query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
31cac13e7c0fc467e865b437f2adc104
Alignment For every nearby boid in the system, calculate the average velocity
[ { "docid": "3f04f968143cdf58cd87d94383c1f65b", "score": "0.74886155", "text": "align(boids) {\n let neighborDist = this.drawingSize * 300;\n let sum = this.p.createVector(0, 0);\n let count = 0;\n for (let i = 0; i < boids.length; i++) {\n let d = p5.Vector.dist(this.position, boids[i].position);\n // if ((d > 0) && (d < neighborDist)) {\n if ((boids[i] !== this) && (d < neighborDist)) {\n sum.add(boids[i].velocity);\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n sum.normalize();\n sum.mult(this.maxspeed);\n let steer = p5.Vector.sub(sum, this.velocity);\n steer.limit(this.maxforce);\n return steer;\n } else {\n return this.p.createVector(0, 0);\n }\n }", "title": "" } ]
[ { "docid": "b5a5469334e72ccf19ac6ae14d4e2281", "score": "0.7268698", "text": "align( boids ) {\n var neighborDist = 150;\n var sum = new Victor();\n var steer = new Victor();\n var count = 0;\n for (var i = 0; i < boids.length; i++) {\n var dist = this.position.distance(boids[i].position);\n if ( dist > 0 && dist < neighborDist ) {\n sum.add(boids[i].velocity);\n count++;\n }\n }\n if (count > 0) {\n sum.divide({x:count,y:count});\n sum.normalize()\n sum.multiply({x:this.maxSpeed,y:this.maxSpeed});\n steer = sum.subtract(this.velocity);\n steer.limitMagnitude(this.maxForce);\n return steer;\n } else {\n return steer;\n }\n }", "title": "" }, { "docid": "768340d88dc5ad2a5a09d6a20bae0258", "score": "0.6832119", "text": "cohesion(birds) {\n let acc = this.p.createVector(0, 0);\n\n if (birds.length === 0) {\n return acc;\n }\n\n birds.forEach((bird) => {\n acc.add(bird.pos);\n });\n\n const avgPos = p5.Vector.div(acc, birds.length);\n const headingToAvgPos = p5.Vector.sub(avgPos, this.pos);\n return headingToAvgPos.normalize();\n }", "title": "" }, { "docid": "c1d71119a6a7865846236caab7ee1f20", "score": "0.68274045", "text": "align(flock) {\n const neighborRange = 60;\n let currBoid;\n const total = new Vector3(0, 0, 0);\n let count = 0;\n // Find total weight for alignment\n for (let i = 0; i < flock.length; i++) {\n currBoid = flock[i];\n const dist = this.position.distanceTo(currBoid.position);\n // Apply force if near enough\n if (dist < neighborRange && dist > 0) {\n total.add(currBoid.velocity);\n count++;\n }\n }\n // Average out total weight\n if (count > 0) {\n total.divideScalar(count);\n total.limit(1);\n }\n return total;\n }", "title": "" }, { "docid": "4217ba63988134ceacb95a34c334e834", "score": "0.66472435", "text": "function matchVelocity(boid) {\n const matchingFactor = 0.05; // Adjust by this % of average velocity\n \n let avgDX = 0;\n let avgDY = 0;\n let numNeighbors = 0;\n \n for (let otherBoid of boids) {\n if (distance(boid, otherBoid) < visualRange) {\n avgDX += otherBoid.dx;\n avgDY += otherBoid.dy;\n numNeighbors += 1;\n }\n }\n \n if (numNeighbors) {\n avgDX = avgDX / numNeighbors;\n avgDY = avgDY / numNeighbors;\n \n boid.dx += (avgDX - boid.dx) * matchingFactor;\n boid.dy += (avgDY - boid.dy) * matchingFactor;\n }\n }", "title": "" }, { "docid": "28abbdbdbcef6c991c351d894be66bb8", "score": "0.66157013", "text": "function Boid(){\n this.location = createVector(random(width), random(height));\n this.velocity = p5.Vector.random2D();\n this.velocity.setMag(random(2, 4));\n this.acceleration = createVector();\n this.maxSpeed = 4;\n // we also have a limit for the force\n this.maxForce = 1;\n \n this.update = function() {\n this.location.add(this.velocity);\n this.velocity.add(this.acceleration);\n this.velocity.limit(this.maxSpeed);\n }\n \n this.display = function() {\n stroke(0);\n fill(10,20,175);\n ellipse(this.location.x,this.location.y,16,16);\n }\n \n this.edges = function() {\n if (this.location.x > width) {\n this.location.x = 0;\n } else if (this.location.x < 0) {\n this.location.x = width;\n }\n \n if (this.location.y > height) {\n this.location.y = 0;\n } else if (this.location.y < 0) {\n this.location.y = height;\n }\n }\n \n // each boid has its own direction, but that direction should be aligned with the average of the directions\n // of all the other boids. But not all, just that ones that are close, because, as we said before,\n // \"AA has a limited ability to perceive its environment\"\n this.align = function(boids){\n let perceptionRadius = 50;\n let steering = createVector(); // this will be the result\n let total = 0;\n // iterate through all the boids and add the velocity to the steering vector\n // IF they are inside the perception Radius\n for (let other of boids) {\n let d = dist(\n this.location.x,\n this.location.y,\n other.location.x,\n other.location.y\n );\n if (other != this && d < perceptionRadius) {\n steering.add(other.velocity);\n total++;\n }\n }\n // average the steering.\n // craig reyonods formula for steering says \"steering force = desired velocity - current velocity\"\n // see 6.3 The Steering Force of https://natureofcode.com/book/chapter-6-autonomous-agents/\n if (total > 0) {\n steering.div(total);\n steering.setMag(this.maxSpeed);\n steering.sub(this.velocity);\n steering.limit(this.maxForce);\n }\n return steering;\n \n }\n \n this.separate = function(){\n \n }\n \n this.cohesion = function(){\n \n }\n // this is where we are going to build our system\n this.flock = function(boids){\n let alignment = this.align(boids);\n this.acceleration.add(alignment);\n }\n }", "title": "" }, { "docid": "3161819e528d6489e8e59b1c03f2e234", "score": "0.65489274", "text": "CalculateAlignment(fishList) {\n var fishCount = 0; // number of other fish in radius; used to calculate average\n var velocity = new THREE.Vector3(0, 0, 0);\n\n // add up the velocities of all neighboring fish\n for (var i = 0; i < fishList.length; i++) {\n if (fishList[i] != this && this.position.distanceTo(fishList[i].position) <= this.radius) {\n velocity.x += fishList[i].velocity.x;\n velocity.y += fishList[i].velocity.y;\n fishCount++;\n }\n }\n\n // calculate average velocity\n if (fishCount > 0) {\n velocity.x = velocity.x / fishCount;\n velocity.y = velocity.y / fishCount;\n velocity.normalize();\n }\n\n return velocity;\n }", "title": "" }, { "docid": "b9e7af2ad58ad3c0b8d4f6fef2a4e338", "score": "0.6493464", "text": "align(birds) {\n let acc = this.p.createVector(0, 0);\n\n birds.forEach((bird) => {\n acc.add(bird.heading);\n });\n\n return acc.normalize();\n }", "title": "" }, { "docid": "6441520db6cfc614faea5cc1314023c5", "score": "0.64267635", "text": "function matchVelocity(boid) {\n\tconst matchingFactor = 0.05; // Adjust by this % of average velocity\n \n\tlet avgDX = 0;\n\tlet avgDY = 0;\n\tlet avgDZ = 0;\n\tlet numNeighbors = 0;\n \n\tfor (let otherBoid of boids) {\n\t if (distance(boid, otherBoid) < VISUAL_RANGE) {\n\t\tavgDX += otherBoid.velocity.x;\n\t\tavgDY += otherBoid.velocity.y;\n\t\tavgDZ += otherBoid.velocity.z;\n\t\tnumNeighbors += 1;\n\t }\n\t}\n \n\tif (numNeighbors) {\n\t avgDX = avgDX / numNeighbors;\n\t avgDY = avgDY / numNeighbors;\n\t avgDZ = avgDZ / numNeighbors;\n \n\t boid.velocity.x += (avgDX - boid.velocity.x) * matchingFactor;\n\t boid.velocity.y += (avgDY - boid.velocity.y) * matchingFactor;\n\t boid.velocity.z += (avgDZ - boid.velocity.z) * matchingFactor;\n\t}\n }", "title": "" }, { "docid": "9a79e2dbad326cb8f1defe53ce1bfcf4", "score": "0.63361025", "text": "_updateCenter () {\n if (!this.boids.length) {\n return;\n }\n const center = new BABYLON.Vector3(0, 0, 0);\n const avgVel = new BABYLON.Vector3(0, 0, 0);\n\n this.boids.forEach((boid) => {\n center.addInPlace(boid.position);\n avgVel.addInPlace(boid.velocity);\n });\n\n center.scaleInPlace(1.0 / this.boids.length);\n avgVel.scaleInPlace(1.0 / this.boids.length);\n\n this.center = center;\n this.avgVel = avgVel;\n }", "title": "" }, { "docid": "3b99208de8916797c9faab2e4dd697e6", "score": "0.62116843", "text": "separate(boids) {\n let desiredSeparation = this.drawingSize * 400;\n let steer = this.p.createVector(0,0);\n let count = 0;\n // check each boid IF there's a boid.\n if (boids && boids.length > 0) {\n for (let i = 0; i < boids.length; i++) {\n let d = p5.Vector.dist(this.position, boids[i].position);\n // if greater than 0 and less than arbitrary amount (0 when you are yourself)\n if ((d > 0) && (d < desiredSeparation)) {\n //calc vect pointing away from neighbor\n let diff = p5.Vector.sub(this.position, boids[i].position);\n diff.normalize();\n // to-do: understand the weight by distance thing better\n diff.div(d) // weight by distance (??)\n steer.add(diff);\n count++;\n }\n }\n }\n // avg - divide by how many\n if (count > 0) {\n steer.div(count);\n }\n // as long as vec is greater than 0\n if (steer.mag() > 0) {\n //implement reynonds: steering = desired - velocity\n steer.normalize();\n steer.mult(this.maxspeed);\n steer.sub(this.velocity);\n steer.limit(this.maxforce);\n }\n return steer;\n }", "title": "" }, { "docid": "93fa868577d715f7b8f338cf59f6956a", "score": "0.62011373", "text": "align(neighbours: Array<Creature>) {\n const sum = new Vector(0, 0);\n let count = 0;\n neighbours.forEach(neighbour => {\n if (neighbour != this && neighbour.maxspeed) {\n sum.add(neighbour.velocity);\n count++;\n }\n });\n if (!count) {\n return sum;\n }\n sum.div(count);\n sum.normalize();\n sum.mul(this.maxspeed);\n\n sum.sub(this.velocity).limit(this.maxspeed);\n\n return sum.limit(0.15);\n }", "title": "" }, { "docid": "d8982070aa26156a992638fa79a85091", "score": "0.61636895", "text": "separate( boids ){\n var sum = new Victor();\n var count = 0;\n for (var j = 0; j < boids.length; j++) {\n \n var desiredSeparation = this.radius + boids[j].radius + ( 25 * this.introversion );\n var sep = this.position.clone().distance(boids[j].position);\n if ( (sep > 0) && (sep < desiredSeparation) ) {\n var thisposition = this.position.clone();\n var diff = thisposition.subtract(boids[j].position);\n diff.normalize();\n diff.divide({x:sep,y:sep});\n sum.add(diff);\n count++;\n }\n }\n if (count > 0) {\n sum.divide({x:count,y:count});\n sum.normalize();\n sum.multiply({x:this.maxSpeed,y:this.maxSpeed});\n sum.subtract(this.velocity);\n sum.limitMagnitude(this.maxForce);\n }\n return sum;\n }", "title": "" }, { "docid": "7bdfbd20e6e85f9b7b4abde0119b664a", "score": "0.61520684", "text": "separate(vehicles) {\n let desiredseparation = this.r * 2;\n let sum = createVector();\n let count = 0;\n // For every boid in the system, check if it's too close\n for (let i = 0; i < vehicles.length; i++) {\n let d = p5.Vector.dist(this.position, vehicles[i].position);\n // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if ((d > 0) && (d < desiredseparation)) {\n // Calculate vector pointing away from neighbor\n let diff = p5.Vector.sub(this.position, vehicles[i].position);\n diff.normalize();\n diff.div(d); // Weight by distance\n sum.add(diff);\n count++; // Keep track of how many\n }\n }\n // Average -- divide by how many\n if (count > 0) {\n sum.div(count);\n // Our desired vector is the average scaled to maximum speed\n sum.normalize();\n sum.mult(this.maxspeed);\n // Implement Reynolds: Steering = Desired - Velocity\n let steer = p5.Vector.sub(sum, this.velocity);\n steer.limit(this.maxforce);\n this.applyForce(steer);\n }\n }", "title": "" }, { "docid": "57f8fb55678477d93608c965f76536f0", "score": "0.61408794", "text": "avgerage(locals) {\n\n if (locals.length < 1) return;\n\n let alignment, cohesion, seperation;\n let total = 0;\n\n if (sliders.alignment > 0) {\n alignment = this.align(locals);\n total++;\n }\n\n if (sliders.cohesion > 0) {\n cohesion = this.cohere(locals);\n total++;\n }\n\n if (sliders.seperation > 0) {\n seperation = this.seperate(locals);\n total++;\n }\n\n if (total === 0) return;\n\n let parameters = [alignment, cohesion, seperation].filter(parameter => parameter !== undefined);\n\n\n let avgVec;\n\n if (total > 1) {\n \n avgVec = parameters.reduce((a, b) => {\n\n let x = a[0] + b[0];\n let y = a[1] + b[1];\n\n return [x, y];\n })\n\n } else {\n avgVec = parameters[0];\n }\n\n let x = avgVec[0] / total;\n let y = avgVec[1] / total;\n\n if (total > 0) { \n this.x.vec = x;\n this.y.vec = y;\n }\n }", "title": "" }, { "docid": "8f595be72ddf594b66d49bd4dfb03002", "score": "0.5977485", "text": "calculateVelocity() {}", "title": "" }, { "docid": "b040c8388c48674744f8d26d57d955c2", "score": "0.5973224", "text": "separation(pack) {\n let perceptionRadius = 100;\n //creates vector\n let steering = createVector();\n let inRangeTotal = 0;\n for (let other of pack) {\n //checks distance with p5 dist function\n let distance = dist(\n this.position.x,\n this.position.y,\n other.position.x,\n other.position.y);\n\n if (other !== this && distance < perceptionRadius) {\n //makes a vector from the other boid to the subject boid\n let difference = p5.Vector.sub(this.position, other.position)\n //reduce strength by dividing by distance\n difference.div(distance);\n //adds boid vecto in to steeringVelocity.\n steering.add(difference);\n inRangeTotal++;\n }\n }\n // defines steeringVector as total / boids.length\n if (inRangeTotal > 0) {\n steering.div(inRangeTotal);\n //sets mag\n steering.setMag(this.maxSpeed * 1.6);\n //subtract current velocity from steering force\n steering.sub(this.velocity);\n //limits force\n steering.limit(this.maxForce);\n }\n return steering;\n }", "title": "" }, { "docid": "23b626f57e46cbcd2f3b0dff404df4b9", "score": "0.59112984", "text": "function FlockCenterOfMass(boids, b)\n{\n var baryCenter = new Point(0, 0);\n for (i in boids)\n {\n if (i != b)\n baryCenter.offset(boids[i].position.x, boids[i].position.y);\n }\n //average it\n baryCenter = baryCenter.scale(1.0/ (boids.length-1));\n \n baryCenter.offset(-boids[b].position.x, -boids[b].position.y);\n \n //small portion\n //baryCenter = baryCenter.scale(0.001);\n \n return baryCenter;\n}", "title": "" }, { "docid": "ac7098b754a433870dc96e4cb62bf288", "score": "0.59068877", "text": "calcAverageMICValues() {\n var sum = 0;\n var keys = Object.keys(this.antibodies);\n //console.log(keys);\n for (var i = 0; i < keys.length; i++) {\n //console.log(antibodies[keys[i]]);\n sum += this.antibodies[keys[i]];\n }\n\n return (sum / keys.length);\n }", "title": "" }, { "docid": "0d22d4868f8732b237e6e7c376d059cb", "score": "0.58044285", "text": "setSteerForce(boids) {\n this.totalAlignForce = alignSlider.value();\n this.totalCohesionForce = cohesionSlider.value();\n this.totalSeparationForce = sepairSlider.value();\n\n\n let avgAlign = createVector(), \n avgCohesion = createVector(), \n avgSepair = createVector(); \n\n let total = 0;\n\n for (let boid of boids) {\n let distance = dist(this.position.x, this.position.y, boid.position.x, boid.position.y);\n if (boid !== this && distance < this.sightRadius) {\n \n \n // alignment\n avgAlign.add(boid.velocity);\n\n // cohesion\n avgCohesion.add(boid.position);\n\n // separation\n let separationForce = p5.Vector.sub(this.position, boid.position);\n separationForce.div(distance);\n avgSepair.add(separationForce);\n\n\n total++;\n }\n }\n\n\n\n let steerForce = createVector();\n\n if (total > 0){\n total = 1;\n avgAlign.div(total);\n\n avgCohesion.div(total);\n avgCohesion.sub(this.position);\n\n avgAlign.setMag(this.totalAlignForce);\n avgCohesion.setMag(this.totalCohesionForce);\n avgSepair.setMag(this.totalSeparationForce);\n\n steerForce.add(avgAlign);\n steerForce.add(avgCohesion);\n steerForce.add(avgSepair);\n \n }\n\n\n // to calculate the steer force, subtract the current velocity (this.velocity) from the\n // desired velocity (steerForce).\n steerForce.sub(this.velocity);\n\n // limiting the vector so the transition can be more soft\n steerForce.limit(this.totalSteerForce);\n\n // TO AVOID WALLS\n //let avoidWall = this.wallAvoidance();\n //steerForce.add(avoidWall);\n\n\n // TO AVOID THE MOUSE\n let avoidMouse = this.mouseAvoidance();\n steerForce.add(avoidMouse);\n\n \n // set the acceleration (or force) of this boid to the desired steer force\n this.acceleration = steerForce;\n\n }", "title": "" }, { "docid": "29f12589014c27344558b302d243e57e", "score": "0.57298964", "text": "avg() {\n let avg = 0;\n for (let a = 0; a < this.size(); a++) {\n avg += this.v[a];\n }\n avg /= this.size();\n return avg;\n }", "title": "" }, { "docid": "d73ae27a1d312e2a2246d98e64a0d647", "score": "0.57116085", "text": "function calculateAlignmentBoundary() {\n\t\tclearCalculationVariables();\n\t\t\n\t\t$('.newAdElement').children().each(function() {\n\t\t\tif ($(this).hasClass('adElementActive') == true) {\n\t\t\t\tleftPosArray.push($(this).position().left);\t\n\t\t\t\ttopPosArray.push($(this).position().top);\t\n\t\n\t\t\t\tif (($(this).position().left + $(this).width()) > farthestRightEdgePos) {\n\t\t\t\t\tfarthestRightEdgePos = $(this).position().left + $(this).width();\t\n\t\t\t\t}\n\t\t\t\tif (($(this).position().top + $(this).height()) > farthestBottomEdgePos) {\n\t\t\t\t\tfarthestBottomEdgePos = $(this).position().top + $(this).height();\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t\t\n\t\tArray.min = function(array){\n\t\t\treturn Math.min.apply(Math, array);\n\t\t};\n\t\t\n\t\tfarthestLeftEdgePos = Array.min(leftPosArray);\n\t\tfarthestTopEdgePos = Array.min(topPosArray);\n\t\t\n\t\talignmentBoundaryCenterPos = ((farthestRightEdgePos - farthestLeftEdgePos) / 2) + farthestLeftEdgePos;\n\t\talignmentBoundaryMiddlePos = ((farthestBottomEdgePos - farthestTopEdgePos) / 2) + farthestTopEdgePos;\n\t}", "title": "" }, { "docid": "188cd5a0097460fa891d2eb00e5996f4", "score": "0.5645539", "text": "function matchVelocity(ant) {\n let avgDX = 0;\n let avgDY = 0;\n let numNeighbors = 0;\n console.log(\"Number of Total Ants :\" + numAnts);\n console.log(\"Number of nearby Ants :\" + numNeighbors);\n console.log(\"X Velocity of Ant :\" + ant.dx);\n console.log(\"Y Velocity of Ant :\" + ant.dy);\n\n for (let otherAnt of ants) {\n if (distance(ant, otherAnt) < visualRange) {\n avgDX += otherAnt.dx;\n avgDY += otherAnt.dy;\n numNeighbors += 1;\n }\n }\n\n if (numNeighbors) {\n avgDX = avgDX / numNeighbors;\n avgDY = avgDY / numNeighbors;\n\n ant.dx += (avgDX - ant.dx) * matchingFactor;\n ant.dy += (avgDY - ant.dy) * matchingFactor;\n }\n}", "title": "" }, { "docid": "8bc861ee992b2cf147211491a78d4912", "score": "0.56068027", "text": "avgElev (){\n\t const toter=volcanoes.length;\n\t const avge=volcanoes.map((Na) =>{\n\t\t return Na.Elevation\n\t }).reduce((max,val) => {\n\t\t return (max + val)/toter\n\t })\n\t console.log(avge)\t \n }", "title": "" }, { "docid": "4811432926e86d8b5e22c0021a9582f6", "score": "0.5571483", "text": "cohesion(boids) {\n let neighbordist = this.drawingSize * 600;\n let sum = this.p.createVector(0, 0); // Start with empty vector to accumulate all locations\n let count = 0;\n for (let i = 0; i < boids.length; i++) {\n let d = this.position.dist(boids[i].position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(boids[i].position); // Add location\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return this.seek(sum); // Steer towards the location\n } else {\n return this.p.createVector(0, 0);\n }\n }", "title": "" }, { "docid": "cbd0146fed4008d708828798774aecab", "score": "0.55605197", "text": "align(locals) {\n if (locals.length < 1 || sliders.alignment === 0) return;\n let avgX = 0, avgY = 0;\n locals.forEach(local => {\n avgX += local.x.vec;\n avgY += local.y.vec;\n })\n\n avgX = avgX / locals.length;\n avgY = avgY / locals.length;\n\n let slideFix = Math.abs(sliders.alignment - 101);\n \n let x = (avgX + this.x.vec) / slideFix;\n let y = (avgY + this.y.vec) / slideFix;\n\n return [x, y];\n }", "title": "" }, { "docid": "f20cffcaa0c4294b46220fc018dd2a1f", "score": "0.55570656", "text": "function zoneGravity() {\n for (var i=0; i<cannonballs.length; i++) {\n var xPos = cannonballs[i].position.x, yPos = cannonballs[i].position.y;\n // var theta = Math.atan((yPos-300)/(xPos - 400));\n // console.log(theta);\n // var distance = Math.pow(Math.pow(xPos - 400, 2) + Math.pow(yPos - 300, 2), 0.5);\n // Body.applyForce(cannonballs[i], {x: xPos, y: yPos}, {x: Math.random()*0.0005, y: Math.random()*0.0005});\n if (xPos < 400 && yPos < 300) {\n // console.log(\"CASE 1: \", theta);\n // Body.applyForce(cannonballs[i], {x: xPos, y: yPos}, {x: 0, y: 0.001});\n Body.setVelocity(cannonballs[i], {x: 0, y: 1});\n\n } else if (xPos < 400 && yPos > 300) {\n // console.log(\"CASE 2: \", theta);\n\n // Body.applyForce(cannonballs[i], {x: xPos, y: yPos}, {x: 0.001, y: 0});\n Body.setVelocity(cannonballs[i], {x: 1, y: 0.0});\n\n\n } else if (xPos > 400 && yPos < 300) {\n // console.log(\"CASE 3: \", theta);\n\n // Body.applyForce(cannonballs[i], {x: xPos, y: yPos}, {x: -0.001, y: 0});\n Body.setVelocity(cannonballs[i], {x: -1, y: 0.0});\n\n\n } else if (xPos > 400 && yPos > 300){\n // console.log(\"CASE 4: \", theta);\n\n // Body.applyForce(cannonballs[i], {x: xPos, y: yPos}, {x: 0, y: -0.001});\n Body.setVelocity(cannonballs[i], {x: 0, y: -1});\n\n\n }\n\n }\n\n }", "title": "" }, { "docid": "b7b116404b61e9f0f8fa2ccfacc803a4", "score": "0.5534581", "text": "function run() {\r\n masses.forEach(function(mass, i) {\r\n masses.forEach(function(other, j) {\r\n if (mass.m != 0 && (i != j)) {\r\n var accel = gforce(mass, other) / mass.m;\r\n var direc = dir(mass, other);\r\n mass.vx += direc.x * accel;\r\n mass.vy += direc.y * accel;\r\n }\r\n });\r\n\r\n if (mass.x < 0 || mass.x > W) {\r\n mass.vx = -mass.vx;\r\n mass.vx = sign(mass.vx) * (Math.pow(Math.abs(mass.vx), WALL_DAMP));\r\n mass.vy = sign(mass.vy) * (Math.pow(Math.abs(mass.vy), WALL_DAMP));\r\n if (mass.x < 0) {\r\n mass.x = 0;\r\n }\r\n else {\r\n mass.x = W;\r\n }\r\n }\r\n if (mass.y < 0 || mass.y > H) {\r\n mass.vy = -mass.vy;\r\n mass.vx = sign(mass.vx) * (Math.pow(Math.abs(mass.vx), WALL_DAMP));\r\n mass.vy = sign(mass.vy) * (Math.pow(Math.abs(mass.vy), WALL_DAMP));\r\n if (mass.y < 0) {\r\n mass.y = 0;\r\n }\r\n else {\r\n mass.y = H;\r\n }\r\n }\r\n\r\n mass.x += mass.vx;\r\n mass.y += mass.vy;\r\n\r\n if (isMouseDown) {\r\n masses[amt] = {\r\n x: mouseX,\r\n y: mouseY,\r\n m: MOUSE_POWER,\r\n vx: 0,\r\n vy: 0,\r\n real: false\r\n };\r\n }\r\n else {\r\n masses[amt].m = 0;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "3aba40252d916aacfa8993ecddce06fb", "score": "0.5513685", "text": "function ruleMatchVelOfNeighboors(b, index){\n\t\tvar c = {\n\t\t\tx: 0,\n\t\t\ty: 0\n\t\t}\n\t\tcLength = 0;\n\n\t\tfor (var i = boids.length - 1; i >= 0; i--) {\n\t\t\tif (i === index) continue;\n\t\t\t\n\t\t\tvar n = boids[i];\n\t\t\tvar distance = Math.sqrt(\n\t\t\t\tMath.pow(n.pos.x - b.pos.x, 2) +\n\t\t\t\tMath.pow(n.pos.y - b.pos.y, 2)\n\t\t\t);\n\n\t\t\tif (distance < 60) {\n\t\t\t\tcLength++;\n\t\t\t\tc.x += n.vel.x;\n\t\t\t\tc.y += n.vel.y;\n\t\t\t};\n\t\t};\n\n\t\tif (cLength > 0) {\n\t\t\tc.x /= cLength;\n\t\t\tc.y /= cLength;\n\t\t};\n\n\t\tc.x /= 32;\n\t\tc.y /= 32;\n\t\t\n\t\treturn c;\n\t}", "title": "" }, { "docid": "9f85633d7919fe6cc8a8779cd2e7636d", "score": "0.54937017", "text": "getPoints() {\n const avg = [];\n\n let previousAnchor;\n for (let i = 1; i < this.anchors.length; i++) {\n previousAnchor = this.anchors[i - 1];\n let x = (previousAnchor.x + this.anchors[i].x) / 2;\n let y = (previousAnchor.y + this.anchors[i].y) / 2;\n avg.push({ x, y });\n }\n // close\n let x = (this.anchors[0].x + this.anchors[this.anchors.length - 1].x) / 2;\n let y = (this.anchors[0].y + this.anchors[this.anchors.length - 1].y) / 2;\n avg.push({ x, y });\n return avg;\n }", "title": "" }, { "docid": "9f85633d7919fe6cc8a8779cd2e7636d", "score": "0.54937017", "text": "getPoints() {\n const avg = [];\n\n let previousAnchor;\n for (let i = 1; i < this.anchors.length; i++) {\n previousAnchor = this.anchors[i - 1];\n let x = (previousAnchor.x + this.anchors[i].x) / 2;\n let y = (previousAnchor.y + this.anchors[i].y) / 2;\n avg.push({ x, y });\n }\n // close\n let x = (this.anchors[0].x + this.anchors[this.anchors.length - 1].x) / 2;\n let y = (this.anchors[0].y + this.anchors[this.anchors.length - 1].y) / 2;\n avg.push({ x, y });\n return avg;\n }", "title": "" }, { "docid": "34b61c996b8e3e98b5790757f681a100", "score": "0.5472139", "text": "computeBehaviors() {\n this.separation = [0, 0];\n this.cohesion = [0, 0];\n this.alignment = [0, 0];\n\n var avg_velocity = 0;\n\n var count = 0;\n var sep_count = 0;\n\n // iterate through all fish\n // TODO: if time, increase efficiency by partitioning the space so that you don't\n // have to look through all fish, only the ones in its bounding box\n for (var i = 0; i < NUM_FISH; i++) {\n var fish = ALL_FISH[i];\n if (this === fish) {\n // do nothing\n } else {\n if (this.inView(fish) && this.inTank(fish.pos)) {\n var diff_pos = math.subtract(fish.pos, this.pos);\n\n // compute cohesion and alignment for fish that are visible\n this.cohesion = math.add(this.cohesion, diff_pos);\n this.alignment = math.add(this.alignment, fish.dir);\n avg_velocity += fish.velocity;\n count++;\n\n if (math.norm(diff_pos) <= SEPARATION_FACTOR) {\n // apply separation, steer AWAY from the neighbor\n\n var weight = 3 * (SEPARATION_FACTOR - math.norm(diff_pos)); // smaller distance will have more weight\n var reversed = math.subtract(0, diff_pos);\n this.separation = math.add(this.separation, reversed);\n this.separation = math.multiply(weight, this.separation);\n\n sep_count++;\n }\n }\n }\n }\n\n if (count > 0) {\n this.alignment = math.multiply(1 / count, this.alignment);\n this.cohesion = math.multiply(1 / count, this.cohesion); // average position it should eventually end up in\n\n this.velocity = avg_velocity / count;\n\n if (\n math.norm(this.cohesion) >\n this.pos + math.multiply(this.velocity, 10)\n ) {\n this.velocity += this.acceleration; // speed up\n }\n\n if (sep_count > 0) {\n this.separation[0] /= count;\n this.separation[1] /= count;\n }\n\n this.alignment = Utils.unit(this.alignment);\n this.cohesion = Utils.unit(this.cohesion);\n this.separation = Utils.unit(this.separation);\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "621d3116a8a23791040e2c837a88b2f7", "score": "0.5471693", "text": "calc_mean() {\n for (let i = 0; i < this.l.length; i++) {\n let e = this.l[i];\n\n let data = e.data;\n for (let r = 0; r < data.length; r++) {\n for (let c = 0; c < this.no_attr; c++) {\n e.mean[c] += data[r][c];\n }\n }\n for (let c = 0; c < this.no_attr; c++) {\n e.mean[c] /= data.length;\n }\n }\n }", "title": "" }, { "docid": "7b27a385c0be11df8f783adc75244bb1", "score": "0.5469204", "text": "calculateMass(){\n var m = this.solute.getMass();\n let solvs = this.solvents;\n for(var i = 0; i < solvs.length; i++){\n m += solvs[i].getMass();\n }\n return m;\n }", "title": "" }, { "docid": "b0866b810f82f67d57e40d3fa593afce", "score": "0.5466314", "text": "update(dt) {\n // State is [angle1, angle2, angular velocity 1, angular velocity 2]\n let denom = 2 * this.mass1 + this.mass2 - this.mass2 * Math.cos(2 * (this.angle1 - this.angle2));\n let changeFunction = state => [\n state[2],\n state[3],\n (-this.gravity * (2 * this.mass1 + this.mass2) * Math.sin(state[0])\n - this.mass2 * this.gravity * Math.sin(state[0] - 2 * state[1])\n - 2 * Math.sin(state[0] - state[1]) * this.mass2 \n * (state[2] * state[2] * this.length2 + state[3] * state[3] * this.length1 * Math.cos(state[0] - state[1])))\n / (this.length1 * denom),\n 2 * Math.sin(state[0] - state[1]) *\n (state[2] * state[2] * this.length1 * (this.mass1 + this.mass2)\n + this.gravity * (this.mass1 + this.mass2) * Math.cos(state[0])\n + state[3] * state[3] * this.length2 * this.mass2 * Math.cos(state[0] - state[1]))\n / (this.length2 * denom)\n ];\n let state = rk4(changeFunction, [this.angle1, this.angle2, this.angularVelocity1, this.angularVelocity2], dt);\n this.angle1 = state[0];\n this.angle2 = state[1];\n this.angularVelocity1 = state[2];\n this.angularVelocity2 = state[3];\n }", "title": "" }, { "docid": "fb0a62099b87b8b4bdae04975086242f", "score": "0.54479384", "text": "update() {\n\n this.bounce = this.p.getBounceMode();\n let gm = this.p.getGravityMode();\n\n if (gm === GravityMode.OFF) {\n\n this.acceleration.set(0, 0);\n\n } else if (gm === GravityMode.SIMPLE) {\n let gravityPoint = this.p.getGravityPoint();\n this.gravity = 1;\n\n this.acceleration.set(p5.Vector.sub(gravityPoint, this.pos).setMag(this.gravity));\n\n } else if (gm === GravityMode.MULTI_POINT) {\n let gravForces = [];\n\n this.p.getGravityList().forEach(gravityVector => {\n let gravDist = this.pos.dist(gravityVector);\n\n if (gravDist > this.p.sqrt(this.GRAVITY_CONST)) {\n this.gravity = this.GRAVITY_CONST / this.p.sq(this.gravDist);\n } else {\n this.gravity = 1;\n }\n\n gravForces.push(p5.Vector.sub(gravityVector, this.pos).setMag(this.gravity));\n });\n\n this.acceleration.set(0, 0);\n\n gravForces.forEach(forceVector => {\n this.acceleration.add(forceVector);\n });\n } else {\n let gravityPoint = this.p.getGravityPoint();\n let gravDist = this.pos.dist(gravityPoint);\n\n if (gravDist > this.p.sqrt(this.GRAVITY_CONST)) {\n this.gravity = this.GRAVITY_CONST / this.p.sq(gravDist);\n } else {\n this.gravity = 1;\n }\n\n this.acceleration.set(p5.Vector.sub(gravityPoint, this.pos).setMag(this.gravity));\n }\n\n this.velocity.add(this.acceleration);\n\n if (this.p.getGravityMode() !== GravityMode.OFF) {\n this.velocity.mult(this.p.getDecay());\n }\n\n // Update location based on heading\n\n this.pos.add(this.velocity.copy().mult(this.p.deltaTime * this.p.PHYSICS_SCALAR));\n\n if (this.bounce) {\n if (this.pos.x < 0 + this.RADIUS + this.p.getBorderWeight()) {\n this.velocity.x *= -1;\n this.pos.x = 0 + this.RADIUS + this.p.getBorderWeight();\n } else if (this.pos.x > this.p.width - this.RADIUS - this.p.getBorderWeight()) {\n this.velocity.x *= -1;\n this.pos.x = this.p.width - this.RADIUS - this.p.getBorderWeight();\n }\n if (this.pos.y < 0 + this.RADIUS + this.p.getBorderWeight()) {\n this.velocity.y *= -1;\n this.pos.y = 0 + this.RADIUS + this.p.getBorderWeight();\n } else if (this.pos.y > this.p.height - this.RADIUS - this.p.getBorderWeight()) {\n this.velocity.y *= -1;\n this.pos.y = this.p.height - this.RADIUS - this.p.getBorderWeight();\n }\n } else {\n if (this.pos.x < 0 - this.RADIUS) {\n this.markedForDelete = true;\n } else if (this.pos.x > this.p.width + this.RADIUS) {\n this.markedForDelete = true;\n }\n if (this.pos.y < 0 - this.RADIUS) {\n this.markedForDelete = true;\n } else if (this.pos.y > this.p.height + this.RADIUS) {\n this.markedForDelete = true;\n }\n }\n }", "title": "" }, { "docid": "0d7f9062d05a8415c49a08d3d8adeede", "score": "0.5426095", "text": "collideWith(asteroid) {\n if(collideCircleCircle(this.x, this.y, this.radius*2, asteroid.x, asteroid.y, asteroid.radius*2)) {\n let yDiff = this.y - asteroid.y;\n let xDiff = this.x - asteroid.x;\n let magnitudeVels = sqrt(this.xVel**2 + this.yVel**2);\n let magnitudeDiff = sqrt(xDiff**2 + yDiff**2);\n let xAdded = this.xVel + xDiff * (magnitudeVels/magnitudeDiff);\n let yAdded = this.yVel + yDiff * (magnitudeVels/magnitudeDiff);\n let magnitudeAdded = sqrt(xAdded**2 + yAdded**2);\n \n this.xVel = xAdded * (magnitudeVels/magnitudeAdded);\n this.yVel = yAdded * (magnitudeVels/magnitudeAdded);\n }\n }", "title": "" }, { "docid": "d024bdb033c29c33180f8a2d7c4a88f3", "score": "0.5393823", "text": "normalize() {\n const size = Math.sqrt(this.vx * this.vx + this.vy * this.vy);\n\n if (size) {\n this.vx /= size;\n this.vy /= size;\n }\n\n return size;\n }", "title": "" }, { "docid": "68d1a95d80bc0f66a46023bf03b2bffc", "score": "0.5390517", "text": "function adjustGravity() {\n\t\tvar gx = 0;\n\t\tvar gy = 0;\n\t\t\n\t\tvertices.forEach(function(element){\n\t\t\tgx += element.x;\n\t\t\tgy += element.y;\n\t\t});\n\t\tgx = gx / nNodes;\n\t\tgy = gy / nNodes;\n\t\tvar diffx = width / 2 - gx;\n\t\tvar diffy = height / 2 - gy;\n\n\t\tvertices.forEach(function(element){\n\t\t\telement.x = element.x + diffx;\n\t\t\telement.y = element.y + diffy;\n\t\t});\n\t}", "title": "" }, { "docid": "3cea00d1921db21d21b71fa751e56a02", "score": "0.5361745", "text": "think() {\n\t\tconst heightLowerLeftLeg = this.lowerLeftLeg.position.y / width;\n\t\tconst heightUpperLeftLeg = this.upperLeftLeg.position.y / width;\n\t\tconst heightLowerRighttLeg = this.lowerRightLeg.position.y / width;\n\t\tconst heightUpperRightLeg = this.upperRightLeg.position.y / width;\n\t\tconst heightBackbone = this.backbone.position.y / width;\n\n\t\tconst angleLowerLeftLeg = this.lowerLeftLeg.angle;\n\t\tconst angleUpperLeftLeg = this.upperLeftLeg.angle;\n\t\tconst angleLowerRighttLeg = this.lowerRightLeg.angle;\n\t\tconst angleUpperRightLeg = this.upperRightLeg.angle;\n\t\tconst angleBackbone = this.backbone.angle;\n\n\t\tconst vxLowerLeftLeg = this.lowerLeftLeg.velocity.x;\n\t\tconst vxUpperLeftLeg = this.upperLeftLeg.velocity.x;\n\t\tconst vxLowerRighttLeg = this.lowerRightLeg.velocity.x;\n\t\tconst vxUpperRightLeg = this.upperRightLeg.velocity.x;\n\t\tconst vxBackbone = this.backbone.velocity.x;\n\n\t\tconst vyLowerLeftLeg = this.lowerLeftLeg.velocity.y;\n\t\tconst vyUpperLeftLeg = this.upperLeftLeg.velocity.y;\n\t\tconst vyLowerRightLeg = this.lowerRightLeg.velocity.y;\n\t\tconst vyUpperRightLeg = this.upperRightLeg.velocity.y;\n\t\tconst vyBackbone = this.backbone.velocity.y;\n\n\t\tconst result = this.brain.predict([\n\t\t\theightLowerLeftLeg,\n\t\t\theightUpperLeftLeg,\n\t\t\theightLowerRighttLeg,\n\t\t\theightUpperRightLeg,\n\t\t\theightBackbone,\n\t\t\tangleLowerLeftLeg,\n\t\t\tangleUpperLeftLeg,\n\t\t\tangleLowerRighttLeg,\n\t\t\tangleUpperRightLeg,\n\t\t\tangleBackbone,\n\t\t\tvxLowerLeftLeg,\n\t\t\tvxUpperLeftLeg,\n\t\t\tvxLowerRighttLeg,\n\t\t\tvxUpperRightLeg,\n\t\t\tvxBackbone,\n\t\t\tvyLowerLeftLeg,\n\t\t\tvyUpperLeftLeg,\n\t\t\tvyLowerRightLeg,\n\t\t\tvyUpperRightLeg,\n\t\t\tvyBackbone,\n\t\t]);\n\n\t\t// Move Muscles\n\t\tconst leftMuscleShift = result[0] <= 0.5 ? 2 : -2;\n\t\tconst rightMuscleShift = result[1] <= 0.5 ? 2 : -2;\n\t\tconst bodyLeftLegShift = result[2] <= 0.5 ? 2 : -2;\n\t\tconst bodyRightLegShift = result[3] <= 0.5 ? 2 : -2;\n\t\tconst leftHandShift = result[4] <= 0.5 ? 2 : -2;\n\t\tconst rightHandShift = result[5] <= 0.5 ? 1 : -1;\n\n\t\tif (this.leftMuscle.length + leftMuscleShift <= 45 && this.leftMuscle.length + leftMuscleShift >= 25)\n\t\t\tthis.leftMuscle.length += leftMuscleShift;\n\t\tif (this.rightMuscle.length + rightMuscleShift <= 45 && this.rightMuscle.length + rightMuscleShift >= 25)\n\t\t\tthis.rightMuscle.length += rightMuscleShift;\n\t\tif (this.bodyLeftLegMuscle.length + bodyLeftLegShift <= 60 && this.bodyLeftLegMuscle.length + bodyLeftLegShift >= 30)\n\t\t\tthis.bodyLeftLegMuscle.length += bodyLeftLegShift;\n\t\tif (this.bodyRightLegMuscle.length + bodyRightLegShift <= 60 && this.bodyRightLegMuscle.length + bodyRightLegShift >= 30)\n\t\t\tthis.bodyRightLegMuscle.length += bodyRightLegShift;\n\t\tif (this.leftHandMuscle.length + leftHandShift <= 35 && this.leftHandMuscle.length + leftHandShift >= 20)\n\t\t\tthis.leftHandMuscle.length += leftHandShift;\n\t\tif (this.rightHandMuscle.length + rightHandShift <= 35 && this.rightHandMuscle.length + rightHandShift >= 20)\n\t\t\tthis.rightHandMuscle.length += rightHandShift;\n\t\t// Adjust Score\n\t\tthis.adjustScore()\n\t}", "title": "" }, { "docid": "5c0b456ffffa681322b3301ffd9e00b6", "score": "0.5347758", "text": "function moveBody() {\n\n // XZ position: move towards target point \n var direction = new THREE.Vector3(); \n direction.subVectors(targetWalkingPos, ghostBody.position);\n direction.y = 0; \n\n cyclePos += deltaTime; \n if(cyclePos > bodyParams.cycleLength) cyclePos -= bodyParams.cycleLength; \n\n if(direction.length() > distanceError){\n direction.normalize(); \n direction.multiplyScalar(bodyParams.walkSpeed * deltaTime);\n \n //rotate towards target\n var angle = ghostBody.rotation.y - targetWalkingAngle; \n\n //get angle between 0 and 2PI\n while(angle < 0) angle = Math.PI * 2 + angle; \n while(angle > Math.PI * 2) angle = angle - Math.PI * 2; \n //choose shorter direction \n if(angle > Math.PI) angle = Math.PI * 2 - angle; \n\n if(Math.abs(angle) > rotationError) {\n ghostBody.rotation.y += walkingRotationDirection * bodyParams.rotateSpeed * deltaTime;\n currentBody.userData.rootBone.rotation.y += walkingRotationDirection * bodyParams.rotateSpeed * deltaTime;\n //move slightly slower if you're rotating\n direction.multiplyScalar(.5);\n }\n\n else {\n ghostBody.rotation.y = targetWalkingAngle;\n currentBody.userData.rootBone.rotation.y = targetWalkingAngle;\n\n }\n ghostBody.position.add(direction); \n\n }\n else {\n currentBody.userData.walking = false; \n }\n\n // Y position: average leg position + offset \n //rset average\n avg.multiplyScalar(0); \n for(var i = 0; i < legs.length; i++) {\n legs[i].userData.ikTarget.getWorldPosition(worldPos); \n avg.add(worldPos);\n var offset = legs[i].userData.stepOffset.clone(); \n offset.applyAxisAngle(upVector, currentBody.userData.rootBone.rotation.y);\n avg.sub(offset);\n }\n\n\n var bones = currentBody.userData.bones;\n //rotate individual bones based on their connected legs \n for(var i = 1; i < bones.length - 1; i++) {\n //reset vectors\n rPos.multiplyScalar(0); \n lPos.multiplyScalar(0); \n //compare the left and right legs, if there are any. \n if( bones[i].userData.attachPoints && bones[i].userData.attachPoints.length == 2) {\n if(bones[i].userData.attachPoints[0].userData.leg) {\n bones[i].userData.attachPoints[0].userData.leg.userData.ikTarget.getWorldPosition(rPos); \n rPos.applyAxisAngle(upVector, -currentBody.userData.rootBone.rotation.y);\n }\n if(bones[i].userData.attachPoints[1].userData.leg) {\n bones[i].userData.attachPoints[1].userData.leg.userData.ikTarget.getWorldPosition(lPos); \n lPos.applyAxisAngle(upVector, -currentBody.userData.rootBone.rotation.y);\n }\n diff.subVectors(rPos, lPos); \n // if(Math.abs(rPos.x - ) > .1) console.log(\"x diff\");\n if(Math.abs(diff.y) > .1 && i >= 2) {\n bones[i-1].rotation.y = -diff.y * .1; \n // console.log(\"y diff\");\n }\n }\n }\n \n // //compare with the legs behind this \n // if( bones[i-1].userData.attachPoints && bones[i-1].userData.attachPoints.length == 2) {\n // if(bones[i-1].userData.attachPoints[0].userData.leg) {\n // bones[i-1].userData.attachPoints[0].userData.leg.userData.ikTarget.getWorldPosition(rPos); \n // rPos2.applyAxisAngle(upVector, -currentBody.userData.rootBone.rotation.y);\n // }\n // if(bones[i-1].userData.attachPoints[1].userData.leg) {\n // bones[i-1].userData.attachPoints[1].userData.leg.userData.ikTarget.getWorldPosition(lPos); \n // lPos2.applyAxisAngle(upVector, -currentBody.userData.rootBone.rotation.y);\n // }\n // var xDiff = rPos.x + lPos.x - lPos2.x - rPos2.x; \n // var yDiff = rPos.y + lPos.y - lPos2.y - rPos2.y; \n // bones[i-1].rotation.z = -Math.atan2(yDiff, xDiff) * .021; \n\n // }\n\n \n // }\n\n avg.divideScalar(legs.length); \n currentBody.userData.rootBone.position.set(avg.x, avg.y, avg.z);\n\n //TO DO: get body rotation as an averageof leg stuff. Make it work for terrain. \n\n}", "title": "" }, { "docid": "37ba4424243301dd768cee35df13c8db", "score": "0.53461355", "text": "function accelerationFromGravity(b1, b2) {\n const dx = b2.x - b1.x;\n const dy = b2.y - b1.y;\n const r = Math.sqrt(dy * dy + dx * dx);\n const a = G * b2.mass / (r * r);\n return [a * dx / r, a * dy / r];\n}", "title": "" }, { "docid": "08370eb1398075b106e0123b19aa3dd7", "score": "0.53442436", "text": "function averageForBdist(d, w = 10) {\n let sum1 = 0, sum2 = 0, n = 0;\n for (let dd = Math.max(1, d-w); dd <= d+w; dd++) {\n for (let x = 0; x < gnumInstances - dd; x++) {\n let y = x + dd;\n sum1 += valueArray[y * gnumInstances1 + x];\n sum2 += valueArray[x * gnumInstances1 + y + 1];\n n++;\n }\n }\n return [sum1/n, sum2/n];\n}", "title": "" }, { "docid": "568a5f7db0790c66879cd0715dc02e22", "score": "0.53429705", "text": "area(v) {\n return this.wedge(v) / 2;\n }", "title": "" }, { "docid": "0ca8e96375d58a6860e2af267a182fd4", "score": "0.5331007", "text": "function combine({v, dirs,dws, vels,vws, accs,aws, vdMax,aMax}) {\n\tvdMax = vdMax || 1;\n\taMax = aMax || 1;\n\t//Use only copies of the arrays that might be modified:\n\tif (vels) vels = vels.slice();\n\tif (vws) vws = vws.slice();\n\tif (accs) accs = accs.slice();\n\tif (aws) aws = aws.slice();\n\t\n\tif (dirs && dws) {\n\t\tlet velAvgDir = scale(averageVector(dirs,dws) || [0,0], vdMax);\n\t\tlet WD = 0;\n\t\tfor (let i = 0; i < dws.length; i++) { \n\t\t\tif (dirs[i] !== null) WD += dws[i] || 0;\n\t\t}\n\t\tif (!vels) {\n\t\t\tvels = [];\n\t\t\tvws = [];\n\t\t}\n\t\tvels.push(velAvgDir);\n\t\tvws.push(WD);\n\t}\n\t\n\tif (vels && vws) {\n\t\tlet avgVel = averageVector(vels,vws) || [0,0];\n\t\tlet WV = 0;\n\t\tfor (let i = 0; i < vws.length; i++) { \n\t\t\tif (vels[i] !== null) WV += vws[i] || 0;\n\t\t}\n\t\tif (!accs) {\n\t\t\taccs = [];\n\t\t\taws = [];\n\t\t}\n\t\taccs.push(velToAcc(v, avgVel, aMax));\n\t\taws.push(WV);\n\t}\n\t\n\tlet a = averageVector(accs,aws);\n\tif (a===null) return null;\n\treturn clampLength(a, aMax);\n}", "title": "" }, { "docid": "8023dd41616684fe892a3e2e940a5678", "score": "0.528977", "text": "function averagerect(lx, hx, ly, hy) {\n if (lx === undefined) {\n const r = vps[3].r;\n lx = bp2i(r.x);\n hx = bp2i(r.y);\n ly = bp2i(r.z);\n hy = bp2i(r.w);\n if (r.z === -1) {\n ly = lx;\n hy = hx;\n }\n }\n let sum1 = 0, sum2 = 0, n = 0;\n for (let x = lx; x <= hx; x++) {\n for (let y= Math.max(x+1, ly); y <= hy; y++) {\n sum1 += valueArray[y * gnumInstances1 + x];\n sum2 += valueArray[x * gnumInstances1 + y + 1];\n n++;\n }\n }\n return [sum1/n, sum2/n];\n}", "title": "" }, { "docid": "f3c92103525242e8d8f824307d3f1a75", "score": "0.5261455", "text": "function getHannIndices(aVelData) //Splits the Hann windowing into parts, where the change (angular velocity) is fast the windows are smaller (indices closer together) and where it is slow the windows are larger TODO: No drift term yet, incorrect algorithm implemented\n{\n let indices = [];\n indices.push(0); //the first index is always 0\n let gyroDataArray = [];\n aVelData.forEach(function(entry) {\n let gyroData = (({ x, y, z }) => ({ x, y, z }))(entry); //only select x,y,z\n gyroDataArray.push(gyroData);\n });\n let testStatistic1Sum = 0; //Sum to track the amount of movement that has happened since the last index\n let testStatistic2Sum = 0; //Sum to track the amount of movement that has happened since the last index\n let magnitudesUntilNow = [];\n for(let i=1; i<gyroDataArray.length; i++)\n {\n let distanceMeasure1 = 0;\n let distanceMeasure2 = 0;\n let testStatistic1 = 0;\n let testStatistic2 = 0;\n let magnitude = Math.sqrt(gyroDataArray[i].x * gyroDataArray[i].x + gyroDataArray[i].y * gyroDataArray[i].y + gyroDataArray[i].z * gyroDataArray[i].z);\n magnitudesUntilNow.push(magnitude);\n let lsEstimation = magnitudesUntilNow => magnitudesUntilNow.reduce( ( p, c ) => p + c, 0 ) / magnitudesUntilNow.length; //average of magnitudes until now\n if(i > 0)\n {\n let magnitudePrev = Math.sqrt(gyroDataArray[i-1].x * gyroDataArray[i-1].x + gyroDataArray[i-1].y * gyroDataArray[i-1].y + gyroDataArray[i-1].z * gyroDataArray[i-1].z);\n distanceMeasure1 = magnitude - magnitudePrev;\n distanceMeasure2 = -magnitude + magnitudePrev;\n }\n else\n {\n distanceMeasure1 = magnitude - lsEstimation;\n distanceMeasure2 = -magnitude + lsEstimation;\n }\n if(i > 0)\n {\n let testStatistic1Prev = testStatistic1; //store previous value\n let testStatistic2Prev = testStatistic2; //store previous value\n testStatistic1 = Math.max(testStatistic1Prev + distanceMeasure1 - mu, 0);\n testStatistic2 = Math.max(testStatistic2Prev + distanceMeasure2 - mu, 0);\n }\n else\n {\n testStatistic1 = Math.max(distanceMeasure1 - mu, 0);\n testStatistic2 = Math.max(distanceMeasure2 - mu, 0);\n }\n testStatistic1Sum = testStatistic1Sum + testStatistic1;\n testStatistic2Sum = testStatistic2Sum + testStatistic2;\n console.log(testStatistic1Sum, testStatistic1Sum); \n if(testStatistic1Sum > 5 && i > 0) //Cannot push 0 twice!\n {\n indices.push(i);\n //lsEstimation = 0;\n testStatistic1Sum = 0;\n testStatistic2Sum = 0;\n magnitudesUntilNow = [];\n }\n }\n if(indices[indices.length-1] !== gyroDataArray.length-1)\n { \n indices.push(gyroDataArray.length-1); //last index is always the index of the last element\n }\n return indices;\n}", "title": "" }, { "docid": "10c14d5cb016ff88de4a0421e2ab2ba5", "score": "0.5240524", "text": "cohesion( boids ) {\n var neighborDist = 50;\n var sum = new Victor();\n var count = 0;\n for (var i = 0; i < boids.length; i++) {\n var dist = this.position.distance(boids[i].position);\n if ( dist > 0 && dist < neighborDist ) {\n sum.add(boids[i].position);\n count++;\n }\n }\n if (count > 0) {\n sum.divide({x: count,y:count});\n return this.seek(sum);\n } else {\n return sum;\n }\n }", "title": "" }, { "docid": "573fe825076ea12b9542beeff920fa37", "score": "0.5238089", "text": "getOccupiedVolume() {\n /* outerReducer: combine the sums of each inner array in the 2d array */\n const outerReducer = (totalVolume, row) => ( row.reduce(innerReducer,0) + totalVolume )\n /* innerReducer: add all the numbers in an array */\n const innerReducer = (totalVol, cell) => ( cell + totalVol )\n return this.heights.reduce(outerReducer,0);\n }", "title": "" }, { "docid": "a5ff082aa12acc0108edf26561b21b0f", "score": "0.52332455", "text": "function Boost(_xPos1, _yPos1, _xPos2, _yPos2) {\n this.startPos = createVector(_xPos1, _yPos1);\n this.endPos = createVector(_xPos2, _yPos2);\n this.angle; //this should be the angle dervived from the vector to rotate the rect \n \n //somewhere along here i need to create normalised vector in the direction of point 1 to point 2\n //this can then be scaled accordingly and the force can be applied to the mover if collided with\n //this could be displayed nicely if at a perp of the objects vector, a line ran up the arrow to display the forces direction.\n}", "title": "" }, { "docid": "560e84c85027b4b11bb9d9bc3ef43895", "score": "0.52317095", "text": "collisionImpact(pods) {\n\t for (var i in pods) {\n\t var pod = pods[i];\n\t var collisionDistance = this.position.add(this.velocity).add(this.orientation).distance(pod.position.add(pod.velocity).add(pod.orientation));\n\t if (collisionDistance < 800) {\n\t var impact = (this.velocityValue + pod.velocityValue) / 1000 * Math.abs(this.velocity.angleTo(pod.velocity)) / 45;\n\t (0, _log.traceJSON)(`Collision distance: ${ collisionDistance } impact ${ impact }`, pod, _log._TRACE);\n\t this.collisions[pod.id] = this.collisions[pod.id] ? this.collisions[pod.id] + 1 : 1;\n\t if (this.collisions[pod.id] > 2) {\n\t (0, _log.traceJSON)(\"RED ALERT!!! Avoid \", pod, _log._TRACE);\n\t this.avoidEnemy(pod);\n\t }\n\t return impact;\n\t }\n\t }\n\t return 0;\n\t }", "title": "" }, { "docid": "2fcf6e7eb638c04d55c8ec8964d7ea88", "score": "0.52278817", "text": "function astronomyCalculation() {\n \n var day = Astronomy.DayValue(_datetime);\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i].astronomy_body;\n var c = body.GeocentricCoordinates(day); //https://en.wikipedia.org/wiki/Astronomical_unit\n var coordinates = new THREE.Vector3(c.x, c.y, c.z);\n coordinates.multiplyScalar(AU_TO_WORLD_UNITS);\n coordinates = equatorialToEclipticPlane(coordinates);\n\n var scene_object_pos = bodies[i].scene_object.position;\n scene_object_pos.x = coordinates.x;\n scene_object_pos.y = coordinates.z; // ATTENTION FLIP\n scene_object_pos.z = coordinates.y;\n\n if (body.Name == \"Sun\") {\n sun_light.position.x = scene_object_pos.x;\n sun_light.position.y = scene_object_pos.y;\n sun_light.position.z = scene_object_pos.z;\n }\n }\n}", "title": "" }, { "docid": "488728b8de81389b9a13d2f40e3d042e", "score": "0.52190727", "text": "separate(flock) {\n const minRange = 200;\n let currBoid;\n const total = new Vector3(0, 0, 0);\n let count = 0;\n // Find total weight of separation\n for (let i = 0; i < flock.length; i++) {\n currBoid = flock[i];\n const dist = this.position.distanceTo(currBoid.position) * 3;\n // Apply weight if too close\n if (dist < minRange && dist > 0) {\n const force = this.position.clone();\n force.sub(currBoid.position);\n force.normalize();\n force.divideScalar(dist);\n total.add(force);\n count++;\n }\n }\n // Average out total weight\n if (count > 0) {\n total.divideScalar(count);\n total.normalize();\n }\n return total;\n }", "title": "" }, { "docid": "f9b8a4721568a739ff9bcf895cc1f3e0", "score": "0.5211496", "text": "calculateTrend() {\n // average vector\n let sum = math.zeros(4, 4).toArray();\n\n for (let pose of this.poseHistory) {\n math.forEach(pose.pose.T.toArray(), (value, index, matrix) => {\n sum[index[0]][index[1]] += value\n })\n }\n\n let avg = math.zeros(4, 4).toArray();\n math.forEach(sum, (value, index, matrix) => {\n avg[index[0]][index[1]] = value / this.poseHistory.length;\n })\n return avg;\n }", "title": "" }, { "docid": "e04d11fc090ecf13485095a414c8d08f", "score": "0.52019274", "text": "function averageVAD(endPos) {\n // some averaging\n let startFrame = endPos - RECORD_SIZE_FRAMING;\n if (startFrame < 0) {\n startFrame = RB_SIZE_FRAMING + startFrame;\n }\n\n // check for voice activity\n let curpos = startFrame;\n let size = 0;\n // likely that the last vad is not yet calculated\n for (let idx = 0; idx < RECORD_SIZE_FRAMING; idx++) {\n VAD_AVERAGE += VAD_RESULT[curpos];\n curpos++;\n size++;\n if (curpos >= RB_SIZE_FRAMING) {\n curpos = 0;\n }\n if (curpos == VAD_LAST_POS) {\n break;\n }\n }\n VAD_AVERAGE /= size;\n}", "title": "" }, { "docid": "8db2801f10f59c9c6b7f53261fbea2ee", "score": "0.52012855", "text": "_applyPhysics() {\n const acclX = drag * this.velocity.x ** 2;\n const acclY = gr + drag * this.velocity.y ** 2;\n this.velocity.x += acclX * frameRate;\n this.velocity.y += acclY * frameRate;\n\n this.position.x += this.velocity.x * frameRate * 100;\n this.position.y += this.velocity.y * frameRate * 100;\n\n // Handle if ball encounters y-axis boundary\n if (\n this.position.y > height - this.radius ||\n this.position.y < this.radius\n ) {\n this.velocity.y *= this.bounce; // returns negative value\n this.position.y =\n this.position.y < this.radius ? this.radius : height - this.radius;\n }\n\n // Handle if ball encounters x-axis boundary\n if (\n this.position.x > width - this.radius ||\n this.position.x < this.radius\n ) {\n this.velocity.x *= this.bounce;\n this.position.x =\n this.position.x < this.radius ? this.radius : width - this.radius;\n }\n }", "title": "" }, { "docid": "3598d3474e418064c897b4e5e177f9d3", "score": "0.51862764", "text": "getVelocity() {\n const normalized = this.latest;\n const range = this.maxVelocity - this.minVelocity;\n const velocity = Math.floor(range * normalized + this.minVelocity);\n return velocity;\n }", "title": "" }, { "docid": "cb6cf7dbec239a777e9b9fd6b52c3eec", "score": "0.5179169", "text": "update () {\n let dx = this.dx,\n dy = this.dy\n\n let distance = Math.sqrt(dx*dx + dy*dy)\n let difference = this.length - distance\n let percent = difference / distance / 2 // each point needs to move\n\n let ox = dx * percent, oy = dy * percent\n this.a.x -= ox\n this.a.y -= oy\n\n this.b.x += ox\n this.b.y += oy\n }", "title": "" }, { "docid": "fbdd6c89408817e869bda6602616395e", "score": "0.517389", "text": "separate(birds) {\n let acc = this.p.createVector(0, 0);\n\n birds.forEach((bird) => {\n let headingToBird = p5.Vector.sub(bird.pos, this.pos);\n acc.add(headingToBird);\n });\n\n acc.normalize();\n return acc.mult(-1);\n }", "title": "" }, { "docid": "799d78ed45ac50f98f152791fb609da1", "score": "0.51698047", "text": "Asv(){\r\n return rebar(this.stirrupSize).A * this.noStirrupLegs\r\n }", "title": "" }, { "docid": "9831ef84eaad5027cfbc7f2ba025c818", "score": "0.5165885", "text": "function apply_velocity() {\n var pi;\n for (i = 0; i < planets.length; i++) {\n pi = planets[i];\n // apply the velocity\n pi.pos.x += pi.vel.x * delta_t;\n pi.pos.y += pi.vel.y * delta_t;\n }\n}", "title": "" }, { "docid": "43e28e649980e54e7fb1fe2928eb48cb", "score": "0.51635474", "text": "function averageOfVectors(arr) {\n // Add em all up, then divide the resulting vector\n // by total num of vectors\n return divideByValue(addVectors(arr), arr.length);\n}", "title": "" }, { "docid": "b4339f525ff90f248a993179bc28c50e", "score": "0.5158533", "text": "function calculate_masterVol() {\n // sum of all frequency component magnitudes\n return d3.range(0, nNyq).reduce((accm,idx) => accm + frequencyData[idx]) / nNyq\n}", "title": "" }, { "docid": "5ce98b6ccdedcb408ae657412cfda3a7", "score": "0.514675", "text": "async align () {\n this.stats.measurements++\n let coordVec = this.driver.currentCoords;\n let measurement = await this.driver.measureAt(coordVec);\n const funcGenerator = this.optimizer.generator(measurement, coordVec);\n \n let generatorOutput = funcGenerator.next(measurement);\n while(!generatorOutput.done) {\n this.stats.measurements++;\n measurement = await this.driver.measureAt(generatorOutput.value);\n generatorOutput = funcGenerator.next(measurement);\n }\n }", "title": "" }, { "docid": "ef89334580f56acbdf0c7676007a16ed", "score": "0.5140434", "text": "function metaball(ball1, ball2, v, handle_len_rate, maxDistance) {\n var center1 = ball1.position;\n var center2 = ball2.position;\n var radius1 = ball1.bounds.width / 2;\n var radius2 = ball2.bounds.width / 2;\n var pi2 = Math.PI / 2;\n var d = center1.getDistance(center2);\n var u1, u2;\n\n if (radius1 == 0 || radius2 == 0)\n return;\n\n if (d > maxDistance || d <= Math.abs(radius1 - radius2)) {\n return;\n } else if (d < radius1 + radius2) { // case circles are overlapping\n u1 = Math.acos((radius1 * radius1 + d * d - radius2 * radius2) /\n (2 * radius1 * d));\n u2 = Math.acos((radius2 * radius2 + d * d - radius1 * radius1) /\n (2 * radius2 * d));\n } else {\n u1 = 0;\n u2 = 0;\n }\n var angle1 = (center2 - center1).getAngleInRadians();\n var angle2 = Math.acos((radius1 - radius2) / d);\n var angle1a = angle1 + u1 + (angle2 - u1) * v;\n var angle1b = angle1 - u1 - (angle2 - u1) * v;\n var angle2a = angle1 + Math.PI - u2 - (Math.PI - u2 - angle2) * v;\n var angle2b = angle1 - Math.PI + u2 + (Math.PI - u2 - angle2) * v;\n var p1a = center1 + getVector(angle1a, radius1);\n var p1b = center1 + getVector(angle1b, radius1);\n var p2a = center2 + getVector(angle2a, radius2);\n var p2b = center2 + getVector(angle2b, radius2);\n\n // define handle length by the distance between\n // both ends of the curve to draw\n var totalRadius = (radius1 + radius2);\n var d2 = Math.min(v * handle_len_rate, (p1a - p2a).length / totalRadius);\n\n // case circles are overlapping:\n d2 *= Math.min(1, d * 2 / (radius1 + radius2));\n\n radius1 *= d2;\n radius2 *= d2;\n\n var path = new Path({\n segments: [p1a, p2a, p2b, p1b],\n style: ball1.style,\n closed: true\n });\n var segments = path.segments;\n segments[0].handleOut = getVector(angle1a - pi2, radius1);\n segments[1].handleIn = getVector(angle2a + pi2, radius2);\n segments[2].handleOut = getVector(angle2b - pi2, radius2);\n segments[3].handleIn = getVector(angle1b + pi2, radius1);\n return path;\n}", "title": "" }, { "docid": "c9c50922240a04468144af026dc4fdb9", "score": "0.5118716", "text": "bounce() {\n if (this.y + this.diameter / 2 >= height) {\n this.y = height - this.diameter / 2;\n this.velY *= -1;\n }\n\n if (this.x - this.diameter / 2 <= 0 || this.x + this.diameter / 2 >= width) {\n this.dir *= -1;\n this.velX *= this.dir;\n if (this.x - this.diameter / 2 <= 0) {\n this.x = this.diameter / 2;\n } else this.x = width - this.diameter / 2;\n }\n }", "title": "" }, { "docid": "9670b52613179b1da2b05cf2fffb1c9e", "score": "0.51056886", "text": "move() {\n if (currentSpell === `Voldemort`) {\n // Add vx and vy to the x and y properties of the first ellipse\n this.x += this.vx;\n this.y += this.vy;\n }\n // Add vx and vy to x and y properties of ellipse 2 once first ellipse reaches width\n if (this.x >= width) {\n this.x2 += this.vx2;\n this.y2 += this.vy2;\n }\n // Constrain y and size properties of ellipse 2\n this.y2 = constrain(this.y2, -1000, 6 * height / 7);\n this.size2 = constrain(this.size2, 0, 700);\n }", "title": "" }, { "docid": "9f809febe3ada6697bc126ef958c1b9d", "score": "0.509244", "text": "function dealGravity()\r\n{\r\n for(var i = 0; i < sphereNum; i++)\r\n {\r\n sphereVelocity[i][1] -= 0.5;\r\n }\r\n}", "title": "" }, { "docid": "373b3687a4a3440228be3917419227c1", "score": "0.50860274", "text": "function volumeCal(coordinate1, coordinate2, coordinate3, coordinate4)\n{\n\tvar a11 = coordinate1[0] - coordinate4[0];\t\t\n\tvar a12 = coordinate2[0] - coordinate4[0];\n\tvar a13 = coordinate3[0] - coordinate4[0];\n\tvar a21 = coordinate1[1] - coordinate4[1];\n\tvar a22 = coordinate2[1] - coordinate4[1];\n\tvar a23 = coordinate3[1] - coordinate4[1];\n\tvar a31 = coordinate1[2] - coordinate4[2];\n\tvar a32 = coordinate2[2] - coordinate4[2];\n\tvar a33 = coordinate3[2] - coordinate4[2];\n\tvar determinant = a11 * (a22 * a33 - a23 * a32) - a12 * (a21 * a33 - a23 * a31) + a13 * (a21 * a32 - a22 * a31);\n\tvar volume = determinant / 6.0;\n\n\treturn volume;\n}", "title": "" }, { "docid": "6e3785827b6f4ee635e39267c73ba7c6", "score": "0.50854254", "text": "collide() {\n for (let i = 0; i < numBalls; i++) {\n let dx = this.others[i].x - this.x;\n let dy = this.others[i].y - this.y;\n let distanceSqrd = dx ** 2 + dy ** 2;\n\n if (distanceSqrd < diameterSqrd) {\n let angle = p.atan2(dy, dx);\n let targetX = this.x + p.cos(angle) * diameter;\n let targetY = this.y + p.sin(angle) * diameter;\n let ax = (targetX - this.others[i].x) * spring;\n let ay = (targetY - this.others[i].y) * spring;\n this.vx -= ax;\n this.vy -= ay;\n this.others[i].vx += ax;\n this.others[i].vy += ay;\n\n //infection logic\n this.checkForStatusChange(i);\n }\n }\n }", "title": "" }, { "docid": "8aa2822560be8422f47294f22a34db74", "score": "0.50844055", "text": "cohesion(neighbours: Array<Creature>) {\n const sum = new Vector(0, 0);\n let count = 0;\n neighbours.forEach(neighbour => {\n if (neighbour != this && neighbour.maxspeed) {\n sum.add(neighbour.location);\n count++;\n }\n });\n if (!count) {\n return sum;\n }\n sum.div(count);\n\n return sum;\n }", "title": "" }, { "docid": "14c21f8594a9dff3d51a9167628878d4", "score": "0.5066376", "text": "function averageCoordinates(object){\n\t\tvar x = 0;\n\t\tvar y = 0;\n\t\tfor(var i = 0; i < object.length; i++){\n\t\t\tx += object[i].coordinates[0];\n\t\t\ty += object[i].coordinates[1];\n\t\t}\n\t\t// console.log(x / object.length, y / object.length);\n\t\tx = x / object.length;\n\t\ty = y / object.length\n\t\treturn {\"x\": x, \"y\": y}\n\t}", "title": "" }, { "docid": "4310e28e686a957c8a6c12df41af70d1", "score": "0.5061204", "text": "get inertia() {\n const mass = this.collider ? this.collider.mass : _Physics__WEBPACK_IMPORTED_MODULE_1__[\"Physics\"].defaultMass;\n let numerator = 0;\n let denominator = 0;\n for (let i = 0; i < this.points.length; i++) {\n const iplusone = (i + 1) % this.points.length;\n const crossTerm = this.points[iplusone].cross(this.points[i]);\n numerator +=\n crossTerm *\n (this.points[i].dot(this.points[i]) + this.points[i].dot(this.points[iplusone]) + this.points[iplusone].dot(this.points[iplusone]));\n denominator += crossTerm;\n }\n return (mass / 6) * (numerator / denominator);\n }", "title": "" }, { "docid": "1dae09b5fb6658065d3b97eb52e2b949", "score": "0.5056022", "text": "testColide() {\n \tconst scaling = 3;\n for (let i = this.id + 1; i < orbiters.length; ++i) {\n \tlet normX = orbiters[i].x - this.x;\n let normY = orbiters[i].y - this.y;\n let distance = sqrt(normX * normX + normY * normY);\n\n if (distance < MINDIST) { \n let unitNormX = normX/ (sqrt(normX* normX + normY * normY));\n let unitNormY = normY/ (sqrt(normX* normX + normY * normY));\n let unitTanX = - unitNormX;\n let unitTanY = unitNormX; \n let v1NormX = unitNormX * (this.vx + this.cvx);\n let v1TanX = unitTanX * (this.vx + this.cvx);\n let v1NormY = unitNormX * (this.vy + this.cvy);\n let v1TanY = unitTanX * (this.vy + this.cvy);\n let v2NormX = unitNormX * (orbiters[i].vx + orbiters[i].cvx);\n let v2TanX = unitTanX * (orbiters[i].vx + orbiters[i].cvx);\n let v2NormY = unitNormX * (orbiters[i].vy + orbiters[i].cvy);\n let v2TanY = unitTanX * (orbiters[i].vy + orbiters[i].cvy);\n \t\n let v1NormXP = (v1NormX * (this.mass - orbiters[i].mass) + 2 * (orbiters[i].mass * v2NormX)) / (this.mass + orbiters[i].mass)\n let v1NormYP = (v1NormY * (this.mass - orbiters[i].mass) + 2 * (orbiters[i].mass * v2NormY)) / (this.mass + orbiters[i].mass)\n \n let v2NormXP = (v2NormX * (orbiters[i].mass - this.mass) + 2 * (this.mass * v1NormX)) / (this.mass + orbiters[i].mass)\n let v2NormYP = (v2NormY * (orbiters[i].mass - this.mass) + 2 * (this.mass * v1NormY)) / (this.mass + orbiters[i].mass)\n \n v1NormXP = v1NormXP * unitNormX;\n v1NormYP = v1NormYP * unitNormY;\n \n v1TanX = v1TanX * unitNormX;\n\t\t\t\tv1TanY = v1TanY * unitNormY;\n \n v2NormXP = v2NormXP * unitNormX;\n v2NormYP = v2NormYP * unitNormY;\n \n v2TanX = v2TanX * unitNormX;\n v2TanY = v2TanY * unitNormY;\n \n this.cvx = v1NormXP + v1TanX;\n this.xvy = v1NormYP + v1TanY;\n \n orbiters[i].cvx = v2NormXP + v2TanX;\n orbiters[i].cvy = v2NormYP + v2TanY;\n\t\t\t}\n }\n }", "title": "" }, { "docid": "5c4f589fe192fbedc5cf6ec2cc8fc0fe", "score": "0.5052095", "text": "function advect(b, d, d0, velocX, velocY, dt) {\n var i0, i1, j0, j1;\n\n var dtx = dt * (N - 2);\n var dty = dt * (N - 2);\n\n var s0, s1, t0, t1;\n var tmp1, tmp2, x, y;\n\n var Nfloat = N;\n var ifloat, jfloat;\n var i, j;\n\n for (j = 1, jfloat = 1; j < N - 1; j++, jfloat++) {\n for (i = 1, ifloat = 1; i < N - 1; i++, ifloat++) {\n tmp1 = dtx * velocX[IX(i, j)];\n tmp2 = dty * velocY[IX(i, j)];\n x = ifloat - tmp1;\n y = jfloat - tmp2;\n\n if (x < 0.5) {\n x = 0.5;\n }\n if (x > Nfloat + 0.5) {\n x = Nfloat + 0.5;\n }\n i0 = Math.floor(x);\n i1 = i0 + 1.0;\n if (y < 0.5) {\n y = 0.5;\n }\n if (y > Nfloat + 0.5) {\n y = Nfloat + 0.5;\n }\n j0 = Math.floor(y);\n j1 = j0 + 1.0;\n\n s1 = x - i0;\n s0 = 1.0 - s1;\n t1 = y - j0;\n t0 = 1.0 - t1;\n\n var i0i = parseInt(i0);\n var i1i = parseInt(i1);\n var j0i = parseInt(j0);\n var j1i = parseInt(j1);\n\n // DOUBLE CHECK THIS!!!\n d[IX(i, j)] =\n (s0 * (t0 * d0[IX(i0i, j0i)] + t1 * d0[IX(i0i, j1i)]) +\n s1 * (t0 * d0[IX(i1i, j0i)] + t1 * d0[IX(i1i, j1i)]));\n }\n }\n\n set_bnd(b, d);\n}", "title": "" }, { "docid": "9c21ac030ea15ae4dfb21d227c81be82", "score": "0.5039584", "text": "function gravity() {\n for (let a = 0; a < particlesArray.length; a++) {\n for (let b = a; b < particlesArray.length; b++) {\n let distance = ((particlesArray[a].x.pos - particlesArray[b].x.pos) * (particlesArray[a].x.pos - particlesArray[b].x.pos)) +\n ((particlesArray[a].y.pos - particlesArray[b].y.pos) * (particlesArray[a].y.pos - particlesArray[b].y.pos));\n\n if (distance < (canvas.width / 7) * (canvas.height / 7)) {\n if (particlesArray[a].size > particlesArray[b].size) {\n particlesArray[b].x.speed = -particlesArray[b].x.speed;\n particlesArray[b].y.speed = -particlesArray[b].y.speed;\n particlesArray[b].update();\n } else {\n particlesArray[a].x.speed = -particlesArray[a].x.speed;\n particlesArray[a].y.speed = -particlesArray[a].y.speed;\n particlesArray[a].update();\n }\n }\n }\n }\n}", "title": "" }, { "docid": "5ed9079d3f9e84d27b6613ac588a3d3c", "score": "0.5039436", "text": "function apportion(v, w, ancestor) {\n if (w) {\n var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;\n while ((vim = nextRight(vim), vip = nextLeft(vip), vim && vip)) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }", "title": "" }, { "docid": "e8431291cfa8e09d89b0764e3e5d51fe", "score": "0.503061", "text": "calculate_casteljau(points) {\n\n\t\tvar l1 = vec3.fromValues(points[0].x, points[0].y, points[0].z);\n var auxp2 = vec3.fromValues(points[0].x, points[1].y, points[2].z);\n var auxp3 = vec3.fromValues(points[2].x, points[2].y, points[2].z);\n var r4 = vec3.fromValues(points[3].x, points[3].y, points[3].z);\n var divide_aux = vec3.fromValues(2,2,2);\n\n var l2 = vec3.create();\n vec3.add(l2, l1, auxp2);\n vec3.divide(l2, l2, divide_aux);\n\n var h = vec3.create();\n vec3.add(h, auxp2, auxp3);\n vec3.divide(h, h, divide_aux);\n\n var l3 = vec3.create();\n vec3.add(l3, l2, h);\n vec3.divide(l3, l3, divide_aux);\n\n var r3 = vec3.create();\n vec3.add(r3, auxp3, r4);\n vec3.divide(r3, r3, divide_aux);\n\n var r2 = vec3.create();\n vec3.add(r2, h, r3);\n vec3.divide(r2, r2, divide_aux);\n\n return vec3.distance(l1,l2) + vec3.distance(l2,l3) + vec3.distance(l3,r2) + vec3.distance(r2,r3) + vec3.distance(r3,r4);\n\t}", "title": "" }, { "docid": "3ec5f70de507060d3ab8184582e71438", "score": "0.50194025", "text": "function ruleBoidsAvoidColliding(b, index){\n\t\tvar c = {\n\t\t\tx: 0,\n\t\t\ty: 0\n\t\t}\n\n\t\tfor (var i = boids.length - 1; i >= 0; i--) {\n\t\t\tif (i === index) continue;\n\n\t\t\tvar n = boids[i];\n\n\t\t\t// Pythagoras\n\t\t\tvar distance = Math.sqrt(Math.pow(b.pos.x-n.pos.x,2) + Math.pow(b.pos.y-n.pos.y,2));\n\t\t\t\n\t\t\tif (distance > 10) continue;\n\n\t\t\t// Find angle from vector. Fun note, if we reverse objectA and B we have anti-gravity\n\t\t\tvar angle = Math.atan2(\n\t\t\t\tn.pos.y - b.pos.y,\n\t\t\t\tn.pos.x - b.pos.x\n\t\t\t);\n\n\t\t\t// All credit for this formula goes to an Isaac Newton\n\t\t\tc.x -= (\n\t\t\t\tMath.cos(angle) *\n\t\t\t\tMath.max(Math.sqrt(distance), 1)\n\t\t\t) * 0.2;\n\t\t\tc.y -= (\n\t\t\t\tMath.sin(angle) *\n\t\t\t\tMath.max(Math.sqrt(distance), 1)\n\t\t\t) * 0.2;\n\t\t};\n\n\t\treturn c;\n\t}", "title": "" }, { "docid": "d77de8d0d996a37899897118c900786a", "score": "0.501777", "text": "approachTarget(ball, c, r) {\n let v = matter_js_3.Vector.normalise({ x: c - ball.column, y: r - ball.row });\n ball.vx += v.x * STEP;\n ball.vy += v.y * STEP;\n }", "title": "" }, { "docid": "97dd40832482131f77b1349f33a7fb88", "score": "0.50149524", "text": "get averageSpeed()\n {\n var time = this._time[this._time.length - 1] - this._time[0];\n \n return this._distanceTravelled/(time/1000);\n }", "title": "" }, { "docid": "488d589d0f42fa7cbf9c7c94233e6546", "score": "0.50131345", "text": "function average_tat(processos){\r\n let qnt_proc = processos.length\r\n let tat = turn_around_time(processos).reduce((a,b) => a+b,0)\r\n return (tat / qnt_proc)\r\n}", "title": "" }, { "docid": "f2e68fc460a4b82edc2b587c56ecfb08", "score": "0.50107014", "text": "update(d_time_ms) {\n let d_time = d_time_ms / 10000\n\n let force_spring_right_top = this.k * (3 * this.getUitslagRightTop() - this.top.getUitslagRightBottom() - this.right_top.getUitslagLeftBottom() - this.right.getUitslagLeftTop())\n let force_spring_right_bottom = this.k * (3 * this.getUitslagRightBottom() - this.bottom.getUitslagRightTop() - this.right_bottom.getUitslagLeftTop() - this.right.getUitslagLeftBottom())\n let force_spring_left_top = this.k * (3 * this.getUitslagLeftTop() - this.top.getUitslagLeftBottom() - this.left_top.getUitslagRightBottom() - this.left.getUitslagRightTop())\n let force_spring_left_bottom = this.k * (3 * this.getUitslagLeftBottom() - this.bottom.getUitslagLeftTop() - this.left_bottom.getUitslagRightTop() - this.left.getUitslagRightBottom())\n\n let force_damp_right_top = this.c * (3 * this.getVRightTop() - this.top.getVRightBottom() - this.right_top.getVLeftBottom() - this.right.getVLeftTop())\n let force_damp_right_bottom = this.c * (3 * this.getVRightBottom() - this.bottom.getVRightTop() - this.right_bottom.getVLeftTop() - this.right.getVLeftBottom())\n let force_damp_left_top = this.c * (3 * this.getVLeftTop() - this.top.getVLeftBottom() - this.left_top.getVRightBottom() - this.left.getVRightTop())\n let force_damp_left_bottom = this.c * (3 * this.getVLeftBottom() - this.bottom.getVLeftTop() - this.left_bottom.getVRightTop() - this.left.getVRightBottom())\n\n // kracht vergelijking:\n let total_force_spring_right = force_spring_right_top + force_spring_right_bottom - force_spring_left_top - force_spring_left_bottom\n let total_force_damp_right = force_damp_right_top + force_damp_right_bottom - force_damp_left_top - force_damp_left_bottom\n let a_right = (total_force_spring_right + total_force_damp_right) / -this.m;\n let dv_right = a_right * d_time\n let dx_right = (this.getVRight() + dv_right) * d_time\n\n this.next_rotation_y = this.mesh.rotation.y + dx_right / this.hsize\n this.next_v_Ry = this.v_Ry + dv_right / this.hsize;\n\n\n // kracht vergelijking:\n let total_force_spring_top = force_spring_right_top - force_spring_right_bottom + force_spring_left_top - force_spring_left_bottom\n let total_force_damp_top = force_damp_right_top - force_damp_right_bottom + force_damp_left_top - force_damp_left_bottom\n let a_top = (total_force_spring_top + total_force_damp_top) / -this.m;\n let dv_top = a_top * d_time\n let dy_top = (this.getVTop() + dv_top) * d_time\n\n this.next_rotation_x = this.mesh.rotation.x + dy_top / this.hsize\n this.next_v_Rx = this.v_Rx + dv_top / this.hsize;\n\n /*\n let total_force_spring_right_top = force_spring_right_top - force_spring_right_bottom - force_spring_left_top + force_spring_left_bottom\n let total_force_damp_right_top = force_damp_right_top - force_damp_right_bottom - force_damp_left_top + force_damp_left_bottom\n let a_right_top = (total_force_spring_right_top + total_force_damp_right_top) / -this.m;\n let a_right = a_right_top * Math.sqrt(0.5)\n let a_top = a_right_top * Math.sqrt(0.5)\n\n let dv_right = a_right * d_time\n let dx_right = (this.getVRight() + dv_right) * d_time\n let dv_top = a_top * d_time\n let dy_top = (this.getVTop() + dv_top) * d_time\n\n this.next_rotation_y = this.mesh.rotation.y + dx_right / this.hsize\n this.next_v_Ry = this.v_Ry + dv_right / this.hsize;\n this.next_rotation_x = this.mesh.rotation.x + dy_top / this.hsize\n this.next_v_Rx = this.v_Rx + dv_top / this.hsize;\n */\n }", "title": "" }, { "docid": "1ba2d9c462535752e7b364d5395fe165", "score": "0.50085676", "text": "function apportion(v, w, ancestor) {\n\t\t if (w) {\n\t\t var vip = v,\n\t\t vop = v,\n\t\t vim = w,\n\t\t vom = vip.parent.children[0],\n\t\t sip = vip.m,\n\t\t sop = vop.m,\n\t\t sim = vim.m,\n\t\t som = vom.m,\n\t\t shift;\n\t\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t\t vom = nextLeft(vom);\n\t\t vop = nextRight(vop);\n\t\t vop.a = v;\n\t\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t\t if (shift > 0) {\n\t\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t\t sip += shift;\n\t\t sop += shift;\n\t\t }\n\t\t sim += vim.m;\n\t\t sip += vip.m;\n\t\t som += vom.m;\n\t\t sop += vop.m;\n\t\t }\n\t\t if (vim && !nextRight(vop)) {\n\t\t vop.t = vim;\n\t\t vop.m += sim - sop;\n\t\t }\n\t\t if (vip && !nextLeft(vom)) {\n\t\t vom.t = vip;\n\t\t vom.m += sip - som;\n\t\t ancestor = v;\n\t\t }\n\t\t }\n\t\t return ancestor;\n\t\t }", "title": "" }, { "docid": "6f91d5a7350943a83d5fb319438bcea1", "score": "0.5008274", "text": "seperate() {\n let desiredseparation = seperationSlider.value();\n let steer = createVector(0, 0);\n let count = 0;\n for (let i = 0; i < agents.length; i++) {\n let d = p5.Vector.dist(this.position, agents[i].position);\n // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if (d > 0 && d < desiredseparation) {\n // Calculate vector pointing away from neighbor\n let diff = p5.Vector.sub(this.position, agents[i].position);\n diff.normalize();\n diff.div(d); // Weight by distance\n steer.add(diff);\n count++; // Keep track of how many\n }\n\n // If too close, infect other agents\n // Barring if they recovered, or already infected\n if (\n this.infected &&\n d < 20 &&\n !agents[i].recovered &&\n !agents[i].infected\n ) {\n agents[i].infected = true;\n infectedCount++;\n infectedText.html(\n `Infected: ${infectedCount} (${Math.round(\n (infectedCount / agents.length) * 100\n )}%)`\n );\n }\n }\n // Average -- divide by how many\n if (count > 0) {\n steer.div(count);\n }\n\n // As long as the vector is greater than 0\n if (steer.mag() > 0) {\n // Implement Reynolds: Steering = Desired - Velocity\n steer.normalize();\n steer.mult(this.maxspeed);\n steer.sub(this.velocity);\n steer.limit(this.maxforce);\n }\n return steer;\n }", "title": "" }, { "docid": "4217ea619f506c9e7ed6084ec8d2b4a9", "score": "0.5002987", "text": "function postCollisionVel(ball_One, ball_Two) {\n x1 = ball_One.pos;\n u1 = ball_One.vel;\n m1 = ball_One.mass;\n x2 = ball_Two.pos;\n u2 = ball_Two.vel;\n m2 = ball_Two.mass;\n dist = math.subtract(x2, x1);\n matRot = math.multiply(\n 1 / math.norm(dist),\n math.matrix([[dist[0], dist[1]], [-dist[1], dist[0]]])\n );\n matUnrot = math.inv(matRot);\n u1Rot = math.multiply(matRot, u1);\n u2Rot = math.multiply(matRot, u2);\n v1Rot = [];\n v2Rot = [];\n v1Rot[1] = math.subset(u1Rot, math.index(1));\n v2Rot[1] = math.subset(u2Rot, math.index(1));\n u1Rotx = math.subset(u1Rot, math.index(0));\n u2Rotx = math.subset(u2Rot, math.index(0));\n v1Rot[0] = (2 * m2 * u2Rotx + (m1 - m2) * u1Rotx) / (m1 + m2);\n v2Rot[0] = (2 * m1 * u1Rotx + (m2 - m1) * u2Rotx) / (m1 + m2);\n v1 = math.multiply(matUnrot, v1Rot);\n v2 = math.multiply(matUnrot, v2Rot);\n return [v1, v2];\n}", "title": "" }, { "docid": "08fc3e6015619e12a1a3b7f36255de13", "score": "0.5002822", "text": "step(duration) {\n //> Memoize.\n const particles = this.particles;\n const len = particles.length;\n\n //> First, loop through all particles and update their velocities\n // from our newly computed values of acceleration between particles.\n for (let i = 0; i < PARTICLE_COUNT; i ++) {\n const p = particles[i];\n let xAcc = 0;\n let yAcc = 0;\n for (let j = 0; j < len; j ++) {\n //> Particles should only be attracted to particles that aren't them.\n if (j !== i) {\n const q = particles[j];\n\n const xOffset = p[0] - q[0];\n const yOffset = p[1] - q[1];\n\n let sqDiagonal = (xOffset * xOffset) + (yOffset * yOffset);\n if (sqDiagonal < PARTICLE_DIAMETER) {\n sqDiagonal = PARTICLE_DIAMETER;\n }\n const diagonal = Math.sqrt(sqDiagonal)\n //> This seems a little odd, but is a more performant, least\n // redundant to compute something mathematically equivalent\n // to the formula for gravitational acceleration.\n const accel = ((GRAV_CONST / sqDiagonal) / diagonal) * q[4];\n\n xAcc -= accel * xOffset;\n yAcc -= accel * yOffset;\n }\n }\n p[2] += xAcc * duration;\n p[3] += yAcc * duration;\n }\n\n //> Now that we have new velocities, update positions from those velocities.\n for (let i = 0; i < PARTICLE_COUNT; i ++) {\n const part = particles[i];\n part[0] += part[2] * duration;\n part[1] += part[3] * duration;\n }\n }", "title": "" }, { "docid": "acb9927c58e8a2557e735c3aa9768945", "score": "0.49996164", "text": "update() {\n this.velocity.add(this.acceleration);\n this.position.add(this.velocity);\n this.acceleration.mult(0);\n }", "title": "" }, { "docid": "76b3d916d60efe33dc5fc1c27c3a0157", "score": "0.49994794", "text": "updateBoundingRadius() {\n const shapes = this.shapes;\n const shapeOffsets = this.shapeOffsets;\n const N = shapes.length;\n let radius = 0;\n\n for (let i = 0; i !== N; i++) {\n const shape = shapes[i];\n shape.updateBoundingSphereRadius();\n const offset = shapeOffsets[i].length();\n const r = shape.boundingSphereRadius;\n if (offset + r > radius) {\n radius = offset + r;\n }\n }\n\n this.boundingRadius = radius;\n }", "title": "" }, { "docid": "9f7278f69e3e81f44e1a7b3491802ada", "score": "0.4994792", "text": "average(){\n \tlet res = 0\n \tfor(let v of this.array)\n \t\tres += v\n \tres /= this.length\n \treturn res.toFixed(2)\n }", "title": "" }, { "docid": "f1a2d13fa809e7f2dff943f5f8011c51", "score": "0.4991568", "text": "seperate(locals) {\n if (locals.length < 1 || sliders.seperation === 0) return;\n\n let avgX = [];\n let avgY = [];\n\n locals.forEach(local => {\n let dist = this.distance(local.x.pos, local.y.pos);\n\n let sepVal = (1 / dist) * sliders.seperation;\n\n let xRat = Math.abs(local.x.pos - this.x.pos) / dist;\n let yRat = Math.abs(local.y.pos - this.y.pos) / dist;\n\n let x = sepVal * xRat;\n let y = sepVal * yRat;\n\n if (local.x.pos > this.x.pos) x -= x * 2;\n if (local.y.pos > this.y.pos) y -= y * 2;\n\n avgX.push(x);\n avgY.push(y);\n });\n\n let x = avgX.reduce((a, b) => a + b) / locals.length;\n let y = avgY.reduce((a, b) => a + b) / locals.length;\n\n return [x, y];\n }", "title": "" }, { "docid": "d8d5abc3dcf22deafc49f1aabdae1828", "score": "0.49875882", "text": "function getBassVol() {\n var bass = bassAvgVolume - 17\n if (bass < 0) {\n bass = 0;\n }\n bass = Math.floor(bass / 1.2 + sphereMinVal);\n if (bass >= 17) {\n bass = 16;\n }\n\n //slight adjustments if bass is really low...\n if (bassAvgVolume < 5) {\n bass = Math.floor(bassAvgVolume);\n if (bass < 0) {\n bass = 0;\n }\n bass += 4;\n }\n return bass;\n}", "title": "" }, { "docid": "585301da9f9fb70f1c62649ebb5a50fe", "score": "0.4984448", "text": "update() { // render or draw this to canvas\r\n // If no this.this.body--go no further\r\n if (this.body.length < 1) return;\r\n // Check each boid to see if it is touching any segments in loop\r\n this.peedhitindexes = [];\r\n for (let i = 0; i < this.body.length; i++) {\r\n for (let j = 0; j < game.flock.boids.length; j++)\r\n if (this.body[i].hitTest(game.flock.boids[j])) {\r\n this.peedhitindexes.push(i);\r\n }\r\n }\r\n // if this.peedhitindexes > 0 then a hit has occured\r\n // remove all segments after lowest index\r\n if (this.peedhitindexes.length > 0 ) {\r\n game.livesLeft --;\r\n if ( game.livesLeft < 1) game.gameEnded = true;\r\n this.min = getMinIndex();\r\n //Remove list elements from end to min index\r\n for (let i = this.body.length - 1; i >= this.min + 1; i--) {\r\n this.body.splice(i, 1);\r\n }\r\n}\r\n\r\n// Move head according to direction set in keyPressed()\r\nif ( millis() - this.peedDelay > 30 && this.moved) { //millis() - peedDelay > 100 &&\r\n if (this.west) this.body[0].loc.x -= blockSize/1.5;\r\n if (this.east) this.body[0].loc.x += blockSize/1.5;\r\n if (this.north) this.body[0].loc.y -= blockSize/1.5;\r\n if (this.south) this.body[0].loc.y += blockSize/1.5;\r\n this.peedDelay = millis();\r\n // move this.body to follow head\r\n for (let i = this.body.length - 1; i > 0 ; i--) {\r\n // let loc of segment equal loc of segment ahead\r\n this.body[i].loc.x = this.body[i-1].loc.x;\r\n this.body[i].loc.y = this.body[i-1].loc.y;\r\n }\r\n}\r\n// Add segments to player after addSegmentInterval\r\nif (millis() - this.lastSegmentAdded > this.addSegmentInterval) {\r\n this.addthis.bodySegments(1);\r\n this.lastSegmentAdded = millis();\r\n}\r\n\r\n// If head out of bounds, then end game\r\nif (this.body[0].loc.x < 0 ||\r\n this.body[0].loc.x > playAreaSize - blockSize ||\r\n this.body[0].loc.y < 0 ||\r\n this.body[0].loc.y > screenH - blockSize) game.gameEnded = true;\r\n\r\n// If head touches this.body, then loop created\r\nif (this.moved)\r\n for (let i = this.body.size() - 1; i > 1 ; i--) {\r\n if (this.body.get(0).loc.x == this.body.get(i).loc.x && this.body.get(0).loc.y == this.body.get(i).loc.y) {\r\n game.makeLoop(i);\r\n game.loopMade = true;\r\n }\r\n }\r\n//update highscore if game ended\r\nif (game.gameEnded && game.score > highestScore) {\r\n highestScore = game.score;\r\n}\r\n}", "title": "" }, { "docid": "008a9e346eed3fccc08f7a50477a7531", "score": "0.4971332", "text": "function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }", "title": "" }, { "docid": "008a9e346eed3fccc08f7a50477a7531", "score": "0.4971332", "text": "function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }", "title": "" }, { "docid": "008a9e346eed3fccc08f7a50477a7531", "score": "0.4971332", "text": "function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }", "title": "" }, { "docid": "008a9e346eed3fccc08f7a50477a7531", "score": "0.4971332", "text": "function apportion(v, w, ancestor) {\n\t if (w) {\n\t var vip = v,\n\t vop = v,\n\t vim = w,\n\t vom = vip.parent.children[0],\n\t sip = vip.m,\n\t sop = vop.m,\n\t sim = vim.m,\n\t som = vom.m,\n\t shift;\n\t while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n\t vom = nextLeft(vom);\n\t vop = nextRight(vop);\n\t vop.a = v;\n\t shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n\t if (shift > 0) {\n\t moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n\t sip += shift;\n\t sop += shift;\n\t }\n\t sim += vim.m;\n\t sip += vip.m;\n\t som += vom.m;\n\t sop += vop.m;\n\t }\n\t if (vim && !nextRight(vop)) {\n\t vop.t = vim;\n\t vop.m += sim - sop;\n\t }\n\t if (vip && !nextLeft(vom)) {\n\t vom.t = vip;\n\t vom.m += sip - som;\n\t ancestor = v;\n\t }\n\t }\n\t return ancestor;\n\t }", "title": "" }, { "docid": "8aa1837dc92656a15e8a521ed0246e7b", "score": "0.49698496", "text": "function surroundingvelocities(model, velocity) {\n //Get the index for the higher face velocity\n var index = getgreaterindex(this[model]['facevelocity'], velocity);\n\n //Check to make sure both indexes are in the array\n if (index == 0) {\n console.log(\"Index for the face velocity was equal to zero\")\n return NaN;\n }\n\n //Make sure that the index doesn't run off the array\n if (index > this[model]['facevelocity'].length) {\n console.log(\"Index for the face velocity was greater than the velocity array.\")\n return NaN;\n }\n\n var array = [this[model]['facevelocity'][index - 1], this[model]['facevelocity'][index]];\n return array;\n}", "title": "" }, { "docid": "f6655ad17af54225c36c7be3274368a4", "score": "0.49696198", "text": "function pidLoop() {\n lastRoll = roll;\n \n var accs = MPU.getAcceleration();\n var accX = accs[0];\n var accY = accs[1];\n var accZ = accs[2];\n \n var accTotalVector = Math.sqrt(accX*accX + accY*accY + accZ*accZ); // this actually should be constant = whatever raw value corresponds to 1G\n var rollAcc = Math.asin(accY / accTotalVector) / DEGS_RAD - rollAccOffset; // asin() gives radians, result has to be in degrees\n var pitchAcc = Math.asin(accX / accTotalVector) / DEGS_RAD - pitchAccOffset;\n \n \n var gyros = MPU.getRotation();\n var gyroX = gyros[0] - gyroOffsetX;\n var gyroY = gyros[1] - gyroOffsetY;\n var gyroZ = gyros[2] - gyroOffsetZ;\n \n\n roll += gyroX * GYRO_RAW_DEGS; \n pitch += gyroY * GYRO_RAW_DEGS;\n // sin() has to be applied on radians\n roll -= pitch * Math.sin(gyroZ * GYRO_RAW_DEGS * DEGS_RAD);\n pitch += roll * Math.sin(gyroZ * GYRO_RAW_DEGS * DEGS_RAD);\n \n \n // integrate accelerometre & gyro. Tiny weightto the noisy accelerometre, just enough to stop the gyro from drifting\n roll = 0.99 * roll + 0.01 * rollAcc;\n pitch = 0.99 * pitch + 0.01 * pitchAcc;\n\n propErr = roll - setPoint;\n\n intErr = KI * intErr;\n if(intErr > MAX_INTEGRAL_ERR) intErr = MAX_INTEGRAL_ERR;\n else if(intErr < -MAX_INTEGRAL_ERR) intErr = -MAX_INTEGRAL_ERR;\n\n if(Math.abs(propErr) > 30) {\n speed = 0;\n } else {\n speed = KP * propErr + intErr + KD * (roll - lastRoll);\n intErr = intErr + propErr;\n }\n\n \n console.log(roll + \" - \" + rollAcc + \" / \" + pitchAcc);\n //setSpeed(speed);\n}", "title": "" }, { "docid": "635663957b2f7ed1144c649dec1383dc", "score": "0.49695703", "text": "averageSize(roomData, startFloor, endFloor) {\n\n }", "title": "" }, { "docid": "34c5aee7f1f1a2a5c7766ddd9eb821f6", "score": "0.4966773", "text": "static update() {\n // skip this if there are no votes\n if (!(GearBase._rotationElections.size > 0))\n return;\n GearBase._updating = true;\n for (const election of GearBase._rotationElections) {\n let sum = 0;\n let count = 0;\n for (const voter of election) {\n if (!isNaN(voter._rotationVote)) {\n sum += voter._rotationVote;\n count += 1;\n voter._rotationVote = NaN;\n }\n }\n if (!(count > 0))\n continue;\n const mean = sum / count;\n for (const voter of election) {\n voter.rotation = mean;\n }\n }\n GearBase._rotationElections.clear();\n GearBase._updating = false;\n }", "title": "" } ]
cba4467f26d75e3e3c687013c32fce94
Here to change the initial join
[ { "docid": "00e989add4ce8bfb15f8298ea5b134f0", "score": "0.0", "text": "getRawPath() {\n return this.path.join('/');\n }", "title": "" } ]
[ { "docid": "aca5163e1dd36a29874502a6b950ca1c", "score": "0.69491893", "text": "_makeJoinQuery () {\n var self = this\n const selectionKeys = [`${this.related.table}.*`, `${this.through.table}.${this.toKey}`]\n this.relatedQuery\n .select.apply(this.relatedQuery, selectionKeys)\n .innerJoin(`${this.through.table}`, function () {\n this.on(`${self.through.table}.${self.viaKey}`, `${self.related.table}.${self.viaForeignKey}`)\n })\n }", "title": "" }, { "docid": "fcab3e26d9b01bc0491eeaacf5747235", "score": "0.64694476", "text": "function doJoin (query, scope, h) {\r\n\n\t// Check, if this is a last join?\r\n\tif(h>=query.sources.length) { // Todo: check if this runs once too many\r\n\n\t\t// Then apply where and select\r\n\n\t\tif(query.wherefn(scope,query.params, alasql)) {\r\n\n\t\t\t// If there is a GROUP BY then pipe to groupping function\r\n\t\t\tif(query.groupfn) {\r\n\t\t\t\tquery.groupfn(scope, query.params, alasql)\r\n\t\t\t} else {\r\n\n\t\t\t\tquery.data.push(query.selectfn(scope, query.params, alasql));\r\n\t\t\t}\t\r\n\t\t}\r\n\t} else if(query.sources[h].applyselect) {\r\n\n\t\tvar source = query.sources[h];\r\n\t\tsource.applyselect(query.params, function(data){\r\n\t\t\tif(data.length > 0) {\r\n\n\t\t\t\tfor(var i=0;i<data.length;i++) {\r\n\t\t\t\t\tscope[source.alias] = data[i];\r\n\t\t\t\t\tdoJoin(query, scope, h+1);\r\n\t\t\t\t};\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tif (source.applymode == 'OUTER') {\r\n\t\t\t\t\tscope[source.alias] = {};\r\n\t\t\t\t\tdoJoin(query, scope, h+1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},scope);\r\n\n\t} else {\r\n\n// STEP 1\r\n\n\t\tvar source = query.sources[h];\r\n\t\tvar nextsource = query.sources[h+1];\r\n\n\t\t// Todo: check if this is smart\r\n\t\tif(true) {//source.joinmode != \"ANTI\") {\r\n\n\t\t\tvar tableid = source.alias || source.tableid; \r\n\t\t\tvar pass = false; // For LEFT JOIN\r\n\t\t\tvar data = source.data;\r\n\t\t\tvar opt = false;\r\n\n\t\t\t// Reduce data for looping if there is optimization hint\r\n\t\t\tif(!source.getfn || (source.getfn && !source.dontcache)) {\r\n\t\t\t\tif(source.joinmode != \"RIGHT\" && source.joinmode != \"OUTER\" && source.joinmode != \"ANTI\" && source.optimization == 'ix') {\r\n\t\t\t\t\tdata = source.ix[ source.onleftfn(scope, query.params, alasql) ] || [];\r\n\t\t\t\t\topt = true;\r\n\n\t\t\t\t}\r\n\t\t\t}\r\n\n\t\t\t// Main cycle\r\n\t\t\tvar i = 0;\r\n\t\t\tif(typeof data == 'undefined') {\r\n\t\t\t\tthrow new Error('Data source number '+h+' in undefined')\r\n\t\t\t}\r\n\t\t\tvar ilen=data.length;\r\n\t\t\tvar dataw;\r\n\n\t\t\twhile((dataw = data[i]) || (!opt && (source.getfn && (dataw = source.getfn(i)))) || (i<ilen) ) {\r\n\t\t\t\tif(!opt && source.getfn && !source.dontcache) data[i] = dataw;\r\n\n\t\t\t\tscope[tableid] = dataw;\r\n\t\t\t\t// Reduce with ON and USING clause\r\n\t\t\t\tif(!source.onleftfn || (source.onleftfn(scope, query.params, alasql) == source.onrightfn(scope, query.params, alasql))) {\r\n\t\t\t\t\t// For all non-standard JOINs like a-b=0\r\n\t\t\t\t\tif(source.onmiddlefn(scope, query.params, alasql)) {\r\n\t\t\t\t\t\t// Recursively call new join\r\n\n\t\t\t\t\t\tif(source.joinmode != \"SEMI\" && source.joinmode != \"ANTI\") { \r\n\n\t\t\t\t\t\t\tdoJoin(query, scope, h+1);\r\n\t\t\t\t\t\t}\r\n\n\t\t\t\t\t\t// if(source.data[i].f = 200) debugger;\r\n\n\t\t\t\t\t\tif(source.joinmode != \"LEFT\" && source.joinmode != \"INNER\") {\r\n\t\t\t\t\t\t\tdataw._rightjoin = true;\r\n\t\t\t\t\t\t}\r\n\n\t\t\t\t\t\t// for LEFT JOIN\r\n\t\t\t\t\t\tpass = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\ti++;\r\n\t\t\t};\r\n\n\t\t\t// Additional join for LEFT JOINS\r\n\t\t\tif((source.joinmode == 'LEFT' || source.joinmode == 'OUTER' || source.joinmode == 'SEMI' ) && !pass) {\r\n\t\t\t// Clear the scope after the loop\r\n\t\t\t\tscope[tableid] = {};\r\n\t\t\t\tdoJoin(query,scope,h+1);\r\n\t\t\t}\t\r\n\n\t\t}\r\n\n\t\t// When there is no records\r\n\n// STEP 2\r\n\n\t\tif(h+1 < query.sources.length) {\r\n\n\t\t\tif(nextsource.joinmode == \"OUTER\" || nextsource.joinmode == \"RIGHT\" \r\n\t\t\t\t|| nextsource.joinmode == \"ANTI\") {\r\n\n\t\t\t\tscope[source.alias] = {};\r\n\n\t\t\t\tvar j = 0;\r\n\t\t\t\tvar jlen = nextsource.data.length;\r\n\t\t\t\tvar dataw;\r\n\n\t\t\t\twhile((dataw = nextsource.data[j]) || (nextsource.getfn && (dataw = nextsource.getfn(j))) || (j<jlen)) {\r\n\t\t\t\t\tif(nextsource.getfn && !nextsource.dontcache) {\r\n\t\t\t\t\t\tnextsource.data[j] = dataw;\r\n\t\t\t\t\t}\r\n\n\t\t\t\t\tif(dataw._rightjoin) {\r\n\t\t\t\t\t\tdelete dataw._rightjoin;\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\n\t\t\t\t\t\tif(h==0) {\r\n\t\t\t\t\t\t\tscope[nextsource.alias] = dataw;\r\n\t\t\t\t\t\t\tdoJoin(query, scope, h+2);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//scope[nextsource.alias] = dataw;\r\n\t\t\t\t\t\t\t//doJoin(query, scope, h+2);\r\n\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tj++;\r\n\t\t\t\t}\r\n\n\t\t\t} else {\r\n\n\t\t\t};\r\n\t\t} else {\r\n\n\t\t};\r\n\n\t\tscope[tableid] = undefined;\r\n\n\t}\r\n\n}", "title": "" }, { "docid": "1b23adaec2e9bcfab0923714b6c17512", "score": "0.6393708", "text": "function buildJoin(tblid, startingStr, reverseJoin) {\n var joinsql = \"\";\n if (!startingStr) startingStr = \"\";\n joinsql += startingStr + \" \";\n tblList.remove(tblid);\n var conns = instance.getConnections({ target: tblid });\n if (conns.length == 0 && reverseJoin) joinsql = \",\\n\" + getTableStr(tblid);\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n var isSourceThere = $.inArray(c.sourceId, tblList) > -1\n if (isSourceThere || reverseJoin) {\n if (isSourceThere) tblList.remove(c.sourceId);\n if (c.getOverlay(\"joinType\")) {\n var joinType = c.getOverlay(\"joinType\").labelText;\n var tblName = getTableStr(c.sourceId);\n var joinCols = c.getOverlay(\"label2\").labelText;\n if (!isSourceThere) {\n joinType = joinType.replace(\"left \", \"right \");\n tblName = getTableStr(c.targetId);\n }\n joinsql += \" \\n \" + joinType + \" \" + tblName + \" on \" + joinCols.replace(\"XX\", \"_\") + \" \";\n joinsql += buildJoin(c.sourceId);\n }\n }\n }\n if (!joinsql) joinsql = \"\";\n return joinsql;\n}", "title": "" }, { "docid": "fac73a755fdeb2dfc729309f82442c39", "score": "0.63928753", "text": "_makeJoinQuery (ignoreSelections) {\n var self = this\n const selectionKeys = [`${this.related.table}.*`, `${this.through.table}.${this.toKey}`]\n\n if (!ignoreSelections) {\n this.relatedQuery.select.apply(this.relatedQuery, selectionKeys)\n }\n\n this.relatedQuery.innerJoin(`${this.through.table}`, function () {\n this.on(`${self.through.table}.${self.viaKey}`, `${self.related.table}.${self.viaForeignKey}`)\n })\n }", "title": "" }, { "docid": "d16fb7582dba1b77b9dab5ec9be962d2", "score": "0.63657033", "text": "function fixMultiJoinConstraint(o,jp){\n\t\t\t//copy of both tables to join\n\t\t\tvar a = JSON.parse(JSON.stringify(o[0])); \n\t\t\tvar b = JSON.parse(JSON.stringify(o[2]));\n\t\t\t\n\t\t\tif(a.table == jp){\n\t\t\t\to[2].table = \"ätemp\";\n\t\t\t\to[2].column = b.table+\"_\"+b.column;\n\t\t\t}\n\t\t\telse if(b.table == jp){\n\t\t\t\to[0].table = \"ätemp\";\n\t\t\t\to[0].column = a.table+\"_\"+a.column;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tconsole.log(\"MultiJoinConstraint error\");\n\t\t\t}\n\t\t\t\n\t\t\treturn o;\n\t\t}", "title": "" }, { "docid": "ec6dc03f98a9d0b370aabf144b9da8ee", "score": "0.63417965", "text": "function doJoin (query, scope, h) {\n\n\t// Check, if this is a last join?\n\tif(h>=query.sources.length) {\n\n\t\t// Then apply where and select\n\n\t\tif(query.wherefn(scope,query.params, alasql)) {\n\n\t\t\t// If there is a GROUP BY then pipe to groupping function\n\t\t\tif(query.groupfn) {\n\t\t\t\tquery.groupfn(scope, query.params, alasql)\n\t\t\t} else {\n\n\t\t\t\tquery.data.push(query.selectfn(scope, query.params, alasql));\n\t\t\t}\t\n\t\t}\n\t} else if(query.sources[h].applyselect) {\n\n\t\tvar source = query.sources[h];\n\t\tsource.applyselect(query.params, function(data){\n\t\t\tif(data.length > 0) {\n\n\t\t\t\tfor(var i=0;i<data.length;i++) {\n\t\t\t\t\tscope[source.alias] = data[i];\n\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t};\t\t\t\n\t\t\t} else {\n\t\t\t\tif (source.applymode == 'OUTER') {\n\t\t\t\t\tscope[source.alias] = {};\n\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t}\n\t\t\t}\n\t\t},scope);\n\n\t} else {\n\n// STEP 1\n\n\t\tvar source = query.sources[h];\n\t\tvar nextsource = query.sources[h+1];\n\n\t\t// Todo: check if this is smart\n\t\tif(true) {//source.joinmode != \"ANTI\") {\n\n\t\t\tvar tableid = source.alias || source.tableid; \n\t\t\tvar pass = false; // For LEFT JOIN\n\t\t\tvar data = source.data;\n\t\t\tvar opt = false;\n\n\t\t\t// Reduce data for looping if there is optimization hint\n\t\t\tif(!source.getfn || (source.getfn && !source.dontcache)) {\n\t\t\t\tif(source.joinmode != \"RIGHT\" && source.joinmode != \"OUTER\" && source.joinmode != \"ANTI\" && source.optimization == 'ix') {\n\t\t\t\t\tdata = source.ix[ source.onleftfn(scope, query.params, alasql) ] || [];\n\t\t\t\t\topt = true;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Main cycle\n\t\t\tvar i = 0;\n\t\t\tif(typeof data == 'undefined') {\n\t\t\t\tthrow new Error('Data source number '+h+' in undefined')\n\t\t\t}\n\t\t\tvar ilen=data.length;\n\t\t\tvar dataw;\n\n\t\t\twhile((dataw = data[i]) || (!opt && (source.getfn && (dataw = source.getfn(i)))) || (i<ilen) ) {\n\t\t\t\tif(!opt && source.getfn && !source.dontcache) data[i] = dataw;\n\n\t\t\t\tscope[tableid] = dataw;\n\t\t\t\t// Reduce with ON and USING clause\n\t\t\t\tif(!source.onleftfn || (source.onleftfn(scope, query.params, alasql) == source.onrightfn(scope, query.params, alasql))) {\n\t\t\t\t\t// For all non-standard JOINs like a-b=0\n\t\t\t\t\tif(source.onmiddlefn(scope, query.params, alasql)) {\n\t\t\t\t\t\t// Recursively call new join\n\n\t\t\t\t\t\tif(source.joinmode != \"SEMI\" && source.joinmode != \"ANTI\") { \n\n\t\t\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if(source.data[i].f = 200) debugger;\n\n\t\t\t\t\t\tif(source.joinmode != \"LEFT\" && source.joinmode != \"INNER\") {\n\t\t\t\t\t\t\tdataw._rightjoin = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// for LEFT JOIN\n\t\t\t\t\t\tpass = true;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\ti++;\n\t\t\t};\n\n\t\t\t// Additional join for LEFT JOINS\n\t\t\tif((source.joinmode == 'LEFT' || source.joinmode == 'OUTER' || source.joinmode == 'SEMI' ) && !pass) {\n\t\t\t// Clear the scope after the loop\n\t\t\t\tscope[tableid] = {};\n\t\t\t\tdoJoin(query,scope,h+1);\n\t\t\t}\t\n\n\t\t}\n\n\t\t// When there is no records\n\n// STEP 2\n\n\t\tif(h+1 < query.sources.length) {\n\n\t\t\tif(nextsource.joinmode == \"OUTER\" || nextsource.joinmode == \"RIGHT\" \n\t\t\t\t|| nextsource.joinmode == \"ANTI\") {\n\n\t\t\t\tscope[source.alias] = {};\n\n\t\t\t\tvar j = 0;\n\t\t\t\tvar jlen = nextsource.data.length;\n\t\t\t\tvar dataw;\n\n\t\t\t\twhile((dataw = nextsource.data[j]) || (nextsource.getfn && (dataw = nextsource.getfn(j))) || (j<jlen)) {\n\t\t\t\t\tif(nextsource.getfn && !nextsource.dontcache) {\n\t\t\t\t\t\tnextsource.data[j] = dataw;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(dataw._rightjoin) {\n\t\t\t\t\t\tdelete dataw._rightjoin;\t\t\t\t\t\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif(h==0) {\n\t\t\t\t\t\t\tscope[nextsource.alias] = dataw;\n\t\t\t\t\t\t\tdoJoin(query, scope, h+2);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//scope[nextsource.alias] = dataw;\n\t\t\t\t\t\t\t//doJoin(query, scope, h+2);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t};\n\t\t} else {\n\n\t\t};\n\n\t\tscope[tableid] = undefined;\n\n\t}\n\n}", "title": "" }, { "docid": "ec6dc03f98a9d0b370aabf144b9da8ee", "score": "0.63417965", "text": "function doJoin (query, scope, h) {\n\n\t// Check, if this is a last join?\n\tif(h>=query.sources.length) {\n\n\t\t// Then apply where and select\n\n\t\tif(query.wherefn(scope,query.params, alasql)) {\n\n\t\t\t// If there is a GROUP BY then pipe to groupping function\n\t\t\tif(query.groupfn) {\n\t\t\t\tquery.groupfn(scope, query.params, alasql)\n\t\t\t} else {\n\n\t\t\t\tquery.data.push(query.selectfn(scope, query.params, alasql));\n\t\t\t}\t\n\t\t}\n\t} else if(query.sources[h].applyselect) {\n\n\t\tvar source = query.sources[h];\n\t\tsource.applyselect(query.params, function(data){\n\t\t\tif(data.length > 0) {\n\n\t\t\t\tfor(var i=0;i<data.length;i++) {\n\t\t\t\t\tscope[source.alias] = data[i];\n\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t};\t\t\t\n\t\t\t} else {\n\t\t\t\tif (source.applymode == 'OUTER') {\n\t\t\t\t\tscope[source.alias] = {};\n\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t}\n\t\t\t}\n\t\t},scope);\n\n\t} else {\n\n// STEP 1\n\n\t\tvar source = query.sources[h];\n\t\tvar nextsource = query.sources[h+1];\n\n\t\t// Todo: check if this is smart\n\t\tif(true) {//source.joinmode != \"ANTI\") {\n\n\t\t\tvar tableid = source.alias || source.tableid; \n\t\t\tvar pass = false; // For LEFT JOIN\n\t\t\tvar data = source.data;\n\t\t\tvar opt = false;\n\n\t\t\t// Reduce data for looping if there is optimization hint\n\t\t\tif(!source.getfn || (source.getfn && !source.dontcache)) {\n\t\t\t\tif(source.joinmode != \"RIGHT\" && source.joinmode != \"OUTER\" && source.joinmode != \"ANTI\" && source.optimization == 'ix') {\n\t\t\t\t\tdata = source.ix[ source.onleftfn(scope, query.params, alasql) ] || [];\n\t\t\t\t\topt = true;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Main cycle\n\t\t\tvar i = 0;\n\t\t\tif(typeof data == 'undefined') {\n\t\t\t\tthrow new Error('Data source number '+h+' in undefined')\n\t\t\t}\n\t\t\tvar ilen=data.length;\n\t\t\tvar dataw;\n\n\t\t\twhile((dataw = data[i]) || (!opt && (source.getfn && (dataw = source.getfn(i)))) || (i<ilen) ) {\n\t\t\t\tif(!opt && source.getfn && !source.dontcache) data[i] = dataw;\n\n\t\t\t\tscope[tableid] = dataw;\n\t\t\t\t// Reduce with ON and USING clause\n\t\t\t\tif(!source.onleftfn || (source.onleftfn(scope, query.params, alasql) == source.onrightfn(scope, query.params, alasql))) {\n\t\t\t\t\t// For all non-standard JOINs like a-b=0\n\t\t\t\t\tif(source.onmiddlefn(scope, query.params, alasql)) {\n\t\t\t\t\t\t// Recursively call new join\n\n\t\t\t\t\t\tif(source.joinmode != \"SEMI\" && source.joinmode != \"ANTI\") { \n\n\t\t\t\t\t\t\tdoJoin(query, scope, h+1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if(source.data[i].f = 200) debugger;\n\n\t\t\t\t\t\tif(source.joinmode != \"LEFT\" && source.joinmode != \"INNER\") {\n\t\t\t\t\t\t\tdataw._rightjoin = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// for LEFT JOIN\n\t\t\t\t\t\tpass = true;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\ti++;\n\t\t\t};\n\n\t\t\t// Additional join for LEFT JOINS\n\t\t\tif((source.joinmode == 'LEFT' || source.joinmode == 'OUTER' || source.joinmode == 'SEMI' ) && !pass) {\n\t\t\t// Clear the scope after the loop\n\t\t\t\tscope[tableid] = {};\n\t\t\t\tdoJoin(query,scope,h+1);\n\t\t\t}\t\n\n\t\t}\n\n\t\t// When there is no records\n\n// STEP 2\n\n\t\tif(h+1 < query.sources.length) {\n\n\t\t\tif(nextsource.joinmode == \"OUTER\" || nextsource.joinmode == \"RIGHT\" \n\t\t\t\t|| nextsource.joinmode == \"ANTI\") {\n\n\t\t\t\tscope[source.alias] = {};\n\n\t\t\t\tvar j = 0;\n\t\t\t\tvar jlen = nextsource.data.length;\n\t\t\t\tvar dataw;\n\n\t\t\t\twhile((dataw = nextsource.data[j]) || (nextsource.getfn && (dataw = nextsource.getfn(j))) || (j<jlen)) {\n\t\t\t\t\tif(nextsource.getfn && !nextsource.dontcache) {\n\t\t\t\t\t\tnextsource.data[j] = dataw;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(dataw._rightjoin) {\n\t\t\t\t\t\tdelete dataw._rightjoin;\t\t\t\t\t\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif(h==0) {\n\t\t\t\t\t\t\tscope[nextsource.alias] = dataw;\n\t\t\t\t\t\t\tdoJoin(query, scope, h+2);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//scope[nextsource.alias] = dataw;\n\t\t\t\t\t\t\t//doJoin(query, scope, h+2);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t};\n\t\t} else {\n\n\t\t};\n\n\t\tscope[tableid] = undefined;\n\n\t}\n\n}", "title": "" }, { "docid": "ccf9445e5deb0fa2d91beb59db713289", "score": "0.6054324", "text": "function setJoins(j, v) {\r\n if(parseInt(v) === 1) {\r\n this.last = this.current\r\n this.current = j\r\n\r\n var joinList = this.joins.map(function(join) {\r\n return {join: join, value: 0}\r\n })\r\n CF.setJoins(joinList, false)\r\n CF.setJoin(j, 1, false)\r\n }\r\n }", "title": "" }, { "docid": "e4e7c06d47d74bca292b9399a04fe405", "score": "0.60225934", "text": "function join(lookupTable, mainTable, lookupKey, mainKey, select) {\n var l = lookupTable.length,\n m = mainTable.length,\n lookupIndex = [],\n output = [];\n for (var i = 0; i < l; i++) { // loop through l items\n var row = lookupTable[i];\n lookupIndex[row[lookupKey]] = row; // create an index for lookup table\n }\n\n //console.log(lookupIndex);\n for (var j = 0; j < m; j++) { // loop through m items\n var y = mainTable[j];\n var x = lookupIndex[y[mainKey]]; // get corresponding row from lookupTable\n output.push(select(y, x)); // select only the columns you need\n //output.push(y[mainKey]);\n }\n return output;\n }", "title": "" }, { "docid": "c16450bf82e246d9c3d3e752859ca9ad", "score": "0.59696263", "text": "function peekJoin() {\n var keys = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n keys[_i] = arguments[_i];\n }\n return new Join(keys, false);\n}", "title": "" }, { "docid": "1bbf41c051582a28feb35926bc10d14f", "score": "0.5945759", "text": "function objSetJoins(j, v) {\r\n if(parseInt(v) === 1) {\r\n this.last = this.current\r\n this.current = j\r\n Object.keys(this.joins).map(function(join) {\r\n var joinList = Object.keys(this.joins).map(function(join) {\r\n return {join: this.joins[join], value: 0}\r\n }.bind(this))\r\n CF.setJoins(joinList, false)\r\n CF.setJoin(this.joins[j], 1, false)\r\n }.bind(this)) \r\n }\r\n }", "title": "" }, { "docid": "470e6f67f96c68b617ad6e4652ecfe6b", "score": "0.59387684", "text": "function getJoin(op,query,t2,t2Name){\n\n\t\t\tif(op == \"JOIN\"){ //implicit join (with where condition)\n\t\t\t\tif(jQuery.isEmptyObject(query)){\n\t\t\t\t\tquery.From = {};\n\t\t\t\t\tquery.From[t2Name] = t2;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tquery.From[t2Name] = t2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn query;\n\t\t\t}\n\t\t\t\n\t\t\tswitch(op.toLowerCase().trim()){\n\t\t\tcase \"join\":\n\t\t\t\tquery.Join = {};\n\t\t\t\tquery.Join[t2Name] = t2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"natural join\": \n\t\t\t\tquery.NaturalJoin = {};\n\t\t\t\tquery.NaturalJoin[t2Name] = t2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"left join\":\n\t\t\tcase \"left outer join\":\n\t\t\t\tquery.LeftJoin = {};\n\t\t\t\tquery.LeftJoin[t2Name] = t2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"right join\":\n\t\t\tcase \"right outer join\":\n\t\t\t\tquery.RightJoin = {};\n\t\t\t\tquery.RightJoin[t2Name] = t2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"full join\":\n\t\t\tcase \"full outer join\":\n\t\t\t\tquery.FullJoin = {};\n\t\t\t\tquery.FullJoin[t2Name] = t2;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"cross join\":\n\t\t\t\tquery.CrossJoin = {};\n\t\t\t\tquery.CrossJoin[t2Name] = t2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\treturn query;\n\t\t}", "title": "" }, { "docid": "9340688cc06ad0c27d53b19284dda1a7", "score": "0.5932451", "text": "function DataJoin(){\n return new Promise(async (resolve) => { \n ColumnHeaders = []\n var PrimaryRows = await GetTableData('SELECT * FROM \"' + PrimaryTable + '\"');\n var SecondaryRows = await GetTableData('SELECT * FROM \"'+ SecondaryTable+ '\"');\n for ( var property in SecondaryRows[0] ) {\n if(property != 'Id' & property != ForeignKey){\n ColumnHeaders.push(' \"'+property+'\" '); \n } \n }; \n for(var i = 0;i<PrimaryRows.length;i++){ \n \n PrimaryRows[i][NewPropertyName] = await GetTableData('SELECT '+ ColumnHeaders.toString() +' FROM ' + SecondaryTable + ' WHERE '+ ForeignKey + ' = '+ PrimaryRows[i].Id.toString());\n delete PrimaryRows[i]['Id']\n }\n \n resolve(PrimaryRows)\n })\n }", "title": "" }, { "docid": "fc746374fb5b6df8c0ef3b3bad3836cd", "score": "0.58883846", "text": "function generateJoinSQL() {\n this._joinTree.reset();\n let queryFields;\n\n switch(this._qType) {\n case null:\n case QueryType.VALUES_LIST:\n queryFields = this._selectFields;\n break;\n\n default:\n queryFields = null;\n }\n\n if(queryFields != null) {\n queryFields.forEach(i => buildJoins.call(this, i));\n }\n\n this._distinctFields.forEach(i => buildJoins.call(this, i));\n this._orderFields.forEach(i => buildJoins.call(this, i));\n\n this._filters.forEach(i => buildJoins.call(this, i.join));\n this._notFilters.forEach(i => buildJoins.call(this, i.join));\n\n // return join SQL string\n return this._joinTree.generateJoinSQL();\n}", "title": "" }, { "docid": "3803e89df5bfa46611b551da298189f9", "score": "0.5886843", "text": "join() {\n let sql = '';\n let i = -1;\n const joins = this.grouped.join;\n if (!joins) return '';\n while (++i < joins.length) {\n const join = joins[i];\n const table = join.schema ? `${join.schema}.${join.table}` : join.table;\n if (i > 0) sql += ' ';\n if (join.joinType === 'raw') {\n sql += this.formatter.unwrapRaw(join.table);\n } else {\n sql += join.joinType + ' join ' + this.formatter.wrap(table);\n let ii = -1;\n while (++ii < join.clauses.length) {\n const clause = join.clauses[ii];\n if (ii > 0) {\n sql += ` ${clause.bool} `;\n } else {\n sql += ` ${clause.type === 'onUsing' ? 'using' : 'on'} `;\n }\n const val = this[clause.type].call(this, clause);\n if (val) {\n sql += val;\n }\n }\n }\n }\n return sql;\n }", "title": "" }, { "docid": "c2f2382c649e9930285764a848ccae32", "score": "0.5874279", "text": "join(table, first) {\n let join;\n const { schema } = this._single;\n const joinType = this._joinType();\n if (typeof first === 'function') {\n join = new JoinClause(table, joinType, schema);\n first.call(join, join);\n } else if (joinType === 'raw') {\n join = new JoinClause(this.client.raw(table, first), 'raw');\n } else {\n join = new JoinClause(\n table,\n joinType,\n table instanceof Builder ? undefined : schema\n );\n if (arguments.length > 1) {\n join.on.apply(join, toArray(arguments).slice(1));\n }\n }\n this._statements.push(join);\n return this;\n }", "title": "" }, { "docid": "debeea1b764881315fa529326e1bb1df", "score": "0.58713216", "text": "static patch() {\n Base.joinEagerRelations = FindOptionsUtils.joinEagerRelations;\n }", "title": "" }, { "docid": "80dd5cceff0f15f9f38691112881ea23", "score": "0.5828542", "text": "function autoJoin() { \n Belay.off();\n var previousPils = []; \n for (var i=0; i < pipeline.length; i++) {\n var stage = pipeline[i];\n var currentId = \"stage-\" + i; \n if (!isParallelStage(stage)) { \n joinWith(previousPils, currentId); \n previousPils = [currentId]; \n } else { \n var currentPils = [];\n for (j = 0; j < stage.streams.length; j++) {\n currentPils[j] = currentId + \"-\" + j; \n }\n for (var j=0; j < stage.streams.length; ++j) {\n joinWith(previousPils, currentPils[j]);\n }\n previousPils = currentPils; \n }\n } \n}", "title": "" }, { "docid": "96e1ac5804fa9269e1f72eda6b755427", "score": "0.5790877", "text": "_processJoin(\n docroot: DocumentNode[],\n node: JoinNode,\n variables: {},\n aliases: string[]\n ) {\n // Get basic information associated with join\n const { table } = node;\n\n // Start a new QueryBuilder\n const qb = this._qb.select().from(table);\n\n // Get 'on' selector as interpolated string\n const on = this._getOnString(docroot, node, variables, aliases);\n\n // Add 'where' statement if applicable\n this._addSelectors(docroot, node, variables, qb);\n\n // Gets and applies all fields contained in this join\n const fields = this._addAllFieldsAndJoins(\n docroot,\n node,\n variables,\n aliases,\n qb\n );\n\n // Return an object with info about the JOIN\n return {\n qb, // <-- QueryBuilder object\n table, // <-- table name\n fields, // <-- All fields\n on // <-- 'on' selector statement\n };\n }", "title": "" }, { "docid": "a859b2e16a3e9bd7db78895d233ead59", "score": "0.57622784", "text": "join(cols, tables, joined_fields, conditions=[], type='join'){\r\n if(cols == \"*\"){\r\n var query = \"select * \";\r\n }else{\r\n var query = \"select \";\r\n for(var i = 0; i < cols.length-1; i++){\r\n query += (cols[i] + \", \");\r\n }\r\n }\r\n query += cols[cols.length-1] + \" from \";\r\n\r\n for(var i = 0; i < tables.length-1; i++){\r\n query += this.database +\".\"+ tables[i] + \" \" + type + \" \"+ this.database + \".\" + tables[i+1] + \" on \" + joined_fields[i];\r\n }\r\n\r\n if(conditions.length != 0){\r\n query += \" where \";\r\n for(var i = 0; i < conditions.length - 1; i++){\r\n query += conditions[i] + \" and \";\r\n }\r\n query += conditions[conditions.length-1];}\r\n return query + \";\";\r\n }", "title": "" }, { "docid": "069deeb37e8261ea48badbd26fae3f09", "score": "0.5751206", "text": "_joinType(val) {\n if (arguments.length === 1) {\n this._joinFlag = val;\n return this;\n }\n const ret = this._joinFlag || 'inner';\n this._joinFlag = 'inner';\n return ret;\n }", "title": "" }, { "docid": "abbdeea8aefe5ba156631ea7e0bd8174", "score": "0.57299614", "text": "function join(lookupTable, mainTable, lookupKey, mainKey, select) {\n let l = lookupTable.length,\n m = mainTable.length,\n lookupIndex = [],\n output = [];\n for (let i = 0; i < l; i++) { // loop through l items\n let row = lookupTable[i];\n lookupIndex[row[lookupKey]] = row; // create an index for lookup table\n }\n for (let j = 0; j < m; j++) { // loop through m items\n let y = mainTable[j];\n let x = lookupIndex[y[mainKey]]; // get corresponding row from lookupTable\n output.push(select(y, x)); // select only the columns you need\n }\n return output;\n}", "title": "" }, { "docid": "f21dabea730aa09870adb03359aa889e", "score": "0.57223487", "text": "function join(lookupTable, mainTable, lookupKey, mainKey, select) {\n var l = lookupTable.length,\n m = mainTable.length,\n lookupIndex = [],\n output = [];\n for (var i = 0; i < l; i++) { // loop through l items\n var row = lookupTable[i];\n lookupIndex[row[lookupKey]] = row; // create an index for lookup table\n }\n for (var j = 0; j < m; j++) { // loop through m items\n var y = mainTable[j];\n var x = lookupIndex[y[mainKey]]; // get corresponding row from lookupTable\n output.push(select(y, x)); // select only the columns you need\n }\n return output;\n}", "title": "" }, { "docid": "5ea354a059124c38113359b9c26197f8", "score": "0.57066864", "text": "_addJoins(query, listAdapter, where, tableAlias) {\n const joinPaths = Object.keys(where).filter(\n path => !listAdapter._getQueryConditionByPath(path)\n );\n for (let path of joinPaths) {\n if (path === 'AND' || path === 'OR') {\n // AND/OR we need to traverse their children\n where[path].forEach(x => this._addJoins(query, listAdapter, x, tableAlias));\n } else {\n const otherAdapter = listAdapter.fieldAdaptersByPath[path];\n // If no adapter is found, it must be a query of the form `foo_some`, `foo_every`, etc.\n // These correspond to many-relationships, which are handled separately\n if (otherAdapter) {\n // We need a join of the form:\n // ... LEFT OUTER JOIN {otherList} AS t1 ON {tableAlias}.{path} = t1.id\n // Each table has a unique path to the root table via foreign keys\n // This is used to give each table join a unique alias\n // E.g., t0__fk1__fk2\n const otherList = otherAdapter.refListKey;\n const otherListAdapter = listAdapter.getListAdapterByKey(otherList);\n const otherTableAlias = `${tableAlias}__${path}`;\n if (!this._tableAliases[otherTableAlias]) {\n this._tableAliases[otherTableAlias] = true;\n query.leftOuterJoin(\n `${otherListAdapter.tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.id`,\n `${tableAlias}.${path}`\n );\n }\n this._addJoins(query, otherListAdapter, where[path], otherTableAlias);\n }\n }\n }\n }", "title": "" }, { "docid": "ccf348a3e7d35af4c2041b85e5edb059", "score": "0.5641518", "text": "function getJoinsTableAllPaths (currentModel, tables,currentNode,visited){\r\n var inoutLinks = graphTGDs.getConnectedLinks(currentModel, { deep: true }); // inbound and outbound \r\n\r\n for (var edge of inoutLinks){\r\n var edgeView=edge.findView(paperTGDs);\r\n if (edgeView.sourceView.model.attributes.type==\"db.Table\" && edgeView.targetView.model.attributes.type==\"db.Table\"){ \r\n if (visited.includes(edge.id)==false){ \r\n if (edgeView.sourceView.model.id==currentModel.id){ //wrong never equal the same id always different REDO!!\r\n \tif (!currentNode.id.includes(edgeView.targetView.model.id)){\r\n\t var obj={id:currentNode.id+\",\"+edgeView.targetView.model.id, text:currentNode.text+\",\"+edgeView.targetView.model.attributes.question}\r\n\t if (tables.some(ta=>ta['id']===obj.id)==false){\r\n\t tables.push(obj);\r\n\t visited.push(edge.id);\r\n\t if (edgeView.sourceView.model.id!=edgeView.targetView.model.id){\r\n\t \tvar aux=Object.assign({}, currentNode);\r\n\t currentNode=obj; \r\n\t getJoinsTableAllPaths(edgeView.targetView.model,tables,currentNode,visited);\r\n\t currentNode=aux;\r\n\t } \r\n\t }\r\n \t}\r\n }else if (edgeView.targetView.model.id==currentModel.id){\r\n \tif (!currentNode.id.includes(edgeView.sourceView.model.id)){ \t\r\n\t var obj={id:currentNode.id+\",\"+edgeView.sourceView.model.id, text:currentNode.text+\",\"+edgeView.sourceView.model.attributes.question}\r\n\t if (tables.some(ta=>ta['id']===obj.id)==false){\r\n\t tables.push(obj);\r\n\t visited.push(edge.id);\r\n\t \r\n\t if (edgeView.sourceView.model.id!=edgeView.targetView.model.id){\r\n\t \tvar aux=Object.assign({}, currentNode);\r\n\t currentNode=obj; \r\n\t getJoinsTableAllPaths(edgeView.sourceView.model,tables,currentNode,visited);\r\n\t currentNode=aux;\r\n\t }\r\n\t }\r\n \t}\r\n }\r\n \r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "72730da2b710de0666768b38afff80cd", "score": "0.5624025", "text": "function materializeJoin(joinInstructions, rawData, nrows=10) {\n console.log(\"in materializeJoin, rawData.length is \", rawData.length);\n // console.log(\" and joinInstructions are\", joinInstructions)\n // joinInstructions will have format like this (note the recursion):\n // const joinInstructions = {\n // 'dataset': '185',\n // 'operation': 'join-string',\n // 'aggregationOp': null,\n // 'column': 'Player',\n // 'relationship': 'date-of-birth',\n // 'relationshipUri': 'http://www.wikidata.org/prop/P1082'\n // 'parentJoin': {\n // 'operation': 'join-count',\n // 'relationship': 'awards',\n // }\n // }\n if (nrows < 0) {\n nrows = rawData.length;\n }\n\n const joinOp = joinInstructions['operation'];\n const aggregationOp = joinInstructions['aggregationOp'];\n const joinRel = joinInstructions['relationship'];\n const joinRelUri = joinInstructions['relationshipUri'];\n const columnName = joinInstructions['parentEntityColumn'] || joinInstructions['column'];\n const isRecursive = joinInstructions['parentJoin'] ? true : false;\n // Here, we need to actually calculate the correct aggregation name.\n let resultingColName = '';\n resultingColName = calculateRecursiveColName(joinInstructions, columnName)\n const temporalSelectionInstructions = joinInstructions['temporalSelectionInstructions'];\n const temporalFilterChoice = temporalSelectionInstructions && temporalSelectionInstructions.temporalFilterChoice;\n const closestToDate = temporalSelectionInstructions && temporalSelectionInstructions.closestToDate;\n const inferDateAttribute = temporalSelectionInstructions && temporalSelectionInstructions.inferDateAttribute;\n\n if (temporalFilterChoice === 'most_recent') {\n resultingColName = 'most_recent-' + resultingColName;\n } else if (temporalFilterChoice === 'closest_to_date') {\n resultingColName = 'closest_to_' + closestToDate + '-' + resultingColName;\n } else if (temporalFilterChoice === 'other_column') {\n resultingColName = 'inferred_' + inferDateAttribute + '-' + resultingColName;\n }\n // if (aggregationOp) {\n // resultingColName = columnName + ' - ' + joinRel + ' (' + aggregationOp + ')';\n // } else {\n // resultingColName = columnName + ' - ' + joinRel;\n // }\n\n const COLUMN_MAPPINGS = {\n \"Player\": 'Q10871364' \n };\n\n // For now, we assume that we have a columnName mapping for the provided dataset.\n // 185_baseball headers and their mappings\n // Player,Number_seasons,Games_played,At_bats,Runs,Hits,Doubles,Triples,Home_runs,RBIs,Walks,Strikeouts,Batting_average,On_base_pct,Slugging_pct,Fielding_ave,Position,Hall_of_Fame\n\n // Right now, we don't do anything if we don't have a column ID.\n // if (!columnId) {\n // return Promise.resolve([]);\n // } else {\n\n\n /* join-string\n * join-number\n * join-collection-string\n *** Valid aggregationOps:\n - count\n - mode\n * join-collection-number\n *** Valid aggregationOps:\n - count\n - mean\n - median\n - mode\n - max\n - min\n - variance\n */\n\n return convertColumnToQIDs(rawData, columnName, nrows).then((sampledQIDs) => {\n console.log(\"joinOp is \", joinOp, \"and nrows is \", nrows, \" and sampledQIDs.length is \", sampledQIDs.length)\n if (isRecursive) {\n switch (joinOp) {\n case 'join-string':\n case 'join-collection-string':\n return materializeJoinCollectionString(rawData, columnName, joinRelUri, resultingColName, sampledQIDs, aggregationOp, joinInstructions);\n break;\n case 'join-number':\n case 'join-collection-number':\n return materializeJoinCollectionNumber(rawData, columnName, joinRelUri, resultingColName, sampledQIDs, aggregationOp, joinInstructions);\n break;\n default:\n return Promise.resolve([]);\n }\n } else {\n switch (joinOp) {\n case 'join-string':\n return materializeJoinString(rawData, columnName, joinRelUri, resultingColName, sampledQIDs, joinInstructions);\n break;\n case 'join-number':\n return materializeJoinNumber(rawData, columnName, joinRelUri, resultingColName, sampledQIDs, joinInstructions);\n break;\n case 'join-collection-string':\n return materializeJoinCollectionString(rawData, columnName, joinRelUri, resultingColName, sampledQIDs, aggregationOp, joinInstructions);\n break;\n case 'join-collection-number':\n return materializeJoinCollectionNumber(rawData, columnName, joinRelUri, resultingColName, sampledQIDs, aggregationOp, joinInstructions);\n break;\n default:\n return Promise.resolve([]);\n \n }\n }\n });\n // }\n}", "title": "" }, { "docid": "92ff2c6a997bbe3860c76325abb63990", "score": "0.5579857", "text": "_decorateRead () {\n this._makeJoinQuery()\n this.relatedQuery.where(`${this.through.table}.${this.toKey}`, this.parent[this.fromKey])\n }", "title": "" }, { "docid": "92ff2c6a997bbe3860c76325abb63990", "score": "0.5579857", "text": "_decorateRead () {\n this._makeJoinQuery()\n this.relatedQuery.where(`${this.through.table}.${this.toKey}`, this.parent[this.fromKey])\n }", "title": "" }, { "docid": "8b0a06112dd3a27eebf4acb53837bde1", "score": "0.5558519", "text": "function _getAdjacencyJoin() { \n var enter = [];\n var exit = [];\n var update = [];\n\n\n //determine which adjacencies to add and update \n _.forEach(layer.topology().data().adjacencies, function(adj){\n //if we don't already have cesium entites for this adjacency\n //add it to the enter array\n if(adjacencyEntityIds[adj.adjacencyId] === undefined){\n enter.push(adj);\n }\n //add it to the update array\n update.push(adj);\n });\n\n // determine which adjacencies to remove\n var topoAdjIds = _.map(layer.topology().data().adjacencies, function(adj){\n return adj.adjacencyId;\n });\n var entityAdjIds = _.keys(adjacencyEntityIds);\n exit = _.difference(entityAdjIds, topoAdjIds);\n\n return {\n enter: enter,\n exit: exit,\n update: update\n };\n }", "title": "" }, { "docid": "d228c0057a71597684c353e4690754a2", "score": "0.5524063", "text": "get_joinxp(refs){\n //\n //Convert the map to an array which has the following format:-\n //[[entity, {relations:relations, distance:distance}], [...], ...]\n const refs_array = [...refs.entries()];\n //\n //Sort the referenced entities, ordering them by the maximum distance of \n //the entity meaured from this one\n refs_array.sort((ref1,ref2)=>{\n //\n //Destructre ref1 and 2 to reveal the maximum distanace of the\n //referenced entity from this one. The entity and relations are\n //immaterial. Ref has the structure: [entity, {relations, distance}]\n const \n //Ignnore the destrucctered entity and relation.\n [, {distance:distance1}] = ref1,\n [, {distance:distance2}] = ref2;\n //\n //Return the comparison, negative, 0 or positive.\n return distance1 - distance2;\n });\n //\n //Use the sorted referenced entities to build the join expression from\n //'anded' sub-expressions.\n const joinxp = refs_array.map(ref_member=>{\n //\n //Destructure the ref to reveal the referenecd entity, the relations\n //that reference it, and the maximium distance of the entity from \n //this one\n const [entity, {relations, distance}] = ref_member;\n //\n //Formulate the referenced entity name, backticked ready for use\n //in an sql statement\n const ref = \"`\" + entity.name + \"`\";\n //\n //Use the relations to formulate 'ands' sub-expressions\n const ands = relations.map(relation=>{\n //\n //Formulate the 'and' subexpression\n //\n //Get the entity that is the home of the relation\n const home = \"`\" + relation.entity.name + \"`\";\n //\n //Formulate the and sb-expession. \n const and = `${home}.${ref}=${ref}.${ref}`;\n //\n //Return teh and\n return and;\n //\n //Separate the sub-expression with the AND operator \n }).join(' AND '); \n //\n //Formulate and return the join expression\n return `inner join ${ref} on ${ands}`;\n //\n //Use a hard return to separate the joinxps tto form the complete \n //expression.\n }).join(\"\\n\");\n //\n //Return the complete join expression.\n return joinxp;\n }", "title": "" }, { "docid": "2481c03cc4329e79607c425c391a61bc", "score": "0.54981565", "text": "function dotToJoin(query) {\n const props = query.where && Object.keys(query.where);\n if (!props || props.length == 0)\n return query;\n\n const where = query.where,\n newq = deepmerge({}, query);\n\n props.forEach(p => {\n const s = p.split('.');\n if (s.length > 1) {\n const [key, value] = s;\n const filter = where[p];\n const joinid = \"$\" + key;\n\n if (!newq.join) newq.join = {};\n if (!newq.join[joinid]) {\n newq.join[joinid] = {\n key,\n where: {\n [value]: filter\n }\n };\n if (newq.where[key]) {\n newq.join[joinid].where[key] = newq.where[key];\n }\n newq.where[key] = joinid;\n } else {\n newq.join[joinid].where[value] = filter;\n }\n delete newq.where[p];\n }\n });\n\n //console.log(\"Transformed query: \", query, newq);\n return newq;\n }", "title": "" }, { "docid": "57eae4b011febbddcfa94b831390c6e2", "score": "0.5484229", "text": "join() {\n return this.match({\n nil: () => M_List.Nil(),\n cons: (head) => (tail) => head.concat(tail.join())\n });\n }", "title": "" }, { "docid": "6f8eb5dda41619ea3ce58bf3a5f55a01", "score": "0.54810333", "text": "join() {\n return new this.__proto__.constructor((state) => {\n let tuple = this.runState(state);\n return tuple.nth(0).runState(tuple.nth(1));\n });\n }", "title": "" }, { "docid": "2af4565751eee534642b9bf02b06f955", "score": "0.5467927", "text": "function materializeJoinNumber(rawData, sourceColName, targetRelUri, targetColumnName, qids, throughJoinInstructions={}) {\n return materializeJoinString(rawData, sourceColName, targetRelUri, targetColumnName, qids, throughJoinInstructions);\n}", "title": "" }, { "docid": "ee364012b4648e8bff4d2b90c64d1a9e", "score": "0.54674536", "text": "function addJoin(join_type, v, coordCurr, normPrev, normNext, isBeginning, context) {\n var miterVec = createMiterVec(normPrev, normNext);\n var isClockwise = (normNext[0] * normPrev[1] - normNext[1] * normPrev[0] > 0);\n\n if (context.texcoord_index != null) {\n zero_v[1] = v;\n one_v[1] = v;\n }\n\n if (isClockwise){\n addVertex(coordCurr, miterVec, miterVec, 1, v, context, 1);\n addVertex(coordCurr, normPrev, miterVec, 0, v, context, -1);\n\n if (!isBeginning) {\n indexPairs(1, context);\n }\n\n addFan(coordCurr,\n // extrusion vector of first vertex\n Vector.neg(normPrev),\n // controls extrude distance of pivot vertex\n miterVec,\n // extrusion vector of last vertex\n Vector.neg(normNext),\n // line normal (unused here)\n miterVec,\n // uv coordinates\n zero_v, one_v, zero_v,\n false, (join_type === JOIN_TYPE.bevel), context\n );\n\n addVertex(coordCurr, miterVec, miterVec, 1, v, context, 1);\n addVertex(coordCurr, normNext, miterVec, 0, v, context, -1);\n } else {\n addVertex(coordCurr, normPrev, miterVec, 1, v, context, 1);\n addVertex(coordCurr, miterVec, miterVec, 0, v, context, -1);\n\n if (!isBeginning) {\n indexPairs(1, context);\n }\n\n addFan(coordCurr,\n // extrusion vector of first vertex\n normPrev,\n // extrusion vector of pivot vertex\n Vector.neg(miterVec),\n // extrusion vector of last vertex\n normNext,\n // line normal for offset\n miterVec,\n // uv coordinates\n one_v, zero_v, one_v,\n false, (join_type === JOIN_TYPE.bevel), context\n );\n\n addVertex(coordCurr, normNext, miterVec, 1, v, context, 1);\n addVertex(coordCurr, miterVec, miterVec, 0, v, context, -1);\n }\n}", "title": "" }, { "docid": "43b62570562affbd42a3c9d52c275043", "score": "0.5442661", "text": "function FullJoinOperator(envir, clause) {\n this.clause = clause;\n this.envir = envir;\n AbstractOpertor.call(this);\n return this;\n}", "title": "" }, { "docid": "f31e1db1dd2bdd201532b3b5f9474662", "score": "0.5440665", "text": "function materializeJoinString(rawData, sourceColName, targetRelUri, targetColumnName, qids, throughJoinInstructions={}) {\n\n return getRelatedLiteralColumn(targetRelUri, qids).then((responses) => {\n if (responses) {\n // console.log(\"literalColumn length is \", responses.length)\n return joinColumn(rawData, targetColumnName, responses)\n } else {\n return [];\n }\n });\n}", "title": "" }, { "docid": "847d0d16cb34db47effc30d25e66a84f", "score": "0.5429042", "text": "function joinStatic(outer, inner, outerKeySelector, innerKeySelector, resultSelector) {\n // TODO: Write static join function without instantiating a new Linq object\n return new linq_1.Linq(outer).join(inner, outerKeySelector, innerKeySelector, resultSelector).toArray();\n}", "title": "" }, { "docid": "f1204cd4d755b6c08bd5d40c3a795cc6", "score": "0.54270726", "text": "function getJoin(rels, r) {\n let res = [];\n for (let i = 0; i < rels.length; i++) {\n let rel = rels[i];\n let join = joinMap[rel + ',' + r];\n if (join) {\n join.columns.forEach((column, index) => {\n let column2 = join.column2[index];\n let tableName = join.tableName;\n let tableName2 = join.tableName2;\n if (tableName === r) {\n let i = tableName;\n tableName = tableName2;\n tableName2 = i;\n i = column;\n column = column2;\n column2 = i\n }\n res.push({tableName, tableName2, column, column2})\n })\n }\n join = joinMap[r + ',' + rel];\n if (join) {\n join.columns.forEach((column, index) => {\n let column2 = join.column2[index];\n let tableName = join.tableName;\n let tableName2 = join.tableName2;\n if (tableName === r) {\n let i = tableName;\n tableName = tableName2;\n tableName2 = i;\n i = column;\n column = column2;\n column2 = i\n }\n res.push({tableName, tableName2, column, column2})\n })\n }\n }\n return res.length === 1 ? res[0] : res\n }", "title": "" }, { "docid": "6000d333503c7ab76db05d993680ea6d", "score": "0.5385102", "text": "join(){\n\n }", "title": "" }, { "docid": "408ddce1d277331124955b0fc30c6483", "score": "0.5368252", "text": "join() {\r\n return Array.from(this).join(...arguments);\r\n }", "title": "" }, { "docid": "95c24a1f228cb3bc4f1aec7573f80366", "score": "0.5339514", "text": "function testOuterJoin_ThrowsOnlyJoinPredicateAllowed() {\n var query = new lf.query.SelectBuilder(hr.db.getGlobal(), []);\n\n var buildQuery = function() {\n var j = db.getSchema().getJob();\n var e = db.getSchema().getEmployee();\n query.from(e).leftOuterJoin(\n j, lf.op.and(j.id.eq(e.jobId), j.id.eq('jobId1')));\n };\n\n // 541: Outer join accepts only join predicate.\n lf.testing.util.assertThrowsError(541, buildQuery);\n}", "title": "" }, { "docid": "8ea4a36f4b2dad57cc482016f30376dc", "score": "0.53367627", "text": "function equijoinWithDefault(xs, ys, primary, foreign, sel, def) {\n const iy = ys.reduce((iy, row) => iy.set(row[foreign], row), new Map);\n return xs.map(row => typeof iy.get(row[primary]) !== 'undefined' ? sel(row, iy.get(row[primary])): sel(row, def));\n }", "title": "" }, { "docid": "c2bd45fb82925c6338a6feb1f50e791e", "score": "0.53088486", "text": "function outerJoinHandler(dbName, index_field, index_table, index_on, command_arr, location) {\n\tvar table_1 = document.getElementById(\"table_1\");\n\tvar table_2 = document.getElementById(\"table_2\");\n\tvar msg = document.getElementById(\"msg\");\n\n\tif (location) {\n\t\tlocation = document.getElementById(location);\n\t} \t\n\t\n\tvar request=indexedDB.open(dbName);\n\t\n\tvar req_tables = [];\n\treq_tables[0] = command_arr[index_table];\n\treq_tables[1] = command_arr[index_table+3];\n\t\n\tvar req_field = command_arr[index_field];\n\tvar split_req_field = req_field.split(',');\n\t\n\t//Check if the required field contains . or not\n\t//select class>>>.<<<department, student>>>.<<<id from student, class where student.department = class.department\n\tfor (var i=0; i<split_req_field.length; i++) {\n\t\tif (split_req_field.length == 1 && split_req_field[0] == '*') {\n\t\t\tbreak;\n\t\t}\n\t\telse if (split_req_field[i].search('\\\\.') == -1) {\n\t\t\tif (msg) { msg.innerHTML = 'ERROR[20]: Wrong input field (' + split_req_field[i] + ')<br/>'; }\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\tvar field_table1 = [];\n\tvar field_table1_count = 0;\n\tvar field_table2 = [];\n\tvar field_table2_count = 0;\n\tvar table\n\t\n\tvar object_result =[];\n\tvar display_result = [];\n\t\n\t//Check if the required table correct\n\t//select >>>class<<<.department, >>>student<<<.id from student, class where student.department = class.department\n\tfor (var i=0; i<split_req_field.length; i++) {\n\t\tif (split_req_field.length == 1 && split_req_field[0] == '*') {\n\t\t\ttable = '*';\n\t\t} else {\n\t\t\tvar str = split_req_field[i].split('.');\n\t\t\ttable = str[0];\n\t\t}\n\t\t\n\t\tif (table == req_tables[0]) {\n\t\t\tfield_table1[field_table1_count] = str[1];\n\t\t\tfield_table1_count++;\n\t\t} else if (table == req_tables[1]) {\n\t\t\tfield_table2[field_table2_count] = str[1];\n\t\t\tfield_table2_count++;\n\t\t} else if (table == '*') {\n\t\t\tfield_table1[0] = '*';\n\t\t\tfield_table2[0] = '*';\n\t\t} else {\n\t\t\tif (msg) { msg.innerHTML = 'ERROR[21]: Wrong input table (' + table + ')<br/>'; }\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\tvar search_field1 = command_arr[index_on+1].split('.');\n\tvar table1 = search_field1[0];\n\tvar field1 = search_field1[1];\n\t\n\tvar operator = command_arr[index_on+2];\n\tif (operator != '=') {\n\t\tif (msg) { msg.innerHTML += 'ERROR[5]: No such operator' + ' (' + operator + ')<br/>'; }\n\t\treturn;\n\t}\n\t\n\tvar search_field2 = command_arr[index_on+3].split('.');\n\tvar table2 = search_field2[0];\n\tvar field2 = search_field2[1];\n\t\n\tif (req_tables[0] != table1 || req_tables[1] != table2) {\n\t\tif (msg) { msg.innerHTML = 'ERROR[23]: Tables not match (' + req_tables + '|' + table1 + ',' + table2 + ')'; }\n\t\t\treturn;\n\t}\n\t\n\trequest.onsuccess = function (e) {\n\t\tdb = this.result;\n\t\t\n\t\tvar dTableNames = db.objectStoreNames;\n\t\tvar match_table=0;\n\t\tfor (var i = 0; i < dTableNames.length; i++) {\n\t\t\tfor (var j=0; j<req_tables.length; j++) {\n\t\t\t\tif (req_tables[j] == dTableNames[i]) {\n\t\t\t\t\tmatch_table++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (match_table != req_tables.length) {\n\t\t\tif (msg) { msg.innerHTML += 'ERROR[10]: Object store (' + req_tables + ') is not exist.<br/>'; }\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar transaction = db.transaction([req_tables[0], req_tables[1]]);\n\t\t\n\t\tvar firstCursor;\n\t\tvar firstCursorObj = {};\n\t\tvar firstCount=0;\n\t\tvar secondCursor;\n\t\tvar secondCursorObj = {};\n\t\tvar secondCount=0;\n\t\t\n\t\tvar row_count=0;\n\t\t\n\t\tvar firstStore = transaction.objectStore(req_tables[0]);\n\t\tvar req = firstStore.openCursor();\n\t\treq.onsuccess = function(event) {\n\t\t\tfirstCursor = event.result || event.target.result;\n\t\t\tif (firstCursor) {\n\t\t\t\tvar data ='{';\n\t\t\t\tfor (var i=0; i<firstStore.indexNames.length; i++) {\n\t\t\t\t\tdata += firstStore.indexNames[i];\n\t\t\t\t\t\n\t\t\t\t\tif (typeof firstCursor.value[firstStore.indexNames[i]] == \"string\") {\n\t\t\t\t\t\tdata += ': \"' + firstCursor.value[firstStore.indexNames[i]] + '\"';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdata += ': ' + firstCursor.value[firstStore.indexNames[i]];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (i != firstStore.indexNames.length-1) {\n\t\t\t\t\t\tdata += ',';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdata += '}';\n\t\t\t\teval('firstCursorObj[firstCount] =' +data);\n\t\t\t\tfirstCount++;\n\t\t\t\tdata = '';\n\t\t\t\tfirstCursor.continue();\n\t\t\t}\n\t\t};\n\t\t\n\t\tvar secondStore = transaction.objectStore(req_tables[1]);\n\t\tvar req = secondStore.openCursor();\n\t\treq.onsuccess = function(event) {\n\t\t\tsecondCursor = event.result || event.target.result;\n\t\t\tif (secondCursor) {\n\t\t\t\tvar data ='{';\n\t\t\t\tfor (var i=0; i<secondStore.indexNames.length; i++) {\n\t\t\t\t\tdata += secondStore.indexNames[i];\n\t\t\t\t\t\n\t\t\t\t\tif (typeof secondCursor.value[secondStore.indexNames[i]] == \"string\") {\n\t\t\t\t\t\tdata += ': \"' + secondCursor.value[secondStore.indexNames[i]] + '\"';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdata += ': ' + secondCursor.value[secondStore.indexNames[i]];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (i != secondStore.indexNames.length-1) {\n\t\t\t\t\t\tdata += ',';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdata += '}';\n\t\t\t\teval('secondCursorObj[secondCount] =' +data);\n\t\t\t\tsecondCount++;\n\t\t\t\tdata = '';\n\t\t\t\tsecondCursor.continue();\n\t\t\t}\n\t\t};\n\t\t\n\t\ttransaction.oncomplete = function(event) {\n\t\t\t\n\t\t\tvar outputStr = '<h3>' + req_tables[0] +' x '+ req_tables[1] +'</h3>' + '<table><tr class=\"first_row\">';\n\t\t\toutputStr += '<td></td>';\n\t\t\t\n\t\t\tfor (var field in firstCursorObj[0]) {\n\t\t\t\n\t\t\t\tfor (var i=0; i<field_table1.length; i++) {\n\t\t\t\t\tif (field_table1[i] == field || field_table1[0] == '*') {\n\t\t\t\t\t\toutputStr += '<td>' + table1 + '_' + field + '</td>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\tfor (var field in secondCursorObj[0]) {\n\t\t\t\t\n\t\t\t\tfor (var i=0; i<field_table2.length; i++) {\n\t\t\t\t\tif (field_table2[i] == field || field_table2[0] == '*') {\n\t\t\t\t\t\toutputStr += '<td>' + table2 + '_' + field + '</td>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\toutputStr += '</tr><tr>';\n\t\t\t\n\t\t\tif (command_arr[index_table+1].toLowerCase() == \"left\") {\n\t\t\t\t//=====================Nested Loop Join==========================\n\t\t\t\tfor (var i=0; i<Object.keys(firstCursorObj).length; i++) {\n\t\t\t\t\tvar sec_match_count = 0;\n\t\t\t\t\tfor (var j=0; j<Object.keys(secondCursorObj).length; j++) {\n\n\t\t\t\t\t\tif (firstCursorObj[i][field1] == secondCursorObj[j][field2]) {\n\t\t\t\t\t\t\toutputStr += '<td>' + (row_count+1) + '</td>';\n\t\t\t\t\t\t\tvar data ='{';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (var field in firstCursorObj[i]) {\n\t\t\t\t\t\t\t\tfor (var k=0; k<field_table1.length; k++) {\n\t\t\t\t\t\t\t\t\tif (field_table1[k] == field || field_table1[0] == '*') {\n\t\t\t\t\t\t\t\t\t\tdata += table1 + '_' + field;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (typeof firstCursorObj[i][field] == \"string\") {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': \"' + firstCursorObj[i][field] + '\",';\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': ' + firstCursorObj[i][field] + ',';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\toutputStr += '<td>' + firstCursorObj[i][field] + '</td>';\n\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (var field in secondCursorObj[j]) {\n\t\t\t\t\t\t\t\tfor (var k=0; k<field_table2.length; k++) {\n\t\t\t\t\t\t\t\t\tif (field_table2[k] == field || field_table2[0] == '*') {\n\t\t\t\t\t\t\t\t\t\tdata += table2 + '_' + field;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (typeof secondCursorObj[j][field] == \"string\") {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': \"' + secondCursorObj[j][field] + '\",';\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': ' + secondCursorObj[j][field] + ',';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\toutputStr += '<td>' + secondCursorObj[j][field] + '</td>';\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutputStr += '</tr>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata=data.slice(0, -1);\n\t\t\t\t\t\t\tdata += '}';\n\t\t\t\t\t\t\teval('object_result[row_count] =' +data);\n\t\t\t\t\t\t\trow_count++;\n\t\t\t\t\t\t\tsec_match_count++;\n\t\t\t\t\t\t\tdata = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\tif (sec_match_count == 0) {\n\t\t\t\t\t\toutputStr += '<td>' + (row_count+1) + '</td>';\n\t\t\t\t\t\tvar data ='{';\n\t\t\t\t\t\tfor (var field in firstCursorObj[i]) {\n\t\t\t\t\t\t\tfor (var k=0; k<field_table1.length; k++) {\n\t\t\t\t\t\t\t\tif (field_table1[k] == field || field_table1[0] == '*') {\n\t\t\t\t\t\t\t\t\tdata += table1 + '_' + field;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (typeof firstCursorObj[i][field] == \"string\") {\n\t\t\t\t\t\t\t\t\t\tdata += ': \"' + firstCursorObj[i][field] + '\",';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdata += ': ' + firstCursorObj[i][field] + ',';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\toutputStr += '<td>' + firstCursorObj[i][field] + '</td>';\n\t\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\tfor (var field in secondCursorObj[0]) {\n\t\t\t\t\t\t\tfor (var k=0; k<field_table2.length; k++) {\n\t\t\t\t\t\t\t\tif (field_table2[k] == field || field_table2[0] == '*') {\n\t\t\t\t\t\t\t\t\tdata += table2 + '_' + field;\n\t\t\t\t\t\t\t\t\tdata += ': \" \",';\n\t\t\t\t\t\t\t\t\toutputStr += '<td>' + ' ' + '</td>';\n\t\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\n\t\t\t\t\t\toutputStr += '</tr>';\n\t\t\t\t\t\tdata = data.slice(0, -1);\n\t\t\t\t\t\tdata += '}';\n\t\t\t\t\t\teval('object_result[row_count] =' +data);\n\t\t\t\t\t\trow_count++;\n\t\t\t\t\t\tdata = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//=====================Nested Loop Join==========================*/\n\t\t\t} else {\n\t\t\t\t//=====================Nested Loop Join==========================\n\t\t\t\tfor (var i=0; i<Object.keys(secondCursorObj).length; i++) {\n\t\t\t\t\tvar sec_match_count = 0;\n\t\t\t\t\tfor (var j=0; j<Object.keys(firstCursorObj).length; j++) {\n\t\t\t\t\t\tif (firstCursorObj[j][field1] == secondCursorObj[i][field2]) {\n\t\t\t\t\t\t\toutputStr += '<td>' + (row_count+1) + '</td>';\n\t\t\t\t\t\t\tvar data ='{';\n\t\t\t\t\t\t\tfor (var field in firstCursorObj[j]) {\n\t\t\t\t\t\t\t\tfor (var k=0; k<field_table1.length; k++) {\n\t\t\t\t\t\t\t\t\tif (field_table1[k] == field || field_table1[0] == '*') {\n\t\t\t\t\t\t\t\t\t\tdata += table1 + '_' + field;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (typeof firstCursorObj[j][field] == \"string\") {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': \"' + firstCursorObj[j][field] + '\",';\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': ' + firstCursorObj[j][field] + ',';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\toutputStr += '<td>' + firstCursorObj[j][field] + '</td>';\n\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (var field in secondCursorObj[i]) {\n\t\t\t\t\t\t\t\tfor (var k=0; k<field_table2.length; k++) {\n\t\t\t\t\t\t\t\t\tif (field_table2[k] == field || field_table2[0] == '*') {\n\t\t\t\t\t\t\t\t\t\tdata += table2 + '_' + field;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (typeof secondCursorObj[i][field] == \"string\") {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': \"' + secondCursorObj[i][field] + '\",';\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdata += ': ' + secondCursorObj[i][field] + ',';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\toutputStr += '<td>' + secondCursorObj[i][field] + '</td>';\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toutputStr += '</tr>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdata = data.slice(0, -1);\n\t\t\t\t\t\t\tdata += '}';\n\t\t\t\t\t\t\teval('object_result[row_count] =' +data);\n\t\t\t\t\t\t\trow_count++;\n\t\t\t\t\t\t\tsec_match_count++;\n\t\t\t\t\t\t\tdata = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (sec_match_count == 0) {\n\t\t\t\t\t\toutputStr += '<td>' + (row_count+1) + '</td>';\n\t\t\t\t\t\tvar data ='{';\n\n\t\t\t\t\t\tfor (var field in firstCursorObj[0]) {\n\t\t\t\t\t\t\tfor (var k=0; k<field_table1.length; k++) {\n\t\t\t\t\t\t\t\tif (field_table1[k] == field || field_table1[0] == '*') {\n\t\t\t\t\t\t\t\t\tdata += table1 + '_' + field;\n\t\t\t\t\t\t\t\t\tdata += ': \" \",';\n\t\t\t\t\t\t\t\t\toutputStr += '<td>' + ' ' + '</td>';\n\t\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\n\t\t\t\t\t\tfor (var field in secondCursorObj[i]) {\n\t\t\t\t\t\t\tfor (var k=0; k<field_table2.length; k++) {\n\t\t\t\t\t\t\t\tif (field_table2[k] == field || field_table2[0] == '*') {\n\t\t\t\t\t\t\t\t\tdata += table2 + '_' + field;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (typeof secondCursorObj[i][field] == \"string\") {\n\t\t\t\t\t\t\t\t\t\tdata += ': \"' + secondCursorObj[i][field] + '\",';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdata += ': ' + secondCursorObj[i][field] + ',';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\toutputStr += '<td>' + secondCursorObj[i][field] + '</td>';\n\t\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\toutputStr += '</tr>';\n\t\t\t\t\t\tdata = data.slice(0, -1);\n\t\t\t\t\t\tdata += '}';\n\t\t\t\t\t\teval('object_result[row_count] =' +data);\n\t\t\t\t\t\trow_count++;\n\t\t\t\t\t\tdata = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//=====================Nested Loop Join==========================*/\n\t\t\t}\n\t\t\toutputStr += '</table><br/>';\n\t\t\t\n\t\t\tconsole.log('End: ' + new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds() + ':' + new Date().getMilliseconds());\n\t\t\t\n\t\t\tif (location) {\n\t\t\t\tlocation.innerHTML = outputStr;\n\t\t\t\tlocation.innerHTML += Object.keys(object_result).length + ' rows are selected.<br/>';\n\t\t\t}\n\t\t};\n\t\tdb.close();\n\t};\n\n}", "title": "" }, { "docid": "feed632b4801f76eec38fe35c670d3fe", "score": "0.5271337", "text": "function testOuterJoin_ThrowsFromNotCalled() {\n var query = new lf.query.SelectBuilder(hr.db.getGlobal(), []);\n\n var buildQuery = function() {\n var j = db.getSchema().getJob();\n var e = db.getSchema().getEmployee();\n query.leftOuterJoin(\n j, e.jobId.eq(j.id)).from(e);\n };\n\n // 542: from() has to be called before innerJoin() or leftOuterJoin().\n lf.testing.util.assertThrowsError(542, buildQuery);\n}", "title": "" }, { "docid": "3a69d17b719f0a7a88dee4e911652e66", "score": "0.52676487", "text": "function testInnerJoin_ThrowsFromNotCalled() {\n var query = new lf.query.SelectBuilder(hr.db.getGlobal(), []);\n\n var buildQuery = function() {\n var j = db.getSchema().getJob();\n var e = db.getSchema().getEmployee();\n query.innerJoin(\n j, e.jobId.eq(j.id)).from(e);\n };\n\n // 542: from() has to be called before innerJoin() or leftOuterJoin().\n lf.testing.util.assertThrowsError(542, buildQuery);\n}", "title": "" }, { "docid": "98183e2bb2aa46571439a7fee6573ccf", "score": "0.5263707", "text": "function LeftJoinOperator(envir, clause) {\n this.clause = clause;\n this.envir = envir;\n AbstractOpertor.call(this);\n return this;\n}", "title": "" }, { "docid": "75a9a6c343622dac3bc7c111615bacc0", "score": "0.5259508", "text": "function join(init) {\n return function (data) {\n return Array.prototype.join.call(data, init);\n };\n }", "title": "" }, { "docid": "ae7bb2426774a38006e46af8882765c9", "score": "0.52330935", "text": "function generateJoinQuery(filterObj, language, searchText = null) {\r\n let joinQuery = ` `;\r\n let breed = filterObj.filter ? filterObj.filter.breed : null;\r\n let laColumns = ['la.EarmarkText', 'la.BrandText', 'la.LivestockOriginReference', 'la.LivestockOriginPIC',\r\n 'la.IsPPSR', 'la.FinancierName', 'la.ManagementNo', 'la.ManagementGroup', 'la.NumberInBirth',\r\n 'la.NumberInReared', 'la.BirthProductivity', 'la.Progeny', 'la.IsHGP', 'la.HGPText', 'la.EIDBatchNo',\r\n 'la.LastMonthOfShearing', 'la.LastComment', 'la.AdditionalTag', 'la.FeedlotTag', 'la.BreederTag',\r\n 'la.StudName', 'la.RegistrationDetail', 'la.WeighBridgeTicket', 'la.ReferenceId', 'la.Name', 'la.Appraisal',\r\n 'la.SupplyChain', 'la.ReminderNote', 'la.ReminderDate', 'la.IsFreeMartin', 'la.DraftGroup',\r\n 'dd.DentitionName', 'cgd.GroupName as ContemporaryGroupName', 'gsd.StatusName as GeneticStatusName',\r\n 'csd.ScoreName as ConditionScoreName', 'lgd.GroupName as LivestockGroupName', 'lclsd.ClassificationName',\r\n 'la.GeneticSireText', 'la.GeneticDamText', 'la.FosterDamText', 'la.RecipientDamText',\r\n 'mgd.GroupName as MultiSireGroupName'];\r\n\r\n let isTopSearch = (searchText != null);\r\n\r\n if (intersection(filterObj.columns, laColumns).length != 0 || isTopSearch)\r\n joinQuery += ` left join livestockattribute la on la.LivestockId = l.Id`;\r\n\r\n // if (includes(filterObj.columns, 'e.Name as EnclosureName') || includes(filterObj.columns, 'etd.EnclosureTypeName') || isTopSearch)\r\n // joinQuery += ` left join enclosure e on e.Id = l.CurrentEnclosureId`;\r\n\r\n if (includes(filterObj.columns, 'asd.StatusName as LivestockActivityStatus'))\r\n joinQuery += ` left join livestockactivitystatusdata asd on asd.ActivityStatusId = l.ActivityStatusId and asd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'sd.SpeciesName'))\r\n joinQuery += ` left join speciesdata sd on l.SpeciesId = sd.SpeciesId and sd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'std.SpeciesTypeName'))\r\n joinQuery += ` left join speciestypedata std on l.SpeciesTypeId = std.SpeciesTypeId and std.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'md.MaturityName'))\r\n joinQuery += ` left join maturitydata md on l.MaturityStatusId = md.MaturityId and md.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'gd.GenderName'))\r\n joinQuery += ` left join genderdata gd on l.GenderId = gd.GenderId and gd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'lcd.CategoryName'))\r\n joinQuery += ` left join livestockcategorydata lcd on l.LivestockCategoryId = lcd.LivestockCategoryId and lcd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'lcld.ColourName'))\r\n joinQuery += ` left join livestockcolourdata lcld on l.ColorId = lcld.LivestockColourId and lcld.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'etd.EnclosureTypeName'))\r\n joinQuery += ` left join enclosuretypedata etd on e.EnclosureTypeId = etd.EnclosureTypeId and etd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'lod.OriginName'))\r\n joinQuery += ` left join livestockorigindata lod on lod.LivestockOriginId = l.LivestockOriginId and lod.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'dd.DentitionName'))\r\n joinQuery += ` left join dentitiondata dd on dd.DentitionId = la.DentitionId and dd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'cgd.GroupName as ContemporaryGroupName'))\r\n joinQuery += ` left join contemporarygroupdata cgd on cgd.ContemporaryGroupId = la.ContemporaryId and cgd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'gsd.StatusName as GeneticStatusName'))\r\n joinQuery += ` left join geneticstatusdata gsd on gsd.GeneticStatusId = la.GeneticStatusId and gsd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'csd.ScoreName as ConditionScoreName'))\r\n joinQuery += ` left join conditionscoredata csd on csd.ConditionScoreId = la.ConditionScoreId and csd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'lgd.GroupName as LivestockGroupName'))\r\n joinQuery += ` left join livestockgroupdata lgd on lgd.LivestockGroupId = la.LivestockGroupId and lgd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'lclsd.ClassificationName'))\r\n joinQuery += ` left join livestockclassificationdata lclsd on lclsd.LivestockClassificationId = la.ClassificationId and lclsd.Language = '${language}'`;\r\n\r\n if (includes(filterObj.columns, 'la.GeneticSireText'))\r\n joinQuery += ` left join livestock lgs on lgs.Id = la.GeneticSireLivestockId`;\r\n\r\n if (includes(filterObj.columns, 'la.GeneticDamText'))\r\n joinQuery += ` left join livestock lgd1 on lgd1.Id = la.GeneticDamLivestockId`;\r\n\r\n if (includes(filterObj.columns, 'la.FosterDamText'))\r\n joinQuery += ` left join livestock lfd on lfd.Id = la.FosterDamLivestockId`;\r\n\r\n if (includes(filterObj.columns, 'la.RecipientDamText'))\r\n joinQuery += ` left join livestock lrd on lrd.Id = la.RecipientDamLivestockId`;\r\n\r\n if (includes(filterObj.columns, 'mgd.GroupName as MultiSireGroupName'))\r\n joinQuery += ` left join multisiregroupdata mgd on mgd.MultiSireGroupId = la.MultiSireGroup`;\r\n\r\n if (includes(filterObj.columns, 'BreedComposition') || breed)\r\n joinQuery += ` left join breedcomposition bc on bc.LivestockId = l.Id\r\n left join breeddata bd on bd.BreedId = bc.BreedId`;\r\n if (breed)\r\n joinQuery += ` left join breedcomposition bc1 on bc1.LivestockId = l.Id`;\r\n\r\n return joinQuery;\r\n}", "title": "" }, { "docid": "c1ba433c954c08b6000be5a01dc0c9c2", "score": "0.5222631", "text": "function join( a, b ) {\n\t const totalDuration = a.duration + b.duration;\n\t a.x = (a.x * a.duration + b.x * b.duration) / totalDuration;\n\t a.y = (a.y * a.duration + b.y * b.duration) / totalDuration;\n\t a.duration = totalDuration;\n\t a.merged = (a.merged || 1) + (b.merged || 1);\n\t log( 'joined', b.id, 'to', a.id );\n\t return a;\n\t}", "title": "" }, { "docid": "611a11e822a67b45f8a5904680f1677e", "score": "0.5201052", "text": "join(entity, withEntity) {\n const command = new this.core.Command.Document.Join(this, entity, withEntity)\n if (this.undoManager.execute(command)) {\n return command.entity\n }\n\n return null\n }", "title": "" }, { "docid": "f3b91dcfe5be3ac85b95b50dc1b3b1e6", "score": "0.5198786", "text": "function join() {\n var keys = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n keys[_i] = arguments[_i];\n }\n return new Join(keys);\n}", "title": "" }, { "docid": "5045c1e696a99ea2eab1167683a13a4f", "score": "0.5195809", "text": "join() {\n return this.match({\n nil: () => M_Stream.Nil(),\n cons: (head) => (tailThunk) => head.concat(tailThunk().join())\n });\n }", "title": "" }, { "docid": "bec8febee4b909a893f6845904a102f4", "score": "0.519185", "text": "function qNameJoin(schema, table) {\n return !!schema ? schema + \".\" + table : table;\n}", "title": "" }, { "docid": "58437c01db5b1716fc3aaebd0c157d17", "score": "0.5188708", "text": "requestJoin (options/**any*/, isNew/**boolean*/) {\n \n }", "title": "" }, { "docid": "0bdf23a2b829de94210c83e18d6ee8b4", "score": "0.51610875", "text": "join(u, v, e) {\n\t\tlet ee = super.join(u, v, e);\n\t\tthis.cap(ee, 0); this.flow(ee, 0);\n\t\tif (this.hasFloors) this.floor(ee, 0);\n\t\treturn ee;\n\t}", "title": "" }, { "docid": "5ecd56d0421786e467bb2e3242a6f19f", "score": "0.51189494", "text": "_addWheres(whereJoiner, listAdapter, where, tableAlias) {\n for (let path of Object.keys(where)) {\n const condition = listAdapter._getQueryConditionByPath(path, tableAlias);\n if (condition) {\n whereJoiner(condition(where[path]));\n } else if (path === 'AND' || path === 'OR') {\n whereJoiner(q => {\n // AND/OR need to traverse both side of the query\n let subJoiner;\n if (path == 'AND') {\n q.whereRaw('true');\n subJoiner = w => q.andWhere(w);\n } else {\n q.whereRaw('false');\n subJoiner = w => q.orWhere(w);\n }\n where[path].forEach(subWhere =>\n this._addWheres(subJoiner, listAdapter, subWhere, tableAlias)\n );\n });\n } else {\n // We have a relationship field\n const fieldAdapter = listAdapter.fieldAdaptersByPath[path];\n if (fieldAdapter) {\n // Non-many relationship. Traverse the sub-query, using the referenced list as a root.\n const otherListAdapter = listAdapter.getListAdapterByKey(fieldAdapter.refListKey);\n this._addWheres(whereJoiner, otherListAdapter, where[path], `${tableAlias}__${path}`);\n } else {\n // Many relationship\n const [p, constraintType] = path.split('_');\n const thisID = `${listAdapter.key}_id`;\n const manyTableName = listAdapter._manyTable(p);\n const subBaseTableAlias = this._getNextBaseTableAlias();\n const otherList = listAdapter.fieldAdaptersByPath[p].refListKey;\n const otherListAdapter = listAdapter.getListAdapterByKey(otherList);\n const otherTableAlias = `${subBaseTableAlias}__${p}`;\n\n const subQuery = listAdapter\n ._query()\n .select(`${subBaseTableAlias}.${thisID}`)\n .from(`${manyTableName} as ${subBaseTableAlias}`);\n subQuery.innerJoin(\n `${otherListAdapter.tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.id`,\n `${subBaseTableAlias}.${otherList}_id`\n );\n\n this._addJoins(subQuery, otherListAdapter, where[path], otherTableAlias);\n\n // some: the ID is in the examples found\n // none: the ID is not in the examples found\n // every: the ID is not in the counterexamples found\n // FIXME: This works in a general and logical way, but doesn't always generate the queries that PG can best optimise\n // 'some' queries would more efficient as inner joins\n\n if (constraintType === 'every') {\n subQuery.whereNot(q => {\n q.whereRaw('true');\n this._addWheres(w => q.andWhere(w), otherListAdapter, where[path], otherTableAlias);\n });\n } else {\n subQuery.whereRaw('true');\n this._addWheres(\n w => subQuery.andWhere(w),\n otherListAdapter,\n where[path],\n otherTableAlias\n );\n }\n\n if (constraintType === 'some') {\n whereJoiner(q => q.whereIn(`${tableAlias}.id`, subQuery));\n } else {\n whereJoiner(q => q.whereNotIn(`${tableAlias}.id`, subQuery));\n }\n }\n }\n }\n }", "title": "" }, { "docid": "92af53f2a69e40b4c36d41f33adad425", "score": "0.5116766", "text": "join() {\n const runState = this.runState\n return State(state => {\n const inner = runState(state)\n return inner.fst.runState(inner.snd)\n })\n }", "title": "" }, { "docid": "30a8e794156b87663dee820edb42af7a", "score": "0.5113662", "text": "join(aSep) {\n let newChildren;\n let i;\n const len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len - 1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n }", "title": "" }, { "docid": "ab2146b537967e025fac244667079eb6", "score": "0.5111821", "text": "requestJoin (options/**any*/, isNew/**boolean*/) {\n return true;\n }", "title": "" }, { "docid": "ab2146b537967e025fac244667079eb6", "score": "0.5111821", "text": "requestJoin (options/**any*/, isNew/**boolean*/) {\n return true;\n }", "title": "" }, { "docid": "ab2146b537967e025fac244667079eb6", "score": "0.5111821", "text": "requestJoin (options/**any*/, isNew/**boolean*/) {\n return true;\n }", "title": "" }, { "docid": "f73e303fdf78b0dfc555a1d286b2aa04", "score": "0.50606287", "text": "function materializeJoinCollectionString(rawData, sourceColName, targetRelUri, targetColumnName, qids, joinMethod='count', throughJoinInstructions={}) {\n return materializeJoinCollectionNumber(rawData, sourceColName, targetRelUri, targetColumnName, qids, joinMethod, throughJoinInstructions, true);\n}", "title": "" }, { "docid": "7bb080499780d1c8fb4be8907314e0c0", "score": "0.50503707", "text": "function idbJoin(db,trans,table,guid,oncomplete,onnotfound,onerror){ \n\t//console.log('idbJoin on ' + table.name + ' guid=' + guid)\n\ttable = idbCheckTable(table);\n\tvar request = trans.objectStore(table.name).get(guid);\n\n\trequest.onsuccess = function(event) {\n\t\tif (event.target.result){\n\t\t\tdb.errorcode = 0;\n\t\t\tdb.error = \"\";\n\t\t\tif (oncomplete)\t{\n\t\t\t\t//console.log('idbJoin got record ' + guid);\n\t\t\t\tfor(var k in event.target.result) table.record[k]=event.target.result[k];\n\t\t\t\toncomplete(event.target.result)\n\t\t\t\t}\n\t\t} else {\n\t\t\tif (onnotfound)\t{\n\t\t\t\tonnotfound()\n\t\t\t} else {\n\t\t\t\tdb.errorcode = \"RecordNotFound\";\n\t\t\t\tdb.error = \"The requested record was not found in the database\";\n\t\t\t\t//console.log('database Error ' + db.errorcode + ' .. ' + db.error);\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t}\t\t\t\t\t\t\n\t}\n\trequest.onerror = function(event){\n\t\tif (onerror){ onerror(event)};\n\t}\t\t\n}", "title": "" }, { "docid": "15f7b587279f1cfe1d5ac2626d1f958c", "score": "0.5035637", "text": "function p_join() {\n\tPL.join();\n}", "title": "" }, { "docid": "b781f47dc3d4dcdf672339401534d806", "score": "0.503174", "text": "joinFun() {\n const a1 = _.join([\"a\", \"b\", \"c\"], \"~\");\n console.log(a1);\n // => a~b~c\n const a2 = _.initial([1, 2, 3]);\n console.log(a2);\n // => [1, 2]\n const a3 = _.last([1, 2, 3]);\n console.log(a3);\n // => 3\n const a4 = _.lastIndexOf([1, 2, 1, 2], 2);\n console.log(a4);\n // => 3\n const a5 = _.lastIndexOf([1, 2, 1, 2], 2, 2);\n console.log(a5);\n // => 1\n }", "title": "" }, { "docid": "978adf8ebadf9ee0c9b3a6531ee4f23b", "score": "0.49992386", "text": "function StrokeLinejoin() {\n }", "title": "" }, { "docid": "02239f5949fc631605d3d9f6e4e541a8", "score": "0.49793568", "text": "type(type) {\n this.joinType = type;\n return this;\n }", "title": "" }, { "docid": "de460a024241741e43c44b6e8caa3f81", "score": "0.497252", "text": "join() {\n return this.match({\n just: (monad) => monad,\n nothing: () => M_Maybe.Nothing()\n });\n }", "title": "" }, { "docid": "2dd21bf68cb0a0c114a6fdc09cdabd72", "score": "0.4900114", "text": "function JoinClause(table, type) {\n this.table = table;\n this.joinType = type;\n this.clauses = [];\n this.and = this;\n}", "title": "" }, { "docid": "2dd21bf68cb0a0c114a6fdc09cdabd72", "score": "0.4900114", "text": "function JoinClause(table, type) {\n this.table = table;\n this.joinType = type;\n this.clauses = [];\n this.and = this;\n}", "title": "" }, { "docid": "560f9eeafab490bfb4c11ed0ad06215e", "score": "0.48915517", "text": "function getJoins(table, foreignFields) {\n if(!foreignFields) return '';\n var foreignTables = [];\n //extracting all the foreign tables names\n _.each(foreignFields, function(field){\n var foreignTable = field.match(/^[^.]+(?=\\.)/)[0]; //matching everything before the dot;\n if(foreignTables.indexOf(foreignTable) === -1){\n foreignTables.push(foreignTable);\n }\n });\n\n return _.map(foreignTables, function (foreignTable) {\n return ' LEFT JOIN ' + foreignTable + ' ON ' + table + '.' +\n pluralize.singular(foreignTable) + '_id = ' + foreignTable + '.id';\n }).join('');\n }", "title": "" }, { "docid": "966d889aa4c8f74180af8ac4ba62fa0b", "score": "0.48759544", "text": "function join(left, right) {\n return left + right;\n}", "title": "" }, { "docid": "f54786d36f249fc37d67df255c2af404", "score": "0.4872672", "text": "_addTagAsJoinID(joinIDs, key) {\n let value = this._tags[key];\n if (value === undefined) {\n return;\n }\n joinIDs.push(new crouton_thrift.TraceJoinId({\n TraceKey : coerce.toString(key),\n Value : coerce.toString(value),\n }));\n }", "title": "" }, { "docid": "7f09bba38e0ad128672a7678e1425a44", "score": "0.48705223", "text": "join() {\n return this.match({\n left: (value) => M_Either.Left(value),\n right: (monad) => monad\n });\n }", "title": "" }, { "docid": "51112968d51a80b0b1ee7a6393ccd68d", "score": "0.48701596", "text": "function resolveJoin (fromName, fromObj, fromProp, toName, toObjs, toProp = '_id') {\n const fromVal = fromObj[fromProp]\n const result = toObjs instanceof Map\n ? toObjs.get(fromVal)\n : toObjs.find(e => e[toProp] === fromVal)\n if (result === undefined) {\n throw new Error(`resolveJoin failed: ${fromName}.${fromProp}=${fromVal} not found in ${toObjs.length} ${toName}.${toProp}`)\n }\n return result\n}", "title": "" }, { "docid": "66e2a8a90d438285b05b2fd17f99b03c", "score": "0.48641875", "text": "function joinColumn(rawData, targetColName, targetData) {\n console.log(\"rawData[0] is \", rawData[0])\n console.log(\"targetData is \", targetData)\n console.log(\"HEY! targetColName is \", targetColName)\n console.log(\"in joinColumn, targetData length is \", targetData.length, \" and rawData length is \", rawData.length)\n for (let i=0; i<targetData.length; i++) {\n rawData[i][targetColName] = targetData[i];\n }\n console.log(\"and after join, rawData[0] is \", rawData[0])\n return rawData;\n}", "title": "" }, { "docid": "10e1330299c1ffc3346f35641ec233d0", "score": "0.4836114", "text": "join() {\n return this._call('join', arguments);\n }", "title": "" }, { "docid": "122b6d48585f39aee9276d49715d5a80", "score": "0.48359558", "text": "function JoinClause(table, type, schema) {\n this.schema = schema;\n this.table = table;\n this.joinType = type;\n this.and = this;\n this.clauses = [];\n}", "title": "" }, { "docid": "09a3f6b3a592cdaa60bae4e071b85548", "score": "0.48266682", "text": "function joinProto(inner, outerKeySelector, innerKeySelector, resultSelector) {\n var outerPred = makeValuePredicate_1.makeValuePredicate(outerKeySelector), innerPred = makeValuePredicate_1.makeValuePredicate(innerKeySelector);\n return this.lift(join, inner, outerPred, innerPred, resultSelector);\n}", "title": "" }, { "docid": "d9f1c54a030692f24df64a2a096171f0", "score": "0.4821062", "text": "function join(oneToOneIdMap, oneToManyIdMap, mergeF) {\n var ids = oneToOneIdMap.getKeys();\n for (var i = 0; i < ids.length; i++) {\n var id = ids[i];\n var obj = oneToOneIdMap.get(id);\n var objectsToMergeIn = oneToManyIdMap.get(id) || [];\n mergeF(obj, objectsToMergeIn);\n }\n}", "title": "" }, { "docid": "3dbdb7828b6469cbd32e3a0fcc0ec856", "score": "0.48109326", "text": "join(separator) {\n return Array.from(this).join(separator);\n }", "title": "" }, { "docid": "67d472d47125c01b579b77d7a3836239", "score": "0.4801754", "text": "getTomming(id) {\n const sql = knex.from('tomming')\n // .innerJoin('fyllingsgrad', 'regdato', 'poi.id', 'tomming.poi_id')\n //.innerJoin('*')\n .where('poi_id', id);\n console.log(sql.toString());\n return sql;\n }", "title": "" }, { "docid": "29072055bb980b90e0ee498a74bec09f", "score": "0.4789531", "text": "function join(oneToOneIdMap, oneToManyIdMap, mergeF) {\n const ids = oneToOneIdMap.getKeys();\n for (let i = 0; i < ids.length; i++) {\n const id = ids[i];\n const obj = oneToOneIdMap.get(id);\n const objectsToMergeIn = oneToManyIdMap.get(id) || [];\n mergeF(obj, objectsToMergeIn);\n }\n}", "title": "" }, { "docid": "634938d5b0093e2debd51949a1b8ac41", "score": "0.47795615", "text": "function JoinTable(tArray){\n\tvar joinArray = [];\n\tvar tmp = 0, index = 0;\n\tvar jArray = [], exObj = [];\n\tvar count = 0;\n\t\n\tFunctionJoin(index, FunctionJoin);\n//\tconsole.log(joinTable);\n\t\n\tfunction FunctionJoin(index, callback){\n\t\tif(tArray[index]!=\"\"){\n\t\t\tvar tablei = tArray[index];\n\t\t//\tconsole.log(\"tablei = \"+index+\" \"+tablei);\n\t\t\t$.ajax({\n\t\t\t\turl: tArray[index]+\".json\",\n\t\t\t\tdataType: 'json',\n\t\t\t\tasync : false ,\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\tvar dataArray = data;\n\t\t\t\t\t\n\t\t\t\t\tfor(var t in dataArray){\n\t\t\t\t\t\tfor(var a in attArray){\n\t\t\t\t\t\t\tvar att = attArray[a].split(\".\");\n\t\t\t\t\t//\t\tconsole.log(\"array = \"+tablei);\n\t\t\t\t\t\t\tif(dataArray[t].hasOwnProperty(att[1]) && att[0] == tablei){\n\t\t\t\t\t\t\t\tdataArray[t][tablei+\".\"+att[1]] = dataArray[t][att[1]];\n\t\t\t\t\t\t\t\tdelete dataArray[t][att[1]];\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tjoinArray.push(dataArray);\n\t\t\t\t\ttmp++;\n\t\t\t\n\t\t\t\t\tif(tmp == tArray.length-1){\n\t\t\t\t\t\tfor(var i=0 ; i<tArray.length-2 ; i++){\n\t\t\t\t\t\t\texObj = [];\n\t\t\t\t\t\t\tfor(var j in joinArray[i]){\n\t\t\t\t\t\t\t\tfor(var k in joinArray[i+1]){\n\t\t\t\t\t\t\t\t\tvar ex = $.extend({},joinArray[i][j], joinArray[i+1][k]);\n\t\t\t\t\t\t\t\t\texObj.push(ex);\n\t\t\t\t\t\t\t\t\t//joinTable.push(ex);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tjoinArray[i+1] = exObj;\n\t\t\t\t\t//\t\tconsole.log(joinArray[i+1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(joinTable == \"\")\n\t\t\t\t\t\t\tjoinTable = joinArray[i];\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tjoinTable2 = joinArray[i];\n\t\t\t\t\t//\tconsole.log(joinTable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tindex++;\n\t\t\tif(index < tArray.length){\n\t\t\t\tconsole.log(\"index = \"+index);\n\t\t\t\tcallback(index, callback);\n\t\t\t}\n\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c2872f3efef680a567630b1188aa4942", "score": "0.47646263", "text": "function JoinAggregate(params) {\n Aggregate.call(this, params);\n}", "title": "" }, { "docid": "c2872f3efef680a567630b1188aa4942", "score": "0.47646263", "text": "function JoinAggregate(params) {\n Aggregate.call(this, params);\n}", "title": "" }, { "docid": "c601a7b82023d7b2126f398d833ffb7e", "score": "0.47551987", "text": "function link(nextEntry,prevEntry){if(nextEntry!=prevEntry){if(nextEntry)nextEntry.p=prevEntry;//p stands for previous, 'prev' didn't minify\nif(prevEntry)prevEntry.n=nextEntry}}", "title": "" }, { "docid": "8d52c2b427d4bde11a1e193857e033df", "score": "0.47413978", "text": "function Transform_Tab_Associative_Link() {\n\t\n}", "title": "" }, { "docid": "c6b75f2da28bab10a553e05f731f3a62", "score": "0.47402087", "text": "function resolveJoins(environment) {\n if (!environment) {\n return undefined;\n }\n\n const newEnv = {};\n Object.keys(environment).forEach(key => {\n const value = environment[key];\n\n if (!value) {\n return;\n }\n\n const joinArray = value['Fn::Join'];\n const isJoin = Boolean(joinArray);\n\n if (isJoin) {\n const separator = joinArray[0];\n const joined = joinArray[1].join(separator);\n newEnv[key] = joined;\n } else {\n newEnv[key] = value;\n }\n });\n return newEnv;\n}", "title": "" }, { "docid": "65d33b4d2ed8c54b7873c96f7504bdf2", "score": "0.47276282", "text": "joining(callback) {\n return this;\n }", "title": "" }, { "docid": "6a9f5d9d5a1a043c7c6a07c5f9f085ff", "score": "0.46969053", "text": "function nonMutatingConcat(original, attach) {\n\t// Only change code below this line\n \n\treturn original.concat(attach); \n\n\t// Only change code above this line\n}", "title": "" }, { "docid": "28ee6bbf5e7bc67ec50cbfc8fb25f1fa", "score": "0.46875378", "text": "join() {\n return this.data;\n }", "title": "" }, { "docid": "8fd51a25d1ab6c868062e0d120ff63e4", "score": "0.46768546", "text": "function includeHasManySimple(callback) {\n // Map for Indexing objects by their id for faster retrieval\n var objIdMap2 = includeUtils.buildOneToOneIdentityMapWithOrigKeys(objs, relation.keyFrom);\n\n filter.where[relation.keyTo] = {\n inq: uniq(objIdMap2.getKeys()),\n };\n\n relation.applyScope(null, filter);\n\n findWithForeignKeysByPage(relation.modelTo, filter,\n relation.keyTo, 0, options, targetFetchHandler);\n\n function targetFetchHandler(err, targets) {\n if (err) {\n return callback(err);\n }\n var targetsIdMap = includeUtils.buildOneToManyIdentityMapWithOrigKeys(targets, relation.keyTo);\n includeUtils.join(objIdMap2, targetsIdMap, function(obj1, valueToMergeIn) {\n defineCachedRelations(obj1);\n obj1.__cachedRelations[relationName] = valueToMergeIn;\n processTargetObj(obj1, function() {});\n });\n callback(err, objs);\n }\n }", "title": "" }, { "docid": "cdaf21be561164e091c99b8a665fd480", "score": "0.467562", "text": "function joinPairs(main, toAdd)\r\n{\r\n //Format of both arrays: [[\"a\", \"b\", 1],[\"a\", \"c\", 2]]\r\n var res = main.clone();\r\n var add = [];\r\n for(var i = 0; i < toAdd.length; i++)\r\n {\r\n var relationToAdd = toAdd[i];\r\n var added = false;\r\n for(var j = 0; j < main.length; j++)\r\n {\r\n var curRelation = main[j];\r\n if (pairsEqual(relationToAdd, curRelation))\r\n {\r\n res[j][2] += relationToAdd[2];\r\n added = true;\r\n break;\r\n }\r\n }\r\n if (added) continue;\r\n for(var j = 0; j < add.length; j++)\r\n {\r\n var curRelation = add[j];\r\n if (pairsEqual(relationToAdd, curRelation))\r\n {\r\n add[j][2] += relationToAdd[2];\r\n added = true;\r\n break;\r\n }\r\n }\r\n if (added) continue;\r\n add.push([relationToAdd[0], relationToAdd[1], relationToAdd[2]]);\r\n }\r\n\r\n for(var j = 0; j < add.length; j++)\r\n {\r\n res.push(add[j]);\r\n }\r\n\r\n return res;\r\n}", "title": "" }, { "docid": "53fd52ad82ac3a8480328f1a8a50fcc7", "score": "0.46730426", "text": "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n loop: while(true){\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) return;\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) return;\n switch(head.tag){\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else head._3 = fail;\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function() {\n return function() {\n delete kills[kid];\n if (tmp) tmp = false;\n else if (tail === null) join(fail, null, null);\n else join(fail, tail._1, tail._2);\n };\n });\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) // We can only proceed if both sides have resolved.\n return;\n else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) return;\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function() {\n return function() {\n delete kills[kid];\n if (tmp) tmp = false;\n else if (tail === null) join(step, null, null);\n else join(step, tail._1, tail._2);\n };\n });\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n if (tail === null) head = null;\n else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "title": "" }, { "docid": "a512c7c35b82f511efa56f9570691554", "score": "0.46722758", "text": "function InnerJoinOperator(envir, clause) {\n this.clause = clause;\n this.envir = envir;\n AbstractOpertor.call(this);\n return this;\n}", "title": "" }, { "docid": "84689b37986889dafe073caa6de4ad69", "score": "0.46527445", "text": "linkAfter(fromTrailer, toHeader){\n this.uview[fromTrailer - 1] = toHeader;\n if (toHeader !== 0){\n this.uview[toHeader] = fromTrailer;\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.46334836", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.46334836", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" }, { "docid": "d41d7238983a0651da6ab1727d126c98", "score": "0.46334836", "text": "function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }", "title": "" } ]
8cf02eebaedb6e6ed161b7f93122945e
Exercice 1 / Convert a string to a date
[ { "docid": "2d712d2d1040a2eccb4744b8cb3ae3eb", "score": "0.7349305", "text": "function convertDate(str)\n{\n\tvar re = /[0-9]+/g;\n\tvar result = re[Symbol.match](str);\n\tvar dateLoc = new Date(result[0],result[1],result[2]);\n\n\treturn dateLoc;\n}", "title": "" } ]
[ { "docid": "1af9de1568ac8eee090f81f75c2e960b", "score": "0.74859524", "text": "function stringToDate(str) {\r\n\t var dArr = str.split(\"/\");\r\n\t var date = new Date(Number(dArr[2]), Number(dArr[1]) - 1, dArr[0]);\r\n\t return date;\r\n\t}", "title": "" }, { "docid": "a50356e1e5eec49d8a4b0417c1b5c491", "score": "0.74660265", "text": "function str_to_date(str){\r\n var d = str.split('-');\r\n return new Date(parseInt(d[2], 10), [parseInt(d[1], 10)-1], parseInt(d[0], 10), 0, 0, 0, 0);\r\n}", "title": "" }, { "docid": "c487097e2f8cf96ce6cc24f0fc18474e", "score": "0.7413704", "text": "function stringToDate(str) {\n var dArr = str.split(\"/\");\n var date = new Date(Number(dArr[2]), Number(dArr[1]) - 1, dArr[0]);\n return date;\n }", "title": "" }, { "docid": "bd8128310a0c18f1298ab533f3f288db", "score": "0.73919445", "text": "function getDateFromString() {\n var dateInStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n if (dateInStr && dateInStr.length > 0) {\n var dateParts = dateInStr.trim().split('/');\n var year = toInteger(dateParts[2]);\n var month = toInteger(dateParts[0]);\n var day = toInteger(dateParts[1]); // tslint:disable-next-line:prefer-const\n\n var result = new Date();\n result.setDate(day);\n result.setMonth(month - 1);\n result.setFullYear(year);\n return result;\n }\n\n return new Date();\n }", "title": "" }, { "docid": "c2c50223a783ba3cdaa2958a76ddde4e", "score": "0.73903316", "text": "function stringToDate(str) {\n\tvar dArr = str.split(\"/\");\n\tvar date = new Date(Number(dArr[2]), Number(dArr[1]) - 1, dArr[0]);\n\treturn date;\n}", "title": "" }, { "docid": "9ded4751bc9de2a03ca43bf5ebdc2395", "score": "0.7366791", "text": "function toDate(str) {\n if (!str) {\n return str;\n }\n\n // dates look like yyyy.mm.dd\n var parts = str.split('.');\n if (parts.length < 3) {\n return undefined;\n }\n\n // Make sure the date is only composed of numbers\n parts.map(function(val) { return +val; });\n if (parts.some(isNaN)) {\n return undefined;\n }\n\n // Subtract one from month because the range is from 0 to 11.\n if (parts.length === 4) {\n return new Date(Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3]));\n }\n return new Date(Date.UTC(parts[0], parts[1] - 1, parts[2]));\n}", "title": "" }, { "docid": "e9f26cc678c21eb2582a9d50676bb10c", "score": "0.73505676", "text": "function get_date(string) {\n let [none, day, month, year] = /(\\d{1,2})\\.(\\d{1,2})\\.(\\d{4})/.exec(string);\n return new Date(year, month - 1, day);\n}", "title": "" }, { "docid": "082e6d5a1521bc345b4ae0d54cf3a4a0", "score": "0.7279113", "text": "function convertStringToDate(text) {\n return new Date(text.replace(/(\\d{2})-(\\d{2})-(\\d{4})/, \"$2/$1/$3\"));\n}", "title": "" }, { "docid": "9f5c8c513c42bee284dc1943d94f7203", "score": "0.7243899", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "title": "" }, { "docid": "1059ad96e4da69738e2a1fd0eb33e1b0", "score": "0.72296125", "text": "function converterData(string){\n //separando data e hora com destructuring\n const [data, horas] = string.split(' ')\n const [dias,mes,ano] = data.split('/')\n const [hora,minuto] = horas.split('H')\n return new Date(ano, mes - 1, dias, hora, minuto) \n\n }", "title": "" }, { "docid": "c79da54e4e966e9ed4fab17a421d17c0", "score": "0.72205853", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "title": "" }, { "docid": "6a89ed03b9428b02027bd61cf8ee6eb0", "score": "0.719987", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ? \n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.7198782", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.7198782", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "d1be686d380a78a746a516da8893aaca", "score": "0.7153839", "text": "function toDate (value) {\n var match\n var output = value\n if (typeof value === 'string') {\n match = value.match(dateRe)\n if (match) {\n if (match.length >= 3) {\n output = new Date(Number(match[1]) + Number(match[2]))\n } else {\n output = new Date(Number(match[1]))\n }\n output = formatDate(output)\n }\n }\n return output\n }", "title": "" }, { "docid": "141042a36accf99cb286d6d9f5bcb97a", "score": "0.7128725", "text": "function getDate(string) {\n let [_, month, day, year] = /(\\d{1,2})-(\\d{1,2})-(\\d{4})/.exec(string)\n return new Date(year, month - 1, day)\n}", "title": "" }, { "docid": "0cf25841c77daef632be463783537005", "score": "0.709596", "text": "function stringToDate(s) {\r\n\t var ret = NaN;\r\n\t var parts = s.split(\"/\");\r\n\t date = new Date(parts[2], parts[0], parts[1]);\r\n\t if (!isNaN(date.getTime())) {\r\n\t\tret = date;\r\n\t }\r\n\t return ret;\r\n\t}", "title": "" }, { "docid": "9ad72b2642ea290730167001dff255dc", "score": "0.70926446", "text": "function examDateStringToDate(date: string): Date {\n return new Date(`${date.slice(0, 16)}Z`);\n}", "title": "" }, { "docid": "6b614e52461d2584e0608caf3b45e0d3", "score": "0.70796204", "text": "static String2Date(s, dateSplitChar = '-') {\r\n if (!s) {\r\n return new Date();\r\n }\r\n const ss = (s.split(dateSplitChar));\r\n const y = parseInt(ss[0], 10);\r\n const m = parseInt(ss[1], 10);\r\n const d = parseInt(ss[2], 10);\r\n if (!isNaN(y) && !isNaN(m) && !isNaN(d)) {\r\n return new Date(y, m - 1, d);\r\n }\r\n else {\r\n return new Date();\r\n }\r\n }", "title": "" }, { "docid": "9dab0eeb0f073683035e90d119a20e0a", "score": "0.7045508", "text": "static fromString(str) {\n return Day.fromMoment(moment(str, 'YYYY-MM-DD'));\n }", "title": "" }, { "docid": "808ddfc94748ecc1c0b2ffe317b1364c", "score": "0.7014022", "text": "static textToDate(text){\n\n // lets add a fail fast using RegExp, this will prevent the user to enter the\n // data with the wrong format\n if (!/\\d{4}-\\d{2}-\\d{2}/.test(text)) \n throw new Error(\"the text to be converted to Date need to be pass in the following format 'YYYY-MM-DD'.\")\n return new Date(text.split('-'))\n }", "title": "" }, { "docid": "55976117ae20e8b301363c6697ca1c27", "score": "0.69998115", "text": "convertToDate(string) {\n var vars = string.split(' ')\n return moment().subtract(parseInt(vars[0]), vars[1]).format('L')\n }", "title": "" }, { "docid": "26d0a9bb7de4f3ccb656d362fa2f2901", "score": "0.69917846", "text": "function createDateFromString(string){\n\tif(verifyValidDate(string)){\n\t\tvar splitted = string.split('/');\n\t\treturn new Date(Number(splitted[2]), \n\t\t\tNumber(splitted[1]) - 1, Number(splitted[0]), 0, 0, 0, 0);\n\t}else{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "3db62ecf5c481ddd386f6503163bed97", "score": "0.69740015", "text": "function convertDate(str) {\n // Split the dates to work independently.\n var dateStr = str.split('-');\n\n // Force the dates into Universal time to avoid issues due to timezones.\n return (new Date(Date.UTC(dateStr[0], dateStr[1] - 1, dateStr[2])));\n\n }", "title": "" }, { "docid": "0b33cc401b69029a381d3ccb3190d675", "score": "0.697342", "text": "function getDateFromString(str) {\n\t\t\tif (str.indexOf(\"-\") >= 0) {\n\t\t\t\tvar ret = new Date();\n\t\t\t\tsetDateBySpecialString(ret, str);\n\t\t\t\treturn ret;\n\t\t\t} else {\n\t\t\t\treturn new Date(str);\n\t\t\t}\n }", "title": "" }, { "docid": "9866d25a2c0b5ae9af4c9b14fb12d734", "score": "0.6962836", "text": "function convertFromStringToDate(stringDate) { \n\n const dateArray = stringDate.split('-'); \n\n if (!Array.isArray(dateArray) || !(dateArray.length === 3)) { \n return { \n error: true, \n message: `El valor debe ser una fecha de esta forma: '2019-03-22'. El valor recibido, en cambio, es: ${stringDate}`\n }\n }\n\n let ano = 0; \n let mes = 0; \n let dia = 0; \n\n try {\n ano = dateArray[0];\n mes = dateArray[1];\n dia = dateArray[2];\n } catch { \n return {\n error: true,\n message: `El valor debe ser una fecha de esta forma: '2019-03-22'. El valor recibido, en cambio, es: ${stringDate}`\n }\n }\n\n if (!parseInt(ano) || !parseInt(mes) || !parseInt(dia)) {\n return {\n error: true,\n message: `El valor debe ser una fecha de esta forma: '2019-03-22'. El valor recibido, en cambio, es: ${stringDate}`\n }\n }\n\n ano = parseInt(ano); \n mes = parseInt(mes) - 1; \n dia = parseInt(dia); \n\n let date = null; \n\n try { \n date = new Date(ano, mes, dia); \n } catch(err) {\n return {\n error: true,\n message: `El valor debe ser una fecha de esta forma: '2019-03-22'. El valor recibido, en cambio, es: ${stringDate}`\n }\n }\n\n return {\n error: false,\n date\n }\n}", "title": "" }, { "docid": "7a0d9680f8ceab99315d36d8b38d7bbf", "score": "0.69465435", "text": "transformDate(str) {\n let parts = str.split(\"-\");\n return parts[2] + \".\" + parts[1] + \".\" + parts[0];\n }", "title": "" }, { "docid": "4ee21185ee9333f8eecd727850068329", "score": "0.69226956", "text": "function getDate(string) {\n // destructoring the return value of the exec method.\n // The _(underscore) binding is ignored and used only \n // to skip the full match element in the array returned by exec.\n\n let [_, month, day, year] =\n /(\\d{1,2})-(\\d{1,2})-(\\d{4})/.exec(string);\n // creates a new dat Object.\n return new Date(year, month - 1, day);\n}", "title": "" }, { "docid": "165b34eb60df22c79a9f46d75f81c3e9", "score": "0.6909357", "text": "function makeDate(str) {\n\tvar delimChar = (str.indexOf(\"/\") != -1) ? \"/\" : \"-\";\n\tvar strDate = str.split(delimChar);\n\t//var strDate = str.split(\"-\");\n\tvar iDate = new Date();\n\tvar month = parseInt(strDate[0], 10);\n\tvar date = parseInt(strDate[1], 10);\n\tvar year = parseInt(strDate[2], 10);\n\t\n\t// added to handle date discrepancy\n\tiDate.setHours(0);\n\tiDate.setMinutes(0);\n\tiDate.setSeconds(0);\n\tiDate.setMilliseconds(0);\n\tiDate.setHours(0);\n\tiDate.setMinutes(0);\n\tiDate.setSeconds(0);\n\tiDate.setMilliseconds(0);\n\tiDate.setFullYear(year, month-1, date);\n\tiDate.format('mm-dd-yyyy');\n\treturn iDate;\n}", "title": "" }, { "docid": "78c9be07becf9e20729ee20efae02f72", "score": "0.690579", "text": "function getdate(str) {\n\t\t\t// inner util function to convert 2-digit years to 4\n\t\t\tfunction fixYear(yr) {\n\t\t\t\tyr = +yr;\n\t\t\t\tif (yr<50) { yr += 2000; }\n\t\t\t\telse if (yr<100) { yr += 1900; }\n\t\t\t\treturn yr;\n\t\t\t};\n\t\t\tvar ret;\n\t\t\t// YYYY-MM-DD\n\t\t\tif (ret=str.match(/(\\d{2,4})-(\\d{1,2})-(\\d{1,2})/)) {\n\t\t\t\treturn (fixYear(ret[1])*10000) + (ret[2]*100) + (+ret[3]);\n\t\t\t}\n\t\t\t// MM/DD/YY[YY] or MM-DD-YY[YY]\n\t\t\tif (ret=str.match(/(\\d{1,2})[\\/-](\\d{1,2})[\\/-](\\d{2,4})/)) {\n\t\t\t\treturn (fixYear(ret[3])*10000) + (ret[1]*100) + (+ret[2]);\n\t\t\t}\n\t\t\treturn 99999999; // So non-parsed dates will be last, not first\n\t\t}", "title": "" }, { "docid": "e7df2a3835c899ea43259b1a7754058d", "score": "0.6886057", "text": "function getDate(s) {\n var a = s.split(/[^0-9]/);\n var d = new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]);\n return d;\n }", "title": "" }, { "docid": "b9c6479914eec941724fb708559e565f", "score": "0.68733346", "text": "function stringToDate(s) {\n var dateParts = s.split(' ')[0].split('-');\n var timeParts = s.split(' ')[1].split(':');\n var d = new Date(dateParts[0], --dateParts[1], dateParts[2]);\n d.setHours(timeParts[0], timeParts[1], timeParts[2])\n\n return d\n }", "title": "" }, { "docid": "69997ffca1669ae50641ecb8d48a439c", "score": "0.68465745", "text": "function convertToDate(x) {\n if (DG.isDate(x)) return x;\n return DG.createDate(x); // strings are subject to browser inconsistencies\n }", "title": "" }, { "docid": "8eba66b4409daca0a3ee50c486bb7fd9", "score": "0.6842025", "text": "function getInvDate(string){\n return new Date(string);\n }", "title": "" }, { "docid": "4a154ae9a9e7e407c3299566048919e8", "score": "0.6840303", "text": "static toMyDate(strDate) {\n // Validate the format\n this.tokens = strDate.split(\"-\");\n\n if(this.tokens.length !== 3)\n return null;\n\n // Check that everything else is a number\n for(var i = 0; i < this.tokens.length; i++)\n if(isNaN(this.tokens[i]))\n return null;\n\n var year = parseInt(this.tokens[0]);\n var month = parseInt(this.tokens[1]);\n var day = parseInt(this.tokens[2]);\n\n // Validate the year\n if(year < 1900 || isNaN(year) || isNaN(month) || isNaN(day))\n return null;\n\n // Validate the month, should be 1 to 12\n if(month < 1 || month > 12)\n return null;\n\n // Validate the day, it should be within the month's day\n var daysInMonths = [31,28,31,30,31,30,31,31,30,31,30,31];\n\n // February is 29 days during leap year\n if((year % 100 === 0) ? (year % 400 === 0) : (year % 4 === 0))\n daysInMonths[1] = 29;\n\n if(day < 1 || day > daysInMonths[month - 1])\n return null;\n \n // We're good\n return new MyDate(year, month, day);\n }", "title": "" }, { "docid": "6fb38e821cb173aca59f1bda3d2651c5", "score": "0.6834998", "text": "function parseDate(str) {\n var mdy = str.split(\"/\");\n return new Date(mdy[2], mdy[0] - 1, mdy[1]);\n }", "title": "" }, { "docid": "dc2cd847f4e0bd1c16f88ab16fb6847f", "score": "0.683307", "text": "function stringToDate(dateString) {\n\tvar dateArray = dateString.split(/[: T . Z -]/);\n\tvar newDate = new Date(dateArray[0], dateArray[1], dateArray[2], dateArray[3], dateArray[4], dateArray[5], dateArray[6]);\n\treturn newDate;\n}", "title": "" }, { "docid": "30f4f59f8489529ff998b9a6525bac84", "score": "0.68286467", "text": "function parseDate(str) {\n var mdy = str.split(\"-\");\n return new Date(mdy[2], mdy[0] - 1, mdy[1]);\n }", "title": "" }, { "docid": "0de1db68e320695584be1dec0c481b6c", "score": "0.68204296", "text": "static stringToDate(dateString: string): Date {\n return moment(dateString).toDate();\n }", "title": "" }, { "docid": "65e0f3af84c2b0e79f2bed5df224f0ce", "score": "0.6819784", "text": "function nhStringToDate(strDate) {\r\n var theYear = strDate.substring(0,4);\r\n var theMonth = strDate.substring(4,6);\r\n var theDay = strDate.substring(6,8);\r\n \r\n // The Date objects expects the month count to start at zero.\r\n theMonth--;\r\n \r\n return new Date(theYear, theMonth, theDay);\r\n}", "title": "" }, { "docid": "e132ba25716497a5b1f339350cdafcbf", "score": "0.6808559", "text": "function convertStringToDate(dateString)\n{\n dateString = dateString.split('-');\n dateString = dateString[1] + '/' + dateString[2] + '/' + dateString[0];\n \n return Date.parse(dateString);\n}", "title": "" }, { "docid": "3c83a4dd252f651b48f706967d37b3bc", "score": "0.67970026", "text": "function dateFromStr(str) {\n var parts = str.split(\"-\");\n return Date.UTC(parts[0], parts[1] - 1, parts[2])\n }", "title": "" }, { "docid": "8953f077253aa74cd48f09d12d066542", "score": "0.6796577", "text": "function date(dateString, format) {\n var d, day, month, year;\n validateArgs(arguments, \"date\", 1, 2, [String, String]);\n switch (format) {\n case undefined:\n if (dateString.length === 8) {\n year = parseFloat(dateString.slice(0, 4));\n month = parseFloat(dateString.slice(4, 6)) - 1;\n day = parseFloat(dateString.slice(6, 8));\n d = new Date(year, month, day);\n } else {\n msgBox(\"date from string can only be yyyyMMdd\", \"Error\", 0);\n }\n break;\n case 'd':\n try {\n d = Date.parse(dateString);\n } catch (e) {\n msgBox(dateString + ':' + e, \"Date Conversion Error\", 0);\n }\n break;\n default:\n try {\n if (dateString.length === format.length) {\n d = Date.parseExact(dateString, format);\n }\n if (d === undefined || d === null) {\n d = Date.parse(dateString);\n }\n } catch (ex) {\n msgBox(dateString + ':' + ex, \"Date Conversion Error\", 0);\n }\n break;\n }\n if (d === null) {\n d = undefined;\n }\n\n return d;\n }", "title": "" }, { "docid": "8cb75d63918df902d7ba82ce91ed832a", "score": "0.6787025", "text": "dateStringToDate(dateString){\n try {\n if (!!dateString && dateString.length===8){\n const day = Number(dateString.substring(0,2));\n const month = Number(dateString.substring(2,4))-1;\n const year = Number(dateString.substring(4));\n return new Date(Date.UTC(year, month, day, 0, 0, 0, 0));\n } else {\n return null;\n }\n } catch(e){\n console.log(e);\n return null;\n }\n }", "title": "" }, { "docid": "3182632355219694b222ff7de9deda87", "score": "0.6775722", "text": "function parseDate(str) {\n var mdy = str.split('-');\n return new Date(mdy[2], mdy[1] - 1, mdy[0]);\n}", "title": "" }, { "docid": "d473d967031a3d89e82f7cefffe305e4", "score": "0.6772915", "text": "function convert(str){\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n}", "title": "" }, { "docid": "faca334462d3fd6e32f284a3343a35e5", "score": "0.6765885", "text": "function toDate(strDateString) {\n\t var tabDate = strDateString.split(\"/\");\n\t var newDate = new Date(tabDate[2], (tabDate[1]-1), tabDate[0]);\n\t return newDate;\n\t}", "title": "" }, { "docid": "9fa52c4aca0f3b76e068c1174f825d27", "score": "0.6753812", "text": "function parseDate(str) {\n var mdy = str.split('/');\n return new Date(mdy[2], mdy[0] - 1, mdy[1]);\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.67530155", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.67530155", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "f588a524aa41086e7bcd965e2f058ac1", "score": "0.6745439", "text": "function stringToDate(input, validate = true) {\n let parts = input.split('-').map(item => Number(item));\n // console.log(parts);\n if (!validateDate(parts)) {\n throw new rest_1.HttpErrors.BadRequest('Invalid timestamp');\n }\n const date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4]);\n // console.log(date.toString());\n if (date.getTime() < Date.now() && validate) {\n throw new rest_1.HttpErrors.BadRequest('Invalid timestamp');\n }\n return date;\n}", "title": "" }, { "docid": "5f90b0c6f5d9d8d666d6b21d98487fa5", "score": "0.67368925", "text": "parse(str) {\r\n let yearMonthDay = str.split('-');\r\n return new Date(yearMonthDay[0], yearMonthDay[1] - 1, 1);\r\n }", "title": "" }, { "docid": "00fc1d710eab41c7afba32753793bce4", "score": "0.67345774", "text": "function convertDate(date){\n\tlet pdate;\n\t\n\tlet y = date.substring(0, 4);\n\tlet m = date.substring(5, 7);\n\tlet d = date.substring(8, 10);\n\t\n\tpdate = y + m + d; \n\t\n\treturn pdate;\n}", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.67298615", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.67298615", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.67298615", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.67298615", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "c022d49dd9f25c70e669754e624fb456", "score": "0.67279804", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value); // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n var _value$split$map = value.split('-').map(function (val) {\n return +val;\n }),\n _value$split$map2 = _slicedToArray(_value$split$map, 3),\n y = _value$split$map2[0],\n m = _value$split$map2[1],\n d = _value$split$map2[2];\n\n return new Date(y, m - 1, d);\n }\n\n var match;\n\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n\n var date = new Date(value);\n\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\".concat(value, \"\\\" into a date\"));\n }\n\n return date;\n }", "title": "" }, { "docid": "56c4615c91dbccf17ce211d10dcb4e64", "score": "0.67175967", "text": "function toDate(str) {\n var millis = Date.parse(str);\n if (isNaN(millis)) {\n throw new Error(l10n.lookupFormat('typesDateNan', [ str ]));\n }\n return new Date(millis);\n}", "title": "" }, { "docid": "c26ea054b94cf856f4180db850457174", "score": "0.6715663", "text": "function zenStringToDate(dval)\r\n{\r\n\tvar str = zenParseDate(dval)\r\n\tif (('' == str)||(-1 == str)) return null;\r\n\tvar d = new Date(parseInt(str.substr(0,4),10),parseInt(str.substr(5,2),10)-1,parseInt(str.substr(8,2),10));\r\n\treturn d;\r\n}", "title": "" }, { "docid": "b4fafd23f004716287a91e1fe1911484", "score": "0.67139363", "text": "function convertDate(date){\n var parts =date.split('-'); \n var mydate = new Date(parts[0], parts[1] - 1, parts[2]);\n return mydate;\n}", "title": "" }, { "docid": "107fcd8243de0016cf7e793f5d0e7b00", "score": "0.67118937", "text": "function parseDate(str) {\n var mdy = str.split('-');\n return new Date(mdy[0], mdy[1]-1, mdy[2]);\n}", "title": "" }, { "docid": "fdd2005d087e89ef1aa184167185a0f8", "score": "0.66993433", "text": "function StringToDate(pString)\n{\n // Convert it.\n var d = new Date(pString);\n // Return it.\n return d;\n}", "title": "" }, { "docid": "ac069afea29f0a3d6155ee2539630071", "score": "0.6698016", "text": "parse(str) {\r\n let yearMonthDay = str.split('-');\r\n return new Date(yearMonthDay[0], yearMonthDay[1] - 1, yearMonthDay[2]);\r\n }", "title": "" }, { "docid": "4221d45859be42bf1ccc6903c3ddcaff", "score": "0.6684126", "text": "function strToDate(date){\n\tlet str = date+\"\"\n\tlet year = str.slice(0,4);\n\tlet month = str.slice(4,6);\n\tlet day = str.slice(6,8);\n\treturn (`${day}/${month}/${year}`)\n}", "title": "" }, { "docid": "9a6da47dc63cca3102794e641e536f5f", "score": "0.66835314", "text": "function parseDate(input) {\n let result;\n\n if(typeof input === 'string' && !isNaN(input)) {\n result = new Date(parseInt(input));\n } else {\n result = new Date(input);\n }\n\n return result;\n }", "title": "" }, { "docid": "4b712e0f28ab6d32d2d6d7b600e2ce91", "score": "0.6675", "text": "function convertDate(string) {\r\n\t// Ankunft in einen Unix-Timestap codieren\r\n\tvar date = new Date();\r\n\tdate.setYear(new Date().getYear()+1900);\r\n\tdate.setMinutes(parseInt(string.split(\":\")[1], 10));\r\n\tdate.setSeconds(parseInt(string.split(\":\")[2], 10));\r\n\tdate.setMilliseconds(0);\r\n\tdate.setHours(parseInt(string.split(\" \")[1].split(\":\")[0], 10));\r\n\tdate.setDate (parseInt(string.split(\".\")[0], 10));\r\n\tdate.setMonth(parseInt(string.split(\".\")[1], 10)-1);\r\n\t\r\n\treturn date.getTime();\r\n}", "title": "" }, { "docid": "fbafeea312dd75a618c813c57b72f475", "score": "0.66709375", "text": "function convert(str) {\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth()+1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [ date.getFullYear(), mnth, day ].join(\"-\");\n}", "title": "" }, { "docid": "044aff779130cd4f146f1de8eb621758", "score": "0.6668607", "text": "function datetry(date) {\n var parts = date.split('-');\n var mydate = new Date(parts[0], parts[1] - 1, parts[2]);\n return mydate;\n }", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.66609675", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n 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];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.66609675", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n 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];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.66609675", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n 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];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "753307c9e50355873b9a817c3392a56c", "score": "0.66609675", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n 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];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "00ab4ec5dcc9a85ab8d46857f07823ec", "score": "0.66589785", "text": "function parseDate(input) {\n var parts = input.split('-');\n return new Date(parts[2], parts[1]-1, parts[0]);\n}", "title": "" }, { "docid": "05ef410a6a11c5101c240a60de463a67", "score": "0.6657018", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "title": "" }, { "docid": "9e92fdd5c75ccf89c66721a9ea7464da", "score": "0.6638509", "text": "function convert(str){\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n }", "title": "" }, { "docid": "9e92fdd5c75ccf89c66721a9ea7464da", "score": "0.6638509", "text": "function convert(str){\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n }", "title": "" }, { "docid": "9e92fdd5c75ccf89c66721a9ea7464da", "score": "0.6638509", "text": "function convert(str){\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n }", "title": "" }, { "docid": "9e92fdd5c75ccf89c66721a9ea7464da", "score": "0.6638509", "text": "function convert(str){\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n }", "title": "" }, { "docid": "9e92fdd5c75ccf89c66721a9ea7464da", "score": "0.6638509", "text": "function convert(str){\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n }", "title": "" }, { "docid": "bbaf920d6997da4c266130679efa52b9", "score": "0.66314256", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n const [y, m, d] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "bbaf920d6997da4c266130679efa52b9", "score": "0.66314256", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* 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, ... */\n const [y, m, d] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "6d461f85ae5723fd52a802bd66e176dc", "score": "0.6626939", "text": "function parseDate(str) {\n var mdy = str.split('/');\n return new Date(mdy[2], mdy[1], mdy[0]);\n}", "title": "" }, { "docid": "068c02123ca05a8035ceafd6d5909642", "score": "0.66163176", "text": "function convertStrDateDottedDMYToDateObj(dateStr)\n{\n let day = Number(dateStr.slice(0, 2));\n let month = Number(dateStr.slice(3, 5)) - 1;\n let year = Number(dateStr.slice(6));\n return new Date(year, month, day);\n}", "title": "" }, { "docid": "f5213a487e65d0d70c38bd8a93e2be4c", "score": "0.66026056", "text": "function convert(str) {\n var date = new Date(str),\n mnth = (\"0\" + (date.getMonth() + 1)).slice(-2),\n day = (\"0\" + date.getDate()).slice(-2);\n return [date.getFullYear(), mnth, day].join(\"-\");\n }", "title": "" }, { "docid": "193ab390e87bfa082e588db788e3879e", "score": "0.6593063", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* 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, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "title": "" }, { "docid": "3675fccfa060d0857935f0f729376765", "score": "0.6592881", "text": "function getDateFromString(dateString) {\n try {\n let dateParts = dateString.split('.');\n let day = dateParts[0];\n let month = dateParts[1];\n let year = dateParts[2];\n let result = new Date('\"' + year + '/' + month + '/' + day + '\"');\n if (result == 'Invalid Date') {\n return '';\n }\n return result;\n } catch (e) {\n return '';\n }\n }", "title": "" }, { "docid": "b7bb92bb5d420e94f2a7a41d1a39914a", "score": "0.65882194", "text": "function convertDate(dayText) {\n var dayArray = dayText.split(\"-\");\n\n var dayMonth = dayArray[1];\n var dayNum = dayArray[2];\n var dayYear = dayArray[0];\n\n // If month value starts with a 0, get rid of 0\n if (dayMonth.charAt(0) == 0) {\n dayMonth = dayMonth.charAt(1);\n }\n\n var dayDate = dayMonth + \"/\" + dayNum + \"/\" + dayYear;\n\n return dayDate;\n }", "title": "" }, { "docid": "2fb9635a4a591ccb1848ba90fe8dcda0", "score": "0.65860444", "text": "function strToDate(valor) {\n var x = valor.split(\"-\");\n\n var data = null;\n if (x.length == 3) {\n try {\n data = new Date(x[0], x[1] - 1, x[2]);\n } catch (e) {}\n }\n\n return data;\n}", "title": "" }, { "docid": "523aae0cb86a32f1485a9b7cdaee70a0", "score": "0.6576437", "text": "makeDate(date) {\n let dateArr = date.split('-')\n let year = dateArr[0];\n let month = dateArr[1];\n let day = dateArr[2];\n return new Date(year, month - 1, day);\n }", "title": "" }, { "docid": "512c2be30d0509075ef07277f827590a", "score": "0.65716594", "text": "function parseDate(input) {\r\n var parts = input.match(/(\\d+)/g);\r\n // new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]])\r\n return new Date(parts[2], parts[1] - 1, parts[0]); // months are 0-based\r\n}", "title": "" }, { "docid": "f6b52b1b0de8cd7927e238f7d0b5f66a", "score": "0.65635747", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "0e3ce15e0e13d469ec53a267c17354e1", "score": "0.6562607", "text": "function makeDateFromString(config) {\n var i, string = config._i, match = isoRegex.exec(string);\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "05f808fcbd134a12d1ee531b60aea234", "score": "0.6561741", "text": "function formatDate(dateString){\n const year = parseInt(dateString.substr(0,4));\n const month = parseInt(dateString.substr(4,2));\n const day = parseInt(dateString.substr(6,2));\n const date = new Date(year, month - 1, day);\n return date;\n}", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.6547725", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.6547725", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "304961789f99866f7a4b89972d11f890", "score": "0.65389764", "text": "function toYYYYMMDD (s) {\n const [ mm, dd, yyyy ] = s.split('/')\n return [ yyyy, mm, dd ].join('-')\n }", "title": "" }, { "docid": "076441dba8d5563b56ac376ec76f66fa", "score": "0.6534334", "text": "function parseSnowflakeDate(dateStr) {\n const tokens = dateStr.split('-')\n const yyyy = +tokens[0];\n const mm = +tokens[1];\n const dd = +tokens[2];\n return new Date(yyyy,mm-1,dd);\n}", "title": "" }, { "docid": "30c243a35edf6b48c8403897ab294a54", "score": "0.65282726", "text": "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n\n if (typeof value === 'string') {\n value = value.trim();\n\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* 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, ... */\n const [y, m = 1, d = 1] = value.split('-').map(val => +val);\n return createDate(y, m - 1, d);\n }\n\n const parsedNb = parseFloat(value); // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n\n let match;\n\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n\n const date = new Date(value);\n\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n\n return date;\n}", "title": "" }, { "docid": "45b50a2c4e589ae13aad8023313c4336", "score": "0.65154266", "text": "function StrToFecha(fecha){\n\t//var hoy = fecha;\n\tvar dd = fecha.substr(8,2);\n\tvar mm = fecha.substr(5,2);\n\tvar yyyy = fecha.substr(0,4);\n\n\treturn dd+'/'+mm+'/'+yyyy;\n}", "title": "" } ]
eb087b090d980c5722d50b07a4e7c3d9
This function is supposed to compare all the items in the array with the first item, in order to discover if they are all the same. stuff is the array. isUniform is the function the array is passed into. var first = stuff[0] defines that we are looking at the first item in the array. the forloop uses stuff.length to go through all the items in the array. the if statement does a comparison of each item while the loop is running.
[ { "docid": "cf93e4e2b8087c1823341875165e5e31", "score": "0.81177294", "text": "function isUniform(stuff){\n var first = stuff[0]\n for(var i = 1; i < stuff.length; i++){\n if(stuff[i] !== first){\n return false;\n }\n }\n return true;\n}", "title": "" } ]
[ { "docid": "e661ea7bc8a8a3e12a6e601fc86fbab8", "score": "0.76758605", "text": "function isUniform(myarray){\n var first = myarray[0];\n for (var i=0; i < myarray.length; i++){ //can start at i=1 to avoid first run\n if(myarray[i] !== first){\n return false\n }\n }\n return true;\n}", "title": "" }, { "docid": "6a0c3e32c3333ff8f3de7fecd86968a8", "score": "0.7619065", "text": "function isUniform(arr){\r\n\tvar first = arr[0];\r\n\tfor (var i = 1; i < arr.length; i++){\r\n\t\tif(array[i]!== first){\r\n\t\t\treturn false;\r\n\t\t} \r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "52813cf6401e7a53daefc00c3cedf228", "score": "0.7603367", "text": "function isUniform(arr){\n\tvar first = arr[0];\n\tfor(var i = 1; i < arr.length; i++){\n\t\tif(arr[i] !== first){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true; \n}", "title": "" }, { "docid": "80f5b9587c9d668a3b45e0e57c142535", "score": "0.7602392", "text": "function isUniform(inputArray){\n\treturn inputArray.every(function(item, index, array){\n\t\treturn item === array[0]; //make sure to include return in anonymous function!\n\t});\n}", "title": "" }, { "docid": "f74a693697f19df72175ef587e9850cf", "score": "0.7583666", "text": "function isUniform(arr){\n const first = arr[0];\n for(let i = 1; i < arr.length; i++) {\n if(arr[i] !== first){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "0d8cb34aed277ea34103a5566a792a89", "score": "0.7577735", "text": "function isUniform(arr){\r\nvar first = arr[0];\r\nfor(var i = 1; i<arr.length; i++){\r\n\tif(arr[i] !=== first)\r\n\t\treturn false;\r\n}\r\nreturn true;\r\n}", "title": "" }, { "docid": "8863bd24782a6126638d240856ca52bd", "score": "0.7463089", "text": "function isUniform(arr) {\n\tvar first = arr[0];\n\tfor(var i = 1; i < arr.length; i++) {\n\t\tif(arr[i] !== first) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "e20c9735d37b27a150d1729d62dbb9a5", "score": "0.74273926", "text": "function isUniform(array){\n\tvar val=array[0];\n\tfor(var i=0;i<array.length;i++){\n\t\tif(val==array[i])\n\t\t\tcontinue;\n\t\telse\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "7deba01fbf5531c28a70d7929bcb203b", "score": "0.7367638", "text": "function isUniform(arr){\r\n var comparation = null;\r\n\r\n\r\n for( i=0; i<=arr.length-1; i++){\r\n if(arr[0]===arr[i]){\r\n comparation++;\r\n }\r\n }\r\n if (comparation===arr.length)\r\n return true;\r\n\r\n else\r\n return false;\r\n}", "title": "" }, { "docid": "40ac3457a4581aa99659dcc8d6439434", "score": "0.72801733", "text": "function\tisUniform(arr){\n\tvar result;\n\tfor(var i = 0; i < arr.length; i++){\n\t\tif(arr[0] === arr[i])\n\t\t\tresult = true;\n\t\telse if(arr[0] !== arr[i]){\n\t\t\treturn false;\t\n\t\t}\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "f0ad20754fea890cce0750cbd2c6bd2a", "score": "0.72231895", "text": "function isUniform(myData) {\n var count = 0;\n var first = myData[0];\n var returnValue = false;\n while (myData[count] === first) {\n count++;\n if (count == myData.length) {\n returnValue = true\n }\n }\n return returnValue;\n}", "title": "" }, { "docid": "6330c5cb5ad4a92fcfdeb811f9abe638", "score": "0.6678293", "text": "function isUniform(arr){\r\n var sortedArr = arr.sort();\r\n\r\n if(sortedArr[0] === sortedArr[sortedArr.length - 1]){\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "3e6f9ae65a3c5e021aa76f27aa8a7c53", "score": "0.6541279", "text": "function allTheSame(array) {\n var first = array[0]\n return array.every(function(element) {\n return element === first\n })\n }", "title": "" }, { "docid": "5b7f9f519cc7dd296ce0ffd89c4306ed", "score": "0.6472467", "text": "function identical(array) {\n var first = array[0];\n for(var i=1; i<array.length; i++)\n\t{\n\t\tif(array[i] != first) return 0;\n\t}\n\treturn first;\n}", "title": "" }, { "docid": "5eabd30f112c87cd864f9bf203cb9e53", "score": "0.64520013", "text": "function sameItems( array ) {\n\t\treturn array.every( function( v, i, a ) {\n\t\t\treturn i === 0 || v === a[i - 1];\n\t\t});\n\t}", "title": "" }, { "docid": "940a3136b3558feb4335ae28cfc2330b", "score": "0.61821765", "text": "function isUniform(list){\n\tfor(var i = 0; i < list.length - 1; i++) {\n\t\tif(list[i] !== list[i+1]){\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "ff12c87358897e76700e84f65450b56c", "score": "0.61661434", "text": "function isUniformMOD (i) {\n\tvar first = i[0]\n\tfor (var k = 1; k<i.length; k++) {\n\t\tif(i[k] != first) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "a3727713b4f33e192766a21ce7e2672e", "score": "0.6091949", "text": "function isIdentical(array) {\n\tvar first = array[0];\n\tfor (var i = 1; i < array.length; i++) {\n\t\tif (array[i] !== first) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "77fe4f9880a90f844bfa7bc0ea2d92ca", "score": "0.5927463", "text": "function allSame (arr) {\n\t if (!Array.isArray(arr)) {\n\t return false\n\t }\n\t if (!arr.length) {\n\t return true\n\t }\n\t var first = arr[0]\n\t return arr.every(function (item) {\n\t return item === first\n\t })\n\t}", "title": "" }, { "docid": "e006e6775d245efe2d4664efb93f7966", "score": "0.5922433", "text": "static allEqualElements(array) {\n for (let i = 0; i < array.length; i++) {\n for (let j = i; j < array.length; j++) {\n // todo: do stuff here\n }\n }\n return true;\n }", "title": "" }, { "docid": "ea743ab678058acd90c97785a776e002", "score": "0.57890505", "text": "function itemUnique(...arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr.includes(arr[i], i + 1)) { // \n return 'Not unique'\n }\n }\n return 'Unique'\n}", "title": "" }, { "docid": "bce7841615a7190b4638c10ef19e0c6c", "score": "0.57757604", "text": "function every(array,func) {\n// using a for loop, loop through the array. \nfor(let i = 0; i < array.length; i++){\n // use an if statement to check if the test passes by pluggin the array into the test func \n if(!func(array[i])){\n // return false not every value passes\n return false;\n } \n \n}// return true if one test fails\n return true;\n\n}", "title": "" }, { "docid": "30de1a642047800208d416fd1178a718", "score": "0.574918", "text": "function myFunction(arr) {\n\tconsole.log(arr.every( (i) => i === arr[0] ));\n\t\n}", "title": "" }, { "docid": "8b50c7f39697070908b0d6a7d9325746", "score": "0.56694835", "text": "function unique(bundle, i, array) {\n\treturn array.every(function(bundle2, j) {\n\t\tif (bundle === bundle2) {\n\t\t\treturn i >= j;\n\t\t}\n\t\treturn true;\n\t});\n}", "title": "" }, { "docid": "f70aa785058985216e18e65d2ee1a063", "score": "0.56523633", "text": "function fitFirst(array) {\n if (array[0] > array.length) {\n console.log(\"Too big!\");\n }\n else if (array[0] < array.length) {\n console.log(\"Too small!\");\n }\n else {\n console.log(\"Just right!\");\n }\n}", "title": "" }, { "docid": "e9d1d2d0e56446ebbeea2841f0c34770", "score": "0.5652085", "text": "function allInArrayEqual(array){\n\tfor (var i = 0; i < array.length; i ++){\n\t\tif (array[i] === \"_\" || array[i] !== array[0]){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "2c87fa2e0b9fc269b3068344d4f520ad", "score": "0.5635298", "text": "function hasSingleCycle(array) {\n const elemSeen = new Array(array.length).fill(0)\n let idx = 0\n for (let i = 0; i < array.length; i++) {\n elemSeen[idx]++\n idx = getNextIdx(idx, array)\n }\n return Math.max(...elemSeen) === 1 && Math.min(...elemSeen) === 1 && idx === 0\n }", "title": "" }, { "docid": "52a03a218a1fdc81cc8942d3366fce4a", "score": "0.55946183", "text": "function isUnique(arr) {\n let sorted_arr = arr.slice().sort();\n let results = [];\n\n for (let i = 0; i < sorted_arr.length - 1; i++) {\n if (sorted_arr[i + 1] == sorted_arr[i]) {\n results.push(sorted_arr[i]);\n }\n }\n if (results.length === 0) {\n return 'All items in the array are unique.';\n } else {\n return `There are this duplicates in the array: ${results}`;\n }\n}", "title": "" }, { "docid": "99500e226c4685b658ef1c39e94af6fb", "score": "0.5590886", "text": "function checkGems(gemArray){\n\tconsole.log(gemArray[0].x, gemArray[0].y);\n\tconsole.log(gemArray[1].x, gemArray[1].y);\n\tconsole.log(gemArray[2].x, gemArray[2].y);\n\n\tfor (let i=0; i<gemArray.length; i++){\n\t\tfor(let j=i+1; j<gemArray.length; j++){\n\t\t\tif(gemArray[i].x === gemArray[j].x && gemArray[i].y === gemArray[j].y){\n\t\t\t\t\tconsole.log('trouble');\n\t\t\t\t\trandomize(gemValues);\n\t\t\t\t\tgemArray[j].x = x;\n\t\t\t\t\tgemArray[j].y = y+80;\n\t\t\t\t\tcheckGems(allGems);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2f09676c6f8bbc683c2fd3aa0c0aa24a", "score": "0.55769086", "text": "function checkUnique(array)\n\t\t\t{\n\t\t\t\tlet unique = true;\n\t\t\t\t\n\t\t\t\tfor(let i = 0; i < array.length; i++)\n\t\t\t\t{\n\t\t\t\t\tfor(let j = 0; j < array.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(j === i)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(array[i] === array[j])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunique = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!unique)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn unique;\n\t\t\t}", "title": "" }, { "docid": "cc01c1a77d726c7c162ccca9e59a41be", "score": "0.55631125", "text": "function isUniform(uniform) {\n var f = uniform[0];\n for(var i = 1; i < uniform.length; i++) {\n if(uniform[i] !== f) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "af50db46d2254945d4b5e8c0268232c6", "score": "0.5547446", "text": "function isUnique(array) {\n return array.every((item, index, self) => self.indexOf(item) === index);\n}", "title": "" }, { "docid": "dbb657354baec3b10398c40016621ab6", "score": "0.55407697", "text": "function every(array, test) {\n //no hayar ningun elemento que no la cumpla\n let returner = !array.some(e => {\n return !test(e)}); \n return returner; //seria true si algun elemento no la cumple, por lo tanto si es false\n //todos los elementos cumplen la condicion\n}", "title": "" }, { "docid": "854b2d31d220037bec156823ccf17f7d", "score": "0.5539413", "text": "function isUnique(array) {\n var seen = {};\n var len = array.length;\n var j = 0;\n for(var i = 0; i < len; i++) {\n var item = array[i];\n if(seen[item] === 1) {\n return false;\n } else {\n seen[item] = 1;\n }\n }\n return true;\n}", "title": "" }, { "docid": "268ec933dacd87e0f4499683db82a721", "score": "0.54970896", "text": "function hasSingleCycle(array) {\n\t// Write your code here.\n\tlet elementsVisited = 0;\n\tlet currentIndex = 0;\n\t\n\twhile (elementsVisited < array.length) {\n\t\tif (elementsVisited > 0 && currentIndex === 0) return false;\n\t\telementsVisited++;\n\t\tcurrentIndex = getNextIdx(currentIndex, array)\n\t}\n\t\n\tfunction getNextIdx(currentIndex, array) {\n\t\tconst jump = array[currentIndex];\n\t\tconst nextIndex = (currentIndex + jump) % array.length;\n\t\treturn nextIndex >= 0 ? nextIndex : nextIndex + array.length;\n\t}\n\t\n\treturn currentIndex === 0;\n}", "title": "" }, { "docid": "2a872ea0828948c1e44e931d109cae75", "score": "0.5486802", "text": "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 }", "title": "" }, { "docid": "dbf74dba282369f34098b5485bed7b5b", "score": "0.5484532", "text": "function every(array, value){\n if (array.length ==0){\n return true;\n };\n for (var i = 0; i < array.length; i++){\n if(array[i].value !== value.value){ //i think the error is here, but with or without .value it doesnt work\n return false;\n } else{\n return true;\n };\n };\n}", "title": "" }, { "docid": "3337713ed0ae8bcc067cc06522ddc401", "score": "0.54720247", "text": "function includes(item, anArray) {\r\n let perfectGrade = false\r\n for (i = 0; i < anArray.length; i++) {\r\n if ((anArray[i]) == item) {\r\n perfectGrade = true;\r\n }\r\n }\r\n return perfectGrade;\r\n}", "title": "" }, { "docid": "29393f77c57103fdbf3ca6c67f8573a0", "score": "0.5467758", "text": "function hasSingleCycle(array) {\n let numElemSeen = 0\n let idx = 0\n while (numElemSeen < array.length) {\n if (numElemSeen > 0 && idx === 0) return false\n numElemSeen++\n idx = getNextIdx(idx, array)\n }\n return idx === 0\n }", "title": "" }, { "docid": "40c6fa08af88e05d4ec3a42077330831", "score": "0.5423138", "text": "function checkArray(arr) {\n return arr.every(function (item) {\n return item;\n });\n}", "title": "" }, { "docid": "8c7acbb9e782f0cca6f7cb7c691c6c95", "score": "0.54045385", "text": "function every(array,argument){\n for(var i = 0; i <= array.length-1; i++){\n if(array[i] === argument){\n return true;\n } else {\n return false;\n }\n }\n if (!false){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "0f3e25cf6a3ec8796ed55ca71a604505", "score": "0.5384105", "text": "function some (array, value){\n if (array.length == 0){\n return false;\n }\n for (var i = 0; i < array.length; i++){\n if((array[i]) != value){\n return false;\n }else{\n return true;\n };\n };\n}", "title": "" }, { "docid": "4d9a29689ad7ed74f5b9d3d97afe735b", "score": "0.5382837", "text": "function hasDuplicates(array) {\n let ticks = 0, result = false;\n for (let i = 0; i < array.length; i++){\n ticks++;\n for (let j = 0; j < array.length; j++) {\n ticks++;\n if (array[i] === array[j] && i !== j){\n result = true;\n }\n }\n }\n return {\n result: result,\n ticks: ticks\n };\n}", "title": "" }, { "docid": "cb90ba43e40239cb6ae7ec06bfdcb8cf", "score": "0.53805447", "text": "function doWhileLoop(array){\n function maybeTrue() {\n return Math.random() >= 0.5\n }\n do {\n array = array.slice(1)\n } while (array.length > 0 && maybeTrue());\n\n return array\n}", "title": "" }, { "docid": "c6eedac84e7c471135d5c827b9e3d7b3", "score": "0.5376423", "text": "function verifyGroup(firstPixel, firstIndex) {\n // Verify _firstItemFromRange for partial items\n verifyFirstItemFromRange({ firstPixel: firstPixel + 0, wholeItem: false }, { index: firstIndex + 0 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 1, wholeItem: false }, { index: firstIndex + 0 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 84, wholeItem: false }, { index: firstIndex + 0 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 85, wholeItem: false }, { index: firstIndex + 3 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 184, wholeItem: false }, { index: firstIndex + 3 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 185, wholeItem: false }, { index: firstIndex + 6 });\n\n // _firstItemFromRange, whole items\n verifyFirstItemFromRange({ firstPixel: firstPixel + 0, wholeItem: true }, { index: firstIndex + 0 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 1, wholeItem: true }, { index: firstIndex + 3 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 99, wholeItem: true }, { index: firstIndex + 3 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 100, wholeItem: true }, { index: firstIndex + 3 });\n verifyFirstItemFromRange({ firstPixel: firstPixel + 101, wholeItem: true }, { index: firstIndex + 6 });\n\n // _lastItemFromRange, partial items\n var last = firstPixel + opts.viewportSize.width - 1;\n verifyLastItemFromRange({ lastPixel: last, wholeItem: false }, { index: firstIndex + 8 });\n verifyLastItemFromRange({ lastPixel: last + 5, wholeItem: false }, { index: firstIndex + 8 });\n verifyLastItemFromRange({ lastPixel: last + 6, wholeItem: false }, { index: firstIndex + 11 });\n verifyLastItemFromRange({ lastPixel: last + 105, wholeItem: false }, { index: firstIndex + 11 });\n verifyLastItemFromRange({ lastPixel: last + 106, wholeItem: false }, { index: firstIndex + 14 });\n\n // _lastItemFromRange, whole items\n verifyLastItemFromRange({ lastPixel: last, wholeItem: true }, { index: firstIndex + 8 });\n verifyLastItemFromRange({ lastPixel: last + 99, wholeItem: true }, { index: firstIndex + 8 });\n verifyLastItemFromRange({ lastPixel: last + 100, wholeItem: true }, { index: firstIndex + 11 });\n }", "title": "" }, { "docid": "78dc71b0cdafa0e7ce3f97647d702a91", "score": "0.5372912", "text": "function hasDuplicate(array) {\n\tfor (a = 0; a < array.length; a++){\n\t\tlet isOrginal = array[a];\n\t\tfor (b = 0; b < array.length; b++){\n\t\t\tlet isDuplicate = array[b]; \n\t\t\tif ((isOrginal == isDuplicate) && (a != b)){\n\t\t\t\treturn true \n\t\t\t}\n\n\t\t}\n\t}\n return false \n}", "title": "" }, { "docid": "bd1f83dc5ccd62a683d3cb54cc7e43f0", "score": "0.5359963", "text": "function every(arr, judge1)\r\n {\r\n \tlet count=foreach(arr,visitor)\r\n \treturn judge1(arr,count);\r\n }", "title": "" }, { "docid": "2148b274e9129c4618beb3beff987dda", "score": "0.5347082", "text": "function sameFunction(ascending) {\n for (var ind=0; ind < ascending.length; ind++) {\n if (ascending[ind] !== match) {\n return false;\n }\n }\n console.log(\"same\");\n return true;\n }", "title": "" }, { "docid": "f22598884966f2c98857ed32c79059b0", "score": "0.53418666", "text": "function _checkForUniqueness(array) {\n return new Set(array).size === array.length;\n }", "title": "" }, { "docid": "e155b4875c42d7fd41b49309ad61257d", "score": "0.5336073", "text": "function first(arr, test, ctx) {\n\t\tvar result = null;\n\t\tarr.some(function (el, i) {\n\t\t\treturn test.call(ctx, el, i, arr) ? ((result = el), true) : false;\n\t\t});\n\t\treturn result;\n\t}", "title": "" }, { "docid": "2d09ad388abce43f9ee35b5f983737e5", "score": "0.5318197", "text": "function printFirstRepeating(arr){\n let n = arr.length, i, j;\n for(i=0; i<n-1; i++){\n for(j=i+1; j<n; j++){\n if(arr[i] === arr[j]){\n console.log(\"1st element duplicate is:\", arr[i]);\n return;\n }\n }\n }\n console.log(\"no duplicates\");\n}", "title": "" }, { "docid": "68699962f69dc2cbd8c38acb78e7d25e", "score": "0.53039885", "text": "function firstDuplicate (arr) {\n\n}", "title": "" }, { "docid": "d52c25a52edadfb67684187c240a8dde", "score": "0.5302665", "text": "function homogenousArray(arr) {\n return arr.every(value => value === arr[0]);\n}", "title": "" }, { "docid": "6516a7527717258a009ef5f6eada29d1", "score": "0.5300143", "text": "function every(array, test) {\nfor (let element of array) {\n if (test(element) === false) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "2f6cab6eaca3ba216653d8fec83169b8", "score": "0.52793103", "text": "function is_equal(array){\n\t\t/* If only one element, return true */\n\t\tif (array.length == 1){\n\t\t\treturn true\n\t\t}\n\t\t/* Go through array, and check each one is equivalent to number above */\n\t\tfor (var i = 0; i < array.length-1; ++i){\n\t\t\tif (array[i] !== array[i+1]){\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}", "title": "" }, { "docid": "4770e5c2302b4d5ceab13949927f0fa9", "score": "0.5276343", "text": "function filtersame(arr){\n for(var i=0;i<arr.length;i++){\n \tfor(var j=i+1;j<arr.length;j++){\n \t\tif(arr[j]==arr[i]){\n \t\t\treturn true;\n \t\t}\n \t}\n }\n return false;\n\t}", "title": "" }, { "docid": "620df42b23be8655b1eadc9c2ec12af2", "score": "0.5267769", "text": "function isFirstElementPrime(array){\nlet firstNumber=array[0];\nif(firstNumber<=1){\n return false;\n}\nfor(let i=2;i<firstNumber;i++)\n{\n if(!(firstNumber%i)){\n return false;\n }\n}\nreturn true;\n\n}", "title": "" }, { "docid": "8073ee225e297e56a6445f47977393d1", "score": "0.5254405", "text": "function findUniq(arr) {\r\n // assign the first three to a, b, and c\r\n var [a,b,c] = arr.slice(0,3);\r\n // then check to see if it is the first character and if so return it. (because if a is the unique one then b and c have to be equal)\r\n if( a != b && a!=c ) return a;\r\n // otherwise, knowing that it is not the first one you can compare each one after \r\n // that to the first one and if not equal then that IS the answer! Simple and brilliant.\r\n for( var x of arr ) if( x!=a ) return x\r\n}", "title": "" }, { "docid": "9a583959bfb116d59612cf4d07cec557", "score": "0.5247307", "text": "function check(){\n\tvar id = false;\n//checks every index of the array and sets id to true if theres a match\n\tfor(i=0;i<done.length;i++){\n\t\tif(done[i] == x){\n\t\t\tid = true;\n\t\t\tconsole.log(\"found dupe\");\n\t\t}\n\t}\n//checks to see if there was a match, if there was it rechooses if not it continues with the game\n\tif(id == true){\n\t\tnumba();\n\t}else{\n\t\tchooseQ();\n\t}\n\n}", "title": "" }, { "docid": "f69b08547742a52e0e135c0ba22a8827", "score": "0.52355355", "text": "function someCheck (array,cb){\n result= true;\n for (let i = 0; i < array.length; i++) {\n\n if (!cb(array[i])) {\n return false;\n }\n }\n return result;\n}", "title": "" }, { "docid": "658fd81d6de0cafc567bc81922e2d9fc", "score": "0.5223742", "text": "function hasSingleCycle(array) {\r\n let index = 0\r\n while (true) {\r\n if (array[index] === Infinity) break\r\n const nextIndex = (array[index] + index) % array.length\r\n array[index] = Infinity\r\n if (nextIndex < 0) {\r\n index = array.length + nextIndex\r\n } else {\r\n index = nextIndex % array.length\r\n }\r\n }\r\n for (let num of array) {\r\n if (num !== Infinity) return false\r\n }\r\n return index === 0\r\n}", "title": "" }, { "docid": "b5cb0d2964f798073f23fd6ea7152bde", "score": "0.52010524", "text": "function every(array, test){\n for(let elem of array){\n if(!test(elem)) return false;\n }\n return true;\n}", "title": "" }, { "docid": "390cbf42f8d466743bdddc6dcc17be34", "score": "0.51960367", "text": "function hasDupes2(array) {\n var existingItems = [];\n for (var i = 0; i < array.length; i++) {\n if(existingItems[array[i]] === undefined){\n // console.log(array[i]);\n existingItems[array[i]] = 1;\n // console.log(existingItems);\n } else {\n console.log(true);\n }\n }\n console.log(false);\n}", "title": "" }, { "docid": "f3437cc277716b39385d37350612f63d", "score": "0.5192264", "text": "function notSame(arr) {\n for (var j = 0; j < arr.length; j++) {\n if (arr[0] !== arr[j]) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "0abcc0363233c8a7cc68fdae60e17fbe", "score": "0.51908094", "text": "function checkArray(array, element) {\n\n for (x = 0; x < array.length; x++) {\n if (element === array[x]) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "331590bac0cf1d296aa283e25001e42a", "score": "0.5185808", "text": "function FirstAppearingOnce()\n{\n for (let i in result) {\n if (result[i] === 1) {\n return i;\n }\n }\n return '#';\n}", "title": "" }, { "docid": "4dec66f1934f31e60fdb2efb375e7881", "score": "0.51799667", "text": "function verificaArray (elemento, array) {\r\n var inclusoArray = false;\r\n\r\n for (var count = 0; count < array.length; count++) {\r\n if (elemento === array[count]) {\r\n inclusoArray = true;\r\n }\r\n }\r\n\r\n return inclusoArray;\r\n}", "title": "" }, { "docid": "99f11bc6ef0b8b25304655c9ad35975a", "score": "0.51628584", "text": "function isUniq(input) {\n for (let i = 0; i < input.length; i++) {\n for (let j = i + 1; j < input.length; j++) {\n if (input[i] === input[j]) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "7476ec00b7cd9f468e26787b81f953ff", "score": "0.515958", "text": "function every(arr, fun){\n\tfor (let element of arr) {\n if (!fun(element)) return false;\n }\n return true;\n}", "title": "" }, { "docid": "31c2be590e07ea9df3821416a64618f1", "score": "0.5142558", "text": "function findUniq(arr) {\r\n var arrays = [];\r\n for(let i = 0; i < arr.length; i++) {\r\n var filtered = arr.filter((val) => {\r\n return val === arr[i]; \r\n });\r\n arrays.push(filtered);\r\n }\r\n for(let i = 0; i < arrays.length; i++) {\r\n if(arrays[i].length === 1) {\r\n var result = arrays[i][0];\r\n return result;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9fc934d4b43887cfeacccdfb26402606", "score": "0.51353824", "text": "function uniqueArr(array){\n let hasil = []\n\n for(let i = 0; i < array.length; i++){\n if (typeof array[i] !== \"number\") return \"Isi array harus number semua\"\n\n let same = false\n for (let k = 0; k < hasil.length; k++){\n if(hasil[k] === array[i]){\n same = true;\n break\n }\n }\n if (same === false){\n hasil.push(array[i])\n }\n }\n return hasil\n}", "title": "" }, { "docid": "ed0cf438ba07e821fb4ff6a06de1288a", "score": "0.513506", "text": "function testJackpot(a) {\n for(let i=1; i<a.length; i++) {\n if(a[i] !== a[i-1])\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "324da5da2e37cc827e8009e91f1c9651", "score": "0.5131938", "text": "function includes(item, anArray) {\n // Traverse through array to find value equal to item\n for (let i = 0; i < anArray.length; i++) {\n // Item equal to value in array will return true\n if (item == anArray[i]) {\n return document.getElementById(\"perfect-grade\").innerHTML = true;\n }\n }\n // If no value matches item, then return false\n return document.getElementById(\"perfect-grade\").innerHTML = false;\n\n}", "title": "" }, { "docid": "6235e6e82221aa2fcebbe7ebd2b15c6b", "score": "0.5130609", "text": "function check(a, x) {\n \n for(let i = 0; i < a.length; i++){\n if( x === a[i] ){\n return true\n } \n }\n return false\n }", "title": "" }, { "docid": "3689ff825a82109569a5bf48dc54b6b7", "score": "0.5129225", "text": "function arrCheck() {\n\n if (lineWord === randomWordChosen) {\n return true;\n } \n \n for (var i = 0; i < lineWord.length; ++i) {\n if (lineWord[i] !== randomWord[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "3419c3d79e416bef3599311d3897cd4c", "score": "0.512897", "text": "function allMakeEqual(array) {\n var output = []\n for(i = 0; i < array.length; i++) {\n var each = makeEqualLength(array[i], size)\n output.push(each)\n }\n return output\n}", "title": "" }, { "docid": "6241343bd4bd8dc13f07d27d20f6afc1", "score": "0.5114519", "text": "function isSolvable(anArray) {\n let inversions = 0;\n let mutatedCopy = removeRandomEmpty(anArray);\n for (let i = 0; i < mutatedCopy.length; i++) {\n for (let j = i + 1; j < mutatedCopy.length; j++) {\n if ((mutatedCopy[i] && mutatedCopy[j]), mutatedCopy[i] > mutatedCopy[j]) {\n inversions++;\n }\n }\n }\n let evenInversions = (inversions / 2);\n return evenInversions;\n}", "title": "" }, { "docid": "042de7ac35437c22f77359d48910ffbc", "score": "0.5114113", "text": "function verifyFirstAtGroupBoundary(firstPixel) {\n // _firstItemFromRange\n // @TODO: Uncomment when blue#50294 is fixed.\n //verifyFirstItemFromRange({ firstPixel: 459, wholeItem: false }, { index: 4 });\n verifyFirstItemFromRange({ firstPixel: firstPixel, wholeItem: false }, { index: 10 });\n }", "title": "" }, { "docid": "f10eca42becbbdc78cc810c9655aaccf", "score": "0.5099395", "text": "function isRepeated(arr)\n{\n for (var node of arr)\n {\n if (node.repeatingUnit !== undefined)\n {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "335eda1298faba7a4fa9b1bf79ac3802", "score": "0.5093845", "text": "function noDuplicate() {\n\n for (let i = 0; i < indexArr.length; i++) {\n for (let k = 0; k < hold.length; k++) {\n if (indexArr[i] === hold[k]) {\n indexArr[i] = getRandomInt(0, Product.all.length);\n noDuplicateH();\n noDuplicate();\n\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "69a986305b0f3945d6ef3912036bbbdf", "score": "0.5092037", "text": "function isUsed(baseArray, usedArray)\n{\n for (var i = 0; i < baseArray.length; i++)\n {\n if (usedArray.includes(baseArray[i]))\n {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "1591b489987c11853d64213305646d9e", "score": "0.5090123", "text": "function findFirstDifferent(arr){\n\n const integers = arr.map(ele => Number(ele));\n const windowSize = 25;\n\n for (let i = windowSize; i < integers.length; i++) {\n const previousNums = windowSize;\n const currentNum = integers[i];\n const numbersSeen = {};\n let foundCompliment = false; //set flag\n\n for (let j = i - previousNums; j < i; j++) {\n if (!numbersSeen[integers[j]]) {\n numbersSeen[integers[j]] = true;\n }\n }\n\n for (let num in numbersSeen) {\n if (numbersSeen[currentNum - Number(num)]) {\n foundCompliment = true;\n }\n }\n\n if (!foundCompliment){\n return currentNum\n }\n }\n }", "title": "" }, { "docid": "d3abdef0f40aa5f1b717def497121a6c", "score": "0.50885123", "text": "function some (array, test) {\n var results = [];\n\n array.forEach(function (element) {\n results.push(test(element));\n })\n \n console.log('results =', results);\n return results.indexOf(true) > -1;\n}", "title": "" }, { "docid": "a63e9bba610b9bb30577875b2e5a54cf", "score": "0.50825274", "text": "function sameV1(array1, array2){\n if (array1.length === array2.length){\n for (let i=0; i<array1.length; i++){\n if (array1[i] * array1[i] !== array2[i]) return false\n }\n return true\n } else {\n console.log(\"The arrays are not of equal length\")\n return false\n }\n} //PROBLEM: this solution is order-dependent. ", "title": "" }, { "docid": "dc4972287ce2efbf7325c8e37bb8ae6a", "score": "0.5071534", "text": "function verifyFirstItemFromRange(input, expectedOutput) {\n var index = layout._firstItemFromRange(input.firstPixel, { wholeItem: input.wholeItem });\n LiveUnit.Assert.areEqual(expectedOutput.index, index,\n \"_firstItemFromRange's returned index should be \" + expectedOutput.index);\n }", "title": "" }, { "docid": "726815587ac128ac2de0b21a580e7121", "score": "0.5059541", "text": "function testJackpot(result) {\n\treturn new Set(result).size === 1\n}", "title": "" }, { "docid": "c0381ca95cd2b09d4a8fd1889166e5eb", "score": "0.5054222", "text": "function checkIdenticalCams(currentItem, array) {\n for (i = 0; i < array.length; i++) {\n if (\n currentItem.cam_id === array[i].cam_id &&\n currentItem.cam_option === array[i].cam_option\n ) {\n array[i].cam_amount += 1;\n currentItem.cam_amount = array[i].cam_amount;\n } else {\n currentItem.cam_amount = 1;\n }\n }\n}", "title": "" }, { "docid": "dbea3ad10a01187fb1a15dcbe2b04e44", "score": "0.50509137", "text": "function scanArray(array, item) {\n var i = 0;\n while (i < array.length) {\n if (array[i] === item) {\n return true;\n }\n i++;\n }\n return false;\n}", "title": "" }, { "docid": "9f157c2577324ce3af4d396739f7e63a", "score": "0.5049215", "text": "function forEachUnique(array, callback) {\n if (array) {\n for (var i = 0; i < array.length; i++) {\n if (ts.indexOf(array, array[i]) === i) {\n var result = callback(array[i], i);\n if (result) {\n return result;\n }\n }\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "a235e4488640323d2114f22083bf81d5", "score": "0.5047178", "text": "function reduceToAllTrue(array){\n\n for (let i = 0; i < array.length; i++ ){\n // we want to access the elements in the array instead of the entire array\n\n if( !array[i] ) return false\n // if we expect one line return we can put conditional statement on one line\n\n }\n return true\n\n\n }", "title": "" }, { "docid": "27c912c2b9a1d7ab8387838a35eb7cd7", "score": "0.5046418", "text": "function minItem(anArray) {\r\n let smallest = anArray[0]\r\n for (i = 1; i < anArray.length; i++) {\r\n if (anArray[i] < smallest) {\r\n smallest = anArray[i];\r\n }\r\n }\r\n return smallest;\r\n}", "title": "" }, { "docid": "e339ef70d60faf10c8640fed8138028d", "score": "0.5044086", "text": "function every(array, callback) {\n if (array) {\n for (var i = 0; i < array.length; i++) {\n if (!callback(array[i], i)) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "5e524c2939e3cce9ad1dc16bcf4c62a9", "score": "0.50361896", "text": "function singleCheck(i) {\n\tif (planeAABBmax[0] < AABBminArray[i][0] || planeAABBmin[0] > AABBmaxArray[i][0])\n\t\treturn false;\n\tif (planeAABBmax[1] < AABBminArray[i][1] || planeAABBmin[1] > AABBmaxArray[i][1])\n\t\treturn false;\n\tif (planeAABBmax[2] < AABBminArray[i][2] || planeAABBmin[2] > AABBmaxArray[i][2])\n\t\treturn false;\n\treturn true;\n}", "title": "" }, { "docid": "deebc368c48ec3116df0168b65cb2c4b", "score": "0.50343186", "text": "function compareArrays() {\n console.log(\"compare arrays\")\n for (let i = 0; i < user_input.length; i++) {\n if (computer_gives[i] != user_input[i]) {\n gameOver();\n return;\n }\n }\n if (user_input.length == computer_gives.length) {\n computer_action();\n }\n}", "title": "" }, { "docid": "6c9f307df2cffb8a7cb19077e92f47cb", "score": "0.50337964", "text": "function everything(array, test){\n if(array.some(n => !test(n))){\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e898e5a97ca86b670c9abbb3fc76c117", "score": "0.5032024", "text": "function allSame(arr, path) {\n const first = _get(arr[0], path);\n for (let i = 1, len = arr.length; i < len; i++) {\n if (_get(arr[i], path) !== first) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "fd0112dd3c8016d972e73a26f5fb8b47", "score": "0.50302076", "text": "function doWhileLoop(array) {\n function maybeTrue() {\n return Math.random() >= 0.5\n }\n\n do {\n array.pop(); // or array = array.slice(1)\n } while (array.length > 0 || maybeTrue());\n return array;\n}", "title": "" }, { "docid": "d3fd48066b74cfc094cbf07f1e28321a", "score": "0.502984", "text": "function fitTheFirstValue(arr) {\n switch (true) {\n case (arr[0] > arr.length):\n console.log(\"Too big!\")\n break;\n case (arr[0] < arr.length):\n console.log(\"Too small!\")\n break;\n default:\n console.log(\"Just right!\")\n }\n}", "title": "" }, { "docid": "3e3d3709b13b37335f94535681648d3e", "score": "0.50260586", "text": "function every(array, test) {\n return !array.some(n => !test(n));\n}", "title": "" }, { "docid": "4df54ab2f32860e08d8cf1bd73c45d47", "score": "0.50246954", "text": "function every(array, test) {\r\n if(array.some(element => !test(element))) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "title": "" } ]
5c81398a9bd2da999e0c825420dd16ce
Nazma Azam 20180626 end Nazma Azam 20180805 start
[ { "docid": "f77d846976f2900968fd8ee00fdda45e", "score": "0.0", "text": "function others_image() {\t\n\t\n\t\n\t\t\t\t\t\t\n\t//localStorage.linkStr_combo=linkStr_combo;\t\n\t//alert (localStorage.linkStr_combo)\t\t\t\t\t\t\t\t\n\t$('#page_link_lv').empty();\n\t$('#page_link_lv').append(localStorage.linkStr_combo);\t\n\t//alert(localStorage.linkStr_combo)\n\t\n\t$.afui.loadContent(\"#page_link\",true,true,'right');\n}", "title": "" } ]
[ { "docid": "be4becf6dd0d098905c2cdd00fe8d0b9", "score": "0.55412716", "text": "Es(){\n return 29000\n }", "title": "" }, { "docid": "8da04f2ae4b0e7313bfe90e59b204b81", "score": "0.53760946", "text": "function calculateZmaniKinsatVeyetziatShabbath(dayG,monthG,yearG)\n {\n //'OTNIEL\n NorthOrSouth = \"N\";\n latd = 31;\n latm = 25;\n EastOrWest = \"E\";\n lngd = 35;\n lngm = 00;\n tz = 2;\n var arrZmanimRet = Array(2);\n \n var yom = new Date (yearG, monthG, dayG);\n\t/*\n // Check daylight saving time.\n // Daylight saving time in Israel: From the friday before the 2nd of April untill 10th of Tishrei.\n hebDate=GregToHeb(new Date (yearG, monthG, dayG));\n hebDateApril2=GregToHeb(new Date (yearG, 3, 2));\n\n var mdyDate = hebDate.split(\"/\")\n var mdyDateApril2 = hebDateApril2.split(\"/\")\n \n // If after the 2nd of April\n if ((monthG > 2) && (dayG > 1))\n {\n // If we are in the same hebrew year as the 2nd of april it means we are before the\n // 10th of Tishrei - hence Daylight saving time applies.\n if (mdyDate[2] == mdyDateApril2[2]) \n {\n tz++;\n }\n // If we are a year after the 2nd of April, check to see if we are before the 10th\n // of Tishrei - DST still applies.\n else if ((mdyDate[2] > mdyDateApril2[2])\n && (mdyDate[0] == 1)\n && (mdyDate[1] < 10))\n {\n tz++;\n }\n \n }\n\t*/\n // motzei shabbat (3 small stars)\n time = suntime(dayG, monthG/*+1*/, yearG, 98, 30, lngd, lngm, EastOrWest, latd, latm, NorthOrSouth, tz);\n\n // If Sunset and sunrise have been calculated successfully.\n if(time[0] == 0)\n {\n // Set zman Yetsiat shabbath.\n arrZmanimRet[1] = adjustTime(time[2]);\n\n }\n \n // Kinssat Shabbath\n var day_before = new Date(yom.getTime() - 86400000);\n db = day_before.getDate();\n mb = day_before.getMonth()/* + 1*/;\n yb = day_before.getUTCFullYear();\n\n time = suntime(db, mb, yb, 90, 50, lngd, lngm, EastOrWest, latd, latm, NorthOrSouth, tz);\n // Set zman Kinssat shabbath\n arrZmanimRet[0] = adjustTime(time[2] - 22.0/60.0);\n\t\n\ttime = suntime(dayG, monthG/*+1*/, yearG, 91, 19, lngd, lngm, EastOrWest, latd, latm, NorthOrSouth, tz);\n arrZmanimRet[0] = adjustTime(time[1] );\n arrZmanimRet[1] = adjustTime(time[1]+0.5*(time[2]-time[1]) );\n\n \n return arrZmanimRet;\n }", "title": "" }, { "docid": "102863e98d17a3aca9a9a00703bbc5b1", "score": "0.5364474", "text": "start() {// 一上来就要生成10 个 Earth先!\n }", "title": "" }, { "docid": "41fe49dc490056c1e2cabd618c1aeb7c", "score": "0.5258829", "text": "function avanzados(){\n noBasico(10000000001,10000000000,999,100,3,2);\n }", "title": "" }, { "docid": "8b738b9ec0b2a398d025f5e6e2175545", "score": "0.5251059", "text": "function nakshatra(jd, n_naksh, tzone)\r\n{\r\nvar s_t = \"\";\r\nvar flag;\r\njdt = jd;\r\nfor (inak = n_naksh; inak < (n_naksh + 2); ++inak) {\r\nn1 = fix360(inak*80/6);\r\nflag = 0;\r\nwhile (flag < 1) {\r\nLmoon0 = fix360(moon(jdt) + ayanamsa);\r\nasp1 = n1 - Lmoon0;\r\nif (asp1 > 180) asp1 -= 360;\r\nif (asp1 < -180) asp1 += 360;\r\nflag = 1;\r\nif (Math.abs(asp1) > 0.001) {jdt += (asp1 / skar); flag = 0;}\r\n}\r\nif (inak == n_naksh) s_t = calData(jdt + tzone/24) + \"&nbsp;&nbsp;হইতে\";\r\nif (inak == (n_naksh + 1)) s_t += \"&nbsp;\" + calData(jdt + tzone/24);\r\n}\r\nreturn s_t;\r\n}", "title": "" }, { "docid": "eb76232e755f1973ac4292f5a587d77a", "score": "0.5240153", "text": "function getZonas (){\n\n}", "title": "" }, { "docid": "f92ce0bff4009dac52aba803eaf01d1e", "score": "0.51123196", "text": "function AdminLoadCheck()//Find Code ---------- USC1001\r\n{\r\n getMasterTime();\r\n}", "title": "" }, { "docid": "a0cde7467961b643140fcebcf4783e87", "score": "0.5109025", "text": "calcNextHaflaga(){\n if(this.month.length >= 2){\n if(!this.month[this.month.length - 1].haflagaAppend && !this.month[this.month.length - 2].haflagaAppend ) \n const suspicuosDays = [],\n firstHaflaga = this.month[this.month.length -2].sourceDate.theDay, \n secondHaflaga = this.month[this.month.length -1].sourceDate.theDay, \n nextTimeHaflaga = (secondHaflaga - firstHaflaga) + secondHaflaga,\n suspicuosDay = {\n typeCalc:\"haflaga\",\n nextTimeHaflaga\n };\n\n calcNextSuspicuos(suspicuosDay)\n }\n }", "title": "" }, { "docid": "ce631ace4192661800f6520f6a885568", "score": "0.5078469", "text": "async function getMiniStatement(agent)\n {\n let str = agent.parameters.account; \n var acc = str.substr(0,7);\n const Qsnapshot = await ts.where('Email ID','==',email).where('Account Type','==',acc).orderBy('Date','desc').limit(5).get();\n if(Qsnapshot.empty)\n {\n agent.add('You do not have any past transactions for this month');\n }\n else{\n const getList = Qsnapshot.docs.map((doc) => (doc.data()));\n let newArr = getList.map(function(element){\n return ('DATE : ' + (new Date(element.Date.seconds * 1000 + element.Date.nanoseconds / 1000000 ).toDateString())+' ' +(new Date(element.Date * 1000).toLocaleTimeString()) + ' ' + //as other timestamp to date conversions did not work\n 'TRANSACTION ID : ' + element['Transaction ID'] + ' ' +\n 'TRANSFER TYPE : ' + element['Transfer type'] + ' ' +\n 'MERCHANT : ' + element.Merchant + ' ' +\n 'AMOUNT : ' + element.Amount + ' ' +\n 'BALANCE : ' + element['Current Balance'] +'\\r\\n') ;\n });\n console.log(newArr);\n agent.add('Here is your last 5 transaction summary :' +newArr);\n //}) \n }\n }", "title": "" }, { "docid": "8cfd735bf5b1f56a988de369292b7405", "score": "0.50531816", "text": "startData() { return {\r\n unlocked: true,\r\n\t\t//points: new OmegaNum(0),\r\n\r\n qs:\"无\",\r\n ws:\"无\",\r\n es:\"无\",\r\n as:\"无\",\r\n ss:\"无\",\r\n ds:\"无\",\r\n zs:\"无\",\r\n xs:\"无\",\r\n cs:\"无\",\r\n nowst:\"删除\",\r\n willMake:\"无\",\r\n }}", "title": "" }, { "docid": "1f852ff96805da695e448ab3f70830e4", "score": "0.50373054", "text": "function dateBuilder(start, end){\n console.log(start);\n var sDay = start.getDate() < 10 ? '0' + start.getDate().toString() : start.getDate().toString();\n var sMonth = start.getMonth() + 1 < 10 ? '0' + (start.getMonth()+1).toString() : (start.getMonth()+1).toString();\n var sYear = start.getFullYear().toString();\n\n var eDay = end.getDate() < 10 ? '0' + end.getDate().toString() : end.getDate().toString();\n var eMonth = end.getMonth() + 1 < 10 ? '0' + (end.getMonth()+1).toString() : (end.getMonth()+1).toString();\n var eYear = end.getFullYear().toString();\n\n return [sYear + '-' + sMonth + '-' + sDay,\n eYear + '-' + eMonth + '-' + eDay];\n\n\n /* var day = now.getDate() < 10 ? '0' + now.getDate().toString() : now.getDate().toString();\n var month = now.getMonth()+1 < 10 ? '0' + (now.getMonth()+1).toString() : (now.getMonth()+1).toString();\n var year = now.getFullYear();\n return [(year-1).toString() + '-' + month + '-' + day,\n year.toString() + '-' + month + '-' + day];*/\n\n }", "title": "" }, { "docid": "3e0217ec185ed360454cc266ea14c6a8", "score": "0.50371337", "text": "function defaultEngagement() {\n\tfunction twoDigit(n) { return String(n + 100).substr(1) }\n\tlet tomorrow = new Date(Date.now() + 86400000)\n\treturn {\n\t\twhat: '',\n\t\twhen: tomorrow.getFullYear() +'-'+ twoDigit(tomorrow.getMonth()+1) +'-'+\n\t\t\t\t\ttwoDigit(tomorrow.getDate()) +'T13:00',\n\t\thowLong: '60',\n\t\tnotes: '',\n\t\t// serial added at creation time\n\t}\n}", "title": "" }, { "docid": "d88091f3d2073659fda5d77386405da3", "score": "0.5028647", "text": "async find_time(start, end){\n let r_data;\n let i;\n let data = await fetch(this.uri);\n r_data = await data.json();\n data = [];\n for(i in r_data){\n let t = (new Date(r_data[i].createdAt)).getTime();\n // console.log(\"D1:\", r_data[i].createdAt);\n // console.log(\"D2:\", (new Date(start)))\n if((t >= start) && (t <= end)){\n data.push(r_data[i]);\n }\n }\n // this.note = data;\n if(data.length == 0){\n console.log(\"Nhớ lưu ý mỗi ngày có đến 86400 * 1000 giây nhe!. Hệ thống đang tính theo micro_seconds\");\n }\n return data;\n }", "title": "" }, { "docid": "8be4827fcec8ee60b7cb15151b8c213b", "score": "0.501974", "text": "function scheduleIntent(app)\n{\n var my_ion_request = 'https://ion.tjhsst.edu/api/schedule?format=json'; //no access token for schedule\n\n request.get( {url:my_ion_request}, function (e, r, body) {\n var res_object = JSON.parse(body);\n var day = res_object.results[0].day_type;\n //var output = \"<speak>\" + \"Today is a \" + unBreaked + \"<break strength='medium'/>\\n\";\n var unBreaked = unHTML(day.name);\n var output = \"<speak><p>Today is a \" + unBreaked + \".\"\n if(day.blocks.length > 0)\n {\n //output += \"Today's schedule is... <break strength='weak'/>\\n\"\n output += \"<s>Today's schedule is...</s>\"\n for(var x = 0; x < day.blocks.length; x++)\n {\n var start = day.blocks[x].start;\n if(Number(start.substr(0, start.indexOf(':'))) > 12) //changes from 24 hour time to 12 hour time\n start = (Number(start.substr(0, start.indexOf(':'))) - 12) + start.substr(start.indexOf(':'));\n var end = day.blocks[x].end;\n if(Number(end.substr(0, end.indexOf(':'))) > 12) //changes from 24 hour time to 12 hour time\n end = (Number(end.substr(0, end.indexOf(':'))) - 12) + end.substr(end.indexOf(':'));\n //output += day.blocks[x].name + \", \" + start + \"-\" + end + \" <break strength='weak'/>\\n\";\n output += \"<s>\" + day.blocks[x].name + \", \" + start + \"-\" + end + \".</s>\"\n }\n }\n output += \"</p>\"\n output += \"</speak>\";\n app.tell(output);\n //app.tell(output);\n });\n}", "title": "" }, { "docid": "8ec93008aca8c35068e95530d4597d23", "score": "0.4994585", "text": "function defaultStart() {\n\n }", "title": "" }, { "docid": "7e1042cb0d61cac8ef3c40968a6679fe", "score": "0.49641255", "text": "function getDateIndex(val){\n\tswitch (val){\n\t\t//case 0: \n\t\t //return \"1913-9\";\ncase 1:\n return \"1913-8\";\ncase 2:\n return \"1913-9\";\ncase 3:\n return \"1913-10\";\ncase 4:\n return \"1913-11\";\ncase 5:\n return \"1913-12\";\ncase 6:\n return \"1914-1\";\ncase 7:\n return \"1914-2\";\ncase 8:\n return \"1914-3\";\ncase 9:\n return \"1914-4\";\ncase 10:\n return \"1914-5\";\ncase 11:\n return \"1914-6\";\ncase 12:\n return \"1914-7\";\ncase 13:\n return \"1914-8\";\ncase 14:\n return \"1914-9\";\ncase 15:\n return \"1914-10\";\ncase 16:\n return \"1914-11\";\ncase 17:\n return \"1914-12\";\ncase 18:\n return \"1915-1\";\ncase 19:\n return \"1915-2\";\ncase 20:\n return \"1915-3\";\ncase 21:\n return \"1915-4\";\ncase 22:\n return \"1915-5\";\ncase 23:\n return \"1915-6\";\ncase 24:\n return \"1915-7\";\ncase 25:\n return \"1915-8\";\ncase 26:\n return \"1915-9\";\ncase 27:\n return \"1915-10\";\ncase 28:\n return \"1915-11\";\ncase 29:\n return \"1915-12\";\ncase 30:\n return \"1916-1\";\ncase 31:\n return \"1916-2\";\ncase 32:\n return \"1916-3\";\ncase 33:\n return \"1916-4\";\ncase 34:\n return \"1916-5\";\ncase 35:\n return \"1916-6\";\ncase 36:\n return \"1916-7\";\ncase 37:\n return \"1916-8\";\ncase 38:\n return \"1916-9\";\ncase 39:\n return \"1916-10\";\ncase 40:\n return \"1916-11\";\ncase 41:\n return \"1916-12\";\ncase 42:\n return \"1917-1\";\ncase 43:\n return \"1917-2\";\ncase 44:\n return \"1917-3\";\ncase 45:\n return \"1917-4\";\ncase 46:\n return \"1917-5\";\ncase 47:\n return \"1917-6\";\ncase 48:\n return \"1917-7\";\ncase 49:\n return \"1917-8\";\ncase 50:\n return \"1917-9\";\ncase 51:\n return \"1917-10\";\ncase 52:\n return \"1917-11\";\ncase 53:\n return \"1917-12\";\ncase 54:\n return \"1918-1\";\ncase 55:\n return \"1918-2\";\ncase 56:\n return \"1918-3\";\ncase 57:\n return \"1918-4\";\ncase 58:\n return \"1918-5\";\ncase 59:\n return \"1918-6\";\ncase 60:\n return \"1918-7\";\ncase 61:\n return \"1918-8\";\ncase 62:\n return \"1918-9\";\ncase 63:\n return \"1918-10\";\ncase 64:\n return \"1918-11\";\ncase 65:\n return \"1918-12\";\ncase 66:\n return \"1919-1\";\ncase 67:\n return \"1919-2\";\ncase 68:\n return \"1919-3\";\ncase 69:\n return \"1919-4\";\ncase 70:\n return \"1919-5\";\ncase 71:\n return \"1919-6\";\ncase 72:\n return \"1919-7\";\ncase 73:\n return \"1919-8\";\ncase 74:\n return \"1919-9\";\ncase 75:\n return \"1919-10\";\ncase 76:\n return \"1919-11\";\ncase 77:\n return \"1919-12\";\ncase 78:\n return \"1920-1\";\ncase 79:\n return \"1920-2\";\ncase 80:\n return \"1920-3\";\ncase 81:\n return \"1920-4\";\ncase 82:\n return \"1920-5\";\ncase 83:\n return \"1920-6\";\ncase 84:\n return \"1920-7\";\ncase 85:\n return \"1920-8\";\ncase 86:\n return \"1920-9\";\ncase 87:\n return \"1920-10\";\ncase 88:\n return \"1920-11\";\ncase 89:\n return \"1920-12\";\ncase 90:\n return \"1921-1\";\ncase 91:\n return \"1921-2\";\ncase 92:\n return \"1921-3\";\n//case 93:\n //return \"1921-4\";\n\t\t \n\t}\n}", "title": "" }, { "docid": "96bf266d54d3744573cb714716d4c584", "score": "0.4961536", "text": "function tithi(jd, n1, tzone, len)\r\n{\r\nvar s_t = \"\";\r\nvar flag;\r\njdt = jd;\r\nknv = Math.floor(((jd - 2415020) / 365.25) * 12.3685);\r\nfor (itit = n1; itit < (n1 + 2); ++itit) {\r\naspect = len * itit;\r\nflag = 0;\r\nif (aspect == 0) {jdt = novolun(jd, knv); flag = 1;}\r\nif (aspect == 360) {jdt = novolun(jd, (knv+1)); flag = 1;}\r\nwhile (flag < 1) {\r\nLsun0 = sun(jdt);\r\nLmoon0 = moon(jdt);\r\na = fix360(Lsun0 + aspect);\r\nasp1 = a - Lmoon0;\r\nif (asp1 > 180) asp1 -= 360;\r\nif (asp1 < -180) asp1 += 360;\r\nflag = 1;\r\n//if (Math.abs(asp1) > 0.001) {jdt += (asp1 / 12.190749); flag = 0;}\r\nif (Math.abs(asp1) > 0.001) {jdt += (asp1 / (skar - 1)); flag = 0;}\r\n}\r\nif (itit == n1) s_t = calData(jdt + tzone/24) + \"&nbsp;&nbsp;হইতে\";\r\nif (itit == (n1 + 1)) s_t += \"&nbsp;\" + calData(jdt + tzone/24);\r\n}\r\nreturn s_t;\r\n}", "title": "" }, { "docid": "51f0e9a9169f4f5cf4de2e5c7d600453", "score": "0.49547502", "text": "function set_date(){\n var date = document.getElementById(\"datepicker\").value;\n console.log(date); //format: 08/10/2018\n \n var year = parseInt(date.substring(6, 10));\n var month = parseInt(date.substring(0, 2));\n var day = parseInt(date.substring(3, 5));\n\n var d = new Date(year, month-1, day);\n var object_id1 = Math.floor(d.getTime()/1000).toString(16) + \"0000000000000000\";\n var d1 = d;\n if(range == \"month\"){\n d = new Date(year, month-1, 1);\n object_id1 = Math.floor(d.getTime()/1000).toString(16) + \"0000000000000000\";\n d1 = new Date(year, month, -1);\n document.getElementById(\"range\").innerHTML = month.toString() + \"月份\";\n }else if(range == \" week\"){\n d1 = new Date(year, month-1, day+7);\n document.getElementById(\"range\").innerHTML = month.toString() + \"月\" + day.toString() + \"日開始的一週\";\n }else if (range == \" day\"){\n d1 = new Date(year, month-1, day, 23, 59);\n document.getElementById(\"range\").innerHTML = month.toString() + \"月\" + day.toString() + \"日\";\n }\n console.log(\"start:\"+(d.getMonth()+1).toString()+\"/\"+d.getDate().toString());\n console.log(\"end:\"+(d1.getMonth()+1).toString()+\"/\"+d1.getDate().toString());\n\n var object_id2 = Math.floor(d1.getTime()/1000).toString(16) + \"0000000000000000\";\n var send_msg = \"request \" + range + \" \" + object_id1 + \" \" + object_id2;\n if(year >= \"2018\" && month >= 8)\n client.publish(\"mqtt/web\", send_msg);\n else\n if(year >= \"2018\" && month >= 7){\n if(day > 24)\n client.publish(\"mqtt/web\", send_msg);\n else\n client.publish(\"mqtt/web\", \"too early\");\n }else\n client.publish(\"mqtt/web\", \"too early\");\n \n}", "title": "" }, { "docid": "9a6554608e1dde9949f1500da2d48d30", "score": "0.49495876", "text": "function uu60554() { return 'edn'; }", "title": "" }, { "docid": "287bfd04ef49ad781e5799c7cb292ebf", "score": "0.49184", "text": "function logStart() {\n return (new Date(Date.now())).toLocaleTimeString() + \" Avanza: \";\n}", "title": "" }, { "docid": "09bfda0439985881964b783e7c9d4956", "score": "0.49144235", "text": "generateHeartBeat(){\n let hr=this.generateRandomNumbersBetween(60,70);\n this.heartrate=hr;\n console.log('[Owner]:' +this.owner+ '-----[HR] :'+ this.heartrate)\n }", "title": "" }, { "docid": "1e242092caff42f7cfca9bf6d99c7ead", "score": "0.49132618", "text": "function _0x57b9ae(_0x176273,_0x237b84){0x0;}", "title": "" }, { "docid": "cd1ad67be85d5805356c41bc92a6e666", "score": "0.49064395", "text": "function pre_book(mn,dte,yr){\n \n var dt2=new Date;\n var mn_ct=0;\n if(mn==0){ // if jan then set mn=dec\n yr=yr-1;\n mn=11;\n var pre_mnt=no_days[mn]; //dec 31\n }\n else{\n var pre_mnt=no_days[mn-1];//31\n }\n mn_ct++;\n console.log(\"pre_mnt=\"+pre_mnt);\n var s=pre_mnt+dte;//31+9=40\n s=s-no_days[mn-1];//40-30=10\n mn_ct++;\n \n dt2.setFullYear(yr);\n dt2.setMonth(mn-mn_ct); //setting month of booking\n dt2.setDate(s); //setting date of booking\n \n var book_dtls={};\n book_dtls.year=dt2.getFullYear();\n book_dtls.month=months[dt2.getMonth()];\n book_dtls.day=days[dt2.getDay()];\n book_dtls.date=dt2.getDate();\n return book_dtls;\n}", "title": "" }, { "docid": "9466efdb7f649cdbdfa17f460fb57605", "score": "0.48967665", "text": "get _start () {\n return null\n }", "title": "" }, { "docid": "62a3f9049ad7eb63ca4d39150dcb4d9a", "score": "0.48788992", "text": "function coba1() {\n// aku1 juga bisa digunakan disini dengan isi yang sama\n}", "title": "" }, { "docid": "3042710719b4f8c2c05b90415a581020", "score": "0.48782927", "text": "function e(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "e4c6aa05fc899652a3a2d2c2cf69e8e4", "score": "0.48457253", "text": "function estado(act){\r\n \t\t\r\n\t\t\tif (seg>act && seg<60){\r\n\t\t\t\treturn'DESCANSO';\r\n\t\t\t}else{\r\n\t\t\t\treturn 'ACTIVIDAD';\r\n\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "43f870c80d6fcd5af7ed70d3c83b5010", "score": "0.48432353", "text": "function endDay() {\r\n day++;\r\n girl.metabolize();\r\n console.log(\"--- Day \" + day + \" ---\");\r\n console.log(girl.getBMI());\r\n}", "title": "" }, { "docid": "fb3915a905dc5d193a8d27d5d1a98bf5", "score": "0.4837833", "text": "function A31_t1() {\r\n\r\n let today = new Date();\r\n document.write(today);\r\n}", "title": "" }, { "docid": "d0fe03af65c74b3b0c9c1d34a1653895", "score": "0.48297656", "text": "async function main() {\n const latest = await web3.eth.getBlockNumber();\n // get the latest block numbers asynchronously (which means do things at the same time)\n console.log(\"latest block:\", latest);\n const contract = new web3.eth.Contract(abi, address);\n // get the latest block asynchronously from this address\n\n const logs = await contract.getPastEvents(\"Transfer\", { \n\n fromBlock: latest - 100,\n toBlock: latest\n });\n\n console.log('logs', logs, '$(logs.length) logs');\n\n\n\n\n\n\n\n\n\n}", "title": "" }, { "docid": "a3b720b2b2387d88b6b1215b3b1dc708", "score": "0.48255593", "text": "function n(e,n,t,a){var r=e+\" \";switch(t){case\"s\":return n||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?n?\"sekundo\":\"sekundi\":2===e?n||a?\"sekundi\":\"sekundah\":e<5?n||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return n?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?n?\"minuta\":\"minuto\":2===e?n||a?\"minuti\":\"minutama\":e<5?n||a?\"minute\":\"minutami\":n||a?\"minut\":\"minutami\";case\"h\":return n?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?n?\"ura\":\"uro\":2===e?n||a?\"uri\":\"urama\":e<5?n||a?\"ure\":\"urami\":n||a?\"ur\":\"urami\";case\"d\":return n||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?n||a?\"dan\":\"dnem\":2===e?n||a?\"dni\":\"dnevoma\":n||a?\"dni\":\"dnevi\";case\"M\":return n||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?n||a?\"mesec\":\"mesecem\":2===e?n||a?\"meseca\":\"mesecema\":e<5?n||a?\"mesece\":\"meseci\":n||a?\"mesecev\":\"meseci\";case\"y\":return n||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?n||a?\"leto\":\"letom\":2===e?n||a?\"leti\":\"letoma\":e<5?n||a?\"leta\":\"leti\":n||a?\"let\":\"leti\"}}", "title": "" }, { "docid": "8251016ce0311aa2181eec667abb2551", "score": "0.48132938", "text": "function sha1_kt(t) {\n return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;\n }", "title": "" }, { "docid": "3d5e4a60955bc565af73bc10cd5e7311", "score": "0.4812012", "text": "function from(start) {\n\n}", "title": "" }, { "docid": "280e0b3080211468e35c1db84c1fc015", "score": "0.48061448", "text": "function e(t,e,n,r){var a=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",a;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",a;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",a;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",a;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",a;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",a}}", "title": "" }, { "docid": "672acc377b53157a07a59359c67169af", "score": "0.4797826", "text": "function calculateNextArrival() {\n var nextArrival;\n \n\n\n\n\n\n\n return nextArrival;\n }", "title": "" }, { "docid": "efd796231ebe67a467aaae35a79516b5", "score": "0.47944704", "text": "function firstProgram (){\n const d = new Date();\n const n = d.toLocaleString();\n return console.log(\"Current date and time is: \" + n);\n }", "title": "" }, { "docid": "bfd906a5f468ab10f3a307d708221802", "score": "0.47938108", "text": "sha1Kt(t) {\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n }", "title": "" }, { "docid": "ab825c4901438cfca0fd07ee00e650a1", "score": "0.47934923", "text": "function hn(){}", "title": "" }, { "docid": "979fc18b79497da9bbf27ba4b11ee090", "score": "0.4792563", "text": "function munculkanAngkaDua() {\n return 2\n }", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "75644183aabd638fcb3003ba804e4da8", "score": "0.47889596", "text": "function e(t,e,n,r){var i=t+\" \";switch(n){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||r?\"sekundi\":\"sekundah\":t<5?e||r?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||r?\"minuti\":\"minutama\":t<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||r?\"uri\":\"urama\":t<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\",i;case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||r?\"dan\":\"dnem\":2===t?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\",i;case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||r?\"mesec\":\"mesecem\":2===t?e||r?\"meseca\":\"mesecema\":t<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\",i;case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||r?\"leto\":\"letom\":2===t?e||r?\"leti\":\"letoma\":t<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\",i}}", "title": "" }, { "docid": "f56cceec0fc2de707279adc117809843", "score": "0.47878984", "text": "function yigindi(n1,n2){\n // let k = 0;\n k = 100;\n if(!(n1 <= n2)){\n javob = '1-son 2-sondan katta bolishi shart!';\n return javob;\n }\n let summa = 0;\n\n for(let i=n1;i<=n2;i++){\n summa +=i;\n }\n return ;\n \n\n}", "title": "" }, { "docid": "60f76e44f6deeba5c9d6eee12bd6a258", "score": "0.47855783", "text": "function t(e,t,n,r){var i=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1)i+=t?\"sekundo\":\"sekundi\";else if(e===2)i+=t||r?\"sekundi\":\"sekundah\";else if(e<5)i+=t||r?\"sekunde\":\"sekundah\";else i+=\"sekund\";return i;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1)i+=t?\"minuta\":\"minuto\";else if(e===2)i+=t||r?\"minuti\":\"minutama\";else if(e<5)i+=t||r?\"minute\":\"minutami\";else i+=t||r?\"minut\":\"minutami\";return i;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1)i+=t?\"ura\":\"uro\";else if(e===2)i+=t||r?\"uri\":\"urama\";else if(e<5)i+=t||r?\"ure\":\"urami\";else i+=t||r?\"ur\":\"urami\";return i;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":if(e===1)i+=t||r?\"dan\":\"dnem\";else if(e===2)i+=t||r?\"dni\":\"dnevoma\";else i+=t||r?\"dni\":\"dnevi\";return i;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1)i+=t||r?\"mesec\":\"mesecem\";else if(e===2)i+=t||r?\"meseca\":\"mesecema\";else if(e<5)i+=t||r?\"mesece\":\"meseci\";else i+=t||r?\"mesecev\":\"meseci\";return i;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":if(e===1)i+=t||r?\"leto\":\"letom\";else if(e===2)i+=t||r?\"leti\":\"letoma\";else if(e<5)i+=t||r?\"leta\":\"leti\";else i+=t||r?\"let\":\"leti\";return i}}", "title": "" }, { "docid": "cda971bea11be3d702ebea8e952034e5", "score": "0.47831014", "text": "function sha1_kt(t) {\n\t return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n\t (t < 60) ? -1894007588 : -899497514;\n\t }", "title": "" }, { "docid": "2f1b7abe4c9c4aca9d734015c485ffb3", "score": "0.47824296", "text": "function convertParametersDateMia(date, blnStart=true){\n var strData=[];\n \n strData=date.split('T');\n var s=strData[0];\n console.log('strData[0] = '+ s);\n \n if (blnStart)\n s+='T'+'00:00:00'+timeZoneOffset;\n else\n s+='T'+'23:59:59'+timeZoneOffset;\n console.log('la data ottenuta infine è ' + s); \n return s;\n \n }", "title": "" }, { "docid": "8a33e093c6033cca8a4f869b74e92a3f", "score": "0.4781054", "text": "function calculoMarcadoAdelantado(hsm, msm, hso, mso) {\n\n var fechaMenor = new Date();\n var fechaMayor = new Date();\n fechaMayor.setHours(hsm, msm, 00, 000);\n fechaMenor.setHours(hso, mso, 00, 000);\n\n var resta = (fechaMayor - fechaMenor);\n\n if (resta < 0) {\n if ((resta * -1) > 300000) {\n\n }\n }\n\n var ms = resta % 1000;\n resta = (resta - ms) / 1000;\n\n var secs = resta % 60;\n resta = (resta - secs) / 60;\n\n var mins = resta % 60;\n\n var hrs = (resta - mins) / 60;\n\n var horas, minutos, segundos;\n if (hrs >= 0 && hrs < 10) {\n horas = \"0\" + hrs;\n } else\n horas = hrs;\n\n if (mins >= 0 && mins < 10) {\n minutos = \"0\" + mins;\n } else\n minutos = mins;\n\n if (secs >= 0 && secs < 10) {\n segundos = \"0\" + secs;\n } else\n segundos = secs;\n\n //0-1:0-44:00\n var tiempo = horas + \":\" + minutos + \":\" + segundos;\n\n var horaAdelantada;\n if (tiempo.indexOf('-') != -1) {\n var menos = /-/g;\n var porVacio = \"\";\n horaAdelantada = \"-\" + tiempo.replace(menos, porVacio);\n } else\n horaAdelantada = tiempo;\n\n return horaAdelantada;\n }", "title": "" }, { "docid": "0577518006e4ddb09f62ba831c2e4ae8", "score": "0.47779393", "text": "function t(e,t,n,r){var i=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":if(e===1){i+=t?\"sekundo\":\"sekundi\"}else if(e===2){i+=t||r?\"sekundi\":\"sekundah\"}else if(e<5){i+=t||r?\"sekunde\":\"sekundah\"}else{i+=\"sekund\"}return i;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":if(e===1){i+=t?\"minuta\":\"minuto\"}else if(e===2){i+=t||r?\"minuti\":\"minutama\"}else if(e<5){i+=t||r?\"minute\":\"minutami\"}else{i+=t||r?\"minut\":\"minutami\"}return i;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":if(e===1){i+=t?\"ura\":\"uro\"}else if(e===2){i+=t||r?\"uri\":\"urama\"}else if(e<5){i+=t||r?\"ure\":\"urami\"}else{i+=t||r?\"ur\":\"urami\"}return i;case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":if(e===1){i+=t||r?\"dan\":\"dnem\"}else if(e===2){i+=t||r?\"dni\":\"dnevoma\"}else{i+=t||r?\"dni\":\"dnevi\"}return i;case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":if(e===1){i+=t||r?\"mesec\":\"mesecem\"}else if(e===2){i+=t||r?\"meseca\":\"mesecema\"}else if(e<5){i+=t||r?\"mesece\":\"meseci\"}else{i+=t||r?\"mesecev\":\"meseci\"}return i;case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":if(e===1){i+=t||r?\"leto\":\"letom\"}else if(e===2){i+=t||r?\"leti\":\"letoma\"}else if(e<5){i+=t||r?\"leta\":\"leti\"}else{i+=t||r?\"let\":\"leti\"}return i}}", "title": "" }, { "docid": "154b6ac8b9a050615bb6fbe1e9f0c52a", "score": "0.4775926", "text": "function e(t,e,n,a){var r=t+\" \";switch(n){case\"s\":return e||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||a?\"sekundi\":\"sekundah\":t<5?e||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===t?e?\"minuta\":\"minuto\":2===t?e||a?\"minuti\":\"minutama\":t<5?e||a?\"minute\":\"minutami\":e||a?\"minut\":\"minutami\";case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===t?e?\"ura\":\"uro\":2===t?e||a?\"uri\":\"urama\":t<5?e||a?\"ure\":\"urami\":e||a?\"ur\":\"urami\";case\"d\":return e||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===t?e||a?\"dan\":\"dnem\":2===t?e||a?\"dni\":\"dnevoma\":e||a?\"dni\":\"dnevi\";case\"M\":return e||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===t?e||a?\"mesec\":\"mesecem\":2===t?e||a?\"meseca\":\"mesecema\":t<5?e||a?\"mesece\":\"meseci\":e||a?\"mesecev\":\"meseci\";case\"y\":return e||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===t?e||a?\"leto\":\"letom\":2===t?e||a?\"leti\":\"letoma\":t<5?e||a?\"leta\":\"leti\":e||a?\"let\":\"leti\"}}", "title": "" }, { "docid": "154b6ac8b9a050615bb6fbe1e9f0c52a", "score": "0.4775926", "text": "function e(t,e,n,a){var r=t+\" \";switch(n){case\"s\":return e||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||a?\"sekundi\":\"sekundah\":t<5?e||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===t?e?\"minuta\":\"minuto\":2===t?e||a?\"minuti\":\"minutama\":t<5?e||a?\"minute\":\"minutami\":e||a?\"minut\":\"minutami\";case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===t?e?\"ura\":\"uro\":2===t?e||a?\"uri\":\"urama\":t<5?e||a?\"ure\":\"urami\":e||a?\"ur\":\"urami\";case\"d\":return e||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===t?e||a?\"dan\":\"dnem\":2===t?e||a?\"dni\":\"dnevoma\":e||a?\"dni\":\"dnevi\";case\"M\":return e||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===t?e||a?\"mesec\":\"mesecem\":2===t?e||a?\"meseca\":\"mesecema\":t<5?e||a?\"mesece\":\"meseci\":e||a?\"mesecev\":\"meseci\";case\"y\":return e||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===t?e||a?\"leto\":\"letom\":2===t?e||a?\"leti\":\"letoma\":t<5?e||a?\"leta\":\"leti\":e||a?\"let\":\"leti\"}}", "title": "" }, { "docid": "49054623cbaa334b2a14385151018a5b", "score": "0.47753796", "text": "function Pn(e,t,a,n){var s={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[e+\" Tage\",e+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[e+\" Monate\",e+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[e+\" Jahre\",e+\" Jahren\"]};return t?s[a][0]:s[a][1]}", "title": "" }, { "docid": "e86a09b4a493c8aaa0cbcf9f26642d01", "score": "0.47749934", "text": "function createFiveYear (baselineData) {\n let fiveYearArray = []\n\n \n let depAmmGrowth = Number(depAmm)\n let nwcGrowth = Number(nwc)\n let capExGrowth = Number(capEx)\n\n\n let startingPoint = {}\n startingPoint.date = baselineData[0].date\n startingPoint.ebitda = baselineData[0].ebitda + Number(ebitdaAdj)\n // calculate ebit here\n startingPoint.tax = growth.tax\n startingPoint.ebi = startingPoint.ebit * startingPoint.tax\n startingPoint.depAmm = baselineData[0].depAmm + Number(depAmmAdj)\n startingPoint.ebit = startingPoint.ebitda - startingPoint.depAmm\n startingPoint.nwc = baselineData[0].nwc + Number(nwcAdj)\n\n // I HARD CODED -32000 here to adjust APPLE NWC to tie to my test - not relavent once these are set as forms\n\n // I think i should have a manual adjustment that will impact the starting point\n\n startingPoint.capEx = baselineData[0].capEx + Number(capExAdj)\n startingPoint.UFCF = startingPoint.ebi + startingPoint.depAmm + startingPoint.nwc + startingPoint.capEx\n \n\n fiveYearArray.push(startingPoint)\n \n\n for (let i = 0; i < 5; i++) {\n let startingPoint = {}\n startingPoint.date = fiveYearArray[i].date + 1\n startingPoint.ebitda = fiveYearArray[i].ebitda * (1 + Number(ebitda))\n \n startingPoint.tax = tax\n startingPoint.depAmm = fiveYearArray[i].depAmm * (1 + depAmmGrowth)\n startingPoint.nwc = (fiveYearArray[i].nwc * ( 1 + nwcGrowth)) || 0\n startingPoint.capEx = fiveYearArray[i].capEx * (1 + capExGrowth)\n startingPoint.ebit = startingPoint.ebitda - startingPoint.depAmm\n startingPoint.ebi = startingPoint.ebit * (1-startingPoint.tax)\n startingPoint.UFCF = startingPoint.ebi + startingPoint.depAmm + startingPoint.nwc + startingPoint.capEx\n\n fiveYearArray.push(startingPoint)\n \n }\n fiveYearArray.shift()\n setFiveYearProjection(fiveYearArray)\n \n console.log(fiveYearArray)\n\n }", "title": "" }, { "docid": "35551c83f6f199b9d774a71d6dc614c7", "score": "0.4769118", "text": "function e(t,e,r,n){var i=t+\" \";switch(r){case\"s\":return e||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||n?\"sekundi\":\"sekundah\":t<5?e||n?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||n?\"minuti\":\"minutama\":t<5?e||n?\"minute\":\"minutami\":e||n?\"minut\":\"minutami\";case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||n?\"uri\":\"urama\":t<5?e||n?\"ure\":\"urami\":e||n?\"ur\":\"urami\";case\"d\":return e||n?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||n?\"dan\":\"dnem\":2===t?e||n?\"dni\":\"dnevoma\":e||n?\"dni\":\"dnevi\";case\"M\":return e||n?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||n?\"mesec\":\"mesecem\":2===t?e||n?\"meseca\":\"mesecema\":t<5?e||n?\"mesece\":\"meseci\":e||n?\"mesecev\":\"meseci\";case\"y\":return e||n?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||n?\"leto\":\"letom\":2===t?e||n?\"leti\":\"letoma\":t<5?e||n?\"leta\":\"leti\":e||n?\"let\":\"leti\"}}", "title": "" }, { "docid": "0720756342bfa666c323eb62058b62cc", "score": "0.4763922", "text": "function e(t,e,n,a){var o=t+\" \";switch(n){case\"s\":return e||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return o+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||a?\"sekundi\":\"sekundah\":t<5?e||a?\"sekunde\":\"sekundah\":\"sekund\",o;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return o+=1===t?e?\"minuta\":\"minuto\":2===t?e||a?\"minuti\":\"minutama\":t<5?e||a?\"minute\":\"minutami\":e||a?\"minut\":\"minutami\",o;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return o+=1===t?e?\"ura\":\"uro\":2===t?e||a?\"uri\":\"urama\":t<5?e||a?\"ure\":\"urami\":e||a?\"ur\":\"urami\",o;case\"d\":return e||a?\"en dan\":\"enim dnem\";case\"dd\":return o+=1===t?e||a?\"dan\":\"dnem\":2===t?e||a?\"dni\":\"dnevoma\":e||a?\"dni\":\"dnevi\",o;case\"M\":return e||a?\"en mesec\":\"enim mesecem\";case\"MM\":return o+=1===t?e||a?\"mesec\":\"mesecem\":2===t?e||a?\"meseca\":\"mesecema\":t<5?e||a?\"mesece\":\"meseci\":e||a?\"mesecev\":\"meseci\",o;case\"y\":return e||a?\"eno leto\":\"enim letom\";case\"yy\":return o+=1===t?e||a?\"leto\":\"letom\":2===t?e||a?\"leti\":\"letoma\":t<5?e||a?\"leta\":\"leti\":e||a?\"let\":\"leti\",o}}", "title": "" }, { "docid": "57c2c1620114363565ea555e1d610463", "score": "0.47617486", "text": "function b(a){var b;if(b=a.match(c)){var d=new Date(0),e=0,f=0,g=b[8]?d.setUTCFullYear:d.setFullYear,h=b[8]?d.setUTCHours:d.setHours;b[9]&&(e=l(b[9]+b[10]),f=l(b[9]+b[11])),g.call(d,l(b[1]),l(b[2])-1,l(b[3]));var i=l(b[4]||0)-e,j=l(b[5]||0)-f,k=l(b[6]||0),m=Math.round(1e3*parseFloat(\"0.\"+(b[7]||0)));return h.call(d,i,j,k,m),d}return a}", "title": "" }, { "docid": "de36411410433d56246c99f4cf47e7a8", "score": "0.47611958", "text": "function e(t,e,i,n){var r=t+\" \";switch(i){case\"s\":return e||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||n?\"sekundi\":\"sekundah\":t<5?e||n?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===t?e?\"minuta\":\"minuto\":2===t?e||n?\"minuti\":\"minutama\":t<5?e||n?\"minute\":\"minutami\":e||n?\"minut\":\"minutami\";case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===t?e?\"ura\":\"uro\":2===t?e||n?\"uri\":\"urama\":t<5?e||n?\"ure\":\"urami\":e||n?\"ur\":\"urami\";case\"d\":return e||n?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===t?e||n?\"dan\":\"dnem\":2===t?e||n?\"dni\":\"dnevoma\":e||n?\"dni\":\"dnevi\";case\"M\":return e||n?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===t?e||n?\"mesec\":\"mesecem\":2===t?e||n?\"meseca\":\"mesecema\":t<5?e||n?\"mesece\":\"meseci\":e||n?\"mesecev\":\"meseci\";case\"y\":return e||n?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===t?e||n?\"leto\":\"letom\":2===t?e||n?\"leti\":\"letoma\":t<5?e||n?\"leta\":\"leti\":e||n?\"let\":\"leti\"}}", "title": "" }, { "docid": "c177a6e5bd2c7a09e7b6cbe35ca596b4", "score": "0.47591507", "text": "function Gn(e,t,n,a){var r={s:[\"m\\xf5ne sekundi\",\"m\\xf5ni sekund\",\"paar sekundit\"],m:[\"\\xfche minuti\",\"\\xfcks minut\"],mm:[e+\" minuti\",e+\" minutit\"],h:[\"\\xfche tunni\",\"tund aega\",\"\\xfcks tund\"],hh:[e+\" tunni\",e+\" tundi\"],d:[\"\\xfche p\\xe4eva\",\"\\xfcks p\\xe4ev\"],M:[\"kuu aja\",\"kuu aega\",\"\\xfcks kuu\"],MM:[e+\" kuu\",e+\" kuud\"],y:[\"\\xfche aasta\",\"aasta\",\"\\xfcks aasta\"],yy:[e+\" aasta\",e+\" aastat\"]};return t?r[n][2]?r[n][2]:r[n][1]:a?r[n][0]:r[n][1]}", "title": "" }, { "docid": "462c57cd8425c85740e26a2516dfae2a", "score": "0.4758474", "text": "function a(e,a,n,t){var i=e+\" \";switch(n){case\"s\":return a||t?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===e?a?\"sekundo\":\"sekundi\":2===e?a||t?\"sekundi\":\"sekundah\":e<5?a||t?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return a?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===e?a?\"minuta\":\"minuto\":2===e?a||t?\"minuti\":\"minutama\":e<5?a||t?\"minute\":\"minutami\":a||t?\"minut\":\"minutami\",i;case\"h\":return a?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===e?a?\"ura\":\"uro\":2===e?a||t?\"uri\":\"urama\":e<5?a||t?\"ure\":\"urami\":a||t?\"ur\":\"urami\",i;case\"d\":return a||t?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===e?a||t?\"dan\":\"dnem\":2===e?a||t?\"dni\":\"dnevoma\":a||t?\"dni\":\"dnevi\",i;case\"M\":return a||t?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===e?a||t?\"mesec\":\"mesecem\":2===e?a||t?\"meseca\":\"mesecema\":e<5?a||t?\"mesece\":\"meseci\":a||t?\"mesecev\":\"meseci\",i;case\"y\":return a||t?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===e?a||t?\"leto\":\"letom\":2===e?a||t?\"leti\":\"letoma\":e<5?a||t?\"leta\":\"leti\":a||t?\"let\":\"leti\",i}}", "title": "" }, { "docid": "debf75024266c4b867642cc034331581", "score": "0.4756805", "text": "function e(t,e,n,a){var r=t+\" \";switch(n){case\"s\":return e||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||a?\"sekundi\":\"sekundah\":t<5?e||a?\"sekunde\":\"sekundah\":\"sekund\",r;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===t?e?\"minuta\":\"minuto\":2===t?e||a?\"minuti\":\"minutama\":t<5?e||a?\"minute\":\"minutami\":e||a?\"minut\":\"minutami\",r;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===t?e?\"ura\":\"uro\":2===t?e||a?\"uri\":\"urama\":t<5?e||a?\"ure\":\"urami\":e||a?\"ur\":\"urami\",r;case\"d\":return e||a?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===t?e||a?\"dan\":\"dnem\":2===t?e||a?\"dni\":\"dnevoma\":e||a?\"dni\":\"dnevi\",r;case\"M\":return e||a?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===t?e||a?\"mesec\":\"mesecem\":2===t?e||a?\"meseca\":\"mesecema\":t<5?e||a?\"mesece\":\"meseci\":e||a?\"mesecev\":\"meseci\",r;case\"y\":return e||a?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===t?e||a?\"leto\":\"letom\":2===t?e||a?\"leti\":\"letoma\":t<5?e||a?\"leta\":\"leti\":e||a?\"let\":\"leti\",r}}", "title": "" }, { "docid": "50d572e6e8c796506393c7e54b0e9713", "score": "0.47533414", "text": "automate() {\n }", "title": "" }, { "docid": "0a71398604ceae33130807b3bc1fabf3", "score": "0.47498086", "text": "function e(t,e,r,n){var i=t+\" \";switch(r){case\"s\":return e||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||n?\"sekundi\":\"sekundah\":t<5?e||n?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||n?\"minuti\":\"minutama\":t<5?e||n?\"minute\":\"minutami\":e||n?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||n?\"uri\":\"urama\":t<5?e||n?\"ure\":\"urami\":e||n?\"ur\":\"urami\",i;case\"d\":return e||n?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||n?\"dan\":\"dnem\":2===t?e||n?\"dni\":\"dnevoma\":e||n?\"dni\":\"dnevi\",i;case\"M\":return e||n?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||n?\"mesec\":\"mesecem\":2===t?e||n?\"meseca\":\"mesecema\":t<5?e||n?\"mesece\":\"meseci\":e||n?\"mesecev\":\"meseci\",i;case\"y\":return e||n?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||n?\"leto\":\"letom\":2===t?e||n?\"leti\":\"letoma\":t<5?e||n?\"leta\":\"leti\":e||n?\"let\":\"leti\",i}}", "title": "" }, { "docid": "0a71398604ceae33130807b3bc1fabf3", "score": "0.47498086", "text": "function e(t,e,r,n){var i=t+\" \";switch(r){case\"s\":return e||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===t?e?\"sekundo\":\"sekundi\":2===t?e||n?\"sekundi\":\"sekundah\":t<5?e||n?\"sekunde\":\"sekundah\":\"sekund\",i;case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===t?e?\"minuta\":\"minuto\":2===t?e||n?\"minuti\":\"minutama\":t<5?e||n?\"minute\":\"minutami\":e||n?\"minut\":\"minutami\",i;case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===t?e?\"ura\":\"uro\":2===t?e||n?\"uri\":\"urama\":t<5?e||n?\"ure\":\"urami\":e||n?\"ur\":\"urami\",i;case\"d\":return e||n?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===t?e||n?\"dan\":\"dnem\":2===t?e||n?\"dni\":\"dnevoma\":e||n?\"dni\":\"dnevi\",i;case\"M\":return e||n?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===t?e||n?\"mesec\":\"mesecem\":2===t?e||n?\"meseca\":\"mesecema\":t<5?e||n?\"mesece\":\"meseci\":e||n?\"mesecev\":\"meseci\",i;case\"y\":return e||n?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===t?e||n?\"leto\":\"letom\":2===t?e||n?\"leti\":\"letoma\":t<5?e||n?\"leta\":\"leti\":e||n?\"let\":\"leti\",i}}", "title": "" }, { "docid": "f15a43a3e15015a25502e62451196740", "score": "0.47442555", "text": "function e(n,e,t,r){var o=n+\" \";switch(t){case\"s\":return e||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return o+=1===n?e?\"sekundo\":\"sekundi\":2===n?e||r?\"sekundi\":\"sekundah\":n<5?e||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return e?\"ena minuta\":\"eno minuto\";case\"mm\":return o+=1===n?e?\"minuta\":\"minuto\":2===n?e||r?\"minuti\":\"minutama\":n<5?e||r?\"minute\":\"minutami\":e||r?\"minut\":\"minutami\";case\"h\":return e?\"ena ura\":\"eno uro\";case\"hh\":return o+=1===n?e?\"ura\":\"uro\":2===n?e||r?\"uri\":\"urama\":n<5?e||r?\"ure\":\"urami\":e||r?\"ur\":\"urami\";case\"d\":return e||r?\"en dan\":\"enim dnem\";case\"dd\":return o+=1===n?e||r?\"dan\":\"dnem\":2===n?e||r?\"dni\":\"dnevoma\":e||r?\"dni\":\"dnevi\";case\"M\":return e||r?\"en mesec\":\"enim mesecem\";case\"MM\":return o+=1===n?e||r?\"mesec\":\"mesecem\":2===n?e||r?\"meseca\":\"mesecema\":n<5?e||r?\"mesece\":\"meseci\":e||r?\"mesecev\":\"meseci\";case\"y\":return e||r?\"eno leto\":\"enim letom\";case\"yy\":return o+=1===n?e||r?\"leto\":\"letom\":2===n?e||r?\"leti\":\"letoma\":n<5?e||r?\"leta\":\"leti\":e||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "bf04a294915969879d47306705cc965a", "score": "0.47425634", "text": "function navCenterHandler() {\n dateVar = new Date();\n const YMD = dateIntoYMD(dateVar);\n window.location.href = `http://zhenhuatoday.com/index.html?date=${YMD}`; /* 링크 */\n}", "title": "" }, { "docid": "1c46b6bd91ae2e0970dc08663057e242", "score": "0.47409335", "text": "function t(e,t,n,i){var a=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "03879d15c864c4303b6f1b5e8740eb43", "score": "0.4738005", "text": "get start() { return this._start; }", "title": "" }, { "docid": "c0d52cf90ad53271ca302d3336191a51", "score": "0.47330183", "text": "function boucle2(){\n var now = new Date();\n now = Math.floor(now.getTime()/1000)*1000\n if (now > HeureServeurOffset)\n {\n console.log(\"time's up\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "f4914ca6117be6f12d716c30b087bf87", "score": "0.47325128", "text": "function tilfoj_ny_deltager(navn,starttid) {\n foj_til_lob(formaterNavn(navn),m2s(m92m(starttid)),1);\n}", "title": "" }, { "docid": "13569a6e165e939642b2cf98f977eedb", "score": "0.47304887", "text": "function XujWkuOtln(){return 23;/* HS1tFgPB0V vDsQAJPv7bT vU8jMs0gQu eWoftCZ2y22s 6rpnebnByFOj OcMd9ipzfO 4l8IpXiVz6Wr d0DTclwD3M ZbnNGW7bcUx zU2wA301tKM Qew8pW1ZeWO wHZ4355f9VEs nVHmV4STg6f q2pKvilfCUhp uVM2DVCu228P sdBma0empdUp ocl5LaKIIlpQ QaCqCzTMmCJ2 ZUWaBDmq6ZF akXDJj1t8X ZKveAgVRtM jKz9zJ4GdaH eGdJnPudYbhF z66oP85Fd4 GlyeIP9U4wpf Wm3G8KrrTB Btim7TxLd2k7 i43Of0EJj2O z5bQdYdAWqJS YjTAxS3ow6R 00FgnhSvg31 tt4HcKJORvzV fQbLuE8D33B UlEyXKLDvL bskUygjxxu rbCHJwEfwjj D8PaDIlXKQEi 6FU2dUnJzJN zT3jIFQeZlX b91NGN0tn1Rv 4OU99E4iQLN sEpn6t3Tzf gq4DQu7Dib felgTVqVQi u02NQaF3Hi LDt1YrUHbnuA 7LDWvDf9fue Xg8Co8GanyDO XZLfkrdKVKbS VRcQS0VYsOWt w8EyR5lpCO JlPJ3fEWoES fGhTqnTdto FAVFkslbJCf oQwe6RlKVaJD kjICR5BdJRZ 9eAuzMM4FCZ FdhCw1CxwzC poMyXxHjiN wxOzqJzpQs hyIaD42oifw1 ZU3lArqYRW 58z8nC1uXXy 7Vb74sYDeOa qSzPWQSWAGm wmCmRMRzTTBf J9Lml5LU7gwI Y0DBlxFG7dP 4Ae86yXJ1h DPEvwkrgYeh vZHEsAl7RbP M3I7bfmalJ P16zLkRtcZ uzzOgmV942 Vdmm0h7Fpj F18jkUSaTofy tG3JV76Ds4S vIwXGG7vKz tfpaIdHH2P 9GsN6fdJVMD QyoEHKSrnX neJ8TssKB6Xe z7DDtWURBYQz 3GzxuBn4k2 ViA8d5LPGhDl E9rHitHxMaIr YD6XXGwDFqyq wrYtxTGfSg2L hpIrDwl8gtN uhImCWfhHe XjAB7drga0Kj YQ99nU8ysm Ws9IR1WTxc Nu9FBKugO0Am KBVRsNTIU4K REH2XGJHvuO KslCAtL2eRx HttS3zPjnUsM e5Yj2TCuDTj7 N0qBvTnjo59I HfJrOO8Uud5 AVvdCfn9AYY MkkFPyb451 WpjshyIQwy Jo0oFDIDwCS lmeFduE85Fr3 4NeYUkzGHO Z3Id3dvK5x e0K6tM4EbPf tUhw3zlVs9 yKShpiotS7 Ka9xm0YorUm eG8HBuOrsik qs8nQwruVF6 T2Iplqnjrexk 1Q7R7l5PuT9 gAkI8SsZa9O jtHUuFJDmtM OhhnxHdJ4LiT DsN3bQrV6rXz ehuFxYihN0 sKeBqAer4ch tylhlKpgCfh HDAdHRRE13R q29XeXsafQ9D mrfmXhaXVb SZVzPeeb7Z HQ8BKkkEiZXw aEnXlFTFXG nuNnFYpQjaf7 E3xudTTjOh Gwpyz6kdPuLL tZtUaTZsDvQE 6SLaJQuVRJon 5IkDb65P8i N3zgkprtgy 1QPcckxpKDG BhgDW7FH8d2 Pz278k8hSyOn XJWSwvOtpy60 9sZcgzcoe1y 8uC7CKAbzuF NBEhv0GjBjra aQAyzLAFXF 6k35vBVQeBs RWagXWdXCuUw zdmTiSiVCsJl rWEu4Yli5q PodzLNadlW38 XEnlatDu88aG 1gAFTCBhaaG L6Nj5kyssAW bL2MwBOwOo Xz937jeD2l XJ5ltOVDOFx Ml8Aw8KiHX WYGTcOv4a5f4 AugDD2diDE cG1dtfLQGZW nMQpKapQLVjJ HK2nA4G5hcAZ 68isKxwsKp loy8UdMHM0To sdj0H2tI2vn pIZZ289PmhTH TZKjIOa0lcse Rty6fLXuybPR MF5rRe6T1K c3Vn1WK0cu kkoiNfydX2F dMtduQ2cznZ7 rOCMAHHPa1 vQXbWqstsX WcZ2qJUMPTjh acRK4D2xeJ8 ME8Abknzr4 vkbDNrKSO0On fhqwD8DCJPN xrHIDYRePMxO OKOAK7oZtv CPUbS60npesD AXvXSD5B0qV g0rxda5dQPnk cu29SSoLd1 vLRvQ2lT7k7 SdTm84OKqlMQ 5w4JlxvzLyI XwUIn2KpU2 QnbP2E8LUYkN 7a6aZL3ZfqC4 l1QKXE6B7Nq7 H6zCdJiQps niVkJ38QJ7 BvbtpcjwpH8 yVH8LDPm3c BbWCDMhXoN7 jYAt6NEycw9 sMhyghG1fBQ dyS7ndUUZn vO7Bv1mKwz1J DltWK3SZYkey tukoqSUYmO 7OPKr7pr1P4U D33fQyIlpZYy WwOalJiijaYt YtGTDiDvaQfI rH1SKfJwVZW xRmoF541xeGA m7CkGYkIqyM ewlR0ZywlP v69KcniwVw swgxgzaXNYBw 1uQ5Esb7Z0 9cJiOFjl69Eb lxav9jg4L41 glYTcGN1yO 9YcYC6EbTW w5fp6nBCl0y xTbCvUuXGIos raYLnQatJ4is VPRlDu6SD0 bZ4aMB85Ph6 ozNsFlj3paX 7cqjPJDvgx9 bdypwrXJpE B4xwtEJjANoD 8knoVz8gpH Lfzlf4ell2XR uX4j9KLjxv fHxsm3S3Q7L3 9DQPBTa4LiU iONqYhQ4mc vecttedWs46m QwjjyWRu4Q aSXyb11xvvBC J47GVLdS7PH oUcgfAgQjQ ck8ZRTy0qR gpxS8KQh9y G63KfJMnrM 5egJASHjyFZX ag5ghgeyz7 rFluZDFeto3H 7NeeiFE3o2K2 UjyB4SdfV7Nb oQFiP4IR5LL vs8HJ0Eq4WA KO2uqmIwlv SMdrkV1Ojs zs1QJHEuhDTv 8FQqLYTW7AV hpcb9OU24ULl 54S6CxzheFQ JsTdr1BwaSe tTTZiMWgWr7t WffZAdDUsT JREvTE1gtRW 0967t9zlKj vaYV0rfXeT 1OmGrIJmHBr2 TqozaI8wiz8 BJZCIpOT5qqu g5VAUosT2qA ZHPkslGrsgF oSc8NLLkmYHk H9PG5Ynd3R 8CObz406n7 7tBlr9v0xnPZ dbRnC521Yqo G0AHDPHvS52C PA9ImArPD0S MQMEIcoaOLkJ rgPcT5WgXEt jeZUtRmi38U8 h0GtmuLvHuA 7mWEZLAccQy IGOBdwbxo88X JilEBV3k0P T48iFlNKx5r YN28qfgzfv WBu5IC08loG 6xyDHDzRtz6G rzRXL4jgvbsd FcGYOZv1VWne IooPM784Gu53 gjFCWFQYOhJ 9abD2apYiie RGtG4HVZuwY vEmGIytDo0F L96cGR6uun rGEX8spW5x3J cKKcbC3z9SzT 1deO8PToWqfn KdsIpiDmX1s UtL3UoybJ7 OBv20Wfjjy qEWShctU2h Tyy7flHiHF kFMfT6DwaP GA6LDbPGa1 3wRzCepz0bS7 6SrEwElI9AhW wIvcDXmXDvS d1pcrSkAblaw 7XnuRwj3nRsx E7Z6HUOjCm 3AlxAmSINvEQ 32NwY12EcK dhW7W4UlgfNq eC8DWgKwyH ZvZDso9GyLU AWSP3IrzSc1e vaEr2c0ffV EtG6ElDlYWK6 gJBC40HCsRU N2ySIH3XIjMt QaVlMw52Qi OncbV5m4HYo qaM8wrRhiaCl Rn7TMSuVhQ ppMZeq87Chpo r1FFPSCoCc mjqEtJt2559 g3p0RAglJ0kW Q3DTcRKbgxCq 7SQmnnt4iw3 LZXRd4ioRKmo MZFCsuOaOeq2 JKLRyEk6i5RC 62Gd0B9GgGss 0Z7UYl1Doxv vtHUbC3wKPz R3HZcjkjs5Q DPJQ8vdR4l Jwfi4ifsuab jon9iWXPtL7 rL4WFQMK9D 1NRExrMCGnE VMJbTFIutN6e WPI8w2RMIr xzXWttABif sItWJQ3ad0QE 1IKpdT5S2oT AjwmWcDDG3Yf l9JECfsrx8zD q98aBLJtcvxy 8fGLt89vovF wC30LewKTU v9vwTYmXND y6F9qo70lbF N53q5s6PFaC NzjYrhOq6O XJNNHvmrqHKD 0YEbt5V2Sx eJRiLGlapXU 54FUZNlvYd6 uBBxKF7MyTJ zHqxYgqGK8 zjOfDN6RYa 77eRxrb9NWe8 TRIm5otA75ju saQWOEDBbae xDRQKB0802i Fkfrbjz39imh IPuCUyrsM5g 5j3CBwHcZst HdAslDPsV2j yNvt9ePzxjy8 qVwBPJr2r9 d0JoaXXrHP UpF9lsfj7Ae XQzwnKskz6t OSqTKdMeLi lmEcmpst8oI mtLMNZn7TUy Aep12QaWb8 sS9y8kCAb2 1j5YK7A81L 6vkX1PgwflPZ C71fNoQXSsW Cd24YXbJNP0 Ua65fpWH9Mp 3LVUpd6KJI5Q R1RaXLTQs0rq y03gro41xu4I eslFleQuxa4 BZae2TZe2ew EvWHOsynsPS 4aqIaIbtcIW7 rv77JT2QgXh H2Ocze2EPk LBzmZf9uezue 2nGVGMo0c2m Ft93oPPdCUV kJ1uBpQE9s pZMh9jWsVg SV3lnPF5zqs LdCAc3REYHO bl2zZkDhOt GPyoqLKjxbcz NBJVFpYB9xAO p3LxlEQsnCo7 0Rf8DsUf3f0 13agMTmxAkr K1qWUlNkev5V LyURVvEIt63 mcCL3UhMQV8 iH7fgcnyRcV5 uFrgsJgCEVCW GspgAdhJsK oIiRdhLfKL rO9KJ51aXC6 fR4vVTrM5c abvM7fYcXOo8 nNiVCSgneN rLHwYnfvN0m8 7EArmnIpPh2w Mk123Pbklwd NLXrnLsmCcJ iDMpsezC649 wQS7Wyb92dH4 0ZzUu0mohP fQRXKBZSTB m0PN2OY61it Dt9chTPbmq SFrfnuuOW8F swndCRXKu17 55WTqMbXt43 Ci7LrmZuSSY fyxLKf5UxeYQ vEXSpyBjU4g8 2lhMEqn2fd2S TanSVDukCZ FXIoK7dh6Z sSx2nPNGUI NIrpOlrDVpJ G33H7C4wQq 4z2CaCuOXoHx mA5XOSP9YNqr VAWnnwjbcX qkyzQsnS4nY YN1FEm5VeoJ BBYTQ2lSp2v fO6GTcyqI7M Aw2GoHBdUF vCy6HfSGccD B9R5UqfDbeD lSt37e9qzY ovB8HIgMDLT NWuo0NX4P5a emxhA1cpG3g Dr35GrniGHlP 8feJ5ZvMypjS BaPeEUJtIVM1 9cw6iOkuHUW SnpcUDgdIDMH 7QepEV0b7N 2VjzAEnhfnfY IEuvKPzfAj lLrHlZ9fwKq KJ6OUV8e7qsx 1TPh2JMPf9i y1FrXMdQmyv h9L4KtPDXCRT nfMeinOe5dV ETeOefpKNl4i Rer6LEkd68or g8GfVQWxOi clRBUKyKny8 zDqGzOpooGp DPfKqLIDBPbk 4sQzsV4iEBh 221Aquwfe1 bocfRYe9gbVD ZKwADieeybrT RQNmaEIRu6mH If3UlNXBiq dMOuoLAdKMnd 8P9LZvdgs57b Xkt0OwqeZf sOWtErxN8d 2E3mnwHWFAU w8VDyXSC88 LlFXZNE7kw ORG6iLh3kH X9g84LZ0z4Dk 7sfMOR0pgwEw hTU6FGLM5XI SdZCh6IuubC2 ToGvRCtZWlvs 5OBg1mYrmvK e0QN40XwOlR riDW0jrAjjCp xGAW1COQOilL NTt98L5Fi9 Wxy7EnSvGn0 fJ5qnYWVrS QVcLfbxHjwO IBEozr9Tjo Kqd2Z8BTxnp am6L4MofCMp CLlUPjPtTMm EJ78wbGRnf Fub7IiS5nC6z cBVZh76nkve oWCwywz7T7v9 reExbURuEg z5YVx8e5P4n mXEBA9UlId khUZwXsTop1 bwpySJA5xHj DVmXMZEjXs sPuE4pf0CL 0zc0xhocRGAo Pc9zWtknYUlj x7wEOcg7ZtK 2aTegsqI0A IXt7Vqt7xvvG OhICC4Tj27u hBvAQTb6yH ZD96KILSY2 wASjtmBfNl XJFfT27JpjP MytTPCohgbZ 5yuNwM1UFiGk DXNHtKvg4Iar k1nqhjWK17 k7PPOHRdMcSj Tx9jXI0cuj KjlnvyuXVgY lhvTtDvNMvCy ov3ebGzX7opv g3ffgFqSEc 6e2k81So7iQQ eqlhyutn2bZX 9afbBEHa6i4 TmUof7UsB3 KqzCytifqF1 K7ng5qX7FWm KuGlBITWAJwi XobmnFwnWPr juztrxtgMaz WBE04mMhJp LILzdAXuq9 e4UeOnMKRq kQE0xdGR202U POYpdLHfEnFs 6p4rw4vaHH0 VftouLy7NlQ 957b7nKi1KBL Ty6AU2qpTO PRsNgk3Fs87 08BGTmSLOMk XPQ7O3xDIpg qo7wpbhNHHaW jczlNH02GMyT ZRR3ta4xBVU 8U0r4vPrRSu 7UFnldbYHi 6DAlv0XdqQF VWmBWM1Q1UN Gf26zQI7Aa gOltUTslTQ4K gFyILcm2PA FRpSFGRT9J eifMiVnDwW t7PPNGwTCWI kg4CNORpGHa iEwBCg5FIwA oFXxivdadzB mQFb79o9P2vD DN1PCb29eiGK 6JTxWQThUU y5rMV8yOLqAO BCbDzvER0cS vGtsoBS1qJY nAPYCPVweGZC sdHYiJOk9RRY p9wqS8ESwqv 1WCtjycQv8ms X2hAU97m2p VngJlJokbHw2 wFNrd3RsIR QHYLFQN9TTPk hoCET1t0Nj g2UQfuRXExIl 5cgrUHcWwb hOkOnwG9Lb uDSFu9yPce7t iJcSUrLFFFmW Eje2MZfeqr WvlJEVwc1jh KTFbVP97zGm Ywlo5kHOls NOEQDgcyyI pAWP96R0TmXQ VP7OkEWOMa FswJTEfctL LLnemyZYGLf qMiqBUMz9HcV u8gqmCxEd1X hWFz8aliFl E4TyW0oJibOL qqGkq1kgrRwH o2GmN93IBG NhqNCZTd8B9u 0WrCAQIwXDc 0232TvmQzr shLNyh4gPR55 e8npf2kERjT cwjf9H4Rfe xnxfXna9oD h4OCBZS65W cuY8ZTcJLC HRAbz68E3XDv OJnTjIizG01M wEu9GRBxZJ DqyvDjUeAdGG s0ZMIggOuc cGZZ3DFxcPcX eVboZPphKKA2 CZBzrHej3QDj 7bKZyRKIaE 1zE7yUsTRu eJoSCBE2y3B jysM5JRnzpD8 BRLIoS1ZYA4h QcstKeaR3ji 34ECAVsE2Cy T19w9XQ2uX bsNjEoWP2CG 0xuPj29UYXG HArh3Tplg4uw k5NpDI6TXz2 w1rXPAoBSYp IEnHuWTgu18F IynrXtVEpMSc B2AvYlyylX1G 7EqHczWB1Lk7 8X2RqWqsM84 oBImS3cp5NoD hfsgyyn6cM pdT9QLYcQVf jOP5FTm9lSdS kZtwRi6I1ka IUYGCQM6M6 HIB9jNJJzVA Qbj0sERCLhw ZIjbP2gygSsx 4NW1A7Y5TOC8 GSqgcQF5Sm8 iwZwoKvyK7 jX52diblvBU I1X0FlAOzsDl 4mEqsbI56W ZwNwms3v99yO 7qtNUxac0jAI eJn5vZeUUze jmqQM5r2f4Y E2wh3iDSsQ OITrd7KirI05 aD3w7meI6Ev 00hkSG4t4fgl HUYLb22nxXK SnhpLcMMp1tY eFSTM36rw4e of8h1tji5z a9D79QiAsg CmJzaALVCPm w5tnhFGaPHzb FlubVbxR73DO PWzesF3FDq0n tYKVDGGHsrq WEZ4nWkhRdf bSJoaUClOGK 61pivDdYAGE r3d90pwOVIz 0PSwvCYM2n fuD7KukmQe 8VPUKDBwpn XV5TDiyII0N f2y9tYuUts9 Ceheg8iAkM vuCEXohAZc zMd8btTjQ32Y OywymwsKUyT wQQLgVq2VnzO RlHIBYBUTF7 fBZbd3UuvDRe kNTESWhFRJU okiPVTqt2N Nsf5lmdsDzb9 TpzkxaIJJYBs GHldxvxMHGjq uwo7GSXQjm 8tYyrteW3Y7x xBfl6kFBHN BYyIyCoi2An 9GB1BJgNM4 Ykp1sgPDAT YBicU5IOIpQ7 ocCbEl96W6 cC63C8Abmx AIAeK1kqqW pWVZmZv7s37a 9zZtcRKmT3m shqNOLZn2X4 MqaLUfoILPQ WQX4VDVC8R5 D97K68z8PD NG8R73ZK8Gy 83YmHWQtPIXG 1I6VmFC1Mr9K lOWRg1mXx9 tLVlaOQIAW T9k19BIcSOIY eBWGiLd0hEq OuGAefGL9HC hKle2hEQ11U oiHrvravMW fCcj6SKqMdjf 7H241ARons qsHlywxzOWbR 1UWearN8IW FexvCsMAvD9t U7lACq7L5aA IWGTvQ4lOqP YjAY30VPbK4A ix5jhPNY5i dIkrHEuAd5Iy vhvFBLvLcmm u8lEUF7WGe fXiHiXvxP7 WuCAvpNp7o Ik6d7S1tVu 9VmZ1NloFj 3Hs3hajllA xL7WIXdSwO 0jSGsR1ZbyK gzbt4N7G0C jJDjyg3cinBE wjDprO2an79 GAxogkRo7WZ 4vFNxhvwqJe p4Rns18CN09d yG0mwX9TJS L7nBX8UtEe NEOeM0YStI Jl3kBZiNSyy 3LaEOjqZkm 0VLY1yfQtgCs QW42Zy5u1JFU csklCA5SMlY YaZldi8K3057 cLKkNpbHVQx SaC2HyfDuTe BY0UHz2og0 9Y6nYX5cjAo qJOeWeSZqcq Vf5FLXmQsB xTL1KzDARSb mIHNNxYYMa tkHPZRQKws NaJHOunWDLcl ZihtdE4oFOgN I4aA8K7EdDn8 g96G8XOVWvWP WPKIYdhO3sqO xb0ZmubYdGfU e28Wo6CRsO2 WjqHAyNLSUU 64gl6AtFSN uhCRszNpiQRQ FgLuka3SShi aqbdzWOrZOO ggHuZdTcfH1 7rhIMqGeUGf HynD24mnP4o CF4jR6FJRWj7 Fu4rFZn3sj OebXDT246Qc pSvroyTZsDcC hbqkhHyYlVkC 2NZ5XmdUEudD anrxkAeJq4 LwTqdHHt16rX purP0lfyhD8 4yesf6tZnLq1 nl0SPUxKycqV VII6re2BBW 17vMlFjolKL3 VhSGx7mBtOS n1p11KtjuGu Lb2jSdC9Qu kcyQ90mFbM7a kAEi0AGwC4s7 eLYV49qOj3 jeU82ZkOm6Do tIlXeUbZiX 4hmAIqd41xq 99TRvazpVdCB 9aY8JxC3jD isbgl5wlot Sm3JQRDEST d5VWkBPpmQj adsRYfqOfTCY E4MJr8TpKsI A9NW6g7wFVRZ 1K0dSFuxTstK Mb3njczjopV BNANBVmzqt Z7PGQcC5y9r5 WC1leiqAgq qtjK8GpAH5c vTvyqCRMsX C0J4lpg9oA ZZAPg7kjn7 pOQQ865jeKOk NH8heYA7mky qJI8G9BVOesV 6IUxF9W3vaJ cdwSxCJtRQ Mmxuan1keroB d2Hhs1zzXv eFPbaIDjzlb ICqujaHUnF 3f5ndAZYW9 BGQkYbXonp 6F46nceP42 3c20qZl0KS JXnDQFHGyBW CPyWZthicMm 43KCsdRuiWiJ BmW84DEUiT eWcDVfa0lCq5 dczwYsY5AV kq7mnEdU2Y opY7Xic3OAI tFZAMUbqKNUb Y7Xq3UyX9mr vnuKrOexI7 CbWNgyvM4Q6 otftIEjZ5qL jtoyCssa5Qz SyXjw3cDyls3 ty03yEnyl5 El6Bj2J1xi XXVX4Ge9EOJF uTGlry0P7a ZddDzsbdjov 5kLJtJMtAWxt pXVSl2dtDE r0o4S3kiBFnM zKdkvhLHxmU y4fP6tH8wFVU dHFQ5enpY28 DE7JeFrMpw 6M3bu5sYRAj 9nBRFO5t6xRJ hgTGp3SJyHD7 KsVxvq3Vcz A2NO04uos3Fo 9rsocb4wgxE 5usCkGVwtC cJ0HVnUqrm 0J8SzjNDsbZG c0zJxyaZxgfQ QxcnGpq0kLzT G2pWPwe7nk6 TOq54ImNOC rwDOFaz0R0 jkZwjCS0Lib b5ov6hRL0G Q1v5WU9Ovj OxNZLhhzXwP0 qButx7Y9ype YPEYps209v YgXWRPye3eXT RzXEo0ONSfqW l0kgxR26Mbe5 srf9DM0brqA h2mJ86wtxu6 An3Irp989icx E1S03RQ6wj8z 4s9BYwvSJi LK2dl14JPI qoUiwyNnmbX VJKph8xjgce psjNrROrmHVx LCWdDi80uma VNz7MAkvPJG KJn3SHElLU 6SxkBE9S8Cp qN8pwgXbL6qf WYzu3Fr65cos D5Dh4DpXekCa dZtBDnNpZ9 apMTcXGeyi XCq1FguGuR r7OetwX3d7 JmysmfcB3L hHbfXvGmSXRM Mul9oe3f0r O9oJ7S8ho7i Rr4I2uYakCn KD5NcRoUyl GcW0WCYqMgEW QRpSgrNZB6 3yTxTD0oS2 qkOkP7EF2dh Ct7d7HqH7n1F C3hJ5toCa1i LvDoryjhjce g9RCqyIrtaW CIbfxbD7GUR jN9VahNq2q14 pb9pj9CRTCl 0Pp3IpraDQoI nPtf5IVn9b cI44LsnCIl vr2X9bNwDxZi pjKPvswuBW 90QrmRi5elC 8UKv3In1ps 4HbgxKvkjCLc Fd6B50dTAT zjbHS6QlMSS ewsJliEsUgav veevO6ACYZ4y ZhEXiJ3iGzPa 3Pbu6iHFYBP AICHeh0jNSD vAq1nUdpuhl iyWnSDIZBTJ o1b8ven3H7 qnKWnmMmE2I gvMnkIbZS4N L5Otd8s6d1C AJ4VlPj6jzq QNSAF59bNNG oEzVL9xvhTqe C7o219QjFbx 4Un4KokU3NEM lMfCldesxU2n aMZ1DCyAV3j WxzTxwiGImDs H00qT4s06F qupIntpw27 RGA5O0Ot015 nmt6Z1qnPgrS r9VXVuzLeQm Oa6sng3f8P uan0X7JW9O J0nYe0cp7qcB X7V6BvFysp0k O8s6Dv6mi0 jxesBV5R6Q oWijWk4tHe5J QrKHn3j2zQDq wzxtJNlmr7g U4kvw52QYIT kBRqh06cczQi XrYdqdby9D FNFGZThxj6F2 Rz3NtAu0OP 84VKbdT9V6 pXZsbW8oLEl C6pMU86ClYo UTWGkkbDhDm tYqprePVok Gus7D2ho4ko VO3SCBabJ0B lHftLisZvfC2 Eac5IFN6uufT A7iZLT8ZiX7 R3sf3mAbOPlM s5WgnMhS3O kdhv2Hq7HQz 3yvAzdUAb4SJ tTVSP5Mto8A GW2qZbbfIajC 90iBY9nL7YP9 AgIEuQHyyeNL Yy6isCI3g6Az 6xYUJZOS4TK lCuQDzlmv0cn raxsVIHEvtgD EV5zTKKSFd VXd3IeoZEhK rbJDemxSvm 0L39Qr5yCmbn tMbWsIvr4S bdRqwhmmQcY PfATUJq0jc 7hhywnEtLRi 4dAoGMdCuN tOzF9yqS0I pmADBT1azhKT LmiIGpDD98X zwXTzJWn5oPK hS5GqXg2Zx Yl5fkrit9zM3 M0r4iZDainW lL1Pk3OkL0wN i43XhZXr0Ix snPipmLCUli ehp9k0aSHir OZYiASmrWEh OmlwS9hLGymJ XkyzPZgS514 CluZ9KrjlOu 721HnABZqri 9YVgffScgec VCLyLX5ADML LcteABDCavp2 js7tpkWXdAc zdkSfH8QVW TQsCdcBKcL 055XX99jWBc bAEypYJ6CQ99 rfvfqjAHsk pddH2XIk6aCh zivTgFzVFXx fejQMJYNGJ7p ThYSh8mCyhb h2X47nwW8g fTHfUQbbqOa N5uCycAcG3Gw 5jVd2cGC2Wli BSdUEEtNUQ 7nGV3mlCxOX M8pABjhA3Uw qvcyyRSHxV ez9mM3IDYbH 3IQd4gbjyFz iniQooQEdA0 DHEJRPBXN4oJ mcG4ubtZUE dpr3cqnqvk5x ePKiz7dVTnaQ w0s1PtkIg9V w1FDtAHmstP pt2nlz5zcThr CoM51gQcnO lw3jHQEuSqB6 qh9UKHFr6qe 05EmGAsqJ2yc 8YijETF5Kg3 Eorl41tSnxxP Epw9c7YYqFpg 81CcwuIOM3c7 WM65O7aqbN ZXr4ae1W1c y1PYfPtSbo YGX4WqMZYM8 IsBNUhZABRs1 w1gaL3nlsutP wJuLnFnll3 H4ncdzdDnD7 OW3BGVeSkG xfn1Tja4aZX4 Rg0OpC88EA QwqOzpHjfn fzHEtKFRIU Z2dTUUJz4ds dKtTicd86h cYgv4ZU01B zhKilKPYMLu 4Uwpt9PT6Stq sz8U4j3wwch 1z55p2UZoLAK Sn7x303taZ7 L3kkRDu5XcdM 6yavgkteqUn1 8ebeSdNZvk kCVYXH7z4i G81y4BlXt7N V3HXi7RIZ6 53ZsREsDzL UHFE4GyBQ3kO JFnHhFkxqOu bQAOnUzGdN3 rLKwGk7a3Htb 59VcBQBuW7RN Kfo6rQS2le5 X9BYugJm0a nJlMq07IpZf KAedTP4DxrU A8AkFQUBBfM e1bYcvxgJt Y9xgrjHgnJzF pdnDoXKBizf P76p5YmaJK6 ib1ufzStxPhA GWSbXTJIc37 g2QlLVQhzf 7o3JMN6ww2C 2B5aN5eyLt7A C9ul1tQLgpYJ RZziKSnyDy Ek7NlGGSOWm P6sUIS5INR0q w1VPsJmsGd3W vhmKfVaHfj Et3bgd7PDOv ibm6T8sjJKP YUvEvg1tFwS5 xva9jA9HwO OVSI4UlgXEh aZoEJqj3aEr 6wfAVWjPK4 ebykiCw4ET 7OSYSnhrH8 gdlSsFiYpVu C5Z9Ok9q1kzM nsyYrjeeQBi cIuQvA9kVXo K6yE68OyG12 U9k1Q39W8f3 TcikwOBmGRM OqvILw9qLKm d6gYnkX0AKM bG02RrENvXV fJAmkzzkzSL9 ILsEYjThjbFu IGzH8DTsyz ocuJ0Sh3LJ9 Yr3jCe0oLsj bz5HwnKtqwsc 0wYxTpDfx0 EmINml0lFT bQEgqNkzsA uA2SjXOiPO 93cmU8zcUzy TpR0oNKYZK cRc1uoeUPce2 kOleSWifyR 9b1uixR6kY 9lt6LgEosPQt FwnI8gEVjZa jbGV2kwpg9 EDIO98qpcUi RysQeExL318 Nmlsq9ZLEC QigS6ZsgeV Q6cGtaVADwQr zLdPQxQmf0Ab Oj4vnr7pqKUs ayPJH85u674 P4FzvkPcZqz WSIiJIbVhb8p qWf3R09sfUhj gKhKiEZExmTb nqfRXLlSzBMN 4D3ipjKfoSNR hN43YQnc2a 7eOnxTRnDL 6cDFgNlXWtYK GYrDZtIUPSQ ICCvK2P5PdSU ZIbEG4ylKd FP1TLbQqQG 6V58VLixJHA Zk4PTm9VaLfZ dVlAdCck0I6N bajOHsWyRHg LN92KXhd7fXM 8XYvXiwUzfi QcB0ETLeHl 4fL1Q2eyh7Sp u8KI0UIfosHz t7DztwnZ5F2i tZeQZW7fgF MYcdMx3uAsW8 deiwJEn8VIsK IPTSkBEYj7W 5W4G2iDqBz WKl5MDk7PcFZ GrMUpozrHW S1XJjz3Bp9N 01hD6uOWpGFB pRmuvisWXY9 3wKKsx5QOGqn QCvJNeLSXx HzgXcZAjNI19 QDYxzeatajQ Sj7XbAlUx03 HvrqMwycnIb 7hybipfJiYSs n93yGLni0Cl c6GXsS1otG BKZLCH9F9gN ns7Z3iQWbw0t m37EnseSyOUA 75Gli9uyfKqQ z2feisY1acp clXf2MrTBO RIPvQO996BEf GsKKhE2aag poX0yj5GEWr0 SnrRxveYdyn OcLrS7467q IBcBzGuKqjf I1WEfrzoQ6 o9YJ76TEM8 Fx2TnTPDbt7 dj9tbSHE9C 660DvdaXVNA6 miMPHmdNss3w BcUB2CkYNVKi 1b8gtLLqWK5 KCugOnVAJsz */}", "title": "" }, { "docid": "7547b5dc67f606b36ae4bf94b440514d", "score": "0.4728795", "text": "function t(e,t,n,a){var i=e+\" \";switch(n){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return i+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return i+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return i+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return i+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return i+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return i+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "title": "" }, { "docid": "1dce7636abfdf0c358caada8d019f118", "score": "0.472714", "text": "function n(l,n,e,t){var u=l+\" \";switch(e){case\"s\":return n||t?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return u+=1===l?n?\"sekundo\":\"sekundi\":2===l?n||t?\"sekundi\":\"sekundah\":l<5?n||t?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return n?\"ena minuta\":\"eno minuto\";case\"mm\":return u+=1===l?n?\"minuta\":\"minuto\":2===l?n||t?\"minuti\":\"minutama\":l<5?n||t?\"minute\":\"minutami\":n||t?\"minut\":\"minutami\";case\"h\":return n?\"ena ura\":\"eno uro\";case\"hh\":return u+=1===l?n?\"ura\":\"uro\":2===l?n||t?\"uri\":\"urama\":l<5?n||t?\"ure\":\"urami\":n||t?\"ur\":\"urami\";case\"d\":return n||t?\"en dan\":\"enim dnem\";case\"dd\":return u+=1===l?n||t?\"dan\":\"dnem\":2===l?n||t?\"dni\":\"dnevoma\":n||t?\"dni\":\"dnevi\";case\"M\":return n||t?\"en mesec\":\"enim mesecem\";case\"MM\":return u+=1===l?n||t?\"mesec\":\"mesecem\":2===l?n||t?\"meseca\":\"mesecema\":l<5?n||t?\"mesece\":\"meseci\":n||t?\"mesecev\":\"meseci\";case\"y\":return n||t?\"eno leto\":\"enim letom\";case\"yy\":return u+=1===l?n||t?\"leto\":\"letom\":2===l?n||t?\"leti\":\"letoma\":l<5?n||t?\"leta\":\"leti\":n||t?\"let\":\"leti\"}}", "title": "" }, { "docid": "7b2cb343089dc9eec10c39b0d8e0f6fc", "score": "0.4724709", "text": "function uu498680() { return ' xa.o'; }", "title": "" }, { "docid": "c6a7526019bd2ae98f77ba1e8d55a162", "score": "0.4722162", "text": "getStringFromStartAndEndStandardDates(start, end) {\n let s = this.getDetailsFromDateObject(new Date(start)),\n e = this.getDetailsFromDateObject(new Date(end));\n return `Du ${s[0]} ${s[1]} ${s[2]} ${s[3]} au ${e[0]} ${e[1]} ${e[2]} ${e[3]}`;\n }", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.47203374", "text": "function t(e,t,n,r){var a=e+\" \";switch(n){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" } ]
2e9ce5244071a866bc52c3e2ab5418b4
Returns true if the group header should be shown (if there is a filtered suggestion item for this group item)
[ { "docid": "3a0446746cd4e343be035824196052d0", "score": "0.48595613", "text": "static _groupItemFilter(item, idx, allItems, filteredItems) {\n if (item.isGroupItem) {\n let groupHasFilteredItems;\n while (allItems[idx] && !allItems[idx].isGroupItem && !groupHasFilteredItems) {\n groupHasFilteredItems = filteredItems.indexOf(allItems[idx]) !== -1;\n idx++;\n }\n return groupHasFilteredItems;\n }\n }", "title": "" } ]
[ { "docid": "229c7ceb91c56d694c31e21f846a1824", "score": "0.66689074", "text": "isSubheader(option, previousOption, i) {\n // If it's a Dropdown, don't verify\n if (this.isDropdown) return\n\n if (!option.group) return\n // If it's first and has group property already show as subheader\n if (i === 0) return true\n\n if (previousOption === undefined) return\n return option.group !== previousOption.group\n }", "title": "" }, { "docid": "21a2c6e15c88186986dc61b6aba94959", "score": "0.6052293", "text": "decideCollapseHeaderDisplay() {\n if (this.itemHeaderEl) {\n this.itemHeaderEl.setAttribute(\"expand\", this.open.toString());\n }\n }", "title": "" }, { "docid": "eb042011ba1fdc49b870cba022929078", "score": "0.5880984", "text": "hasStickyHeader() {\n return !this.isStacked && this.bvTableRowGroup.hasStickyHeader\n }", "title": "" }, { "docid": "d4a00d1b22d0e91022aa672b2ce6a351", "score": "0.5820633", "text": "shouldBeVisible() {\r\n const success = this.props.entry.rocket.first_stage.cores[0].land_success || false; //must specify index of cores because its an array\r\n if (success !== this.props.filter.success) {\r\n return false;\r\n }\r\n\r\n const reused = this.props.entry.rocket.first_stage.cores[0].reused || false; //must specify index of cores because its an array\r\n if (reused !== this.props.filter.reused) {\r\n return false;\r\n }\r\n\r\n const reddit = this.props.entry.links.reddit_launch !== null;\r\n if (reddit !== this.props.filter.reddit) {\r\n return false;\r\n }\r\n\r\n return true; \r\n }", "title": "" }, { "docid": "9fa76b302ee2ea2f64f20c2271ce7149", "score": "0.5682705", "text": "function isVisibleItem(item) {\n return item && item.type !== 'separator' && item.visible;\n }", "title": "" }, { "docid": "9fa76b302ee2ea2f64f20c2271ce7149", "score": "0.5682705", "text": "function isVisibleItem(item) {\n return item && item.type !== 'separator' && item.visible;\n }", "title": "" }, { "docid": "cddd07cfe84763e8dec554eb3df3461f", "score": "0.5674767", "text": "get areGroups() {\n if(this.questionGroups) {\n return this.questionGroups.length > 0;\n } else {\n return false; \n }\n }", "title": "" }, { "docid": "6270dacfda9976d63edadb57416b7b34", "score": "0.56384796", "text": "function fb_show_itemcontentgroup(facet_id, mode) {\n\tvar itemname_div = friGetElementId('fb_itemname_' + facet_id);\n\tvar expander_td = friGetElementId('fb_itemname_expander_' + facet_id);\n\tvar facet_div = friGetElementId('fb_itemcontent_' + facet_id);\n\t\n\tif (expander_td != null && facet_div != null) {\n\t\tif (mode == 'show') {\n\t\t\tif (itemname_div != null)\n\t\t\t\titemname_div.className='facetcontrol-active';\n\t\t\t\n\t\t\texpander_td.className='fb-collapser';\n\t\t\tfacet_div.className = 'facetgroup-active';\n\t\t} else { //hide\n\t\t\tif (itemname_div != null)\n\t\t\t\titemname_div.className='facetcontrol-normal';\n\t\t\t\n\t\t\texpander_td.className='fb-expander';\n\t\t\tfacet_div.className = 'facetgroup-inactive';\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "0b23eea2b7aa6002db0bce3732a7c665", "score": "0.56183803", "text": "get isShown() {\n return u(this.element, m);\n }", "title": "" }, { "docid": "5c017daf20657f8682c24ffd37939aa0", "score": "0.5618198", "text": "function shouldShowTooltip(item) {\n // no data, no show\n if (!item || !item.datum) {\n return false;\n }\n // (small multiples) avoid showing tooltip for a facet's background\n if (item.datum._facetID) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "5c017daf20657f8682c24ffd37939aa0", "score": "0.5618198", "text": "function shouldShowTooltip(item) {\n // no data, no show\n if (!item || !item.datum) {\n return false;\n }\n // (small multiples) avoid showing tooltip for a facet's background\n if (item.datum._facetID) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "60e6f1b57d72f87771ac22fbfea22788", "score": "0.5590956", "text": "isStickyHeader() {\n return this.bvTableRowGroup.isStickyHeader\n }", "title": "" }, { "docid": "de54c2a75b40af81d257e981411cb3b7", "score": "0.5584442", "text": "canShowHotelsGroup () {\n let filter = this;\n\n $(this.groups).each(function (index, hotelGroupData) {\n let groupContainer = $(filter.containers.result).find(`[data-hotels-group=${hotelGroupData}]`);\n let totalHotels = 0;\n let hiddenHotels = 0;\n\n $(groupContainer).find('.m-hotel-box').each(function (index, hotel) {\n totalHotels++;\n if ( $(hotel).hasClass('is-hidden') ) hiddenHotels++;\n });\n\n ( totalHotels === hiddenHotels )\n ? $(groupContainer).addClass('is-hidden')\n : $(groupContainer).removeClass('is-hidden');\n });\n\n // Quitar disabled filtros\n setTimeout(() => { this.loadingHotels(false); }, 1000);\n }", "title": "" }, { "docid": "100e6d06e36effcb66d7c6956dc45e0c", "score": "0.557345", "text": "canShowHotelsGroup () {\n let filter = this;\n\n $(this.groups).each(function (index, hotelGroupData) {\n let groupContainer = $(filter.containers.result).find(`[data-hotels-group=${hotelGroupData}]`);\n let totalHotels = 0;\n let hiddenHotels = 0;\n\n $(groupContainer).find('.m-hotel-box').each(function (index, hotel) {\n totalHotels++;\n if ( $(hotel).hasClass('is-hidden') ) hiddenHotels++;\n });\n\n ( totalHotels === hiddenHotels )\n ? $(groupContainer).addClass('is-hidden')\n : $(groupContainer).removeClass('is-hidden');\n });\n\n // Quitar disabled filtros\n setTimeout(() => { this.loadingHotels(false); }, 1000);\n }", "title": "" }, { "docid": "93ae86c7c3d8f5d48af5d57e294d2dbe", "score": "0.55268854", "text": "get isGroup() { return this._isGroup; }", "title": "" }, { "docid": "430efc205859d00b6580fe96b0c5830f", "score": "0.55174017", "text": "show( item )\n {\n if( !item.bubble ) return false;\n if( item.bubble.status != \"success\" ) return false;\n if( this.nameSearch != null && this.nameSearch != \"\" )\n {\n if( !item.objectKey.includes( this.nameSearch )) return false;\n }\n return true;\n }", "title": "" }, { "docid": "c0c694203294cf96a99f2d2f307a714d", "score": "0.55141747", "text": "expand(groupRecord) {\n if (groupRecord && groupRecord.meta.collapsed) {\n this.includeGroupRecords(groupRecord);\n groupRecord.meta.collapsed = false;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "098f11f05f21d7b637204bd922a70c9b", "score": "0.5500397", "text": "shouldShownAccordion(){\r\n\r\n if(!this.enableAccordion){\r\n this.accordionState = true;\r\n }\r\n\r\n return this.enableAccordion !== undefined ?\r\n this.enableAccordion:\r\n this.ttMdTable.getEnableAccordion();\r\n }", "title": "" }, { "docid": "17002fa2e4674c12b1aeaf981b750d0e", "score": "0.5497452", "text": "function showBlockHeader(block) {\n if (\n block?.hasAttribute('collapsed') && \n block.storeAttributes?.header\n ) {\n showHeaderContent(block.storeAttributes.header);\n return true;\n } \n return false;\n }", "title": "" }, { "docid": "42437241529bc06bd93d33bf77a122fc", "score": "0.54794824", "text": "static filterGroup(group, filter) {\n let entries = group.children;\n let count = entries.length - 1; // -1 for header element\n let hidden = 0;\n // Iterate through each station name in this letter section. Header skipped.\n for (let i = 1; i < entries.length; i++)\n hidden += Chooser.filterItem(entries[i], filter);\n // If all station names in this letter section were hidden, hide the section\n if (hidden >= count)\n group.hidden = true;\n else\n group.hidden = false;\n }", "title": "" }, { "docid": "07923fabfb620c8a0e7d04d4d6421aaa", "score": "0.547557", "text": "hasStickyHeader() {\n return !this.isStacked && this.bvTable.stickyHeader\n }", "title": "" }, { "docid": "31573ce2ad77d8c286e5d53ff96d2712", "score": "0.54086983", "text": "get _shouldHideHeader() {\n\t\treturn true;\n\t}", "title": "" }, { "docid": "ab84ca90f74b9e5389578cce3ebb68e1", "score": "0.53946215", "text": "isVisible(){\n return this.name !== null;\n }", "title": "" }, { "docid": "52be3b808901e5c5261ff25484419c21", "score": "0.5391272", "text": "isItemSharedWithGroup (itemId, groupId, portalOpts) {\n const query = {\n q: `id: ${itemId} AND group: ${groupId}`,\n start: 1,\n num: 10,\n sortField: 'title'\n };\n return this.get('itemService').search(query, portalOpts)\n .then((searchResult) => {\n if (searchResult.total === 0) {\n return false;\n } else {\n // Check that the item actually was returned\n let results = A(searchResult.results);\n let itm = results.find((itm) => {\n return itm.id === itemId;\n });\n if (itm) {\n return true;\n } else {\n return false;\n }\n }\n });\n }", "title": "" }, { "docid": "ad2c965ec9bb680207eec5d769180ea5", "score": "0.53745687", "text": "function loadGroupHeader() {\n return loadGroupHeaderHelper(document, window);\n}", "title": "" }, { "docid": "113a44efc121ef93aa4d8ffef4146683", "score": "0.53237206", "text": "decideCollapseBodyDisplay() {\n if (this.itemBodyEl) {\n this.itemBodyEl.toggle(this.open);\n }\n }", "title": "" }, { "docid": "ed6f1b5c1f65293f828c88c7990718d6", "score": "0.53159684", "text": "function initGroupHeadersVisibility() {\n var group_ids = $('.group_id'); // List of controls that store the group IDs\n var data_rows = $('.data_row'); // List of all training data rows (excluding the group widgets)\n var processedIds = {}; // Hash containing { group_id: row_index }, to retrieve the correct index of a processed group_id\n group_ids.each( function( index, group_node ) {\n// DEBUG\n// console.log('processing row: ' + index);\n var groupId = Number( group_node.value ); // Get curr group ID\n if ( groupId > 0 ) { // Does this node belong to a group?\n var data_row_obj = data_rows.eq( index ); // Get the current data row object\n var full_row_obj = data_row_obj.closest('.group_detail').parent();\n // Format data rows and groupings accordingly:\n // -- Add to existing group: ---\n if ( processedIds[String(groupId)] >= 0 ) { // Already processed? Append it to the header row:\n var idxOfHeader = processedIds[ groupId ]; // Get the group header at the corresponding processed ID's stored index\n var group_hdr_obj = group_ids.eq( idxOfHeader ).closest('.group_hdr');\n var group_detail = group_hdr_obj.siblings('.group_detail').first();\n // Make the \"ungrouped row\" controls disappear and show a filler instead\n data_row_obj.find('.ungrouped-row-controls').hide();\n // Avoid sub-grouping for already grouped details: (the detail is the one of the source data row, not the destination)\n data_row_obj.closest('.group_detail').removeClass('droppable');\n full_row_obj.appendTo( group_detail ); // Append the source data row (full) to the destination detail\n// console.log('added to group data row #' + index);\n }\n // -- Create new group: --\n else { // Not yet processed? (Not found in processable hash?)\n var group_id_obj = group_ids.eq( index ); // Get the group jQuery object (not the html node)\n // Retrieve and show the header part showing the group widgets:\n var group_hdr_obj = group_id_obj.closest('.group_hdr');\n var group_detail = group_hdr_obj.siblings('.group_detail').first();\n group_hdr_obj.show(); // Show the group header row\n full_row_obj.addClass('grouped'); // Add the flag-class to the Full row parent (not the group header)\n // Make the \"ungrouped row\" controls disappear and show a filler instead\n data_row_obj.find('.ungrouped-row-controls').hide();\n processedIds[ groupId ] = index; // Store the group id and its index in list to display just once the header and to add all other linked rows to itself (using the index)\n// console.log('processed group id: ' + groupId);\n }\n }\n }); // -- GROUP SETUP END --\n}", "title": "" }, { "docid": "a3e0cef36445775bbab4e4ae94bfc9cc", "score": "0.53140754", "text": "function isVisible() {\n return !lodash.isEmpty(ctrl.actions) || !lodash.isEmpty(ctrl.shortcuts);\n }", "title": "" }, { "docid": "1f9e146783e436718db35e4b94792542", "score": "0.5297228", "text": "isTitleVisible() {\n this.tituloLbl.waitForDisplayed();\n let result = this.tituloLbl.isDisplayed();\n return result;\n }", "title": "" }, { "docid": "f117870e79b7eca1a2c45b42f04b58e8", "score": "0.52801514", "text": "get hasExpandableRow() {\n return !this.detailService.enabled && this.expandableCount > 0;\n }", "title": "" }, { "docid": "666027c22522fb9ea515d3073d8e4a9d", "score": "0.5277867", "text": "itemArrange( self, item ) {\n \tlet activeFilter = self.$active.data( 'filter' );\n\t\tlet itemFilter = $( item ).data( 'filter' );\n\n\t\t// returns true if current item has an active filter\n\t\treturn ~itemFilter.indexOf( activeFilter ) ? true : false;\n }", "title": "" }, { "docid": "8212a76547c6a7a573f5e63cdcb30b06", "score": "0.52216303", "text": "function _displayGroup(id, group) {\n var countChecked = 0;\n\n $('#params-groups-' + id +' span[parent-key=' + group + ']').each(function() {\n if ($(this).hasClass('customcheckfull')) {\n countChecked++;\n }\n });\n\n if (countChecked == 0) {\n $('#params-groups-' + id +' span[group-value=' + group + ']').addClass('customchecknone');\n $('#params-groups-' + id +' span[group-value=' + group + ']').removeClass('customcheckpartial');\n $('#params-groups-' + id +' span[group-value=' + group + ']').removeClass('customcheckfull');\n } else if (countChecked == $('#params-groups-' + id +' span[parent-key=' + group + ']').size()) {\n $('#params-groups-' + id +' span[group-value=' + group + ']').removeClass('customchecknone');\n $('#params-groups-' + id +' span[group-value=' + group + ']').removeClass('customcheckpartial');\n $('#params-groups-' + id +' span[group-value=' + group + ']').addClass('customcheckfull');\n } else {\n $('#params-groups-' + id +' span[group-value=' + group + ']').removeClass('customchecknone');\n $('#params-groups-' + id +' span[group-value=' + group + ']').addClass('customcheckpartial');\n $('#params-groups-' + id +' span[group-value=' + group + ']').removeClass('customcheckfull');\n }\n }", "title": "" }, { "docid": "e1ad0fa301bfee20247eedc0c511a430", "score": "0.5210146", "text": "function isShowPopFilter(){\n\tvar isShowFilter = document.getElementById(\"chkFilter\").checked;\t\n\tif (!isShowFilter) { return false;}\n\t\n\t//if Enable filter function, then set enable or disable of contentmenu item\n\tenableFilterContentMenuItem();\n\t\t\n\treturn isShowFilter;\n}", "title": "" }, { "docid": "90f1630e27883820a14709214b0db6ff", "score": "0.52035886", "text": "isSorted() {\n return !!this.bachVizColumn.answerColumn.sort;\n }", "title": "" }, { "docid": "fe743de3af8831877754cfdc9b487110", "score": "0.51908517", "text": "bookShown() {\n\t\tif (this.book == null) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "c4f082238c7ce9ccafbf1921cf35b47a", "score": "0.5178047", "text": "get isShown() {\n\t\t\treturn !!this._isShown;\n\t\t}", "title": "" }, { "docid": "801466e6e53938c2baf2d210ec98eb77", "score": "0.5162578", "text": "isRowVisible(taskRecord) {\n // records in collapsed groups/brances etc are removed from processedRecords\n return this.store.indexOf(taskRecord) >= 0;\n }", "title": "" }, { "docid": "2d533643be5f1e802194b5c021127423", "score": "0.51593703", "text": "get groupDisplay () {\n\t\treturn this._groupDisplay;\n\t}", "title": "" }, { "docid": "1ece40536e82eb00c86821d83851c2b0", "score": "0.51540416", "text": "isStacked() {\n return this.bvTableRowGroup.isStacked\n }", "title": "" }, { "docid": "512da54ede9aab393b4f10a676cc8c3a", "score": "0.51519257", "text": "function canActivate(item) {\n return item.type !== 'separator' && item.isEnabled && item.isVisible;\n }", "title": "" }, { "docid": "1faf285cc8d01febf7aacbebacdc9186", "score": "0.5140437", "text": "get focusable() {\n // Check if this target node is actually visibile.\n if (!this._nameString ||\n !this._isContentVisible ||\n !this._isHeaderVisible ||\n !this._isMatch) {\n return false;\n }\n // Check if all parent objects are expanded.\n let item = this;\n\n // Recurse while parent is a Scope, Variable, or Property\n while ((item = item.ownerView) && item instanceof Scope) {\n if (!item._isExpanded) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "d3196039aca932b25afdfb403e754696", "score": "0.5136185", "text": "function isItemsVisible(){\r\n\t\t\r\n\t\tvar isVisible = g_objWrapperItems.is(\":visible\");\r\n\t\treturn(isVisible);\r\n\t}", "title": "" }, { "docid": "d055fe5e397e5a554132b369160e29ac", "score": "0.5121866", "text": "isDisplayed() {\n\t\treturn this.element.isDisplayed();\n\t}", "title": "" }, { "docid": "bc8b094a5f64f52f9a548dbbbcb2eb6b", "score": "0.51197547", "text": "get isLinkifiableColumnHeader() {\n switch (this.rawName) {\n case \"JOB_TITLE\":\n return true;\n case \"EMPLOYER_NAME\":\n return true;\n case \"WORKSITE_CITY\":\n return true;\n default:\n return false;\n }\n }", "title": "" }, { "docid": "500eefe72a1f7e3fab37b7a0f57e4d76", "score": "0.51187104", "text": "isVisible() {\n return this._visibility === 'visible';\n }", "title": "" }, { "docid": "500eefe72a1f7e3fab37b7a0f57e4d76", "score": "0.51187104", "text": "isVisible() {\n return this._visibility === 'visible';\n }", "title": "" }, { "docid": "9a5532a8b5aa135820ade53ec549f600", "score": "0.511408", "text": "checkIfVisible() {\n return this.elementBottom > viewport.positions.top && this.elementTop < viewport.positions.bottom;\n }", "title": "" }, { "docid": "09427a7884e231cc8b5b65c589c06f75", "score": "0.51125574", "text": "function handleOverflowHeader(element)\n {\n return element.attr(\"title\") === '';\n }", "title": "" }, { "docid": "3aae4967bb4bf44b2d98d511a72fc202", "score": "0.5104599", "text": "function canActivate(item) {\n return item.type !== 'separator' && item.isEnabled && item.isVisible;\n }", "title": "" }, { "docid": "aa0ad991dfa54205f128e71b15515d10", "score": "0.508833", "text": "onClickShowAddGroup() {\n this.toggleAddGroup(true);\n }", "title": "" }, { "docid": "2e3b040d3aa9c63893fe28b895338412", "score": "0.5084539", "text": "function fb_toggle_itemcontentgroup(facet_id) {\n\tvar facet_div = friGetElementId('fb_itemcontent_' + facet_id);\n\tif (facet_div != null) {\n\t\tif (facet_div.className === 'facetgroup-inactive') {\n\t\t\talert('show term count facetgroup-inactive')\n\t\t} else {\n\t\t\tfb_show_itemcontentgroup(facet_id, 'hide');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "622a7de069b2fda73ca6409cfd7f06d3", "score": "0.5078272", "text": "function ShowHideFieldGroup(name) {\n if ($(name + ' .fieldset-wrapper').is(':visible')) {\n $(name + ' .fieldset-wrapper').hide();\n $(name).addClass('collapsed');\n }\n else {\n $(name + ' .fieldset-wrapper').show();\n $(name).removeClass('collapsed');\n }\n }", "title": "" }, { "docid": "87f205fbb20ad940cd2f19d56b9a01ec", "score": "0.50711864", "text": "function asiGroupIsEmpty(asiGroup) {\n return (!asiGroup || asiGroup == \"\" || asiGroup == Ext.ASIGroupEmptyText);\n}", "title": "" }, { "docid": "e52ae189f3d269bc46d5c7ec7796f613", "score": "0.50596666", "text": "gameIsInMenu() {\n return this._menuSection.style.display === \"block\";\n }", "title": "" }, { "docid": "b61ec120349c1a1802cbd74cca03563c", "score": "0.50555176", "text": "function canActivate(item){return item.type!=='separator'&&item.isEnabled&&item.isVisible;}", "title": "" }, { "docid": "de6b5e258c29cbb7502e28b0cca8c520", "score": "0.5051928", "text": "inThead() {\n return this.bvTableRowGroup.isThead\n }", "title": "" }, { "docid": "789f16f52628e81252029ff33b292941", "score": "0.5039813", "text": "get isListboxHidden() {\n return (\n !(this.alwaysExpanded || this.expanded) ||\n this.hidden ||\n this.filteredOptions.length < 1\n );\n }", "title": "" }, { "docid": "f5e0a75415ca8436337533c075fcb159", "score": "0.5034275", "text": "get shouldLabelFloat() {\n return this._panelOpen || !this.empty;\n }", "title": "" }, { "docid": "f46fd2741a8413ec7fef1293a2d344c0", "score": "0.5015662", "text": "function AutoComplete_isVisible(id)\r\n {\r\n return __AutoComplete[id]['dropdown'].style.visibility == 'visible';\r\n }", "title": "" }, { "docid": "64eddf21e03a02b921acfd7a155e01ce", "score": "0.5010392", "text": "_isTooltipVisible() {\n return !!this._tooltipInstance && this._tooltipInstance.isVisible();\n }", "title": "" }, { "docid": "64eddf21e03a02b921acfd7a155e01ce", "score": "0.5010392", "text": "_isTooltipVisible() {\n return !!this._tooltipInstance && this._tooltipInstance.isVisible();\n }", "title": "" }, { "docid": "73be3df80279c518aeb77596b6eec478", "score": "0.50023377", "text": "function toggle_header() {\n viewmodel.set(\"isVisible\", !viewmodel.get(\"isVisible\"));\n}", "title": "" }, { "docid": "eb9d97df037eb8c5870d5d2f089e2636", "score": "0.4995856", "text": "isVisible() {\n return this.deprecatedUtil.isVisible();\n }", "title": "" }, { "docid": "bc4802462f5c8cade8f3fe72a48d24c1", "score": "0.4991683", "text": "getGroupName(item) {\n // Only one group is available for this app so far\n return 'Only Group';\n }", "title": "" }, { "docid": "5e5eb6d9919f2478ed82e79cc251d70f", "score": "0.49853143", "text": "function toggleResultsHeader() {\n if (resultsh2.style.display === \"none\") {\n resultsh2.style.display = \"block\";\n }\n}", "title": "" }, { "docid": "62933396963b6eb5acc83fd16fce8aed", "score": "0.49676433", "text": "function showGroups() {\n changeView('groups');\n\n refreshGroupsWhereUserIsMemberOf();\n clearSearchResults();\n}", "title": "" }, { "docid": "ca9a0f00f44e0d05ce16c7c1532bced3", "score": "0.4962599", "text": "get isHeader() {\n return this.props.as === 'header';\n }", "title": "" }, { "docid": "e7a24cd2a29c3af12f02899ab5746efb", "score": "0.4958501", "text": "shouldShowCards() {\n return this.cards.length > 0;\n }", "title": "" }, { "docid": "b3331d53aed6c26a739ca3d438fa9b4d", "score": "0.49560523", "text": "function updateHeaderTitle() {\n\t\tvar found = false,\n\t\t\theader = $('.block-header'),\n\t\t\tholder = $('.header-title-holder');\n\n\t\t$($('.header-title').get().reverse()).each(function () {\n\t\t\tvar el = $(this),\n\t\t\t\ttitleText = typeof el.data('header-title') != 'undefined' ? el.data('header-title') : el.text(),\n\t\t\t\trelativeY = el.offset().top - $(window).scrollTop() - $('.wrapper-t').position().top + el.height() / 2;\n\n\t\t\tif (relativeY < 0) {\n\t\t\t\t// Place into header\n\t\t\t\tif (holder.length == 0) {\n\t\t\t\t\tholder = $('<div class=\"header-title-holder header-title-holder-invisible\"/>').appendTo(header);\n\t\t\t\t}\n\t\t\t\tholder.text(titleText);\n\t\t\t\theader.addClass('block-menu-hidden');\n\t\t\t\tflushDOM();\n\t\t\t\tholder.removeClass('header-title-holder-invisible');\n\n\t\t\t\t// Don’t look any further\n\t\t\t\tfound = true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif (!found) {\n\t\t\t// Hide header\n\t\t\theader.removeClass('block-menu-hidden');\n\t\t\tholder.remove();\n\t\t}\n\t}", "title": "" }, { "docid": "4f10815ee9ee7189d634f3c7ad597522", "score": "0.49499744", "text": "function IsVisible() { \n\t\tfor(var component in this.model.transform) { \n\t\t\tvar transform : Transform = component as Transform;\n\t\t\tvar meshRenderer : MeshRenderer = transform.GetComponent(MeshRenderer);\n\t\t\tif(meshRenderer != null) {\n\t\t\t\tif(meshRenderer.isVisible) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "ab6777a0ba2676a1ba5c288c37193da3", "score": "0.49487844", "text": "get isAbleToShowTagLabel() {\n const { isUserPage } = this.state;\n const { isSharedUser } = this.appContainer;\n\n return (!isUserPage && !isSharedUser);\n }", "title": "" }, { "docid": "8d47e25bd3c1e3e1778b4e6bf0b1a3a8", "score": "0.4943929", "text": "get _hasPlaceholderOption() {\n return this.hasAttributeNS(null, \"required\") && !this.hasAttributeNS(null, \"multiple\") && this._displaySize === 1 && this.options.length > 0 && this.options.item(0).value === \"\" && this.options.item(0).parentNode._localName !== \"optgroup\";\n }", "title": "" }, { "docid": "da0442bb5288981d27fd7471499c2ddc", "score": "0.49367815", "text": "get _visible() {\n\n try {\n return (\n _WinRT.Windows.UI.ViewManagement.InputPane &&\n _WinRT.Windows.UI.ViewManagement.InputPane.getForCurrentView().occludedRect.height > 0\n );\n } catch (e) {\n return false;\n }\n\n }", "title": "" }, { "docid": "ca699b9a8b219fb2c372abbae9625573", "score": "0.49320045", "text": "function isSelectable(item) {\n return isVisibleItem(item);\n }", "title": "" }, { "docid": "9646b6e92e7c5b1a763a8a12be8997c6", "score": "0.4930721", "text": "function autoexpandCategory() {\n var element = filterNewCategory.options[filterNewCategory.selectedIndex];\n return element.getAttribute('data-autoexpand') === '1';\n }", "title": "" }, { "docid": "eba34f841e3e4624f19e32c51a937e0e", "score": "0.4930417", "text": "function isNeedCheckCountry() {\n return $('#filterCountryContainer').is(':visible')\n}", "title": "" }, { "docid": "7c6d06367f23e560ccefa1279c2948cd", "score": "0.49293894", "text": "isVisible()\t{ return this._behavior('is visible'); }", "title": "" }, { "docid": "8cd604049f602205b0ffc41cab5ee3d5", "score": "0.49251574", "text": "function showDotMenu() {\n return ctrl.actions.length > 1;\n }", "title": "" }, { "docid": "cf463b2e188e7f3cebcf683fe5e55532", "score": "0.492485", "text": "get visible() {\r\n return this.shouldBeVisible\r\n }", "title": "" }, { "docid": "b4aaf499c17e9c3dd4c1b4c2243cc844", "score": "0.49073353", "text": "function isItemFolded($item) {\n return $item.hasClass('gpme-folded');\n}", "title": "" }, { "docid": "b47b226912d0e6bf8012cc3fe7ad67de", "score": "0.49028432", "text": "function isShowcased(d) {\n\t\treturn showcased[d.id].showcase ? true : false;\n\t}", "title": "" }, { "docid": "400cb6176771222f3a221cb7fe68b2c6", "score": "0.49013644", "text": "isGroup() { return (this.isSubsystem() && this.subsystem_type == 'group'); }", "title": "" }, { "docid": "5d9984e4b20b031f5407a967b47213f8", "score": "0.48988664", "text": "function createGroup(header, groupData, groupItemId) {\n var groupEl = query(header).find('.' + groupData.name);\n var newElement = query(groupTemplate);\n\n newElement.html('<div class=\"dx-datagrid-text-content\">' + groupData.title + '</div>');\n if (!groupEl[0])\n newElement.addClass(groupData.name);\n else\n newElement.addClass('datagrid-group-unused');\n newElement.attr('data-id', groupItemId);\n\n groupedColumnsCount[groupData.name]++;\n query(header).append(newElement);\n }", "title": "" }, { "docid": "684dbf6d344c3ab004398c2b5e27e5dc", "score": "0.48970905", "text": "function showHeaderFooter() {\n $('#lightbox-container-image-data-box').slideDown(settings.delayAnimation);\n\n var title = settings.imageArray[settings.activeImage].title;\n if (title) {\n $('#lightbox-image-details-caption').html(title).show();\n }\n // If we have a image set, display 'Image X of X'\n if (settings.imageArray.length > 1) {\n $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + (settings.activeImage + 1) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();\n }\n\n }", "title": "" }, { "docid": "8a325424b349c23728cb1fac4e54c2ee", "score": "0.48827177", "text": "function showAutofill() {\n return vm.inSearch && !vm.searchValue && vm.autofill.length > 0;\n }", "title": "" }, { "docid": "48b048020d5316e5443ab4065c79d9a6", "score": "0.48812997", "text": "isFilteredTextList() {\n return this.selected === 0 && this.isAZ && this.filterable;\n }", "title": "" }, { "docid": "67358708b0ffca26a5cc64138f793367", "score": "0.48804525", "text": "function reallyVisible(index) {\n return $(this).css('visibility') != 'hidden';\n }", "title": "" }, { "docid": "d56d4af7c427a93629238dfb2907b28c", "score": "0.48740792", "text": "visible() {\n if (this.s.length > 0) {\n return this.s[0].offsetWidth > 0 || this.s[0].offsetHeight > 0\n }\n\n return false\n }", "title": "" }, { "docid": "4f3a6b9012c248f869f73ae6e3d9a5c6", "score": "0.48737898", "text": "show () {\n if (this.canDo('visible', true)) {\n this.__setStateInfo('visible', true)\n this.$emit('input', true)\n return true\n }\n return false\n }", "title": "" }, { "docid": "d3eec0eb3e520f5f76184a12b6b6669c", "score": "0.48734915", "text": "function fmdf_fmcontainer_block_headerdisplay(hide) {\n\tvar c = fmdc.selection.selectedobj;\n\t//alert(hide);\n\tif (hide=='1'){\n\t\tc.find('.fmcontainer_block_titlebar').height('.1em');\n\t\tc.find('.fmcontainer_block_titlebar img').hide();\n\t\tc.find('.fmcontainer_block_titlebar a').hide();\n\t} else {\n\t\tc.find('.fmcontainer_block_titlebar').height('2em');\n\t\tc.find('.fmcontainer_block_titlebar img').show();\n\t\tc.find('.fmcontainer_block_titlebar a').show();\n\t}\n}", "title": "" }, { "docid": "b8fbdd96b29e1da47cc65cec315dea34", "score": "0.48672834", "text": "get shouldLabelFloat() {\n return this._panelOpen || !this.empty || (this._focused && !!this._placeholder);\n }", "title": "" }, { "docid": "b8fbdd96b29e1da47cc65cec315dea34", "score": "0.48672834", "text": "get shouldLabelFloat() {\n return this._panelOpen || !this.empty || (this._focused && !!this._placeholder);\n }", "title": "" }, { "docid": "b9738b04a5bdb8e59bf736f7bad9b0ed", "score": "0.4866166", "text": "get _isVisible() {\n\t\treturn Boolean(this.offsetWidth || this.offsetHeight);\n\t}", "title": "" }, { "docid": "84f7965ac45c51867a46c144aa91ee24", "score": "0.4863991", "text": "toggleShowHide(event, clickedGroup, wasExpanded) {\n if (wasExpanded) {\n this.props.removeExpandedGroup(clickedGroup);\n } else {\n this.props.addExpandedGroup(clickedGroup);\n }\n }", "title": "" }, { "docid": "cc1701dcb990477d6166c21645ecd10a", "score": "0.485997", "text": "function _shouldBeVisible(auction) {\n return (auction.state == 'created' || auction.state == 'waiting_for_bids')\n}", "title": "" }, { "docid": "f68d7c8ebc07c62a58ce5f7b0890deae", "score": "0.4854398", "text": "get _isVisible() {\n return Boolean(this.offsetWidth || this.offsetHeight);\n }", "title": "" }, { "docid": "996bf3593ab32272547c23faf1ad9a3f", "score": "0.4845916", "text": "get visible()\n {\n return !this.treeElement.parentNode.collapsed;\n }", "title": "" }, { "docid": "c89983692a4bf273e79d8249060ce9de", "score": "0.48454288", "text": "function toggleItemDisplay() {\n items.toggle(is_visible);\n }", "title": "" }, { "docid": "2d076497f37c39fa081cdf39c4311c2d", "score": "0.4829585", "text": "function isVisible(i, el) {\n return el.parentNode.style.display !== 'none';\n }", "title": "" }, { "docid": "4e4f1a9df13307fe84740a1d06e86806", "score": "0.48295006", "text": "function showEventAddedHeader() {\n const $eventListHeader = $('#event-added-header');\n if ($eventListHeader.hasClass('d-none')) {\n $eventListHeader.removeClass('d-none');\n }\n}", "title": "" } ]
362b0cc736b75fb97b27ca43ee99e22d
Get a style property value.
[ { "docid": "bc5945152744a2f75c22b54eec2b1367", "score": "0.6596365", "text": "function getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" } ]
[ { "docid": "718f2f8fa80821f340be13fdb67410b0", "score": "0.75559884", "text": "function w3_getStyleValue(elmnt,style) {\n if (window.getComputedStyle) {\n return window.getComputedStyle(elmnt,null).getPropertyValue(style);\n } else {\n return elmnt.currentStyle[style];\n }\n}", "title": "" }, { "docid": "5f7ca57bd979bfa05bf6cd84b5e4aea6", "score": "0.7491473", "text": "function getPropValue(style, value) {\r\n return parseFloat(style.getPropertyValue(value)) || 0;\r\n}", "title": "" }, { "docid": "5984ce0cb548c1969bb404e14c683dd3", "score": "0.7487778", "text": "getPropertyValue (attr) {\r\n let value\r\n\r\n do {\r\n value = node.style[attr] || node.getAttribute(attr)\r\n } while (\r\n value == null\r\n && (node = node.parentNode)\r\n && node.nodeType === 1\r\n )\r\n\r\n return value || null\r\n }", "title": "" }, { "docid": "982e5da28e6601c87b3a1acfe4eb601e", "score": "0.7468744", "text": "function _getStyle(el, property) {\n if (window.getComputedStyle) {\n return document.defaultView.getComputedStyle(el, null)[property];\n }\n if (el.currentStyle) {\n return el.currentStyle[property];\n }\n return undefined;\n }", "title": "" }, { "docid": "43d591e5392f807d8ba6e5365f0e3d02", "score": "0.7454723", "text": "get_style_value(element, name) {\n return (getComputedStyle(element))[name];\n }", "title": "" }, { "docid": "7bec0e67576fdef39833c465910586bf", "score": "0.7452349", "text": "function _getStyle(el, property) {\n if (window.getComputedStyle) {\n return document.defaultView.getComputedStyle(el, null)[property];\n }\n if (el.currentStyle) {\n return el.currentStyle[property];\n }\n }", "title": "" }, { "docid": "f741a8160d9db04ad05508354ec27d41", "score": "0.7422238", "text": "function _getStyle(el, property) {\n if ( window.getComputedStyle ) {\n return document.defaultView.getComputedStyle(el,null)[property];\n }\n if ( el.currentStyle ) {\n return el.currentStyle[property];\n }\n }", "title": "" }, { "docid": "c40a39d21c1ca570ad1e034b756a6245", "score": "0.7383968", "text": "function _getCSSValue(element, prop) {\n var p = _getPrefixed(prop);\n if (window.getComputedStyle) {\n return window.getComputedStyle(element)[p];\n } else {\n return element.style[p];\n }\n }", "title": "" }, { "docid": "f7aed98aaa64c0c4babdc79c37fa5375", "score": "0.73353773", "text": "function getStyleValue(elem, prop) {\n\t if (elem.currentStyle) {\n\t\treturn elem.currentStyle[prop];\n\t } else if (window.getComputedStyle) {\n\t\treturn document.defaultView.getComputedStyle(elem, null)[prop];\n\t } else if (prop in elem.style) {\n\t\treturn elem.style[prop];\n\t }\n\t return null;\n }", "title": "" }, { "docid": "db2230e296725daa2b6e272d1c14db3d", "score": "0.73295134", "text": "function getStyle (element, style) {\n return window\n .getComputedStyle(element)\n .getPropertyValue(style)\n}", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7303141", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7303141", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7303141", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.7303141", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009694", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009694", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009694", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009694", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009616", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009616", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009616", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "86aeb2784e62e15ae84cd352b791012b", "score": "0.73009616", "text": "get style() {\n return this.__style.get();\n }", "title": "" }, { "docid": "27a7aa3b59714a14d7b9eac262c2a1d6", "score": "0.7036587", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "27a7aa3b59714a14d7b9eac262c2a1d6", "score": "0.7036587", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "27a7aa3b59714a14d7b9eac262c2a1d6", "score": "0.7036587", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "27a7aa3b59714a14d7b9eac262c2a1d6", "score": "0.7036587", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "7dfd4d568355d816884b5a16dfd7a769", "score": "0.703079", "text": "function getStyle(styleProp) {\n\t \tif (object.currentStyle)\n\t \t\tvar style = object.currentStyle[styleProp];\n\t \telse if (window.getComputedStyle)\n\t \t\tvar style = document.defaultView.getComputedStyle(object,null).getPropertyValue(styleProp);\n\t \treturn style;\n\t }", "title": "" }, { "docid": "f2303d9c9d8fce97d87116c24c76bd58", "score": "0.70274127", "text": "function getStyleValue(node, styleName) {\n // Word uses non-standard names for the metadata that puts in the style of the element...\n // Most browsers will not provide the information for those unstandard values throug the node.style\n // property, so the only reliable way to read them is to get the attribute directly and do\n // the required parsing..\n var textStyle = node.getAttribute('style');\n if (textStyle && textStyle.length > 0 && textStyle.indexOf(styleName) >= 0) {\n // Split all the CSS name: value pairs\n var inStyles = textStyle.split(';');\n for (var i = 0; i < inStyles.length; i++) {\n // Split the name and value\n var nvpair = inStyles[i].split(':');\n if (nvpair.length == 2 && nvpair[0].trim() == styleName) {\n return nvpair[1].trim();\n }\n }\n }\n // As a backup mechanism, we'll still try to get the value from the style object\n // Dictionary styles = (Dictionary)(object)node.Style;\n // return (string)styles[styleName];\n return null;\n}", "title": "" }, { "docid": "a3ced5c7206b96c9d0023fba5ba67150", "score": "0.7018133", "text": "getStyle(elementData, property) {\n const data = elementData;\n const alreadyComputed = data.computedStyle;\n if (alreadyComputed) {\n return alreadyComputed[property];\n }\n const inlineValue = data.el.style[property];\n if (inlineValue) {\n return inlineValue;\n }\n const attribute = data.el.getAttribute(property);\n if (attribute) {\n return attribute;\n }\n data.computedStyle = window.getComputedStyle(data.el);\n return data.computedStyle[property];\n }", "title": "" }, { "docid": "3aa870f7104094485017678998115683", "score": "0.7013162", "text": "function getStyle(el, style){\n if (!document.getElementById) \n return;\n var value = el.style[toCamelCase(style)];\n if (!value) {\n if (document.defaultView) {\n value = document.defaultView.getComputedStyle(el, \"\").getPropertyValue(style);\n }\n else \n if (el.currentStyle) {\n value = el.currentStyle[toCamelCase(style)];\n }\n }\n return value;\n }", "title": "" }, { "docid": "e3ae972444615ab8753f3db07098094c", "score": "0.6998641", "text": "get style() {\n return this._style;\n }", "title": "" }, { "docid": "4973247a13acd7bde2bc4dda856023fd", "score": "0.6981957", "text": "function getStyle(si) {\n\treturn getObj(si).style;\n}", "title": "" }, { "docid": "c1085d0828d72e0c8b0721cd243406c2", "score": "0.6922034", "text": "function gb_cc_get_style(el, styleProp) {\n\tvar x = document.getElementsByTagName(el)[0];\n\tif (x.currentStyle) {\n\t\tvar y = x.currentStyle[styleProp];\n\t}\n\telse if (window.getComputedStyle) {\n\t\tvar y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);\n\t}\n\treturn y;\n}", "title": "" }, { "docid": "6146514b3df27189c89fb644bae1bfc9", "score": "0.68757147", "text": "function getStyle(el, prop) {\n return window.getComputedStyle !== undefined ? window.getComputedStyle(el, null).getPropertyValue(prop) : el.currentStyle[prop];\n }", "title": "" }, { "docid": "1600f88df83a4238637cbb19b63d338e", "score": "0.68571675", "text": "function xbStyleGetEffectiveValue(propname)\n{\n var value = null;\n\n if (this.window.document.defaultView && this.window.document.defaultView.getComputedStyle)\n {\n // W3\n // Note that propname is the name of the property in the CSS Style\n // Object. However the W3 method getPropertyValue takes the actual\n // property name from the CSS Style rule, i.e., propname is\n // 'backgroundColor' but getPropertyValue expects 'background-color'.\n\n var capIndex;\n var cappropname = propname;\n\n while ( (capIndex = cappropname.search(/[A-Z]/)) != -1)\n {\n if (capIndex != -1)\n {\n cappropname = cappropname.substring(0, capIndex) + '-' + cappropname.substring(capIndex, capIndex+1).toLowerCase() + cappropname.substr(capIndex+1);\n }\n }\n\n value = this.window.document.defaultView.getComputedStyle(this.object, '').getPropertyValue(cappropname);\n\n // xxxHack for Gecko:\n if (!value && this.styleObj[propname])\n {\n value = this.styleObj[propname];\n }\n }\n else if (typeof(this.styleObj[propname]) == 'undefined')\n {\n value = xbStyleNotSupportStringValue(propname);\n }\n else if (typeof(this.object.currentStyle) != 'undefined')\n {\n // IE5+\n value = this.object.currentStyle[propname];\n if (!value)\n {\n value = this.styleObj[propname];\n }\n\n if (propname == 'clip' && !value)\n {\n // clip is not stored in IE5/6 handle separately\n value = 'rect(' + this.object.currentStyle.clipTop + ', ' + this.object.currentStyle.clipRight + ', ' + this.object.currentStyle.clipBottom + ', ' + this.object.currentStyle.clipLeft + ')';\n }\n }\n else\n {\n // IE4+, Opera, NN4\n value = this.styleObj[propname];\n }\n\n return value;\n}", "title": "" }, { "docid": "50c9c95faf0509ae0a3950b247bd9e88", "score": "0.6824166", "text": "function getStyleRuleValue(style, selector) {\n for (var i = 0; i < document.styleSheets.length; i++) {\n var mysheet = document.styleSheets[i];\n var myrules = mysheet.cssRules ? mysheet.cssRules : mysheet.rules;\n for (var j = 0; j < myrules.length; j++) {\n if (myrules[j].selectorText && myrules[j].selectorText.toLowerCase() === selector) {\n return myrules[j].style[style];\n }\n }\n\n }\n}", "title": "" }, { "docid": "84050afcb3c755342fd05c0ac2cc4ded", "score": "0.6811548", "text": "function getStyle ( styleName ) {\n\n return styleMap[ styleName ];\n\n }", "title": "" }, { "docid": "7bcdfe1b5ccf0899d9ae259453a99493", "score": "0.6751548", "text": "function get(element) {\n return getComputedStyle(element);\n }", "title": "" }, { "docid": "7bcdfe1b5ccf0899d9ae259453a99493", "score": "0.6751548", "text": "function get(element) {\n return getComputedStyle(element);\n }", "title": "" }, { "docid": "3468d854e2704f11179036b05a7323bf", "score": "0.6745807", "text": "function getElementStyle(elementID, CssStyleProperty) {\n var element = document.getElementById(elementID);\n if (element.currentStyle) {\n return element.currentStyle[toCamelCase(CssStyleProperty)];\n } else if (window.getComputedStyle) {\n var compStyle = window.getComputedStyle(element, '');\n return compStyle.getPropertyValue(CssStyleProperty);\n } else {\n return '';\n }\n}", "title": "" }, { "docid": "37121c6607706fd35a8da69b261ed161", "score": "0.67041373", "text": "function get_style(obj, property, propertyNS)\r\n {\r\n\t var ret = alib.dom.styleGet(obj, property);\r\n\t if (ret)\r\n\t \t return ret;\r\n\t else\r\n\t\t return \"\";\r\n\r\n try\r\n {\r\n if(obj.currentStyle)\r\n {\r\n var returnVal = eval(\"obj.currentStyle.\" + property);\r\n }\r\n else\r\n {\r\n /*\r\n Safari does not expose any information for the object if display is\r\n set to none is set so we temporally enable it.\r\n */\r\n if(isSafari && obj.style.display == \"none\")\r\n {\r\n obj.style.display = \"\";\r\n var wasHidden = true;\r\n }\r\n\r\n var returnVal = ALib.m_document.defaultView.getComputedStyle(obj, '').getPropertyValue(propertyNS);\r\n\r\n // Rehide the object\r\n if(isSafari && wasHidden)\r\n {\r\n obj.style.display = \"none\";\r\n }\r\n }\r\n }\r\n catch(e)\r\n {\r\n // Do nothing\r\n }\r\n\r\n return returnVal;\r\n }", "title": "" }, { "docid": "df0790be7bee97edd917ecd609a438d4", "score": "0.66785765", "text": "function _getStyle(el, style) {\n\treturn L.DomUtil.getStyle(el, style) || L.DomUtil.getStyle(el, _kebabToCamelCase(style));\n}", "title": "" }, { "docid": "67f0322ed0f8b769d81a8a2d0efbea58", "score": "0.6669075", "text": "function getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n }", "title": "" }, { "docid": "bf6f56fc5a175492ff1159f083584dc7", "score": "0.66635936", "text": "function getStyle(el, styleProp)\n{\n if (el.currentStyle)\n y = el.currentStyle[styleProp];\n else if (window.getComputedStyle)\n y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);\n return y;\n}", "title": "" }, { "docid": "2c1464d7a35a09cea61e5ab3f25e81c6", "score": "0.6635323", "text": "function getStyleForProperty(elem, propertyName) {\n var styleAttribute = elem.style;\n var computedStyle = getComputedStyle(elem) || elem.currentStyle;\n var styleValue = styleAttribute[propertyName] && !/auto|initial|none|unset/.test(styleAttribute[propertyName])\n ? styleAttribute[propertyName]\n : computedStyle[propertyName];\n var result = defaultValues[propertyName];\n\n if (propertyName !== 'transform' && (propertyName in computedStyle || propertyName in styleAttribute)) {\n result = styleValue;\n }\n\n return result;\n }", "title": "" }, { "docid": "f797dbd2b5a6f35c54b6bb4606242758", "score": "0.6621424", "text": "get cssText() {\n return this.getAttribute(\"style\");\n }", "title": "" }, { "docid": "fa06c992b00f7a87339836937f3f4a31", "score": "0.6617949", "text": "function getStyle(el, styleProp) {\n\tvar styleValue;\n\tif(el.currentStyle) styleValue = el.currentStyle[styleProp];\n\telse if(window.getComputedStyle) styleValue = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);\n\tvar px = new RegExp('px');\n styleValue = styleValue.replace(px, '');\n\ttry { styleValue = styleValue - 0; } catch(e) { alert(e); }\n\treturn styleValue;\n}", "title": "" }, { "docid": "9d451a0c20a4ed0609f0a7514cb8ab04", "score": "0.66101956", "text": "get style() {\n return this.element.style;\n }", "title": "" }, { "docid": "9d451a0c20a4ed0609f0a7514cb8ab04", "score": "0.66101956", "text": "get style() {\n return this.element.style;\n }", "title": "" }, { "docid": "1141e60507678c2172c49b7f7d7743a4", "score": "0.6577552", "text": "function get(element) {\r\n return getComputedStyle(element);\r\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "09c3a914261439c1fe1220283cdd674f", "score": "0.6565455", "text": "function get(element) {\n return getComputedStyle(element);\n}", "title": "" }, { "docid": "54be8b7fe45a5328e556c345ec84193f", "score": "0.65562546", "text": "function getCSSPropertyValue(element, property) {\n\t\t\t\treturn parseInt(window.getComputedStyle(element, null).getPropertyValue(property), 10);\n\t\t\t}", "title": "" }, { "docid": "7880c109bc631e01f6b8bcb852dae807", "score": "0.65296096", "text": "function getStyle(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "7880c109bc631e01f6b8bcb852dae807", "score": "0.65296096", "text": "function getStyle(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "7880c109bc631e01f6b8bcb852dae807", "score": "0.65296096", "text": "function getStyle(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "7880c109bc631e01f6b8bcb852dae807", "score": "0.65296096", "text": "function getStyle(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "b015c10db1ebe734011e4dd045c0380e", "score": "0.65274185", "text": "function getCSSProp (element, prop) {\n if (element.style[prop]) {\n // inline style property\n return element.style[prop];\n } else if (element.currentStyle) {\n // external stylesheet for Explorer\n return element.currentStyle[prop];\n } else if (document.defaultView && document.defaultView.getComputedStyle) {\n // external stylesheet for Mozilla and Safari 1.3+\n prop = prop.replace(/([A-Z])/g,\"-$1\");\n prop = prop.toLowerCase();\n return document.defaultView.getComputedStyle(element,\"\").getPropertyValue(prop);\n } else {\n // Safari 1.2\n return null;\n }\n}", "title": "" }, { "docid": "0e3e40b2fb9e90cf068e4762dde07eeb", "score": "0.6479744", "text": "function getCSS(element, property) {\r\n\r\n\t\tvar elem = document.getElementsByTagName(element)[0];\r\n\t\tvar css = null;\r\n\r\n\t\tif (elem.currentStyle) {\r\n\t\t\tcss = elem.currentStyle[property];\r\n\r\n\t\t} else if (window.getComputedStyle) {\r\n\t\t\tcss = document.defaultView.getComputedStyle(elem, null).\r\n\t\t\t\tgetPropertyValue(property);\r\n\t\t}\r\n\r\n\t\treturn css;\r\n\r\n\t}", "title": "" }, { "docid": "1af129a5f23b38ed4d6f03a7b3fbd1d9", "score": "0.64730847", "text": "get style() {\n return this._svgNode.css();\n }", "title": "" }, { "docid": "83ca82170b412fa53f0cb137ea2bb90b", "score": "0.64639515", "text": "function getStyle(object, styleName) {\n if (window.getComputedStyle) {\n return document.defaultView.getComputedStyle(object, null).getPropertyValue(styleName);\n } else if (object.currentStyle) {\n return object.currentStyle[styleName]\n }\n}", "title": "" }, { "docid": "20f3443d2a3248533810e06508dc6bfe", "score": "0.6455765", "text": "function getStyle(styleName) {\n eval(\"var current = styleDict.\" + styleName);\n if (typeof current == 'undefined') return styleDict.none;\n return current;\n}", "title": "" }, { "docid": "7b7b5c0f1638932280be11a27d06edc7", "score": "0.644187", "text": "function i(t){return getComputedStyle(t)}", "title": "" }, { "docid": "d2da89452d3463cdd0ede08a495a92ca", "score": "0.64410627", "text": "function getCSSprop(elementID, cssvalue){\n var returnvalue=\"\";\n returnvalue=document.defaultView.getComputedStyle(elementID, null).getPropertyValue(cssvalue);\n return returnvalue;\n}", "title": "" }, { "docid": "24b48befff6f7a30b4b7caf9c1a1003c", "score": "0.6435806", "text": "function getCssproperty (selecter, property){\n const compStyles = window.getComputedStyle(selecter);\n const value = compStyles.getPropertyValue(property);\n return value;\n}", "title": "" }, { "docid": "33ba50e8d77e272005cd91c1d64d43e9", "score": "0.64286256", "text": "getStyle(idx) // get an image from style array.\n\t{\n\t\t//alert(styles[idx]);\n\t\treturn this.game.getStyle(idx);\n\t}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.64262056", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.64262056", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.64262056", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "8cbea1f5c7a521fe7e54c425789e2167", "score": "0.64262056", "text": "function n(t){return getComputedStyle(t)}", "title": "" }, { "docid": "3f85d88361bc097cf7fe6fd3c389abde", "score": "0.64005387", "text": "function po(e){return getComputedStyle(e)}", "title": "" }, { "docid": "0370978bdca4d3ee594b417dec0b0d2e", "score": "0.6398909", "text": "function EZgetStyle(el, styleProp, value)\n{\n\tel = EZgetEl(el);\n\tif (!EZ.legacy.EZgetStyle)\n\t{\n\t\tif (value != EZ.undefined && !EZisArrayLike(value))\n\t\t\tvalue = [value];\n\t\tdo\n\t\t{\n\t\t\tvar val = [];\n\t\t\tvar style = el && el.style;\n\t\t\tif (style)\n\t\t\t{\n\t\t\t\tif (document.defaultView && document.defaultView.getComputedStyle)\n\t\t\t\t\tval = document.defaultView.getComputedStyle(el, '');\n\t\t\t\telse if (el.currentStyle)\n\t\t\t\t\tval = el.currentStyle;\n\t\t\t\telse\n\t\t\t\t\tval = '';\t\t\t\t//safety for unexpected\n\t\t\t}\n\t\t\t// return all or specified style if not searching for specific value(s)\n\t\t\tif (value == EZ.undefined)\n\t\t\t\treturn !styleProp ? val : val[styleProp];\n\n\t\t\t// return el if specified property matches one of specified values\n\t\t\tif ([].indexOf.call(value,val[styleProp]) != -1)\n\t\t\t\treturn el;\n\t\t}\n\t\twhile (el = el.parentElement)\t//move up dom tree\n\n\t\treturn EZnone();\t\t\t\t//specified value not found in dom tree\n\t}\n\t//--------------------------------------------------------------------\n\t// legacy code -- get element or element for id if el not element\n\t//\tTODO: may not work on chrome -- window.getComputedStyle is function\n\t//\t\t not sure if working in dw environment\n\t//--------------------------------------------------------------------\n\tvar value = '';\n\tvar currentStyle = null;\n\n\tif (window.getComputedStyle)\t//chrome & FF work (others TBD per Ray)\n\t\tcurrentStyle = window.getComputedStyle;\n\n\telse if (el.currentStyle)\t\t//pre IE11\n\t\tcurrentStyle = el.currentStyle\n\n\tif (currentStyle && currentStyle[style])\n\t\tvalue = currentStyle[style];\n\n\treturn value;\n}", "title": "" }, { "docid": "0370978bdca4d3ee594b417dec0b0d2e", "score": "0.6398909", "text": "function EZgetStyle(el, styleProp, value)\n{\n\tel = EZgetEl(el);\n\tif (!EZ.legacy.EZgetStyle)\n\t{\n\t\tif (value != EZ.undefined && !EZisArrayLike(value))\n\t\t\tvalue = [value];\n\t\tdo\n\t\t{\n\t\t\tvar val = [];\n\t\t\tvar style = el && el.style;\n\t\t\tif (style)\n\t\t\t{\n\t\t\t\tif (document.defaultView && document.defaultView.getComputedStyle)\n\t\t\t\t\tval = document.defaultView.getComputedStyle(el, '');\n\t\t\t\telse if (el.currentStyle)\n\t\t\t\t\tval = el.currentStyle;\n\t\t\t\telse\n\t\t\t\t\tval = '';\t\t\t\t//safety for unexpected\n\t\t\t}\n\t\t\t// return all or specified style if not searching for specific value(s)\n\t\t\tif (value == EZ.undefined)\n\t\t\t\treturn !styleProp ? val : val[styleProp];\n\n\t\t\t// return el if specified property matches one of specified values\n\t\t\tif ([].indexOf.call(value,val[styleProp]) != -1)\n\t\t\t\treturn el;\n\t\t}\n\t\twhile (el = el.parentElement)\t//move up dom tree\n\n\t\treturn EZnone();\t\t\t\t//specified value not found in dom tree\n\t}\n\t//--------------------------------------------------------------------\n\t// legacy code -- get element or element for id if el not element\n\t//\tTODO: may not work on chrome -- window.getComputedStyle is function\n\t//\t\t not sure if working in dw environment\n\t//--------------------------------------------------------------------\n\tvar value = '';\n\tvar currentStyle = null;\n\n\tif (window.getComputedStyle)\t//chrome & FF work (others TBD per Ray)\n\t\tcurrentStyle = window.getComputedStyle;\n\n\telse if (el.currentStyle)\t\t//pre IE11\n\t\tcurrentStyle = el.currentStyle\n\n\tif (currentStyle && currentStyle[style])\n\t\tvalue = currentStyle[style];\n\n\treturn value;\n}", "title": "" }, { "docid": "0a3ed4ed5ae4d290104957553552ecaa", "score": "0.6394446", "text": "async getCssValue(property: string): Promise<string> {\n return await this.requestJSON('GET', '/css/' + property);\n }", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.63836837", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.63836837", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.63836837", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.63836837", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.63836837", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" } ]
69e6f125093605760028793c04a59499
Create and populate the fields for spec.processings. This is an array of objects, each of which contains keys for how the Logicker should do postprocessing on the contentscript's galleryMap. Each holds a "match" regexp for the uri, "doDig", "doScrape", and array of "actions" of varying types.
[ { "docid": "c3a558cb166aaa7e7dea847079df1ef8", "score": "0.48347363", "text": "static layoutProcessings(processings) {\r\n Optionator.layoutSpecSection(C.OPT_CONF.SECTIONS.PROCESSINGS, processings);\r\n }", "title": "" } ]
[ { "docid": "0c8533f70161b31dd033cdad694327a1", "score": "0.4779882", "text": "buildProcessRelationships(experiment) {\n let samplesById = _.indexBy(experiment.samples, 'id');\n experiment.processes.forEach(p => {\n let inputSamples = experiment.relationships.process2sample\n .filter(entry => entry.direction === 'in' && entry.process_id === p.id);\n let outputSamples = experiment.relationships.process2sample\n .filter(entry => entry.direction === 'out' && entry.process_id === p.id);\n\n // Workflow code assumes an id field for samples, but we only have a sample_id field. So add in the id field.\n // Additionally the inputSamples and outputSamples are built off of the relationships which don't have a name\n // field so also add that in\n inputSamples.forEach(s => {\n s.id = s.sample_id;\n s.name = samplesById[s.id].name;\n });\n outputSamples.forEach(s => {\n s.id = s.sample_id;\n s.name = samplesById[s.id].name;\n });\n p.input_samples = inputSamples;\n p.output_samples = outputSamples;\n });\n\n return experiment;\n }", "title": "" }, { "docid": "88760c51f5491d958328b9f29bf4acc8", "score": "0.46280673", "text": "async process() {\n // Retrieve the content from Contentful.\n const res = await this.client.getEntries({\n \"sys.contentType.sys.id[in]\": this.config.id,\n include: 10\n })\n // Once the data is in place, loop through it and process each item to return\n // an array of key-value pairs for all specified fields.\n return (res.items || []).map(item => this.processItem(item))\n }", "title": "" }, { "docid": "367b14edb812550bbafd990491aa8196", "score": "0.4588021", "text": "static getProcessingEntries() {\r\n return Dominatrix.getEntries(Dominatrix.SectionElements.PROCESSINGS);\r\n }", "title": "" }, { "docid": "68ae6aebb403220a96c0167f6b81788c", "score": "0.4574651", "text": "static preprocess(data) {\n const pics = [];\n const myCollection = {\n paintings: [],\n photos: []\n };\n\n data.forEach((item) => pics.push(item.answers));\n\n [].concat(...pics).forEach((item) => {\n if (item.type === `photo`) {\n myCollection.photos.push(item.image.url);\n } else {\n myCollection.paintings.push(item.image.url);\n }\n });\n\n return myCollection;\n }", "title": "" }, { "docid": "91cc4be1fa3c7a550b7ca8dabd872dd8", "score": "0.44534415", "text": "postProcess (data) {\n data = sorter(data)\n let promises = []\n\n Object.keys(this.annotations.list).forEach(key => {\n let annotation = this.annotations.list[key]\n\n if (annotation.resolve) {\n let promise = Promise.resolve(annotation.resolve(data))\n promises.push(promise)\n }\n })\n\n return Promise.all(promises).then(() => data)\n }", "title": "" }, { "docid": "a3fe2442c8127119d572b987ba2336d3", "score": "0.43940535", "text": "function postProcessing() {\n console.debug('Onedata ReDoc integration: post processing');\n // live collection\n var anchorLinks = document.querySelectorAll('a[href^=\"#\"]:not([orig-href]):not([data-is-click-handler])');\n Array.from(anchorLinks).forEach(processInternalLink);\n var externalLinks = document.querySelectorAll('a:not([href^=\"#\"]):not([orig-href]):not([data-is-click-handler])');\n Array.from(externalLinks).forEach(function(lnk) {\n lnk.addEventListener('click', handleLinkOpen); \n lnk.setAttribute('data-is-click-handler', 'true');\n });\n var menuItems = document.querySelectorAll('li[data-item-id]:not([data-is-click-handler])');\n Array.from(menuItems).forEach(function(item) {\n item.addEventListener('click', handleMenuItemOpen);\n item.setAttribute('data-is-click-handler', 'true');\n });\n // HACK convert wrongly generated swagger.json links (badly used relative link)\n try {\n var swaggerUrl = window.location.href.replace(/(.*)\\/.*/, '$1/swagger.json');\n Array.from(document.querySelectorAll('a[href*=\"swagger.json\"]'))\n .forEach(function(a) {\n a.href = swaggerUrl;\n });\n } catch (error) {\n console.warn('Failed to convert bad relative swagger.json links: ' + error);\n }\n // convert documentation links\n try {\n Array.from(document.querySelectorAll('a[href^=\"https://onedata.org/docs/doc/\"]'))\n .forEach(function(a) {\n a.href = a.href.replace(/https:\\/\\/onedata.org\\/docs\\//g, window.location.origin + '/#/home/documentation/');\n });\n } catch (error) {\n console.warn('Failed to convert bad relative swagger.json links: ' + error);\n }\n \n if (document.postProcessingIteration < 1) {\n var logo = document.querySelector('img[src$=\"-logo.svg\"');\n if (logo) {\n logo.setAttribute('src', logo.getAttribute('src').replace('https://onedata.org/', '/'));\n }\n // HACK remove misleading link from logo\n var logoLink = document.querySelector('.menu-content a[href^=\"https://onedata.org\"]');\n if (logoLink) {\n logoLink.href = 'javascript:void(0);';\n }\n // HACK hack for current wrong links, it should be fixed in documentation in future\n var supportLinks = document.querySelectorAll('a[href=\"https://onedata.org/support\"]');\n Array.from(supportLinks).forEach(function(a) {\n a.href = 'https://onedata.org/#/home/support';\n });\n }\n \n if (document.iframeLoaded) {\n var anchorElement = redocAnchorChanged(document.apiAnchor);\n if (anchorElement) {\n document.postProcessingJumpDone = true;\n }\n } else {\n setTimeout(postProcessing, 200);\n }\n \n document.postProcessingIteration += 1;\n}", "title": "" }, { "docid": "2185a1623fbedd900c4864257acf3459", "score": "0.4361291", "text": "buildinfoToPatch(){\n \t\tconst {formInput} = this.state;\n \t\tvar modelType = this.state.modelType;\n\n \t\t//Make modelType plural\n \t\tif(modelType != 'series'){\n \t\t\tmodelType += \"s\";\n \t\t}\n\n \t\tthis.state.infoToPatch['type'] = modelType;\n \t\tthis.state.infoToPatch['attributes'] = {};\n \t\tthis.state.infoToPatch['relationships'] = {};\n \t\tthis.state.infoToPatch['id'] = this.state.id;\n\n \t\tfor(var key in formInput){\n \t\t\t// skip loop cycle if the property is from prototype or field is \"\"\n \t\t\tif (!formInput.hasOwnProperty(key)) \n\t\t \tcontinue;\n\n\t\t if(key === 'series' ||\n\t\t key === 'comics' \t||\n\t\t key === 'characters' ||\n\t\t key === 'creators' ||\n\t\t key === 'events'){\n\t\t \tvar connectionSet = new Set(formInput[key].split(\", \"));\n\t\t \tvar data = [];\n\t\t \tfor(let id of connectionSet){\n\t\t \t\tdata.push({id: id, type: key});\n\t\t \t}\n\n\t\t \tif(key === 'series' && modelType === 'comics'){\n\t\t \t\tif(connectionSet.has(\"\"))\n\t\t \t\t\tthis.state.infoToPatch.relationships[key] = {data: []};\n\t\t \t\telse\n\t\t \t\t\tthis.state.infoToPatch.relationships[key] = {data: data};\n\t\t \t}\n\t\t \telse{\n\t\t \t\tif(connectionSet.has(\"\")){\n\t\t \t\t\tthis.state.infoToPatch.attributes['num_' + key] = 0;\n\t\t \t\t\tthis.state.infoToPatch.relationships[key] = {data: []};\n\t\t \t\t}\n\t\t \t\telse{\n\t\t \t\t\tthis.state.infoToPatch.attributes['num_' + key] = connectionSet.size;\n\t\t \t\t\tthis.state.infoToPatch.relationships[key] = {data: data};\n\t\t \t\t}\n\t\t \t}\n\t\t \t\n\t\t }\n\t\t else{\n\t\t \tif(this.state.formInput[key] != \"\")\n\t\t \t\tthis.state.infoToPatch.attributes[key] = this.state.formInput[key];\n\t\t \telse if(key === 'price')\n\t\t \t\tthis.state.infoToPatch.attributes[key] = 0;\n\t\t \telse\n\t\t \t\tthis.state.infoToPatch.attributes[key] = null;\n\t\t }\n \t\t}\n \t}", "title": "" }, { "docid": "8cd4349fc2b629aecaec9880921519c9", "score": "0.4327812", "text": "function toParts() {\n var method = arguments.length <= 0 || arguments[0] === undefined ? 'put' : arguments[0];\n var data = arguments[1];\n var designId = data.designId;\n var authToken = data.authToken;\n var apiEndpoint = data.apiEndpoint;\n\n var entries = data._entries || [];\n\n var authTokenStr = authToken ? '/?auth_token=' + authToken : '';\n var designUri = apiEndpoint + '/designs/' + designId;\n var partUri = designUri + '/parts';\n\n var fieldNames = ['id', 'name', 'description', 'uuid'];\n var mapping = {\n 'id': 'uuid',\n 'params': 'part_parameters'\n };\n\n /* \"binary_document_id\": null,\n \"binary_document_url\": \"\",\n \"source_document_id\": null,\n \"source_document_url\": \"\",]*/\n var requests = entries.map(function (entry) {\n var refined = (0, _ramda.pick)(fieldNames, (0, _utils.remapJson)(mapping, entry));\n var send = (0, _httpUtils.jsonToFormData)(refined);\n\n return {\n url: partUri + '/' + refined.uuid + authTokenStr,\n method: method,\n send: send,\n type: 'ymSave',\n typeDetail: 'parts',\n mimeType: null, // 'application/json'\n responseType: 'json',\n withCredentials: true\n };\n });\n return requests;\n}", "title": "" }, { "docid": "2947f233c621d7e27c0bb28568e5af54", "score": "0.43111545", "text": "processedPosts(){\n let posts = this.results;\n \n // 1. ''\n posts.map(\n post => {\n let imgObj = post.multimedia.find(media => media.format === \"superJumbo\");\n post.image_url = imgObj ? imgObj.url:\"http://placehold.it/300x200?text=N/A\";\n }\n );\n\n // 2. ''\n let i, j, chunkedArray = [], chunk = 4;\n for(let i=0, j=0; i < posts.length; i += chunk, j++){\n // 3. ''\n //if(JSON.stringify(posts[i]['per_facet']).match(/Trump/i)){\n chunkedArray[j] = posts.slice(i,i+chunk);\n //}\n }\n return chunkedArray;\n }", "title": "" }, { "docid": "e6b83b76f29e8c39fca368be61543d7b", "score": "0.42096615", "text": "function processPronounciations(parsed) {\n log.info(`Processing pronounciations...`);\n\n const pronounciations = {};\n\n parsed.forEach(\n (\n {\n lesson,\n number,\n pinyin,\n description,\n audioFastUrl,\n audioSlowUrl,\n },\n ) => {\n // get name without pinyin words\n const r1 = /^(.+)\\n/;\n const name = lesson.trim().match(r1)[1];\n\n const r2 = /^.+(\\d+)$/;\n const lessonNo = name.match(r2)[1];\n const r3 = /^main_slide-(\\d+)$/;\n const exerciseNo = number.trim().match(r3)[1];\n const identifier = `P${lessonNo}-${exerciseNo}`;\n\n log.info(`Processing exercise ${identifier}`);\n\n const audio = getAudioFileName(audioFastUrl);\n\n if (audioSlowUrl != audioFastUrl) {\n throw new Error(\n `Slow audio is not duplicate of fast audio`,\n );\n }\n\n if (description == \"null\") {\n description = \"\";\n }\n\n const exercise = {\n identifier,\n pinyin: pinyin.trim(),\n description: description.trim(),\n audio,\n };\n\n // create pronounciation on first encounter\n if (pronounciations[name] === undefined) {\n pronounciations[name] = {};\n pronounciations[name].exercises = [];\n }\n pronounciations[name].name = name;\n pronounciations[name].exercises.push(exercise);\n },\n );\n\n return pronounciations;\n}", "title": "" }, { "docid": "dd301c074210cccf2a4e9bc8d208fdc7", "score": "0.41773382", "text": "function parse_content2Array() {\n var sectionA_text;\n var sectionB_text;\n var sectionC_text;\n var submissionID;\n var submissionTIME;\n var keywords;\n\n var finalData = [];\n finalData[0] = [];\n finalData[1] = [];\n}", "title": "" }, { "docid": "9e636faa70e9c0a30ae670280a34b076", "score": "0.4166169", "text": "function processData(data) {\n var pages = [];\n var pageTracker = [];\n var SMs = []\n var SMTracker = [];\n var SMCount = {};\n\n for (var feature in data.features) {\n\t\t\tvar properties = data.features[feature].properties;\n\n //process page properties and store it in page Tracker array\n if (pageTracker[properties.Page] === undefined) {\n pages.push(properties.Page);\n pageTracker[properties.Page] = 1;\n }\n\n //process SM properties and store it in SM Tracker array\n if (SMTracker[properties.SM] === undefined) {\n SMs.push(properties.SM);\n SMTracker[properties.SM] = 1;\n }\n\n //process SM properties and count the number of each subjective markers\n if (SMCount[properties.SM] === undefined) {\n \tSMCount[properties.SM] = 1;\n }\n else {\n \tSMCount[properties.SM] += 1;\n }\n\t\t}\n return { \n SMs : SMs,\n pages : pages.sort(function(a,b){return a - b}),\n SMCount : SMCount\n };\n }", "title": "" }, { "docid": "76b1987e27f242ac066f8d5a7f24a7a3", "score": "0.4162392", "text": "function processAction(){\n\t\t\t\t\t\t\t\t\tlogger(\"processing action:\");\n\t\t\t\t\t\t\t\t\tif(typeof action.actions==\"object\" && action.actions!=null && condStatus){\n\t\t\t\t\t\t\t\t\t\t//if action is creating a new record\n\t\t\t\t\t\t\t\t\t\tif(action.actions.create && action.actions.create.createMethod==\"createMethod\"){\n\t\t\t\t\t\t\t\t\t\t\tvar hostname\n\t\t\t\t\t\t\t\t\t\t\tif(request && request.headers && request.headers.host && request.headers.host.split(\":\")){\n\t\t\t\t\t\t\t\t\t\t\t\thostname=request.headers.host.split(\":\")[0];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tvar cloudPointHostId;\n\t\t\t\t\t\t\t\t\t\t\tif(hostname && ContentServer.getConfigDetails(hostname)){\n\t\t\t\t\t\t\t\t\t\t\t\tcloudPointHostId=ContentServer.getConfigDetails(hostname).cloudPointHostId;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//get the creating record schema\n\t\t\t\t\t\t\t\t\t\t\tutility.getMainSchema({schema:action.actions.create.record,cloudPointHostId:cloudPointHostId},function(schema){\n\t\t\t\t\t\t\t\t\t\t\t\tif(schema.error){callback({error:data.docType+\" not exists\"});return;}\n\t\t\t\t\t\t\t\t\t\t\t\tvar newRecord = {};\n\t\t\t\t\t\t\t\t\t\t\t\tif(schema['@properties']){\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar props = Object.keys(schema['@properties']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t//if action properties are given then continue with action props else take all schema properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tprops=Object.keys(action.actions.create.props).length>props.length?Object.keys(action.actions.create.props):props;\n\t\t\t\t\t\t\t\t\t\t\t\t\t//setting system properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['org']=org;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['docType']=schema['@id'];\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['cloudPointHostId']=cloudPointHostId;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['recordId']=schema['@id']+\"\"+global.guid();\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['author']=userId;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['editor']=userId;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['revision']=1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['dateCreated']=global.getDate();\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord['dateModified']=global.getDate();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//setting other properties\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(0);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction setProp(index){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(index>=props.length){//all properties assignement done\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"next doAction: \"+indx);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[newRecord['docType']]=newRecord;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['create'][newRecord.recordId]=(newRecord);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"processing for: \"+action.actions.create.props[props[index]]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar PropdataType=\"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(schema['@properties'][props[index]]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPropdataType=schema['@properties'][props[index]].dataType.type;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(schema['@sysProperties'][props[index]]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPropdataType=schema['@sysProperties'][props[index]].dataType.type;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.create.props && action.actions.create.props[props[index]]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if current is set\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.create.props[props[index]] == \"current\" || action.actions.create.props[props[index]] == \"recordId\"){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"prop eval: \"+props[index]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]] = Data.recordId;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.create.props[props[index]].indexOf(\"recordId.\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.create.props[props[index]].split(\".\").length==2){//if recordId.something\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//it is immedeately avialable in data.recordId\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Prop value assign: \"+(action.actions.create.props[props[index]].replace(\"recordId\", \"Data['\"+recordId+\"']\")));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Prop eval: \"+(eval(action.actions.create.props[props[index]].replace(\"recordId\", \"Data['\"+recordId+\"']\"))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]] = eval(action.actions.create.props[props[index]].replace(\"recordId\", \"Data['\"+recordId+\"']\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(Data[recordId], action.actions.create.props[props[index]], function(val){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"assigned: \"+val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]] = val;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(Data[action.actions.create.props[props[index]]]){//if string is a property in Data\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]] = Data[action.actions.create.props[props[index]]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{//store the string if not found any where\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]] = action.actions.create.props[props[index]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * assigning respective default values\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * Array= [\"multiPickList\",\"array\",\"image\",\"images\",\"attachment\",\"attachments\",\"privateVideo\",\"privateVideos\",\"dndImage\",\"tags\"]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *\tObjects=[\"struct\",\"geoLocation\",\"userDefinedFields\",\"richText\"]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *\tboolean\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t *\tnumber\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if([\"multiPickList\",\"array\",\"image\",\"images\",\"attachment\",\"attachments\",\"privateVideo\",\"privateVideos\",\"dndImage\",\"tags\"].indexOf(PropdataType)!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]]=[];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if([\"struct\",\"geoLocation\",\"userDefinedFields\",\"richText\"].indexOf(PropdataType)!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]]={};\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if (PropdataType==\"boolean\"){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]]=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if (PropdataType==\"number\"){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]]=undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewRecord[props[index]]=\"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProp(index+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif(action.actions.assign){\n\t\t\t\t\t\t\t\t\t\t\tif(action.actions.assign.remoteRecord){//checking for remote record\n\t\t\t\t\t\t\t\t\t\t\t\tvar remoteRecordId = action.actions.assign.remoteRecord;\n\t\t\t\t\t\t\t\t\t\t\t\tif(remoteRecordId.indexOf(\"recordId\")!=-1){//if remote record id is in current document\n\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecordId = remoteRecordId.replace(\"recordId\", \"Data['\"+recordId+\"']\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+remoteRecordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecordId = eval(remoteRecordId);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t//get Remote Record and update\n\t\t\t\t\t\t\t\t\t\t\t\tCouchBaseUtil.getDocumentByIdFromContentBucket(remoteRecordId, function(remoteRecord){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(remoteRecord.error){//no record exists\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"remote record: \"+remoteRecordId+\" does not exist...\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//get the updation in Global Data object\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'][remoteRecordId]){//if it is already in updation process\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord = Data['update'][remoteRecordId];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{//else fresh updation to be made\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord = remoteRecord.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Got Remote Record: \"+remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar prop = action.actions.assign.property;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Code added for Some more generic functionality,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar val=action.actions.assign.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.assign.value){//if value is fixed\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=action.actions.assign.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(remoteRecord[prop] && remoteRecord[prop].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop].push(val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop]=(val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][remoteRecord.recordId]=(remoteRecord);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[remoteRecord.recordId]=remoteRecord;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.valueExpression){//if value to be get from an expression\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=action.actions.assign.valueExpression;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar context;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.indexOf(\"recordId\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval = val.replace(\"recordId\", recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(Data[recordId], val, function(expRes){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=expRes;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Assigning value: \"+val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!action.actions.assign.noPush && remoteRecord[prop] && remoteRecord[prop].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop].push(val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop]=(val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][remoteRecord.recordId]=(remoteRecord);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[remoteRecord.recordId]=remoteRecord;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.evalExpression){//if evalExpression like array.reduce\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=action.actions.assign.evalExpression;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.expression && typeof val.expression==\"object\"){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp=evalExpression(val.expression.operator,val.expression.values);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Assigning value: \"+temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!action.actions.assign.noPush && remoteRecord[prop] && remoteRecord[prop].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop].push(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop]=(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][remoteRecord.recordId]=(remoteRecord);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[remoteRecord.recordId]=remoteRecord;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction evalExpression(operator,values){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(Array.isArray(values) && values.length==2 && operator){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar newVal=[];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues.forEach(function(value){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(value);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(typeof value==\"object\" && value.expression){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewVal.push(evalExpression(value.expression.operator,value.expression.values));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(value.indexOf(\"recordId\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue = value.replace(\"recordId\", recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(Data[recordId], value, function(expRes){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewVal.push(expRes);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnewVal.push(value)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp=(newVal[0]+operator+newVal[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn(eval(temp));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}catch(err){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.hasOwnProperty(\"emptyValue\")){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Empty Value\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(action.actions.assign.emptyValue);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop]=action.actions.assign.emptyValue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][remoteRecord.recordId]=(remoteRecord);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[remoteRecord.recordId]=remoteRecord;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.hasOwnProperty(\"incrementValue\")){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"incrementValue\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(action.actions.assign.incrementValue);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isNaN(remoteRecord[prop])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop]=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop]=remoteRecord[prop]*1 + action.actions.assign.incrementValue*1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][remoteRecord.recordId]=(remoteRecord);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[remoteRecord.recordId]=remoteRecord;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.hasOwnProperty(\"struct\")){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * Updated for SupSideRFQ\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * D:10-05-2017\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"struct\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar struct=action.actions.assign.struct;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar jsnKys=Object.keys(struct);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar valJson={};\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprepareJson(0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction prepareJson(jsnIndx){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(jsnIndx<jsnKys.length){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar val=struct[jsnKys[jsnIndx]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.indexOf(\"recordId\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval = val.replace(\"recordId\", recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(Data[recordId], val, function(expRes){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=expRes;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Assigning value: \"+val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalJson[jsnKys[jsnIndx]]=val;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprepareJson(jsnIndx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Done creating Struct\", valJson);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(remoteRecord[prop] && remoteRecord[prop].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop].push(valJson);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoteRecord[prop]=(valJson);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][remoteRecord.recordId]=(remoteRecord);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[remoteRecord.recordId]=remoteRecord;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t//if modifying current Document\n\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign){//Code added D:28-10-2015//\n\n\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.assign.constructor==Array){//Added to support multiple assigning D:04-07-2016\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar record=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'] [Data[triggerDoc.schemas.sourceSchema]['recordId']]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data['update'] [Data[triggerDoc.schemas.sourceSchema]['recordId']];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!record){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar assigns = action.actions.assign;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar assignsLen = assigns.length;\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocessAssigns(0);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t\t\t * Adding code for multiple assign operations in after save\n\t\t\t\t\t\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction processAssigns(assignInd){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(assignInd>=assignsLen){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Assigning operations are done.\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=(record);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);//Going for next action\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar assignProp = assigns[assignInd]['property'];//visibility\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar assignVal = assigns[assignInd]['value'];//author\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Getting expEval\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(assignVal.indexOf(\"+\")==-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(record, assignVal, function(val){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"assigned: \"+val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhile(val.constructor==String && val.indexOf(\"\\\"\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval = val.replace(\"\\\"\",\"\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"assigned revised: \"+val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Patch Added on D: 4th Feb, 2016\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(record[assignProp] && record[assignProp].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.constructor==Array){//Added on 22-03-2016, Not to push duplicate values\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Value array and property array\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval.forEach(function(v){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(record[assignProp].indexOf(v));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[assignProp].indexOf(v)==-1?record[assignProp].push(v):'';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Value string and property array\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(record[assignProp].indexOf(val)==-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Not found, so pushing\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[assignProp].push(val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"val exists...\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[assignProp]=val;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessAssigns(assignInd+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessComboProp(record, assignVal, function(finalVal){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"final value: \"+finalVal);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(record[assignProp] && record[assignProp].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(finalVal.constructor==Array){//Added on 22-03-2016, Not to push duplicate values\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Value array and property array\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfinalVal.forEach(function(v){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(record[assignProp].indexOf(v));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[assignProp].indexOf(v)==-1?record[assignProp].push(v):'';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Value string and property array\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(record[assignProp].indexOf(finalVal)==-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Not found, so pushing\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[assignProp].push(finalVal);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"val exists...\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[assignProp]=finalVal;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessAssigns(assignInd+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t\t\t * end of multiple assign operations in after save\n\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.hasOwnProperty(\"emptyValue\")){\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Empty Value\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(action.actions.assign.emptyValue);\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar record=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'] [record.recordId] ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data['update'][record.recordId];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!record){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property]=action.actions.assign.emptyValue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Data['update'].push(remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=(record);\n\t\t\t\t\t\t\t\t\t\t\t\t\tData[record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+record.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.hasOwnProperty(\"valueExpression\")){\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar record=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'] [record.recordId] ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data['update'][record.recordId];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!record){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar val=action.actions.assign.valueExpression;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.indexOf(\"recordId.\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tval = val.replace(\"recordId\", recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(Data[recordId], val, function(expRes){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=expRes;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Assigning value: \"+val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!action.actions.assign.noPush && record[prop] && record[prop].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property].push(val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property]=(val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=(record);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+record.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(val.indexOf(\"Schema@\")>-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.split(\".\").length==2){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar schma= val.split(\".\")[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tschma=schma.split(\"@\")[1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property] = eval(val.replace(\"Schema@\"+schma, \"Data['\"+schma+\"']\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if((recProps[recKeys[rpI]]).split(\".\").length==1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar schma= val.split(\".\")[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tschma=schma.split(\"@\")[1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property] = eval(val.replace(\"Schema@\"+schma, \"Data['\"+schma+\"']\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=(record);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(val.indexOf(\"store\")>-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property] = eval(val.replace(\"store\", \"Data['store']\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=(record);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.hasOwnProperty(\"incrementValue\")){\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"incrementValue\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(action.actions.assign.incrementValue);\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar record=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'] [record.recordId] ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data['update'][record.recordId];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!record){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(isNaN(record[action.actions.assign.property])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property]=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\trecord[action.actions.assign.property]=record[action.actions.assign.property]*1+action.actions.assign.incrementValue*1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Data['update'].push(remoteRecord.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=(record);\n\t\t\t\t\t\t\t\t\t\t\t\t\tData[record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+record.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.assign.hasOwnProperty(\"struct\")){\n\t\t\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t\t\t * Updated for SupSideRFQ\n\t\t\t\t\t\t\t\t\t\t\t\t\t * D:10-05-2017\n\t\t\t\t\t\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"struct\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar prop = action.actions.assign.property;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar record=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'] [record.recordId] ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data['update'][record.recordId];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!record){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar struct=action.actions.assign.struct;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar jsnKys=Object.keys(struct);\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar valJson={};\n\t\t\t\t\t\t\t\t\t\t\t\t\tprepareJson(0);\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction prepareJson(jsnIndx){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(jsnIndx<jsnKys.length){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar val=struct[jsnKys[jsnIndx]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.indexOf(\"recordId\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval = val.replace(\"recordId\", recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(Data[recordId], val, function(expRes){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=expRes;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Assigning value: \"+val);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalJson[jsnKys[jsnIndx]]=val;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprepareJson(jsnIndx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Done creating Struct\", valJson);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(record[prop] && record[prop].constructor==Array){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[prop].push(valJson);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[prop]=(valJson);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=(record);\n\t\t\t\t\t\t\t\t\t\t\t\t\tData[record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Remote record id: \"+record.recordId);\n\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t//triggerDoc: triggerToSaveMessage, below code is to support legacy trigger documents\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar property = action.actions.assign.property;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar val = action.actions.assign.value.split(\".\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar record=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'] [record.recordId] ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data['update'][record.recordId];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!record){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(property.indexOf(\"->\")==-1 && property.indexOf('recordId')!=-1 && property.split(\".\").length==2){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar kys = property.split(\".\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(val.length==2){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[kys[1]]= Data[val[0]][val[1]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"else val[0]: \"+val[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[kys[1]]= val[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[triggerDoc.schemas.sourceSchema]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"record id: \"+record['recordId']);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//May be we are missing retrieving value from a relation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"need to write more logic to handle property like recordId.xxx or not, currently ingnoring and processing for next\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//if delete action is set\n\t\t\t\t\t\t\t\t\t\tif(action.actions && action.actions.delete){\n\t\t\t\t\t\t\t\t\t\t\tvar delData = action.actions.delete;\n\t\t\t\t\t\t\t\t\t\t\tvar qry = {\"select\": [\"recordId\"], \"from\": \"records\",\"where\": delData };\n\t\t\t\t\t\t\t\t\t\t\tconstructN1QL(qry, Data['recordId'], function(finalQry){\n\t\t\t\t\t\t\t\t\t\t\t\tCouchBaseUtil.executeViewInContentBucket(finalQry,{parameters:[]}, function(queryResult){\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(queryResult);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(queryResult && queryResult.length>0 && queryResult[0].recordId){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGenericRecordServer.removeRecord(request,queryResult[0].recordId,function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Record Deleted: \"+(queryResult[0].recordId));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Record not found\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//Write Service Invocation code here\n\t\t\t\t\t\t\t\t\t\tif(action.actions && action.actions.invokeService){\n\t\t\t\t\t\t\t\t\t\t\tvar serviceName=action.actions.invokeService.serviceName;\n\t\t\t\t\t\t\t\t\t\t\tif(serviceName==\"RestApiService\"){\n\t\t\t\t\t\t\t\t\t\t\t\tvar serviceDoc = action.actions.invokeService.serviceDoc;\n\t\t\t\t\t\t\t\t\t\t\t\tvar record=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\tif(Data['update'] [record.recordId] ){\n\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data['update'][record.recordId];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(!record){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif(serviceDoc.apiEndPointURL){\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar restApiDoc = {};\n\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['parameters']={};\n\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['path']={};\n\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['data']={};\n\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['options']={};\n\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['method']=\"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['apiEndPoint']=serviceDoc.apiEndPointURL+\n\t\t\t\t\t\t\t\t\t\t\t\t\t(action.actions.invokeService.path==\"/\" ? \"\":action.actions.invokeService.path);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tserviceDoc.pathAndParams.forEach(function(pathAndParam){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(pathAndParam.path==action.actions.invokeService.path){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['method']=pathAndParam.method;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*Path parameters, if any*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpathAndParam.pathParams.forEach(function(pathParam){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(pathParam.key && pathParam.value){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(pathParam.value.indexOf(record['docType'])!=-1 && pathParam.value.indexOf(\".\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Fetching value from the record\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['path'][pathParam.key]=record[pathParam.value.split(\".\")[1]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['path'][pathParam.key]=pathParam.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpathAndParam.queryParams.forEach(function(queryParam){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(queryParam.key && queryParam.value){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(queryParam.value.indexOf(record['docType'])!=-1 && queryParam.value.indexOf(\".\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Fetching value from the record\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['parameters'][queryParam.key]=record[queryParam.value.split(\".\")[1]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['parameters'][queryParam.key]=queryParam.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*Checking for post data*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar postData={};\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpathAndParam.data.forEach(function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprepareJsonForRestAPI(data, postData, function(finalTempJson){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Final Temp Json\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(finalTempJson);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tObject.keys(postData).forEach(function(dataKey){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treplaceWithValue(record, postData[dataKey], function(d){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostData[dataKey]=d;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t logger(\"d\");logger(d);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t logger(\"PostData: \");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t logger(JSON.stringify(postData));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpathAndParam.data.forEach(function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(data.key && data.value){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(data.value.indexOf(record['docType'])!=-1 && data.value.indexOf(\".\")!=-1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Fetching value from the record\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['data'][data.key]=record[data.value.split(\".\")[1]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['data'][data.key]=data.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tserviceDoc.otherConfigs.forEach(function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(data.key && data.value){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(data.useAsInParam){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Fetching value from the record\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['parameters'][data.key]=record[data.value.split(\".\")[1]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(data.username || data.user){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['options']['user']=data.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trestApiDoc['options'][data.key]=data.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRestApiController.invokeRestApiService(restApiDoc, function(res){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(res);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//need to write logic to store result in properties of record.\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.invokeService.result.length){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taction.actions.invokeService.result.forEach(function(mapJ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(mapJ.prop && mapJ.parseAs){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar val=JSON.parse(JSON.stringify(res));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmapJ.parseAs.split(\".\").forEach(function(parse){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tval=val[parse];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord[mapJ.prop]=val;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['update'][record.recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tData[recordId]=record;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"Modified Record:\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(JSON.stringify(record));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Just for testing we are not invoking rest api\n\t\t\t\t\t\t\t\t\t\t\t\t\t//doAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Code for error message\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t}//Need to write for another service\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif(action.actions && action.actions.email){\n\t\t\t\t\t\t\t\t\t\t\tif(action.actions.email.to &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tArray.isArray(action.actions.email.to) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\taction.actions.email.values &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tArray.isArray(action.actions.email.values) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\taction.actions.email.message &&\n\t\t\t\t\t\t\t\t\t\t\t\t\taction.actions.email.subject){\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"EMAIL TRIGGER\");\n\t\t\t\t\t\t\t\t\t\t\t\tvar context=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\tvar to=[];\n\t\t\t\t\t\t\t\t\t\t\t\tvar values=[];\n\t\t\t\t\t\t\t\t\t\t\t\tvar message=action.actions.email.message;\n\t\t\t\t\t\t\t\t\t\t\t\tvar subject=action.actions.email.subject;\n\t\t\t\t\t\t\t\t\t\t\t\tprocessEmailTo();\n\t\t\t\t\t\t\t\t\t\t\t\tfunction processEmailTo(){\n\t\t\t\t\t\t\t\t\t\t\t\t\tpeto(0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction peto(ptoi){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(ptoi<action.actions.email.to.length){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(context, action.actions.email.to[ptoi], function(ptovalue){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(Array.isArray(ptovalue)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<ptovalue.length;i++){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto.push(ptovalue[i].replace(/\\\"$/,\"\").replace(/^\\\"/,\"\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto.push(ptovalue.replace(/\\\"$/,\"\").replace(/^\\\"/,\"\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpeto(ptoi+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessEmailValues();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tfunction processEmailValues(){\n\t\t\t\t\t\t\t\t\t\t\t\t\tpev(0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction pev(pvi){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(pvi<action.actions.email.values.length){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(context, action.actions.email.values[pvi], function(pvvalue){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues.push(pvvalue.replace(/\\\"$/,\"\").replace(/^\\\"/,\"\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpev(pvi+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessMessage();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tfunction processMessage(){\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar dollarSigns=message.match(/\\$\\d/g);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(dollarSigns)\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<dollarSigns.length;i++){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmessage=message.replace(new RegExp(\"\\\\\"+dollarSigns[i],\"g\"),values[(dollarSigns[i].replace(\"$\",\"\")*1)-1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdollarSigns=subject.match(/\\$\\d/g);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(dollarSigns)\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<dollarSigns.length;i++){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubject=subject.replace(new RegExp(\"\\\\\"+dollarSigns[i],\"g\"),values[(dollarSigns[i].replace(\"$\",\"\")*1)-1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar mailData={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom:\"cloudseed \"+\" <[email protected]>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tto:to,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubject:subject,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//text:message,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thtml:message\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire('../services/clsMailgun.js').getMailgun().messages().send(mailData, function (err, result) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(err);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"email sent\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif(action.actions && action.actions.box){\n\t\t\t\t\t\t\t\t\t\t\tif(action.actions.box.action &&\n\t\t\t\t\t\t\t\t\t\t\t\t\taction.actions.box.data &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t!Array.isArray(action.actions.box.data) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\ttypeof action.actions.box.data==\"object\" ){\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"BOX TRIGGER\");\n\t\t\t\t\t\t\t\t\t\t\t\tvar context=Data[triggerDoc.schemas.sourceSchema];\n\t\t\t\t\t\t\t\t\t\t\t\tvar data={};\n\t\t\t\t\t\t\t\t\t\t\t\tdata.action=action.actions.box.action\n\t\t\t\t\t\t\t\t\t\t\t\tprocessTo();\n\t\t\t\t\t\t\t\t\t\t\t\tfunction processTo(){\n\t\t\t\t\t\t\t\t\t\t\t\t\tpto(0);\n\t\t\t\t\t\t\t\t\t\t\t\t\tfunction pto(ptoi){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(ptoi<Object.keys(action.actions.box.data).length){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpEvaluator(context,action.actions.box.data[Object.keys(action.actions.box.data)[ptoi]], function(ptovalue){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata[Object.keys(action.actions.box.data)[ptoi]]=ptovalue.replace(/\\\"$/,\"\").replace(/^\\\"/,\"\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpto(ptoi+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessAPI();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tfunction processAPI(){\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire('../services/Box_com_API.js').service(data, function (err, result) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\n\n\t\t\t\t\t\t\t\t\t\tif(action.actions && action.actions.redirect){\n\t\t\t\t\t\t\t\t\t\t\tvar redirectKeys = Object.keys(action.actions.redirect);\n\t\t\t\t\t\t\t\t\t\t\tvar rKeysLen = redirectKeys.length;\n\t\t\t\t\t\t\t\t\t\t\tfor(var i=0;i<rKeysLen;i++){\n\t\t\t\t\t\t\t\t\t\t\t\tvar key = action.actions.redirect[redirectKeys[i]]\n\t\t\t\t\t\t\t\t\t\t\t\tResultData[redirectKeys[i]]=Data[key];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tlogger(ResultData);\n\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif(action.actions && action.actions.n1ql){\n\t\t\t\t\t\t\t\t\t\t\tvar qry=action.actions.n1ql.query;\n\t\t\t\t\t\t\t\t\t\t\tconstructN1QL(qry, Data['recordId'], function(finalQry){\n\t\t\t\t\t\t\t\t\t\t\t\tif(qry.from == \"records\"){\n\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"final query: \", finalQry);\n\t\t\t\t\t\t\t\t\t\t\t\t\tCouchBaseUtil.executeViewInContentBucket(finalQry,{parameters:[]}, function(queryResult){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"query results: \", queryResult);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.n1ql.if &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taction.actions.n1ql.if.cond\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& eval(action.actions.n1ql.if.cond)){\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.n1ql.if.store){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tData['store']=eval(action.actions.n1ql.if.store);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar crJson=action.actions.n1ql.if.create;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(crJson){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreateNSetProps(crJson, function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"n1ql if eval done\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(action.actions.n1ql.else){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar elseJson = action.actions.n1ql.else;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(elseJson){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tprocessElse(elseJson, function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogger(\"n1ql if eval done\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(action.actions.n1ql.store){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry{Data['store']=eval(action.actions.n1ql.store);}catch(err){}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tlogger(\"No actions are configured, invoking next action. or conditions evaluation result is false\");\n\t\t\t\t\t\t\t\t\t\tdoAction(indx+1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "deb252752bb2dad133bb9c97dc63f2d7", "score": "0.41537327", "text": "function _process(data) {\n for (let item of data) {\n let parser = new DOMParser;\n let dom = parser.parseFromString('<!doctype html><body>' + item.body, 'text/html');\n item.body = dom.body.textContent;\n\n // extract keywords\n let keywords = []\n for (let word_block of item.keywords.split(\", \")) {\n let words = word_block.replace(\"(\", \"\").replace(\")\", \"\").split(\" \")\n for (let word of words) keywords.push(word)\n }\n item.keywords = keywords\n\n // create dictionary for faster lookup\n let dict = {}\n for (let word of item.keywords) dict[word] = true;\n item.keywordsDict = dict\n\n // assumption is made that titles are unique\n // base64 of title is used as uid for object\n item.uid = btoa(item.title)\n }\n return data;\n}", "title": "" }, { "docid": "4e59619ef43ecb95708ca1e35370a62e", "score": "0.41409665", "text": "function processSubmission(submission) {\r\n var request = $http({\r\n method: 'POST',\r\n url: API_URL + '/v3/submissions/' + submission.id + '/process/',\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n data: angular.toJson({\r\n param: submission\r\n })\r\n });\r\n return _processRequest(request);\r\n }", "title": "" }, { "docid": "98015ec7bdd27b888708b55c297a7c73", "score": "0.4109011", "text": "static getProcesses(bpmnJSON) {\n return bpmnJSON.definitions.process;\n }", "title": "" }, { "docid": "5bd072ca667e0b2713cf6a468f67f33c", "score": "0.41066715", "text": "function createBatch(base, props) {\n const registrationPromises = [];\n const completePromises = [];\n const requests = [];\n const batchId = getGUID();\n const batchQuery = new batching_BatchQueryable(base);\n // this query is used to copy back the behaviors after the batch executes\n // it should not manipulated or have behaviors added.\n const refQuery = new batching_BatchQueryable(base);\n const { headersCopyPattern } = {\n headersCopyPattern: /Accept|Content-Type|IF-Match/i,\n ...props,\n };\n const execute = async () => {\n await Promise.all(registrationPromises);\n if (requests.length < 1) {\n // even if we have no requests we need to await the complete promises to ensure\n // that execute only resolves AFTER every child request disposes #2457\n // this likely means caching is being used, we returned values for all child requests from the cache\n return Promise.all(completePromises).then(() => void (0));\n }\n const batchBody = [];\n let currentChangeSetId = \"\";\n for (let i = 0; i < requests.length; i++) {\n const [, url, init] = requests[i];\n if (init.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n // end an existing change set\n batchBody.push(`--changeset_${currentChangeSetId}--\\n\\n`);\n currentChangeSetId = \"\";\n }\n batchBody.push(`--batch_${batchId}\\n`);\n }\n else {\n if (currentChangeSetId.length < 1) {\n // start new change set\n currentChangeSetId = getGUID();\n batchBody.push(`--batch_${batchId}\\n`);\n batchBody.push(`Content-Type: multipart/mixed; boundary=\"changeset_${currentChangeSetId}\"\\n\\n`);\n }\n batchBody.push(`--changeset_${currentChangeSetId}\\n`);\n }\n // common batch part prefix\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n // these are the per-request headers\n const headers = new Headers(init.headers);\n // this is the url of the individual request within the batch\n const reqUrl = isUrlAbsolute(url) ? url : combine(batchQuery.requestBaseUrl, url);\n if (init.method !== \"GET\") {\n let method = init.method;\n if (headers.has(\"X-HTTP-Method\")) {\n method = headers.get(\"X-HTTP-Method\");\n headers.delete(\"X-HTTP-Method\");\n }\n batchBody.push(`${method} ${reqUrl} HTTP/1.1\\n`);\n }\n else {\n batchBody.push(`${init.method} ${reqUrl} HTTP/1.1\\n`);\n }\n // lastly we apply any default headers we need that may not exist\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;charset=utf-8\");\n }\n // write headers into batch body\n headers.forEach((value, name) => {\n if (headersCopyPattern.test(name)) {\n batchBody.push(`${name}: ${value}\\n`);\n }\n });\n batchBody.push(\"\\n\");\n if (init.body) {\n batchBody.push(`${init.body}\\n\\n`);\n }\n }\n if (currentChangeSetId.length > 0) {\n // Close the changeset\n batchBody.push(`--changeset_${currentChangeSetId}--\\n\\n`);\n currentChangeSetId = \"\";\n }\n batchBody.push(`--batch_${batchId}--\\n`);\n const responses = await spPost(batchQuery, {\n body: batchBody.join(\"\"),\n headers: {\n \"Content-Type\": `multipart/mixed; boundary=batch_${batchId}`,\n },\n });\n if (responses.length !== requests.length) {\n throw Error(\"Could not properly parse responses to match requests in batch.\");\n }\n return new Promise((res, rej) => {\n try {\n for (let index = 0; index < responses.length; index++) {\n const [, , , resolve, reject] = requests[index];\n try {\n resolve(responses[index]);\n }\n catch (e) {\n reject(e);\n }\n }\n // this small delay allows the promises to resolve correctly in order by dropping this resolve behind\n // the other work in the event loop. Feels hacky, but it works so 🤷\n setTimeout(res, 0);\n }\n catch (e) {\n setTimeout(() => rej(e), 0);\n }\n }).then(() => Promise.all(completePromises)).then(() => void (0));\n };\n const register = (instance) => {\n instance.on.init(function () {\n if (isFunc(this[RegistrationCompleteSym])) {\n throw Error(\"This instance is already part of a batch. Please review the docs at https://pnp.github.io/pnpjs/concepts/batching#reuse.\");\n }\n // we need to ensure we wait to start execute until all our batch children hit the .send method to be fully registered\n registrationPromises.push(new Promise((resolve) => {\n this[RegistrationCompleteSym] = resolve;\n }));\n return this;\n });\n instance.on.pre(async function (url, init, result) {\n // Do not add to timeline if using BatchNever behavior\n if (hOP(init.headers, \"X-PnP-BatchNever\")) {\n // clean up the init operations from the timeline\n // not strictly necessary as none of the logic that uses this should be in the request, but good to keep things tidy\n if (typeof (this[RequestCompleteSym]) === \"function\") {\n this[RequestCompleteSym]();\n delete this[RequestCompleteSym];\n }\n this.using(CopyFrom(refQuery, \"replace\", (k) => /(init|pre)/i.test(k)));\n return [url, init, result];\n }\n // the entire request will be auth'd - we don't need to run this for each batch request\n this.on.auth.clear();\n // we replace the send function with our batching logic\n this.on.send.replace(async function (url, init) {\n // this is the promise that Queryable will see returned from .emit.send\n const promise = new Promise((resolve, reject) => {\n // add the request information into the batch\n requests.push([this, url.toString(), init, resolve, reject]);\n });\n this.log(`[batch:${batchId}] (${(new Date()).getTime()}) Adding request ${init.method} ${url.toString()} to batch.`, 0);\n // we need to ensure we wait to resolve execute until all our batch children have fully completed their request timelines\n completePromises.push(new Promise((resolve) => {\n this[RequestCompleteSym] = resolve;\n }));\n // indicate that registration of this request is complete\n this[RegistrationCompleteSym]();\n return promise;\n });\n this.on.dispose(function () {\n if (isFunc(this[RegistrationCompleteSym])) {\n // if this request is in a batch and caching is in play we need to resolve the registration promises to unblock processing of the batch\n // because the request will never reach the \"send\" moment as the result is returned from \"pre\"\n this[RegistrationCompleteSym]();\n // remove the symbol props we added for good hygene\n delete this[RegistrationCompleteSym];\n }\n if (isFunc(this[RequestCompleteSym])) {\n // let things know we are done with this request\n this[RequestCompleteSym]();\n delete this[RequestCompleteSym];\n // there is a code path where you may invoke a batch, say on items.add, whose return\n // is an object like { data: any, item: IItem }. The expectation from v1 on is `item` in that object\n // is immediately usable to make additional queries. Without this step when that IItem instance is\n // created using \"this.getById\" within IITems.add all of the current observers of \"this\" are\n // linked to the IItem instance created (expected), BUT they will be the set of observers setup\n // to handle the batch, meaning invoking `item` will result in a half batched call that\n // doesn't really work. To deliver the expected functionality we \"reset\" the\n // observers using the original instance, mimicing the behavior had\n // the IItem been created from that base without a batch involved. We use CopyFrom to ensure\n // that we maintain the references to the InternalResolve and InternalReject events through\n // the end of this timeline lifecycle. This works because CopyFrom by design uses Object.keys\n // which ignores symbol properties.\n this.using(CopyFrom(refQuery, \"replace\", (k) => /(auth|pre|send|init|dispose)/i.test(k)));\n }\n });\n return [url, init, result];\n });\n return instance;\n };\n return [register, execute];\n}", "title": "" }, { "docid": "79914fdcd5186dd04a4c95e5ec40d7ea", "score": "0.41058663", "text": "function shapePortingActionsForDisplay(portingActions) {\n portingActions.loadAudioLibraries.response = service.audioLibraries;\n var extensions = portingActions.loadExtensions.response;\n var destinations = portingActions.loadDestinations.response;\n var extensionsByDidProps = [\n \"number_alias\", \"outbound_caller_id_number\", \"effective_caller_id_number\"\n ];\n var extensionsByDid = usefulTools.arrayToObjectByProp(extensions, extensionsByDidProps);\n var destsByDestNum = usefulTools.arrayToObjectByProp(destinations, \"destination_number\");\n var extensionsByExtension = usefulTools.arrayToObjectByProp(extensions, \"extension\");\n var recordings = service.recordings;\n var displayContext = {\n service: {\n extensionsByDid: extensionsByDid,\n destinationsByDestinationNumber: destsByDestNum,\n extensionsByExtension: extensionsByExtension,\n recordings: recordings\n }\n };\n var actions = Object.values(portingActions).map(function(resourceGroup) {\n var action = resourceGroup.action;\n return resourceGroup.response.map(function(resource) {\n var actionData = displayTransferOption.call(displayContext, resource);\n if (actionData) {\n actionData.resourceUuid = getResourceUuid(resource);\n actionData.resource = resource;\n actionData.actionName = action.name;\n }\n return actionData;\n });\n });\n return _.flatten(actions).filter(Boolean);\n }", "title": "" }, { "docid": "94f4d6103dce3db9be60cb2d722e9d59", "score": "0.40977755", "text": "function processFilter(filter, processed) {\n // make sure all of our inputs have been processed\n\n filter.inputs.forEach(function (feedId) {\n\n var feed = feeds[feedId];\n\n if (typeof feed !== 'undefined' && typeof feed.filter !== 'undefined' && typeof processed[feed.filter] === 'undefined') {\n processFilter(filters[feed.filter], processed);\n\n }\n\n });\n\n // inputs ready, do actual processing\n\n var uris = filter.inputs.map(function (feedId) {\n var feed = feeds[feedId];\n if (typeof feed !== 'undefined') {\n return feeds[feedId].uri;\n }\n });\n\n fp.requestParallel(uris).then(\n function (responses) {\n var keepEvents = [];\n\n responses.forEach(function (response) {\n\n // TODO(twilde): check response's status code\n\n fp.extractEvents(response.body).forEach(function (eventText) {\n\n if (fp.filterEvent(eventText, filter.rules)) {\n keepEvents.push(eventText);\n }\n\n });\n\n });\n var cacheTarget = cachePath + '/' + filter._id + '.ical',\n cacheContent = icalTemplate(feeds[filter.output], keepEvents);\n console.log(cacheTarget);\n fs.writeFile(cacheTarget, cacheContent, function (error) {\n if (error !== null) {\n throw error;\n }\n });\n },\n function (error) {\n throw error; // TODO(twilde): better error handling?\n }\n );\n\n // must run, always\n processed[filter._id] = true;\n\n}", "title": "" }, { "docid": "f4c02387cbb40cb0d9901011d62e56b3", "score": "0.40924343", "text": "function getSupportedPages(){\n return [\n {\n displayName: \"Money Saving Mom\",\n submissionUrl: 'http://moneysavingmom.com/submit-a-deal',\n formId: 'si_contact_form7',\n fieldIds: {\n firstName: 'si_contact_name7',\n lastName: null,\n email: 'si_contact_email7',\n subject: 'si_contact_subject7',\n url: 'si_contact_ex_field7_2',\n message: 'si_contact_ex_field7_1'\n }\n },\n {\n displayName: \"For The Mommas\",\n submissionUrl: 'http://forthemommas.com/how-to-contact-us',\n formId: 'gform_2',\n fieldIds: {\n firstName: 'input_2_1',\n lastName: null,\n email: 'input_2_2',\n subject: 'input_2_3',\n url: null,\n message: 'input_2_4'\n }\n },\n {\n displayName: \"Hip2Save\",\n submissionUrl: 'http://hip2save.com/contact/',\n formId: 'submitdealform',\n fieldIds: {\n firstName: 'Name',\n lastName: null,\n email: 'emailAddress',\n subject: 'DealSubject',\n url: 'Organization',\n message: 'comment'\n }\n },\n {\n displayName: \"Penny Pinchin' Mom\",\n submissionUrl: 'http://www.pennypinchinmom.com/contact-me/',\n formId: 'gform_3',\n fieldIds: {\n firstName: 'input_3_1_3',\n lastName: 'input_3_1_6',\n email: 'input_3_3',\n subject: null,\n url: null,\n message: 'input_3_4'\n }\n },\n {\n displayName: 'Passion For Savings',\n submissionUrl: 'http://www.passionforsavings.com/contact-us/',\n formId: 'gform_1',\n fieldIds: {\n firstName: 'input_1_4',\n lastName: null,\n email: 'input_1_5',\n subject: 'input_1_1',\n url: 'input_1_6',\n message: 'input_1_3'\n }\n }\n ]\n\n\n // // Template\n // {\n // displayName: null,\n // submissionUrl: null,\n // formId: null,\n // fieldIds: {\n // firstName: null,\n // lastName: null,\n // email: null,\n // subject: null,\n // url: null,\n // message: null\n // }\n // }\n}", "title": "" }, { "docid": "a54e4bbb32b46d01b3f1d68f3095eb8c", "score": "0.408494", "text": "buildInfoToPost(){\n \t\tconst {formInput} = this.state;\n \t\tvar modelType = this.state.modelType;\n\n \t\t//Make modelType plural\n \t\tif(modelType != 'series'){\n \t\t\tmodelType += \"s\";\n \t\t}\n\n \t\tthis.state.infoToPost['type'] = modelType;\n \t\tthis.state.infoToPost['attributes'] = {};\n \t\tthis.state.infoToPost['relationships'] = {};\n\n \t\tfor(var key in formInput){\n \t\t\t// skip loop cycle if the property is from prototype or field is \"\"\n \t\t\tif (!formInput.hasOwnProperty(key)) \n\t\t \tcontinue;\n\n\t\t if(key === 'series' ||\n\t\t key === 'comics' \t||\n\t\t key === 'characters' ||\n\t\t key === 'creators' ||\n\t\t key === 'events'){\n\t\t \tvar connectionSet = new Set(formInput[key].split(\", \"));\n\t\t \tvar data = [];\n\t\t \tfor(let id of connectionSet){\n\t\t \t\tdata.push({id: id, type: key});\n\t\t \t}\n\n\t\t \t//Comics does not have a num_series attribute, always 1\n\t\t \tif(key === 'series' && modelType === 'comics'){\n\t\t \t\tif(connectionSet.has(\"\"))\n\t\t \t\t\tdelete this.state.infoToPost.relationships[key];\n\t\t \t\telse\n\t\t \t\t\tthis.state.infoToPost.relationships[key] = {data: data};\n\t\t \t}\n\t\t \telse{\n\t\t \t\tif(connectionSet.has(\"\")){\n\t\t \t\t\tthis.state.infoToPost.attributes['num_' + key] = 0;\n\t\t \t\t\tdelete this.state.infoToPost.relationships[key];\n\t\t \t\t}\n\t\t \t\telse{\n\t\t \t\t\tthis.state.infoToPost.attributes['num_' + key] = connectionSet.size;\n\t\t \t\t\tthis.state.infoToPost.relationships[key] = {data: data};\n\t\t \t\t}\n\t\t \t}\n\t\t }\n\t\t else{\n\t\t \tif(this.state.formInput[key] != \"\")\n\t\t \t\tthis.state.infoToPost.attributes[key] = this.state.formInput[key];\n\t\t \telse if(key === 'price')\n\t\t \t\tthis.state.infoToPost.attributes[key] = 0;\n\t\t \telse\n\t\t \t\tthis.state.infoToPost.attributes[key] = null;\n\n\t\t }\n \t\t}\n \t}", "title": "" }, { "docid": "9602f3373a564d1cf08bf55e670d806a", "score": "0.40717337", "text": "explodeContentMap(contentMapping = '') {\n // Explode the contentMapping into nested objects.\n let maps = contentMapping.split(/\\r?\\n/);\n let contentTypes = [];\n let index = 0, line = '', urlPattern = null, i = 0, name = '', search = '';\n for (index in maps) {\n line = maps[index].split('|');\n if (line.length > 2) {\n urlPattern = line[0];\n name = line[1];\n search = line[2];\n let fields = [];\n let fieldname = '', fieldstart = '', fieldend = '', fielddateformat = '';\n for (i = 3; i < (line.length - 3); i+= 4) {\n fieldstart = line[i].trim();\n fieldend = line[i+1].trim();\n fieldname = line[i+2].trim();\n fielddateformat = line[i+3].trim();\n\n fields.push({ start: fieldstart, end: fieldend, name: fieldname, dateformat: fielddateformat });\n }\n\n contentTypes.push({ name: name, urlpattern: urlPattern, search: search, fields: fields });\n }\n }\n return contentTypes;\n }", "title": "" }, { "docid": "e55f9e0c0176847a5ade91fa9257bbce", "score": "0.40714523", "text": "catchAndWrapExecuteProcess () {\n let data = new FormData(document.querySelector(`#${FORM_WORKFLOW_ID}`));\n let toSendData = new FormData();\n let toFillWorkflow = this.state.workflow.json;\n\n // If mosaic unchecked, no key will be in FormData, TODO same exception for every boolean/checkbox values I guess\n if (!data.get('subset_WFS.mosaic')) {\n data.append('subset_WFS.mosaic', 'False');\n }\n for (let pair of data) {\n // if there is no dot, the input is deform related, leave it as is\n // but put it in the to be sent data\n if (pair[0].indexOf('.') === -1) {\n toSendData.append(pair[0], pair[1]);\n continue;\n }\n console.log('this pair', pair);\n let keys = pair[0].split('.');\n let tasks = toFillWorkflow.tasks;\n toFillWorkflow.parallel_groups.forEach((group) => {\n tasks = tasks.concat(group.tasks);\n });\n for (let i = 0, nb = tasks.length; i !== nb; i++) {\n // if the process identifier is not the same, we know it's not the right input\n if (tasks[i].inputs && tasks[i].identifier === keys[0]) {\n for (let inputName in tasks[i].inputs) {\n if (tasks[i].inputs.hasOwnProperty(inputName)) {\n if (inputName === keys[1]) {\n if (inputName === 'mosaic') {\n // mosaic value must always be a \"True\" of \"False\" string\n if (typeof (tasks[i].inputs[inputName]) === 'boolean') {\n tasks[i].inputs[inputName] = (pair[1] === true) ? 'True' : 'False';\n } else if (typeof (tasks[i].inputs[inputName]) === 'string') {\n tasks[i].inputs[inputName] = (pair[1] === 'True') ? 'True' : 'False';\n }\n } else {\n tasks[i].inputs[inputName] = pair[1];\n }\n }\n }\n }\n }\n }\n }\n let stringified = JSON.stringify(toFillWorkflow);\n toSendData.append('workflow_string', stringified);\n console.log('workflow json:', stringified);\n this.execute(toSendData);\n }", "title": "" }, { "docid": "8a347910b40d9ee7b2474ca048d3ecd8", "score": "0.4071212", "text": "function generateProcess(devProcess, peopleConfiguration, ticketsForEachSprints, startTimeOfWholeProcess, nbOfSprint) {\n const sprintInHours = 80;\n const workToDo = [\n { type: 'feature', amount: ticketsForEachSprints }\n ];\n const p = R.prop(R.__, devProcess);\n const store = {\n canWork: true,\n devProcess,\n workToDo: generateWork(workToDo),\n people: generatePeople(peopleConfiguration)\n };\n\n log('startNewSprint');\n\n return {\n render: () => render('.dev-process', template(wholeDevProcess, [store])),\n startProcess: () => {\n if ((Date.now() - startTimeOfWholeProcess) / 1000 <= nbOfSprint * 10) {\n asyncFunction(closeSprint, sprintInHours);\n }\n if ((Date.now() - startTimeOfWholeProcess) / 1000 <= (nbOfSprint - 1) * 10) {\n asyncFunction(newSprint, sprintInHours, ticketsForEachSprints);\n }\n\n findWorkToDo(R.filter(cur => cur.busy === false, store.people));\n },\n findTaskForPeople: person => {\n if (store.canWork === false) {\n return false;\n } else {\n let result = R.head(R.filter(cur => R.and(R.equals(cur.busy, false), R.includes(cur.status, person.statusToLookFor)), store.workToDo));\n\n\n if (R.isNil(result) && person.type === 'dev') {\n result = generateAdditionalWork('feature', R.length(store.workToDo));\n store.workToDo.push(result);\n\n const updatedPeople = R.evolve({\n busy: R.T,\n workOn: R.always(result.identifier),\n restingTime: R.add(addTime(person.startTime)),\n startTime: R.always(Date.now())\n }, person);\n const updatedTask = R.evolve({\n busy: R.T,\n restingTime: R.add(addTime(result.startTime)),\n startTime: R.always(Date.now())\n }, result);\n\n asyncFunction(finishWork, result.estimate, { person: updatedPeople, task: updatedTask });\n\n store.people = R.adjust(updatedPeople.index, R.always(updatedPeople), store.people);\n store.workToDo = R.adjust(updatedTask.index, R.always(updatedTask), store.workToDo);\n } else if (isNotNil(result)) {\n const updatedPeople = R.evolve({\n busy: R.T,\n workOn: R.always(result.identifier),\n restingTime: R.add(addTime(person.startTime)),\n startTime: R.always(Date.now())\n }, person);\n const updatedTask = R.evolve({\n busy: R.T,\n restingTime: R.add(addTime(result.startTime)),\n startTime: R.always(Date.now())\n }, result);\n\n asyncFunction(finishWork, result.estimate, { person: updatedPeople, task: updatedTask });\n\n store.people = R.adjust(updatedPeople.index, R.always(updatedPeople), store.people);\n store.workToDo = R.adjust(updatedTask.index, R.always(updatedTask), store.workToDo);\n }\n }\n },\n findPeopleForTask: task => {\n if (store.canWork === false) {\n return false;\n } else {\n const result = R.head(R.filter(cur => R.and(R.equals(cur.busy, false), R.includes(task.status, cur.statusToLookFor)), store.people));\n\n if (isNotNil(result)) {\n const updatedPeople = R.evolve({\n busy: R.T,\n workOn: R.always(task.identifier),\n restingTime: R.add(addTime(result.startTime)),\n startTime: R.always(Date.now())\n }, result);\n const updatedTask = R.evolve({\n busy: R.T,\n restingTime: R.add(addTime(task.startTime)),\n startTime: R.always(Date.now())\n }, task);\n\n asyncFunction(finishWork, task.estimate, { person: updatedPeople, task: updatedTask });\n\n store.people = R.adjust(updatedPeople.index, R.always(updatedPeople), store.people);\n store.workToDo = R.adjust(updatedTask.index, R.always(updatedTask), store.workToDo);\n }\n }\n },\n transition: (person, task) => {\n const newStatusAndEstimate = store.devProcess[task.status].finish(task.iteration);\n const updatedPeople = R.evolve({\n busy: R.F,\n workOn: R.always(null),\n busyTime: R.add(addTime(task.startTime)),\n startTime: R.always(Date.now())\n }, person);\n const updatedTask = R.evolve({\n busy: R.F,\n status: R.always(R.head(newStatusAndEstimate)),\n iteration: R.cond([\n [() => R.or(R.includes(R.head(newStatusAndEstimate), statusThatIncreaseIteration), R.includes(R.head(newStatusAndEstimate), task.previousStatuses)), R.inc],\n [() => R.includes(R.head(newStatusAndEstimate), statusThatResetIteration), R.always(0)],\n [R.T, R.identity]\n ]),\n previousStatuses: R.append(task.status),\n busyTime: R.add(addTime(person.startTime)),\n startTime: R.always(Date.now()),\n estimate: R.always(R.last(newStatusAndEstimate))\n }, task);\n\n store.people = R.adjust(updatedPeople.index, R.always(updatedPeople), store.people);\n store.workToDo = R.adjust(updatedTask.index, R.always(updatedTask), store.workToDo);\n\n if (store.canWork === false) {\n return false;\n } else {\n findWorkToDo([updatedPeople]);\n findPeopleToWork([updatedTask]);\n }\n },\n startNewSprint: nbTickets => {\n log('startNewSprint');\n const workToDo = [\n { type: 'feature', amount: nbTickets }\n ];\n store.canWork = true;\n store.workToDo = R.concat(store.workToDo, generateWork(workToDo, R.length(store.workToDo)));\n },\n closeSprint: () => {\n log('closeSprint');\n store.canWork = false;\n store.people = R.map(cur => R.evolve({\n busy: R.F,\n workOn: R.always(null),\n restingTime: R.add(addTime(cur.startTime)),\n startTime: R.always(Date.now())\n }, cur), store.people);\n store.workToDo = R.map(cur => R.evolve({\n busy: R.F,\n restingTime: R.add(addTime(cur.startTime)),\n startTime: R.always(Date.now())\n }, cur), store.workToDo);\n }\n };\n}", "title": "" }, { "docid": "1ce68ae1eec350a90c2d08160183493c", "score": "0.40557098", "text": "function processRecipe(body) {\n let imgURL = body['images'][0].hostedLargeUrl;\n\n let imageNode = document.createElement(\"img\");\n imageNode.src = imgURL;\n\n let cellNode = document.createElement(\"td\");\n let pNameNode = document.createElement(\"p\");\n pNameNode.append(\"Recipe name: \" + body['name']);\n cellNode.appendChild(pNameNode);\n\n let pIngredientsNode = document.createElement('p');\n pIngredientsNode.append(\"Recipe name: \" + body['name']);\n cellNode.appendChild(pIngredientsNode);\n cellNode.appendChild(imageNode);\n\n let rowNode = document.createElement(\"tr\");\n rowNode.appendChild(cellNode);\n}", "title": "" }, { "docid": "772029ab71b271281b7e0c2f0bea885a", "score": "0.4036961", "text": "function splitNewPartialEntries(match, newObjectArray, originalNewObjectArray, baseObjectArray) {\n\n var outputPartialObjectArray = {};\n var outputNewObjectArray = {};\n\n //console.log(match);\n\n _.map(match, function (value, matchKey) {\n\n outputPartialObjectArray[matchKey] = [];\n outputNewObjectArray[matchKey] = [];\n\n //Need to make sure all entries per src_id are only new.\n var newCheckArray = _.where(value, {\n dest: 'dest'\n });\n\n if (matchKey === 'demographics') {\n\n if (match[matchKey].match === 'new') {\n outputNewObjectArray[matchKey] = newObjectArray[matchKey];\n } else if (match[matchKey].match === 'partial') {\n\n //console.log(baseObjectArray)\n\n var partialOutput = {\n partial_entry: newObjectArray[matchKey][0],\n partial_match: match[matchKey],\n match_entry_id: baseObjectArray[matchKey][0]._id\n };\n\n var multiPartialOutput = {\n partial_entry: newObjectArray[matchKey][0],\n partial_matches: [{\n match_entry: baseObjectArray[matchKey][0]._id,\n match_object: match[matchKey]\n }]\n };\n\n //console.log(JSON.stringify(multiPartialOutput, null, 10));\n\n //outputPartialObjectArray[matchKey].push(partialOutput);\n outputPartialObjectArray[matchKey].push(multiPartialOutput);\n }\n\n } else {\n\n //If there are no dest records, everything is new.\n if (newCheckArray.length === 0) {\n\n if (newObjectArray[matchKey] === undefined) {\n outputNewObjectArray[matchKey] = [];\n } else {\n outputNewObjectArray[matchKey] = newObjectArray[matchKey];\n }\n }\n\n var groupCheckedArray = _.groupBy(newCheckArray, 'src_id');\n\n //if (matchKey === 'social_history') {\n // console.log(groupCheckedArray); \n //}\n\n _.each(groupCheckedArray, function (element, index) {\n var newElementArray = _.filter(element, function (elementItem, elementItemIndex) {\n if (elementItem.match === 'new') {\n return true;\n } else {\n return false;\n }\n });\n\n //Only valid entries (src_id) will have equal lengths\n //Everything else is a partial match as that is all that remains.\n\n //console.log(newElementArray.length);\n //console.log(element.length);\n\n if (newElementArray.length !== element.length) {\n //console.log(newObjectArray[matchKey]);\n if (newObjectArray[matchKey] !== undefined) {\n var partialEntry = newObjectArray[matchKey][index];\n\n //Need to pare down element object to just partial match entries.\n //For each partial, grab the associated target entry and source entry.\n //Return a big list of all matches.\n //This will result in too many partial source entries being persisted.\n //Must modify save logic to account for this.\n\n //console.log(element);\n\n var partialElementArray = _.filter(element, function (elementItem, elementItemIndex) {\n if (elementItem.match === 'partial') {\n return true;\n } else {\n return false;\n }\n });\n\n //console.log(matchKey);\n\n if (matchKey === 'procedures') {\n //console.log(partialElementArray);\n }\n\n var multiPartialOutput = {\n partial_entry: partialEntry,\n partial_matches: []\n };\n\n //console.log(partialElementArray.length);\n\n _.each(partialElementArray, function (partialElement, partialIndex) {\n\n if (matchKey === 'social_history') {\n //console.log(partialElementArray);\n }\n\n //---Dying between lines.\n var partialOutput = {\n partial_entry: partialEntry,\n partial_match: partialElement,\n match_entry_id: baseObjectArray[matchKey][partialElement.dest_id]._id\n };\n //outputPartialObjectArray[matchKey].push(partialOutput);\n //---\n\n var multiPartialMatch = {\n match_entry: baseObjectArray[matchKey][partialElement.dest_id]._id,\n match_object: partialElement\n };\n\n multiPartialOutput.partial_matches.push(multiPartialMatch);\n\n });\n\n //console.log(JSON.stringify(multiPartialOutput, null, 10));\n outputPartialObjectArray[matchKey].push(multiPartialOutput);\n\n }\n } else {\n if (newObjectArray[matchKey] !== undefined) {\n\n var outputNewEntry = originalNewObjectArray[matchKey][element[0].src_id];\n outputNewObjectArray[matchKey].push(outputNewEntry);\n }\n }\n\n });\n\n }\n\n });\n\n var returnObject = {\n newEntries: outputNewObjectArray,\n partialEntries: outputPartialObjectArray\n };\n\n return returnObject;\n\n }", "title": "" }, { "docid": "6f53124bbe52fbfe38bb65f265c3e80e", "score": "0.40294424", "text": "processDefinitions(driverFunc: Function, defsToProcess: Array<Object>, resolver: Object) {\n if (!Array.isArray(defsToProcess)) {\n throw new Error('Source definitions must be defined in an array');\n }\n\n // TODO: Test that this stores definitions\n defsToProcess.forEach((def) => {\n // Add the driver function to the source\n def.driverFunc = driverFunc;\n\n const item = new SourceDefinition(def);\n this.definitions.set(item.id, item);\n\n // TODO: Test that this is called\n if (resolver && typeof resolver.onAddDefinition === 'function') {\n resolver.onAddDefinition(item);\n }\n });\n }", "title": "" }, { "docid": "092aa2634db639cf03420e2829bd9f5d", "score": "0.40238586", "text": "function buildForm() {\n document.getElementById(\"abstract\").innerHTML = process[\"abstract\"];\n document.getElementById(\"input\").innerHTML = \"<h3>Input:</h3>\";\n\tdocument.getElementById(\"output\").innerHTML = \"\";\n\n var inputs = process.dataInputs, supported = true,\n sld = \"text/xml; subtype=sld/1.0.0\",\n input;\n for (var i=0,ii=inputs.length; i<ii; ++i) {\n input = inputs[i];\n if (input.complexData) {\n var formats = input.complexData.supported.formats;\n if (formats[\"application/wkt\"]) {\n addWKTInput(input);\n } else if (formats[\"text/xml; subtype=wfs-collection/1.0\"]) {\n addWFSCollectionInput(input);\n } else if (formats[\"image/tiff\"]) {\n addRasterInput(input);\n } else if (formats[sld]) {\n addXMLInput(input, sld);\n } else {\n supported = false;\n }\n } else if (input.boundingBoxData) {\n addBoundingBoxInput(input);\n } else if (input.literalData) {\n addLiteralInput(input);\n } else {\n supported = false;\n }\n if (input.minOccurs > 0) {\n document.getElementById(\"input\").appendChild(document.createTextNode(\"* \"));\n }\n }\n \n if (supported) {\n var executeButton = document.createElement(\"button\");\n executeButton.innerHTML = \"Execute\";\n document.getElementById(\"input\").appendChild(executeButton);\n executeButton.onclick = execute;\n } else {\n document.getElementById(\"input\").innerHTML = '<span class=\"notsupported\">' +\n \"Sorry, the WPS builder does not support the selected process.\" +\n \"</span>\";\n }\n }", "title": "" }, { "docid": "7798fec78a1be6d9fe4d18b6676451e8", "score": "0.40185952", "text": "function calculateData(data){\n \n for(var i=0; i<data.length; i++){\n data[i].path = data[i].path.split('/../../')[1];\n data[i].collectionCount = Object.keys(data[i].json).length;\n }\n\n var tasks = [\n { description: 'Indd -> Interchange: End to end tool', done: true },\n { description: 'Indd -> Interchange: Report tool', done: true },\n { description: 'Indd -> Interchange: Left-Right Headers & Release-Number', done: true },\n { description: 'Indd -> Interchange: Page numbers', done: true },\n { description: 'Indd -> Interchange: Page numbers tests', done: false },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 3', done: false },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 4', done: false },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 3', done: false },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 4', done: false },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 3', done: false },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 4', done: false },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 3', done: true },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 4', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 3', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 4', done: true },\n { description: 'Indd -> Interchange: Parsing Blockquotes', done: false },\n { description: 'Interchange -> Neptune: Treatise / Fascicles', done: true },\n { description: 'Interchange -> Neptune: Treatise / Fascicles DTD Validation', done: true },\n { description: 'Interchange -> Neptune: Treatise / Fascicles tests', done: true },\n { description: 'Interchange -> Neptune: FrontMatter', done: false },\n { description: 'Interchange -> Neptune: FrontMatter -> TOC levels', done: false },\n { description: 'Interchange -> Neptune: FrontMatter DTD Validation', done: false },\n { description: 'Interchange -> Neptune: FrontMatter tests', done: false },\n { description: 'Interchange -> Neptune: Detailed TOC', done: false },\n { description: 'Interchange -> Neptune: Detailed TOC DTD Validatiom', done: false },\n { description: 'Interchange -> Neptune: Detailed TOC tests', done: false },\n { description: 'Interchange -> Neptune: Table of Statutes', done: false },\n { description: 'Interchange -> Neptune: Table of Statutes DTD Validation', done: false },\n { description: 'Interchange -> Neptune: Table of Statutes tests', done: false },\n { description: 'Interchange -> Neptune: Index', done: false },\n { description: 'Interchange -> Neptune: Index DTD Validation', done: false },\n { description: 'Interchange -> Neptune: Index tests', done: false },\n { description: 'Interchange -> Neptune: Input/Output comparison report', done: false }\n ];\n\n var validations = [\n { document: '5996_JCQ_08-F02_MJ13.indd', description: 'Invalid TOC Level : \"1.\tTravail subordonné \" tagged as TM-A-', fix: 'Replace index level to TM-1-', accepted: false },\n { document: '6018-F0*.indd', description: 'Footnote/First page - Position of Note de remerciements - Invalid Page Numbers', fix: 'Move the note to the last content of the page', accepted: false }\n ];\n\n return { packages: data, tasks, validations };\n}", "title": "" }, { "docid": "7798fec78a1be6d9fe4d18b6676451e8", "score": "0.40185952", "text": "function calculateData(data){\n \n for(var i=0; i<data.length; i++){\n data[i].path = data[i].path.split('/../../')[1];\n data[i].collectionCount = Object.keys(data[i].json).length;\n }\n\n var tasks = [\n { description: 'Indd -> Interchange: End to end tool', done: true },\n { description: 'Indd -> Interchange: Report tool', done: true },\n { description: 'Indd -> Interchange: Left-Right Headers & Release-Number', done: true },\n { description: 'Indd -> Interchange: Page numbers', done: true },\n { description: 'Indd -> Interchange: Page numbers tests', done: false },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 3', done: false },\n { description: 'Indd -> Interchange: Treatise / Fascicles Parsing Package 4', done: false },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 3', done: false },\n { description: 'Indd -> Interchange: FrontMatter Parsing Package 4', done: false },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 3', done: false },\n { description: 'Indd -> Interchange: Detailed TOC Parsing Package 4', done: false },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 3', done: true },\n { description: 'Indd -> Interchange: Table of Statutes Parsing Package 4', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 1', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 2', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 3', done: true },\n { description: 'Indd -> Interchange: Index Parsing Package 4', done: true },\n { description: 'Indd -> Interchange: Parsing Blockquotes', done: false },\n { description: 'Interchange -> Neptune: Treatise / Fascicles', done: true },\n { description: 'Interchange -> Neptune: Treatise / Fascicles DTD Validation', done: true },\n { description: 'Interchange -> Neptune: Treatise / Fascicles tests', done: true },\n { description: 'Interchange -> Neptune: FrontMatter', done: false },\n { description: 'Interchange -> Neptune: FrontMatter -> TOC levels', done: false },\n { description: 'Interchange -> Neptune: FrontMatter DTD Validation', done: false },\n { description: 'Interchange -> Neptune: FrontMatter tests', done: false },\n { description: 'Interchange -> Neptune: Detailed TOC', done: false },\n { description: 'Interchange -> Neptune: Detailed TOC DTD Validatiom', done: false },\n { description: 'Interchange -> Neptune: Detailed TOC tests', done: false },\n { description: 'Interchange -> Neptune: Table of Statutes', done: false },\n { description: 'Interchange -> Neptune: Table of Statutes DTD Validation', done: false },\n { description: 'Interchange -> Neptune: Table of Statutes tests', done: false },\n { description: 'Interchange -> Neptune: Index', done: false },\n { description: 'Interchange -> Neptune: Index DTD Validation', done: false },\n { description: 'Interchange -> Neptune: Index tests', done: false },\n { description: 'Interchange -> Neptune: Input/Output comparison report', done: false }\n ];\n\n var validations = [\n { document: '5996_JCQ_08-F02_MJ13.indd', description: 'Invalid TOC Level : \"1.\tTravail subordonné \" tagged as TM-A-', fix: 'Replace index level to TM-1-', accepted: false },\n { document: '6018-F0*.indd', description: 'Footnote/First page - Position of Note de remerciements - Invalid Page Numbers', fix: 'Move the note to the last content of the page', accepted: false }\n ];\n\n return { packages: data, tasks, validations };\n}", "title": "" }, { "docid": "308f7715dada217f73cbfda697d1ed94", "score": "0.40184936", "text": "function processProvenance() {\n let rawdata;\n rawdata = fs.readFileSync(\"results/events.json\");\n let eventTypes = JSON.parse(rawdata);\n\n rawdata = fs.readFileSync(\"results/study/JSON/processed_results.json\");\n let results = JSON.parse(rawdata);\n\n rawdata = fs.readFileSync(\"results/study/JSON/study_participants.json\");\n let study_participants = JSON.parse(rawdata);\n\n rawdata = fs.readFileSync(\"results/study/JSON/participant_actions.json\");\n let provenance = JSON.parse(rawdata);\n\n //create events objects per participant;\n let events = [];\n\n provenance.map(participant => {\n participantEventArray = [];\n\n let r = results.find(r => r.data.workerID === participant.id);\n r.data.browsedAwayTime = 0;\n\n let p = study_participants.find(p => p.id === participant.id);\n\n participant.data.provGraphs.map(action => {\n //see if this a single event, or the start/end of a long event;\n let event = eventTypes[action.event];\n\n if (event && event.type === \"singleAction\") {\n //create copy of event template\n let eventObj = JSON.parse(JSON.stringify(eventTypes[action.event]));\n eventObj.label = action.event;\n eventObj.time = action.time;\n if (eventObj.label !== \"next\" && eventObj.label !== \"back\") {\n participantEventArray.push(eventObj);\n }\n } else {\n //at the start of an event;\n if (event && event.start.trim() == action.event.trim()) {\n let eventObj = JSON.parse(JSON.stringify(eventTypes[action.event]));\n eventObj.startTime = action.time;\n eventObj.task = action.task;\n\n //if this event started after the last task, ignore it;\n // if (Date.parse(eventObj.startTime)< Date.parse(r.data['S-task16'].startTime)){\n participantEventArray.push(eventObj);\n // }\n } else {\n //at the end of an event;\n //find the 'start' eventObj;\n let startObj = participantEventArray\n .filter(e => {\n let value =\n e.type === \"longAction\" &&\n Array.isArray(e.end) &&\n e.end.includes(action.event) &&\n (e.label === \"task\" ? e.task === action.task : true);\n return value;\n })\n .pop();\n if (startObj === undefined) {\n // console.log(\"could not find start event for \", action.event, action.task);\n } else {\n startObj.endTime = action.time;\n let minutesBrowsedAway =\n (Date.parse(startObj.endTime) - Date.parse(startObj.startTime)) /\n 1000 /\n 60;\n\n if (\n startObj.label === \"browse away\" &&\n startObj.task &&\n startObj.task[0] === \"S\"\n ) {\n //only adjust time for browse away events during task completions\n if (\n Date.parse(startObj.startTime) <\n Date.parse(r.data[\"S-task16\"].endTime)\n ) {\n if (minutesBrowsedAway < 50) {\n r.data.browsedAwayTime =\n r.data.browsedAwayTime + minutesBrowsedAway;\n\n //catch case where browse away is logged at several hours;\n r.data[startObj.task].minutesOnTask =\n Math.round(\n (r.data[startObj.task].minutesOnTask -\n minutesBrowsedAway) *\n 10\n ) / 10;\n }\n }\n }\n }\n }\n }\n });\n\n //update total on study time\n r.data.overallMinutesOnTask =\n r.data.overallMinutesToComplete - r.data.browsedAwayTime;\n //update total on participant_info\n p.data.minutesOnTask = r.data.overallMinutesOnTask;\n\n events.push({ id: participant.id, provEvents: participantEventArray });\n // console.log(participantEventArray.filter(e=>e.type === 'longAction' && e.endTime === undefined))\n });\n\n // console.log(events)\n fs.writeFileSync(\n \"results/study/JSON/provenance_events.json\",\n JSON.stringify(events)\n );\n console.log(\"exported provenance_events.json\");\n\n // console.log(events)\n fs.writeFileSync(\n \"results/study/JSON/provenance_processed_results.json\",\n JSON.stringify(results)\n );\n console.log(\"exported provenance_processed_results.json\");\n\n // console.log(events)\n fs.writeFileSync(\n \"results/study/JSON/provenance_study_participants.json\",\n JSON.stringify(study_participants)\n );\n console.log(\"exported provenance_study_participants.json\");\n}", "title": "" }, { "docid": "fa61bc759f39bd1f448b23080828bb25", "score": "0.4017919", "text": "function collectDataFromFields(){\n $(document).on(\"click\", \".cq-dialog-submit\", function () {\n var $multifields = $(\"[\" + DATA_EAEM_NESTED + \"]\");\n\n if(_.isEmpty($multifields)){\n return;\n }\n\n var $form = $(this).closest(\"form.foundation-form\"),\n $fieldSets;\n\n $multifields.each(function(i, multifield){\n $fieldSets = $(multifield).find(\"[class='coral-Form-fieldset']\");\n\n $fieldSets.each(function (counter, fieldSet) {\n collectNonImageFields($form, $(fieldSet), counter);\n\n collectImageFields($form, $(fieldSet), counter);\n });\n });\n });\n }", "title": "" }, { "docid": "8dde22aad2b55a0cbab1c32529959b0f", "score": "0.4017542", "text": "assembleFormatParse() {\n const formatParse = {};\n\n for (const field of keys(this._parse)) {\n const p = this._parse[field];\n\n if (accessPathDepth(field) === 1) {\n formatParse[field] = p;\n }\n }\n\n return formatParse;\n }", "title": "" }, { "docid": "3ac000f7bab71797363f616de0787ff0", "score": "0.40148845", "text": "function processData(data) {\n\n\t\t/* the purpose of process data */\n\t\t// parse data\n\t\t// map data out into the three parts needed\n\n\t\t\n\n\t\tconsole.log('data original ', data);\n\t\tvar newData = {};\n\t\tnewData.products = [];\n\n\t\t// iterate through the product list in case there are multiple products\n\t\t_.each(data, function(product, idx, list) {\n\t\t\tif (product.productDetails.childProducts) {\n\t\t\t\t// there are child products products\n\t\t\t\tconsole.log('there are child products');\n\t\t\t\tnewData.hasChildProducts = true;\n\n\t\t\t\t//child product usecase\n\t\t\t\t//pass in the product builder data multiple times and feed it into an array\n newData.products.push(productBuilder(product, data, product.id, 'master')); //<-- this is the master product/collection\n\n //these are the child products/member pages in collection\n _.each(product.productDetails.childProducts, function(elem, idx) {\n\t\t\t\t\tnewData.products.push(productBuilder(elem, data, product.id, 'inmaster'));\n\t\t\t\t});\n\n } else {\n\t\t\t\t// there are no child products\n\t\t\t\tconsole.log('there are NO child products');\n\t\t\t\tnewData.hasChildProducts = false;\n\t\t\t\t//pass in the product builder data once and feed it into an array of 1\n\n\t\t\t\tnewData.products.push(productBuilder(product, data, product.id, 'notmaster')); //single product\n\n\t\t\t}\n\t\t\t\n\t\t\tconsole.log('heres the new data', newData, newData.upccolorsize, newData.upccolorsize);\n\n\t\t});\n\n\n\t\treturn newData;\n\n\n\t}", "title": "" }, { "docid": "b3bb797e6b646828a5f3095336970d47", "score": "0.40062243", "text": "function _process(templates, params, cb) {\n const _templates = _.extend(templates, {}), // process template copies, not the originals\n tasks = {};\n\n _.keys(_templates).forEach(function (key) {\n tasks[key] = function (cb) {\n _templates[key].process(params, function (data) {\n cb(null, data);\n });\n };\n });\n\n async.parallel(tasks, function (err, results) {\n cb(results);\n });\n }", "title": "" }, { "docid": "d6f98eeffcbc7bf7f8cac516e575d5ee", "score": "0.40054843", "text": "function buildPreview(previewSequence) {\n\n// console.group('buildPreview');\n\n preview.steps = [];\n preview.existinglinks = [];\n\n // existing links at a given steps\n // [llstring, donenow]\n var links = [];\n\n $.each(previewSequence, function(sequenceIdx, planIDX) {\n\n var step = plan.steps[planIDX];\n var stepAnalysis = analysis.steps[planIDX];\n\n step.sequenceIdx = sequenceIdx;\n\n var portals = step.portals.split('|');\n\n// console.debug(planIDX,step);\n\n preview.steps[sequenceIdx] = {\n planIDX: planIDX,\n marker: portals[0].split(','),\n portals: {},\n crosslinks: {},\n droppedcrosslinks: [],\n droppedblockingfields: [],\n nolongerblockedlinks: [],\n links: links.slice(0),\n fields: [],\n wastedfields: [],\n blockingFields: {},\n blockedVertexes: [],\n farmKeys: null,\n badDestinationReasons: [],\n stops: {\n now: portals[0],\n past: [],\n future: [],\n }\n };\n\n if (sequenceIdx>0)\n {\n $.each(preview.steps[sequenceIdx-1].fields, function(index, prevField) {\n preview.steps[sequenceIdx].fields.push([prevField[0],false]);\n });\n }\n\n $.each(stepAnalysis.actions, function(actionIdx, action) {\n\n switch (action.type)\n {\n case 'keys':\n preview.steps[sequenceIdx].farmKeys = action.farm;\n break;\n\n case 'take-down':\n switch (action.reason)\n {\n case 'blocking-link':\n if (preview.steps[sequenceIdx].droppedcrosslinks.indexOf(action.link)==-1)\n {\n preview.steps[sequenceIdx].droppedcrosslinks.push(action.link);\n }\n\n var nolongerblockedlink = plan.steps[action.blockingIDX].portals.split('|').sort().join('|');\n\n if (preview.steps[sequenceIdx].nolongerblockedlinks.indexOf(nolongerblockedlink)==-1)\n {\n preview.steps[sequenceIdx].nolongerblockedlinks.push(nolongerblockedlink);\n }\n break;\n\n case 'blocking-field':\n if (preview.steps[sequenceIdx].droppedblockingfields.indexOf(action.field)==-1)\n {\n preview.steps[sequenceIdx].droppedblockingfields.push(action.field);\n }\n break;\n }\n break;\n }\n })\n\n if (step.type=='link')\n {\n preview.steps[sequenceIdx].links.push([step.portals,true]);\n links.push([step.portals,false]);\n\n $.each(stepAnalysis.infos, function(infoIdx, info) {\n if (info.type=='fields')\n {\n $.each(['createdFields','wastedFields'], function(whichIdx, which) {\n\n $.each(info[which], function(fieldIdx, field) {\n \n var vertexes = step.portals.split('|');\n\n // other links building the field\n $.each(field, function(linkIdx, link) {\n\n $.each(link.llstring.split('|'), function(index, vertex) {\n if (vertexes.indexOf(vertex)==-1)\n {\n vertexes.push(vertex);\n }\n });\n\n if (\n typeof link.planned == 'undefined'\n && preview.existinglinks.indexOf(link.llstring) == -1\n )\n {\n preview.existinglinks.push(link.llstring);\n }\n });\n\n if (which=='wastedFields')\n {\n preview.steps[sequenceIdx].wastedfields.push(vertexes);\n }\n else\n {\n preview.steps[sequenceIdx].fields.push([vertexes,true]);\n }\n\n });\n });\n }\n });\n\n }\n\n var crosslinks = [];\n\n $.each(stepAnalysis.errors, function(errorIdx, error) {\n \n switch (error.type)\n {\n case 'crosslinks':\n $.each(error.crosslinks, function(crosslinkidx, crosslink) {\n crosslinks.push(crosslink);\n });\n break;\n\n case 'portal-inside-fields':\n $.each(error.blockingFields, function(blockingFieldidx, blockingField) {\n preview.steps[sequenceIdx].blockingFields[blockingField.llstring] = {\n team: blockingField.teamDECODED,\n }\n if (typeof blockingField.planned != 'undefined')\n {\n preview.steps[plan.steps[blockingField.planned].sequenceIdx].blockedVertexes.push(portals[0]);\n }\n });\n break;\n\n case 'not-own-faction':\n case 'no-keys-available':\n case 'not-full-resos':\n preview.steps[sequenceIdx].badDestinationReasons.push(error.type);\n break;\n\n }\n\n });\n\n for (var backIdx = sequenceIdx; backIdx >= 0; backIdx--) {\n\n if (backIdx < sequenceIdx)\n {\n if (backIdx == (sequenceIdx-1))\n {\n preview.steps[sequenceIdx].stops.past = preview.steps[backIdx].stops.past.slice(0);\n }\n\n if (preview.steps[sequenceIdx].stops.now!=preview.steps[backIdx].stops.now)\n {\n if (backIdx == (sequenceIdx-1))\n {\n preview.steps[sequenceIdx].stops.past.unshift(preview.steps[backIdx].stops.now);\n }\n\n if (\n (!preview.steps[backIdx].stops.future.length)\n || preview.steps[backIdx].stops.future.slice(-1)[0] != preview.steps[sequenceIdx].stops.now\n )\n {\n preview.steps[backIdx].stops.future.push(preview.steps[sequenceIdx].stops.now);\n }\n\n }\n\n }\n \n\n $.each(stepAnalysis.portalsState, function(index, portalState) {\n\n if (typeof preview.steps[backIdx].portals[portalState.llstring] == 'undefined')\n {\n\n preview.steps[backIdx].portals[portalState.llstring] = {\n coords: portalState.llstring.split(','),\n team: portalState.teamDECODED\n };\n }\n });\n\n $.each(crosslinks, function(crosslinkidx, crosslink) {\n if (\n typeof preview.steps[backIdx].crosslinks[crosslink.llstring] == 'undefined'\n || (!preview.steps[backIdx].crosslinks[crosslink.llstring].activenow)\n )\n {\n preview.steps[backIdx].crosslinks[crosslink.llstring] = {activenow:(backIdx == sequenceIdx),teamDECODED:crosslink.teamDECODED};\n }\n \n });\n \n };\n\n if (sequenceIdx>0)\n {\n $.each(preview.steps[sequenceIdx-1].crosslinks, function(llstring,crosslink) {\n if (typeof preview.steps[sequenceIdx].crosslinks[llstring] == 'undefined')\n {\n preview.steps[sequenceIdx].crosslinks[llstring] = {activenow:null,teamDECODED:crosslink.teamDECODED};;\n }\n });\n }\n\n });\n\n $.each(analysis.Portals, function(llstring, portalState) {\n\n for (var backIdx = previewSequence.length-1; backIdx >= 0; backIdx--)\n {\n if (typeof preview.steps[backIdx].portals[portalState.llstring] == 'undefined')\n {\n\n preview.steps[backIdx].portals[portalState.llstring] = {\n coords: portalState.llstring.split(','),\n team: portalState.teamDECODED\n };\n }\n\n }\n\n });\n\n if (preview.lastShownStep)\n {\n var stepToShow = preview.lastShownStep;\n preview.lastShownStep = null;\n\n if (typeof preview.steps[stepToShow-1] == 'undefined')\n {\n stepToShow = preview.steps.length;\n }\n\n if (stepToShow)\n {\n showPreview(stepToShow);\n }\n else\n {\n $('#planPreviewModal').modal('hide');\n }\n \n }\n\n// console.groupEnd();\n\n }", "title": "" }, { "docid": "df817e67fb4af2fa02dda0bdd44bc919", "score": "0.40028635", "text": "async function exec(preview, { previewsitemMapper, categoryMapper, genreMapper, seriesMapper, publisherMapper, personMapper, itemMapper }) { \r\n \r\n // retrieve the previews items to insert \r\n let items = await previewsitemMapper.findByPreview(preview);\r\n console.log('\\nFound %s Previews Items to process\\n', items.length);\r\n \r\n let categories = await getOrAdd({\r\n items: items, \r\n name: 'categories', \r\n keyGen: (item) => item.category, \r\n findOne: (item) => categoryMapper.findOne({ _id: item.category }), \r\n insert: (item) => categoryMapper.insertOne({ _id: item.category, name: '' })\r\n }); \r\n\r\n let genres = await getOrAdd({\r\n items: items, \r\n name: 'genres', \r\n keyGen: (item) => item.genre,\r\n findOne: (item) => genreMapper.findOne({ _id: item.genre }),\r\n insert: (item) => genreMapper.insertOne({ _id: item.genre, name: '' })\r\n });\r\n\r\n let series = await getOrAdd({\r\n items: items,\r\n name: 'series',\r\n keyGen: (item) => item.series_code,\r\n findOne: (item) => seriesMapper.findOne({ _id: item.series_code }), \r\n insert: (item) => seriesMapper.insertOne({ _id: item.series_code, name: item.main_desc })\r\n }); \r\n\r\n let publishers = await getOrAdd({\r\n items: items,\r\n name: 'publishers', \r\n keyGen: (item) => item.publisher,\r\n findOne: (item) => publisherMapper.findOne({ name: item.publisher }),\r\n insert: (item) => publisherMapper.insertOne({ name: item.publisher })\r\n });\r\n\r\n let writers = await getOrAdd({\r\n items: items, \r\n name: 'writers', \r\n keyGen: (item) => item.writer,\r\n findOne: (item) => personMapper.findOne({ fullname: item.writer }),\r\n insert: (item) => personMapper.insertOne({ fullname: item.writer, writer: true, artist: false, cover_artist: false }),\r\n update: (item) => personMapper.findOneAndSet({ fullname: item.writer }, { writer: true })\r\n });\r\n\r\n let artists = await getOrAdd({\r\n items: items,\r\n name: 'artists', \r\n keyGen: (item) => item.artist,\r\n findOne: (item) => personMapper.findOne({ fullname: item.artist }),\r\n insert: (item) => personMapper.insertOne({ fullname: item.artist, writer: false, artist: true, cover_artist: false }),\r\n update: (item) => personMapper.findOneAndSet({ fullname: item.artist }, { artist: true })\r\n });\r\n\r\n let coverartists = await getOrAdd({\r\n items: items,\r\n name: 'cover artists', \r\n keyGen: (item) => item.cover_artist,\r\n findOne: (item) => personMapper.findOne({ fullname: item.cover_artist }),\r\n insert: (item) => personMapper.insertOne({ fullname: item.cover_artist, writer: false, artist: false, cover_artist: true }),\r\n update: (item) => personMapper.findOneAndSet({ fullname: item.cover_artist }, { cover_artist: true })\r\n });\r\n\r\n\r\n console.log('Processing items');\r\n let progress = new Progress(' inserting [:bar] :current/:total', { total: items.length, width: 50 });\r\n\r\n for(let item of items) { \r\n let genre = genres.get(item.genre);\r\n let category = categories.get(item.category);\r\n let seri = series.get(item.series_code);\r\n let publisher = publishers.get(item.publisher);\r\n let writer = writers.get(item.writer);\r\n let artist = artists.get(item.artist);\r\n let coverartist = coverartists.get(item.cover_artist);\r\n\r\n let writerLink = writer ? {\r\n _id: writer._id,\r\n fullname: writer.fullname\r\n } : null;\r\n\r\n let artistLink = artist ? {\r\n _id: artist._id,\r\n fullname: artist.fullname\r\n } : null;\r\n\r\n let coverartistLink = coverartist ? {\r\n _id: coverartist._id,\r\n fullname: coverartist.fullname\r\n } : null;\r\n \r\n let newItem = {\r\n stock_no: item.stock_no,\r\n parent_item: item.parent_item_no_alt,\r\n title: item.copy.title,\r\n desc: item.copy.preview + '\\n' + item.copy.description,\r\n variant_desc: item.variant_desc,\r\n series: seri,\r\n issue_no: parseInt(item.issue_no) || null,\r\n issue_seq_no: parseInt(item.issue_seq_no) || null,\r\n volume_tag: item.volume_tag,\r\n max_issue: parseInt(item.max_issue) || null,\r\n price: parseFloat(item.price) || null,\r\n publisher: publisher,\r\n upc_no: item.upc_no,\r\n isbn_no: item.short_isbn_no,\r\n ean_no: item.ean_no,\r\n cards_per_pack: parseInt(item.cards_per_pack),\r\n pack_per_box: parseInt(item.pack_per_box),\r\n box_per_case: parseInt(item.box_per_case),\r\n discount_code: item.discount_code,\r\n print_date: Date.parse(item.prnt_date) ? new Date(item.prnt_date) : null,\r\n ship_date: Date.parse(item.ship_date) ? new Date(item.ship_date) : null,\r\n srp: parseFloat(item.srp),\r\n category: category,\r\n genre: genre,\r\n mature: item.mature === 'Y' ? true : false,\r\n adult: item.adult === 'Y' ? true : false,\r\n caution1: item.caut1,\r\n caution2: item.caut2,\r\n caution3: item.caut3,\r\n writer: writerLink,\r\n artist: artistLink,\r\n cover_artist: coverartistLink,\r\n foc_date: Date.parse(item.foc_date) ? new Date(item.foc_date) : null,\r\n previews: [{ \r\n previews_no: item.diamd_no,\r\n page: item.page\r\n }]\r\n };\r\n\r\n // save in mongo\r\n newItem = await itemMapper.insertOne(newItem);\r\n\r\n // save in elasticsearch\r\n await itemMapper.index(newItem);\r\n \r\n progress.tick();\r\n }\r\n\r\n \r\n}", "title": "" }, { "docid": "fcacdb1cdc7170a7ac6b45ab0e7a9549", "score": "0.39943957", "text": "function find_gens(pat) {\n\t\tdict.clear();\n\t\tvar default_name = pat.name || \"gen\";\n\t\t// iterate all gen~ objects in the patcher\n\t\t// to set their export name, path, and scripting name\n\t\tvar obj = pat.firstobject;\n\t\twhile (obj) {\n\t\t\tif (obj.maxclass.toString() == \"patcher\") {\n\t\t\t\tvar subpat = obj.subpatcher()\n\t\t\t\tif (subpat) find_gens(subpat);\n\t\t\t\t\n\t\t\t} else if (obj.maxclass.toString() == \"gen~\") {\n\t\t\t\tvar name = default_name;\n\t\t\t\tif (obj.getattr(\"title\")) { \n\t\t\t\t\tname = obj.getattr(\"title\").toString(); \n\t\t\t\t} else if (obj.getattr(\"gen\")) { \n\t\t\t\t\tname = obj.getattr(\"gen\").toString(); \n\t\t\t\t} \n\t\t\t\t// sanitize:\n\t\t\t\tname = safename(name);\n\t\t\t\t// sanitize via scripting name too:\n\t\t\t\twhile (name != obj.varname.toString()) {\n\t\t\t\t\t// try to apply it:\n\t\t\t\t\tobj.varname = name;\n\t\t\t\t\tname = safename(obj.varname);\n\t\t\t\t}\n\t\t\t\t// ensure exportname matches:\n\t\t\t\tobj.message(\"exportname\", name);\n\t\t\t\t// ensure each gen~ has an export path configured:\n\t\t\t\tobj.message(\"exportfolder\", export_path);\n\n\t\t\t\tif (doExport) {\n\t\t\t\t\tobj.message(\"export_json\");\n\n\t\t\t\t\t// this might not work on the first pass, since it can take a little time.\n\t\t\t\t\tdict.import_json(obj.getattr(\"exportfolder\") + obj.getattr(\"exportname\") + \".json\")\n\t\t\t\t\t\n\t\t\t\t\tvar ast = JSON.parse(dict.stringify())\n\t\t\t\t\tif (ast.class == \"Module\") {\n\t\t\t\t\t\tvar nodes = ast.block.children;\n\t\t\t\t\t\tfor (var i=0; i<nodes.length; i++) {\n\t\t\t\t\t\t\tvar node = nodes[i];\n\t\t\t\t\t\t\tif (node.typename == \"Data\") {\n\t\t\t\t\t\t\t\t//var bufname = obj.getattr(node.name)\n\t\t\t\t\t\t\t\tvar bufname = obj.getattr(node.name)\n\t\t\t\t\t\t\t\tvar buffer = new Buffer(bufname)\n\t\t\t\t\t\t\t\tvar frames = buffer.framecount()\n\t\t\t\t\t\t\t\tvar chans = buffer.channelcount()\n\t\t\t\t\t\t\t\tif (frames > 0 && chans > 0) {\n\t\t\t\t\t\t\t\t\tvar wavname = node.name + \".wav\"\n\t\t\t\t\t\t\t\t\t// write out that file so it can be referenced:\n\t\t\t\t\t\t\t\t\tbuffer.send(\"write\", obj.getattr(\"exportfolder\") + wavname);\n\t\t\t\t\t\t\t\t\t//post(\"found buffer mapped Data\", node.name, bufname, wavname, frames, chans)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (node.typename == \"Buffer\") {\n\t\t\t\t\t\t\t\t// find the corresponding buffer~:\n\t\t\t\t\t\t\t\tvar bufname = obj.getattr(node.name)\n\t\t\t\t\t\t\t\tvar buffer = new Buffer(bufname)\n\t\t\t\t\t\t\t\tvar frames = buffer.framecount()\n\t\t\t\t\t\t\t\tvar chans = buffer.channelcount()\n\n\t\t\t\t\t\t\t\tif (frames < 0 || chans < 0) {\n\t\t\t\t\t\t\t\t\terror(\"oopsy: can't find buffer~ \"+bufname);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// write it out:\n\t\t\t\t\t\t\t\t//buffer.send(\"write\", obj.getattr(\"exportfolder\") + bufname + \".wav\");\n\n \t\t\t\t\t\t\tpost(\"oopsy: consider replacing [buffer \"+node.name+\"] with [data \"+node.name+\" \"+frames+\" \"+chans+\"]\\n\"); \n\t\t\t\t\t\t\t\tif (node.name != bufname) { \n\t\t\t\t\t\t\t\t\tpost(\"and set @\"+node.name, bufname, \"on the gen~\\n\"); \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\terror(\"gen~ cannot export with [buffer] objects\\n\")\n\t\t\t\t\t\t\t\terrors = 1;\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (doExport) {\n\t\t\t\t\tobj.message(\"exportcode\");\n\t\t\t\t}\n\t\t\t\tnames.push(name);\n\n\t\t\t\tcpps.push(path + sep + name + \".cpp\")\n\t\t\t}\n\t\t\tobj = obj.nextobject;\n\t\t}\n\t}", "title": "" }, { "docid": "2e9d18535d421bd18e47ad2e90798345", "score": "0.39936578", "text": "function dataProcessing (data) {\n const processedDataArray = data.map(doc => {\n const documentWithExtraField = addVariousArtistsField(doc)\n const stringifiedDoc = {\n ...documentWithExtraField,\n Artist: arrayFieldToString(documentWithExtraField.Artist),\n ArtistBio: arrayFieldToString(documentWithExtraField.ArtistBio)\n }\n const processedDoc = normalizeDate(stringifiedDoc)\n return processedDoc\n })\n return processedDataArray\n}", "title": "" }, { "docid": "3a8e344cfff0cec83e05d1ec8b569da7", "score": "0.39893147", "text": "function fillProcesses(text) {\n // Filtrando o input recebido pelo arquivo de texto\n processes = text.split('\\n').filter((e) => e.length >= 6);\n\n // Tratando as strings dos processos\n for(i=0;i<processes.length;i++) {\n processes[i] = processes[i].replaceAll(' ', '');\n processes[i] = processes[i].split(',');\n }\n\n // Ordenando os processos por arrivalTime\n processes.sort((a, b) => {\n return parseInt(a[0]) - parseInt(b[0]);\n });\n\n // Criando a lista de processos e atualizando o output\n for(i=0;i<processes.length;i++) {\n // Criando o novo objeto de processo\n processes[i] = new Process(i, processes[i][0], processes[i][1], processes[i][2], processes[i][3], processes[i][4], processes[i][5]);\n\n // Atualizando o output do menu\n Interface.outputP.innerHTML += `${processes[i].name}: ${processes[i].arrivalTime}, ${processes[i].priority}, ${processes[i].processorTime}, ${processes[i].size}, ${processes[i].printer}, ${processes[i].disk}<br><br>`;\n }}", "title": "" }, { "docid": "cf7bdcb54a8a489e7802f8dbd167c0a1", "score": "0.39727202", "text": "async function preprocess (params) {\n let app = this\n let sources\n\n // Show table\n document.getElementById('hottable').style.display = 'block'\n\n log('[Preprocess] Got params:', params)\n if (params && params.files) {\n sources = createSourcesFromFiles(params.files)\n } else if (params && params.url) {\n sources = [createSourceFromUrl(app.url)]\n } else {\n app.showError('No sources provided')\n }\n\n log('[Preprocess] Created such sources:', sources)\n for (let source of sources) {\n // Create readable streams\n try {\n source.stream = await createStream((source.file) ? source.file : source.url)\n } catch (e) {\n app.showError(e.message)\n }\n\n // Detect structure (columns)\n const structure = await getStreamStructure(source.stream, source.type)\n source = Object.assign(source, structure)\n log('[Preprocess] Got source structure:', structure)\n\n // By default, restructured collection has the same structure\n source.pipeline.restructure.newColumns = source.columns.slice(0)\n\n // Add this source to reactive app.sources\n app.sources.push(source)\n\n // Check if we are in the RUN mode (loaded url)\n if (app.run) {\n // Deactivate RUN mode\n app.run = false\n // Load querified pipeline\n Object.assign(source.pipeline, app.runPipeline)\n // Process source\n log('[Preprocess] Start process()')\n app.process(source)\n } else {\n // By default open each source in the preview mode\n log('[Preprocess] Start preview()')\n app.preview(source)\n }\n }\n // Hide file dialog\n app.closeOpenDialog()\n}", "title": "" }, { "docid": "77ace3ee28f452dab29505c4faba2419", "score": "0.39702755", "text": "parsedProbe() {\n const requestPaths = {\n uri: \"req_resources[0].uri\",\n type: \"req_resources[0].type\"\n };\n\n const imageUri = get(this.probe, requestPaths.uri, null);\n const videoUri = get(this.probe, requestPaths.uri, null);\n\n const type = get(this.probe, requestPaths.type, null);\n const info = {\n isImage: type.includes(\"image\"),\n isVideo: type.includes(\"video\")\n };\n\n if (info.isImage) {\n info.type = \"image\";\n info.source = this.imageUrl(imageUri);\n info.thumbnail = this.thumbnailUrl(imageUri, fileType.IMAGE);\n } else {\n info.type = \"video\";\n info.source = this.videoUrl(videoUri);\n info.originalSource = this.videoUrl(videoUri, { original: true });\n info.thumbnail = this.thumbnailUrl(videoUri, fileType.VIDEO);\n }\n\n info.status = \"parsed\";\n info.id = this.probe.id;\n info.md5 = this.probe.meta[\"Hash:md5\"];\n info.name = this.probe.meta[\"File:FileName\"];\n info.galleryFusedScore = this.fusedScore();\n info.hasFused = this.probe.has_fused;\n return info;\n }", "title": "" }, { "docid": "9a13e4760599a1ef235d54d870d184d4", "score": "0.39606303", "text": "function submitForm() {\n var jobName = x(\"jobName\");\n let jobTitle = document.getElementById(\"jobNameDiv\");\n jobTitle.innerHTML = \"<img src=job.png id='img'>\" + \"<div class='px-xs-2'>Job Name: </div>\" + jobName;\n var jobId = x(\"jobId\");\n let jobIdDiv = document.getElementById(\"jobIdDiv\");\n jobIdDiv.innerHTML = \"<img src=id.png id='img'>\" + \"<div class='px-xs-2'>Job Id: </div>\" + jobId;\n var jobDesigner = x(\"jobDesigner\");\n let jobDesinerDiv = document.getElementById(\"jobDesignerDiv\");\n jobDesinerDiv.innerHTML = \"<img src=designer.png id='img'>\" + \"<div class='px-xs-2'>Designer: </div>\" + jobDesigner;\n var jobStartDate = x(\"jobStartDate\");\n var jobDueDate = x(\"jobDueDate\");\n let jobDueDateDiv = document.getElementById(\"jobDueDateDiv\");\n jobDueDateDiv.innerHTML = \"<img src=due-date.png id='img'>\" + \"<div class='px-xs-2'>Job Due Date: </div>\" + jobDueDate;\n var category = x(\"category\");\n let categoryDiv = document.getElementById(\"jobCategoryDiv\");\n categoryDiv.innerHTML = \"<img src=category.png id='img'>\" + \"<div class='px-xs-2'>Category: </div>\" + category;\n var process = [];\n\n // loop through the check boxed values and return the names of the boxes selected to the process array\n var checkBoxes = document.querySelectorAll(\"#processList li input[type=checkbox]:checked\");\n for (let i = 0 ; i < checkBoxes.length; i++){\n process.push(checkBoxes[i].name);\n }\n\n // If checkbox selected\n process.forEach(function(element, value) {\n if (element === \"design\"){\n value = 26\n } else if (element === \"laser\") {\n value = 9;\n } else if (element === \"bend\") {\n value = 11;\n } else if (element === \"weld\") {\n value = 26;\n } else if (element === \"metalFinish\") {\n value = 14;\n } else if (element === \"assembly\") {\n value = 15;\n } else {\n console.log(\"Nothing selected\");\n }\n return chartData.push(value);\n });\n\n if (validation()) // Calling validation function\n {\n // document.getElementById(\"newJobForm\").submit(); //form submission\n // form.jobName = jobName;\n // form.jobId = jobId;\n // form.jobDesigner = jobDesigner;\n // form.jobStartDate = jobStartDate;\n // form.jobDueDate = jobDueDate;\n // form.category = category;\n // form.processList = process;\n // // console.log(form);\n }\n\n hideForm();\n}", "title": "" }, { "docid": "7882edf3058f230a4cf8466fa532c82d", "score": "0.39548132", "text": "function postBuildings(request, response) {\n\t//console.log(\"Buildings Data: \");\n\t//console.log(request.body);\n\t//console.log(request.body.address);\n\t//console.log(request.body.name);\n\t//console.log(request.body.manager);\n\n\tvar query = sql.format('INSERT INTO Building SET ?', request.body);\n\tdb.Query(query, function(status, results) {\n\t\tif (!status) {\n\t\t\tconsole.log(\"ERROR: \" + results);\n\t\t\tresponse.status(401).end();\n\t\t\treturn;\n\t\t} else {\n\t\t\tresponse.status(200).end();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "958aa1d3299d667942b2a94a83490717", "score": "0.39494112", "text": "function preProcessListPageInput(arr) {\r\n arr[1][1].map(function(item){\r\n item.imagepath = \"http://\" + arr[0] + '/' + item.imagepath;\r\n item['content'] = item['content'].substr(0, 60);\r\n item.dateandtime = formatTime(new Date(parseInt(item.dateandtime) * 1000));\r\n });\r\n}", "title": "" }, { "docid": "2be820344449d239050165868ac0eb09", "score": "0.39463973", "text": "postProcessResponse(message, response,aiResponse){\n //User Map\t\t\n\t\t\n\t\tconsole.log(\"aiResponse.action >>>>>>>>>>>>>>>> \"+aiResponse.action);\n\t\tconsole.log(\"aiResponse ====== \"+response);\n\t\tvar enrichedResponse = response;\t\n\t\tvar attachments='';\n\t\tif(aiResponse.action== \"electronics\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Here are the offers! I hope you find something you like. Remember, if you provide your feedback , I can offer you even more personalized coupons. Enjoy!',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Buy a Hair Dryer\",\n\t\t\t\t\t\t\t\t\"value\": \"Get a Straightner free\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Buy 2 air-conditioners\",\n\t\t\t\t\t\t\t\t\"value\": \"Get a discount of 20%\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"electronics.n\")\n\t\t{\n\t\t\t\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Hey don\\'t worry, I have more Electronic offers for you below! I know you\\'ll find something you want.',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Buy a 4K TV\",\n\t\t\t\t\t\t\t\t\"value\": \"Get a Blu Ray player for free\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Samsung Refrigerator\",\n\t\t\t\t\t\t\t\t\"value\": \"Get discount of 30%\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"user.query\")\n\t\t{\n\t\t\t\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Here are some offers based on your past interests! Tell me if you want something more specific, I\\'ll look out for offers relevant to that.',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Garments\",\n\t\t\t\t\t\t\t\t\"value\": \"20% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Shoes\",\n\t\t\t\t\t\t\t\t\"value\": \"10% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Electronic Devices\",\n\t\t\t\t\t\t\t\t\"value\": \"5% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Sports Gear\",\n\t\t\t\t\t\t\t\t\"value\": \"20% OFF \",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Computing Devices\",\n\t\t\t\t\t\t\t\t\"value\": \"15% OFF \",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"computers\")\n\t\t{\t\t\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'These offers below are going to blow your mind! Remember, if you provide your feedback , I can offer you more personalized coupons. Knock yourself out!',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Buy a fully configured Desktop for $350\",\n\t\t\t\t\t\t\t\t\"value\": \"Use COUPON CODE # WEMSBS\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Hard-Disk 1TB space\",\n\t\t\t\t\t\t\t\t\"value\": \"$19 only\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"sports.n\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Don\\'t worry, I have more Sports Gear offers for you. I\\'m going to make sure we find something you like ;)',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Buy a swimming pool kit\",\n\t\t\t\t\t\t\t\t\"value\": \"Get first month of membership FREE\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Football signed by Tom Brady\",\n\t\t\t\t\t\t\t\t\"value\": \"\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"sports\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Here are the best offers! Remember, if you provide your feedback , I can offer you more personalized coupons. Have fun!',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Sports Gear\",\n\t\t\t\t\t\t\t\t\"value\": \"Discount on Lebron James Merchandise, Original 2007 NBA Finals Cavaliers Jersey for just $200 \",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"user.request1\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t//'title': 'Hey , I found something which made me think of you. Look at the offer below. Isn\\'t it perfect? Happy //shopping!',\n\t\t\t\t\t\t\n\t\t\t\t\t\t'title': 'Sorry , you did not like them. I found something new , which could be of interest to you . Isn’t this better ?',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Kids' Apparel\",\n\t\t\t\t\t\t\t\t\"value\": \"30% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Women's Shoes\",\n\t\t\t\t\t\t\t\t\"value\": \"15% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Electronic Devices\",\n\t\t\t\t\t\t\t\t\"value\": \"25% OFF on purchase of $300 and above\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Sports Gear\",\n\t\t\t\t\t\t\t\t\"value\": \"Special Discount on Lebron James Merchandise\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \"Computing Devices\",\n\t\t\t\t\t\t\t\t\"value\": \"Buy one RAM and get 50% OFF on the other\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\t\n\t\telse if(aiResponse.action== \"computer.n\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Relax, I still have a bucketload of brilliant deals. We\\'re going to make sure we find you something awesome!',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Get Norton Security For 2 years for just $40\",\n\t\t\t\t\t\t\t\t\"value\": \"Use COUPON CODE # NORTON2YR\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Special Discount on Intel 5th Generation Processors $70\",\n\t\t\t\t\t\t\t\t\"value\": \"Use COUPON CODE # INTEL$70\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"garments\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'You\\'re going to love these offers I have for you! Remember, if you provide your feedback , I can offer you more personalized coupons! Enjoy!',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Women's Garments\",\n\t\t\t\t\t\t\t\t\"value\": \"20% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Men's Garments\",\n\t\t\t\t\t\t\t\t\"value\": \"15% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Kids' Garments\",\n\t\t\t\t\t\t\t\t\"value\": \"25% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Special Discount on Camisoles\",\n\t\t\t\t\t\t\t\t\"value\": \"USE COUPON CODE # 15OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"garments.n\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Hold on, I still have some more offers for you! Let\\'s make sure we find you something you like!',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Buy one pair of jeans\",\n\t\t\t\t\t\t\t\t\"value\": \"Get 20% off on the next one\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Special Discount on suits for men\",\n\t\t\t\t\t\t\t\t\"value\": \"17% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Kids' Garments\",\n\t\t\t\t\t\t\t\t\"value\": \"25% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Special Discount on Camisoles\",\n\t\t\t\t\t\t\t\t\"value\": \"USE COUPON CODE # 15OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"shoes\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'These offers are going to blow your mind! And remember, if you provide your feedback , I can offer you more personalized coupons. Have fun!',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Women's Shoes\",\n\t\t\t\t\t\t\t\t\"value\": \"Get 20% off\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Men's Shoes\",\n\t\t\t\t\t\t\t\t\"value\": \"15% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Kids' Shoes\",\n\t\t\t\t\t\t\t\t\"value\": \"25% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Special Discount on Vans\",\n\t\t\t\t\t\t\t\t\"value\": \"USE COUPON CODE # 15OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\telse if(aiResponse.action== \"shoes.n\")\n\t\t{\n\t\t\tattachments=\n\t\t\t{\n\t\t\t\t\n\t\t\t\t'attachments':\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t'pretext': '',\n\t\t\t\t\t\t'title': 'Hey don\\'t loose hope, i have more for you in this categotry. More Shoes Offers:',\n\t\t\t\t\t\t//'title_link': 'https://api.slack.com/',\n\t\t\t\t\t\t\"fields\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Buy one shoe pair\",\n\t\t\t\t\t\t\t\t\"value\": \"Get 20% off on the other one.\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Special discount on the woman shoes.\",\n\t\t\t\t\t\t\t\t\"value\": \"25% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Kids Shoes\",\n\t\t\t\t\t\t\t\t\"value\": \"25% OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"title\": \" Special Discount on Vans\",\n\t\t\t\t\t\t\t\t\"value\": \"USE COUPON CODE # 15OFF\",\n\t\t\t\t\t\t\t\t\"short\": true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'color': '#7CD197'\n\t\t\t\t\t} \n\t\t\t\t]\n\t\t\t};\n\t\t\tenrichedResponse = attachments;\n\t\t}\n\t\t\n\t\t\n\t\t//smile:\n\t\t//'user.request1'\n\t\t\n\t\treturn enrichedResponse;\n\t}", "title": "" }, { "docid": "0e7d621efd15334cf41fe3fb5d0babf4", "score": "0.39459667", "text": "function testProcessedFields() {\n\tconst song = createSong(PARSED_DATA, PROCESSED_DATA);\n\tconst valuesMap = {\n\t\talbumArtist: song.getAlbumArtist(),\n\t\tartist: song.getArtist(),\n\t\ttrack: song.getTrack(),\n\t\talbum: song.getAlbum(),\n\t};\n\n\tfor (const key in valuesMap) {\n\t\tconst expectedValue = PROCESSED_DATA[key];\n\t\tconst actualValue = valuesMap[key];\n\n\t\tit(`should return processed ${key} value`, () => {\n\t\t\texpect(expectedValue).to.be.equal(actualValue);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "dfdca4939dbf4bd3c73e6ccc870eac81", "score": "0.39427894", "text": "function preprocess(dataobj){\n\ttmp = {\n\t\tproperties: {\n\t\t\tjob: dataobj,\n\t\t},\n\t\tHeadline:{text: dataobj.Headline},\n\t\tDiscoAmsName: {text: dataobj.DiscoAmsName},\n\t\tBody: {text: dataobj.Body},\n\t\tPostingCreated: {text: dataobj.PostingCreated},\n\t\tDetails: {text: \"Indrykket d. \"+ dataobj.PostingCreated + \" Arbejdsted: \"+ dataobj.WorkLocation }\n\t\t};\n\treturn tmp;\n}", "title": "" }, { "docid": "6f54f45243423ff15f51fe046eb324e7", "score": "0.39415994", "text": "function executeDefaultProcessing$static(data/*:ProcessingData*/)/*:void*/ {\n var content/*:Content*/ = data.getContent();\n var properties/*:String*/ = mx.resources.ResourceManager.getInstance().getString('com.coremedia.blueprint.base.components.quickcreate.QuickCreateSettings', 'item_' + content.getType().getName());\n if (properties) { //ok, there are custom properties defined for the content type\n //create property-names array\n var propertiesArray/*:Array*/ = properties.split(\",\");\n for (var i/*:int*/ = 0; i < propertiesArray.length; i++) {\n var propertyName/*:String*/ = propertiesArray[i];\n if (content.getType().getDescriptor(propertyName)) {\n var value/*:**/ = data.get(propertyName);\n if (value) {\n content.getProperties().set(propertyName, value);\n }\n }\n else {\n AS3.trace('[INFO]', 'Skipped processing of \"' + propertyName + '\": not a content property.');\n }\n }\n }\n }", "title": "" }, { "docid": "250c6d2b63d03d10ebada7b21ea3c25b", "score": "0.39407593", "text": "function pre(payload) {\n // banner is first image and banner text is image alt\n payload.resource.banner = {\n img: '',\n text: ''\n };\n const firstImg = select(payload.resource.mdast, 'image');\n if (firstImg.length > 0) {\n payload.resource.banner = {\n img: firstImg[0].url,\n text: firstImg[0].alt\n }\n } \n\n const content = [];\n let foundFirstImg = false;\n // content is everything after first image\n visit(payload.resource.mdast, 'paragraph', function (node) {\n if (foundFirstImg) {\n // start adding nodes to result only after first image found\n const hast = toHAST(node);\n const html = toHTML(hast);\n content.push(html);\n }\n if (!foundFirstImg && node.children.length > 0 && node.children[0].type === 'image') {\n // look for first image\n foundFirstImg = true;\n }\n });\n\n payload.resource.content = content;\n \n // avoid htl execution error if missing\n payload.resource.meta = payload.resource.meta || {};\n payload.resource.meta.references = payload.resource.meta.references || [];\n payload.resource.meta.icon = payload.resource.meta.icon || '';\n}", "title": "" }, { "docid": "2cfb688715d62e8f44cf27c81ce5babe", "score": "0.39405075", "text": "async function createScrapingLogic() {\n try {\n const browser = await puppeteer.launch({headless: false});\n const page = await browser.newPage();\n await page.setExtraHTTPHeaders({Referer: 'https://workingatbooking.com/vacancies/'})\n await page.setUserAgent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36');\n await page.goto(mainPageUrl);\n console.log('1:')\n await getToSearchResultspage(page);\n await page.waitForSelector(closeMapLightboxSel);\n \n await clickBtn(page, closeMapLightboxSel);\n\n await clickBtn(page, radioBtns.hotels);\n await page.waitForSelector(`${radioBtns.hotels}${waitforSels.activeFilteClass}`);\n \n await clickBtn(page, radioBtns.guesthouse);\n await page.waitForSelector(`${radioBtns.guesthouse}${waitforSels.activeFilteClass}`);\n \n await page.waitForSelector(pagiBtnsObj.allsSel);\n await extractPaginatedPages(page, pagiBtnsObj, hotelsCardsObj, '1');\n \n writeObjIntoJsonFile(allHotelsInfosObj, './model/hotel-infos-security.json');\n \n } catch(e) {\n console.log('our error: ' + e);\n }\n}", "title": "" }, { "docid": "5fab01abafe02abb215f42410dff6b83", "score": "0.39288583", "text": "processActions(actions) {\n\n let isValidAction = action => {\n // if there's no action to validate\n if (!action) {\n return false\n }\n\n // if there's no data\n if (Object.keys(action.data).length === 0) {\n return false\n }\n\n // let's make sure it's one of the supported types\n // return action.type === 'resize' || action.type === 'mousemove' || action.type === 'click' || action.type === 'scroll'\n return true\n }\n\n return actions\n .filter(isValidAction)\n .map((action, i) => Object.assign({}, action, {\n duration: (actions[i].timestamp - actions[i == 0 ? 0 : i - 1].timestamp) / 1000\n }))\n }", "title": "" }, { "docid": "746d1ccb262acb1cbef3d443fdb73ed6", "score": "0.39253476", "text": "function buildReportsForTesting(i) {\n let dummyReqRes = null; //this is the object which holds req/res info indexed by the order they are dispatched in.\n let reports = {}; //this is the report object which holds all reports, sorted by path for a partiuclar test set.\n let statuses = [200, 204, 500, 400];\n for (let j = 0; j <= i; j++) {\n dummyReqRes = {}; // make new reqres obj for index j\n dummyReqRes.req = {};\n dummyReqRes.res = {};\n dummyReqRes.report = {};\n dummyReqRes.req.headers = {\n Cookies: `${j}`,\n Accepts: \"application/json\",\n };\n dummyReqRes.res.headers = {\n Cookies: `${j}`,\n Accepts: \"application/json\",\n };\n dummyReqRes.req.body = JSON.stringify(\n `The value of j is ${j}.Testing req body.`\n );\n dummyReqRes.res.body = JSON.stringify(\n `The value of i is ${j}.Testing res body.`\n );\n dummyReqRes.res.status = statuses[j % 3];\n reports[j] = dummyReqRes;\n }\n\n return reports;\n }", "title": "" }, { "docid": "4757ba39b11b5d85471d745585c4ad84", "score": "0.3918671", "text": "function processShipshapeJson(jsonFile, revisionID, diffID, callback) {\n // We filter the notes from shipshape to only care about notes\n // associated with files that are part of the code review.\n // TODO(jvg): modify shipshape CLI to allow passing these in to\n // shipshape to reduce analysis & processing time.\n conduitInstance.differentialGetCommitPaths(revisionID,\n function(error, result) {\n if (error !== undefined) {\n callback(error);\n return;\n }\n\n var files = {};\n for (var key in result.response) {\n files[result.response[key]] = 1;\n }\n var input = fs.readFileSync(jsonFile);\n var parsed = JSON.parse(input);\n if (!parsed.analyze_response) {\n callback(\"Invalid shipshape response file: \" + jsonFile);\n return;\n }\n var relevant = [];\n for (var r in parsed.analyze_response) {\n var notes = parsed.analyze_response[r].note;\n if (notes !== undefined) {\n for (var n in notes) {\n var note = notes[n];\n if (note.location && note.location.path &&\n files[note.location.path]) {\n relevant.push(note);\n }\n }\n }\n }\n if (relevant.length == 0) {\n callback();\n return;\n }\n\n // async post each note as an inline comment to phabricator.\n var postRelevant = function(item, callback) {\n conduitInstance.differentialCreateInline(revisionID,\n diffID, item.location.path, true,\n item.location.range.start_line, undefined,\n item.category + \": \" + item.description, callback);\n };\n\n // run above function async over each relevant entry.\n async.serialAsyncForEach(relevant, postRelevant,\n function(error) {\n if (error !== undefined) {\n callback(error);\n return;\n }\n // inline comments won't be committed/shown until\n // a createComment is posted with attachInlines == true\n conduitInstance.differentialCreateComment(\n revisionID, \"\", \"comment\", false /* silent */,\n true /* attachInlines */, callback);\n });\n });\n}", "title": "" }, { "docid": "207d6da07ca4844c7407d5ef831e7651", "score": "0.39047074", "text": "getImpressionsToPost() {\n const impressionsToPost = [];\n const splice = this._impressions.splice(0, IMPRESSIONS_PER_POST);\n const groupedImpressions = new Map();\n \n splice.forEach(impression => {\n // Builds the keyImpression object\n const keyImpressions = {\n keyName: impression.keyName,\n treatment: impression.treatment,\n time: impression.time,\n changeNumber: impression.changeNumber,\n label: impression.label,\n };\n // Checks if already exists in order to add o create new impression bulks\n if (!groupedImpressions.has(impression.feature)) {\n groupedImpressions.set(impression.feature, [keyImpressions]);\n } else {\n const currentImpressions = groupedImpressions.get(impression.feature);\n groupedImpressions.set(impression.feature, currentImpressions.concat(keyImpressions));\n }\n });\n \n // Builds the entire bulk\n /*\n {\n \"impressions\": [{\n \"testName\": \"example-1\",\n \"keyImpressions\": [impression1, impression2, ...]\n }, {\n \"testName\": \"example-1\",\n \"keyImpressions\": [impression1, impression2, ...]\n }]\n }\n */\n groupedImpressions.forEach((value, key) => {\n const impressionToPost = {\n testName: key,\n keyImpressions: value,\n };\n impressionsToPost.push(impressionToPost);\n });\n return impressionsToPost;\n }", "title": "" }, { "docid": "d768c3f8d2161eff5f6c8737e07e847c", "score": "0.38925093", "text": "process(text) {\n if (!text)\n return null\n\n let props = {\n data: text,\n }\n \n props.links = this.links(text)\n props.links.forEach(l => {\n let c = `<a href=${l.link} target=\"_blank\">${l.link}</a>`\n if (l.image)\n c = `<img src=${l.link}></img>`\n\n props.data = props.data.replace(l.link, c)\n })\n\n props.refs = this.ref(text)\n props.refs.forEach(l => {\n let c = `<a href=${l.slug}>${l.clean}</a>`\n props.data = props.data.replace(l.link, c)\n })\n \n return props;\n }", "title": "" }, { "docid": "6cc8a191dde2943abcbe7a72bc5d10c2", "score": "0.38840723", "text": "function populateData (myData, myMetaData, searchType) {\n\t\teditData(myData); //Prep the key values in myData object before compiling in Handlebars\n\t\tconsole.log('myData =');\n\t\tconsole.log(myData)\n\t\tconsole.log(searchType)\n\t\t\n\t\t$contentFeed.empty(); //Empty content feed on new search response\n\t\t$bgImg.removeClass('bg-img-repeat'); //Remove bg-img-repeat class on new search response\n\n\t\tfor (var i=0; i<myData.length; ++i) {\n\t var newData = compileContentFeed(myData[i], searchType); //Compile all the data in the array\n\n\t if (myData.length > 7) {\n\t \t$bgImg.addClass('bg-img-repeat'); //Add bg-img-repeat class when more than 8 objects\n\t }\n\t $('#landingPage').addClass('hide');\n\t $contentFeed.append(newData); //Append all the data in the $contentFeed\n\t }\n\t compileMetaData(myMetaData); //Compile meta data\n\t addPagination(myMetaData); //Add pagination\n\t $('#mainContent').foundation(); //Re-initialize all plugins within $contentFeed\n\t}", "title": "" }, { "docid": "dca025334936464345bfc0cb89fabd67", "score": "0.38805202", "text": "_processFields() {\n\t\t\tthis.$fields = null;\n\t\t\tthis.$primaryField = null;\n\t\t\tthis.$softDelete = false;\n\t\t\tthis.$shouldAuthorizeFields = false;\n\n\t\t\tif (_.isObject(this.settings.fields)) {\n\t\t\t\tthis.logger.debug(`Process field definitions...`);\n\n\t\t\t\tthis.$fields = this._processFieldObject(this.settings.fields);\n\n\t\t\t\t// Compile validators for basic methods\n\t\t\t\tthis.$validators = {\n\t\t\t\t\tcreate: validator.compile(\n\t\t\t\t\t\tgenerateValidatorSchemaFromFields(this.settings.fields, {\n\t\t\t\t\t\t\ttype: \"create\",\n\t\t\t\t\t\t\tenableParamsConversion: mixinOpts.enableParamsConversion\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t\tupdate: validator.compile(\n\t\t\t\t\t\tgenerateValidatorSchemaFromFields(this.settings.fields, {\n\t\t\t\t\t\t\ttype: \"update\",\n\t\t\t\t\t\t\tenableParamsConversion: mixinOpts.enableParamsConversion\n\t\t\t\t\t\t})\n\t\t\t\t\t),\n\t\t\t\t\treplace: validator.compile(\n\t\t\t\t\t\tgenerateValidatorSchemaFromFields(this.settings.fields, {\n\t\t\t\t\t\t\ttype: \"replace\",\n\t\t\t\t\t\t\tenableParamsConversion: mixinOpts.enableParamsConversion\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (!this.$primaryField) this.$primaryField = { name: \"_id\", columnName: \"_id\" };\n\t\t\tif (this.$softDelete) this.logger.debug(\"Soft delete mode: ENABLED\");\n\t\t\tthis.logger.debug(`Primary key field`, this.$primaryField);\n\t\t}", "title": "" }, { "docid": "e96c65d700ac50a996331109e5023417", "score": "0.3878972", "text": "walkAllFields(scriptContent, paramType, iteree) {\n for (const collectionName of Object.keys(scriptContent)) {\n if (collectionName === 'meta') {\n continue;\n }\n const collection = scriptContent[collectionName];\n if (!collection) {\n continue;\n }\n const resourceType = TextUtil.singularize(collectionName);\n for (const resource of collection) {\n this.walkResource(resourceType, resource, paramType,\n (obj, paramSpec) => iteree(collectionName, resource, obj,\n paramSpec));\n }\n }\n }", "title": "" }, { "docid": "324acd27b8e0033b3ed2f104a69d47c4", "score": "0.3876063", "text": "static normalize(data) {\n let post = _$1.mapKeys(data, (v, k) => _$1.snakeCase(k));\n post.md5 = post.md_5;\n\n const flags = post.flags.split(/\\s+/);\n post.is_pending = _$1.indexOf(flags, \"pending\") !== -1;\n post.is_flagged = _$1.indexOf(flags, \"flagged\") !== -1;\n post.is_deleted = _$1.indexOf(flags, \"deleted\") !== -1;\n\n post.has_visible_children = post.has_children;\n post.tag_string = post.tags;\n post.pool_string = post.pools;\n post.status_flags = post.flags;\n post.image_width = post.width;\n post.image_height = post.height;\n\n return post;\n }", "title": "" }, { "docid": "033b9159f2ce0de201df353989628973", "score": "0.38661626", "text": "function postProcessAttachments(results, asBlob) {\n\t return PouchPromise.all(results.map(function (row) {\n\t if (row.doc && row.doc._attachments) {\n\t var attNames = Object.keys(row.doc._attachments);\n\t return PouchPromise.all(attNames.map(function (att) {\n\t var attObj = row.doc._attachments[att];\n\t if (!('body' in attObj)) { // already processed\n\t return;\n\t }\n\t var body = attObj.body;\n\t var type = attObj.content_type;\n\t return new PouchPromise(function (resolve) {\n\t readBlobData(body, type, asBlob, function (data) {\n\t row.doc._attachments[att] = jsExtend.extend(\n\t pick(attObj, ['digest', 'content_type']),\n\t {data: data}\n\t );\n\t resolve();\n\t });\n\t });\n\t }));\n\t }\n\t }));\n\t}", "title": "" }, { "docid": "e92c68311cda4a30288f1da2d0ed1ef7", "score": "0.3856695", "text": "async function addProcessorsToForm(form) {\n\tconst processors = await FormProcessorModel.find({ form: form._id });\n\t//@TODO Add type labels\n\tform.processors = processors ? processors : [];\n\treturn form;\n}", "title": "" }, { "docid": "2043ceb661a74802f72d682b08b0a1eb", "score": "0.385482", "text": "async getStatsForFields(\n indexPatternTitle,\n query,\n fields,\n samplerShardSize,\n timeFieldName,\n earliestMs,\n latestMs,\n interval,\n maxExamples) {\n\n // Batch up fields by type, getting stats for multiple fields at a time.\n const batches = [];\n const batchedFields = {};\n _.each(fields, (field) => {\n if (field.fieldName === undefined) {\n // undefined fieldName is used for a document count request.\n // getDocumentCountStats requires timeField - don't add to batched requests if not defined\n if (timeFieldName !== undefined) {\n batches.push([field]);\n }\n } else {\n const fieldType = field.type;\n if (batchedFields[fieldType] === undefined) {\n batchedFields[fieldType] = [[]];\n }\n let lastArray = _.last(batchedFields[fieldType]);\n if (lastArray.length === FIELDS_REQUEST_BATCH_SIZE) {\n lastArray = [];\n batchedFields[fieldType].push(lastArray);\n }\n lastArray.push(field);\n }\n });\n\n _.each(batchedFields, (lists) => {\n batches.push(...lists);\n });\n\n\n let results = [];\n await Promise.all(batches.map(async (batch) => {\n let batchStats = [];\n const first = batch[0];\n switch (first.type) {\n case ML_JOB_FIELD_TYPES.NUMBER:\n // undefined fieldName is used for a document count request.\n if (first.fieldName !== undefined) {\n batchStats = await this.getNumericFieldsStats(\n indexPatternTitle,\n query,\n batch,\n samplerShardSize,\n timeFieldName,\n earliestMs,\n latestMs);\n } else {\n // Will only ever be one document count card,\n // so no value in batching up the single request.\n const stats = await this.getDocumentCountStats(\n indexPatternTitle,\n query,\n timeFieldName,\n earliestMs,\n latestMs,\n interval);\n batchStats.push(stats);\n }\n break;\n case ML_JOB_FIELD_TYPES.KEYWORD:\n case ML_JOB_FIELD_TYPES.IP:\n batchStats = await this.getStringFieldsStats(\n indexPatternTitle,\n query,\n batch,\n samplerShardSize,\n timeFieldName,\n earliestMs,\n latestMs);\n break;\n case ML_JOB_FIELD_TYPES.DATE:\n batchStats = await this.getDateFieldsStats(\n indexPatternTitle,\n query,\n batch,\n samplerShardSize,\n timeFieldName,\n earliestMs,\n latestMs);\n break;\n case ML_JOB_FIELD_TYPES.BOOLEAN:\n batchStats = await this.getBooleanFieldsStats(\n indexPatternTitle,\n query,\n batch,\n samplerShardSize,\n timeFieldName,\n earliestMs,\n latestMs);\n break;\n case ML_JOB_FIELD_TYPES.TEXT:\n default:\n // Use an exists filter on the the field name to get\n // examples of the field, so cannot batch up.\n await Promise.all(batch.map(async (field) => {\n const stats = await this.getFieldExamples(\n indexPatternTitle,\n query,\n field.fieldName,\n timeFieldName,\n earliestMs,\n latestMs,\n maxExamples);\n batchStats.push(stats);\n }));\n break;\n }\n\n results = [...results, ...batchStats];\n }));\n\n return results;\n }", "title": "" }, { "docid": "aac3678d093b6bff35a9864e6f592c52", "score": "0.38447616", "text": "formatData(items) {\n let tempItems = items.map((item) => {\n let id = item.sys.id;\n let images = item.fields.images.map((image) => image.fields.file.url);\n\n let property = { ...item.fields, images, id };\n return property;\n });\n return tempItems;\n }", "title": "" }, { "docid": "f9b307fd88a75c6da7af42d61e6fa23d", "score": "0.38386816", "text": "function generateFormFilings($button){\n var data = {};\n data['general-data'] = {};\n $('.general-data .filing-data').each(function() {\n if ($(this).data('name') === 'company-name'){\n data['general-data']['cik'] = $(this).attr('href');\n }\n if ($(this).text() === \"☒\"){\n data['general-data'][$(this).data('name')] = '1';\n\n } else if ($(this).text() === \"☐\"){\n data['general-data'][$(this).data('name')] = '0';\n } else {\n data['general-data'][$(this).data('name')] = $(this).text();\n }\n });\n\n\n data['non-derivative'] = {};\n data['derivative'] = {};\n $('.non-derivative, .derivative').each(function() {\n let className = $(this).attr('class');\n let i = Object.keys(data[className]).length;\n data[className][i] = {};\n $(this).find('.filing-data').each(function () {\n data[className][i][$(this).data('name')] = $(this).text();\n });\n });\n\n data['reporting-person'] = {};\n $('.reporting-person').each(function () {\n let i = Object.keys(data['reporting-person']).length;\n data['reporting-person'][i] = {};\n $(this).find('.filing-data').each(function () {\n if ($(this).data('name') === 'name-address'){\n data['reporting-person'][i]['cik'] = $(this).attr('href');\n data['reporting-person'][i]['cik-number'] = $(this).data('cik');\n } else if ($(this).data('code')) {\n data['reporting-person'][i][$(this).data('name')] = $(this).data('code-description');\n data['reporting-person'][i][$(this).data('code')] = $(this).text();\n }\n else {\n data['reporting-person'][i][$(this).data('name')] = $(this).text();\n }\n });\n });\n\n\n\n data['footnotes'] = {};\n $('#footnotes .filing-data').each(function () {\n let i = Object.keys(data['footnotes']).length;\n data['footnotes'][i] = {};\n data['footnotes'][i] = $(this).text();\n });\n\n data['remarks'] = {};\n $('#remarks .filing-data').each(function () {\n let i = Object.keys(data['remarks']).length;\n data['remarks'][i] = {};\n data['remarks'][i] = $(this).text();\n });\n\n data['signatures'] = {};\n $('.signature').each(function () {\n let i = Object.keys(data['signatures']).length;\n data['signatures'][i] = {};\n $(this).find('.filing-data').each(function () {\n data['signatures'][i][$(this).data('name')] = $(this).text();\n });\n });\n\n let htmlContent = $(\"#content\").html();\n\n let stringJson = JSON.stringify(data);\n $.ajax({\n type: 'POST',\n data: {\n formType: formType,\n filingId: filingID,\n data: stringJson,\n htmlContent: htmlContent,\n },\n headers: {'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')},\n url: '/generate-filing/generate-filing',\n success: function(response) {\n var link = document.createElement(\"a\");\n link.download = response.file_name;\n link.href = response.url_to_file;\n link.click();\n }\n });\n}", "title": "" }, { "docid": "aff1875b65865d1a202ba489fc067c93", "score": "0.38320106", "text": "_generateParts2() {\n // Generate the MessagePart body\n const body = this.initBodyWithMetadata(['sourceUrl', 'previewUrl', 'artist', 'fileName', 'orientation',\n 'width', 'height', 'previewWidth', 'previewHeight', 'title', 'subtitle']);\n\n // Generate the MessagePart with the body\n this.part = new MessagePart({\n mimeType: this.constructor.MIMEType,\n body: JSON.stringify(body),\n });\n const parts = [this.part];\n\n // If there is a source part, add it to the parts array and add it to the Message Part\n // Node Heirarchy\n if (this.source) {\n parts.push(this.source);\n this.addChildPart(this.source, 'source');\n }\n\n // If there is a preview part, add it to the parts array and add it to the Message Part\n // Node Heirarchy\n if (this.preview) {\n parts.push(this.preview);\n this.addChildPart(this.preview, 'preview');\n }\n\n return parts;\n }", "title": "" }, { "docid": "3744fa0d10292edb6119366a1a34a39c", "score": "0.38259333", "text": "processAll(input) {\n // should be an array of url strings\n input = makeArray(input);\n\n // An array of promises\n let items = _.map(input, this.process.bind(this));\n\n // After all URLs have been processed, handle collecting the next set of\n // URLs to process.\n return Promise.all(items)\n .then(this.getOutput.bind(this))\n .catch(e => {\n console.log('processAll failed.');\n console.error(e);\n });\n }", "title": "" }, { "docid": "73088f4dfbb6732ebdd225d44cf63b06", "score": "0.3822154", "text": "function postProcessAttachments(results, asBlob) {\n return PouchPromise.all(results.map(function (row) {\n if (row.doc && row.doc._attachments) {\n var attNames = Object.keys(row.doc._attachments);\n return PouchPromise.all(attNames.map(function (att) {\n var attObj = row.doc._attachments[att];\n if (!('body' in attObj)) { // already processed\n return;\n }\n var body = attObj.body;\n var type = attObj.content_type;\n return new PouchPromise(function (resolve) {\n readBlobData(body, type, asBlob, function (data) {\n row.doc._attachments[att] = jsExtend.extend(\n pick(attObj, ['digest', 'content_type']),\n {data: data}\n );\n resolve();\n });\n });\n }));\n }\n }));\n}", "title": "" }, { "docid": "d3e0bace7cc5de0872241631c12b5f19", "score": "0.38172963", "text": "function process_sorted_data() {\n\t\tvar new_val = '';\n\n\t\t// Articles added to the Page Builder interface.\n\t\tplaced_articles = $( '#ttfmake-stage' ).find( '.wsuwp-spine-builder-column' );\n\n\t\t$.each( placed_articles, function() {\n\t\t\tvar column = $(this),\n\t\t\t\tarticle = column.children( '.issue-article' );\n\n\t\t\tif ( article.length ) {\n\t\t\t\tvar new_val = article[0].id.replace( 'issue-article-', '' ),\n\t\t\t\t\theadline = article.data( 'headline' ),\n\t\t\t\t\tsubtitle = article.data( 'subtitle' ),\n\t\t\t\t\tbg_id = article.data( 'background-id' ),\n\t\t\t\t\tbg_url = article.data( 'background-image' ),\n\t\t\t\t\tbg_sizes = article.data( 'background-sizes' ),\n\t\t\t\t\tbg_size = article.data( 'background-size' ),\n\t\t\t\t\tposition = article.data( 'background-position' ),\n\t\t\t\t\tsize_select = column.find( '.spine-builder-column-background-size' );\n\n\t\t\t\t// Always set Post ID and Headline values.\n\t\t\t\tcolumn.children( '.wsuwp-column-post-id' ).val( new_val );\n\t\t\t\tcolumn.find( '.spine-builder-column-headline' ).val( headline );\n\n\t\t\t\t// \"First Words\" articles don't display a subtitle.\n\t\t\t\tif ( column.closest( '.ttfmake-section' ).hasClass('ttfmake-section-wsuwpsingle') ) {\n\t\t\t\t\tcolumn.find( '.spine-builder-column-subtitle' ).val( '' );\n\t\t\t\t} else {\n\t\t\t\t\tcolumn.find( '.spine-builder-column-subtitle' ).val( subtitle );\n\t\t\t\t}\n\n\t\t\t\t// Set the background value and update the HTML if needed.\n\t\t\t\tcolumn.find( '.spine-builder-column-background-id' ).val( bg_id );\n\t\t\t\tif ( bg_url.length ) {\n\t\t\t\t\tcolumn.find('.spine-builder-column-set-background-image').html('<img src=\"' + bg_url + '\" />').\n\t\t\t\t\t\tnext('.spine-builder-column-remove-background-image').show();\n\t\t\t\t} else {\n\t\t\t\t\tcolumn.find('.spine-builder-column-set-background-image').html('Set background image').\n\t\t\t\t\t\tnext('.spine-builder-column-remove-background-image').hide();\n\t\t\t\t}\n\n\t\t\t\t// Set the background size options.\n\t\t\t\tsize_select.find('option:gt(0)').remove();\n\t\t\t\tif ( bg_sizes.length ) {\n\t\t\t\t\tvar sizes = bg_sizes.split(',');\n\n\t\t\t\t\t$.each( sizes, function(index, value) {\n\t\t\t\t\t\tvar size = value.split(':'),\n\t\t\t\t\t\t\toption = '<option value=\"' + size[0] + '\">' + size[1] + '</option>';\n\n\t\t\t\t\t\tsize_select.append(option);\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tif ( bg_size.length ) {\n\t\t\t\t\tsize_select.val(bg_size);\n\t\t\t\t}\n\n\t\t\t\t// Set background position value if not in a \"Secondary Articles\" section.\n\t\t\t\tif ( column.closest( '.ttfmake-section' ).hasClass('ttfmake-section-wsuwpsecondary') ) {\n\t\t\t\t\tcolumn.find( '.spine-builder-column-background-position' ).val( '' );\n\t\t\t\t\tarticle.find( '.wsm-article-body' ).css('background-position', '' );\n\t\t\t\t} else {\n\t\t\t\t\tcolumn.find( '.spine-builder-column-background-position' ).val( position );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcolumn.find( '.wsm-article-meta' ).val( '' );\n\t\t\t\tcolumn.find('.spine-builder-column-set-background-image').html('Set background image').\n\t\t\t\t\tnext('.spine-builder-column-remove-background-image').hide();\n\t\t\t}\n\t\t} );\n\n\t\t// Articles in the staging area.\n\t\tstaged_articles = $issue_articles.sortable( 'toArray' );\n\n\t\t$.each( staged_articles, function( index, val ) {\n\t\t\tnew_val = val.replace( 'issue-article-', '' );\n\t\t\tstaged_articles[index] = new_val;\n\t\t} );\n\n\t\t$( '#issue-staged-articles' ).val( staged_articles );\n\n\t}", "title": "" }, { "docid": "d8b6e17eb839345b3c75339fba967ee5", "score": "0.38094926", "text": "function postProcess (data) {\n // If we are processing a balances request then just pull out the balances\n if (data.type === 'balances') {\n return {\n balances:\n (data.balances.balances || [])\n .map(balance => ({\n asset: balance.asset,\n free: parseFloat(balance.free),\n locked: parseFloat(balance.locked),\n }))\n .filter(balance => balance.free || balance.locked)\n }\n }\n if (data.type === 'trades') {\n return tradesProcessor(data)\n }\n // Otherwise just return the data untouched\n return data\n}", "title": "" }, { "docid": "07a5f597cd0d3ef8401e85019a1ca494", "score": "0.38014662", "text": "static get PARTS() {\n return {\n contentDetails: 2,\n fileDetails: 1,\n id: 0,\n liveStreamingDetails: 2,\n localizations: 2,\n player: 0,\n processingDetails: 1,\n recordingDetails: 2,\n snippet: 2,\n statistics: 2,\n status: 2,\n suggestions: 1,\n topicDetails: 2\n };\n }", "title": "" }, { "docid": "2f730df9dcd9ca4af709899c0a942048", "score": "0.37998685", "text": "function configurePostProcesses(scene, rootUrl) {\n if (rootUrl === void 0) { rootUrl = null; }\n var _a, _b, _c;\n if (rootUrl === null || !((_a = scene.metadata) === null || _a === void 0 ? void 0 : _a.postProcesses)) {\n return;\n }\n // Load post-processes configuration\n var data = scene.metadata.postProcesses;\n if (data.ssao && !exports.ssao2RenderingPipelineRef) {\n exports.ssao2RenderingPipelineRef = core_1.SSAO2RenderingPipeline.Parse(data.ssao.json, scene, rootUrl);\n if (data.ssao.enabled) {\n scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(exports.ssao2RenderingPipelineRef.name, scene.cameras);\n }\n }\n if (((_b = data.screenSpaceReflections) === null || _b === void 0 ? void 0 : _b.json) && !exports.screenSpaceReflectionPostProcessRef) {\n exports.screenSpaceReflectionPostProcessRef = core_1.ScreenSpaceReflectionPostProcess._Parse(data.screenSpaceReflections.json, scene.activeCamera, scene, \"\");\n }\n if (data.default && !exports.defaultRenderingPipelineRef) {\n exports.defaultRenderingPipelineRef = core_1.DefaultRenderingPipeline.Parse(data.default.json, scene, rootUrl);\n if (!data.default.enabled) {\n scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(exports.defaultRenderingPipelineRef.name, scene.cameras);\n }\n }\n if ((_c = data.motionBlur) === null || _c === void 0 ? void 0 : _c.json) {\n exports.motionBlurPostProcessRef = core_1.MotionBlurPostProcess._Parse(data.motionBlur.json, scene.activeCamera, scene, \"\");\n }\n scene.onDisposeObservable.addOnce(function () {\n exports.ssao2RenderingPipelineRef = null;\n exports.screenSpaceReflectionPostProcessRef = null;\n exports.defaultRenderingPipelineRef = null;\n exports.motionBlurPostProcessRef = null;\n });\n}", "title": "" }, { "docid": "09de3dc195f43b4bf5479791a787bac4", "score": "0.3795058", "text": "createDescription() {\n return {\n processLayersDefault: this.m_processLayersDefault,\n processPointsDefault: this.m_processPointsDefault,\n processLinesDefault: this.m_processLinesDefault,\n processPolygonsDefault: this.m_processPolygonsDefault,\n layersToProcess: this.m_layersToProcess,\n layersToIgnore: this.m_layersToIgnore,\n pointsToProcess: this.m_pointsToProcess,\n pointsToIgnore: this.m_ignoredPoints,\n linesToProcess: this.m_linesToProcess,\n linesToIgnore: this.m_linesToIgnore,\n polygonsToProcess: this.m_polygonsToProcess,\n polygonsToIgnore: this.m_polygonsToIgnore,\n kindsToProcess: this.m_kindsToProcess,\n kindsToIgnore: this.m_kindsToIgnore\n };\n }", "title": "" }, { "docid": "48dccfdc35e65a4763232309527d9afa", "score": "0.37911347", "text": "static preprocessInfo({mediaInfo})\n {\n mediaInfo = { ...mediaInfo };\n\n let { type } = helpers.mediaId.parse(mediaInfo.mediaId);\n if(type == \"folder\")\n {\n mediaInfo.mangaPages = [];\n\n // These metadata fields don't exist for folders.\n mediaInfo.userName = null;\n mediaInfo.illustType = 0;\n }\n else\n {\n // Vview images don't use pages and always have one page.\n mediaInfo.mangaPages = [{\n width: mediaInfo.width,\n height: mediaInfo.height,\n urls: mediaInfo.urls,\n }];\n }\n return mediaInfo;\n }", "title": "" }, { "docid": "61ac3b8027a769e6846ba66994860420", "score": "0.3787696", "text": "function recreateDynamicArrays() {\n dynamicProjectHolder.createAllTasks(projectHolder.groupAllTasks());\n dynamicProjectHolder.sortAllByDate();\n dynamicProjectHolder.createTodayTasks();\n dynamicProjectHolder.createWeekTasks();\n dynamicProjectHolder.createLateTasks();\n}", "title": "" }, { "docid": "09fcef2029037cfe03a2549775d7d3e4", "score": "0.37754256", "text": "postProcess() {\n const vertices = {}; // These are metaVertices\n const topLevelVertices = {}; // These are metaVertices\n const inEdges = {};\n for (let coprocessor of coprocessors)\n coprocessor.postProcessStart.call(this,vertices,topLevelVertices, inEdges);\n\n // Put information from each vertex into its meta-vertex,\n // and attach additional data on assertions, goals, & required signatures into meta.state\n for (const vertex of this.g.verticies) {\n for (let coprocessor of coprocessors)\n coprocessor.postProcessEachVertex.call(this,vertex,vertices,topLevelVertices, inEdges);\n }\n\n // Process each edge by itself to create initial processing data, and build:\n // * A vertex.state.children hierarchy\n // * topLevelVertices\n // * inEdges.equivalent\n // * inEdges.narrows\n for (const edge of this.g.edges) {\n for (let coprocessor of coprocessors)\n coprocessor.postProcessEachEdge.call(this,edge,vertices,topLevelVertices, inEdges);\n }\n\n let hash;\n do {\n hash = hashSortCoerce.hash(topLevelVertices);\n\n // Handle relations between competencies, to determine how the competencies relate to goals\n for (const edge of this.g.edges) {\n for (let coprocessor of coprocessors)\n coprocessor.postProcessEachEdgeRepeating.call(this,edge,vertices,topLevelVertices, inEdges);\n }\n\n for (const vertex of this.g.verticies) {\n for (let coprocessor of coprocessors)\n coprocessor.postProcessEachVertexRepeating.call(this,vertex,vertices,topLevelVertices, inEdges);\n }\n } while (hash !== hashSortCoerce.hash(topLevelVertices));\n\n let profile = {\n children: []\n };\n for (let coprocessor of coprocessors)\n coprocessor.postProcessProfileBefore.call(this,profile,vertices,topLevelVertices, inEdges);\n\n // Hides data from outputted profile\n const pruneNonFrameworkData = (vertex, depth)=>{\n if (depth == null)\n depth = 0;\n delete vertex.framework;\n for (let i = 0; i < vertex.children.length; i++) {\n let prune = pruneNonFrameworkData(vertex.children[i], depth + 1);\n if (prune.length == 0) {\n vertex.children.splice(i--, 1);\n }\n if (prune.length == 1) {\n vertex.children.splice(i, 1, ...prune);\n }\n if (prune.length > 1) {\n vertex.children.splice(i--, 1, ...prune);\n }\n }\n if (!EcArray.has(this.framework.competency, vertex.id)) {\n return vertex.children;\n }\n return [vertex];\n };\n\n // Add top-level vertices to profile's children - they store references to all other children\n for (var vertexKey in topLevelVertices) {\n profile.children = profile.children.concat(topLevelVertices[vertexKey]);\n }\n // Get summary statistics for results\n for (const child of profile.children) {\n for (let coprocessor of coprocessors)\n coprocessor.postProcessProfileEachElement.call(this,child,inEdges,vertices);\n }\n\n let newChildren = [];\n for (let i = 0; i < profile.children.length; i++)\n newChildren = newChildren.concat(pruneNonFrameworkData(profile.children[i]));\n\n profile.children = newChildren;\n\n // Insert profile.timeline (resource alignments for goal competencies and their children)\n for (let obj of profile.children)\n for (let coprocessor of coprocessors)\n coprocessor.postProcessProfileAfter.call(this,obj,profile);\n this.log(\"Done computing profile.\");\n\n return profile;\n }", "title": "" }, { "docid": "ec7a6bbb821c65f71ab4bb696253ca4c", "score": "0.3773254", "text": "function consolidate_features(all_decisions) {\n record = {\n 'subject': [],\n 'location': []\n }\n all_decisions.forEach((token, index) => {\n parsed_class = token['winning_class'][0]\n token_value = token['token']\n /*token_value = token['token']\n if (index == 0 && parsed_class == 'name_component') {\n\n } else {*/\n switch (parsed_class) {\n case 'name_component':\n mr = merge_if_directly_subsequent_is_alike(all_decisions, index, token['winning_class'][0])\n if (mr) {\n all_decisions[index + 1] = mr\n } else {\n record['subject'].push({\n 'value': token_value,\n 'type': 'primary'\n })\n }\n break;\n case 'job_component':\n if (!record['subject'].length == 0) {\n record['subject'][0]['occupation'] = token_value;\n }\n break;\n case 'predicate':\n switch (token_value) {\n case 'wid':\n if (!record['subject'].length == 0) {\n record['subject'][0]['occupation'] = 'widow';\n }\n deceased_name = look_for_name_of_deceased(all_decisions, index)\n if (deceased_name) {\n record['subject'].push({\n 'value': deceased_name,\n 'type': 'deceased spouse of primary'\n })\n }\n break;\n case 'h':\n modify_probability_of_subsequent(['job_component', 'name_component'], {\n \"address_component\": 1.0\n }, all_decisions, index)\n attach_to_next(all_decisions, index, 'address_component', [{\n 'type': 'home'\n }])\n break;\n case 'r':\n modify_probability_of_subsequent(['job_component', 'name_component'], {\n \"address_component\": 1.0\n }, all_decisions, index)\n attach_to_next(all_decisions, index, 'address_component', [{\n 'position': 'rear'\n }])\n break;\n default:\n // Now we want to see if the predicate is actually a part of a\n // name –– e.g. 'A' is part of the name 'SMITH JOHN A'\n\n // check if last token was parsed as a name; if so, add it to the name\n if (all_decisions[index - 1]) {\n if (all_decisions[index - 1]['winning_class'][0] == \"name_component\") {\n if (record['subject'][0]) {\n record['subject'][0]['value'] = record['subject'][0]['value'] + \" \" + token_value\n }\n } else if (TokenInterpret.matches_cardinal_dir(token_value)) {\n console.log(\"treating as address: \" + token_value)\n treat_token_as_address_component(token, all_decisions, index, record)\n }\n }\n break;\n\n }\n break;\n case 'address_component':\n treat_token_as_address_component(token, all_decisions, index, record)\n break;\n }\n\n })\n return record;\n}", "title": "" }, { "docid": "91784e402451691fdb55c5d344e7a360", "score": "0.3771902", "text": "function createSubmissionPart(submissionPartPostRequest, responseHandler) {\n let url = baseSubmissionUrl + \"part/\";\n let json = JSON.stringify(submissionPartPostRequest);\n return $.ajax({\n url: url,\n type: \"POST\",\n data: json,\n contentType: \"application/json\",\n dataType: \"json\",\n success: function (response) {\n responseHandler(response);\n },\n error: function (e) {\n console.log(e);\n }\n });\n}", "title": "" }, { "docid": "018aa6c404c63f9aec0b714261f53b9a", "score": "0.3769869", "text": "function initFieldMap()\r\n{\r\n\t// GRAPHIC BLOCK\r\n\tvar hdr_arr = new Array();\r\n\tmasterFields[GRAPHIC_OBJ - 1] = hdr_arr;\r\n\r\n\t// CLASS BLOCK\r\n\tvar class_arr = new Array();\r\n\tclass_arr.push(new FieldMap('classHeader', 'classEditHeader', true, INPUT_TEXT_FLD));\r\n\tclass_arr.push(new FieldMap('className', 'classEditName', true, INPUT_TEXT_FLD));\r\n\tclass_arr.push(new FieldMap('classDescription', 'classEditDescription', true, TEXT_AREA_FLD));\r\n\tclass_arr.push(new FieldMap('classImgURL', 'classEditImgURL', true, IMAGE_FLD));\r\n\tmasterFields[CLASS_OBJ - 1] = class_arr;\r\n\r\n\t// WORKSHOP BLOCK\r\n\tvar wrk_arr = new Array();\r\n\twrk_arr.push(new FieldMap('workshopHeader', 'workshopEditHeader', true, INPUT_TEXT_FLD));\r\n\twrk_arr.push(new FieldMap('workshopName', 'workshopEditName', true, INPUT_TEXT_FLD));\r\n\twrk_arr.push(new FieldMap('workshopDescription', 'workshopEditDescription', true, TEXT_AREA_FLD));\r\n\twrk_arr.push(new FieldMap('workshopImgURL', 'workshopEditImgURL', true, IMAGE_FLD));\r\n\tmasterFields[WORKSHOP_OBJ - 1] = wrk_arr;\r\n\r\n\t// STAFF BLOCK\r\n\tvar st_arr = new Array();\r\n\tst_arr.push(new FieldMap('staffName', 'staffEditName', true, INPUT_TEXT_FLD));\r\n\tst_arr.push(new FieldMap('staffDescription', 'staffEditDescription', true, TEXT_AREA_FLD));\r\n\tmasterFields[STAFF_OBJ - 1] = st_arr;\r\n\r\n\t// TEXT BLOCK\r\n\tvar arr = new Array();\r\n\tarr.push(new FieldMap('textName', 'textEditName', true, INPUT_TEXT_FLD));\r\n\tarr.push(new FieldMap('textDescription', 'textEditDescription', true, TEXT_AREA_FLD));\r\n\tmasterFields[TEXT_OBJ - 1] = arr;\r\n\r\n\t// SCHEDULE BLOCK\r\n\tvar sch_arr = new Array();\r\n\tsch_arr.push(new FieldMap('scheduleName', 'scheduleEditName', true, INPUT_TEXT_FLD));\r\n\tsch_arr.push(new FieldMap('scheduleDescription', 'scheduleEditDescription', true, INPUT_TEXT_FLD));\r\n\tsch_arr.push(new FieldMap('scheduleFullName', 'scheduleEditFullName', true, BUTTON_TEXT_FLD));\r\n\tmasterFields[SCHEDULE_OBJ - 1] = sch_arr;\r\n\r\n\t// SOCIAL BLOCK\r\n\tvar soc_arr = new Array();\r\n\tsoc_arr.push(new FieldMap('socialName', 'socialEditName', true, INPUT_TEXT_FLD));\r\n\tmasterFields[SOCIAL_OBJ - 1] = soc_arr;\r\n\r\n\t// NONCLASS BLOCK\r\n\tvar nonclass_arr = new Array();\r\n\tnonclass_arr.push(new FieldMap('nonclassHeader', 'nonclassEditHeader', true, INPUT_TEXT_FLD));\r\n\tnonclass_arr.push(new FieldMap('nonclassName', 'nonclassEditName', true, INPUT_TEXT_FLD));\r\n\tmasterFields[NON_CLASS_OBJ - 1] = nonclass_arr;\r\n\r\n\t// NON WORKSHOP BLOCK\r\n\tvar nonwrk_arr = new Array();\r\n\tnonwrk_arr.push(new FieldMap('nonworkshopHeader', 'nonworkshopEditHeader', true, INPUT_TEXT_FLD));\r\n\tnonwrk_arr.push(new FieldMap('nonworkshopName', 'nonworkshopEditName', true, INPUT_TEXT_FLD));\r\n\tmasterFields[NON_WORKSHOP_OBJ - 1] = nonwrk_arr;\r\n\r\n\t// FOOTER BLOCK\r\n\tvar foot_arr = new Array();\r\n\tfoot_arr.push(new FieldMap('footerName', 'footerEditName', true, INPUT_TEXT_FLD));\r\n\tfoot_arr.push(new FieldMap('footerDescription', 'footerEditDescription', true, INPUT_TEXT_FLD));\r\n\tmasterFields[FOOTER_OBJ - 1] = foot_arr;\r\n}", "title": "" }, { "docid": "9851cb2793ce214ecd94204dce4f02cf", "score": "0.37672624", "text": "static newInstances(fieldDefs, jsonSchema, pageNumber, page, parentid) {\n var children = [];\n if (fieldDefs !== undefined && fieldDefs !== null && fieldDefs !== \"\") {\n fieldDefs.forEach((field, fieldNumber) => {\n var fieldGenerator = FieldFactory.newInstance(\n field,\n fieldNumber,\n pageNumber,\n jsonSchema,\n page,\n parentid\n );\n if (fieldGenerator !== null) {\n children.push(fieldGenerator);\n }\n });\n }\n return children;\n }", "title": "" }, { "docid": "9cd341194ae25a94c546c9a947acb796", "score": "0.37658685", "text": "get kinds() {\n const oThis = this;\n\n return {\n '1': oThis.emailServiceApiCallHookProcessor,\n '2': oThis.cronProcessesMonitor,\n '3': oThis.bgJobProcessor,\n '4': oThis.notificationJobProcessor,\n '5': oThis.socketJobProcessor,\n '6': oThis.pushNotificationHookProcessor,\n '7': oThis.pushNotificationAggregator,\n '8': oThis.userSocketConnArchival,\n '9': oThis.retryPendingReceiptValidation,\n '10': oThis.pepoMobileEventJobProcessor,\n '11': oThis.reValidateAllReceipts,\n '12': oThis.cdnCacheInvalidationProcessor,\n '13': oThis.pixelJobProcessor,\n '14': oThis.monitorOstEventHooks,\n '15': oThis.populatePopularityCriteria,\n '16': oThis.webhookJobPreProcessor,\n '17': oThis.webhookProcessor,\n '18': oThis.populateUserData,\n '19': oThis.populateUserWeeklyData,\n '20': oThis.zoomMeetingTracker,\n '21': oThis.channelTrendingRankGenerator\n };\n }", "title": "" }, { "docid": "41efe97471fce818f5be31452346e9d5", "score": "0.3763957", "text": "function parseAndUpdateJSONContent(jsonContent, params) {\n jsonContent.content.displaySubmit = activityAdaptor.displaySubmit; \n\n\t\t/* Activity Instructions. */\n\t\tif(jsonContent.content.instructions && jsonContent.content.instructions[0] && jsonContent.content.instructions[0].tag) {\n\t var instructionsTag = jsonContent.content.instructions[0].tag;\n\t __content.directionsXML = jsonContent.content.instructions[0][instructionsTag];\t\t\t\n\t\t}\n\n __content.maxscore = jsonContent.meta.score.max;\n\n /* Make options array and attach base path in media. */\n $.each(jsonContent.content.stimulus, function(i) {\n if(this.tag === \"options\") {\n this.options = this.options.split(\",\");\n }\n if(this.tag === \"image\") {\n this.image = params.productAssetsBasePath + this.image;\n }\n if(this.tag === \"audio\") {\n this.audio = params.productAssetsBasePath + this.audio;\n }\n if(this.tag === \"video\") {\n this.video = params.productAssetsBasePath + this.video; \n }\n });\n\n /* Extract interaction id's and tags from question text. */\n var interactionId = \"\";\n var interactionTag = \"\";\n\n /* String present in href of interaction tag. */\n var interactionReferenceString = \"http://www.comprodls.com/m1.0/interaction/mcqmc\";\n\n /* Parse questiontext as HTML to get HTML tags. */\n var parsedQuestionArray = $.parseHTML(jsonContent.content.canvas.data.questiondata[0].text);\n var j = 0;\n $.each( parsedQuestionArray, function(i) {\n if(this.href === interactionReferenceString) {\n interactionId = this.childNodes[0].nodeValue.trim();\n interactionTag = this.outerHTML;\n interactionTag = interactionTag.replace(/\"/g, \"'\");\n j++;\n }\n });\n\n /* Replace interaction tag with blank string. */\n jsonContent.content.canvas.data.questiondata[0].text = jsonContent.content.canvas.data.questiondata[0].text.replace(interactionTag,\"\");\n var questionText = \"1. \" + jsonContent.content.canvas.data.questiondata[0].text; \n var interactionType = jsonContent.content.interactions[interactionId].type;\n\t\tvar correctAnswers = jsonContent.responses[interactionId].correct;\n\t\t\n\t\t/*for(var j =0; j < correctAnswers.length; j ++) {\n\t\t\t__content.answersXML.push(jsonContent.content.interactions[interactionId][interactionType][correctAnswers[j]].replace(/^\\s+|\\s+$/g, ''));\t\n\t\t}*/\n\t\t\n /* Make optionsXML and answerXML from JSON. */\n\t\tvar optionCount = jsonContent.content.interactions[interactionId][interactionType].length;\n\t\tfor(var i = 0; i < optionCount; i++) {\n var optionObject = jsonContent.content.interactions[interactionId][interactionType][i];\n\t\t\tvar option = optionObject[Object.keys(optionObject)].replace(/^\\s+|\\s+$/g, '');\n\t\t\t__content.optionsXML.push(getHTMLEscapeValue(option));\n\t\t\toptionObject[Object.keys(optionObject)] = option;\n /* Update JSON after updating option. */\n jsonContent.content.interactions[interactionId][interactionType][i] = optionObject;\n $.each(correctAnswers, function(i) {\n if(Object.keys(optionObject) == this) {\n __content.answersXML.push(optionObject[Object.keys(optionObject)]);\n }\n })\n\t\t}\n\n\t\t__content.questionXML = questionText + \" ^^ \" + __content.optionsXML.toString() + \" ^^ \" + interactionId;\t\t\t\t\n\t\t\n\t\t/* Returning processed JSON. */\n\t\treturn jsonContent;\t\n\t}", "title": "" }, { "docid": "66047a853b4d15074afe8af0a8f3372f", "score": "0.37602437", "text": "function prepFn(parms) {\n\t\tvar numInGroup,\n\t\t\tdata = { };\n\n\t\t// Prepare to be called for another probe type\n\t\tif (!Object.keys(remaining).length) {\n\t\t\tinitForNextProbe();\n\t\t\treturn;\n\t\t}\n\n\t\t// Chop off the correct number of items, based on the number of\n\t\t// parallel probes for each type of probe.\n\t\tfor (name in remaining) {\n\t\t\tnumInGroup = Math.ceil(objects[name].length/remaining[name]);\n\t\t\tdata[name] = objects[name].splice(0, numInGroup);\n\t\t\tremaining[name]--;\n\t\t\tif (!objects[name].length || !remaining[name])\n\t\t\t\tdelete remaining[name];\n\t\t}\n\n\t\treturn data;\n\t}", "title": "" }, { "docid": "6a78bb9e836938372579f98ae9d9c73f", "score": "0.37566033", "text": "function formatPost(data){\n data.then(function(gallery){\n var strArr = []\n , altArr = []\n , imgArr = []\n , urlArr = [];\n _.each(gallery.postsArr, function(post){\n var str = post.markdown.toString()\n , img = /'img':'[\\/(\\w)(\\_\\-)']*(\\.(gif|png))'/ig\n , alt = /'alt':'(.)*'/ig\n , url = /'url':'(.)*'/ig\n , final = {};\n\n\n final.img = returnUseableString(img, str, strArr);\n final.alt = returnUseableString(alt, str, altArr);\n final.url = returnUseableString(url, str, urlArr);\n final.classes = post.tagClasses;\n\n if(final.img && final.alt){\n imgArr.push(final);\n }\n });\n gallery.rows = wrapIntoRows(imgArr);\n gallery.imgArr = imgArr;\n });\n }", "title": "" }, { "docid": "ea873b435361dc7e5369c905ef853c4d", "score": "0.3756544", "text": "function postProcessForDisAmbiguation(){\n for (var dupName in dupEntries) {\n var titleArray = [];\n for (var i = 0; i < dupEntries[dupName].length; i++) {\n var dupEntry = dupEntries[dupName][i];\n var abstract = dupEntry[11];\n var url = dupEntry[12];\n var description = getFirst_P_Element(abstract);\n var finalName = generateDisAmbName(dupName, url)\n var dEntryString = '[[' + finalName + ']] ' + description;\n titleArray.push(dEntryString);\n items.push([\n finalName,\n 'A',\n '','','','','','','','','',\n abstract,\n url\n ].join('\\t'));\n }\n // Steps 3 to 5 from above description\n processAndGenerateDisAmbiguationEntry(dupName, titleArray);\n }\n}", "title": "" }, { "docid": "1a9d10920ce0ae86666fa80ab28f32d3", "score": "0.37562928", "text": "createPatch() {\n // Verify that we have the Records we need\n if (!this.originalRecord || !this.patchedRecord) {\n throw new Error('Cannot create Patch without an Original Record and the Patched Record!');\n } // Create the rfc6902 JSON patch from the Record JSON\n\n\n let originalJSON = this.originalRecord.toJSON().artifact;\n let patchedJSON = this.patchedRecord.toJSON().artifact;\n this.rfc6902Patch = this.createRFC6902Patch(originalJSON, patchedJSON); // Set the RFC6902 Patch\n\n this.setPatch(this.rfc6902Patch);\n }", "title": "" }, { "docid": "70af551b92be973a2495c6a9d79940d8", "score": "0.37497604", "text": "function process_data(text) {\n // splits text to lines\n var entries = text.split(\"\\n\");\n entries = sort_tags_to_import(entries);\n var count = entries.length;\n var entry;\n var result = [[], []];\n var object;\n var tags;\n // creates card and tag objects which are meant ot be sent into database\n for (let i = 0; i < count; i += 1) {\n entry = entries[i];\n if (entry[0] == \"card\") {\n tags = entry[3].split(\"|\").sort();\n for (let i = 0; i < tags.length; i += 1) {\n tags[i] = Number(tags[i]);\n }\n object = {id: \"new\", card_front: entry[1], card_back: entry[2], tag_count: tags.length, tags: tags};\n result[0].push(object);\n } else if (entry[0] == \"tag\") {\n object = {id: \"new\", tag_name: entry[2], success_rate: 0, card_count: 0};\n result[1].push(object);\n }\n }\n return filter_json(result);\n}", "title": "" }, { "docid": "075ae5cf43b4b26e276ade97d0bffd3b", "score": "0.3738083", "text": "function populateRunActionsOnInput(action) {\n var newAction = {};\n var prompts = {};\n var sayListArr = [];\n var playListArr = [];\n var playList = {};\n var sayList = {};\n var rawInputAction = {};\n var routeToExtension = {};\n var assignVar = {};\n if (!_.isUndefined(action.inputType)) {\n newAction.inputType = action.inputType;\n if (action.deleteUrl && _.startsWith(action.value, 'http')) {\n playList.url = encodeUtf8(action.value);\n playList.deleteUrl = encodeUtf8(action.deleteUrl);\n playListArr[0] = playList;\n prompts.playList = playListArr;\n } else {\n sayList.value = encodeUtf8(action.value);\n sayListArr[0] = sayList;\n prompts.sayList = sayListArr;\n }\n newAction.prompts = prompts;\n if (newAction.inputType == 2 && !_.isUndefined(action.value)) {\n newAction.description = action.description;\n routeToExtension.destination = '$Input';\n routeToExtension.description = action.description;\n rawInputAction.routeToExtension = routeToExtension;\n newAction.rawInputActions = [];\n newAction.rawInputActions[0] = rawInputAction;\n newAction.minNumberOfCharacters = action.minNumberOfCharacters;\n newAction.maxNumberOfCharacters = action.maxNumberOfCharacters;\n newAction.attempts = 3;\n newAction.repeats = 2;\n } else {\n newAction.description = action.description;\n assignVar.value = '$Input';\n assignVar.variableName = action.variableName;\n rawInputAction.assignVar = assignVar;\n newAction.rawInputActions = [];\n newAction.rawInputActions[0] = rawInputAction;\n\n if (newAction.inputType === 4) {\n newAction.inputs = [];\n _.forEach(action.inputActions, function (inputAction) {\n var assignVar = {};\n var assignVarItem = {};\n var inputItem = {};\n inputItem.actions = [];\n // remove input fields with blank values\n if (!_.isEmpty(inputAction.value)) {\n inputItem.input = inputAction.key;\n assignVarItem.variableName = action.variableName;\n assignVarItem.value = inputAction.value;\n assignVar.assignVar = assignVarItem;\n\n inputItem.actions.push(assignVar);\n\n newAction.inputs.push(inputItem);\n }\n });\n\n }\n\n newAction.minNumberOfCharacters = 1;\n newAction.maxNumberOfCharacters = action.maxNumberOfCharacters;\n newAction.language = action.language;\n newAction.voice = action.voice;\n }\n }\n return newAction;\n }", "title": "" }, { "docid": "0eebdf578c4c9fc15f46b370d71be79f", "score": "0.37348932", "text": "function _process_meta_results (data, type, args){\n\n // Grab meta information.\n var total = data.total();\n var first = data.first();\n var last = data.last();\n var meta_cache = new Array();\n meta_cache.push('[total: ' + total);\n meta_cache.push(', first: ' + first);\n meta_cache.push(', last: ' + last);\n meta_cache.push(']<br />');\n\n // Our element ids.\n var backward_id = 'bak_paging_id_' + core.util.randomness(10);\n var forward_id = 'for_paging_id_' + core.util.randomness(10);\n\n // Determine which arguments we'll (or would) need to page\n // forwards or backwards.\n var b_args = null;\n var f_args = null;\n b_args = core.util.clone(args);\n if( ! b_args['index'] ){ b_args['index'] = 2; }\n b_args['index'] = parseInt(b_args['index']) - 1;\n f_args = core.util.clone(args);\n if( ! f_args['index'] ){ f_args['index'] = 1; }\n f_args['index'] = parseInt(f_args['index']) + 1;\n\n // Increment packet (async ordering).\n b_args['packet'] = last_sent_packet++;\n f_args['packet'] = last_sent_packet++;\n\n // Determine which results processor and urls we'll (or would) use\n // for the binding(s).\n var proc = null\n var backward_url = null;\n var forward_url = null;\n if( type == 'association' ){\n\tproc = _process_assoc_results;\n\tbackward_url = core.api.live_search.association(b_args);\n\tforward_url = core.api.live_search.association(f_args);\n }else if( type == 'gene_product' ){\n\tproc = _process_gp_results;\n\tbackward_url = core.api.live_search.gene_product(b_args);\n\tforward_url = core.api.live_search.gene_product(f_args);\n }else if( type == 'term' ){\n\tproc = _process_term_results;\n\tbackward_url = core.api.live_search.term(b_args);\n\tforward_url = core.api.live_search.term(f_args);\n }else{\n\tcore.kvetch('ERROR: no good type in meta, ready to die...');\n }\n\n // Generate the necessary paging html.\n if( first > 1 ){\n\tmeta_cache.push(' <a href=\"#\" id=\"' + backward_id + '\"><- back</a>');\n }\n if( last < total ){\n\tmeta_cache.push(' <a href=\"#\" id=\"' + forward_id + '\">forward -></a>');\n }\n \n // Add all of the html.\n jQuery('#meta_results').html(meta_cache.join(''));\n\n // Where necessary, add forwards and backwards click bindings.\n if( first > 1 ){\n\t_paging_binding(backward_id, backward_url, proc);\n }\n if( last < total ){\n\t_paging_binding(forward_id, forward_url, proc);\n } \n}", "title": "" }, { "docid": "417a11520a70002ca4133db1aa4bfc16", "score": "0.3733746", "text": "function process() {\n console.log(\"Processing Issues: \" + startDate);\n if (self.config.run_zendesk) {\n processZendeskIssues(startDate);//see if there are any new Zendesk Issues to deal with\n }\n if (self.config.run_jira) {\n processJiraIssues(startDate);//see if there are any new JIRA issues to deal with\n }\n startDate.setMilliseconds(startDate.getMilliseconds() + self.config.sleep); //TODO: is our logic right so that we don't miss any the next time around?\n console.log(\"Processed issues. Sleeping\");\n }", "title": "" }, { "docid": "b524b29b0bd1f71da544e9707c98b05e", "score": "0.37317684", "text": "function getPosters(specs, theta, posterSize)\n{\n posterSize = posterSize || 8;\n var posterSpacing = 4;\n var phiStart = 88 - posterSize;\n var thetaStart = theta - specs.length*(posterSize+posterSpacing)/2;\n var posters = specs.map(spec => {\n var poster = getPoster(spec, thetaStart, phiStart, posterSize);\n thetaStart += (posterSize+posterSpacing);\n return poster;\n });\n console.log(\"POSTERS:\", posters);\n return posters;\n}", "title": "" }, { "docid": "2e438d71eb90a32deab0380d445de7f7", "score": "0.37312758", "text": "function buildExecsObject(obj, regular_expressions) {\n execs = [];\n let r = 0;\n //console.log(obj);\n for (let key in obj) {\n //console.log(key);\n let lineNumber = key;\n let result = obj[key].result;\n let iterations = obj[key].trace;\n let exec = {\n lineNumber: lineNumber,\n iterations: iterations,\n result: result,\n regex: regular_expressions[r].pattern,\n decorationId: \"\",\n };\n execs.push(exec);\n r++;\n }\n // console.log(execs);\n}", "title": "" }, { "docid": "ce2776a843bbc7b9dbfb68c8f87a21cb", "score": "0.3729788", "text": "makeBuildings(props) {\n\n\t\tlet quantity = fancynumber(props.quantity,1,10)\n\t\tfor(let q=0;q<quantity;q++) {\n\t\t\tlet xoffset = fancynumber(props.xoffset,-100,100)\n\t\t\tlet yoffset = fancynumber(props.yoffset,-100,100)\n\t\t\tlet zoffset = fancynumber(props.zoffset,-100,100)\n\t\t\tlet hasroof = fancynumber(props.hasroof) ? true : false\n\t\t\tlet width = fancynumber(props.width,5,100)\n\t\t\tlet depth = fancynumber(props.depth,5,100)\n\t\t\tlet height = fancynumber(props.height,5,100)\n\t\t\tlet floors = fancynumber(props.floors,1,10)\n\t\t\tlet segments = fancynumber(props.segments,1,10)\n\t\t\tlet p = make_entire_building(xoffset,yoffset,zoffset,hasroof,width,depth,height,floors,segments)\n\t\t\tthis.add(p)\n\t\t}\n\n\t\t// add a piece of art to the center\n\t\tlet geometry = new THREE.BoxBufferGeometry(1,1,1,16,16,16)\n\t\tif(this.geometry) this.geometry.dispose()\n\t\tthis.geometry = geometry\n\t\treturn this.geometry\n\t}", "title": "" }, { "docid": "4015cd85a67da9c6c21a83a574545204", "score": "0.37281185", "text": "function create_buildings_reports_controller(){\n\n /* Assuming site_eui vs. gross_floor_area */\n fake_report_data_payload = {\n \"status\": \"success\",\n \"building_counts\" : [\n { \"yr_e\": \"Dec 31,2011\",\n \"num_buildings\": 10, \n \"num_buildings_w_data\": 9\n },\n {\n \"yr_e\": \"Dec 31,2012\",\n \"num_buildings\": 15,\n \"num_buildings_w_data\": 14\n }\n ],\n \"report_data\": [\n {\n id: 5321,\n x: 70,\n y: 20000,\n yr_e: \"2011-12-31\" \n },\n {\n id: 5322,\n x: 71,\n y: 40000,\n yr_e: \"2011-12-31\" \n },\n {\n id: 5321,\n x: 73.1,\n y: 20000,\n yr_e: \"2012-12-31\" \n },\n {\n id: 5322,\n x: 75,\n y: 40000,\n yr_e: \"2012-12-31\" \n },\n ] \n }\n\n /* Assuming site_eui vs. gross_floor_area */\n fake_aggregated_report_data_payload = {\n \"status\": \"success\",\n \"building_counts\" : [\n { \"yr_e\": \"Dec 31,2011\",\n \"num_buildings\": 10, \n \"num_buildings_w_data\": 9\n },\n {\n \"yr_e\": \"Dec 31,2012\",\n \"num_buildings\": 15,\n \"num_buildings_w_data\": 14\n }\n ],\n \"report_data\": [\n {\n x: 70,\n y: '100-199k',\n yr_e: \"2011-12-31\" , \n },\n {\n x: 71,\n y: '200-299k',\n yr_e: \"2011-12-31\" \n },\n {\n x: 73.1,\n y: '100-199k',\n yr_e: \"2012-12-31\" \n },\n {\n x: 75,\n y: '200-299k',\n yr_e: \"2012-12-31\" \n },\n ]\n }\n \n buildings_reports_ctrl = controller('buildings_reports_controller', {\n $scope: buildings_reports_ctrl_scope,\n $log: log,\n buildings_reports_service: mock_buildings_reports_service\n });\n }", "title": "" }, { "docid": "e7fa6045054441cff86980f511cbf399", "score": "0.372751", "text": "getScenarios() {\n return {\n 0: {\n 'title': 'Default',\n 'desc': 'Top 100 movies of this year.',\n },\n 1: {\n 'title': 'Scenario 1',\n 'desc': 'Alive actors whose name starts with a keyword that have not participated in any movie for a given year.',\n 'applicableFilters': {\n 'startYear': {\n 'op': 'equals',\n 'default': '2017'\n },\n 'primaryName': {\n 'op': 'starts w/',\n 'type': 'string',\n 'default': 'phi'\n }\n }\n },\n 2: {\n 'title': 'Scenario 2',\n 'desc': 'Alive producers who have produced more than 50 talk shows in a given year, and whose name contains a keyword.',\n 'applicableFilters': {\n 'startYear': {\n 'op': 'equals',\n 'default': '2017'\n },\n 'primaryName': {\n 'op': 'contains',\n 'type': 'string',\n 'default': 'gi'\n },\n 'count': {\n 'op': '=',\n 'type': 'number',\n 'default': '50'\n }\n }\n },\n 3: {\n 'title': 'Scenario 3',\n 'desc': 'Average runtime for movies whose original title contains a given keyword and are written by someone who is still alive.',\n 'applicableFilters': {\n 'originalTitle': {\n 'op': 'contains',\n 'type': 'string',\n 'default': 'gill'\n }\n }\n },\n 4: {\n 'title': 'Scenario 4',\n 'desc': 'Alive producers with the greatest number of long-run movies produced (runtime > 120 minutes)'\n },\n 5: {\n 'title': 'Scenario 5',\n 'desc': 'Unique actor pairs who have acted together in more than 2 movies, sorted by average movie rating.',\n 'applicableFilters': {\n 'count': {\n 'op': '=',\n 'type': 'number',\n 'default': 2\n }\n }\n },\n 6: {\n 'title': 'Scenario 6',\n 'desc': 'Actors that have worked in a given number of movies of a certain genre',\n 'applicableFilters': {\n 'genre': {\n 'op': 'equals',\n 'type': 'string',\n 'default': 'horror'\n },\n 'count': {\n 'op': 'equals',\n 'type': 'number',\n 'default': '10'\n }\n }\n },\n 7: {\n 'title': 'Scenario 7',\n 'desc': 'Actors and directors that have worked together certain number of times in titles that are not tv shows and the titles that they have worked in together',\n 'applicableFilters': {\n 'count': {\n 'op': 'equals',\n 'type': 'number',\n 'default': '5'\n }\n }\n },\n 8: {\n 'title': 'Scenario 8',\n 'desc': 'The highest rated episodes of shows that have spanned more than one year and have ended, by year sorted highest to lowest',\n },\n 9: {\n 'title': 'Scenario 9',\n 'desc': 'Writers and directors that have worked together in atleast a certain number of different TV Shows',\n 'applicableFilters': {\n 'count': {\n 'op': 'equals',\n 'type': 'number',\n 'default': '5'\n }\n }\n },\n 10: {\n 'title': 'Scenario 10',\n 'desc': 'The most popular TV shows by year, between two years that are still running',\n 'applicableFilters': {\n 'startYear': {\n 'op': 'equals',\n 'type': 'number',\n 'default': '2017'\n },\n 'endYear': {\n 'op': 'equals',\n 'type': 'number',\n 'default': '2019'\n }\n }\n }\n }\n }", "title": "" }, { "docid": "415babe91b8a47f3a9f79fdab5db2c8c", "score": "0.37263876", "text": "async createInitialOps (entryPoint) {\n if (!entryPoint.follow) {\n const op = {\n type: 'extract',\n to: entryPoint.is,\n extract: entryPoint.extract,\n cache: entryPoint.cache,\n conf: { ...entryPoint }\n }\n this.emit('pre-queue.operation.extract', entryPoint.url, op)\n if (!op.skip) {\n this.operations.addItem(entryPoint.url, op)\n }\n return\n }\n\n for (let j = 0; j < entryPoint.follow.length; j++) {\n const op = entryPoint.follow[j]\n\n this.operations.addItem(entryPoint.url, {\n type: 'crawl',\n selector: op.selector,\n to: op.to,\n cache: op.cache,\n maxPagesToCrawl: ('maxPagesToCrawl' in op) ? op.maxPagesToCrawl : 0,\n conf: { ...entryPoint }\n })\n }\n }", "title": "" }, { "docid": "5adcfd6cca9edbb4a44ee648adb42391", "score": "0.37228072", "text": "function makeProperJSON(entry, _week){\n var assessments = [];\n $(entry).each(function(op){\n\n var _title = this.title.$t;\n var _content = this.content.$t;\n console.log(_title + \": \" + _content);\n // _content.split(\", \")[0].split(\": \")[1]\n\n var stage = splitter(_content, 0);\n var manager = splitter(_content, 1);\n var date = splitter(_content, 2);\n var time = splitter(_content, 3);\n\n var _splitday = date.split(\"/\");\n\n var _day = new Date(_splitday[2]+\"-\"+_splitday[1]+\"-\"+_splitday[0]);\n\n var day = weekdays[_day.getDay()] + \" \" + time;\n\n var location = splitter(_content, 4);\n var department = splitter(_content, 5);\n\n var assessment = {\n \"title\": _title,\n \"stage\": stage,\n \"manager\": manager,\n \"date\": day,\n \"location\": location,\n \"department\": department\n };\n assessments.push(assessment);\n });\n\n var jsonobj = {\"assessments\": assessments, \"current-week\": _week};\n\n return jsonobj;\n}", "title": "" }, { "docid": "972e65bf24038a57fbe774d0c7a0dae8", "score": "0.37214562", "text": "function processAllFieldsOfTheForm(req, res) {\n var form = new formidable.IncomingForm();\n\n form.parse(req, function (err, fields, files) {\n //Store the data from the fields in your data store.\n //The data store could be a file or database or any other store based\n //on your application.\n res.writeHead(200, {\n 'content-type': 'text/plain'\n });\n res.write('received the data:\\n\\n');\n res.end(util.inspect({\n fields: fields,\n files: files\n }));\n\n var fileName = \"data/\" + fields.exercise + \"/\" + fields.exercise + \"_\" + \"M\" + fields.mission + \"_Sortie\" + fields.sortie + \"_UAV\" + fields.uavid + \".json\";\n \n var fileExists = true;\n var failCounter = 1;\n \n do\n {\n if (fs.existsSync(fileName)) \n {\n fileName = \"data/\" + fields.exercise + \"/\" + fields.exercise + \"_\" + \"M\" + fields.mission + \"_Sortie\" + fields.sortie + \"_UAV\" + fields.uavid + \"_Rev\" + failCounter + \".json\";\n failCounter++;\n }\n else\n {\n fileExists = false;\n }\n }\n while(fileExists === true);\n \n \n fs.writeFile(fileName, util.inspect({\n fields: fields}), function(err) {\n if(err) { return console.log(err); }});\n\n });\n}", "title": "" }, { "docid": "93499d938ba0524bec0b20dd83269474", "score": "0.37207437", "text": "formatData(items) {\n // loop through the items data\n let tempItems = items.map(item => {\n // grab the id\n let id = item.sys.id;\n // flatten out the images into an array\n let images = item.fields.images.map(image => image.fields.file.url);\n // create a room object with just the existing items.fields object while also replacing the .images object with our flattened images object and add in the id field.\n let room = { ...item.fields, images: images, id: id };\n return room;\n });\n\n return tempItems;\n }", "title": "" }, { "docid": "064a63ba788efc4697cd910a35ce4db6", "score": "0.37194538", "text": "function populateArray() {\n\t$(\".gallery-item a\").each(function() {\n\n\t\tvar itemObject = {\titemURL : $(this).attr(\"href\"),\n\t\t\t\t\t\t\titemCaption : $(this).children(\"img\").attr(\"alt\"),\n\t\t\t\t\t\t\titemType : \"image\" }; // default type is \"image\"\n\n\t\t// if it's a video, change the itemType to video\n\t\tif ( $(this).hasClass(\"video\") ) {\n\t\t\titemObject.itemType = \"video\";\n\t\t} \n\n\t\titemArray.push(itemObject);\n\t\t\n\t});\n}", "title": "" } ]
7c8cbdccb5137f2b16a484d0f6f8c895
function to get counters along with their customers
[ { "docid": "41b84bb026ab0cf3ac542124534340ac", "score": "0.7309344", "text": "function getCountersWithCustomers() {\n\tlet counterCardContainer = $('#counters-card-container');\n\tcounterCardContainer.empty();\n\t$.get('/admin/counters', function(counters) {\n\t\tfor(counter of counters){\n\t\t\tlet customerId = counter.customerId;\n\t\t\tif (customerId != null) {\n\t\t\t\tlet tempCounter = counter;\n\t\t\t\t$.get('/admin/customers',{id: customerId}, function(customer) {\n\t\t\t\t\tcounterCardContainer.append(`\n\t\t\t\t\t\t\t<!--Card-->\n\t\t\t\t\t\t <div class=\"col-12 col-sm-6\">\n\t\t\t\t\t\t <div class=\"card\">\n\t\t\t\t\t\t <div class=\"card-header card-inverse bg-app-color\">\n\t\t\t\t\t\t <small>COUNTER-ID: ${tempCounter.id} - ${tempCounter.counterName}</small>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t <div class=\"card-body\">\n\t\t\t\t\t\t <div class=\"special-card\">\n\t\t\t\t\t\t <span class=\"special-card-icon fa fa-id-badge\"></span>\n\t\t\t\t\t\t <span class=\"special-card-text\">${customer[0].id}</span> \n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t <div class=\"card-subtitle\">\n\t\t\t\t\t\t Name: ${customer[0].name}\n\t\t\t\t\t\t </div> \n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t <div class=\"card-footer text-muted\">\n\t\t\t\t\t\t <small>Updated At - ${counter.updatedAt}</small>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t`);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcounterCardContainer.append(`\n\t\t\t\t\t\t\t<!--Card-->\n\t\t\t\t\t\t <div class=\"col-12 col-sm-6\">\n\t\t\t\t\t\t <div class=\"card\">\n\t\t\t\t\t\t <div class=\"card-header card-inverse bg-app-color\">\n\t\t\t\t\t\t <small>COUNTER-ID: ${counter.id} - ${counter.counterName}</small>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t <div class=\"card-body\">\n\t\t\t\t\t\t <div class=\"special-card\">\n\t\t\t\t\t\t <span class=\"special-card-icon fa fa-id-badge\"></span>\n\t\t\t\t\t\t <span class=\"special-card-text\">:(</span> \n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t <div class=\"card-subtitle\">\n\t\t\t\t\t\t No any customer at this counter! :(\n\t\t\t\t\t\t </div> \n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t <div class=\"card-footer text-muted\">\n\t\t\t\t\t\t <small>Updated At - ${counter.updatedAt}</small>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t </div>\n\t\t\t\t\t\t`);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" } ]
[ { "docid": "534de059d8572ace5f0b547d5c83bd83", "score": "0.6555594", "text": "function getCustomersCount() {\n return $http.get('/api/v1/customers/count');\n }", "title": "" }, { "docid": "fdb13b7fe80d65943349a97f20f8af55", "score": "0.62741446", "text": "function getCounters(req, res){\n var userId = req.user.sub;\n\n if(req.params.id){\n userId = req.params.id;\n }\n\n getCountFollow(userId).then((value) => {\n return res.status(200).send(value);\n });\n}", "title": "" }, { "docid": "96cfc647695f6b7c97f7abf1e5951fc8", "score": "0.62463146", "text": "function getCustomers() {\n return DataCache.customerData;\n }", "title": "" }, { "docid": "5aa99e42477ed0ee6de6109c70b19170", "score": "0.6234866", "text": "function getCounters(req,res){\n\n var userId=req.user.sub\n if(req.params.id){\n userId=req.params.id;\n }\n\n getCountFollow(userId).then((value)=>{\n return res.status(200).send(value);\n });\n \n}", "title": "" }, { "docid": "869ffc1786893a3e500a56e4aed80449", "score": "0.61535406", "text": "function getCounters(req,res){\n\n let userId = req.user.sub;\n\n if(req.params.id){\n userId = req.params.id; \n }\n getCountFollow(userId).then((value) => {\n return res.status(200).send(value);\n })\n\n\n}", "title": "" }, { "docid": "0f83116562abcbed5a2d62f686fe4051", "score": "0.6091192", "text": "function clientCount () {\n return {type: \"userCount\", users: wss.clients.size};\n}", "title": "" }, { "docid": "5ffa189472b38ab366e0d30dbd9fe7ef", "score": "0.59100366", "text": "get Counter() {}", "title": "" }, { "docid": "8c2b4d22ba92f92cbffa84c32322e57f", "score": "0.58850366", "text": "function countServices() {\r\n var query = new CB.CloudQuery(\"Logs\");\r\n query.setLimit(10000000);\r\n query.count({\r\n success: function(number) {\r\n document.getElementById(\"numTaxiServed\").innerHTML += number;\r\n },\r\n error: function(err) {\r\n\r\n }\r\n });\r\n}", "title": "" }, { "docid": "a791ad33346252ba60222d42a15d9afc", "score": "0.5867676", "text": "function extractCounters(metrics) {\n var counters = [];\n \n Object.keys(metrics.counters).forEach(function(name) {\n counters[name] = {\n name: name,\n value: metrics.counters[name]\n };\n });\n \n Object.keys(metrics.counter_rates).forEach(function(name) {\n counters[name].rate = metrics.counter_rates[name];\n });\n \n return Object.keys(counters).map(function(name) {\n return counters[name];\n });\n}", "title": "" }, { "docid": "5866133757e5261c75b69bc5e0c9653e", "score": "0.5866885", "text": "getAllUsersDiaryCount() {\n let res = [];\n for (let i = 0; i < this.userCount; i++) {\n let address = this.userIndex.get(i);\n res.push({user: address, count: this.users.get(address)});\n }\n return res;\n }", "title": "" }, { "docid": "b66b5719aeed8ee0661cc4866c142383", "score": "0.57892215", "text": "function getBookExchangeReqCount() {\n let users = getListOfData('/api/users/');\n\n users.then(users => {\n // users.forEach(user => {user['req_count'] = 0});\n users.forEach(user => {\n user['req_count'] = 0;\n user['books'].forEach(book => {\n getListOfData(book).then(book => {\n user['req_count'] += Number(book['request_count']);\n }, e => e.message);\n });\n });\n }).catch(e => {console.log(e.message)});\n return users;\n }", "title": "" }, { "docid": "4fb3e405ad4c9f05cc8bb6850317b5e9", "score": "0.5740459", "text": "async allOrdersCustomer() {\n return db\n .query(\n `SELECT orders.order_id, orders.stage, orders.total, \"user\".company_name, COUNT(*)\n FROM orders, supplier, \"user\", order_item\n WHERE orders.supplier_id = supplier.supplier_id\n AND supplier.supplier_id = \"user\".user_id\n AND order_item.order_id = orders.order_id\n GROUP BY orders.order_id, \"user\".company_name\n ORDER BY orders.order_id`\n )\n .then(Result.many);\n }", "title": "" }, { "docid": "209486214c8178e597a6c41b918a458b", "score": "0.5738758", "text": "function getCountOfSubscribers(){\n return totalSubscribers;\n }", "title": "" }, { "docid": "86faa4c1b91bdebf30a172c55ba62e23", "score": "0.5738385", "text": "function getCustomers(transaction) {\n return transaction.customer;\n}", "title": "" }, { "docid": "4465cfca9e044546b133bd4c94cc2041", "score": "0.56617934", "text": "getCustomersFromDb(context) {\n const { currentUser } = firebase.auth\n try {\n return firebase.db.collection('customers').where('sid', '==', currentUser.uid)\n .onSnapshot(res => {\n if (res.docs.length > 0) {\n const rawCustomers = res.docs.map(item => ({ id: item.id, ...item.data() }))\n const mappedCustomers = rawCustomers.map(item => ({\n ...item,\n transaction: context.state.customerInfo.transaction, // Demo(static) data\n }))\n context.commit('SET_CUSTOMERS', mappedCustomers)\n }\n })\n } catch (error) {\n return { status: 'error', errorText: error }\n }\n }", "title": "" }, { "docid": "c7930b3e50533d2bf6edb231f396a76b", "score": "0.5640506", "text": "function accounts_by_count(ledger, limit) {\n return ledger.query().then(function (entries) {\n var counts = entries.transactions.map(function (e) {\n return e.postings;\n }).reduce(function (val, postings) {\n postings.forEach(function (posting) {\n var account = posting.account.name;\n val[account] = (val[account] || 0) + 1;\n });\n\n return val;\n }, {});\n\n return top_contributors(counts, limit).map(function (e) {\n return {\n name: e.key,\n total: counts[e.key],\n unit: ''\n };\n });\n });\n}", "title": "" }, { "docid": "ef738c5ff7fa7af5c441baa68636952c", "score": "0.564", "text": "function listCustomers(customers) {\r\n for (i = 0; i < customers.length; i++) {\r\n customers[i].getaddress();\r\n }\r\n}", "title": "" }, { "docid": "895711496fd17758c2dd8224e2bf8b9a", "score": "0.56369144", "text": "function myFn3 () {\n var store = store2;\n var counter = {};\n var saleDates = store['sale dates'];\n for (var key in saleDates) {\n for (var i = 0; i < saleDates[key].length; i++) {\n if ( !counter[saleDates[key]] ) {\n counter = saleDates[key][i];\n } else {\n counter += saleDates[key][i];\n };\n };\n };\n console.log(counter);\n}", "title": "" }, { "docid": "d004b911ee80aa782da588ba839ee5b2", "score": "0.5625743", "text": "function generateCurrentCustomerCharges() {\n return `\n <li>sub total: <span>${STORE.customerCharges.subTotal}</span></li>\n <li>Tip: <span>${STORE.customerCharges.tip}</span></li>\n <hr>\n <li>Total: <span>${STORE.customerCharges.total}</span></li>\n `;\n}", "title": "" }, { "docid": "68c703b2dd71bdd8bf40aefbc8b3e33d", "score": "0.56215894", "text": "function getCustomers() {\r\n let customers = [];\r\n\r\n for (let i = 2; i <= sheet.getLastRow(); i++) {\r\n // for every row of customer data\r\n\r\n const currentPrintCell = sheet.getRange(i, 1).getValue();\r\n if (!currentPrintCell) {\r\n customers.push(sheet.getRange(i, 5).getValue());\r\n }\r\n }\r\n\r\n return customers;\r\n}", "title": "" }, { "docid": "ad0e4e76bba1495ee3f742af56a35bef", "score": "0.55827224", "text": "count(req, res){\n const ProxyEngineService = this.app.services.ProxyEngineService\n ProxyEngineService.count('User')\n .then(count => {\n const counts = {\n carts: count\n }\n return res.json(counts)\n })\n .catch(err => {\n return res.serverError(err)\n })\n }", "title": "" }, { "docid": "f25e5f32f476f61acc79066ff83938f9", "score": "0.55673", "text": "init() {\n if (this.isLoaded()) {\n this.counters = {}\n this.counters.transaction = this.findNextCounter(this.transactions())\n this.counters.payee = this.findNextCounter(this.payees())\n // categories and bank accounts share the same pattern for ID (this comes from KMyMoney)\n this.counters.category = this.findNextCounter(this.categories().concat(this.bankAccounts(true)))\n }\n }", "title": "" }, { "docid": "7d275e9bfaf9b91c99cafea8ec38005a", "score": "0.5562229", "text": "function loadCustomers() {\n console.log(\"Loading customer information\");\n var customerIDs = [ ];\n $.each(quotes, function(index, quote) {\n if (!_contains(customerIDs, quote.customer.id)) {\n customerIDs.push(quote.customer.id);\n }\n });\n if (customerIDs.length < 1) {\n return;\n }\n console.log(\"Requesting customer IDs \" + JSON.stringify(customerIDs));\n var batch = osapi.newBatch();\n $.each(customerIDs, function(index, customerID) {\n batch.add('customer' + customerID, loadCustomer(customerID));\n });\n batch.execute(function(responses) {\n customers = { };\n $.each(customerIDs, function(index, customerID) {\n var response = responses['customer' + customerID];\n // TODO - deal with response.error not being null\n customers[customerID] = response.content;\n });\n console.log(\"Result customers = \" + JSON.stringify(customers));\n });\n}", "title": "" }, { "docid": "fb7db3cd039ef72f9038afb2f954bdeb", "score": "0.5526568", "text": "function setupCounters() {\n\t\tif ( !lifetimeGenerationCounter && config.lifetimeGenerationSelector ) {\n\t\t\tlifetimeGenerationCounter = sn.api.datum.sumCounter(urlHelper)\n\t\t\t\t.sourceIds(generationSources)\n\t\t\t\t.callback(function(sum) {\n\t\t\t\t\tsn.log('{0} total generation kWh', (sum/1000));\n\t\t\t\t\td3.select(config.lifetimeGenerationSelector).text(kiloValueFormat(sum));\n\t\t\t\t})\n\t\t\t\t.start();\n\t\t}\n\n\t\tif ( !lifetimeConsumptionCounter && config.lifetimeConsumptionSelector ) {\n\t\t\tlifetimeConsumptionCounter = sn.api.datum.sumCounter(urlHelper)\n\t\t\t\t.sourceIds(consumptionSources)\n\t\t\t\t.callback(function(sum) {\n\t\t\t\t\tsn.log('{0} total consumption kWh', (sum/1000));\n\t\t\t\t\td3.select(config.lifetimeConsumptionSelector).text(kiloValueFormat(sum));\n\t\t\t\t})\n\t\t\t\t.start();\n\t\t}\n\t}", "title": "" }, { "docid": "beafe36e0a6b834103f54db99658105b", "score": "0.55247146", "text": "function getAllCustomerHandler(data) {\n\n // debug\n console.log(\"Request Successful!\");\n console.log(data);\n \n for (i = 0; i < data.length; i++) {\n\n var client = data[i];\n var html =\n '<div class=\"client-item\" id=\"' + client.customerId +'\">'\n + '<div class=\"client-item-text\">'\n + '<h4 class=\"client-name\">' + client.name + '</h4>'\n + '<div class=\"client-information\">'\n + '<span class=\"sale-number\"> Orders: ' + client.orders + '</span>'\n + '</div>'\n + '</div>'\n + '</div>';\n\n $('.client-list').append(html);\n }\n\n}", "title": "" }, { "docid": "c310eee02a51535db217b3379d2132f0", "score": "0.55188686", "text": "async function getTopCustomers() {\n\t\tconst { data } = await axios.get('/get/top-10-customers');\n\t\tsetTopCustomers(data);\n\t}", "title": "" }, { "docid": "d63be68443e651e048e0a858e4df6f8c", "score": "0.5502901", "text": "function usersOnline (){\n let clientCounter = 0\n wss.clients.forEach(c => {\n clientCounter++\n })\n return clientCounter\n}", "title": "" }, { "docid": "5eb999e15e2833e8804688b5afefa84d", "score": "0.5495282", "text": "function getAllCust(){\n\t\t\tvar defer = $q.defer();\n\t\t\t\n\t\t\t$http({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: 'api/customer/all'\n\t\t\t})\n\t\t\t\t.success(function (data) {\n\t\t\t\t\tdefer.resolve(data);\n\t\t\t\t})\n\t\t\t\t.error(function (err) {\n\t\t\t\t\tdefer.reject(err)\n\t\t\t\t});\n\t\t\t\n\t\t\treturn defer.promise;\t\n\t\t}", "title": "" }, { "docid": "fc0039762909117c9ce053650b8f5d14", "score": "0.5486585", "text": "customers(){\n const allCustomers = this.deliveries().map(delivery => delivery.customer());\n return [...new Set(allCustomers)];\n\n }", "title": "" }, { "docid": "69ba2ceb824c8e7d6bd1e53ff8a64fc4", "score": "0.54624754", "text": "customers() {\n return this.deliveries().map(\n function (delivery) {\n return delivery.customer();\n }.bind(this)\n );\n }", "title": "" }, { "docid": "99e7b2149b0b1487c2f37e729a7aec99", "score": "0.54512614", "text": "async countOrdersOfCustomer(req, res, next) {\n try {\n let customerId = req.params.customerId;\n let customerDetails = await User.findById(customerId);\n let countOfAllOrder = await Order.count({ customer: customerId });\n\n let queryComplete = {};\n queryComplete.status = \"delivered\";\n queryComplete.customer = customerId;\n let countOfCompleted = await Order.count(queryComplete);\n\n let queryOfPending = {}\n queryOfPending.status = \"pendding\";\n queryOfPending.customer = customerId;\n let countOfPendding = await Order.count(queryOfPending);\n\n let queryOfRefuse = {}\n queryOfRefuse.status = \"rejected\";\n queryOfRefuse.customer = customerId;\n let countOfRefuse = await Order.count(queryOfRefuse);\n\n return res.status(200).json({\n countOfAllOrder,\n countOfCompleted,\n countOfPendding,\n countOfRefuse\n })\n } catch (err) {\n next(err)\n }\n }", "title": "" }, { "docid": "8788e97fec78285e2fb5135b1e08e600", "score": "0.54383856", "text": "function getInvoiceStatisticsForClient() {\r\n // create api parameters\r\n //Modified by Viktor on 11/08/2016 - sorting Billed\r\n vm.sortName = getSortingColumn();\r\n //vm.sortName = \"RelievedFeeAmount-InvoiceFeeAmount + Matter_ARWriteOffFeeAmount\";\r\n vm.sortDirection = \"desc\";\r\n var httpParams = getCommonHttpParams();\r\n\r\n return drilldownDetailsSharedService.getInvoiceStatisticsForClient(httpParams).then(function (response) {\r\n // data\r\n var temp = drilldownDetailsSharedService.mapToInvoiceStatistics(response, vm.selectedCategory, drilldownDetailsSharedService.groupBy.Client);\r\n\r\n if (vm.isDisplayingMonthlyData) {\r\n if (vm.reloadTableData) {\r\n vm.statisticsByMonthForClient = [];\r\n }\r\n vm.statisticsByMonthForClient = vm.statisticsByMonthForClient.concat(temp);\r\n } else {\r\n if (vm.reloadTableData) {\r\n vm.statisticsForClient = [];\r\n }\r\n vm.statisticsForClient = vm.statisticsForClient.concat(temp);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "1c5b8fe138d942acb216d694f480d458", "score": "0.5434002", "text": "static async getTopTen(){ \n const results = await db.query(\n `SELECT\n customers.id, \n first_name AS \"firstName\",\n middle_name AS \"middleName\", \n last_name AS \"lastName\",\n COUNT(*)\n FROM customers \n JOIN reservations\n ON reservations.customer_id=customers.id\n GROUP BY customers.id\n ORDER BY count DESC\n LIMIT 10`\n \n );\n const topCustomers = results.rows;\n\n if (topCustomers.length === 0) {\n const err = new Error(`Sorry, we cannot show you this now. ALERT Admin!`);\n throw err;\n }\n return results.rows.map(c => new Customer(c));\n }", "title": "" }, { "docid": "8b8e0179e622d73f03af293379eb3b68", "score": "0.54153484", "text": "async getDashboadStat({params, response}){\n \n let analytics = new Object()\n\n /*Current Year*/ \n let date = new Date();\n const currentyears = date.getFullYear()\n const yearsstart = currentyears + '-01-01 00:00:00'\n const yearsEnd = currentyears + '-12-31 00:00:00'\n\n // DECLARED TRAVEL\n const declaredTravel = await Travels.query().where('company_id', params.id).whereBetween('created_at', [yearsstart, yearsEnd]).count()\n const declaredTravelNumber = declaredTravel[0]['count(*)']\n\n analytics.declaredTravelNumber = declaredTravelNumber\n\n // CANCELLING TRAVEL\n const cancellingTravel = await Travels.query().where('company_id', params.id).where('annulation_state', 1).whereBetween('created_at', [yearsstart, yearsEnd]).count()\n const cancellingTravelNumber = cancellingTravel[0]['count(*)']\n\n analytics.cancellingTravelNumber = cancellingTravelNumber\n\n // STATION CLIENT\n /* For place reservation */\n const clients = await Tickets\n .query()\n .innerJoin('Travels', 'travels.id', 'Tickets.travel_id')\n .where('company_id', params.id)\n .whereBetween('Tickets.created_at', [yearsstart, yearsEnd])\n .count()\n const clientsNumber1 = clients[0]['count(*)']\n /* For expedition */\n const expeditionClient = await Expeditions.query().where('company_id', params.id).whereBetween('created_at', [yearsstart, yearsEnd]).count()\n const expeditionClientNumber = expeditionClient[0]['count(*)']\n\n analytics.clientsNumber = clientsNumber1 + expeditionClientNumber\n\n // FIND THINGS\n const findThing = await LostObjets.query().where('company_id', params.id).where('declaration_state', 1).whereBetween('created_at', [yearsstart, yearsEnd]).count()\n const findThingNumber = findThing[0]['count(*)']\n\n analytics.findThingNumber = findThingNumber\n\n // LOST THINGS DECLARED\n const lostThing = await LostObjets.query().where('company_id', params.id).whereBetween('created_at', [yearsstart, yearsEnd]).count()\n const lostThingNumber = lostThing[0]['count(*)']\n\n analytics.lostThingNumber = lostThingNumber\n\n /* EXPEDITION DO*/\n const expeditionClient2 = await Expeditions.query().where('company_id', params.id).where('expedition_state_id', 6).whereBetween('created_at', [yearsstart, yearsEnd]).count()\n const expeditionClientNumber2 = expeditionClient2[0]['count(*)']\n analytics.expeditionDo = expeditionClientNumber2\n\n /* EXPEDITION DECLARED*/\n const expeditionClient3 = await Expeditions.query().where('company_id', params.id).whereBetween('created_at', [yearsstart, yearsEnd]).count()\n const expeditionClientNumber3 = expeditionClient3[0]['count(*)']\n analytics.expeditionNumber = expeditionClientNumber3\n\n\n\n /*------------------*/\n // GRAPH STAT LOGIC\n /*------------------*/\n\n // STEP 1: Select list of element fro the current year \n /*For tickets sold*/\n const thisYearsTravelNotInJSON = await Tickets\n .query()\n .innerJoin('Travels', 'travels.id', 'Tickets.travel_id')\n .where('company_id', params.id)\n .where('annulation_state', 0)\n .whereNot('ticket_state_id', 1)\n .whereBetween('Tickets.created_at', [yearsstart, yearsEnd])\n .select('Tickets.id', 'Tickets.created_at')\n .fetch()\n const thisYearsTravel = thisYearsTravelNotInJSON.toJSON()\n /*For Find Things*/\n const thisYearsThingsNotInJSON = await LostObjets\n .query()\n .where('company_id', params.id)\n .where('declaration_state', 1)\n .whereBetween('updated_at', [yearsstart, yearsEnd])\n .select('id', 'updated_at')\n .fetch()\n const thisYearsThings = thisYearsThingsNotInJSON.toJSON()\n /*For Expedition*/\n const thisYearsExpeditionsNotInJSON = await Expeditions\n .query()\n .where('company_id', params.id)\n .where('expedition_state_id', 1)\n .whereBetween('updated_at', [yearsstart, yearsEnd])\n .select('id', 'updated_at')\n .fetch()\n const thisYearsExpeditions = thisYearsExpeditionsNotInJSON.toJSON()\n\n\n // STEP 2: init the month table\n /*Current month*/ \n let currentdate = new Date();\n const currentmonth = currentdate.getMonth()+1\n /*Initialisation*/ \n let monthTable = []\n for (let index = 0; index < currentmonth; index++) {\n monthTable[index] = {'month': index + 1, 'data': [0,0,0]} \n }\n\n\n // STEP 3: converte creat at .....\n /*For tickets sold*/\n for (let index = 0; index < thisYearsTravel.length; index++) {\n // Get the month\n let date = new Date(thisYearsTravel[index].created_at);\n var month = date.getMonth()+1\n // Verify if there are a corresponding on monthTable\n for (let index = 0; index < monthTable.length; index++) { \n if (monthTable[index].month == month) {\n monthTable[index].data[0] += 1\n }\n } \n }\n /*For Find Things*/\n for (let index = 0; index < thisYearsThings.length; index++) {\n // Get the month\n let date = new Date(thisYearsThings[index].updated_at);\n var month = date.getMonth()+1\n // Verify if there are a corresponding on monthTable\n for (let index = 0; index < monthTable.length; index++) { \n if (monthTable[index].month == month) {\n monthTable[index].data[1] += 1\n }\n } \n }\n /*For Expedition*/\n for (let index = 0; index < thisYearsExpeditions.length; index++) {\n // Get the month\n let date = new Date(thisYearsExpeditions[index].updated_at);\n var month = date.getMonth()+1\n // Verify if there are a corresponding on monthTable\n for (let index = 0; index < monthTable.length; index++) { \n if (monthTable[index].month == month) {\n monthTable[index].data[2] += 1\n }\n } \n }\n\n\n // STEP 4: Extract data \n let GraphData = {'series': [{'name': 'Tickets vendus', 'data':[]},{'name': 'Objet retrouvés', 'data':[]},{'name': 'Colis Expediés', 'data':[]}, ], 'month': []}\n let MonthInLetter = ['Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Decembre']\n \n for (let index = 0; index < monthTable.length; index++) {\n GraphData.series[0].data[index] = monthTable[index].data[0] \n GraphData.series[1].data[index] = monthTable[index].data[1] \n GraphData.series[2].data[index] = monthTable[index].data[2] \n\n GraphData.month[index] = MonthInLetter[index]\n }\n\n // console.log(monthTable);\n // console.log(GraphData);\n\n\n\n\n\n\n\n\n // console.log(monthTable);\n analytics.GraphData = GraphData\n\n\n\n\n\n\n\n\n\n\n response.json({\n message: 'success',\n data: analytics\n })\n \n\n \n }", "title": "" }, { "docid": "d49f9bb2e3add625805d37cd5b421f6c", "score": "0.54033494", "text": "function getCustomerSubListValues () {\n // use dao here later\n var search = getSearch();\n search.addColumns(getColumns());\n search.addFilters(getRestrictionFilters());\n\n var runSearch = search.runSearch();\n var results = [];\n var start = 0;\n var end = 1000;\n\n var newResults = [];\n do {\n newResults = runSearch.getResults(start, end) || [];\n start += 1000;\n end += 1000;\n var convertedResults = [];\n for (var i = 0; i < newResults.length; i++) {\n convertedResults.push(convertToRow(newResults[i]));\n }\n\n results = results.concat(convertedResults);\n } while (newResults.length >= 1000);\n\n return results;\n }", "title": "" }, { "docid": "ff4e68198213c55cb8de3493ec621e03", "score": "0.53902984", "text": "function loadCustomerIDs(callback){\n var srcURL = CONSTANTS.srcURL + g_args.id + (g_args.type == TYPE_EVENT ? '' : '/?type=brand');\n printLog(' From: ' + srcURL);\n var t = process.hrtime();\n\n request(srcURL, function (err, resp, body) {\n if (!err && resp.statusCode === 200) {\n var resultAsJSON = JSON.parse(body); \n g_data.customerIDArray = resultAsJSON.data ? resultAsJSON.data.customerIds : [];\n }else{\n g_data.time_step2 = process.hrtime(t)[0];\n printLog(' Time Elapsed: ' + g_data.time_step2 + '(s)');\n \n callback(true, 'STEP 2 - HTTPRequest failed');\n return;\n }\n g_data.totalCustomerCount = g_data.customerIDArray ? g_data.customerIDArray.length : 0; \n printLog(' Loaded customers: ' + g_data.totalCustomerCount);\n \n g_data.time_step2 = process.hrtime(t)[0];\n printLog(' Time Elapsed: ' + g_data.time_step2 + '(s)');\n\n if(g_data.totalCustomerCount > 0){\n callback();\n }else{\n callback(true, 'STEP 2 - Loaded customers: 0');\n }\n });\n}", "title": "" }, { "docid": "9ac458ab4e8b279d6a433078f9d560e8", "score": "0.53795975", "text": "function getAccounts(cb){\n\tauthedClient.getAccounts(function(err, response, data){\t\t\t\n\t\tlet accts = data; \n\t\tlet accounts_obj = [];\n\t\tlet cnt = 0;\n\t\tfor(var key in accts){\t\t\t\n\t\t\tlet acct = accts[key];\t\t\n\t\t\tlet acct_no = acct.id;\n\t\t\tlet acct_bal = acct.balance;\n\t\t\tlet profile_id = acct.profile_id;\n\t\t\tif(currency_accounts[acct.currency])\n\t\t\t\tcnt = currency_accounts[acct.currency].cnt+1\n\t\t\taccounts_obj[acct.currency] = { 'number':acct_no, 'balance':acct_bal };\n\t\t\tcurrency_accounts[acct.currency] = { 'cnt': cnt, 'number':acct_no, 'balance':acct_bal };\n\t\t}\t\n\t\t//accounts = Object.assign({}, accounts_obj);\t\t\t\t\n\t\tcb = cb || null;\n\t\tif(cb)\n\t\t\tcb(accounts_obj);\t\t\n\t}); \n}", "title": "" }, { "docid": "995a8b1c88cd110a44f5f741268f7f86", "score": "0.53794545", "text": "function getTransactionsCount(){\n let count = {\n credit: 0,\n debit: 0\n }\n\n for (let transaction of user.transactions){\n if (transaction.type === 'Credit'){\n count.credit++\n } else{\n count.debit++\n }\n }\n\n return count\n}", "title": "" }, { "docid": "94e3399980c75535b8342646ea8c4d3c", "score": "0.5376757", "text": "function getClients() {\n UserClientResource.query({\n user: userId\n }, function(data) {\n var all = {\n userR: {\n id: '',\n first_name: 'Todos',\n last_name: '',\n }\n };\n data.unshift(all);\n\n $scope.clients = data;\n });\n }", "title": "" }, { "docid": "c374841a1be5eba799542e0cae0b951c", "score": "0.53756976", "text": "function fetchCustomer(customerId, cb) {\n httpRequest(\"GET\", null, '/customers/'+customerId, function(err, data){\n if (err) return cb(err);\n if(hasError(data)) return cb(handleErrors(data));\n return cb(null, (data));\n });\n}", "title": "" }, { "docid": "4fc3e8f9c2e796dcbc797b3df0ea0959", "score": "0.53680784", "text": "function CountContact() {\n let addressBookCount = AddressBook.reduce((count) => (count = count + 1), 0);\n console.log(\"Contact Count is: \" + addressBookCount);\n }", "title": "" }, { "docid": "ff66c9665b7b2034b0e234fae0ac08ca", "score": "0.53610307", "text": "function getClients() {\n UserClientResource.query({\n userR: userId\n }, function(data) {\n var all = {\n user: {\n id: '',\n first_name: 'Todos',\n last_name: '',\n }\n };\n data.unshift(all);\n\n $scope.clients = data;\n });\n }", "title": "" }, { "docid": "c8758b89594c32533fb2c04d44cfce7e", "score": "0.5357369", "text": "getClients() {\n let clients = [];\n for (let i in this.daysStackData) {\n clients.push(this.daysStackData[i].client);\n }\n return clients.length;\n }", "title": "" }, { "docid": "ca48535a05dd5095ec449a228917690d", "score": "0.5357134", "text": "countAll() {\n let sqlRequest = \"SELECT COUNT(*) AS count FROM customers\";\n return this.common.findOne(sqlRequest);\n }", "title": "" }, { "docid": "597b8234f2fdccf4a2d0e1bea450a70c", "score": "0.53495526", "text": "function getCustomers(req, res) {\r\n\tconsole.log(\"entra\");\r\n Customer.find({}, (err, customers) => {\r\n if (err) return res.status(500).send({message: `Error al realizar la peticion: ${err}`});\r\n //if (!customers) return res.status(404).send({message: `No existen clientes`});\r\n res.send(200, customers);\r\n })\r\n}", "title": "" }, { "docid": "3ba787d93281e848dfe5fcf45ba03724", "score": "0.53447604", "text": "function payees_by_count(ledger, limit) {\n return ledger.query().then(function (entries) {\n var counts = entries.transactions.map(function (e) {\n return e.payee;\n }).reduce(function (val, payee) {\n val[payee] = (val[payee] || 0) + 1;\n return val;\n }, {});\n\n return top_contributors(counts, limit).map(function (e) {\n return {\n name: e.key,\n total: counts[e.key],\n unit: ''\n };\n });\n });\n}", "title": "" }, { "docid": "bde60da31b941fc05795f7278559443c", "score": "0.5336215", "text": "function counting_data(){\r\n var counter = $(\".counter\");\r\n if( counter.length){\r\n counter.counterUp({\r\n delay:10,\r\n time:2000\r\n });\r\n }\r\n }", "title": "" }, { "docid": "c888f001e974bd83b667483ac621dd29", "score": "0.53320867", "text": "function findrecord_count() {\r\n\t\tCustomerService.findrecord_count()\r\n\t\t.then(function (record_count) {\r\n\t\t\t\t$scope.totalnof_records = record_count;\r\n\t\t\t}, \r\n\t\t\tfunction (errResponse) {\r\n\t\t\t\tconsole.log('Error while fetching record count');\r\n\t\t\t}\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "ddb0b02b8206d9cf58f101dc9c1ba92a", "score": "0.53311884", "text": "getCustomerWithIdFromDb(context, cid) {\n try {\n return firebase.db.collection('customers').doc(cid)\n .onSnapshot(res => {\n if (res.exists) {\n const rawCustomer = res.data()\n const mappedCustomer = {\n ...rawCustomer,\n id: cid,\n transaction: context.state.customerTransactions, // Demo(static) data\n }\n context.commit('SET_CUSTOMERINFO', mappedCustomer)\n }\n })\n } catch (error) {\n return { status: 'error', errorText: error }\n }\n }", "title": "" }, { "docid": "bf1648bda5170d945e03c97d369c1759", "score": "0.53262705", "text": "getAll() {\n return Resource.get(this).resource('Admin:getAllCustomersWithDenials')\n .then(res => {\n this.displayData.customersSafe = res.customers;\n });\n }", "title": "" }, { "docid": "115340115bede302dae0cbcfa0462abc", "score": "0.5322745", "text": "function getRecentCustomer(limit) {\n\n const info = {\n method: 'GET',\n headers: {'Authorization': getCookie('token')},\n };\n \n return new Promise((resolve) => {\n fetch(BASE_URL + `/recentContact?limit=${limit}`, info)\n .then(res => {\n if(checkUnauthorized(res)) {\n return;\n }\n res.json().then(bodyRes=>{resolve(bodyRes);});\n })\n })\n}", "title": "" }, { "docid": "48261e9a084ea58a823de3b3df8cd72b", "score": "0.5319667", "text": "static async list(req, res) {\n try {\n const filter = { deleted: false };\n let sort = 'dt_created';\n\n if (req.query.sort) {\n ({ sort } = req.query);\n }\n if (req.query.type) { // eg. wholesale, retail\n filter.type = { $in: req.query.type.toLowerCase().split(',') };\n }\n if (req.query.q) {\n const keyword = new RegExp(req.query.q, 'i');\n filter.$or = [\n { company: { $regex: keyword } },\n { website: { $regex: keyword } },\n { 'billing.first_name': { $regex: keyword } },\n { 'billing.last_name': { $regex: keyword } },\n { 'billing.company': { $regex: keyword } },\n { 'billing.city': { $regex: keyword } },\n { 'billing.state': { $regex: keyword } },\n { 'billing.email': { $regex: keyword } },\n ];\n }\n\n // calculate total numbers\n const total = await Customer\n .countDocuments(filter);\n\n // pagination configuration\n const pageOptions = {\n page: parseInt(req.query.page || 0, 10),\n count: parseInt(req.query.count, 10) === -1 ? total : parseInt(req.query.count || 10, 10),\n };\n\n const customers = await Customer\n .find(filter)\n .sort(sort)\n .skip(pageOptions.page * pageOptions.count)\n .limit(pageOptions.count)\n .populate('user', POPULATE_FIELDS)\n .populate('approved_by', POPULATE_FIELDS)\n .exec();\n\n return res.success({\n total,\n page: pageOptions.page,\n count: pageOptions.count,\n customers,\n });\n } catch (err) {\n return res.error(err.message);\n }\n }", "title": "" }, { "docid": "38ce84e061fef44b373392dabaee54df", "score": "0.53178024", "text": "getUsersCountByStatus() {\n return this.rest.get(`${this.baseUrl}/count/by-status`);\n }", "title": "" }, { "docid": "dc5c18b472ee2316840191de21db497e", "score": "0.5308288", "text": "function getCSAccounts(params) {\n\t var uri = env_1.default.hydraHostName.clone().setPath(env_1.default.pathPrefix + \"/cs/accounts/\");\n\t params && Object.keys(params).forEach(function (k) {\n\t if (params[k] !== undefined) {\n\t uri.addQueryParam(k, params[k]);\n\t }\n\t });\n\t return fetch_1.getUri(uri);\n\t }", "title": "" }, { "docid": "ecab310bd6c89aeba67d40e05a9e4fbb", "score": "0.53008294", "text": "function getClients() {\n UserClientResource.query({\n user_id: loginService.getUserId()\n }, function(data) {\n all = {\n id: '',\n name: 'Todos',\n lastname: '',\n organization: 0\n }\n data.unshift(all);\n $scope.clients = data;\n });\n }", "title": "" }, { "docid": "63570878c37e0f399b88319a921bfc44", "score": "0.5273635", "text": "function customerCallback(arr, response) {\n data = (function(a){\n var rv = [];\n for (o in a) {\n customers[a[o].id] = a[o];\n rv[o] = { label : a[o].name + \" | \" + a[o].contact, value: a[o].id };\n }\n return rv;\n })(arr);\n if (response) {\n response(data);\n }\n}", "title": "" }, { "docid": "8899a8dd45c93d5b438295c5f460e728", "score": "0.5271485", "text": "static async getNumALL() {\n let industries = [];\n let numbers = [];\n try {\n industries = await salaryData.distinct(\"Industry\");\n for (let i = 0; i < industries.length; i++) {\n numbers.push({\n name: industries[i],\n val: await salaryData.countDocuments({ Industry: industries[i] }),\n });\n }\n return numbers;\n } catch (e) {\n console.error(`Unable to get industries, ${e}`);\n return numbers;\n }\n }", "title": "" }, { "docid": "3014760cc024a47b5fabc16fdf285c1a", "score": "0.52701885", "text": "getCustomersThisCompany(params) {\n // Don't get more than once\n if (this.displayData.customers.length) {\n return new Promise(resolve => resolve());\n }\n return Resource.get(this).resource('Employee:getAllCustomersThisCompany', params)\n .then(res => {\n this.displayData.customers = res.filter(customer => customer.firstName !== '__default__');\n });\n }", "title": "" }, { "docid": "87ef7efccfbd0af1b125080b1a1b298d", "score": "0.52692086", "text": "function getCustomerName(cid,cb){\r\n connection.query(\"select customer_name from tbl_customer where customer_id='\"+cid+\"'\",function(err,res1){\r\n if(res1.length >0){\r\n resultsets=res1;\r\n }else{\r\n resultsets={};\r\n }\r\n cb(resultsets); \r\n });\r\n }", "title": "" }, { "docid": "86299debe29c272f2c31f91d9995f132", "score": "0.5267102", "text": "function countAll(){ \n return global.conn.collection(\"customers\").countDocuments();\n}", "title": "" }, { "docid": "a002b857ee7c6b0067aca3745592e843", "score": "0.52651525", "text": "function getPagedCustomers(page, take) {\n return $http.get('/api/v1/customers?page=' + page + '&take=' + take);\n }", "title": "" }, { "docid": "1e00d055022c33a2958d0d45b602cce7", "score": "0.5261395", "text": "getCustomers() {\n return this.request({\n method: 'get',\n url: '/customer',\n });\n }", "title": "" }, { "docid": "b34fa77cc97d7fc28d5bb3866efd46db", "score": "0.5254497", "text": "function totals(customerlist, observable, totalobservable) {\n //creating reference variable that will be used to count the totals\n var amountowedfigure = 0;\n var totalcustomers = 0;\n //looping through the list of objects to extract different variables from the object\n for (var i = 0; i <= customerlist().length - 1; i++) {\n amountowedfigure += customerlist()[i].customerAccount().amountOwing();\n totalobservable(amountowedfigure);\n totalcustomers += totalpayments(customerlist()[i].customerAccount().customerPayments);\n observable(totalcustomers);\n }\n return true;\n }", "title": "" }, { "docid": "316e818e9b2724b8468e8ecefa625630", "score": "0.5252355", "text": "function render_counter(a,b,c){current_count=parseInt(jQuery(\"#\"+a+\"_info\").text()),max_count=b.fnGetData().length,current_count!=max_count?jQuery(\"#objects_count\").html(\"(\"+current_count+\" \"+c+\" \"+max_count+\")\"):jQuery(\"#objects_count\").html(\"(\"+max_count+\")\")}", "title": "" }, { "docid": "09e2566b05683fefd3acd16ed8965a10", "score": "0.5251654", "text": "function getAllCustomer (orgId, departId, pageSize, currentPage) {\n const info = {\n method: 'GET',\n headers: {'Authorization': getCookie('token')},\n }\n\n return new Promise((resolve) => {\n fetch(BASE_URL + `/contact?organization_id=${orgId}&department_id=${departId}&size=${pageSize}&current=${currentPage}`, info)\n .then(res => {\n if(checkUnauthorized(res)) {\n return;\n }\n if (res.ok) {\n res.json().then(resBody => {\n resolve(resBody)\n });\n } else {\n res.json().then(resBody => {\n resolve(resBody);\n })\n }\n })\n })\n}", "title": "" }, { "docid": "c80b221252e649b8406ff5518a8d5180", "score": "0.52302736", "text": "function getOnlineClients() {\n\tlet num = 0;\n\tObject.keys(clients).forEach(key => {\n\t\tif (devices.hasOwnProperty(key)) {\n\t\t\tnum++;\n\t\t}\n\t});\n\treturn num;\n}", "title": "" }, { "docid": "ffbe42e6b7a61f0f0ec47c5154f63ff0", "score": "0.522932", "text": "function renderCounters(){\n itemCountSpan.innerHTML = todos.toString();\n uncheckedCountSpan.innerHTML = pendingTodos.toString();\n }", "title": "" }, { "docid": "91a8cf658671b5e955b618ae1a291b07", "score": "0.52281463", "text": "static getAllCustomerReports(query) {\n return async (dispatch, getState) => {\n registerAccessToken(getState().user.tokens.access);\n const [res, data] = await api.customerReport.get.allCustomerReports(query);\n // const [res, data] = [{ status: 200 },\n // [\n // {\n // id: \"cr1\",\n // description: \"bad taste\",\n // customerName: \"Saduni\",\n // mobileNumber: \"01772665167\",\n // userId: \"u1\",\n // },\n // {\n // id: \"cr2\",\n // description: \"bad smell\",\n // customerName: \"Sandun\",\n // mobileNumber: \"01712341167\",\n // userId: \"u2\",\n // },\n // ]\n // ] //todo:remove mock\n if (res.status === 200) {\n dispatch(setCustomerReports(data));\n }\n return res;\n }\n }", "title": "" }, { "docid": "092dc5d36f29a8c1271b7380cd5f3a4d", "score": "0.52251554", "text": "function showCustomerReport(customer){\n console.log(`Customer Name: ${customer[\"Account Holder\"]}`);\n printPhoneNumbers(customer[\"Phone Numbers\"]);\n showTransactions(customer[\"Transactions\"], customer[\"Starting Balance\"]);\n if (customer[\"Favorite Melon\"] === \"Casaba\" || customer[\"Number of Pets\"] > 5){\n console.log(\"Congratulations on being a premiere customer!\");\n } else {\n console.log(\"Thank you for being a valued customer!\");\n }\n}", "title": "" }, { "docid": "6a115d6b4c6e047890b02630a4b8f1c3", "score": "0.52243423", "text": "function getAllCustomers() {\n return customerTable;\n}", "title": "" }, { "docid": "41a4370a2c7a8932a9a3b4c9309c7e4e", "score": "0.52139693", "text": "function getworkshopcount(req, res){\n Workshop.countDocuments({\"datum\":{$gte: Date.now()}}, (err, doc) =>{\n if(err){\n res.json({\n status: \"Error\",\n message: \"Could not find any workshops to count\"\n })\n }\n if (!err){\n res.json({\n status: \"Success\",\n message: \"GET all workshops count\",\n data: doc\n })\n } \n })\n}", "title": "" }, { "docid": "18c86f600c53030233b8268863841653", "score": "0.52086", "text": "getStatistics(){\n GetAllCustomers().then(async(response) => {\n const statList = await Promise.all(response.data.map(async (customer, id) => {\n var statResponse = await GetStatisticsByCustomerId(customer.id)\n if(statResponse.status == \"OK\")\n {\n return statResponse.data\n }\n }))\n this.buildStatistics(statList, response.data);\n })\n}", "title": "" }, { "docid": "0ad7eb7c812395c77f56206c2f5e863e", "score": "0.5184667", "text": "function ShowAllCustomer() {\n //Initially clearing table data\n dataTable.clear().draw();\n\n //Getting Customer Data From my API\n HttpApi.Get('/api/customers/').then(data => {\n let count = 0;\n data.forEach(customer => {\n dataTable.row.add([\n ++count,\n `<a href=\"/customer/edit/${customer.id}\">${customer.name}</a>`,\n customer.membershipType.name,\n GetMonths(customer.membershipType.durationInMonths),\n `${customer.membershipType.signUpFee}$`,\n `${customer.membershipType.discountRate}%`,\n `<img src=\"../../Content/Img/btn-delete.svg\" class=\"img-rounded js-delete\" data-customer-id=${customer.id}>`\n ]).draw();\n });\n });\n}", "title": "" }, { "docid": "965fbd7351c4e196d00d32740b2cf84d", "score": "0.5173909", "text": "async function getCustomerList() {\n try {\n let response = await fetch(apiUrl+\"api/customers\", {\n method: \"GET\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n Authorization:\"Token \"+token\n },\n });\n let res = await response.json();\n if (response.ok) {\n _storeData('customers',res)\n dispatch({type:'GET_CUSTOMERS',payload:res})\n }else{\n dispatch({type:'ERROR_STATUS',payload:res})\n }\n } catch (error) {\n dispatch({type:'ERROR_STATUS',payload:error.messages})\n }\n }", "title": "" }, { "docid": "55ae2643854bd6a45137bd3f79b506e0", "score": "0.51674896", "text": "function fetchAllCustomers() {\r\n\t\tCustomerService.fetchAllCustomers()\r\n\t\t\t.then(\r\n\t\t\t\t\tfunction (customer) {\r\n\t\t\t\t\t\tself.customers = customer;\r\n\t\t\t\t\t\tself.Filtercustomers=self.customers;\r\n\t\t\t\t\t\tconsole.log(customer);\r\n\t\t\t\t\t\t/*fetchAllBranches();\t\r\n\t\t\t\t\t\tfetchAllLocations();\t*/\t\r\n\t\t\t\t\t\tpagination();\r\n\t\t\t\t\t}, \r\n\t\t\t\t\tfunction (errResponse) {\r\n\t\t\t\t\t\tconsole.log('Error while fetching customers');\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t}", "title": "" }, { "docid": "a55da31e12880aa858eca44f4a34b93e", "score": "0.5151383", "text": "function getActorCount() {\n var http = new XMLHttpRequest();\n http.onreadystatechange = function () {\n if (http.readyState === 4) {\n end = new Date().getTime();\n if (http.status < 400) {\n returnData = JSON.parse(http.responseText);\n if (returnData) {\n countDisplay.innerHTML = returnData.count;\n updateFooter(http, (end - start));\n }\n } else {\n updateFooter(http, (end - start));\n }\n }\n };\n start = new Date().getTime();\n http.open(\"GET\", \"/api/ActorBackendService/?c=\" + start);\n http.send();\n}", "title": "" }, { "docid": "500fea95cb3b5a4685cea1d0c44a077f", "score": "0.51491505", "text": "function setUpStatistics() {\n $scope.company.recommend = 0;\n $scope.company.returners = 0;\n var reviews = $scope.company.reviews;\n angular.forEach(reviews, function (review) {\n if (review.recommend) {\n $scope.company.recommend++;\n }\n if (review.returnOffer) {\n $scope.company.returners++;\n }\n });\n }", "title": "" }, { "docid": "1484b249301834f211abe0baa039e5be", "score": "0.51490825", "text": "function listCustomers(store, criteria, format) {\n var axios = createCoreApiCall(store);\n var api = sitewhereRestApi.API.Customers.listCustomers(axios, criteria, format);\n return loaderWrapper(store, api);\n}", "title": "" }, { "docid": "541218bc00960ef87e90fb4c0f94fce5", "score": "0.5143563", "text": "function commonTags (customers){\n var countTag = _.reduce(customers, function(countTag, person, i, c){ //go through each customer\n return _.reduce(person.tags, function(countTag, tag, i, c){ // go through each tag array\n countTag[tag] = countTag[tag] ? countTag[tag] + 1 : 1; // if tag already exists, add 1 to count, else assign count to 1 for that tag\n return countTag;\n }, countTag); \n }, {}); //console.log(countTag);\n \n var biggestAppearance = 0;\n var mostCommonTags = [];\n_.each(countTag, function(v, k, c){\n if(v >= biggestAppearance){//has to be greater than or equals or else you will not get top 3 in front\n mostCommonTags.unshift(k);\n biggestAppearance = v;\n } else {\n mostCommonTags.push(k); // lowest occuring at at end of array\n } \n}); return mostCommonTags.slice(0, 3);//return just the top 3\n}", "title": "" }, { "docid": "d8034ffe545f95a8126c4de10004bbd4", "score": "0.5130646", "text": "customers() {\n return store.customers.map(customer =>{\n return customer\n })\n }", "title": "" }, { "docid": "e00db2636a6365590fe1951004af7e75", "score": "0.51281476", "text": "static async fetchUsers() {\n const body = await axios.get(`${BROKRETE_BACKEND_API}/users`);\n return body.data.customers;\n }", "title": "" }, { "docid": "9de0ad119c21de4321806bbca59252f7", "score": "0.512124", "text": "function showCustomerNumberUp() {\r\n if (customer_Number + 1 > customersList.length) {\r\n customer_Number = 1;\r\n } else {\r\n customer_Number++;\r\n }\r\n display_Customer();\r\n}", "title": "" }, { "docid": "c52e558f881409afa163c551512f2d95", "score": "0.5115294", "text": "function totalCustomers() {\n const numberOfCustomers = customerData.length;\n card1.innerHTML = numberOfCustomers;\n\n if (numberOfCustomers > 1) {\n card1Paragraph.innerHTML = 'Customers';\n }\n}", "title": "" }, { "docid": "7f187ede99e8ab0782f04f9d8c92d1f8", "score": "0.5113054", "text": "function getMonthlyIncomings() {\n var monthlyIncomings = 0;\n for (var cost in incomings) {\n if (incomings.hasOwnProperty(cost)) {\n console.log(cost + \" -> \" + incomings[cost]);\n monthlyIncomings = monthlyIncomings + incomings[cost];\n }\n }\n return monthlyIncomings;\n}", "title": "" }, { "docid": "f68ec165d11402e3146adb698216ff94", "score": "0.5111307", "text": "function getData() {\n\n var date = new Date();\n var cacheBuster = \"?cb=\" + date.getTime();\n\n return $http({ method: 'GET', url: urlBase + '/Count' + cacheBuster });\n }", "title": "" }, { "docid": "61d9e7ba1f6d9486b18477f673947b46", "score": "0.5106087", "text": "function getCustomers() {\n return new Promise(function (resolve) {\n const pool1 = new sql.ConnectionPool(dbConfig, err => {\n // ... error checks\n if (err)\n console.log(err);\n // Query\n var _query = queryModule.prepareGetQuery();\n pool1.request().query(_query, (err, result) => {\n if (err)\n console.log(err);\n // ... error checks\n resolve(result);\n });\n });\n });\n}", "title": "" }, { "docid": "99479b8936a521f6e80de64759117ba6", "score": "0.5105263", "text": "function getUnreadCountForCustomer(logHandler, channel_ids, user_id) {\n return new Promise((resolve, reject) => {\n let userVisibleMessageTypes = constants.userReadUnreadMessageTypes.join(\", \");\n let query = `SELECT \n ch.channel_id, COUNT(*) AS unread_count\n FROM\n channel_history ch\n LEFT JOIN \n users_conversation uc ON ch.channel_id = uc.channel_id \n WHERE\n ch.channel_id IN (?) AND ch.user_id = ? AND uc.id > ch.last_read_message_id AND uc.message_type in (${userVisibleMessageTypes})\n GROUP BY ch.channel_id`;\n let queryObj = {\n query : query,\n args : [channel_ids, user_id],\n event : \"getUnreadCountForCustomer\"\n };\n dbHandler.executeQuery(logHandler, queryObj).then((result) => {\n let channelToUnreadCount = {};\n for (let i = 0; i < result.length; i++) {\n channelToUnreadCount[result[i].channel_id] = result[i].unread_count;\n }\n // logger.info(logHandler, { getUnreadCountForCustomer : channelToUnreadCount });\n resolve(channelToUnreadCount);\n }, (error) => {\n logger.error(logHandler, \"error in getUnreadCountForCustomer\", error);\n reject(error);\n });\n });\n}", "title": "" }, { "docid": "d29ab99bde250a471f0717bfe8a8d0e1", "score": "0.50980765", "text": "calculateCustomersOrderTotal(customers) {\n for (const customer of customers) {\n if (customer && customer.orders) {\n let total = 0;\n for (const order of customer.orders) {\n total += (order.price * order.quantity);\n }\n customer.orderTotal = total;\n }\n }\n }", "title": "" }, { "docid": "b9da5fabfb670d532d9e4fea552683ae", "score": "0.50960916", "text": "function searchClientVendorChart(arrAccts) {\r\n var stLogTitle = 'suitelet_unbilledBalances.searchClientVendorChart';\r\n\r\n //Filters\r\n var arrFilters = [];\r\n arrFilters.push(new nlobjSearchFilter('custrecord_from_sub', null, 'anyof', OBJ_PARAM.stParamFromSubsidiary));\r\n arrFilters.push(new nlobjSearchFilter('custrecord_ic_ar_acct', null, 'anyof', arrAccts));\r\n\r\n //Columns\r\n var arrColumns = [];\r\n arrColumns.push(new nlobjSearchColumn('internalid'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_from_sub'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_to_sub'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_ic_client'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_ic_vendor'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_ic_item'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_vb_item'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_ic_ar_acct'));\r\n arrColumns.push(new nlobjSearchColumn('custrecord_accr_ic_ap'));\r\n\r\n var arrResults = nlapiSearchRecord('customrecord_apco_ic_client_vdnr', null, arrFilters, arrColumns);\r\n\r\n if (Eval.isEmpty(arrResults)) {\r\n arrResults = [];\r\n }\r\n\r\n nlapiLogExecution('DEBUG', stLogTitle, 'arrResults.length = ' + arrResults.length);\r\n return arrResults;\r\n}", "title": "" }, { "docid": "55900ccdafaf5399cebb32e80fd10e32", "score": "0.50948286", "text": "function getCustomers(id, callback) {\r\n if (id != NULL) {\r\n var query = datastore.createQuery(['Customers']).filter('id', '=', id);\r\n datastore.runQuery(query, (err, Customers) => callback(err, Customers, datastore.KEY));\r\n } else {\r\n var queryall = datastore.createQuery(['Customers']);\r\n datastore.runQuery(queryall, (err, Customers) => callback(err, Customers, datastore.KEY));\r\n }\r\n }", "title": "" }, { "docid": "2fe6987130fed8ecb9d8cf928260de46", "score": "0.5081247", "text": "function getNumberOfCustomers() {\n let result = Math.floor(Math.random() * 32);\n return result;\n}", "title": "" }, { "docid": "2e745e6d0b41867053385e23ac2f988c", "score": "0.5080896", "text": "function getCustomerByTable(table_num) { \n\t\t//console.log(\"table number: \" + table_num);\n\t\tfor (var i = 0; i < customer_list.length; ++i) {\n\t\t\t//console.log(\"customer name: \" + temp_customer.name);\n\t\t\t//console.log(\"customer table id: \" + customer_list[i].table_id);\n\t\t\tif (customer_list[i].table_id == table_num) {\n\t\t\t\treturn customer_list[i];\n\t\t\t}\n\t\t}\n\t\t//console.log(\"No users at this table!!\");\n\t\treturn null;\n\n\t}", "title": "" }, { "docid": "be9515faa898c681acf2532703b2a4c6", "score": "0.50769806", "text": "async getBooksSummary() {\n try {\n let authorsMap = new Map();\n let books = await this.getBooks();\n books.forEach(book => {\n book.authors.forEach(author => {\n if (authorsMap.has(author)) {\n let value = authorsMap.get(author);\n authorsMap.set(author, ++value);\n } else\n authorsMap.set(author, 1);\n })\n });\n return authorsMap;\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "82b717f4d00a486467a7299760810928", "score": "0.5065184", "text": "function getCountNum() {\n $.getJSON('/disabling_logs/count.json', function(data) {\n $('#counter_data').html(data.count);\n $(\"abbr.time_ago\").timeago();\n });\n}", "title": "" }, { "docid": "1a6b25152639acb6303a1611142b3a8d", "score": "0.50579405", "text": "function get_candy_count(students) {\n var candy_count = 0;\n for (var i = 0; i<students.length ;i++) {\n if (students[i].age < 15) {\n candy_count += students[i][\"candies\"]\n }} return candy_count;\n}", "title": "" }, { "docid": "9ce4734c95566cab1c51befad62aa948", "score": "0.5050191", "text": "function counter() {\n var count = 0\n return{\n add:function (num) {\n count += num\n },\n retrive : function () {\n console.log(count)\n }\n }\n\n}", "title": "" }, { "docid": "1fa8eaadb2bbc1a1868fc54829b14d77", "score": "0.50448775", "text": "async function getAllSubscribers() {\n\n // Get Subscribers\n const cursorAt = (startingAfter != null) ? startingAfter : (endingBefore != null) ? endingBefore : null;\n const cursorDirection = (startingAfter != null) ? 'after' : (endingBefore != null) ? 'before' : 'after';\n const subscribers = await getSubscribers(cursorAt, cursorDirection);\n\n // Re\n log(`Total subscribers: ${subscribers.length}`)\n await getSubscribersData(subscribers).then(async promises => {\n //resolve all promises\n const allSubscribers = await Promise.all(promises)\n\n log(`Total ${allSubscribers.length} records mapped`)\n\n // writing the output\n writeFile(createCSV(allSubscribers));\n\n }).catch(function(error) { console.error(error) });\n}", "title": "" }, { "docid": "cb9efd141cc7aa9ca770ee9da0b0f64d", "score": "0.5039265", "text": "function getTotalCount() {\n\t\t\n\t\tvar $jobsUrl = $AJAX_URL + '/candidate/getProfileCountForWebsite.srvc';\n\t\t\n\t\t$.when( $.post($jobsUrl) ).done(function($initial) {\t\t\t\n\t\t\tvar $loadingCounter = $('.loading-counter');\n\t\t\tvar $counters = $('.counter');\n\t\t\t\n\t\t\t$loadingCounter.fadeOut('slow', function() {\n\t\t\t\t\n\t\t\t\t$counterContainer = $('.counter > span');\n\t\t\t\t$initial = parseInt($initial);\n\n\t\t\t\t$counterContainer.counter({\n\t\t\t\t\tformat: '999999',\n\t\t\t\t\tdirection: 'up',\n\t\t\t\t\tinitial: $initial,\n\t\t\t\t\tstop: $initial,\n\t\t\t\t\tinterval: 1000,\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfunction incrementByOne() {\n\t\t\t\t\t\n\t\t\t\t\t$initial = parseInt($counterContainer.text());\t\t\t\t\t\t\n\t\t\t\t\t$randomStop = $initial + 1;\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$counterContainer.counter({\n\t\t\t\t\t\tformat: '999999',\n\t\t\t\t\t\tdirection: 'up',\n\t\t\t\t\t\tinitial: $initial,\n\t\t\t\t\t\tstop: $randomStop,\n\t\t\t\t\t\tinterval: 1000, \n\t\t\t\t\t});\t\t\n\t\t\t\t}\n\n\t\t\t\t(function loop() {\n\t\t\t\t var rand = Math.round(Math.random() * (10000 - 3000)) + 3000;\n\t\t\t\t setTimeout(function() {\n\t\t\t\t \tincrementByOne();\n\t\t\t\t loop(); \n\t\t\t\t }, rand);\n\t\t\t\t}());\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t$('.home #bg .active-text').hide().removeClass('hide').fadeIn('slow', function() {\n\t\t\t\t\t$counters.hide().removeClass('hide').fadeIn('slow');\t\t\t\t\t\n\t\t\t\t});\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t});\t\t\n\t\t\n\t}", "title": "" }, { "docid": "0fa2b8df03a379c0915093d1dafb1fda", "score": "0.5035862", "text": "function getCustomers(page = 1, perPage = 25, search = \"\") {\n $.ajax({\n url: \"controller/Customers.php\",\n type: \"POST\",\n dataType: \"json\",\n data: {\n a: \"get\",\n getColumnsArgs: { table: customerTable },\n countArgs: { fields: [\"count(code_clt)\"], table: customerTable, conditions: search },\n page: {currentPage: page, perPage: perPage},\n search: search\n },\n beforeSend : function(){\n $('.customers-list').addClass('spinner');\n $('.customers-grid').addClass('spinner');\n }\n })\n\n .done(function(data) {\n $('.customers-list').removeClass('spinner');\n $('.customers-grid').removeClass('spinner');\n\n // start show count info\n $('.main-header .zones .navigations .customers-count-min').html(data.pagination.min);\n $('.main-header .zones .navigations .customers-count-max').html(data.pagination.max);\n $('.main-header .zones .navigations .customers-count-total').html(data.pagination.count);\n\n $('.main-header .zones .navigations .pagination-first').attr(\"data-page\", data.pagination.first);\n $('.main-header .zones .navigations .pagination-prev').attr(\"data-page\", data.pagination.prev);\n $('.main-header .zones .navigations .pagination-current').val(data.pagination.current).attr(\"data-page\", data.pagination.next);\n $('.main-header .zones .navigations .pagination-next').attr(\"data-page\", data.pagination.next);\n $('.main-header .zones .navigations .pagination-last').attr(\"data-page\", data.pagination.last);\n // end show count info\n\n // start prevent click on pagination buttons\n $(\".paginations\").each(function () {\n if ($(this).attr(\"data-page\") == $(\".pagination-current\").val()) {\n $(this).addClass(\"btn-prevent-click\");\n } else {\n $(this).removeClass(\"btn-prevent-click\");\n }\n });\n // end prevent click on pagination buttons\n\n var thead = \"<tr>\";\n for (var c in data.column) {\n thead += \"<th>\" + data.column[c] + \"</th>\";\n }\n thead +=\"<th>Action</th></tr>\";\n $('#table-customers-list thead').html( thead );\n\n var tbody = \"\";\n var customerGrid = '<div class=\"container\"><div class=\"row\">';\n\n for (var i in data.customer) {\n var customer = data.customer[i];\n tbody += \"<tr>\";\n\n // check if is not null client name, then set data to 'customerGrid'\n if (customer.CLIENT) {\n customerGrid += '<div class=\"col-lg-3 col-md-4 col-sm-6 col-xs-12\">';\n customerGrid += '<div class=\"customer-grid\" data-code=\"' + customer.CODE_CLT + '\" data-client=\"' + customer.CLIENT + '\">';\n customerGrid += '<div class=\"customer-details text-center\">';\n customerGrid += '<h3 class=\"fullname\"><i class=\"fa fa-user\"></i> ' + customer.CLIENT + '</h3>';\n if (customer.E_MAIL) customerGrid += '<p><i class=\"fa fa-envelope\"></i> ' + customer.E_MAIL + '</p>';\n if (customer.TEL) customerGrid += '<p><i class=\"fa fa-phone\"></i> ' + customer.TEL + '</p>';\n customerGrid += '</div></div></div>';\n }\n\n for (var c in data.column) {\n var column = data.column[c];\n tbody += \"<td>\" + customer[column] + \"</td>\";\n }\n\n tbody += '<td>';\n tbody += ' <span class=\"btn btn-primary btn-xs btn-edit\" data-code=\"' + customer.CODE_CLT + '\" data-client=\"' + customer.CLIENT + '\"><i class=\"fa fa-edit\"></i></span>';\n tbody += ' <span class=\"btn btn-danger btn-xs btn-delete\" data-code=\"' + customer.CODE_CLT + '\"><i class=\"fa fa-remove\"></i></span>';\n tbody += '</td></tr>';\n }\n\n customerGrid += \"</div></div>\"\n\n $('#table-customers-list tbody').html( tbody );\n datatablesInit();\n\n $('.customers-grid > .customers-grid-content').html( customerGrid );\n })\n\n .fail(function(data) {\n console.log(\"error \");\n $('.customers-list').removeClass('spinner');\n $('.customers-grid').removeClass('spinner');\n $('.customers-list .retry-btn').show();\n $('.customers-grid .retry-btn').show();\n });\n }", "title": "" }, { "docid": "f1a3fb329213e1325213886b0bb227c7", "score": "0.50354236", "text": "function countAllItems() {\n const headerCounter = document.getElementById('header-counter');\n const basket = getBasket();\n let count = 0;\n for (let i = 0; i < basket.length; i += 1) {\n count += basket[i].count;\n }\n headerCounter.innerHTML = count;\n}", "title": "" } ]
1e98dc8eff91eb530a22a866538df9c4
Finalize the block's creation
[ { "docid": "31f742b8bd35c298c102a7adda59942d", "score": "0.0", "text": "freeze() {\n\t\tthis.timestamp = Date.now()\n\t\tthis.hash = this.generateHash()\n\t}", "title": "" } ]
[ { "docid": "7a32dba9e1500285b9b9339bb0ad7da8", "score": "0.7114395", "text": "finalize() {\n if (this.tr_buffer) {\n throw new Error(\"already finalized\");\n }\n this.ref_block_num = this.ref_block_num & 0xffff;\n this.ref_block_prefix = new Buffer(this.ref_block_prefix, \"hex\").readUInt32LE(4);\n //DEBUG console.log(\"ref_block\",@ref_block_num,@ref_block_prefix,r)\n\n var iterable = this.operations;\n for (var i = 0, op; i < iterable.length; i++) {\n op = iterable[i];\n if (op[1][\"finalize\"]) {\n op[1].finalize();\n }\n }\n this.tr_buffer = ops.transaction.toBuffer(this);\n }", "title": "" }, { "docid": "320cf6f383a4acd5fb72cf0c15d2aa36", "score": "0.6462598", "text": "finalize() {\n }", "title": "" }, { "docid": "5e02ce300afd70f5e9d65a411b8dc8c7", "score": "0.63819736", "text": "endBlock() {\n this.ident -= 1;\n this.writeLine('}');\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.633928", "text": "finalize() {\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.633928", "text": "finalize() {\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.633928", "text": "finalize() {\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.633928", "text": "finalize() {\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.633928", "text": "finalize() {\n }", "title": "" }, { "docid": "ce8b1ed6753640c0b5b73956003f590f", "score": "0.6308419", "text": "function end() {\n doc.blocks.push(currentBlock);\n\n setCurrentBlock();\n // console.log(...doc.blocks.map(b => b.tags));\n // reset block var (new it)\n // end of read, handle end of class/file\n // get function name as this is after comment block\n }", "title": "" }, { "docid": "0a895e1f5d812400abb8811a6a191b6d", "score": "0.627578", "text": "finalize() {}", "title": "" }, { "docid": "4d5f241ae89ee65bd145fe127cef809f", "score": "0.62499213", "text": "finalize() {\n\n\n }", "title": "" }, { "docid": "9e4c9d391b83c11ed2f8c0d14dd54297", "score": "0.61259484", "text": "exitBlock(ctx) {\n\t}", "title": "" }, { "docid": "9e4c9d391b83c11ed2f8c0d14dd54297", "score": "0.61259484", "text": "exitBlock(ctx) {\n\t}", "title": "" }, { "docid": "ae827a0dd3771b1dc6e59d13ee11bf8d", "score": "0.6062182", "text": "clear() {\n this.blocks = Object.create(null);\n }", "title": "" }, { "docid": "094868233a65f1a20063289a61dbb91a", "score": "0.6036585", "text": "function willFinalize$1() {}", "title": "" }, { "docid": "abe3d0e9fe0e6bd1970cdc383ce071af", "score": "0.59475887", "text": "function endBlock() {\n var block = peekBlock();\n ts.Debug.assert(block !== undefined, \"beginBlock was never called.\");\n var index = blockActions.length;\n blockActions[index] = 1 /* Close */;\n blockOffsets[index] = operations ? operations.length : 0;\n blocks[index] = block;\n blockStack.pop();\n return block;\n }", "title": "" }, { "docid": "de919dcb9eb4475d458d1562b41d323b", "score": "0.5898232", "text": "function _createBlockEnd() {\n\t var doc = this._app.doc;\n\t var anchor = doc.createComment('end');\n\t return anchor;\n\t}", "title": "" }, { "docid": "b84c0d472a17b816f81ef476c02505e1", "score": "0.5805345", "text": "function Block() {}", "title": "" }, { "docid": "d414c7f5cf6c9d59db43f76c61bf6846", "score": "0.57916427", "text": "_cleanUp() {\n this._vault = null;\n this._source = null;\n }", "title": "" }, { "docid": "56f67b7c7860d495f4163a5d115d1e1c", "score": "0.57653916", "text": "function createBlock() {\n return send(next => client.createBlock({}, next));\n }", "title": "" }, { "docid": "1af77cf2e7ba74cce9fc4575a5391826", "score": "0.57114154", "text": "function cl_block(outs) {\n cl_hash(HSIZE);\n free_ent = ClearCode + 2;\n clear_flg = true;\n output(ClearCode, outs);\n }", "title": "" }, { "docid": "1af77cf2e7ba74cce9fc4575a5391826", "score": "0.57114154", "text": "function cl_block(outs) {\n cl_hash(HSIZE);\n free_ent = ClearCode + 2;\n clear_flg = true;\n output(ClearCode, outs);\n }", "title": "" }, { "docid": "99da4dbcbe094ddcacfd1d2166c8603c", "score": "0.57042104", "text": "function Block() {\n\tthis.stereotype = '<<block>>';\n\tthis.name = '';\n\tthis.id = '';\n\tthis.color = CONFIG_block_color;\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.w = 0; \n\tthis.h = 0;\n\tthis.init_w = 160;\n\tthis.init_h = 180;\n\tthis.fill = CONFIG_block_color;\n\n\tthis.connections = [];\n\tthis.conn_side1_count = 0;\n\tthis.conn_side1_conns = [];\n\tthis.conn_side2_count = 0;\n\tthis.conn_side2_conns = [];\n\tthis.conn_side3_count = 0;\n\tthis.conn_side3_conns = [];\n\tthis.conn_side4_count = 0;\n\tthis.conn_side4_conns = [];\n\t\n\tthis.constraints = [];\n\tthis.operations = [];\n\tthis.parts = [];\n\tthis.references = [];\n\tthis.values = [];\n\tthis.properties = [];\n\n\tthis.constraint_header_y = 0;\n this.operation_header_y = 0;\n this.part_header_y = 0;\n this.reference_header_y = 0;\n this.value_header_y = 0;\n this.property_header_y = 0;\n\n this.connection_toolbar_item;\n this.all_compartment_visible = true;\n \n this.constraints_visible = true;\n this.operations_visible = true;\n this.parts_visible = true;\n\tthis.references_visible = true;\n\tthis.values_visible = true;\n\tthis.properties_visible = true;\n\n\tthis.constraints_completely_visible_off = false;\n this.operations_completely_visible_off = false;\n this.parts_completely_visible_off = false;\n\tthis.references_completely_visible_off = false;\n\tthis.values_completely_visible_off = false;\n\tthis.properties_completely_visible_off = false;\n}", "title": "" }, { "docid": "51c709e787ca9b95f1cca7d0d988e09e", "score": "0.570299", "text": "function cl_block(outs) {\n cl_hash(HSIZE);\n free_ent = ClearCode + 2;\n clear_flg = true;\n output(ClearCode, outs);\n }", "title": "" }, { "docid": "51c709e787ca9b95f1cca7d0d988e09e", "score": "0.570299", "text": "function cl_block(outs) {\n cl_hash(HSIZE);\n free_ent = ClearCode + 2;\n clear_flg = true;\n output(ClearCode, outs);\n }", "title": "" }, { "docid": "ec7e5a37e34cdb6d26e9471a496a7671", "score": "0.569701", "text": "function endWithBlock() {\n ts.Debug.assert(peekBlockKind() === 1 /* With */);\n var block = endBlock();\n markLabel(block.endLabel);\n }", "title": "" }, { "docid": "c3d68ff7f3de67f58a1119451ffb79ed", "score": "0.5674965", "text": "function Block() {\n\t this.next = null;\n\t this.previous = null;\n\t}", "title": "" }, { "docid": "a249869065c8d817446f40d552650c84", "score": "0.56728536", "text": "_onNewBlock(blockInfo) {\n this.bestBlockInfo.height = blockInfo.height;\n this.bestBlockInfo.hash = blockInfo.hash;\n\n if ((this._dapContract) && (this._isAuthed)) {\n this._fetchUserDapContext();\n }\n }", "title": "" }, { "docid": "be54b0ddc9572c0a4b551846ca85b096", "score": "0.563635", "text": "_onBlockCreated(block, saveBlock){\n\n if (!block.blockValidation.blockValidationType[\"skip-recalculating-hash-rate\"] )\n this.blocks.recalculateNetworkHashRate();\n\n }", "title": "" }, { "docid": "be54b0ddc9572c0a4b551846ca85b096", "score": "0.563635", "text": "_onBlockCreated(block, saveBlock){\n\n if (!block.blockValidation.blockValidationType[\"skip-recalculating-hash-rate\"] )\n this.blocks.recalculateNetworkHashRate();\n\n }", "title": "" }, { "docid": "0223938e4f3d02f7513d66ee10f9f07c", "score": "0.56298673", "text": "finalize() {\n this.emit('finalizing');\n this.shutdown();\n this.disable();\n this.unmount();\n this.emit('finalized');\n }", "title": "" }, { "docid": "684a8d444586e297a1dfe5964ca9f3f2", "score": "0.5622768", "text": "addBlock(block){\n \taddBlock(block);\n }", "title": "" }, { "docid": "eb5a2756df4f4254f4f0ebc7da1115d0", "score": "0.5613439", "text": "function init() {\n\tallBlockObjects = blockFactory.createInitialBlocks();\n}", "title": "" }, { "docid": "c962e0748f83dd21814d518bb3ec5493", "score": "0.55618376", "text": "function saveBlock() {\n if (currentBlock) {\n currentFile.blocks.push(currentBlock);\n currentBlock = null;\n }\n }", "title": "" }, { "docid": "4700e8d7ad66fe1fbf080928e36fbdf7", "score": "0.5554334", "text": "endBlock(nodeCount) {\n const len = this._blockStarts.pop()\n if (len === undefined)\n throw new Error('CodeGen: not in self-balancing block')\n const toClose = this._nodes.length - len\n if (\n toClose < 0 ||\n (nodeCount !== undefined && toClose !== nodeCount)\n ) {\n throw new Error(\n `CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`\n )\n }\n this._nodes.length = len\n return this\n }", "title": "" }, { "docid": "f65bf50a322200e67ad6c4a797b1e290", "score": "0.5552036", "text": "cleanup () {\n if (this._inflate) {\n if (this._inflate.writeInProgress) {\n this._inflate.pendingClose = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate.writeInProgress) {\n this._deflate.pendingClose = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "title": "" }, { "docid": "f65bf50a322200e67ad6c4a797b1e290", "score": "0.5552036", "text": "cleanup () {\n if (this._inflate) {\n if (this._inflate.writeInProgress) {\n this._inflate.pendingClose = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate.writeInProgress) {\n this._deflate.pendingClose = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "title": "" }, { "docid": "5951d49fdd352f2e50e10236814bd2b8", "score": "0.5551363", "text": "function finalize() {\n var childId = 0;\n var processChildNode = function() {\n if (childId >= _self.childNodes.length) {\n outputStream.write('\\r\\n--' + _self.boundary + '--\\r\\n');\n return callback();\n }\n var child = _self.childNodes[childId++];\n outputStream.write((childId > 1 ? '\\r\\n' : '') + '--' + _self.boundary + '\\r\\n');\n child.stream(outputStream, options, function() {\n setImmediate(processChildNode);\n });\n };\n\n if (_self.multipart) {\n setImmediate(processChildNode);\n } else {\n return callback();\n }\n }", "title": "" }, { "docid": "8eb53e90d02aa669b26f25204daff614", "score": "0.55444294", "text": "function Finalizable () {\n \n this.finalized = false;\n \n }", "title": "" }, { "docid": "7dbf08834f248fae457f6cb2280d0179", "score": "0.55314606", "text": "handleBlockEnd() {\n this._importOverrideMapArray.pop();\n }", "title": "" }, { "docid": "9c98ec4a55e485dc85e435cc925c809e", "score": "0.5513703", "text": "endBlock(nodeCount) {\n const len = this._blockStarts.pop();\n if (len === undefined)\n throw new Error(\"CodeGen: not in self-balancing block\");\n const toClose = this._nodes.length - len;\n if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {\n throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n }\n this._nodes.length = len;\n return this;\n }", "title": "" }, { "docid": "9c98ec4a55e485dc85e435cc925c809e", "score": "0.5513703", "text": "endBlock(nodeCount) {\n const len = this._blockStarts.pop();\n if (len === undefined)\n throw new Error(\"CodeGen: not in self-balancing block\");\n const toClose = this._nodes.length - len;\n if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {\n throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);\n }\n this._nodes.length = len;\n return this;\n }", "title": "" }, { "docid": "1e9de472a62f1c748ffa0af265d6d1a1", "score": "0.55069417", "text": "postNewBlock()\n {\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: async (request, reply) => {\n\n if (request.payload === undefined || request.payload.body === undefined) {\n return boom.badRequest(`Invalid request payload: ${request.payload}`);\t//400\n }\n\n let body = request.payload.body.trim();\n \t\t\tif (body.length === 0) {\n return boom.badRequest('Invalid request payload: EMPTY');\t// 400\n }\n\n \ttry {\n\n let blockAux = new BlockClass.Block();\n blockAux.body = body;\n\n await this.addBlock(blockAux);\n\n console.log(`New Block created at height: ${blockAux.height}`);\n console.log(`${JSON.stringify(blockAux)}`);\n\n return blockAux;\n\n } catch (err) {\n \treturn boom.badImplementation(err.message);\t// 500\n \t}\n }\n });\n }", "title": "" }, { "docid": "53226af092f739cc690e2086b79f53cc", "score": "0.55063426", "text": "exitBlockStatement(ctx) {\n\t}", "title": "" }, { "docid": "8f362101e6bd7d94b28701535eb8c295", "score": "0.54976386", "text": "finalize() {\n this.cache = null;\n }", "title": "" }, { "docid": "4494b6c2fd226a1edbc408279343831c", "score": "0.5492722", "text": "function onDragEnd(event) {\n let block = event.target;\n\n // if block is created from sidebar\n if (block.originalAddress[0] == -1) {\n // if drag ended location is inside sidebar, and delete block\n let relativeMousePosition = event.data.getLocalPosition(this.stage.sidebar);\n if (this.stage.sidebar.containsPosition(relativeMousePosition)) {\n this.stage.sidebar.removeChild(block);\n } else {\n this.stage.addChild(block);\n // Apply possible stage offset due to panning\n block.position.x -= this.stage.position.x;\n block.position.y -= this.stage.position.y;\n }\n }\n\n // if block has targetBlock(placeholder block that is being hovered over), attach\n if(event.targetBlock) {\n block.attachTo(event.targetBlock);\n }\n\n // Get new block address\n let newAddress = this.getAddress(block);\n\n // if parameter block is not in scope, delete block\n if (block.type === CraftyBlock.PARAMETER && newAddress[0] !== block.originalAddress[0]) {\n this.removeBlock(block);\n } else {\n // only interested in when block address changed\n if (!this.isAddressEqual(block.originalAddress,newAddress) && newAddress[0] != -3) { // -3 is when block is deleted\n\n // when block is no longer a root block\n if (block.originalAddress.length == 1 && newAddress.length != 1) {\n // remove block from rootBlocks\n this.rootBlocks.splice(this.rootBlocks.indexOf(block),1);\n }\n\n // if the block is on stage\n if (newAddress[0] == -2) {\n // add to rootBlocks right after original root block position\n if (block.originalAddress[0] == -1) {\n this.rootBlocks.push(block);\n } else {\n this.rootBlocks.splice(block.originalAddress[0]+1,0,block);\n }\n // no need to addToStage since it is already done during moving\n }\n\n CraftyBlockEvents.emit('canvaschange');\n }\n }\n\n block.originalAddress = undefined;\n }", "title": "" }, { "docid": "ff53057f4261fe89de403a013f030a01", "score": "0.5477868", "text": "addBlock(data){\n\n let newBlock = new Block.Block(data);\n\n // -- check if the mempool it has anything-- \n // add graduted students, // TODO Block size dissection \n\n //gives the block time and discarding the last three numbers\n newBlock.timestamp = Date.now().toString().slice(0,-3);\n // gives the height \n newBlock.height = this.list.length;\n // to avoid the error from gensis block\n if(this.list.length > 0){\n // get the hash from the last block\n newBlock.previousHash = this.list[this.list.length-1].hash;\n } \n // hash all the data inside the block\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n //push the block into the list (Temp)\n\n this.list.push(newBlock);\n // return the block\n return newBlock;\n}", "title": "" }, { "docid": "7dc1e969e71d54e8499ff33429bd8acd", "score": "0.5476328", "text": "generateNewBlock(){\n var blockType = getRandomNumber(0,blocks.length - 1);\n var block = new Block(blocks[blockType]);\n //TODO : new block initialized positions\n this.active = block;\n return block;\n }", "title": "" }, { "docid": "4bf844cdf69cdd1d3801990a420275f0", "score": "0.54761165", "text": "cl_block(outs) {\r\n this.cl_hash(HSIZE);\r\n this.free_ent = this.ClearCode + 2;\r\n this.clear_flg = true;\r\n this.output(this.ClearCode, outs);\r\n }", "title": "" }, { "docid": "a2b7243c687282b6849073402943e512", "score": "0.54588354", "text": "cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n this._deflate.close();\n this._deflate = null;\n }\n }", "title": "" }, { "docid": "a2b7243c687282b6849073402943e512", "score": "0.54588354", "text": "cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n this._deflate.close();\n this._deflate = null;\n }\n }", "title": "" }, { "docid": "a2b7243c687282b6849073402943e512", "score": "0.54588354", "text": "cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n this._deflate.close();\n this._deflate = null;\n }\n }", "title": "" }, { "docid": "376de373934f022e97023fa0209cc32f", "score": "0.54346436", "text": "static finalize() {\n if (!hasClassFinalized(this)) {\n finalizeClassAndSuper(this);\n }\n }", "title": "" }, { "docid": "0e0248131c2bbb08051eab27f97e3e1d", "score": "0.5429068", "text": "async finalize(options) {\n await super.finalize(options)\n }", "title": "" }, { "docid": "b16d5c59638632a3293b2349c1091e98", "score": "0.5427513", "text": "function FreeBlock(startTime, endTime) {\n BasicBlock.call(this, startTime, endTime);\n}", "title": "" }, { "docid": "6fcf6e7a515f92983c86a200de30beda", "score": "0.5417084", "text": "exitConstructorBody(ctx) {\n\t}", "title": "" }, { "docid": "e3085eb2732cd4416d81fd930ddbc3dd", "score": "0.54145396", "text": "function lifecycleRemoved() {\n this[ Constants.INSERTED ] = false;\n\n const block = this[ Constants.BLOCK ];\n\n if (block) {\n block.destroy();\n this[ Constants.BLOCK ] = undefined;\n }\n}", "title": "" }, { "docid": "7da5f2d7e883e1e65da8fbfd72c5151b", "score": "0.5398758", "text": "async addBlock(newBlock) {\n \n //Get height from DB \n const height = await this.getBlockHeight()\n newBlock.height = height + 1\n //UTC time\n newBlock.time = new Date().getTime().toString().slice(0, -3)\n \n //If the first non Genesis block has been added, link to previous block. \n if (newBlock.height > 0) {\n const prevBlock = await this.getBlock(height)\n newBlock.previousBlockHash = prevBlock.hash\n }\n\n //Create hash\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString()\n\n //Add block to DB\n console.log(\"Add block: \"+newBlock.height)\n await DB.addBlockToDB(newBlock.height, JSON.stringify(newBlock))\n return newBlock\n }", "title": "" }, { "docid": "025b1277d7873374f41a3684138907b6", "score": "0.53862494", "text": "finalize() {\n this.resourceManager.finalize(); // Finalize all layers\n\n for (const layer of this.layers) {\n this._finalizeLayer(layer);\n }\n }", "title": "" }, { "docid": "38aea98a651a5e6119fcda72beeacdf6", "score": "0.53862166", "text": "function resetItemBlocks() {\n removeItemBlocks();\n createItemBlock('New Item Block', [], []);\n}", "title": "" }, { "docid": "da78388805610784af53f08ef4258673", "score": "0.53779334", "text": "addBlock(newBlock){\n\n var self = this;\n return new Promise(function(resolve, reject) {\n console.log(newBlock);\n if(typeof newBlock === 'object') { \n getCompleteBlocksDBData().then(function(data) {\n console.log(\"addBlock entered: \", data);\n // Block height\n if(typeof newBlock === 'object') {\n newBlock.height = data.length;\n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n // previous block hash\n if(data.length > 0){\n newBlock.previousBlockHash = JSON.parse(data[data.length-1].value).hash;\n }\n else {\n /*var welcome_message = \"Welcome to your private Blockchain\";\n var genesis_message = \"your genesis Block is created. EJY\"\n console.log(self.comments().replace(\"{0}\", \"=\".repeat(welcome_message.length)));\n console.log(self.comments().replace(\"{0}\", welcome_message));\n console.log(self.comments().replace(\"{0}\", genesis_message));\n console.log(self.comments().replace(\"{0}\", \"=\".repeat(welcome_message.length))); */\n }\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n console.log(\"IMPORTANT: newBlock structure\", JSON.stringify(newBlock));\n // Adding block object to chain\n addDataToLevelDB(JSON.stringify(newBlock))\n .then(function(result) {\n if(JSON.parse(result).height == 0) {\n var welcome_message = \"Welcome to your private Blockchain\";\n var genesis_message = \"your genesis Block is created. EJY\";\n console.log(self.comments().replace(\"{0}\", \"=\".repeat(welcome_message.length)));\n console.log(self.comments().replace(\"{0}\", welcome_message));\n console.log(self.comments().replace(\"{0}\", genesis_message));\n console.log(self.comments().replace(\"{0}\", \"=\".repeat(welcome_message.length)));\n }\n else {\n var welcome_message = \"Your Block is Successfully Added\";\n console.log(self.comments().replace(\"{0}\", \"=\".repeat(welcome_message.length)));\n console.log(self.comments().replace(\"{0}\", welcome_message));\n console.log(self.comments().replace(\"{0}\", \"=\".repeat(welcome_message.length)));\n }\n console.log(\"addBlock resolved\");\n return resolve(result);\n }); \n }\n else {\n return reject();\n } \n })\n }\n else {\n var error = \"It is not a Block object. Please enter a Block. example: obj.addBlock(new Block('My First Block'))\";\n console.log(error)\n return reject(error);\n }\n\n });\n }", "title": "" }, { "docid": "118dc2b32a2637b7779676f41d93dfb0", "score": "0.5375238", "text": "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "title": "" }, { "docid": "118dc2b32a2637b7779676f41d93dfb0", "score": "0.5375238", "text": "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "title": "" }, { "docid": "118dc2b32a2637b7779676f41d93dfb0", "score": "0.5375238", "text": "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "title": "" }, { "docid": "118dc2b32a2637b7779676f41d93dfb0", "score": "0.5375238", "text": "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "title": "" }, { "docid": "a7c3462129d0ba5a521306a89caba1fa", "score": "0.53487045", "text": "saveBlock(){\n this.canvas = this.renderTempField();\n }", "title": "" }, { "docid": "39709d5951d282a43945cce7f83f28f6", "score": "0.5347656", "text": "function Block(protoblock, blocks, overrideName) {\n if (protoblock === null) {\n console.log('null protoblock sent to Block');\n return;\n }\n\n this.protoblock = protoblock;\n this.name = protoblock.name;\n this.overrideName = overrideName;\n this.blocks = blocks;\n this.collapsed = false; // Is this block in a collapsed stack?\n this.trash = false; // Is this block in the trash?\n this.loadComplete = false; // Has the block finished loading?\n this.label = null; // Editable textview in DOM.\n this.text = null; // A dynamically generated text label on block itself.\n this.value = null; // Value for number, text, and media blocks.\n this.privateData = null; // A block may have some private data,\n // e.g., nameboxes use this field to store\n // the box name associated with the block.\n this.image = protoblock.image; // The file path of the image.\n this.imageBitmap = null;\n\n // All blocks have at a container and least one bitmap.\n this.container = null;\n this.bounds = null;\n this.bitmap = null;\n this.highlightBitmap = null;\n\n // The svg from which the bitmaps are generated\n this.artwork = null;\n this.collapseArtwork = null;\n\n // Start and Action blocks has a collapse button (in a separate\n // container).\n this.collapseContainer = null;\n this.collapseBitmap = null;\n this.expandBitmap = null;\n this.collapseBlockBitmap = null;\n this.highlightCollapseBlockBitmap = null;\n this.collapseText = null;\n\n this.size = 1; // Proto size is copied here.\n this.docks = []; // Proto dock is copied here.\n this.connections = [];\n\n // Keep track of clamp count for blocks with clamps.\n this.clampCount = [1, 1];\n this.argClampSlots = [1];\n\n // Some blocks have some post process after they are first loaded.\n this.postProcess = null;\n this.postProcessArg = null;\n\n // Lock on label change\n this._label_lock = false;\n\n // Internal function for creating cache.\n // Includes workaround for a race condition.\n this._createCache = function () {\n var myBlock = this;\n myBlock.bounds = myBlock.container.getBounds();\n\n if (myBlock.bounds == null) {\n setTimeout(function () {\n myBlock._createCache();\n }, 200);\n } else {\n myBlock.container.cache(myBlock.bounds.x, myBlock.bounds.y, myBlock.bounds.width, myBlock.bounds.height);\n }\n };\n\n // Internal function for creating cache.\n // Includes workaround for a race condition.\n this.updateCache = function () {\n var myBlock = this;\n\n if (myBlock.bounds == null) {\n setTimeout(function () {\n myBlock.updateCache();\n }, 300);\n } else {\n myBlock.container.updateCache();\n myBlock.blocks.refreshCanvas();\n }\n };\n\n this.offScreen = function (boundary) {\n return !this.trash && boundary.offScreen(this.container.x, this.container.y);\n };\n\n this.copySize = function () {\n this.size = this.protoblock.size;\n };\n\n this.getInfo = function () {\n return this.name + ' block';\n };\n\n this.highlight = function () {\n if (this.collapsed && COLLAPSABLES.indexOf(this.name) !== -1) {\n // We may have a race condition.\n if (this.highlightCollapseBlockBitmap) {\n this.highlightCollapseBlockBitmap.visible = true;\n this.collapseBlockBitmap.visible = false;\n this.collapseText.visible = true;\n this.bitmap.visible = false;\n this.highlightBitmap.visible = false;\n }\n } else {\n this.bitmap.visible = false;\n this.highlightBitmap.visible = true;\n if (COLLAPSABLES.indexOf(this.name) !== -1) {\n // There could be a race condition when making a\n // new action block.\n if (this.highlightCollapseBlockBitmap) {\n if (this.collapseText !== null) {\n this.collapseText.visible = false;\n }\n if (this.collapseBlockBitmap.visible !== null) {\n this.collapseBlockBitmap.visible = false;\n }\n if (this.highlightCollapseBlockBitmap.visible !== null) {\n this.highlightCollapseBlockBitmap.visible = false;\n }\n }\n }\n }\n this.updateCache();\n };\n\n this.unhighlight = function () {\n if (this.collapsed && COLLAPSABLES.indexOf(this.name) !== -1) {\n if (this.highlightCollapseBlockBitmap) {\n this.highlightCollapseBlockBitmap.visible = false;\n this.collapseBlockBitmap.visible = true;\n this.collapseText.visible = true;\n this.bitmap.visible = false;\n this.highlightBitmap.visible = false;\n }\n } else {\n this.bitmap.visible = true;\n this.highlightBitmap.visible = false;\n if (COLLAPSABLES.indexOf(this.name) !== -1) {\n if (this.highlightCollapseBlockBitmap) {\n this.highlightCollapseBlockBitmap.visible = false;\n this.collapseBlockBitmap.visible = false;\n this.collapseText.visible = false;\n }\n }\n }\n this.updateCache();\n };\n\n this.updateArgSlots = function (slotList) {\n // Resize and update number of slots in argClamp\n this.argClampSlots = slotList;\n this._newArtwork();\n this.regenerateArtwork(false);\n };\n\n this.updateSlots = function (clamp, plusMinus) {\n // Resize an expandable block.\n this.clampCount[clamp] += plusMinus;\n this._newArtwork(plusMinus);\n this.regenerateArtwork(false);\n };\n\n this.resize = function (scale) {\n // If the block scale changes, we need to regenerate the\n // artwork and recalculate the hitarea.\n var myBlock = this;\n\n this.postProcess = function (args) {\n if (myBlock.imageBitmap !== null) {\n myBlock._positionMedia(myBlock.imageBitmap, myBlock.imageBitmap.image.width, myBlock.imageBitmap.image.height, scale);\n z = myBlock.container.getNumChildren() - 1;\n myBlock.container.setChildIndex(myBlock.imageBitmap, z);\n }\n\n if (myBlock.name === 'start' || myBlock.name === 'drum') {\n // Rescale the decoration on the start blocks.\n for (var turtle = 0; turtle < myBlock.blocks.turtles.turtleList.length; turtle++) {\n if (myBlock.blocks.turtles.turtleList[turtle].startBlock === myBlock) {\n myBlock.blocks.turtles.turtleList[turtle].resizeDecoration(scale, myBlock.bitmap.image.width);\n myBlock._ensureDecorationOnTop();\n break;\n }\n }\n }\n myBlock.updateCache();\n myBlock._calculateBlockHitArea();\n\n // If it is in the trash, make sure it remains hidden.\n if (myBlock.trash) {\n myBlock.hide();\n }\n };\n\n this.postProcessArg = null;\n\n this.protoblock.scale = scale;\n this._newArtwork(0);\n this.regenerateArtwork(true, []);\n\n if (this.text !== null) {\n this._positionText(scale);\n }\n\n if (this.collapseContainer !== null) {\n this.collapseContainer.uncache();\n var postProcess = function (myBlock) {\n myBlock.collapseBitmap.scaleX = myBlock.collapseBitmap.scaleY = myBlock.collapseBitmap.scale = scale / 2;\n myBlock.expandBitmap.scaleX = myBlock.expandBitmap.scaleY = myBlock.expandBitmap.scale = scale / 2;\n\n var bounds = myBlock.collapseContainer.getBounds();\n if (bounds) myBlock.collapseContainer.cache(bounds.x, bounds.y, bounds.width, bounds.height);\n myBlock._positionCollapseContainer(myBlock.protoblock.scale);\n myBlock._calculateCollapseHitArea();\n };\n\n this._generateCollapseArtwork(postProcess);\n var fontSize = 10 * scale;\n this.collapseText.font = fontSize + 'px Sans';\n this._positionCollapseLabel(scale);\n }\n };\n\n this._newArtwork = function (plusMinus) {\n if (COLLAPSABLES.indexOf(this.name) > -1) {\n var proto = new ProtoBlock('collapse');\n proto.scale = this.protoblock.scale;\n proto.extraWidth = 10;\n proto.basicBlockCollapsed();\n var obj = proto.generator();\n this.collapseArtwork = obj[0];\n var obj = this.protoblock.generator(this.clampCount[0]);\n } else if (this.name === 'ifthenelse') {\n var obj = this.protoblock.generator(this.clampCount[0], this.clampCount[1]);\n } else if (this.protoblock.style === 'clamp') {\n var obj = this.protoblock.generator(this.clampCount[0]);\n } else {\n switch (this.name) {\n case 'equal':\n case 'greater':\n case 'less':\n var obj = this.protoblock.generator(this.clampCount[0]);\n break;\n case 'calcArg':\n case 'doArg':\n case 'namedcalcArg':\n case 'nameddoArg':\n var obj = this.protoblock.generator(this.argClampSlots);\n this.size = 2;\n for (var i = 0; i < this.argClampSlots.length; i++) {\n this.size += this.argClampSlots[i];\n }\n this.docks = [];\n this.docks.push([obj[1][0][0], obj[1][0][1], this.protoblock.dockTypes[0]]);\n break;\n default:\n if (this.isArgBlock()) {\n var obj = this.protoblock.generator(this.clampCount[0]);\n } else if (this.isTwoArgBlock()) {\n var obj = this.protoblock.generator(this.clampCount[0]);\n } else {\n var obj = this.protoblock.generator();\n }\n this.size += plusMinus;\n break;\n }\n }\n\n switch (this.name) {\n case 'nameddoArg':\n for (var i = 1; i < obj[1].length - 1; i++) {\n this.docks.push([obj[1][i][0], obj[1][i][1], 'anyin']);\n }\n\n this.docks.push([obj[1][2][0], obj[1][2][1], 'in']);\n break;\n case 'namedcalcArg':\n for (var i = 1; i < obj[1].length; i++) {\n this.docks.push([obj[1][i][0], obj[1][i][1], 'anyin']);\n }\n break;\n case 'doArg':\n this.docks.push([obj[1][1][0], obj[1][1][1], this.protoblock.dockTypes[1]]);\n for (var i = 2; i < obj[1].length - 1; i++) {\n this.docks.push([obj[1][i][0], obj[1][i][1], 'anyin']);\n }\n\n this.docks.push([obj[1][3][0], obj[1][3][1], 'in']);\n break;\n case 'calcArg':\n this.docks.push([obj[1][1][0], obj[1][1][1], this.protoblock.dockTypes[1]]);\n for (var i = 2; i < obj[1].length; i++) {\n this.docks.push([obj[1][i][0], obj[1][i][1], 'anyin']);\n }\n break;\n default:\n break;\n }\n\n // Save new artwork and dock positions.\n this.artwork = obj[0];\n for (var i = 0; i < this.docks.length; i++) {\n this.docks[i][0] = obj[1][i][0];\n this.docks[i][1] = obj[1][i][1];\n }\n };\n\n this.imageLoad = function () {\n // Load any artwork associated with the block and create any\n // extra parts. Image components are loaded asynchronously so\n // most the work happens in callbacks.\n\n // We need a text label for some blocks. For number and text\n // blocks, this is the primary label; for parameter blocks,\n // this is used to display the current block value.\n var fontSize = 10 * this.protoblock.scale;\n this.text = new createjs.Text('', fontSize + 'px Sans', '#000000');\n\n this.generateArtwork(true, []);\n };\n\n this._addImage = function () {\n var image = new Image();\n var myBlock = this;\n\n image.onload = function () {\n var bitmap = new createjs.Bitmap(image);\n bitmap.name = 'media';\n myBlock.container.addChild(bitmap);\n myBlock._positionMedia(bitmap, image.width, image.height, myBlock.protoblock.scale);\n myBlock.imageBitmap = bitmap;\n myBlock.updateCache();\n };\n image.src = this.image;\n };\n\n this.regenerateArtwork = function (collapse) {\n // Sometimes (in the case of namedboxes and nameddos) we need\n // to regenerate the artwork associated with a block.\n\n // First we need to remove the old artwork.\n if (this.bitmap != null) {\n this.container.removeChild(this.bitmap);\n }\n\n if (this.highlightBitmap != null) {\n this.container.removeChild(this.highlightBitmap);\n }\n\n if (collapse && this.collapseBitmap !== null) {\n this.collapseContainer.removeChild(this.collapseBitmap);\n this.collapseContainer.removeChild(this.expandBitmap);\n this.container.removeChild(this.collapseBlockBitmap);\n this.container.removeChild(this.highlightCollapseBlockBitmap);\n }\n\n // Then we generate new artwork.\n this.generateArtwork(false);\n };\n\n this.generateArtwork = function (firstTime) {\n // Get the block labels from the protoblock.\n var myBlock = this;\n var thisBlock = this.blocks.blockList.indexOf(this);\n var block_label = '';\n\n // Create the highlight bitmap for the block.\n function __processHighlightBitmap(name, bitmap, myBlock) {\n if (myBlock.highlightBitmap != null) {\n myBlock.container.removeChild(myBlock.highlightBitmap);\n }\n\n myBlock.highlightBitmap = bitmap;\n myBlock.container.addChild(myBlock.highlightBitmap);\n myBlock.highlightBitmap.x = 0;\n myBlock.highlightBitmap.y = 0;\n myBlock.highlightBitmap.name = 'bmp_highlight_' + thisBlock;\n myBlock.highlightBitmap.cursor = 'pointer';\n // Hide highlight bitmap to start.\n myBlock.highlightBitmap.visible = false;\n\n // At me point, it should be safe to calculate the\n // bounds of the container and cache its contents.\n if (!firstTime) {\n myBlock.container.uncache();\n }\n\n myBlock._createCache();\n myBlock.blocks.refreshCanvas();\n\n if (firstTime) {\n myBlock._loadEventHandlers();\n if (myBlock.image !== null) {\n myBlock._addImage();\n }\n myBlock._finishImageLoad();\n } else {\n if (myBlock.name === 'start' || myBlock.name === 'drum') {\n myBlock._ensureDecorationOnTop();\n }\n\n // Adjust the docks.\n myBlock.blocks.adjustDocks(thisBlock, true);\n\n // Adjust the text position.\n myBlock._positionText(myBlock.protoblock.scale);\n\n if (COLLAPSABLES.indexOf(myBlock.name) !== -1) {\n myBlock.bitmap.visible = !myBlock.collapsed;\n myBlock.highlightBitmap.visible = false;\n myBlock.updateCache();\n }\n\n if (myBlock.postProcess != null) {\n myBlock.postProcess(myBlock.postProcessArg);\n myBlock.postProcess = null;\n }\n }\n };\n\n // Create the bitmap for the block.\n function __processBitmap(name, bitmap, myBlock) {\n if (myBlock.bitmap != null) {\n myBlock.container.removeChild(myBlock.bitmap);\n }\n\n myBlock.bitmap = bitmap;\n myBlock.container.addChild(myBlock.bitmap);\n myBlock.bitmap.x = 0;\n myBlock.bitmap.y = 0;\n myBlock.bitmap.name = 'bmp_' + thisBlock;\n myBlock.bitmap.cursor = 'pointer';\n myBlock.blocks.refreshCanvas();\n\n if (myBlock.protoblock.disabled) {\n var artwork = myBlock.artwork.replace(/fill_color/g, DISABLEDFILLCOLOR).replace(/stroke_color/g, DISABLEDSTROKECOLOR).replace('block_label', block_label);\n } else {\n var artwork = myBlock.artwork.replace(/fill_color/g, PALETTEHIGHLIGHTCOLORS[myBlock.protoblock.palette.name]).replace(/stroke_color/g, HIGHLIGHTSTROKECOLORS[myBlock.protoblock.palette.name]).replace('block_label', block_label);\n }\n\n for (var i = 1; i < myBlock.protoblock.staticLabels.length; i++) {\n artwork = artwork.replace('arg_label_' + i, myBlock.protoblock.staticLabels[i]);\n }\n\n _makeBitmap(artwork, myBlock.name, __processHighlightBitmap, myBlock);\n };\n\n if (this.overrideName) {\n if (['nameddo', 'nameddoArg', 'namedcalc', 'namedcalcArg'].indexOf(this.name) !== -1) {\n block_label = this.overrideName;\n if (block_label.length > 8) {\n block_label = block_label.substr(0, 7) + '...';\n }\n } else {\n block_label = this.overrideName;\n }\n } else if (this.protoblock.staticLabels.length > 0 && !this.protoblock.image) {\n // Label should be defined inside _().\n block_label = this.protoblock.staticLabels[0];\n }\n\n while (this.protoblock.staticLabels.length < this.protoblock.args + 1) {\n this.protoblock.staticLabels.push('');\n }\n\n if (firstTime) {\n // Create artwork and dock.\n var obj = this.protoblock.generator();\n this.artwork = obj[0];\n for (var i = 0; i < obj[1].length; i++) {\n this.docks.push([obj[1][i][0], obj[1][i][1], this.protoblock.dockTypes[i]]);\n }\n }\n\n if (this.protoblock.disabled) {\n var artwork = this.artwork.replace(/fill_color/g, DISABLEDFILLCOLOR).replace(/stroke_color/g, DISABLEDSTROKECOLOR).replace('block_label', block_label);\n } else {\n var artwork = this.artwork.replace(/fill_color/g, PALETTEFILLCOLORS[this.protoblock.palette.name]).replace(/stroke_color/g, PALETTESTROKECOLORS[this.protoblock.palette.name]).replace('block_label', block_label);\n }\n\n for (var i = 1; i < this.protoblock.staticLabels.length; i++) {\n artwork = artwork.replace('arg_label_' + i, this.protoblock.staticLabels[i]);\n }\n\n _makeBitmap(artwork, this.name, __processBitmap, this);\n };\n\n this._finishImageLoad = function () {\n var thisBlock = this.blocks.blockList.indexOf(this);\n\n // Value blocks get a modifiable text label.\n if (SPECIALINPUTS.indexOf(this.name) !== -1) {\n if (this.value == null) {\n switch(this.name) {\n case 'text':\n this.value = '---';\n break;\n case 'solfege':\n case 'eastindiansolfege':\n this.value = 'sol';\n break;\n case 'notename':\n this.value = 'G';\n break;\n case 'rest':\n this.value = _('rest');\n break;\n case 'number':\n this.value = NUMBERBLOCKDEFAULT;\n break;\n case 'modename':\n this.value = getModeName(DEFAULTMODE);\n break;\n case 'voicename':\n this.value = DEFAULTVOICE;\n break;\n case 'drumname':\n this.value = getDrumName(DEFAULTDRUM);\n break;\n }\n }\n\n if (this.name === 'solfege') {\n var obj = splitSolfege(this.value);\n var label = i18nSolfege(obj[0]);\n var attr = obj[1];\n\n if (attr !== '♮') {\n label += attr;\n }\n } else if (this.name === 'eastindiansolfege') {\n var obj = splitSolfege(this.value);\n var label = WESTERN2EISOLFEGENAMES[obj[0]];\n var attr = obj[1];\n\n if (attr !== '♮') {\n label += attr;\n }\n } else {\n var label = this.value.toString();\n }\n\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n\n this.text.text = label;\n this.container.addChild(this.text);\n this._positionText(this.protoblock.scale);\n } else if (this.protoblock.parameter) {\n // Parameter blocks get a text label to show their current value.\n this.container.addChild(this.text);\n this._positionText(this.protoblock.scale);\n }\n\n if (COLLAPSABLES.indexOf(this.name) === -1) {\n this.loadComplete = true;\n if (this.postProcess !== null) {\n this.postProcess(this.postProcessArg);\n this.postProcess = null;\n }\n\n this.blocks.refreshCanvas();\n this.blocks.cleanupAfterLoad(this.name);\n } else {\n // Start blocks and Action blocks can collapse, so add an\n // event handler.\n var proto = new ProtoBlock('collapse');\n proto.scale = this.protoblock.scale;\n proto.extraWidth = 10;\n proto.basicBlockCollapsed();\n var obj = proto.generator();\n this.collapseArtwork = obj[0];\n var postProcess = function (myBlock) {\n myBlock._loadCollapsibleEventHandlers();\n myBlock.loadComplete = true;\n\n if (myBlock.postProcess !== null) {\n myBlock.postProcess(myBlock.postProcessArg);\n myBlock.postProcess = null;\n }\n };\n\n this._generateCollapseArtwork(postProcess);\n }\n };\n\n this._generateCollapseArtwork = function (postProcess) {\n var myBlock = this;\n var thisBlock = this.blocks.blockList.indexOf(this);\n\n function __processHighlightCollapseBitmap(name, bitmap, myBlock) {\n myBlock.highlightCollapseBlockBitmap = bitmap;\n myBlock.highlightCollapseBlockBitmap.name = 'highlight_collapse_' + thisBlock;\n myBlock.container.addChild(myBlock.highlightCollapseBlockBitmap);\n myBlock.highlightCollapseBlockBitmap.visible = false;\n\n if (myBlock.collapseText === null) {\n var fontSize = 10 * myBlock.protoblock.scale;\n switch (myBlock.name) {\n case 'action':\n myBlock.collapseText = new createjs.Text(_('action'), fontSize + 'px Sans', '#000000');\n break;\n case 'start':\n myBlock.collapseText = new createjs.Text(_('start'), fontSize + 'px Sans', '#000000');\n break;\n case 'matrix':\n myBlock.collapseText = new createjs.Text(_('matrix'), fontSize + 'px Sans', '#000000');\n break;\n case 'status':\n myBlock.collapseText = new createjs.Text(_('status'), fontSize + 'px Sans', '#000000');\n break;\n case 'pitchdrummatrix':\n myBlock.collapseText = new createjs.Text(_('drum'), fontSize + 'px Sans', '#000000');\n break;\n case 'rhythmruler':\n myBlock.collapseText = new createjs.Text(_('ruler'), fontSize + 'px Sans', '#000000');\n break;\n case 'pitchstaircase':\n myBlock.collapseText = new createjs.Text(_('stair'), fontSize + 'px Sans', '#000000');\n break;\n case 'tempo':\n myBlock.collapseText = new createjs.Text(_('tempo'), fontSize + 'px Sans', '#000000');\n case 'modewidget':\n myBlock.collapseText = new createjs.Text(_('mode'), fontSize + 'px Sans', '#000000');\n break;\n case 'pitchslider':\n myBlock.collapseText = new createjs.Text(_('slider'), fontSize + 'px Sans', '#000000');\n break;\n case 'drum':\n myBlock.collapseText = new createjs.Text(_('drum'), fontSize + 'px Sans', '#000000');\n break;\n }\n myBlock.collapseText.textAlign = 'left';\n myBlock.collapseText.textBaseline = 'alphabetic';\n myBlock.container.addChild(myBlock.collapseText);\n }\n myBlock._positionCollapseLabel(myBlock.protoblock.scale);\n myBlock.collapseText.visible = myBlock.collapsed;\n\n myBlock._ensureDecorationOnTop();\n\n myBlock.updateCache();\n\n myBlock.collapseContainer = new createjs.Container();\n myBlock.collapseContainer.snapToPixelEnabled = true;\n\n var image = new Image();\n image.onload = function () {\n myBlock.collapseBitmap = new createjs.Bitmap(image);\n myBlock.collapseBitmap.scaleX = myBlock.collapseBitmap.scaleY = myBlock.collapseBitmap.scale = myBlock.protoblock.scale / 2;\n myBlock.collapseContainer.addChild(myBlock.collapseBitmap);\n myBlock.collapseBitmap.visible = !myBlock.collapsed;\n finishCollapseButton(myBlock);\n };\n\n image.src = 'images/collapse.svg';\n\n finishCollapseButton = function (myBlock) {\n var image = new Image();\n image.onload = function () {\n myBlock.expandBitmap = new createjs.Bitmap(image);\n myBlock.expandBitmap.scaleX = myBlock.expandBitmap.scaleY = myBlock.expandBitmap.scale = myBlock.protoblock.scale / 2;\n myBlock.collapseContainer.addChild(myBlock.expandBitmap);\n myBlock.expandBitmap.visible = myBlock.collapsed;\n\n var bounds = myBlock.collapseContainer.getBounds();\n if (bounds) myBlock.collapseContainer.cache(bounds.x, bounds.y, bounds.width, bounds.height);\n myBlock.blocks.stage.addChild(myBlock.collapseContainer);\n if (postProcess !== null) {\n postProcess(myBlock);\n }\n\n myBlock.blocks.refreshCanvas();\n myBlock.blocks.cleanupAfterLoad(myBlock.name);\n };\n\n image.src = 'images/expand.svg';\n }\n };\n\n function __processCollapseBitmap(name, bitmap, myBlock) {\n myBlock.collapseBlockBitmap = bitmap;\n myBlock.collapseBlockBitmap.name = 'collapse_' + thisBlock;\n myBlock.container.addChild(myBlock.collapseBlockBitmap);\n myBlock.collapseBlockBitmap.visible = myBlock.collapsed;\n myBlock.blocks.refreshCanvas();\n\n var artwork = myBlock.collapseArtwork;\n _makeBitmap(artwork.replace(/fill_color/g, PALETTEHIGHLIGHTCOLORS[myBlock.protoblock.palette.name]).replace(/stroke_color/g, HIGHLIGHTSTROKECOLORS[myBlock.protoblock.palette.name]).replace('block_label', ''), '', __processHighlightCollapseBitmap, myBlock);\n };\n\n var artwork = this.collapseArtwork;\n _makeBitmap(artwork.replace(/fill_color/g, PALETTEFILLCOLORS[this.protoblock.palette.name]).replace(/stroke_color/g, PALETTESTROKECOLORS[this.protoblock.palette.name]).replace('block_label', ''), '', __processCollapseBitmap, this);\n };\n\n this.hide = function () {\n this.container.visible = false;\n if (this.collapseContainer !== null) {\n this.collapseContainer.visible = false;\n this.collapseText.visible = false;\n }\n };\n\n this.show = function () {\n if (!this.trash) {\n // If it is an action block or it is not collapsed then show it.\n if (!(COLLAPSABLES.indexOf(this.name) === -1 && this.collapsed)) {\n this.container.visible = true;\n if (this.collapseContainer !== null) {\n this.collapseContainer.visible = true;\n this.collapseText.visible = true;\n }\n }\n }\n };\n\n // Utility functions\n this.isValueBlock = function () {\n return this.protoblock.style === 'value';\n };\n\n this.isNoHitBlock = function () {\n return NOHIT.indexOf(this.name) !== -1;\n };\n\n this.isArgBlock = function () {\n return this.protoblock.style === 'value' || this.protoblock.style === 'arg';\n };\n\n this.isTwoArgBlock = function () {\n return this.protoblock.style === 'twoarg';\n };\n\n this.isTwoArgBooleanBlock = function () {\n return ['equal', 'greater', 'less'].indexOf(this.name) !== -1;\n };\n\n this.isClampBlock = function () {\n return this.protoblock.style === 'clamp' || this.isDoubleClampBlock() || this.isArgFlowClampBlock();\n };\n\n this.isArgFlowClampBlock = function () {\n return this.protoblock.style === 'argflowclamp';\n };\n\n this.isDoubleClampBlock = function () {\n return this.protoblock.style === 'doubleclamp';\n };\n\n this.isNoRunBlock = function () {\n return this.name === 'action';\n };\n\n this.isArgClamp = function () {\n return this.protoblock.style === 'argclamp' || this.protoblock.style === 'argclamparg';\n };\n\n this.isExpandableBlock = function () {\n return this.protoblock.expandable;\n };\n\n this.getBlockId = function () {\n // Generate a UID based on the block index into the blockList.\n var number = blockBlocks.blockList.indexOf(this);\n return '_' + number.toString();\n };\n\n this.removeChildBitmap = function (name) {\n for (var child = 0; child < this.container.getNumChildren(); child++) {\n if (this.container.children[child].name === name) {\n this.container.removeChild(this.container.children[child]);\n break;\n }\n }\n };\n\n this.loadThumbnail = function (imagePath) {\n // Load an image thumbnail onto block.\n var thisBlock = this.blocks.blockList.indexOf(this);\n var myBlock = this;\n if (this.blocks.blockList[thisBlock].value === null && imagePath === null) {\n return;\n }\n var image = new Image();\n\n image.onload = function () {\n // Before adding new artwork, remove any old artwork.\n myBlock.removeChildBitmap('media');\n\n var bitmap = new createjs.Bitmap(image);\n bitmap.name = 'media';\n\n\n var myContainer = new createjs.Container();\n myContainer.addChild(bitmap);\n\n // Resize the image to a reasonable maximum.\n var MAXWIDTH = 600;\n var MAXHEIGHT = 450;\n if (image.width > image.height) {\n if (image.width > MAXWIDTH) {\n bitmap.scaleX = bitmap.scaleY = bitmap.scale = MAXWIDTH / image.width;\n }\n } else {\n if (image.height > MAXHEIGHT) {\n bitmap.scaleX = bitmap.scaleY = bitmap.scale = MAXHEIGHT / image.height;\n }\n }\n\n var bounds = myContainer.getBounds();\n myContainer.cache(bounds.x, bounds.y, bounds.width, bounds.height);\n myBlock.value = myContainer.getCacheDataURL();\n myBlock.imageBitmap = bitmap;\n\n // Next, scale the bitmap for the thumbnail.\n myBlock._positionMedia(bitmap, bitmap.image.width, bitmap.image.height, myBlock.protoblock.scale);\n myBlock.container.addChild(bitmap);\n myBlock.updateCache();\n };\n\n if (imagePath === null) {\n image.src = this.value;\n } else {\n image.src = imagePath;\n }\n };\n\n this._doOpenMedia = function (thisBlock) {\n var fileChooser = docById('myOpenAll');\n var myBlock = this;\n\n readerAction = function (event) {\n window.scroll(0, 0);\n\n var reader = new FileReader();\n reader.onloadend = (function () {\n if (reader.result) {\n if (myBlock.name === 'media') {\n myBlock.value = reader.result;\n myBlock.loadThumbnail(null);\n return;\n }\n myBlock.value = [fileChooser.files[0].name, reader.result];\n myBlock.blocks.updateBlockText(thisBlock);\n }\n });\n if (myBlock.name === 'media') {\n reader.readAsDataURL(fileChooser.files[0]);\n }\n else {\n reader.readAsText(fileChooser.files[0]);\n }\n fileChooser.removeEventListener('change', readerAction);\n };\n\n fileChooser.addEventListener('change', readerAction, false);\n fileChooser.focus();\n fileChooser.click();\n window.scroll(0, 0)\n };\n\n this.collapseToggle = function () {\n // Find the blocks to collapse/expand\n var myBlock = this;\n var thisBlock = this.blocks.blockList.indexOf(this);\n this.blocks.findDragGroup(thisBlock);\n\n function __toggle() {\n var collapse = myBlock.collapsed;\n if (myBlock.collapseBitmap === null) {\n console.log('collapse bitmap not ready');\n return;\n }\n myBlock.collapsed = !collapse;\n\n // These are the buttons to collapse/expand the stack.\n myBlock.collapseBitmap.visible = collapse;\n myBlock.expandBitmap.visible = !collapse;\n\n // These are the collpase-state bitmaps.\n myBlock.collapseBlockBitmap.visible = !collapse;\n myBlock.highlightCollapseBlockBitmap.visible = false;\n myBlock.collapseText.visible = !collapse;\n\n if (collapse) {\n myBlock.bitmap.visible = true;\n } else {\n myBlock.bitmap.visible = false;\n myBlock.updateCache();\n }\n myBlock.highlightBitmap.visible = false;\n\n if (myBlock.name === 'action') {\n // Label the collapsed block with the action label\n if (myBlock.connections[1] !== null) {\n var text = myBlock.blocks.blockList[myBlock.connections[1]].value;\n if (text.length > 8) {\n text = text.substr(0, 7) + '...';\n }\n myBlock.collapseText.text = text;\n } else {\n myBlock.collapseText.text = '';\n }\n }\n\n // Make sure the text is on top.\n var z = myBlock.container.getNumChildren() - 1;\n myBlock.container.setChildIndex(myBlock.collapseText, z);\n\n // Set collapsed state of blocks in drag group.\n if (myBlock.blocks.dragGroup.length > 0) {\n for (var b = 1; b < myBlock.blocks.dragGroup.length; b++) {\n var blk = myBlock.blocks.dragGroup[b];\n myBlock.blocks.blockList[blk].collapsed = !collapse;\n myBlock.blocks.blockList[blk].container.visible = collapse;\n }\n }\n\n myBlock.collapseContainer.updateCache();\n myBlock.updateCache();\n }\n\n __toggle();\n };\n\n this._positionText = function (blockScale) {\n this.text.textBaseline = 'alphabetic';\n this.text.textAlign = 'right';\n var fontSize = 10 * blockScale;\n this.text.font = fontSize + 'px Sans';\n this.text.x = TEXTX * blockScale / 2.;\n this.text.y = TEXTY * blockScale / 2.;\n\n // Some special cases\n if (SPECIALINPUTS.indexOf(this.name) !== -1) {\n this.text.textAlign = 'center';\n this.text.x = VALUETEXTX * blockScale / 2.;\n } else if (this.protoblock.args === 0) {\n var bounds = this.container.getBounds();\n this.text.x = bounds.width - 25;\n } else {\n this.text.textAlign = 'left';\n if (this.docks[0][2] === 'booleanout') {\n this.text.y = this.docks[0][1];\n }\n }\n\n // Ensure text is on top.\n z = this.container.getNumChildren() - 1;\n this.container.setChildIndex(this.text, z);\n this.updateCache();\n };\n\n this._positionMedia = function (bitmap, width, height, blockScale) {\n if (width > height) {\n bitmap.scaleX = bitmap.scaleY = bitmap.scale = MEDIASAFEAREA[2] / width * blockScale / 2;\n } else {\n bitmap.scaleX = bitmap.scaleY = bitmap.scale = MEDIASAFEAREA[3] / height * blockScale / 2;\n }\n bitmap.x = (MEDIASAFEAREA[0] - 10) * blockScale / 2;\n bitmap.y = MEDIASAFEAREA[1] * blockScale / 2;\n };\n\n this._calculateCollapseHitArea = function () {\n var bounds = this.collapseContainer.getBounds();\n var hitArea = new createjs.Shape();\n var w2 = bounds.width;\n var h2 = bounds.height;\n\n hitArea.graphics.beginFill('#FFF').drawEllipse(-w2 / 2, -h2 / 2, w2, h2);\n hitArea.x = w2 / 2;\n hitArea.y = h2 / 2;\n this.collapseContainer.hitArea = hitArea;\n };\n\n this._positionCollapseLabel = function (blockScale) {\n this.collapseText.x = COLLAPSETEXTX * blockScale / 2;\n this.collapseText.y = COLLAPSETEXTY * blockScale / 2;\n\n // Ensure text is on top.\n z = this.container.getNumChildren() - 1;\n this.container.setChildIndex(this.collapseText, z);\n };\n\n this._positionCollapseContainer = function (blockScale) {\n this.collapseContainer.x = this.container.x + (COLLAPSEBUTTONXOFF * blockScale / 2);\n this.collapseContainer.y = this.container.y + (COLLAPSEBUTTONYOFF * blockScale / 2);\n };\n\n // These are the event handlers for collapsible blocks.\n this._loadCollapsibleEventHandlers = function () {\n var myBlock = this;\n var thisBlock = this.blocks.blockList.indexOf(this);\n this._calculateCollapseHitArea();\n\n this.collapseContainer.on('mouseover', function (event) {\n myBlock.blocks.highlight(thisBlock, true);\n myBlock.blocks.activeBlock = thisBlock;\n myBlock.blocks.refreshCanvas();\n });\n\n var moved = false;\n var locked = false;\n var mousedown = false;\n var offset = {x:0, y:0};\n\n function handleClick () {\n if (locked) {\n return;\n }\n\n locked = true;\n\n setTimeout(function () {\n locked = false;\n }, 500);\n\n hideDOMLabel();\n if (!moved) {\n myBlock.collapseToggle();\n }\n }\n\n this.collapseContainer.on('click', function (event) {\n handleClick();\n });\n\n this.collapseContainer.on('mousedown', function (event) {\n hideDOMLabel();\n // Always show the trash when there is a block selected.\n trashcan.show();\n moved = false;\n mousedown = true;\n var d = new Date();\n blocks.mouseDownTime = d.getTime();\n offset = {\n x: myBlock.collapseContainer.x - Math.round(event.stageX / blocks.blockScale),\n y: myBlock.collapseContainer.y - Math.round(event.stageY / blocks.blockScale)\n };\n });\n\n this.collapseContainer.on('pressup', function (event) {\n if (!mousedown) {\n return;\n }\n\n mousedown = false;\n if (moved) {\n myBlock._collapseOut(blocks, thisBlock, moved, event);\n moved = false;\n } else {\n var d = new Date();\n if ((d.getTime() - blocks.mouseDownTime) > 1000) {\n var d = new Date();\n blocks.mouseDownTime = d.getTime();\n handleClick();\n }\n }\n });\n\n this.collapseContainer.on('mouseout', function (event) {\n if (!mousedown) {\n return;\n }\n mousedown = false;\n if (moved) {\n myBlock._collapseOut(blocks, thisBlock, moved, event);\n moved = false;\n } else {\n // Maybe restrict to Android?\n var d = new Date();\n if ((d.getTime() - blocks.mouseDownTime) < 200) {\n var d = new Date();\n blocks.mouseDownTime = d.getTime();\n handleClick();\n }\n }\n });\n\n this.collapseContainer.on('pressmove', function (event) {\n if (!mousedown) {\n return;\n }\n moved = true;\n var oldX = myBlock.collapseContainer.x;\n var oldY = myBlock.collapseContainer.y;\n myBlock.collapseContainer.x = Math.round(event.stageX / blocks.blockScale) + offset.x;\n myBlock.collapseContainer.y = Math.round(event.stageY / blocks.blockScale) + offset.y;\n var dx = myBlock.collapseContainer.x - oldX;\n var dy = myBlock.collapseContainer.y - oldY;\n myBlock.container.x += dx;\n myBlock.container.y += dy;\n\n // If we are over the trash, warn the user.\n if (trashcan.overTrashcan(event.stageX / blocks.blockScale, event.stageY / blocks.blockScale)) {\n trashcan.startHighlightAnimation();\n } else {\n trashcan.stopHighlightAnimation();\n }\n\n myBlock.blocks.findDragGroup(thisBlock)\n if (myBlock.blocks.dragGroup.length > 0) {\n for (var b = 0; b < myBlock.blocks.dragGroup.length; b++) {\n var blk = myBlock.blocks.dragGroup[b];\n if (b !== 0) {\n myBlock.blocks.moveBlockRelative(blk, dx, dy);\n }\n }\n }\n\n myBlock.blocks.refreshCanvas();\n });\n };\n\n this._collapseOut = function (blocks, thisBlock, moved, event) {\n // Always hide the trash when there is no block selected.\n\n trashcan.hide();\n blocks.unhighlight(thisBlock);\n if (moved) {\n // Check if block is in the trash.\n if (trashcan.overTrashcan(event.stageX / blocks.blockScale, event.stageY / blocks.blockScale)) {\n if (trashcan.isVisible)\n blocks.sendStackToTrash(this);\n } else {\n // Otherwise, process move.\n blocks.blockMoved(thisBlock);\n }\n }\n\n if (blocks.activeBlock !== myBlock) {\n return;\n }\n\n blocks.unhighlight(null);\n blocks.activeBlock = null;\n blocks.refreshCanvas();\n };\n\n this._calculateBlockHitArea = function () {\n var hitArea = new createjs.Shape();\n var bounds = this.container.getBounds()\n\n if (bounds === null) {\n this._createCache();\n bounds = this.bounds;\n }\n\n // Since hitarea is concave, we only detect hits on top\n // section of block. Otherwise we would not be able to grab\n // blocks placed inside of clamps.\n if (this.isClampBlock() || this.isArgClamp()) {\n hitArea.graphics.beginFill('#FFF').drawRect(0, 0, bounds.width, STANDARDBLOCKHEIGHT);\n } else if (this.isNoHitBlock()) {\n // No hit area\n hitArea.graphics.beginFill('#FFF').drawRect(0, 0, 0, 0);\n } else {\n // Shrinking the height makes it easier to grab blocks below\n // in the stack.\n hitArea.graphics.beginFill('#FFF').drawRect(0, 0, bounds.width, bounds.height * 0.75);\n }\n this.container.hitArea = hitArea;\n };\n\n // These are the event handlers for block containers.\n this._loadEventHandlers = function () {\n var myBlock = this;\n var thisBlock = this.blocks.blockList.indexOf(this);\n var blocks = this.blocks;\n\n this._calculateBlockHitArea();\n\n this.container.on('mouseover', function (event) {\n blocks.highlight(thisBlock, true);\n blocks.activeBlock = thisBlock;\n blocks.refreshCanvas();\n });\n\n var haveClick = false;\n var moved = false;\n var locked = false;\n var getInput = window.hasMouse;\n\n this.container.on('click', function (event) {\n blocks.activeBlock = thisBlock;\n haveClick = true;\n\n if (locked) {\n return;\n }\n\n locked = true;\n setTimeout(function () {\n locked = false;\n }, 500);\n\n hideDOMLabel();\n\n if ((!window.hasMouse && getInput) || (window.hasMouse && !moved)) {\n if (blocks.selectingStack) {\n var topBlock = blocks.findTopBlock(thisBlock);\n blocks.selectedStack = topBlock;\n blocks.selectingStack = false;\n } else if (myBlock.name === 'media') {\n myBlock._doOpenMedia(thisBlock);\n } else if (myBlock.name === 'loadFile') {\n myBlock._doOpenMedia(thisBlock);\n } else if (SPECIALINPUTS.indexOf(myBlock.name) !== -1) {\n if (!myBlock.trash) {\n myBlock._changeLabel();\n }\n } else {\n if (!blocks.inLongPress) {\n var topBlock = blocks.findTopBlock(thisBlock);\n console.log('running from ' + blocks.blockList[topBlock].name);\n blocks.logo.runLogoCommands(topBlock);\n }\n }\n }\n });\n\n this.container.on('mousedown', function (event) {\n // Track time for detecting long pause...\n // but only for top block in stack.\n if (myBlock.connections[0] == null) {\n var d = new Date();\n blocks.mouseDownTime = d.getTime();\n blocks.longPressTimeout = setTimeout(function () {\n blocks.triggerLongPress(myBlock);\n }, LONGPRESSTIME);\n }\n\n // Always show the trash when there is a block selected,\n trashcan.show();\n\n // Raise entire stack to the top.\n blocks.raiseStackToTop(thisBlock);\n\n // And possibly the collapse button.\n if (myBlock.collapseContainer != null) {\n blocks.stage.setChildIndex(myBlock.collapseContainer, blocks.stage.getNumChildren() - 1);\n }\n\n moved = false;\n var offset = {\n x: myBlock.container.x - Math.round(event.stageX / blocks.blockScale),\n y: myBlock.container.y - Math.round(event.stageY / blocks.blockScale)\n };\n\n myBlock.container.on('mouseout', function (event) {\n if (haveClick) {\n return;\n }\n\n if (!blocks.inLongPress) {\n myBlock._mouseoutCallback(event, moved, haveClick, true);\n }\n\n moved = false;\n });\n\n myBlock.container.on('pressup', function (event) {\n if (haveClick) {\n return;\n }\n\n if (!blocks.inLongPress) {\n myBlock._mouseoutCallback(event, moved, haveClick, true);\n }\n\n moved = false;\n });\n\n var original = {x: event.stageX / blocks.blockScale, y: event.stageY / blocks.blockScale};\n\n myBlock.container.on('pressmove', function (event) {\n // FIXME: More voodoo\n event.nativeEvent.preventDefault();\n\n if (blocks.longPressTimeout != null) {\n clearTimeout(blocks.longPressTimeout);\n blocks.longPressTimeout = null;\n }\n\n if (!moved && myBlock.label != null) {\n myBlock.label.style.display = 'none';\n }\n\n if (window.hasMouse) {\n moved = true;\n } else {\n // Make it eaiser to select text on mobile.\n setTimeout(function () {\n moved = Math.abs((event.stageX / blocks.blockScale) - original.x) + Math.abs((event.stageY / blocks.blockScale) - original.y) > 20 && !window.hasMouse;\n getInput = !moved;\n }, 200);\n }\n\n var oldX = myBlock.container.x;\n var oldY = myBlock.container.y;\n\n var dx = Math.round(Math.round(event.stageX / blocks.blockScale) + offset.x - oldX);\n var dy = Math.round(Math.round(event.stageY / blocks.blockScale) + offset.y - oldY);\n var finalPos = oldY + dy;\n\n if (blocks.stage.y === 0 && finalPos < (45 * blocks.blockScale)) {\n dy += (45 * blocks.blockScale) - finalPos;\n }\n\n blocks.moveBlockRelative(thisBlock, dx, dy);\n\n // If we are over the trash, warn the user.\n if (trashcan.overTrashcan(event.stageX / blocks.blockScale, event.stageY / blocks.blockScale)) {\n trashcan.startHighlightAnimation();\n } else {\n trashcan.stopHighlightAnimation();\n }\n\n if (myBlock.isValueBlock() && myBlock.name !== 'media') {\n // Ensure text is on top\n var z = myBlock.container.getNumChildren() - 1;\n myBlock.container.setChildIndex(myBlock.text, z);\n } else if (myBlock.collapseContainer != null) {\n myBlock._positionCollapseContainer(myBlock.protoblock.scale);\n }\n\n // ...and move any connected blocks.\n blocks.findDragGroup(thisBlock)\n if (blocks.dragGroup.length > 0) {\n for (var b = 0; b < blocks.dragGroup.length; b++) {\n var blk = blocks.dragGroup[b];\n if (b !== 0) {\n blocks.moveBlockRelative(blk, dx, dy);\n }\n }\n }\n\n blocks.refreshCanvas();\n });\n });\n\n this.container.on('mouseout', function (event) {\n if (!blocks.inLongPress) {\n myBlock._mouseoutCallback(event, moved, haveClick, true);\n }\n\n moved = false;\n });\n\n this.container.on('pressup', function (event) {\n if (!blocks.inLongPress) {\n myBlock._mouseoutCallback(event, moved, haveClick, false);\n }\n\n moved = false;\n });\n };\n\n this._mouseoutCallback = function (event, moved, haveClick, hideDOM) {\n var thisBlock = this.blocks.blockList.indexOf(this);\n\n // Always hide the trash when there is no block selected.\n trashcan.hide();\n\n if (this.blocks.longPressTimeout != null) {\n clearTimeout(this.blocks.longPressTimeout);\n this.blocks.longPressTimeout = null;\n }\n\n if (moved) {\n // Check if block is in the trash.\n if (trashcan.overTrashcan(event.stageX / blocks.blockScale, event.stageY / blocks.blockScale)) {\n if (trashcan.isVisible) {\n blocks.sendStackToTrash(this);\n }\n } else {\n // Otherwise, process move.\n // Also, keep track of the time of the last move.\n var d = new Date();\n blocks.mouseDownTime = d.getTime();\n this.blocks.blockMoved(thisBlock);\n\n // Just in case the blocks are not properly docked after\n // the move (workaround for issue #38 -- Blocks fly\n // apart). Still need to get to the root cause.\n this.blocks.adjustDocks(this.blocks.blockList.indexOf(this), true);\n }\n } else if (SPECIALINPUTS.indexOf(this.name) !== -1 || ['media', 'loadFile'].indexOf(this.name) !== -1) {\n if (!haveClick) {\n // Simulate click on Android.\n var d = new Date();\n if ((d.getTime() - blocks.mouseDownTime) < 500) {\n if (!this.trash)\n {\n var d = new Date();\n blocks.mouseDownTime = d.getTime();\n if (this.name === 'media' || this.name === 'loadFile') {\n this._doOpenMedia(thisBlock);\n } else {\n this._changeLabel();\n }\n }\n }\n }\n }\n\n if (hideDOM) {\n // Did the mouse move out off the block? If so, hide the\n // label DOM element.\n if (this.bounds != null && (event.stageX / blocks.blockScale < this.container.x || event.stageX / blocks.blockScale > this.container.x + this.bounds.width || event.stageY / blocks.blockScale < this.container.y || event.stageY / blocks.blockScale > this.container.y + this.bounds.height)) {\n this._labelChanged();\n hideDOMLabel();\n this.blocks.unhighlight(null);\n this.blocks.refreshCanvas();\n } else if (this.blocks.activeBlock !== thisBlock) {\n // Are we in a different block altogether?\n hideDOMLabel();\n this.blocks.unhighlight(null);\n this.blocks.refreshCanvas();\n } else {\n // this.blocks.unhighlight(null);\n // this.blocks.refreshCanvas();\n }\n\n this.blocks.activeBlock = null;\n }\n };\n\n this._ensureDecorationOnTop = function () {\n // Find the turtle decoration and move it to the top.\n for (var child = 0; child < this.container.getNumChildren(); child++) {\n if (this.container.children[child].name === 'decoration') {\n // Drum block in collapsed state is less wide.\n if (this.name === 'drum') {\n var bounds = this.container.getBounds();\n if (this.collapsed) {\n var dx = 25 * this.protoblock.scale / 2;\n } else {\n var dx = 0;\n }\n for (var turtle = 0; turtle < this.blocks.turtles.turtleList.length; turtle++) {\n if (this.blocks.turtles.turtleList[turtle].startBlock === this) {\n this.blocks.turtles.turtleList[turtle].decorationBitmap.x = bounds.width - dx - 50 * this.protoblock.scale / 2;\n break;\n }\n }\n }\n\n this.container.setChildIndex(this.container.children[child], this.container.getNumChildren() - 1);\n break;\n }\n }\n };\n\n this._changeLabel = function () {\n var myBlock = this;\n var blocks = this.blocks;\n var x = this.container.x;\n var y = this.container.y;\n\n var canvasLeft = blocks.canvas.offsetLeft + 28 * blocks.blockScale;\n var canvasTop = blocks.canvas.offsetTop + 6 * blocks.blockScale;\n\n var movedStage = false;\n if (!window.hasMouse && blocks.stage.y + y > 75) {\n movedStage = true;\n var fromY = blocks.stage.y;\n blocks.stage.y = -y + 75;\n }\n\n // A place in the DOM to put modifiable labels (textareas).\n var labelValue = (this.label)?this.label.value:this.value;\n var labelElem = docById('labelDiv');\n\n if (this.name === 'text') {\n var type = 'text';\n labelElem.innerHTML = '<input id=\"textLabel\" style=\"position: absolute; -webkit-user-select: text;-moz-user-select: text;-ms-user-select: text;\" class=\"text\" type=\"text\" value=\"' + labelValue + '\" />';\n labelElem.classList.add('hasKeyboard');\n this.label = docById('textLabel');\n } else if (this.name === 'solfege') {\n var type = 'solfege';\n\n var obj = splitSolfege(this.value);\n var selectednote = obj[0];\n var selectedattr = obj[1];\n\n // solfnotes_ is used in the interface for internationalization.\n //.TRANS: the note names must be separated by single spaces\n var solfnotes_ = _('ti la sol fa mi re do').split(' ');\n\n var labelHTML = '<select name=\"solfege\" id=\"solfegeLabel\" style=\"position: absolute; background-color: #88e20a; width: 100px;\">'\n for (var i = 0; i < SOLFNOTES.length; i++) {\n if (selectednote === solfnotes_[i]) {\n labelHTML += '<option value=\"' + SOLFNOTES[i] + '\" selected>' + solfnotes_[i] + '</option>';\n } else if (selectednote === SOLFNOTES[i]) {\n labelHTML += '<option value=\"' + SOLFNOTES[i] + '\" selected>' + solfnotes_[i] + '</option>';\n } else {\n labelHTML += '<option value=\"' + SOLFNOTES[i] + '\">' + solfnotes_[i] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n if (selectedattr === '') {\n selectedattr = '♮';\n }\n labelHTML += '<select name=\"noteattr\" id=\"noteattrLabel\" style=\"position: absolute; background-color: #88e20a; width: 60px;\">';\n for (var i = 0; i < SOLFATTRS.length; i++) {\n if (selectedattr === SOLFATTRS[i]) {\n labelHTML += '<option value=\"' + selectedattr + '\" selected>' + selectedattr + '</option>';\n } else {\n labelHTML += '<option value=\"' + SOLFATTRS[i] + '\">' + SOLFATTRS[i] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n labelElem.innerHTML = labelHTML;\n this.label = docById('solfegeLabel');\n this.labelattr = docById('noteattrLabel');\n } else if (this.name === 'eastindiansolfege') {\n var type = 'solfege';\n\n var obj = splitSolfege(this.value);\n var selectednote = WESTERN2EISOLFEGENAMES[obj[0]];\n var selectedattr = obj[1];\n\n var eisolfnotes_ = ['ni', 'dha', 'pa', 'ma', 'ga', 're', 'sa'];\n\n var labelHTML = '<select name=\"solfege\" id=\"solfegeLabel\" style=\"position: absolute; background-color: #88e20a; width: 100px;\">'\n for (var i = 0; i < SOLFNOTES.length; i++) {\n if (selectednote === eisolfnotes_[i]) {\n labelHTML += '<option value=\"' + SOLFNOTES[i] + '\" selected>' + eisolfnotes_[i] + '</option>';\n } else if (selectednote === WESTERN2EISOLFEGENAMES[SOLFNOTES[i]]) {\n labelHTML += '<option value=\"' + SOLFNOTES[i] + '\" selected>' + eisolfnotes_[i] + '</option>';\n } else {\n labelHTML += '<option value=\"' + SOLFNOTES[i] + '\">' + eisolfnotes_[i] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n if (selectedattr === '') {\n selectedattr = '♮';\n }\n labelHTML += '<select name=\"noteattr\" id=\"noteattrLabel\" style=\"position: absolute; background-color: #88e20a; width: 60px;\">';\n for (var i = 0; i < SOLFATTRS.length; i++) {\n if (selectedattr === SOLFATTRS[i]) {\n labelHTML += '<option value=\"' + selectedattr + '\" selected>' + selectedattr + '</option>';\n } else {\n labelHTML += '<option value=\"' + SOLFATTRS[i] + '\">' + SOLFATTRS[i] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n labelElem.innerHTML = labelHTML;\n this.label = docById('solfegeLabel');\n this.labelattr = docById('noteattrLabel');\n } else if (this.name === 'notename') {\n var type = 'notename';\n const NOTENOTES = ['B', 'A', 'G', 'F', 'E', 'D', 'C'];\n const NOTEATTRS = ['♯♯', '♯', '♮', '♭', '♭♭'];\n if (this.value != null) {\n var selectednote = this.value[0];\n if (this.value.length === 1) {\n var selectedattr = '♮';\n } else if (this.value.length === 2) {\n var selectedattr = this.value[1];\n } else {\n var selectedattr = this.value[1] + this.value[1];\n }\n } else {\n var selectednote = 'G';\n var selectedattr = '♮'\n }\n\n var labelHTML = '<select name=\"notename\" id=\"notenameLabel\" style=\"position: absolute; background-color: #88e20a; width: 60px;\">'\n for (var i = 0; i < NOTENOTES.length; i++) {\n if (selectednote === NOTENOTES[i]) {\n labelHTML += '<option value=\"' + selectednote + '\" selected>' + selectednote + '</option>';\n } else {\n labelHTML += '<option value=\"' + NOTENOTES[i] + '\">' + NOTENOTES[i] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n if (selectedattr === '') {\n selectedattr = '♮';\n }\n labelHTML += '<select name=\"noteattr\" id=\"noteattrLabel\" style=\"position: absolute; background-color: #88e20a; width: 60px;\">';\n\n for (var i = 0; i < NOTEATTRS.length; i++) {\n if (selectedattr === NOTEATTRS[i]) {\n labelHTML += '<option value=\"' + selectedattr + '\" selected>' + selectedattr + '</option>';\n } else {\n labelHTML += '<option value=\"' + NOTEATTRS[i] + '\">' + NOTEATTRS[i] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n labelElem.innerHTML = labelHTML;\n this.label = docById('notenameLabel');\n this.labelattr = docById('noteattrLabel');\n } else if (this.name === 'modename') {\n var type = 'modename';\n if (this.value != null) {\n var selectedmode = this.value[0];\n } else {\n var selectedmode = getModeName(DEFAULTMODE);\n }\n\n var labelHTML = '<select name=\"modename\" id=\"modenameLabel\" style=\"position: absolute; background-color: #88e20a; width: 60px;\">'\n for (var i = 0; i < MODENAMES.length; i++) {\n if (MODENAMES[i][0].length === 0) {\n // work around some weird i18n bug\n labelHTML += '<option value=\"' + MODENAMES[i][1] + '\">' + MODENAMES[i][1] + '</option>';\n } else if (selectednote === MODENAMES[i][0]) {\n labelHTML += '<option value=\"' + selectedmode + '\" selected>' + selectedmode + '</option>';\n } else if (selectednote === MODENAMES[i][1]) {\n labelHTML += '<option value=\"' + selectedmode + '\" selected>' + selectedmode + '</option>';\n } else {\n labelHTML += '<option value=\"' + MODENAMES[i][0] + '\">' + MODENAMES[i][0] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n labelElem.innerHTML = labelHTML;\n this.label = docById('modenameLabel');\n } else if (this.name === 'drumname') {\n var type = 'drumname';\n if (this.value != null) {\n var selecteddrum = getDrumName(this.value);\n } else {\n var selecteddrum = getDrumName(DEFAULTDRUM);\n }\n\n var labelHTML = '<select name=\"drumname\" id=\"drumnameLabel\" style=\"position: absolute; background-color: #00b0a4; width: 60px;\">'\n for (var i = 0; i < DRUMNAMES.length; i++) {\n if (DRUMNAMES[i][0].length === 0) {\n // work around some weird i18n bug\n labelHTML += '<option value=\"' + DRUMNAMES[i][1] + '\">' + DRUMNAMES[i][1] + '</option>';\n } else if (selecteddrum === DRUMNAMES[i][0]) {\n labelHTML += '<option value=\"' + selecteddrum + '\" selected>' + selecteddrum + '</option>';\n } else if (selecteddrum === DRUMNAMES[i][1]) {\n labelHTML += '<option value=\"' + selecteddrum + '\" selected>' + selecteddrum + '</option>';\n } else {\n labelHTML += '<option value=\"' + DRUMNAMES[i][0] + '\">' + DRUMNAMES[i][0] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n labelElem.innerHTML = labelHTML;\n this.label = docById('drumnameLabel');\n } else if (this.name === 'voicename') {\n var type = 'voicename';\n if (this.value != null) {\n var selectedvoice = getVoiceName(this.value);\n } else {\n var selectedvoice = getVoiceName(DEFAULTVOICE);\n }\n\n var labelHTML = '<select name=\"voicename\" id=\"voicenameLabel\" style=\"position: absolute; background-color: #00b0a4; width: 60px;\">'\n for (var i = 0; i < VOICENAMES.length; i++) {\n if (VOICENAMES[i][0].length === 0) {\n // work around some weird i18n bug\n labelHTML += '<option value=\"' + VOICENAMES[i][1] + '\">' + VOICENAMES[i][1] + '</option>';\n } else if (selectedvoice === VOICENAMES[i][0]) {\n labelHTML += '<option value=\"' + selectedvoice + '\" selected>' + selectedvoice + '</option>';\n } else if (selectedvoice === VOICENAMES[i][1]) {\n labelHTML += '<option value=\"' + selectedvoice + '\" selected>' + selectedvoice + '</option>';\n } else {\n labelHTML += '<option value=\"' + VOICENAMES[i][0] + '\">' + VOICENAMES[i][0] + '</option>';\n }\n }\n\n labelHTML += '</select>';\n labelElem.innerHTML = labelHTML;\n this.label = docById('voicenameLabel');\n } else {\n var type = 'number';\n labelElem.innerHTML = '<input id=\"numberLabel\" style=\"position: absolute; -webkit-user-select: text;-moz-user-select: text;-ms-user-select: text;\" class=\"number\" type=\"number\" value=\"' + labelValue + '\" />';\n labelElem.classList.add('hasKeyboard');\n this.label = docById('numberLabel');\n }\n\n var focused = false;\n\n var __blur = function (event) {\n // Not sure why the change in the input is not available\n // immediately in FireFox. We need a workaround if hardware\n // acceleration is enabled.\n\n if (!focused) {\n return;\n }\n\n myBlock._labelChanged();\n\n event.preventDefault();\n\n labelElem.classList.remove('hasKeyboard');\n\n window.scroll(0, 0);\n myBlock.label.removeEventListener('keypress', __keypress);\n\n if (movedStage) {\n blocks.stage.y = fromY;\n blocks.updateStage();\n }\n };\n\n if (this.name === 'text' || this.name === 'number') {\n this.label.addEventListener('blur', __blur);\n }\n\n var __keypress = function (event) {\n if ([13, 10, 9].indexOf(event.keyCode) !== -1) {\n __blur(event);\n }\n };\n\n this.label.addEventListener('keypress', __keypress);\n\n this.label.addEventListener('change', function () {\n myBlock._labelChanged();\n });\n\n if (this.labelattr != null) {\n this.labelattr.addEventListener('change', function () {\n myBlock._labelChanged();\n });\n }\n\n this.label.style.left = Math.round((x + blocks.stage.x) * blocks.blockScale + canvasLeft) + 'px';\n this.label.style.top = Math.round((y + blocks.stage.y) * blocks.blockScale + canvasTop) + 'px';\n\n // There may be a second select used for # and b.\n if (this.labelattr != null) {\n this.label.style.width = Math.round(60 * blocks.blockScale) * this.protoblock.scale / 2 + 'px';\n this.labelattr.style.left = Math.round((x + blocks.stage.x + 60) * blocks.blockScale + canvasLeft) + 'px';\n this.labelattr.style.top = Math.round((y + blocks.stage.y) * blocks.blockScale + canvasTop) + 'px';\n this.labelattr.style.width = Math.round(60 * blocks.blockScale) * this.protoblock.scale / 2 + 'px';\n this.labelattr.style.fontSize = Math.round(20 * blocks.blockScale * this.protoblock.scale / 2) + 'px';\n } else {\n this.label.style.width = Math.round(100 * blocks.blockScale) * this.protoblock.scale / 2 + 'px';\n }\n\n this.label.style.fontSize = Math.round(20 * blocks.blockScale * this.protoblock.scale / 2) + 'px';\n this.label.style.display = '';\n this.label.focus();\n\n // Firefox fix\n setTimeout(function () {\n myBlock.label.style.display = '';\n myBlock.label.focus();\n focused = true;\n }, 100);\n };\n\n this._labelChanged = function () {\n // Update the block values as they change in the DOM label.\n if (this == null || this.label == null) {\n // console.log('cannot find block associated with label change');\n this._label_lock = false;\n return;\n }\n\n this._label_lock = true;\n\n this.label.style.display = 'none';\n if (this.labelattr != null) {\n this.labelattr.style.display = 'none';\n }\n\n var oldValue = this.value;\n\n if (this.label.value === '') {\n this.label.value = '_';\n }\n var newValue = this.label.value;\n\n if (this.labelattr != null) {\n var attrValue = this.labelattr.value;\n switch (attrValue) {\n case '♯♯':\n case '♯':\n case '♭♭':\n case '♭':\n newValue = newValue + attrValue;\n break;\n default:\n break;\n }\n }\n\n if (oldValue === newValue) {\n // Nothing to do in this case.\n this._label_lock = false;\n return;\n }\n\n var c = this.connections[0];\n if (this.name === 'text' && c != null) {\n var cblock = this.blocks.blockList[c];\n switch (cblock.name) {\n case 'action':\n var that = this;\n\n setTimeout(function () {\n that.blocks.palettes.removeActionPrototype(oldValue);\n }, 1000);\n\n // Ensure new name is unique.\n var uniqueValue = this.blocks.findUniqueActionName(newValue);\n if (uniqueValue !== newValue) {\n newValue = uniqueValue;\n this.value = newValue;\n var label = this.value.toString();\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n this.text.text = label;\n this.label.value = newValue;\n this.updateCache();\n }\n break;\n default:\n break;\n }\n }\n\n // Update the block value and block text.\n if (this.name === 'number') {\n this.value = Number(newValue);\n if (isNaN(this.value)) {\n var thisBlock = this.blocks.blockList.indexOf(this);\n this.blocks.errorMsg(newValue + ': Not a number', thisBlock);\n this.blocks.refreshCanvas();\n this.value = oldValue;\n }\n } else {\n this.value = newValue;\n }\n\n if (this.name === 'solfege') {\n var obj = splitSolfege(this.value);\n var label = i18nSolfege(obj[0]);\n var attr = obj[1];\n\n if (attr !== '♮') {\n label += attr;\n }\n } else if (this.name === 'eastindiansolfege') {\n var obj = splitSolfege(this.value);\n var label = WESTERN2EISOLFEGENAMES[obj[0]];\n var attr = obj[1];\n\n if (attr !== '♮') {\n label += attr;\n }\n } else {\n var label = this.value.toString();\n }\n\n if (label.length > 8) {\n label = label.substr(0, 7) + '...';\n }\n\n this.text.text = label;\n\n // and hide the DOM textview...\n this.label.style.display = 'none';\n\n // Make sure text is on top.\n var z = this.container.getNumChildren() - 1;\n this.container.setChildIndex(this.text, z);\n this.updateCache();\n\n var c = this.connections[0];\n if (this.name === 'text' && c != null) {\n var cblock = this.blocks.blockList[c];\n switch (cblock.name) {\n case 'action':\n // If the label was the name of an action, update the\n // associated run this.blocks and the palette buttons\n // Rename both do <- name and nameddo blocks.\n this.blocks.renameDos(oldValue, newValue);\n\n if (oldValue === _('action')) {\n this.blocks.newNameddoBlock(newValue, this.blocks.actionHasReturn(c), this.blocks.actionHasArgs(c));\n this.blocks.setActionProtoVisiblity(false);\n }\n\n this.blocks.newNameddoBlock(newValue, this.blocks.actionHasReturn(c), this.blocks.actionHasArgs(c));\n var blockPalette = blocks.palettes.dict['action'];\n for (var blk = 0; blk < blockPalette.protoList.length; blk++) {\n var block = blockPalette.protoList[blk];\n if (oldValue === _('action')) {\n if (block.name === 'nameddo' && block.defaults.length === 0) {\n block.hidden = true;\n }\n }\n else {\n if (block.name === 'nameddo' && block.defaults[0] === oldValue) {\n blockPalette.remove(block,oldValue);\n }\n }\n }\n\n if (oldValue === _('action')) {\n this.blocks.newNameddoBlock(newValue, this.blocks.actionHasReturn(c), this.blocks.actionHasArgs(c));\n this.blocks.setActionProtoVisiblity(false);\n }\n this.blocks.renameNameddos(oldValue, newValue);\n this.blocks.palettes.hide();\n this.blocks.palettes.updatePalettes('action');\n this.blocks.palettes.show();\n break;\n case 'storein':\n // If the label was the name of a storein, update the\n // associated box this.blocks and the palette buttons.\n if (this.value !== 'box') {\n this.blocks.newStoreinBlock(this.value);\n this.blocks.newNamedboxBlock(this.value);\n }\n // Rename both box <- name and namedbox blocks.\n this.blocks.renameBoxes(oldValue, newValue);\n this.blocks.renameNamedboxes(oldValue, newValue);\n this.blocks.palettes.hide();\n this.blocks.palettes.updatePalettes('boxes');\n this.blocks.palettes.show();\n break;\n case 'setdrum':\n case 'playdrum':\n if (_THIS_IS_MUSIC_BLOCKS_) {\n if (newValue.slice(0, 4) === 'http') {\n this.blocks.logo.synth.loadSynth(newValue);\n }\n }\n break;\n default:\n break;\n }\n }\n\n // We are done changing the label, so unlock.\n this._label_lock = false;\n\n if (_THIS_IS_MUSIC_BLOCKS_) {\n // Load the synth for the selected drum.\n if (this.name === 'drumname') {\n this.blocks.logo.synth.loadSynth(getDrumSynthName(this.value));\n } else if (this.name === 'voicename') {\n this.blocks.logo.synth.loadSynth(getVoiceSynthName(this.value));\n }\n }\n };\n\n}", "title": "" }, { "docid": "bd60a27b7fe74e9c1c671359911cb16d", "score": "0.5340258", "text": "function initBlock() {\n // TODO: add code here\n return true;\n}", "title": "" }, { "docid": "e57746bcd281e37e309aecae0245ad48", "score": "0.5336974", "text": "constructor() {\n\n var self = this;\n this.getBlockHeight()\n .then(function(data) {\n if(data == 0) { \n self.addBlock(new Block(\"First block in the chain - Genesis block\"))\n .then(function() {\n\n })\n .catch(function(err) {\n console.log(err);\n })\n }\n })\n }", "title": "" }, { "docid": "b92d6b30376e45d9f83482a24c8ec480", "score": "0.53199434", "text": "function runBlock(cb) {\n self.runBlock({\n block: block,\n root: parentState\n }, function (err, results) {\n if (err) {\n // remove invalid block\n console.log('Invalid block error:', err);\n self.blockchain.delBlock(block.header.hash(), cb);\n } else {\n // set as new head block\n headBlock = block;\n cb();\n }\n });\n }", "title": "" }, { "docid": "b92d6b30376e45d9f83482a24c8ec480", "score": "0.53199434", "text": "function runBlock(cb) {\n self.runBlock({\n block: block,\n root: parentState\n }, function (err, results) {\n if (err) {\n // remove invalid block\n console.log('Invalid block error:', err);\n self.blockchain.delBlock(block.header.hash(), cb);\n } else {\n // set as new head block\n headBlock = block;\n cb();\n }\n });\n }", "title": "" }, { "docid": "b9b78aa2a6feefe5c42e274c79789f9c", "score": "0.5306368", "text": "emptyStage() {\n // iterate in reverse order\n for (let i=this.rootBlocks.length-1; i>=0;i--) {\n this.removeBlock(this.rootBlocks[i]);\n }\n }", "title": "" }, { "docid": "daaae9effa028c7c66e061b055bfddf0", "score": "0.53038853", "text": "teardown(){\n\t\t\t\t\t\tdelete box.setWidth;\n\t\t\t\t\t\tdelete box.setHeight;\n\t\t\t\t\t}", "title": "" }, { "docid": "400d266165f7c45a9b6478b4cfe1bc1b", "score": "0.530386", "text": "generateGenesisBlock(){\n // Add your code here\n let self= this;\n self.getBlockHeight().then((height)=>{\n if(height=== -1){\n let body = {\n address: \"\",\n star: {\n ra: \"\",\n dec: \"\",\n mag: \"\",\n cen: \"\",\n story: \"Genesis Block\"\n }\n };\n let genesisBlock= new Block.Block(body);\n self.addBlock(genesisBlock).then((block)=>{\n //console.log(block);\n });\n }\n }).catch((err)=>{console.log(err)});\n }", "title": "" }, { "docid": "778e4e24d4a566b5ee6e48c5019b0c2b", "score": "0.5285359", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "778e4e24d4a566b5ee6e48c5019b0c2b", "score": "0.5285359", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "778e4e24d4a566b5ee6e48c5019b0c2b", "score": "0.5285359", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "778e4e24d4a566b5ee6e48c5019b0c2b", "score": "0.5285359", "text": "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "title": "" }, { "docid": "77b971f8386344614dcdecfd23f469f1", "score": "0.52748597", "text": "async _destroy () {}", "title": "" }, { "docid": "ab17a18332f32b8f7bbc0e25526f2c54", "score": "0.5273724", "text": "async removeBlock(block) {\n const hash = block.hash;\n\n // Recover last tx symbol, that was used before the block appeared.\n let minTxSymbol = Number.MAX_VALUE;\n\n // Loop through all transactions and remove the data\n const transactions = block.tx;\n for (const tx of transactions) {\n /**\n * In the following, we assume that all the database\n * entities exist.\n */ \n\n // 1) Get the symbol\n const txSym = await this.getTxSymbol(tx.txid);\n if (txSym == null) {\n console.log(`Tx Symbol ${txSym} did not exist. Skipping removal.`);\n continue;\n }\n\n minTxSymbol = Math.min(minTxSymbol, txSym);\n\n // 2) Loop through inputs and re-validate the utxos\n if (tx.vin) {\n for (let input of tx.vin) {\n const { txid, vout, coinbase } = input;\n\n if (!txid || vout == null) {\n if (!coinbase) throw new Error(`Invalid input @ blockSymbol = ${block.height}`);\n continue;\n }\n\n console.log(` Revalidating ${txid}:${vout}`);\n\n const pair = await this.utxoExists(txid, vout);\n if (pair == null) {\n throw new Error(`Blockchain error. Utxo ${txid}:${vout} does not exist.`);\n }\n\n // 2.1) Re-validate utxo.\n // Spent utxos must be set to unspent.\n // This will set the keys `spentOnBlock`, `spentInTx` symbols to null.\n try {\n const decoded = UtxoValueSchema.decode(pair.value);\n decoded.spentOnBlock = null;\n decoded.spentInTx = null;\n\n const value = UtxoValueSchema.encode(decoded);\n\n this.dbBatches.utxo.push({\n type: 'put',\n key: pair.key,\n value: value,\n });\n\n } catch (e) {\n console.error(pair)\n console.error(pair.value)\n console.error(e);\n }\n }\n }\n\n // 3) Remove newly created outputs\n if (tx.vout) {\n for (const output of tx.vout) {\n try {\n /**\n * 3.1) Remove the utxo\n */\n\n // Get the address of the output\n const address = await this.getAddressSymbol(output);\n const addressSymbol = address.value;\n\n // Delete the utxo\n //console.log(` Deleting ${tx.txid}:${output.n}`);\n const key = this.serializeUtxoKey(txSym, output.n);\n\n this.dbBatches.utxo.push({\n type: 'del',\n key: key,\n });\n\n if (!address || !address.key) {\n continue;\n }\n\n /**\n * 3.2) Delete the utxo from the address utxo list\n */\n\n // Get the utxo list\n //console.log(` Deleting ${tx.txid}:${output.n} from ${address.key}`);\n const serializedUtxoList = await this.db['address-utxos'].get(encodeSymbol(addressSymbol))\n .catch(() => EMPTY_UTXO_LIST);\n \n // Decode the existing structure\n const deserializedUtxoList = AddressValueSchema.decode(serializedUtxoList); \n \n // Remove the affected utxo\n for (let i = deserializedUtxoList.txSymbol.length; i >= 0; --i) {\n if (deserializedUtxoList.txSymbol[i] == txSym &&\n deserializedUtxoList.vout[i] == output.n) {\n // console.log('REMOVING UTXO', i, `(${output.n} | ${txSym})`)\n deserializedUtxoList.txSymbol.splice(i, 1);\n deserializedUtxoList.vout.splice(i, 1);\n break;\n }\n }\n\n // Save the list again\n this.dbBatches['address-utxos'].push({\n type: 'put',\n key: encodeSymbol(addressSymbol),\n value: AddressValueSchema.encode(deserializedUtxoList),\n });\n\n /**\n * 3.3) We do not remove the address symbol\n * because it will most likely appear in future.\n */\n\n } catch (e) {\n console.error('ERROR', tx.txid, `output-${output.n}`, e);\n }\n } \n }\n\n // Delete tx symbol\n this.dbBatches['tx-sym'].push({\n type: 'del',\n key: hexToBin(tx.txid),\n });\n }\n\n // Remove the block symbol\n this.dbBatches['block-sym'].push({\n type: 'del',\n key: hexToBin(hash),\n });\n\n // Recover last tx symbol\n if (minTxSymbol != Number.MAX_VALUE) {\n this.lastTxSymbol = minTxSymbol - 1;\n }\n }", "title": "" }, { "docid": "cd0aaf9cba66a7c70dd6a04c3d270045", "score": "0.5265721", "text": "function clearBlockInUsed()\n{\n\tfor(var g = 0; g < gBlockGroup.length; g++) {\n\t\tgBlockGroup[g].blockUsed = 0;\n\t}\t\n}", "title": "" }, { "docid": "2992c9f3798f13ac252f2524a4105009", "score": "0.526235", "text": "exitBlockStatements(ctx) {\n\t}", "title": "" }, { "docid": "d59b04ab7b0fb7cbc0a7c6217ae633d8", "score": "0.5245818", "text": "disposeInternal() {\n this.features_ = null;\n this.regions_ = null;\n }", "title": "" }, { "docid": "cf46ca64665ab6181aebaf992017b391", "score": "0.52454025", "text": "function fin(o) {\n // because order of finalization is not guaranteed, don't print\n // object name\n print('finalizing');\n}", "title": "" }, { "docid": "38dedd4832105e9a4a6c22b8adcb280e", "score": "0.52450424", "text": "_cleanup() {\n this._remainder = null;\n this._head = null;\n this._bitstream = null;\n }", "title": "" }, { "docid": "ba3be8f8376d297a1576a430dff8d25c", "score": "0.5242816", "text": "function awaitNewBlock() {\n return new Promise(function(resolve, reject) {\n let onHeader = function(header) {\n resolve(header);\n daemon.removeBlockListener(onHeader);\n }\n daemon.addBlockListener(onHeader);\n });\n }", "title": "" }, { "docid": "b00fcdd2209789a8d194088e4d441170", "score": "0.52409875", "text": "generateGenesisBlock(){\n // Add your code here\n let self= this;\n self.getBlockHeight().then((height)=>{\n if(height=== -1){\n let genesisBlock= new Block.Block(\"Genesis block\");\n self.addBlock(genesisBlock).then((block)=>{\n //console.log(block);\n });\n }\n }).catch((err)=>{console.log(err)});\n }", "title": "" }, { "docid": "51246cc480863d860dfa42cd83f87bd0", "score": "0.52371866", "text": "async _createBlockNew(height, blockValidation, minerAddress, transactions, args){\n\n //validate miner Address\n\n args.unshift( this.blockchain, minerAddress, transactions, undefined, undefined );\n let data = new this.blockDataClass(...args);\n\n return new this.blockClass( this.blockchain, blockValidation, 1, undefined, await blockValidation.getHashCallback(height-1), await blockValidation.getDifficultyCallback(height-1), await blockValidation.getChainHashCallback(height-1), undefined, 0, data, height, this.db);\n\n }", "title": "" }, { "docid": "51246cc480863d860dfa42cd83f87bd0", "score": "0.52371866", "text": "async _createBlockNew(height, blockValidation, minerAddress, transactions, args){\n\n //validate miner Address\n\n args.unshift( this.blockchain, minerAddress, transactions, undefined, undefined );\n let data = new this.blockDataClass(...args);\n\n return new this.blockClass( this.blockchain, blockValidation, 1, undefined, await blockValidation.getHashCallback(height-1), await blockValidation.getDifficultyCallback(height-1), await blockValidation.getChainHashCallback(height-1), undefined, 0, data, height, this.db);\n\n }", "title": "" }, { "docid": "da6ad60a47b1c290f748e478dc9e76ec", "score": "0.5230534", "text": "constructor(\n ctor /* { blockDef, codeGen, debGen =codeGen } */,\n name,\n parent =null\n ) {\n super(ctor, name, parent);\n\n // blockly blocks added map with references in missions and wsps\n this._blocklyElems = {};\n }", "title": "" }, { "docid": "31c4c51c6c85d599a84f45e19e055de8", "score": "0.5227558", "text": "async complete_object_upload_finally(buffer_pool_cleanup, read_file, write_file, fs_context) {\n try {\n // release buffer back to pool if needed\n if (buffer_pool_cleanup) buffer_pool_cleanup();\n } catch (err) {\n dbg.warn('NamespaceFS: complete_object_upload buffer pool cleanup error', err);\n }\n try {\n if (read_file) await read_file.close(fs_context);\n } catch (err) {\n dbg.warn('NamespaceFS: complete_object_upload read file close error', err);\n }\n try {\n if (write_file) await write_file.close(fs_context);\n } catch (err) {\n dbg.warn('NamespaceFS: complete_object_upload write file close error', err);\n }\n }", "title": "" }, { "docid": "854b1ae489ed2f5f7322dcb041203064", "score": "0.5225877", "text": "postNewBlock() {\n this.app.post('/block', async (req, res) => {\n const { address, star } = req.body;\n // check to see if request data is good\n if (!checkAddress(address)) {\n return res.json(INVALID_ADDRESS);\n }\n if (!checkStar(star)) {\n return res.json(INVALID_STORY);\n }\n // check to see if validation is good\n const mempool = await this.mempool.getFormattedData();\n if (checkRegistration(mempool, address)) {\n // remove message from mempool by its address\n const message = mempool.reduce(getMessageInRequestsFromAddress(address), '');\n await this.mempool.filterOut(message);\n // create new block\n const block = await this.createBlock({ address, star });\n // add block to the chain\n await this.addBlock(block);\n // send back new block to requester\n return res.json({ ...block });\n }\n return res.json(INVALID_NEW_BLOCK_REQUEST);\n });\n }", "title": "" }, { "docid": "f6088c4c96d5407682eae824af41b18a", "score": "0.5222878", "text": "static finalize() {\n super.finalize();\n\n const template = this.prototype._template;\n if (!template || hasThemes(this.is)) {\n return;\n }\n\n addStylesToTemplate(this.getStylesForThis(), template);\n }", "title": "" }, { "docid": "f6088c4c96d5407682eae824af41b18a", "score": "0.5222878", "text": "static finalize() {\n super.finalize();\n\n const template = this.prototype._template;\n if (!template || hasThemes(this.is)) {\n return;\n }\n\n addStylesToTemplate(this.getStylesForThis(), template);\n }", "title": "" }, { "docid": "9e4df0fde6f351cce52dcd2dbccec58a", "score": "0.52213866", "text": "async addBlock(newBlock) {\n // Previous block height\n const previousBlockHeight = parseInt(await this.getBlockHeight());\n // Block height\n newBlock.height = previousBlockHeight + 1;\n // UTC timestamp\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n // previous block hash\n if (newBlock.height > 0) {\n const previousBlock = await this.getBlock(previousBlockHeight);\n newBlock.previousBlockHash = previousBlock.hash;\n }\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n // Adding block object to chain\n await this.addDataToLevelDB(newBlock.height, JSON.stringify(newBlock));\n }", "title": "" }, { "docid": "8c959477eb97614f331ad7f0b99fbc89", "score": "0.52098536", "text": "function newBlock(blockhash) {\n // blockhash is hash string\n audio.beep()\n console.log('new block', blockhash)\n blocks.insert(blockhash)\n ore.previousblockhash = blockhash\n restartMempool()\n restartProspector()\n}", "title": "" }, { "docid": "90cc9e48f38c8c843910c5b55ce19357", "score": "0.5205949", "text": "function _destroy(ev) {\n removeDropArea();\n\n if (selected == null) return;\n var topEl = selected.getClosestBlock();\n if (topEl !== null) {\n var kids = selected.children.slice().reverse();\n for(let child of kids) {\n child.removeFromParent();\n child.setPosition(0,0)\n if(topEl.type == BLOCK_TYPES.cblockStart) {\n topEl.parent.insertChild(child, 1); // 0 is the null BlockWrapper\n } else if(topEl.type == BLOCK_TYPES.stack\n || topEl.type == BLOCK_TYPES.cblock\n || topEl.type == BLOCK_TYPES.CSSStart) {\n topEl.parent.insertChild(child, topEl.getIndex() + 1);\n }\n }\n\n } else {\n let newX = selected.x,\n newY = selected.y;\n if (selected.left() - getOffset(SCRIPTING_AREA).left < 0) {\n newX = 0;\n }\n if (selected.top() - getOffset(SCRIPTING_AREA).top < 0) {\n newY = 0;\n }\n selected.setPosition(newX, newY);\n }\n selected = null;\n}", "title": "" }, { "docid": "107c5ba663cd7597161ac3fc7a7231c0", "score": "0.52055985", "text": "function endExceptionBlock() {\n ts.Debug.assert(peekBlockKind() === 0 /* Exception */);\n var exception = endBlock();\n var state = exception.state;\n if (state < 2 /* Finally */) {\n emitBreak(exception.endLabel);\n }\n else {\n emitEndfinally();\n }\n markLabel(exception.endLabel);\n emitNop();\n exception.state = 3 /* Done */;\n }", "title": "" }, { "docid": "97b80f52239ef41c1adc559092e47fdc", "score": "0.5204841", "text": "async postNewBlock() { \n\n this.app.post(\"/block\", async (req, res) => {\n \n let blockchain = new Blockchain();\n console.log(\" --- Adding new Block From API\");\n \n if(req.body.constructor === Object && Object.keys(req.body).length === 0) {\n \n console.log('Block missing');\n res.send({\"Error\": \"Empty Block cannot be saved\"});\n }\n else {\n\n let myBlockBody = req.body.body;\n if(myBlockBody != null & myBlockBody != \"\") {\n \n //adding validation request for star registration\n let validity = this.reqHelper.isAddressValidated(myBlockBody.address);\n\n if(validity) {\n\n //delete the validation request from Array \n this.reqHelper.removeAddressValidationRequest(myBlockBody.address);\n\n let newBlock = new BlockClass.Block(myBlockBody);\n console.log(\"New Block is --- :::: \", newBlock)\n await blockchain.addBlock(newBlock); \n let myBlockHeight = await blockchain.getBlockHeightAsync();\n myBlockHeight = myBlockHeight + 1;\n \n console.log(\"New Block Height is ---\", myBlockHeight)\n \n let thisBlock = await blockchain.getBlockAsync(myBlockHeight);\n console.log(\"New saved Block is --- :::: \", thisBlock)\n res.send(thisBlock);\n }\n else {\n res.send({\"Error\": \"Please make a new validation request with this wallet address for star registration\"}); \n }\n \n }\n else {\n res.send({\"Error\": \"Empty Block cannot be saved\"});\n }\n }\n\n });\n }", "title": "" }, { "docid": "f28dc433a21e93d39802e8366ecb6402", "score": "0.5198248", "text": "createGenesBlock() {\n return new Block(0, \"04/01/2018\", \"genesis block\", \"0\");\n }", "title": "" }, { "docid": "c40c22552fde73380a41a11ec6847402", "score": "0.51948464", "text": "createGenesisBlock(){\r\n //call the class Block. properties can be anything as its the first block\r\n return new Block(0, \"07/07/2019\", \"Genesis Block\", \"0\");\r\n }", "title": "" } ]
a89d63d75d7f78182c0228cbeeaa9fee
date from string and format string
[ { "docid": "a05cb5e6d77665f7d9c2db9e18662715", "score": "0.0", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" } ]
[ { "docid": "caccc85603abff625e5dd89e8d90c441", "score": "0.7544057", "text": "function makeDateFromStringAndFormat(string, format) {\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n string = string.replace(getParseRegexForToken(tokens[i]), '');\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // handle timezone\n datePartArray[3] += config.tzh;\n datePartArray[4] += config.tzm;\n // return\n return config.isUTC ? new Date(Date.UTC.apply({}, datePartArray)) : dateFromArray(datePartArray);\n }", "title": "" }, { "docid": "84d70c0d6219045b4725ae208f29ce82", "score": "0.7380297", "text": "function makeDateFromStringAndFormat(string, format) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n // We store some additional data on the array for validation\n // datePartArray[7] is true if the Date was created with `Date.UTC` and false if created with `new Date`\n // datePartArray[8] is false if the Date is invalid, and undefined if the validity is unknown.\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // return\n return dateFromArray(datePartArray, config.isUTC, config.tzh, config.tzm);\n }", "title": "" }, { "docid": "84d70c0d6219045b4725ae208f29ce82", "score": "0.7380297", "text": "function makeDateFromStringAndFormat(string, format) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n // We store some additional data on the array for validation\n // datePartArray[7] is true if the Date was created with `Date.UTC` and false if created with `new Date`\n // datePartArray[8] is false if the Date is invalid, and undefined if the validity is unknown.\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // return\n return dateFromArray(datePartArray, config.isUTC, config.tzh, config.tzm);\n }", "title": "" }, { "docid": "84d70c0d6219045b4725ae208f29ce82", "score": "0.7380297", "text": "function makeDateFromStringAndFormat(string, format) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n // We store some additional data on the array for validation\n // datePartArray[7] is true if the Date was created with `Date.UTC` and false if created with `new Date`\n // datePartArray[8] is false if the Date is invalid, and undefined if the validity is unknown.\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // return\n return dateFromArray(datePartArray, config.isUTC, config.tzh, config.tzm);\n }", "title": "" }, { "docid": "84d70c0d6219045b4725ae208f29ce82", "score": "0.7380297", "text": "function makeDateFromStringAndFormat(string, format) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n // We store some additional data on the array for validation\n // datePartArray[7] is true if the Date was created with `Date.UTC` and false if created with `new Date`\n // datePartArray[8] is false if the Date is invalid, and undefined if the validity is unknown.\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // return\n return dateFromArray(datePartArray, config.isUTC, config.tzh, config.tzm);\n }", "title": "" }, { "docid": "84d70c0d6219045b4725ae208f29ce82", "score": "0.7380297", "text": "function makeDateFromStringAndFormat(string, format) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n // We store some additional data on the array for validation\n // datePartArray[7] is true if the Date was created with `Date.UTC` and false if created with `new Date`\n // datePartArray[8] is false if the Date is invalid, and undefined if the validity is unknown.\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // return\n return dateFromArray(datePartArray, config.isUTC, config.tzh, config.tzm);\n }", "title": "" }, { "docid": "b52f0c2d2389dd93c18ae442ca7000b3", "score": "0.7239569", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "c9ff817e5402fe354992d11acc2ec4e8", "score": "0.72021407", "text": "function dateConv(str) {\n if (!config) return;\n var format = config.dates.dateFormat;\n var res = str;\n if (format === \"mm/dd/yyyy\") {\n res = res.replace(/([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})/, \"$3-$1-$2\");\n } else if (format === \"dd.mm.yyyy\") {\n res = res.replace(/([0-9]{2})\\.([0-9]{2})\\.([0-9]{4})/, \"$3-$2-$1\");\n } else {\n alert(\"unsupported date format: \" + format);\n return \"\";\n }\n if (!/[0-9]{4}-[0-9]{2}-[0-9]{2}/.test(res)) {\n return \"\";\n }\n return res;\n}", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.71777546", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.71777546", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "00bd59abc786628426259a83b49a9309", "score": "0.7171218", "text": "function makeDateFromStringAndFormat(config) {\r\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\r\n\t var tokens = config._f.match(formattingTokens),\r\n\t string = config._i,\r\n\t i, parsedInput;\r\n\r\n\t config._a = [];\r\n\r\n\t for (i = 0; i < tokens.length; i++) {\r\n\t parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\r\n\t if (parsedInput) {\r\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\r\n\t }\r\n\t // don't parse if its not a known token\r\n\t if (formatTokenFunctions[tokens[i]]) {\r\n\t addTimeToArrayFromToken(tokens[i], parsedInput, config);\r\n\t }\r\n\t }\r\n\r\n\t // add remaining unparsed input to the string\r\n\t if (string) {\r\n\t config._il = string;\r\n\t }\r\n\r\n\t // handle am pm\r\n\t if (config._isPm && config._a[3] < 12) {\r\n\t config._a[3] += 12;\r\n\t }\r\n\t // if is 12 am, change hours to 0\r\n\t if (config._isPm === false && config._a[3] === 12) {\r\n\t config._a[3] = 0;\r\n\t }\r\n\t // return\r\n\t dateFromArray(config);\r\n\t }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.7163808", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.7163808", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.7163808", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.7163808", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.7163808", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.7163808", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "caf1dd835cd23fe08d147f093264e170", "score": "0.7150607", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "9e719923867a13f268f0ad345d7a4b3a", "score": "0.71486294", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "9e719923867a13f268f0ad345d7a4b3a", "score": "0.71486294", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "9e8902a330a2a691b7f7a3ba64984280", "score": "0.71386784", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n \n config._a = [];\n \n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "15fbbeec52ed96480a21937df5c1dfb3", "score": "0.71340495", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "c98e87e50db1a33d59ba786297375048", "score": "0.70823413", "text": "function parseDate(input,format) {\n\t\t\tif ( format == \"european\" ) {\n\t\t\t\tvar parts = input.split('-');\n\t\t\t} else if ( format == \"american\" ) {\n\t\t\t\tvar parts = input.split('/');\n\t\t\t}\n\t\t\t// new Date(year, month [, day [, hours[, minutes[, seconds[, ms]]]]])\n\t\t\tif ( format == \"european\" ) {\n\t\t\t\treturn new Date(parts[2], parts[1]-1, parts[0]); // Note: months are 0-based\n\t\t\t} else if ( format == \"american\" ) {\n\t\t\t\treturn new Date(parts[2], parts[0]-1, parts[1]); // Note: months are 0-based\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "22384e88900f9f1bc760a5e9f0175f6d", "score": "0.7068959", "text": "function makeDateFromString(config) {\r\n\t var i,\r\n\t string = config._i,\r\n\t match = isoRegex.exec(string);\r\n\r\n\t if (match) {\r\n\t // match[2] should be \"T\" or undefined\r\n\t config._f = 'YYYY-MM-DD' + (match[2] || \" \");\r\n\t for (i = 0; i < 4; i++) {\r\n\t if (isoTimes[i][1].exec(string)) {\r\n\t config._f += isoTimes[i][0];\r\n\t break;\r\n\t }\r\n\t }\r\n\t if (parseTokenTimezone.exec(string)) {\r\n\t config._f += \" Z\";\r\n\t }\r\n\t makeDateFromStringAndFormat(config);\r\n\t } else {\r\n\t config._d = new Date(string);\r\n\t }\r\n\t }", "title": "" }, { "docid": "afa0ed65dee1d3dd467f9918954441d0", "score": "0.70345485", "text": "function makeDateFromStringAndFormat(string, format) {\n var inArray = [0, 0, 1, 0, 0, 0, 0],\n timezoneHours = 0,\n timezoneMinutes = 0,\n isUsingUTC = false,\n inputParts = string.match(inputCharacters),\n formatParts = format.match(tokenCharacters),\n i,\n isPm;\n\n // function to convert string input to date\n function addTime(format, input) {\n var a;\n switch (format) {\n // MONTH\n case 'M' :\n // fall through to MM\n case 'MM' :\n inArray[1] = ~~input - 1;\n break;\n case 'MMM' :\n // fall through to MMMM\n case 'MMMM' :\n for (a = 0; a < 12; a++) {\n if (moment.monthsParse[a].test(input)) {\n inArray[1] = a;\n break;\n }\n }\n break;\n // DAY OF MONTH\n case 'D' :\n // fall through to DDDD\n case 'DD' :\n // fall through to DDDD\n case 'DDD' :\n // fall through to DDDD\n case 'DDDD' :\n inArray[2] = ~~input;\n break;\n // YEAR\n case 'YY' :\n input = ~~input;\n inArray[0] = input + (input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' :\n inArray[0] = ~~Math.abs(input);\n break;\n // AM / PM\n case 'a' :\n // fall through to A\n case 'A' :\n isPm = (input.toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' :\n // fall through to hh\n case 'HH' :\n // fall through to hh\n case 'h' :\n // fall through to hh\n case 'hh' :\n inArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' :\n // fall through to mm\n case 'mm' :\n inArray[4] = ~~input;\n break;\n // SECOND\n case 's' :\n // fall through to ss\n case 'ss' :\n inArray[5] = ~~input;\n break;\n // TIMEZONE\n case 'Z' :\n // fall through to ZZ\n case 'ZZ' :\n isUsingUTC = true;\n a = (input || '').match(timezoneParseRegex);\n if (a && a[1]) {\n timezoneHours = ~~a[1];\n }\n if (a && a[2]) {\n timezoneMinutes = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n timezoneHours = -timezoneHours;\n timezoneMinutes = -timezoneMinutes;\n }\n break;\n }\n }\n for (i = 0; i < formatParts.length; i++) {\n addTime(formatParts[i], inputParts[i]);\n }\n // handle am pm\n if (isPm && inArray[3] < 12) {\n inArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (isPm === false && inArray[3] === 12) {\n inArray[3] = 0;\n }\n // handle timezone\n inArray[3] += timezoneHours;\n inArray[4] += timezoneMinutes;\n // return\n return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);\n }", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.70293576", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.70195943", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.70195943", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.70195943", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.70195943", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.70195943", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.70195943", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "d7839a8f39e7c6f1ede9046fa903ee3a", "score": "0.69931316", "text": "function makeDateFromStringAndFormat(string, format) {\n var inArray = [0, 0, 1, 0, 0, 0, 0],\n timezoneHours = 0,\n timezoneMinutes = 0,\n isUsingUTC = false,\n inputParts = string.match(inputCharacters),\n formatParts = format.match(tokenCharacters),\n len = Math.min(inputParts.length, formatParts.length),\n i,\n isPm;\n\n // function to convert string input to date\n function addTime(format, input) {\n var a;\n switch (format) {\n // MONTH\n case 'M' :\n // fall through to MM\n case 'MM' :\n inArray[1] = ~~input - 1;\n break;\n case 'MMM' :\n // fall through to MMMM\n case 'MMMM' :\n for (a = 0; a < 12; a++) {\n if (moment.monthsParse[a].test(input)) {\n inArray[1] = a;\n break;\n }\n }\n break;\n // DAY OF MONTH\n case 'D' :\n // fall through to DDDD\n case 'DD' :\n // fall through to DDDD\n case 'DDD' :\n // fall through to DDDD\n case 'DDDD' :\n inArray[2] = ~~input;\n break;\n // YEAR\n case 'YY' :\n input = ~~input;\n inArray[0] = input + (input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' :\n inArray[0] = ~~Math.abs(input);\n break;\n // AM / PM\n case 'a' :\n // fall through to A\n case 'A' :\n isPm = (input.toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' :\n // fall through to hh\n case 'HH' :\n // fall through to hh\n case 'h' :\n // fall through to hh\n case 'hh' :\n inArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' :\n // fall through to mm\n case 'mm' :\n inArray[4] = ~~input;\n break;\n // SECOND\n case 's' :\n // fall through to ss\n case 'ss' :\n inArray[5] = ~~input;\n break;\n // TIMEZONE\n case 'Z' :\n // fall through to ZZ\n case 'ZZ' :\n isUsingUTC = true;\n a = (input || '').match(timezoneParseRegex);\n if (a && a[1]) {\n timezoneHours = ~~a[1];\n }\n if (a && a[2]) {\n timezoneMinutes = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n timezoneHours = -timezoneHours;\n timezoneMinutes = -timezoneMinutes;\n }\n break;\n }\n }\n for (i = 0; i < len; i++) {\n addTime(formatParts[i], inputParts[i]);\n }\n // handle am pm\n if (isPm && inArray[3] < 12) {\n inArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (isPm === false && inArray[3] === 12) {\n inArray[3] = 0;\n }\n // handle timezone\n inArray[3] += timezoneHours;\n inArray[4] += timezoneMinutes;\n // return\n return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);\n }", "title": "" }, { "docid": "477b01d827e8092434ff5f7bea57ac4d", "score": "0.6963666", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "58c6759fc3adf8857d4e5f4f7413faf5", "score": "0.69598866", "text": "function niceDate(str) {\n let yearMonth = str.split(\"-\")\n let day = yearMonth[2].split('T')\n return `${yearMonth[0]}/${yearMonth[1]}/${day[0]}`\n }", "title": "" }, { "docid": "6a18a01c81952d5599aa70f3a4c27125", "score": "0.69594073", "text": "function makeDateFromString(config) {\n\t var i,\n\t string = config._i,\n\t match = isoRegex.exec(string);\n\t\n\t if (match) {\n\t config._pf.iso = true;\n\t for (i = 4; i > 0; i--) {\n\t if (match[i]) {\n\t // match[5] should be \"T\" or undefined\n\t config._f = isoDates[i - 1] + (match[6] || \" \");\n\t break;\n\t }\n\t }\n\t for (i = 0; i < 4; i++) {\n\t if (isoTimes[i][1].exec(string)) {\n\t config._f += isoTimes[i][0];\n\t break;\n\t }\n\t }\n\t if (string.match(parseTokenTimezone)) {\n\t config._f += \"Z\";\n\t }\n\t makeDateFromStringAndFormat(config);\n\t }\n\t else {\n\t config._d = new Date(string);\n\t }\n\t }", "title": "" }, { "docid": "2968c208fc090fc46cba796a601dff20", "score": "0.6930627", "text": "function parseDate(dateStr, format) {\n let m, d, y;\n let datePattern;\n switch (format) {\n case \"mm-dd-yyyy\":\n datePattern = /^(\\d{2})-(\\d{2})-(\\d{4})$/;\n [, m, d, y] = execForce(datePattern, dateStr);\n break;\n case \"dd-mm-yyyy\":\n datePattern = /^(\\d{2})-(\\d{2})-(\\d{4})$/;\n [, d, m, y] = execForce(datePattern, dateStr);\n break;\n case \"yyyy-mm-dd\":\n datePattern = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n [, y, m, d] = execForce(datePattern, dateStr);\n break;\n default:\n throw new Error(\"Invalid date format!\");\n }\n return new Date(Number(y), Number(m) - 1, Number(d));\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.6922508", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.6922508", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.6922508", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.6922508", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.6922508", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "112630196f91031d20d9d74daade6ff7", "score": "0.6922508", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return parseTokenTimezone.exec(string) ?\n makeDateFromStringAndFormat(string, format + ' Z') :\n makeDateFromStringAndFormat(string, format);\n }\n return new Date(string);\n }", "title": "" }, { "docid": "47e8a26d64aa9f1884ef341eb16b4eb8", "score": "0.6921658", "text": "function createDate(str, format){\n //declare constant array with all the months\n const MONTHS = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ];\n\n //declare variable to store the result (date object)\n let res;\n\n //create a new date object using string data from the date sent\n if (format === \"YYYY-MM-DD\") {\n let pieces = str.split(\"-\");\n let day = Number(pieces[2]);\n let month = Number(pieces[1]) - 1; // month numbers start at 0\n let year = Number(pieces[0]);\n res = new Date(year, month, day);\n } else if (format === \"DD-MMM-YYYY\") {\n let pieces = str.split(\"-\");\n let day = Number(pieces[0]);\n let month = MONTHS.indexOf(pieces[1]); // month numbers start at 0\n let year = Number(pieces[2]);\n res = new Date(year, month, day);\n }\n\n //return date object\n return res;\n}", "title": "" }, { "docid": "21ac2bc21f82fd9e103df1eeba007e59", "score": "0.6912672", "text": "function formatDate(date){\n\ttry{\n\t\treturn new Date(Date.parse(date.replace(/-/g, \"/\")));\n\t}catch(ex){\n\t\n\t}\n}", "title": "" }, { "docid": "6192d1de3768c8a7b5e3768b236911d6", "score": "0.6906946", "text": "function makeDateFromStringAndFormat(config) {\n\t\n\t config._a = [];\n\t config._pf.empty = true;\n\t\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var lang = getLangDefinition(config._l),\n\t string = '' + config._i,\n\t i, parsedInput, tokens, token, skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\t\n\t tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\t\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t }\n\t else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t }\n\t else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\t\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\t\n\t // handle am pm\n\t if (config._isPm && config._a[HOUR] < 12) {\n\t config._a[HOUR] += 12;\n\t }\n\t // if is 12 am, change hours to 0\n\t if (config._isPm === false && config._a[HOUR] === 12) {\n\t config._a[HOUR] = 0;\n\t }\n\t\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "title": "" }, { "docid": "237255be63e71724055c2a9551ca2beb", "score": "0.69042003", "text": "function stringToDate(_date, _format, _delimiter) {\n var formatLowerCase = _format.toLowerCase();\n var formatItems = formatLowerCase.split(_delimiter);\n var dateItems = _date.split(_delimiter);\n var monthIndex = formatItems.indexOf(\"mm\");\n var dayIndex = formatItems.indexOf(\"dd\");\n var yearIndex = formatItems.indexOf(\"yyyy\");\n var month = parseInt(dateItems[monthIndex]);\n month -= 1;\n var formatedDate = new Date(dateItems[yearIndex], month, dateItems[dayIndex]);\n return formatedDate;\n }", "title": "" }, { "docid": "c79da54e4e966e9ed4fab17a421d17c0", "score": "0.68995607", "text": "function makeDateFromString(string) {\n var format = 'YYYY-MM-DDT',\n i;\n if (isoRegex.exec(string)) {\n for (i = 0; i < 3; i++) {\n if (isoTimes[i][1].exec(string)) {\n format += isoTimes[i][0];\n break;\n }\n }\n return makeDateFromStringAndFormat(string, format + 'Z');\n }\n return new Date(string);\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.68969715", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.68969715", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.68969715", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.68969715", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "03fb976dd90ba95b938f40411ec4561b", "score": "0.68854177", "text": "function formatDate (input) {\n var trimmedString=input.substring(0,10);\n var datePart = trimmedString.split(\"-\",3),\n year = datePart[0], // get only two digits\n month = datePart[1],\n day = datePart[2];\n return day+'/'+month+'/'+year;\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.68802357", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.68802357", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.68802357", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "031b45d6f38a5ab7f95b7c03f9496390", "score": "0.68726593", "text": "function parseDate(str) {\n\t var mdy = str.split('-')\n\t return new Date(mdy[2], mdy[1]-1, mdy[0]);\n\t // default date format = y-m-d\n\t}", "title": "" }, { "docid": "7b211d858d241b862de3c43d20c6ba0e", "score": "0.6871093", "text": "static parse(input) {\n\t\tif (typeof(input) === 'number') {\n\t\t\treturn input;\n\t\t} else {\n\t\t\tinput = String(input);\n\t\t}\n\t\tlet date = null;\n\t\ttry {\n\t\t\t// try MM-DD-YYYY format\n\t\t\tlet [m,d,y] = input.match(/\\d{1,4}/g) || [];\n\t\t\t//console.log('MM-DD-YYYY:',m,d,y);\n\t\t\tif (!(m && d && y)) {\n\t\t\t\t// try Month DD, YYYY format\n\t\t\t\t[,m,d,y] = input.match(/(\\w+) (\\d+)[^\\d]+(\\d{4})/i) || [];\n\t\t\t\t//console.log('Month Day, Year:',m,d,y);\n\t\t\t\tm = ['','january','feburary','march','april','may','june','july','august','september','october','november','december'].indexOf(String(m).toLowerCase());\n\t\t\t}\n\t\t\tif (m && d && y) {\n\t\t\t\tm = parseInt(m);\n\t\t\t\td = parseInt(d);\n\t\t\t\ty = parseInt(y);\n\t\t\t\t//console.log('Parsed:',m,d,y);\n\t\t\t\tdate = new Date(y,m-1,d,0,0,0,0).getTime() / 1000;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t} finally {\n\t\t\treturn date;\n\t\t}\n }", "title": "" }, { "docid": "426cd0d855e372612be305a65c97002a", "score": "0.68626124", "text": "function strtodate(str) {\r\n\r\n var arr = str.split(\" \");\r\n var arr2 = arr[0].split(i18n.xgcalendar.dateformat.separator);\r\n var arr3 = arr[1].split(\":\");\r\n\r\n var y = arr2[i18n.xgcalendar.dateformat.year_index];\r\n var m = arr2[i18n.xgcalendar.dateformat.month_index].indexOf(\"0\") == 0 ? arr2[i18n.xgcalendar.dateformat.month_index].substr(1, 1) : arr2[i18n.xgcalendar.dateformat.month_index];\r\n var d = arr2[i18n.xgcalendar.dateformat.day_index].indexOf(\"0\") == 0 ? arr2[i18n.xgcalendar.dateformat.day_index].substr(1, 1) : arr2[i18n.xgcalendar.dateformat.day_index];\r\n var h = arr3[0].indexOf(\"0\") == 0 ? arr3[0].substr(1, 1) : arr3[0];\r\n var n = arr3[1].indexOf(\"0\") == 0 ? arr3[1].substr(1, 1) : arr3[1];\r\n return new Date(y, parseInt(m) - 1, d, h, n);\r\n}", "title": "" }, { "docid": "cdeca56d1da73793a72783a9a37e2ee2", "score": "0.68580484", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.68521965", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "af399f43cc5f9dec24265ba9221b0267", "score": "0.6841134", "text": "function formatDate(date, formatStr) {\n return formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6838409", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" }, { "docid": "05af89ae3dfca9e204b8f7523e382d42", "score": "0.6821117", "text": "function strToDate(str) {\n let [ _ , month, day, year] = \n /(\\d{1,2})-(\\d{1,2})-(\\d{4})/.exec(str);\n return new Date(year, month, day)\n}", "title": "" }, { "docid": "a9a915b7bb7b7164dea717b37fd0d441", "score": "0.6816002", "text": "function _getDate(string, inputFormat) {\n\t\tinputFormat = inputFormat || 'yyyy-mm-dd hh:ii:ss'; // default format\n\t\tvar parts = string.match(/(\\d+)/g), i = 0, fmt = {};\n\t inputFormat.replace(/(yyyy|dd|mm|hh|ii|ss)/g, function(part) { fmt[part] = i++; });\n\t return new Date(parts[fmt['yyyy']], parts[fmt['mm']]-1, parts[fmt['dd']], parts[fmt['hh']], parts[fmt['ii']], parts[fmt['ss']]);\n\t}", "title": "" }, { "docid": "150d0e0e97257470be7d351395cebfce", "score": "0.6800465", "text": "function parseDateStr(str) {\n // @TODO Timezone\n var yearStr = str.slice(0, 4);\n var moStr = str.slice(4, 6);\n var dayStr = str.slice(6, 8);\n // @TODO Validate strings\n var year = Number(yearStr);\n var mo = Number(moStr) - 1;\n var day = Number(dayStr);\n return new Date(year, mo, day);\n}", "title": "" }, { "docid": "e7855cabe33f0dc74acd134aae443942", "score": "0.6771684", "text": "function cal_parse_date (str_date) {\r\n\tvar re_date = /^(\\d+)\\/(\\d+)\\/(\\d+)$/;\r\n\tif (!re_date.exec(str_date))\r\n\t\treturn alert(\"Parsing error: unsupported date format '\" + str_date + \"'\");\r\n\treturn (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1));\r\n}", "title": "" }, { "docid": "8fd244e95d7bc7b9547c13222b768b1c", "score": "0.6765132", "text": "parse(date, format) {\n return new Date(Date.parse(date));\n }", "title": "" }, { "docid": "72eae8f883ba05e826b36d806cba745c", "score": "0.6761385", "text": "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\t\n\t config._a = [];\n\t config._pf.empty = true;\n\t\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i, parsedInput, tokens, token, skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\t\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\t\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t }\n\t else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t }\n\t else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\t\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\t\n\t // clear _12h flag if hour is <= 12\n\t if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n\t config._pf.bigHour = undefined;\n\t }\n\t // handle meridiem\n\t config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n\t config._meridiem);\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "title": "" }, { "docid": "01f6b01a09c21e0de1004c8d93323f9d", "score": "0.6752039", "text": "function makeDateFromStringAndFormat(config) {\r\n\r\n if (config._f === moment.ISO_8601) {\r\n parseISO(config);\r\n return;\r\n }\r\n\r\n config._a = [];\r\n config._pf.empty = true;\r\n\r\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\r\n var lang = getLangDefinition(config._l),\r\n string = '' + config._i,\r\n i, parsedInput, tokens, token, skipped,\r\n stringLength = string.length,\r\n totalParsedInputLength = 0;\r\n\r\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\r\n\r\n for (i = 0; i < tokens.length; i++) {\r\n token = tokens[i];\r\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\r\n if (parsedInput) {\r\n skipped = string.substr(0, string.indexOf(parsedInput));\r\n if (skipped.length > 0) {\r\n config._pf.unusedInput.push(skipped);\r\n }\r\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\r\n totalParsedInputLength += parsedInput.length;\r\n }\r\n // don't parse if it's not a known token\r\n if (formatTokenFunctions[token]) {\r\n if (parsedInput) {\r\n config._pf.empty = false;\r\n }\r\n else {\r\n config._pf.unusedTokens.push(token);\r\n }\r\n addTimeToArrayFromToken(token, parsedInput, config);\r\n }\r\n else if (config._strict && !parsedInput) {\r\n config._pf.unusedTokens.push(token);\r\n }\r\n }\r\n\r\n // add remaining unparsed input length to the string\r\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\r\n if (string.length > 0) {\r\n config._pf.unusedInput.push(string);\r\n }\r\n\r\n // handle am pm\r\n if (config._isPm && config._a[HOUR] < 12) {\r\n config._a[HOUR] += 12;\r\n }\r\n // if is 12 am, change hours to 0\r\n if (config._isPm === false && config._a[HOUR] === 12) {\r\n config._a[HOUR] = 0;\r\n }\r\n\r\n dateFromConfig(config);\r\n checkOverflow(config);\r\n }", "title": "" }, { "docid": "19eb9029b99a3759d2c5f58fc7716d17", "score": "0.6727878", "text": "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "19eb9029b99a3759d2c5f58fc7716d17", "score": "0.6727878", "text": "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "19eb9029b99a3759d2c5f58fc7716d17", "score": "0.6727878", "text": "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "19eb9029b99a3759d2c5f58fc7716d17", "score": "0.6727878", "text": "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "19eb9029b99a3759d2c5f58fc7716d17", "score": "0.6727878", "text": "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "1e1592911c628f8e9257b6ef70c97ab3", "score": "0.67222905", "text": "function stringToDate(str){\n let times = str.split(\":\");\n\n // some date values are predefined, so we can avoid\n // edge cases (like one date beeing processed 23:59h\n // and the next on the other day at 00:00h)\n return new Date(1997, 12, 3, times[0], times[1], 0, 0);\n }", "title": "" }, { "docid": "c600e0babc0fd3714dc69be371f2f76b", "score": "0.67204034", "text": "formatDate(string){\n var options = { year: 'numeric', month: 'long', day: 'numeric' };\n return new Date(string).toLocaleDateString([],options);\n }", "title": "" }, { "docid": "9e5827b70d6e5fdd1436910900614984", "score": "0.67193943", "text": "function parseDate(string) {\n var y = string.substring(0, 4);\n var m = string.substring(4, 6) - 1;\n var d = string.substring(6, 8);\n return new Date(y, m, d);\n}", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6717375", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6717375", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6717375", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6717375", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "5519abf0b7cd39160f5a851b45355a5e", "score": "0.67139703", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n } else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" } ]
372bc59b18952f374879abd573483eab
The Behaviour class is the base for the other Behaviour
[ { "docid": "a901ed3f4a50ae4121f0cc932ed8e5ee", "score": "0.64462006", "text": "function Behaviour(life, easing) {\n\t\t/**\n\t\t * The behaviour's id;\n\t\t * @property id\n\t\t * @type {String} id\n\t\t */\n\t\tthis.id = 'Behaviour_' + Behaviour.id++;\n\t\tthis.life = Proton.Util.initValue(life, Infinity);\n\t\t/**\n\t\t * The behaviour's decaying trend, for example Proton.easeOutQuart;\n\t\t * @property easing\n\t\t * @type {String}\n\t\t * @default Proton.easeLinear\n\t\t */\n\t\tthis.easing = Proton.ease.setEasingByName(easing);\n\t\tthis.age = 0;\n\t\tthis.energy = 1;\n\t\t/**\n\t\t * The behaviour is Dead;\n\t\t * @property dead\n\t\t * @type {Boolean}\n\t\t */\n\t\tthis.dead = false;\n\t\t/**\n\t\t * The behaviour's parents array;\n\t\t * @property parents\n\t\t * @type {Array}\n\t\t */\n\t\tthis.parents = [];\n\t\t/**\n\t\t * The behaviour name;\n\t\t * @property name\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = 'Behaviour';\n\t}", "title": "" } ]
[ { "docid": "23193aaafa06b5c698e36ba7f54d7a2b", "score": "0.6465405", "text": "createBehavior() {\n return undefined;\n }", "title": "" }, { "docid": "37cd6d6a308e39277847c5fad5094732", "score": "0.61646575", "text": "function FindWood() { //This would become [Look, BrainLook, MoveForward]\n Behaviour.call(this);\n}", "title": "" }, { "docid": "637d83f960e48dfd2ded2bc265f2de1c", "score": "0.6124637", "text": "createBehavior(target) {\n return new this.behavior(target, this.options);\n }", "title": "" }, { "docid": "02d49c4f70380c7c6a94d45e0008fb5d", "score": "0.61124885", "text": "function apply_behaviours() {\r\n Behaviour.list = new Array();\r\n Behaviour.register(page_rules);\r\n Behaviour.apply();\r\n }", "title": "" }, { "docid": "5a859ff7879f979b93341620befd24b8", "score": "0.61022717", "text": "function UIBehaviour$() {}", "title": "" }, { "docid": "706ddcd9a7508202da9ed48f420206c4", "score": "0.6023353", "text": "incrementBehavior() {\n this._behavior ++;\n }", "title": "" }, { "docid": "93a3cfda54fbcaea30420f0e557044cf", "score": "0.58536476", "text": "get behaviors () {\n return []\n }", "title": "" }, { "docid": "265df0af93bbe52db8339af3d42031ed", "score": "0.58259624", "text": "behave() {\n if (this.getBehavior()) {\n this.getBehavior()(this);\n }\n\n return this;\n }", "title": "" }, { "docid": "dd40627d4336e0b812c8cfce41f99629", "score": "0.56235486", "text": "createBehavior(target) {\n /* eslint-disable-next-line @typescript-eslint/no-use-before-define */\n return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName);\n }", "title": "" }, { "docid": "21a88065b4e8752604ae53fdd7507329", "score": "0.5565253", "text": "constructor(agent, locations) {\n this.name = agent.name;\n this.locations = locations;\n agent.locations = locations;\n this.startMSec = agent.arrivalTick * 25; // We simulate 25 fps\n this.arrivalLocation = agent.arrivalLocation;\n this.id = agent.id;\n\n let startLocation = locations.find(i => i.name == agent.arrivalLocation);\n if (!startLocation) console.error(\"Bad starting location \" + agent.arrivalLocation);\n\n\n this.startX = startLocation.position.x\n this.startY = startLocation.position.y;\n this.startZ = startLocation.position.z;\n\n this.destX = 0;\n this.destY = 0;\n this.destZ = 0;\n\n this.behavior = new EvacuationBehavior(this, agent.id, new Vector3(100,0, 100));\n\n\n }", "title": "" }, { "docid": "7b8343898fe8c3cc29a58677ee5f41d3", "score": "0.55495197", "text": "function addBehaviors() {}", "title": "" }, { "docid": "db59490ac6d535a00ac667976790de61", "score": "0.55456173", "text": "function ShowBehavior() {}", "title": "" }, { "docid": "19fa32e1410bb9616ce4bff706f963dd", "score": "0.55077267", "text": "constructor(agent, locations) {\n this.name = agent.name;\n this.startMSec = agent.arrivalTick * 25; // We simulate 25 fps\n this.arrivalLocation = agent.arrivalLocation;\n this.age = agent.age;\n this.severity = agent.severity;\n this.patientName = agent.patientName;\n this.gender = agent.gender;\n this.id = agent.id;\n\n let startLocation = locations.find(i=>i.name == agent.arrivalLocation);\n if(!startLocation) console.error(\"Bad starting location \" + agent.arrivalLocation);\n\n\n this.startX = startLocation.position.x \n this.startY = startLocation.position.y;\n this.startZ = startLocation.position.z;\n\n this.destX = 0;\n this.destY = 0;\n this.destZ = 0;\n\n //this.startMSec = Math.floor(parseFloat(splits[1]));\n\n ///Now check to see what behavior this agent should receive\n // if (splits.length == 8 || splits[8].trim() == \"\" || splits[8].trim().toLowerCase() == \"none\") //i.e. there is no behavior specification\n // this.behavior = new None(Agent.index++);\n // else {\n // //In this case we have to figure it out\n // //The behavior is determined by the first word after the comma. Everything else can be a argument in the constructor\n // let behave = splits[8].trim().toLowerCase();\n // if (behave == \"back\")\n // this.behavior = new BackAndForth(Agent.index++, [this.startX, this.startY, this.startZ], [this.destX, this.destY, this.destZ]);\n // }\n if(agent.name == \"patient\"){\n this.behavior = new None(Agent.index++);\n }\n else{\n //This is where we assign behaviors based on medical position type\n if(agent.type==\"Triage Nurse\"){\n //We need to convert from coordinates to locations.\n this.behavior = new BackAndForth(Agent.index++, [this.startX, this.startY, this.startZ], [this.destX, this.destY, this.destZ])\n }\n else{\n this.behavior = new BackAndForth(Agent.index++, [this.startX, this.startY, this.startZ], [this.destX, this.destY, this.destZ])\n }\n }\n }", "title": "" }, { "docid": "dbf665d32981507df17cfd2806ae1b29", "score": "0.5493924", "text": "function NgvasBaseComponent(Clazz) {\n this.Clazz = Clazz;\n this._delayedSetters = [];\n this.shapeOut = new core_1.EventEmitter();\n /////////////////////////////////////////////\n // MOUSE EVENTS\n this.clickEvent = new core_1.EventEmitter();\n this.dblclickEvent = new core_1.EventEmitter();\n this.wheelEvent = new core_1.EventEmitter();\n this.mouseenterEvent = new core_1.EventEmitter();\n this.mouseleaveEvent = new core_1.EventEmitter();\n }", "title": "" }, { "docid": "14bd2b8159d224c750b4c931b26eb494", "score": "0.5438747", "text": "function Interaction() {\r\n var _this = \r\n // Call super\r\n _super.call(this) || this;\r\n /**\r\n * An indicator of global events were already initialized.\r\n */\r\n _this._globalEventsAdded = false;\r\n /**\r\n * Holds which mouse event listeners to use.\r\n */\r\n _this._pointerEvents = {\r\n \"pointerdown\": \"mousedown\",\r\n \"pointerup\": \"mouseup\",\r\n \"pointermove\": \"mousemove\",\r\n \"pointercancel\": \"mouseup\",\r\n \"pointerover\": \"mouseover\",\r\n \"pointerout\": \"mouseout\",\r\n \"wheel\": \"wheel\"\r\n };\r\n /**\r\n * Indicates if Interaction should use only \"pointer\" type events, like\r\n * \"pointermove\", available in all modern browsers, ignoring \"legacy\"\r\n * events, like \"touchmove\".\r\n */\r\n _this._usePointerEventsOnly = false;\r\n /**\r\n * Use only touch events (for touch only devices such as tablets and phones)\r\n */\r\n _this._useTouchEventsOnly = false;\r\n /**\r\n * Add special hover events. Normally, touch device tap will also simulate\r\n * hover event. On some devices (ahem iOS) we want to prevent that so that\r\n * over/out events are not duplicated.\r\n */\r\n _this._addHoverEvents = true;\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n */\r\n _this._passiveSupported = false;\r\n /**\r\n * Holds list of delayed events\r\n */\r\n _this._delayedEvents = { out: [] };\r\n /**\r\n * List of objects that current have a pointer hovered over them.\r\n */\r\n _this.overObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_1__.List();\r\n /**\r\n * List of objects that currently has a pressed pointer.\r\n */\r\n _this.downObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_1__.List();\r\n /**\r\n * List of objects that need mouse position to be reported to them.\r\n */\r\n _this.trackedObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_1__.List();\r\n /**\r\n * List of objects that are currently being dragged.\r\n */\r\n _this.transformedObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_1__.List();\r\n /**\r\n * Holds all known pointers.\r\n */\r\n _this.pointers = new _utils_Dictionary__WEBPACK_IMPORTED_MODULE_6__.Dictionary();\r\n /**\r\n * Inertia options that need to be applied to after element drag, if it's\r\n * `inert = true`.\r\n *\r\n * This is just a default, which can and probably will be overridden by\r\n * actual elements.\r\n */\r\n _this.inertiaOptions = new _utils_Dictionary__WEBPACK_IMPORTED_MODULE_6__.Dictionary();\r\n /**\r\n * Default options for click events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hitOptions = {\r\n \"doubleHitTime\": 300,\r\n //\"delayFirstHit\": false,\r\n \"hitTolerance\": 10,\r\n \"noFocus\": true\r\n };\r\n /**\r\n * Default options for hover events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hoverOptions = {\r\n \"touchOutBehavior\": \"leave\",\r\n \"touchOutDelay\": 1000\r\n };\r\n /**\r\n * Default options for detecting a swipe gesture. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.swipeOptions = {\r\n \"time\": 500,\r\n \"verticalThreshold\": 75,\r\n \"horizontalThreshold\": 30\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.keyboardOptions = {\r\n \"speed\": 0.1,\r\n \"accelleration\": 1.2,\r\n \"accellerationDelay\": 2000\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @since 4.5.14\r\n */\r\n _this.mouseOptions = {\r\n \"sensitivity\": 1\r\n };\r\n // Set class name\r\n _this.className = \"Interaction\";\r\n // Create InteractionObject for <body>\r\n _this.body = _this.getInteraction(document.body);\r\n _this._disposers.push(_this.body);\r\n // Detect browser capabilities and determine what event listeners to use\r\n if (window.hasOwnProperty(\"PointerEvent\")) {\r\n // IE10+/Edge without touch controls enabled\r\n _this._pointerEvents.pointerdown = \"pointerdown\";\r\n _this._pointerEvents.pointerup = \"pointerup\";\r\n _this._pointerEvents.pointermove = \"pointermove\";\r\n _this._pointerEvents.pointercancel = \"pointercancel\";\r\n _this._pointerEvents.pointerover = \"pointerover\";\r\n _this._pointerEvents.pointerout = \"pointerout\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if (window.hasOwnProperty(\"MSPointerEvent\")) {\r\n // IE9\r\n _this._pointerEvents.pointerdown = \"MSPointerDown\";\r\n _this._pointerEvents.pointerup = \"MSPointerUp\";\r\n _this._pointerEvents.pointermove = \"MSPointerMove\";\r\n _this._pointerEvents.pointercancel = \"MSPointerUp\";\r\n _this._pointerEvents.pointerover = \"MSPointerOver\";\r\n _this._pointerEvents.pointerout = \"MSPointerOut\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if ((typeof matchMedia !== \"undefined\") && matchMedia('(pointer:fine)').matches) {\r\n // This is only for Safari as it does not support PointerEvent\r\n // Do nothing and let it use regular `mouse*` events\r\n // Hi Apple ;)\r\n // Additionally disable hover events for iOS devices\r\n if ('ontouchstart' in window) {\r\n _this._addHoverEvents = false;\r\n _this._useTouchEventsOnly = true;\r\n }\r\n }\r\n else if (window.navigator.userAgent.match(/MSIE /)) {\r\n // Oh looky, an MSIE that does not support PointerEvent. Hi granpa IE9!\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else if (_this.fullFF()) {\r\n // Old FF, let's use regular events.\r\n // (Newer FFs would be detected by the PointerEvent availability check)\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else {\r\n // Uses defaults for normal browsers\r\n // We also assume that this must be a touch device that does not have\r\n // any pointer events\r\n _this._useTouchEventsOnly = true;\r\n }\r\n // Detect if device has a mouse\r\n // This is turning out to be not reliable\r\n // @todo remove\r\n /*if (!window.navigator.msPointerEnabled && (typeof matchMedia !== \"undefined\") && !matchMedia('(pointer:fine)').matches && !this.fullFF()) {\r\n this._useTouchEventsOnly = true;\r\n }*/\r\n // Detect proper mouse wheel events\r\n if (\"onwheel\" in document.createElement(\"div\")) {\r\n // Modern browsers\r\n _this._pointerEvents.wheel = \"wheel\";\r\n }\r\n else if (_utils_Type__WEBPACK_IMPORTED_MODULE_16__.hasValue(document.onmousewheel)) {\r\n // Webkit and IE support at least \"mousewheel\"\r\n _this._pointerEvents.wheel = \"mousewheel\";\r\n }\r\n // Set up default inertia options\r\n _this.inertiaOptions.setKey(\"move\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": _utils_Ease__WEBPACK_IMPORTED_MODULE_12__.polyOut3\r\n });\r\n _this.inertiaOptions.setKey(\"resize\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": _utils_Ease__WEBPACK_IMPORTED_MODULE_12__.polyOut3\r\n });\r\n // Set the passive mode support\r\n _this._passiveSupported = Interaction.passiveSupported;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }", "title": "" }, { "docid": "83d30bae24ee856a24060b9d42e6fd9e", "score": "0.5430964", "text": "createBehavior(target) {\n return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options);\n }", "title": "" }, { "docid": "ac6b5ddc21cb520bf77f9f26d3de59f4", "score": "0.54276067", "text": "withBehaviors(...behaviors) {\n this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors);\n return this;\n }", "title": "" }, { "docid": "e9a22fc723ea29138b9be2b0ee1f5317", "score": "0.54245234", "text": "static enhance(): BehaviorInstruction {\r\n let instruction = new BehaviorInstruction();\r\n instruction.enhance = true;\r\n return instruction;\r\n }", "title": "" }, { "docid": "9cd81606f175f032ce5367f5ce5c2521", "score": "0.5411769", "text": "function CycleAgent(){}", "title": "" }, { "docid": "5c714f3c4f68aa668cc18fea31712fa7", "score": "0.53980595", "text": "constructor() {\n this.bubble__orientation = document.querySelector('.bubbles__orientation')\n this.ax = 0\n this.ay = 0\n this.az = 0\n this.rotation = 0\n this.arAlpha = 0\n this.arBeta = 0\n this.arGamma = 0\n this.startR = 0\n this.accel = 0.24\n this.decel = 0.75\n this.divider = 2\n this.position = 0\n this.vr = 0\n this.pr = 0\n this.elasticity = 0.9\n this.strength = 0.03\n this.target = 0\n\n this.testSupport()\n }", "title": "" }, { "docid": "70f1abd165c59e65d3022cfbad372d01", "score": "0.5388977", "text": "function flyBeheivor(){\n\tthis.fly = function(){\n\t}\n}", "title": "" }, { "docid": "141cd2bc87b8b2e36eb0c17d97a09ca2", "score": "0.53756905", "text": "static init(fn) {\n return new ActorBehavior(fn);\n }", "title": "" }, { "docid": "0e45bcdde80371f3c09f15945400ea8a", "score": "0.5369596", "text": "function genBehavior() {\n\tvar actionName = choose(Object.keys(ACTION_SPEC));\n\tvar actioncost = ACTION_SPEC[actionName]; //choose a random action\n\tvar action = actioncost.action; //the action function\n\tvar cost = actioncost.cost;\n\tvar direction = Math.floor(Math.random() * 4);\n\treturn new Behavior(direction, cost, action, actionName)\n}", "title": "" }, { "docid": "5dbb9276dd82f1ad696e63ab361e5256", "score": "0.5364487", "text": "function Interaction() {\n var _this = // Call super\n _super.call(this) || this;\n /**\n * An indicator of global events were already initialized.\n */\n\n\n _this._globalEventsAdded = false;\n /**\n * Holds which mouse event listeners to use.\n */\n\n _this._pointerEvents = {\n \"pointerdown\": \"mousedown\",\n \"pointerup\": \"mouseup\",\n \"pointermove\": \"mousemove\",\n \"pointercancel\": \"mouseup\",\n \"pointerover\": \"mouseover\",\n \"pointerout\": \"mouseout\",\n \"wheel\": \"wheel\"\n };\n /**\n * Indicates if Interaction should use only \"pointer\" type events, like\n * \"pointermove\", available in all modern browsers, ignoring \"legacy\"\n * events, like \"touchmove\".\n */\n\n _this._usePointerEventsOnly = false;\n /**\n * Use only touch events (for touch only devices such as tablets and phones)\n */\n\n _this._useTouchEventsOnly = false;\n /**\n * Add special hover events. Normally, touch device tap will also simulate\n * hover event. On some devices (ahem iOS) we want to prevent that so that\n * over/out events are not duplicated.\n */\n\n _this._addHoverEvents = true;\n /**\n * Indicates if passive mode options is supported by this browser.\n */\n\n _this._passiveSupported = false;\n /**\n * Holds list of delayed events\n */\n\n _this._delayedEvents = {\n out: []\n };\n /**\n * List of objects that current have a pointer hovered over them.\n */\n\n _this.overObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\n /**\n * List of objects that currently has a pressed pointer.\n */\n\n _this.downObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\n /**\n * List of objects that need mouse position to be reported to them.\n */\n\n _this.trackedObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\n /**\n * List of objects that are currently being dragged.\n */\n\n _this.transformedObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\n /**\n * Holds all known pointers.\n */\n\n _this.pointers = new _utils_Dictionary__WEBPACK_IMPORTED_MODULE_7__[\"Dictionary\"]();\n /**\n * Inertia options that need to be applied to after element drag, if it's\n * `inert = true`.\n *\n * This is just a default, which can and probably will be overridden by\n * actual elements.\n */\n\n _this.inertiaOptions = new _utils_Dictionary__WEBPACK_IMPORTED_MODULE_7__[\"Dictionary\"]();\n /**\n * Default options for click events. These can be overridden in\n * [[InteractionObject]].\n */\n\n _this.hitOptions = {\n //\"holdTime\": 1000,\n \"doubleHitTime\": 300,\n //\"delayFirstHit\": false,\n \"hitTolerance\": 10,\n \"noFocus\": true\n };\n /**\n * Default options for hover events. These can be overridden in\n * [[InteractionObject]].\n */\n\n _this.hoverOptions = {\n \"touchOutBehavior\": \"leave\",\n \"touchOutDelay\": 1000\n };\n /**\n * Default options for detecting a swipe gesture. These can be overridden in\n * [[InteractionObject]].\n */\n\n _this.swipeOptions = {\n \"time\": 500,\n \"verticalThreshold\": 75,\n \"horizontalThreshold\": 30\n };\n /**\n * Default options for keyboard operations. These can be overridden in\n * [[InteractionObject]].\n */\n\n _this.keyboardOptions = {\n \"speed\": 0.1,\n \"accelleration\": 1.2,\n \"accellerationDelay\": 2000\n };\n /**\n * Default options for keyboard operations. These can be overridden in\n * [[InteractionObject]].\n *\n * @since 4.5.14\n */\n\n _this.mouseOptions = {\n \"sensitivity\": 1\n }; // Set class name\n\n _this.className = \"Interaction\"; // Create InteractionObject for <body>\n\n _this.body = _this.getInteraction(document.body);\n\n _this._disposers.push(_this.body); // Detect browser capabilities and determine what event listeners to use\n\n\n if (window.hasOwnProperty(\"PointerEvent\")) {\n // IE10+/Edge without touch controls enabled\n _this._pointerEvents.pointerdown = \"pointerdown\";\n _this._pointerEvents.pointerup = \"pointerup\";\n _this._pointerEvents.pointermove = \"pointermove\";\n _this._pointerEvents.pointercancel = \"pointercancel\";\n _this._pointerEvents.pointerover = \"pointerover\";\n _this._pointerEvents.pointerout = \"pointerout\"; //this._usePointerEventsOnly = true;\n } else if (window.hasOwnProperty(\"MSPointerEvent\")) {\n // IE9\n _this._pointerEvents.pointerdown = \"MSPointerDown\";\n _this._pointerEvents.pointerup = \"MSPointerUp\";\n _this._pointerEvents.pointermove = \"MSPointerMove\";\n _this._pointerEvents.pointercancel = \"MSPointerUp\";\n _this._pointerEvents.pointerover = \"MSPointerOver\";\n _this._pointerEvents.pointerout = \"MSPointerOut\"; //this._usePointerEventsOnly = true;\n } else if (typeof matchMedia !== \"undefined\" && matchMedia('(pointer:fine)').matches) {\n // This is only for Safari as it does not support PointerEvent\n // Do nothing and let it use regular `mouse*` events\n // Hi Apple ;)\n // Additionally disable hover events for iOS devices\n if ('ontouchstart' in window) {\n _this._addHoverEvents = false;\n _this._useTouchEventsOnly = true;\n }\n } else if (window.navigator.userAgent.match(/MSIE /)) {\n // Oh looky, an MSIE that does not support PointerEvent. Hi granpa IE9!\n _this._usePointerEventsOnly = true;\n } else if (_this.fullFF()) {\n // Old FF, let's use regular events.\n // (Newer FFs would be detected by the PointerEvent availability check)\n _this._usePointerEventsOnly = true;\n } else {\n // Uses defaults for normal browsers\n // We also assume that this must be a touch device that does not have\n // any pointer events\n _this._useTouchEventsOnly = true;\n } // Detect if device has a mouse\n // This is turning out to be not reliable\n // @todo remove\n\n /*if (!window.navigator.msPointerEnabled && (typeof matchMedia !== \"undefined\") && !matchMedia('(pointer:fine)').matches && !this.fullFF()) {\n this._useTouchEventsOnly = true;\n }*/\n // Detect proper mouse wheel events\n\n\n if (\"onwheel\" in document.createElement(\"div\")) {\n // Modern browsers\n _this._pointerEvents.wheel = \"wheel\";\n } else if (_utils_Type__WEBPACK_IMPORTED_MODULE_16__[\"hasValue\"](document.onmousewheel)) {\n // Webkit and IE support at least \"mousewheel\"\n _this._pointerEvents.wheel = \"mousewheel\";\n } // Set up default inertia options\n\n\n _this.inertiaOptions.setKey(\"move\", {\n \"time\": 100,\n \"duration\": 500,\n \"factor\": 1,\n \"easing\": _utils_Ease__WEBPACK_IMPORTED_MODULE_12__[\"polyOut3\"]\n });\n\n _this.inertiaOptions.setKey(\"resize\", {\n \"time\": 100,\n \"duration\": 500,\n \"factor\": 1,\n \"easing\": _utils_Ease__WEBPACK_IMPORTED_MODULE_12__[\"polyOut3\"]\n }); // Set the passive mode support\n\n\n _this._passiveSupported = Interaction.passiveSupported; // Apply theme\n\n _this.applyTheme();\n\n return _this;\n }", "title": "" }, { "docid": "d48d13c371e6e675b2ecc3b83d05d94a", "score": "0.5356645", "text": "function Burnisher () {}", "title": "" }, { "docid": "b75e4500d4b594b0bf45c1a0aa49f653", "score": "0.53063405", "text": "function flipperActor(state) {\n var flipUpBeh = function flipUpBeh(message) {\n console.log(state, 'flipping up...');\n state = 'up';\n this.behavior = flipDownBeh;\n };\n var flipDownBeh = function flipDownBeh(message) {\n console.log(state, 'flipping down...');\n state = 'down';\n this.behavior = flipUpBeh;\n };\n return flipDownBeh;\n}", "title": "" }, { "docid": "d3e20ca6fd73488fd3df1ceec70077ca", "score": "0.5301028", "text": "function Component_MessageBehavior() {\n\n /**\n * Reference to temporary game settings.\n * @property settings\n * @type Object\n * @protected\n */\n this.tempSettings = GameManager.tempSettings;\n\n /**\n * Indicates if the message is currently waiting.\n * @property isWaiting\n * @type boolean\n * @readOnly\n */\n this.isWaiting = false;\n\n /**\n * Indicates if the message is currently running.\n * @property isRunning\n * @type boolean\n * @readOnly\n */\n this.isRunning = false;\n\n /**\n * Indicates if a voice is currently playing together with the message.\n * @property isVoicePlaying\n * @type boolean\n * @readOnly\n */\n this.isVoicePlaying = false;\n\n /**\n * Current message caret/cursor position.\n * @property caretPosition\n * @type gs.Point\n * @readOnly\n */\n this.caretPosition = new gs.Point(0, 0);\n\n /**\n * Current raw message text.\n * @property message\n * @type string\n * @readOnly\n */\n this.message = \"\";\n\n /**\n * All currently displayed raw messages.\n * @property messages\n * @type string[]\n * @readOnly\n */\n this.messages = [];\n\n /**\n * Voice associated with the current message.\n * @property voice\n * @type gs.AudioBufferReference\n */\n this.voice = null;\n\n /**\n * Indicates if current message is partial. DEPRECATED. Please do not use.\n * @property partial\n * @deprecated\n * @type boolean\n * @readOnly\n */\n this.partial = false;\n\n /**\n * Indicates if the message is currently waiting in live-preview.\n * @property waitingPreview\n * @type boolean\n * @readOnly\n */\n this.waitingPreview = false;\n\n /**\n * Indicates if the auto-message is enabled.\n * @property autoMessageEnabled\n * @type boolean\n * @readOnly\n */\n this.autoMessageEnabled = false;\n this.onMessageFinish = (function(_this) {\n return function(sender) {\n _this.object.events.emit(\"finish\", _this);\n if (_this.object.settings.autoErase || _this.object.settings.paragraphSpacing > 0) {\n return _this.message = \"\";\n }\n };\n })(this);\n this.onMessageWaiting = (function(_this) {\n return function(sender) {\n if (!_this.object.textRenderer.isBatched() || !_this.object.textRenderer.isBatchInProgress()) {\n _this.object.textRenderer.waitAtEnd = !_this.partial;\n return _this.object.events.emit(\"waiting\", _this);\n }\n };\n })(this);\n }", "title": "" }, { "docid": "7fe17c6906f97bcc45b49f105649443b", "score": "0.52865845", "text": "function activate(){}", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.5279646", "text": "function Composition() {}", "title": "" }, { "docid": "ac930e2e852440648afa7596d03b7708", "score": "0.5275253", "text": "function Interaction() {\r\n var _this = \r\n // Call super\r\n _super.call(this) || this;\r\n /**\r\n * An indicator of global events were already initialized.\r\n *\r\n * @type {boolean}\r\n */\r\n _this._globalEventsAdded = false;\r\n /**\r\n * Holds which mouse event listeners to use.\r\n *\r\n * @type {Object}\r\n */\r\n _this._pointerEvents = {\r\n \"pointerdown\": \"mousedown\",\r\n \"pointerup\": \"mouseup\",\r\n \"pointermove\": \"mousemove\",\r\n \"pointercancel\": \"mouseup\",\r\n \"pointerover\": \"mouseover\",\r\n \"pointerout\": \"mouseout\",\r\n \"wheel\": \"wheel\"\r\n };\r\n /**\r\n * Indicates if Interaction should use only \"pointer\" type events, like\r\n * \"pointermove\", available in all modern browsers, ignoring \"legacy\"\r\n * events, like \"touchmove\".\r\n *\r\n * @type {boolean}\r\n */\r\n _this._usePointerEventsOnly = false;\r\n /**\r\n * Use only touch events (for touch only devices such as tablets and phones)\r\n *\r\n * @type {boolean}\r\n */\r\n _this._useTouchEventsOnly = false;\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n *\r\n * @type {boolean}\r\n */\r\n _this._passiveSupported = false;\r\n /**\r\n * Holds list of delayed events\r\n *\r\n * @type {IDelayedEvent[]}\r\n */\r\n _this._delayedEvents = { out: [] };\r\n /**\r\n * List of objects that current have a pointer hovered over them.\r\n *\r\n * @type {List<InteractionObject>}\r\n */\r\n _this.overObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\r\n /**\r\n * List of objects that currently has a pressed pointer.\r\n *\r\n * @type {List<InteractionObject>}\r\n */\r\n _this.downObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\r\n /**\r\n * List of objects that need mouse position to be reported to them.\r\n *\r\n * @type {List<InteractionObject>}\r\n */\r\n _this.trackedObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\r\n /**\r\n * List of objects that are currently being dragged.\r\n *\r\n * @type {List<InteractionObject>}\r\n */\r\n _this.transformedObjects = new _utils_List__WEBPACK_IMPORTED_MODULE_2__[\"List\"]();\r\n /**\r\n * Holds all known pointers.\r\n *\r\n * @type {Dictionary<string, IPointer>}\r\n */\r\n _this.pointers = new _utils_Dictionary__WEBPACK_IMPORTED_MODULE_7__[\"Dictionary\"]();\r\n /**\r\n * Inertia options that need to be applied to after element drag, if it's\r\n * `inert = true`.\r\n *\r\n * This is just a default, which can and probably will be overridden by\r\n * actual elements.\r\n *\r\n * @type {Dictionary}\r\n */\r\n _this.inertiaOptions = new _utils_Dictionary__WEBPACK_IMPORTED_MODULE_7__[\"Dictionary\"]();\r\n /**\r\n * Default options for click events. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @type {IHitOptions}\r\n */\r\n _this.hitOptions = {\r\n //\"holdTime\": 1000,\r\n \"doubleHitTime\": 300,\r\n //\"delayFirstHit\": false,\r\n \"hitTolerance\": 10,\r\n \"noFocus\": true\r\n };\r\n /**\r\n * Default options for hover events. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @type {IHoverOptions}\r\n */\r\n _this.hoverOptions = {\r\n \"touchOutBehavior\": \"leave\",\r\n \"touchOutDelay\": 1000\r\n };\r\n /**\r\n * Default options for detecting a swipe gesture. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @type {ISwipeOptions}\r\n */\r\n _this.swipeOptions = {\r\n \"time\": 500,\r\n \"verticalThreshold\": 75,\r\n \"horizontalThreshold\": 30\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @type {IKeyboarOptions}\r\n */\r\n _this.keyboardOptions = {\r\n \"speed\": 0.1,\r\n \"accelleration\": 1.2,\r\n \"accellerationDelay\": 2000\r\n };\r\n // Set class name\r\n _this.className = \"Interaction\";\r\n // Create InteractionObject for <body>\r\n _this.body = _this.getInteraction(document.body);\r\n _this._disposers.push(_this.body);\r\n // Detect browser capabilities and determine what event listeners to use\r\n if (window.hasOwnProperty(\"PointerEvent\")) {\r\n // IE10+/Edge without touch controls enabled\r\n _this._pointerEvents.pointerdown = \"pointerdown\";\r\n _this._pointerEvents.pointerup = \"pointerup\";\r\n _this._pointerEvents.pointermove = \"pointermove\";\r\n _this._pointerEvents.pointercancel = \"pointercancel\";\r\n _this._pointerEvents.pointerover = \"pointerover\";\r\n _this._pointerEvents.pointerout = \"pointerout\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if (window.hasOwnProperty(\"MSPointerEvent\")) {\r\n // IE9\r\n _this._pointerEvents.pointerdown = \"MSPointerDown\";\r\n _this._pointerEvents.pointerup = \"MSPointerUp\";\r\n _this._pointerEvents.pointermove = \"MSPointerMove\";\r\n _this._pointerEvents.pointercancel = \"MSPointerUp\";\r\n _this._pointerEvents.pointerover = \"MSPointerOver\";\r\n _this._pointerEvents.pointerout = \"MSPointerOut\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if ((typeof matchMedia !== \"undefined\") && matchMedia('(pointer:fine)')) {\r\n // This is only for Safari as it does not support PointerEvent\r\n // Do nothing and let it use regular `mouse*` events\r\n // Hi Apple ;)\r\n }\r\n else {\r\n // Uses defaults for normal browsers\r\n // We also assume that this must be a touch device that does not have\r\n // any pointer events\r\n _this._useTouchEventsOnly = true;\r\n }\r\n // Detect if device has a mouse\r\n // This is turning out to be not reliable\r\n // @todo remove\r\n /*if (!window.navigator.msPointerEnabled && (typeof matchMedia !== \"undefined\") && !matchMedia('(pointer:fine)').matches && !this.fullFF()) {\r\n this._useTouchEventsOnly = true;\r\n }*/\r\n // Detect proper mouse wheel events\r\n if (\"onwheel\" in document.createElement(\"div\")) {\r\n // Modern browsers\r\n _this._pointerEvents.wheel = \"wheel\";\r\n }\r\n else if (_utils_Type__WEBPACK_IMPORTED_MODULE_15__[\"hasValue\"](document.onmousewheel)) {\r\n // Webkit and IE support at least \"mousewheel\"\r\n _this._pointerEvents.wheel = \"mousewheel\";\r\n }\r\n // Set up default inertia options\r\n _this.inertiaOptions.setKey(\"move\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": _utils_Ease__WEBPACK_IMPORTED_MODULE_12__[\"polyOut3\"]\r\n });\r\n _this.inertiaOptions.setKey(\"resize\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": _utils_Ease__WEBPACK_IMPORTED_MODULE_12__[\"polyOut3\"]\r\n });\r\n // Check for passive mode support\r\n try {\r\n var target_1 = _this;\r\n var options = Object.defineProperty({}, \"passive\", {\r\n get: function () {\r\n target_1._passiveSupported = true;\r\n }\r\n });\r\n window.addEventListener(\"test\", options, options);\r\n window.removeEventListener(\"test\", options, options);\r\n }\r\n catch (err) {\r\n _this._passiveSupported = false;\r\n }\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }", "title": "" }, { "docid": "4272a9b26098b33812728f40016c872d", "score": "0.5271194", "text": "doBehavior(action, args = []) {\n args.unshift(this);\n _.each(this.behaviors, (behavior) => { if(behavior[action]) return behavior[action].apply(behavior, args); }); // returning false from any behavior will cancel subsequent ones\n }", "title": "" }, { "docid": "df1f1a57973df8e80aa2cfb737073bf5", "score": "0.5262215", "text": "constructor() {\n super(...arguments);\n this._animationDir = \"bounce-right\";\n }", "title": "" }, { "docid": "c4dee24699056f1045814b718b76f2b1", "score": "0.52614087", "text": "function PointerDragBehavior(options) {\n this._useAlternatePickedPointAboveMaxDragAngleDragSpeed = -1.1;\n /**\n * The maximum tolerated angle between the drag plane and dragging pointer rays to trigger pointer events. Set to 0 to allow any angle (default: 0)\n */\n this.maxDragAngle = 0;\n /**\n * @hidden\n */\n this._useAlternatePickedPointAboveMaxDragAngle = false;\n /**\n * The id of the pointer that is currently interacting with the behavior (-1 when no pointer is active)\n */\n this.currentDraggingPointerID = -1;\n /**\n * If the behavior is currently in a dragging state\n */\n this.dragging = false;\n /**\n * The distance towards the target drag position to move each frame. This can be useful to avoid jitter. Set this to 1 for no delay. (Default: 0.2)\n */\n this.dragDeltaRatio = 0.2;\n /**\n * If the drag plane orientation should be updated during the dragging (Default: true)\n */\n this.updateDragPlane = true;\n // Debug mode will display drag planes to help visualize behavior\n this._debugMode = false;\n this._moving = false;\n /**\n * Fires each time the attached mesh is dragged with the pointer\n * * delta between last drag position and current drag position in world space\n * * dragDistance along the drag axis\n * * dragPlaneNormal normal of the current drag plane used during the drag\n * * dragPlanePoint in world space where the drag intersects the drag plane\n */\n this.onDragObservable = new __WEBPACK_IMPORTED_MODULE_2__Misc_observable__[\"c\" /* Observable */]();\n /**\n * Fires each time a drag begins (eg. mouse down on mesh)\n */\n this.onDragStartObservable = new __WEBPACK_IMPORTED_MODULE_2__Misc_observable__[\"c\" /* Observable */]();\n /**\n * Fires each time a drag ends (eg. mouse release after drag)\n */\n this.onDragEndObservable = new __WEBPACK_IMPORTED_MODULE_2__Misc_observable__[\"c\" /* Observable */]();\n /**\n * If the attached mesh should be moved when dragged\n */\n this.moveAttached = true;\n /**\n * If the drag behavior will react to drag events (Default: true)\n */\n this.enabled = true;\n /**\n * If camera controls should be detached during the drag\n */\n this.detachCameraControls = true;\n /**\n * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)\n */\n this.useObjectOrienationForDragging = true;\n /**\n * Predicate to determine if it is valid to move the object to a new position when it is moved\n */\n this.validateDrag = function (targetPosition) { return true; };\n this._tmpVector = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._alternatePickedPoint = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._worldDragAxis = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._targetPosition = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._attachedElement = null;\n this._startDragRay = new __WEBPACK_IMPORTED_MODULE_5__Culling_ray__[\"a\" /* Ray */](new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](), new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */]());\n this._lastPointerRay = {};\n this._dragDelta = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */]();\n // Variables to avoid instantiation in the below method\n this._pointA = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._pointB = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._pointC = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._lineA = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._lineB = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._localAxis = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._lookAt = new __WEBPACK_IMPORTED_MODULE_3__Maths_math__[\"x\" /* Vector3 */](0, 0, 0);\n this._options = options ? options : {};\n var optionCount = 0;\n if (this._options.dragAxis) {\n optionCount++;\n }\n if (this._options.dragPlaneNormal) {\n optionCount++;\n }\n if (optionCount > 1) {\n throw \"Multiple drag modes specified in dragBehavior options. Only one expected\";\n }\n }", "title": "" }, { "docid": "72604a8c292bee302f9b771149de350d", "score": "0.5256799", "text": "function Trigger()\n{\n\tthis._listeners = new Array();\n}", "title": "" }, { "docid": "6b187bcb7bc0687037d04c204f8c0aac", "score": "0.52481884", "text": "constructor(){\n super('obs-scene trigger', 'core.rosie.trigger.obs-scene');\n }", "title": "" }, { "docid": "a0dfe930fc2af1ecd4dc94d6e9962414", "score": "0.52419335", "text": "constructor(name) {\n this._name = name;\n this._behavior = 0;\n }", "title": "" }, { "docid": "28ca6ab20bbd400e24c2435736317b5c", "score": "0.52325034", "text": "activate(...args) {\n this._super(...args);\n this._attachEvents();\n }", "title": "" }, { "docid": "afbf6b0710f94fb3c8499b4d8466780c", "score": "0.52231824", "text": "constructor(interaction) {\n this.active = false;\n this.isModified = false;\n this.smoothEnd = false;\n this.allowResume = false;\n this.modification = void 0;\n this.modifierCount = 0;\n this.modifierArg = void 0;\n this.startCoords = void 0;\n this.t0 = 0;\n this.v0 = 0;\n this.te = 0;\n this.targetOffset = void 0;\n this.modifiedOffset = void 0;\n this.currentOffset = void 0;\n this.lambda_v0 = 0;\n this.one_ve_v0 = 0;\n this.timeout = void 0;\n this.interaction = void 0;\n this.interaction = interaction;\n }", "title": "" }, { "docid": "639787532048a908f2613875ccdb4f4c", "score": "0.51977104", "text": "constructor(game, friendly, x, y, velocity, speed, lifetime, damage, proj, hold, aimme, effect) {\n super(game, friendly, x, y, velocity, speed, lifetime, damage, proj, effect);\n\n this.tempspeed = this.speed;\n\n this.floattimer = Date.now();\n\n this.floatspeed = 0.8;\n\n this.returnlifetime = this.lifetime/2;\n\n this.resetonce = true;\n\n Object.assign(this, {hold, aimme});\n }", "title": "" }, { "docid": "1f1fbdc254b0e25c51a5336268020fd8", "score": "0.5194336", "text": "function setupActivity()\n{\n\tworld = objView.getWorldModel();\n\tworld.addStepListener(stepsListener,1000);\n\tobjView.addStartableListener(startableListener);\n\tobjView.addCollisionsListener(collisionsListener);\n\n\t//Get the pirate guy\n\tball = world.getAtomByName(\"ball\");\n\tif (ball == null){\n\t\tSystem.err.println(\"Error, pirate guy not found (atom named ball\");\n\t}\n\t\n\t//Get the treasure element\n\ttreasure = objView.getElementByName(\"treasure\");\n\tif (treasure == null){\n\t\tSystem.err.println(\"Error, treasure not found (passive element named treasure\");\n\t}\n\n\t//Get the resultant displ daemon (invisible for now)\t\n\tresultDisplDaemon = world.getDaemonByName(\"resDispl\");\n\tif (resultDisplDaemon == null){\n\t\tSystem.err.println(\"Error, resultant displacement vector not found (displ daemon named resDispl\");\n\t}\n\t\n\t//Add listeners to all displ. daemons to detect when the pirate goes through each arrow\n\tvar daemons = world.getDaemons();\n\tvar i\n\tfor (i = 0; i < daemons.size(); i++){\n\t\tvar d = daemons.elementAt(i);\n\t\tif (d.getName().startsWith(\"displ\")){\n\t\t\tdisplDColor = d.getActiveColor()\n\t\t\td.addDaemonListener(daemonListener)\n\t\t}\n\t}\n\t\n\t//Add area listener to detect when the pirate reaches the treasure\n\tball.addAreaListener(areaListener, treasure);\n//\t\t\tobjView.getPanelToWorldCoordinateTuner().tuneX(JPartWorld.getPxFromCm(tx))-2,\n//\t\t\tobjView.getPanelToWorldCoordinateTuner().tuneY(JPartWorld.getPxFromCm(ty))-2,4,4)\n\t\n}", "title": "" }, { "docid": "d94d28da742f27a44a34cf2d010775b1", "score": "0.5190689", "text": "constructor(name) { //JavaScript will invoke the constructor() method every time we create a new instance of our Dog class. This constructor() method accepts one argument, name.\n this._name = name; //this refers to an instance of that class\n this._behavior = 0; //we create a property called behavior\n }", "title": "" }, { "docid": "a77d370cb6cc554f33977b12e8e5d365", "score": "0.51864463", "text": "function PersonAnimator(){\n this.moveRandomly = function(){ /*..*/ };\n}", "title": "" }, { "docid": "a590e61171b0d4ca20af32540b24e1fa", "score": "0.5165843", "text": "function inspectBehavior(){\n}", "title": "" }, { "docid": "1504c473642ab3bcf206faccd9600803", "score": "0.5163387", "text": "constructor() {\n super(3);\n\n this.emitters = {};\n }", "title": "" }, { "docid": "55657e70efadfac1e8c8e71351175e78", "score": "0.5161673", "text": "function Start ()\n{ \n neighbors = new Collider2D[flock.flockSize];\n\n behavior = gameObject.GetComponent(Behavior);\n\n scene = GameObject.Find(\"Scene\").GetComponent(Scene);\n scene.RegisterShow(ShowBird);\n\n birdLayerMask = LayerMask.GetMask([\"Bird\"]);\n\n rigidbody2D.velocity = Vector2.zero;\n \n birdSprite = Instantiate(birdSpritePrefab, transform.position, Quaternion.identity);\n animator = birdSprite.GetComponent(Animator);\n\n StartCoroutine(\"BirdBehavior\");\n}", "title": "" }, { "docid": "dd330f290aaedbbc558b44d1743c4ace", "score": "0.51456445", "text": "function canAcceptBehavior(){\n return true;\n}", "title": "" }, { "docid": "4bef742098cea2390a009be36ac56dc0", "score": "0.51388395", "text": "constructor() {\n\n\t\t/**\n\t\t * Movement to the left.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\n\t\tthis.left = false;\n\n\t\t/**\n\t\t * Movement to the right.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\n\t\tthis.right = false;\n\n\t\t/**\n\t\t * Forward motion.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\n\t\tthis.forward = false;\n\n\t\t/**\n\t\t * Backward motion.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\n\t\tthis.backward = false;\n\n\t\t/**\n\t\t * Ascension.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\n\t\tthis.up = false;\n\n\t\t/**\n\t\t * Descent.\n\t\t *\n\t\t * @type {Boolean}\n\t\t */\n\n\t\tthis.down = false;\n\n\t}", "title": "" }, { "docid": "7682bc05a074e69e1f0426a40093955d", "score": "0.5136514", "text": "static attribute(attrName: string, type?: HtmlBehaviorResource): BehaviorInstruction {\r\n let instruction = new BehaviorInstruction();\r\n instruction.attrName = attrName;\r\n instruction.type = type || null;\r\n instruction.attributes = {};\r\n return instruction;\r\n }\r\n\r\n /**\r\n * Creates a dynamic component instruction.\r\n * @param host The element that will parent the dynamic component.\r\n * @param viewModel The dynamic component's view model instance.\r\n * @param viewFactory A view factory used in generating the component's view.\r\n * @return The created instruction.\r\n */\r\n static dynamic(host: Element, viewModel: Object, viewFactory: ViewFactory): BehaviorInstruction {\r\n let instruction = new BehaviorInstruction();\r\n instruction.host = host;\r\n instruction.viewModel = viewModel;\r\n instruction.viewFactory = viewFactory;\r\n instruction.inheritBindingContext = true;\r\n return instruction;\r\n }", "title": "" }, { "docid": "7a352af9a0cfdcbc505ada0cfbf3db83", "score": "0.5125996", "text": "get requiredBehavior () {\n\t\treturn this._requiredBehavior;\n\t}", "title": "" }, { "docid": "3c20ce42109bd0cc304cb55d1b2a29d5", "score": "0.51230484", "text": "constructor(options) {\r\n super(options);\r\n this.cameraGroup = options.cameraGroup;\r\n this.camera = options.camera;\r\n this.THREE = options.THREE;\r\n this.listener = new this.THREE.AudioListener();\r\n this.camera.add(this.listener);\r\n this.vehicle = new YUKA.Vehicle();\r\n this.map.aiManager.add(this.vehicle);\r\n this.collisionFilterGroup = 2;\r\n this.collisionFilterMask = 5;\r\n let position = new this.CANNON.Vec3(0, 1, 0);\r\n this.bodyActor = new Actor({\r\n THREE: this.THREE,\r\n CANNON: this.CANNON,\r\n map: this.map,\r\n lifespan: undefined,\r\n position,\r\n velocity: undefined,\r\n rawShapeData: { size: 1 },\r\n noDie: true,\r\n mass: 1,\r\n bodySettings: { fixedRotation: true, material: \"playerMaterial\" },\r\n collisionFilterGroup: this.collisionFilterGroup,\r\n collisionFilterMask: this.collisionFilterMask\r\n });\r\n\r\n this.bodyActor.body.fixedRotation = true;\r\n this.bodyActor.body.linearDamping = 0.7;\r\n\r\n this.leftFireDebouncer = new Debouncer(1);\r\n this.rightFireDebouncer = new Debouncer(1);\r\n this.leftControllerGrip = options.leftControllerGrip;\r\n this.rightControllerGrip = options.rightControllerGrip;\r\n\r\n this.debouncers = [this.leftFireDebouncer, this.rightFireDebouncer];\r\n this.playerPos = undefined;\r\n this.messages = [];\r\n\r\n this.leftHandParticleSystem = new ParticleSystem({\r\n THREE: this.THREE,\r\n scene: this.scene,\r\n type: \"left_hand\",\r\n useLoaded: true\r\n });\r\n\r\n this.rightHandParticleSystem = new ParticleSystem({\r\n THREE: this.THREE,\r\n scene: this.scene,\r\n type: \"right_hand\",\r\n useLoaded: true\r\n });\r\n\r\n // add music\r\n this.music = new Sound({\r\n THREE: this.THREE,\r\n actor: this.bodyActor,\r\n player: this,\r\n name: \"music01\"\r\n });\r\n }", "title": "" }, { "docid": "3f3b5ec303736cde2b3e27fe7d530b78", "score": "0.5116201", "text": "function events(behaviour) {\n\t\n\t\t\t\t// Attach the standard drag event to the handles.\n\t\t\t\tif (!behaviour.fixed) {\n\t\n\t\t\t\t\tscope_Handles.forEach(function (handle, index) {\n\t\n\t\t\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\t\t\tattach(actions.start, handle.children[0], start, {\n\t\t\t\t\t\t\thandles: [handle],\n\t\t\t\t\t\t\thandleNumber: index\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\n\t\t\t\t// Attach the tap event to the slider base.\n\t\t\t\tif (behaviour.tap) {\n\t\n\t\t\t\t\tattach(actions.start, scope_Base, tap, {\n\t\t\t\t\t\thandles: scope_Handles\n\t\t\t\t\t});\n\t\t\t\t}\n\t\n\t\t\t\t// Fire hover events\n\t\t\t\tif (behaviour.hover) {\n\t\t\t\t\tattach(actions.move, scope_Base, hover, { hover: true });\n\t\t\t\t}\n\t\n\t\t\t\t// Make the range draggable.\n\t\t\t\tif (behaviour.drag) {\n\t\n\t\t\t\t\tvar drag = [scope_Base.querySelector('.' + options.cssClasses.connect)];\n\t\t\t\t\taddClass(drag[0], options.cssClasses.draggable);\n\t\n\t\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\t\tif (behaviour.fixed) {\n\t\t\t\t\t\tdrag.push(scope_Handles[drag[0] === scope_Handles[0] ? 1 : 0].children[0]);\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdrag.forEach(function (element) {\n\t\t\t\t\t\tattach(actions.start, element, start, {\n\t\t\t\t\t\t\thandles: scope_Handles\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "edc41a729026c8affb0c79d9163b47ab", "score": "0.51097697", "text": "constructor() {\n\t\tthis._HOOKS = [];\n\t}", "title": "" }, { "docid": "8bcc6a8978ecb3aa2bbb723e78457e28", "score": "0.5104704", "text": "activate() {}", "title": "" }, { "docid": "b7010b456ca249d4604bf6bc05963d16", "score": "0.5102479", "text": "setupBubbleEvents() {\n if (this._keyframes instanceof Keyframes) {\n this._keyframes.removeAllListeners();\n\n const evt = (from, to) => {\n this._keyframes.on(from, events.bubbleEvent(to, this));\n };\n\n evt('change:list', 'change:keyframes:list');\n evt('change', 'change:keyframe');\n evt('change:time', 'change:keyframe:time');\n evt('change:value', 'change:keyframe:value');\n evt('change:ease', 'change:keyframe:ease');\n evt('add', 'add:keyframe');\n evt('remove', 'remove:keyframe');\n }\n }", "title": "" }, { "docid": "5c1968bfc25b3dbe00fb3ec09be0683a", "score": "0.5099554", "text": "static load(node) {\n BehaviourLoader.behaviours.forEach(behav => {\n if (node.def[behav.name]) {\n node.addBehaviour(behav.name, behav.funct(node, node.def[behav.name]));\n }\n });\n if (node.def.eventDefinitions) {\n node.def.eventDefinitions.forEach(ed => {\n BehaviourLoader.behaviours.forEach(behav => {\n if (ed.$type == behav.name) {\n node.addBehaviour(behav.name, behav.funct(node, ed));\n }\n });\n });\n }\n if (node.def.extensionElements && node.def.extensionElements.values) {\n node.def.extensionElements.values.forEach(ext => {\n BehaviourLoader.behaviours.forEach(behav => {\n if (ext.$type == behav.name) {\n node.addBehaviour(behav.name, behav.funct(node, ext));\n }\n });\n });\n }\n }", "title": "" }, { "docid": "97554f02d0bbd13e6aa539a9899b7225", "score": "0.50942075", "text": "setBehavior(behavior) {\n if (!behavior instanceof Function) {\n return this;\n }\n\n this.behavior = behavior;\n\n return this;\n }", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "fa51bf5332b09fd9fa34aa03fb6aa723", "score": "0.50908935", "text": "function IDEBehaviorType()\n{\n\tassert2(this instanceof arguments.callee, \"Constructor called as a function\");\n}", "title": "" }, { "docid": "28de019425350326dedbf322666f2c05", "score": "0.5083698", "text": "static get nuBehaviors() {\n return {};\n }", "title": "" }, { "docid": "f8ab9938f12bcb2a76099b493649d8f6", "score": "0.5082262", "text": "constructor() {\r\n super('jump');\r\n \r\n this.ready = 0;\r\n this.speedBoost = 0.3;\r\n this.duration = 0.3;\r\n this.velocity = 200;\r\n this.engageTime = 0;\r\n this.requestTime = 0;\r\n this.gracePeriod = 0.1; //time before you land where button press will count\r\n \r\n }", "title": "" }, { "docid": "d015d9470c041a8cb0ac065e8f8cef55", "score": "0.5063034", "text": "ActivateFire() {\n this.Firing = true;\n this.FireCount++;\n // Single Fires\n this.Objects[\"Fire1-1\"].activate();\n this.Objects[\"Fire1-2\"].activate();\n this.Objects[\"Fire1-3\"].activate();\n\n // Paired Alternating Fires\n switch(this.FireCount % 2) {\n case 0:\n this.Objects[\"Fire2-1\"].activate();\n this.Objects[\"Fire2-2\"].activate();\n this.Objects[\"Fire5-1\"].activate();\n this.Objects[\"Fire5-2\"].activate();\n this.Objects[\"Fire10-1\"].activate();\n this.Objects[\"Fire10-2\"].activate();\n this.Objects[\"Fire10-3\"].activate();\n this.Objects[\"Fire12-1\"].activate();\n this.Objects[\"Fire12-2\"].activate();\n this.Objects[\"Fire12-3\"].activate();\n break;\n case 1:\n this.Objects[\"Fire3-1\"].activate();\n this.Objects[\"Fire3-2\"].activate();\n this.Objects[\"Fire4-1\"].activate();\n this.Objects[\"Fire4-2\"].activate();\n this.Objects[\"Fire9-1\"].activate();\n this.Objects[\"Fire9-2\"].activate();\n this.Objects[\"Fire9-3\"].activate();\n this.Objects[\"Fire11-1\"].activate();\n this.Objects[\"Fire11-2\"].activate();\n this.Objects[\"Fire11-3\"].activate();\n }\n\n // Arrythmic Fire\n switch(this.FireCount % 3) {\n case 0:\n this.Objects[\"Fire6-1\"].activate();\n this.Objects[\"Fire6-2\"].activate();\n this.Objects[\"Fire8-1\"].activate();\n this.Objects[\"Fire8-2\"].activate();\n break;\n case 1:\n this.Objects[\"Fire6-1\"].activate();\n this.Objects[\"Fire6-2\"].activate();\n this.Objects[\"Fire7-1\"].activate();\n this.Objects[\"Fire7-2\"].activate();\n break;\n case 2:\n this.Objects[\"Fire7-1\"].activate();\n this.Objects[\"Fire7-2\"].activate();\n this.Objects[\"Fire8-1\"].activate();\n this.Objects[\"Fire8-2\"].activate();\n }\n }", "title": "" }, { "docid": "043b2095be66965c7d9fe89943151a50", "score": "0.50626475", "text": "constructor(){\n /**\n * the string for the event fired when a slot is changed\n */\n this.SLOT_CHANGED = \"slotChanged\";\n\n /**\n * the string for when an item in the specified slot is changed\n */\n this.ITEM_CHANGED = \"Item Changed\";\n\n this.items = [new PlaceableItem(new BearTrap(0,0,64,64, {\n \"url\":\"/assets/Traps/BearTrap/BearTrap.json\",\n \"offsetX\": 0,\n \"offsetY\": -32,\n \"ghost\": false\n }), \"/assets/Traps/BearTrap/trap_Animation1_1.png\")];\n this.currentSelected = 0;\n this.listeners = [];\n }", "title": "" }, { "docid": "00b663f9591c1f04849441d282b9fe48", "score": "0.5055623", "text": "constructor() {\n super();\n this.state = {number: 1, counter: 0};\n this.increase = this.increase.bind(this);\n this.tick = this.tick.bind(this);\n }", "title": "" }, { "docid": "9a0ac11285df05ac25b88afe2f981728", "score": "0.5049094", "text": "constructor(position, target) {\n\t\tsuper();\n\t\tthis.projectionMatrix = mat4.create();\n\t\tthis.viewMatrix = mat4.create();\n\n\t\tthis.position = position || [0, 0, 0];\n\t\tthis.target = target;\n\t\tthis.binormal = vec3.create();\n\t\t//\tthis.buildModelMatrix();\n\n\t\tthis.width = 7.5;\n\t\tthis.height = 5.0;\n\t\tthis.fov = 45;\n\t\tthis.aspectRatio = this.width / this.height;\n\t\tthis.near = 0.1;\n\t\tthis.far = 300.0;\n\n\t\tmat4.perspective(\n\t\t\tthis.projectionMatrix,\n\t\t\tthis.fov,\n\t\t\tthis.aspectRatio,\n\t\t\tthis.near,\n\t\t\tthis.far\n\t\t);\n\t\tmat4.lookAt(this.viewMatrix, this.position, this.target, this.UP);\n\n let behaviour = new Behaviour(this);\n behaviour.setUpdate(this.buildModelMatrix);\n this.addBehaviour(behaviour);\t}", "title": "" }, { "docid": "d57760894db271fe6f0f0dd701f4b2e5", "score": "0.503542", "text": "function Beercamper() {\n // properties\n this.levels = 7;\n this.distance3d = 1670;\n \n \n // cache some jQuery objects\n this.$window = $(window);\n this.$document = $(document);\n \n // which method should be used to return CSS transform styles\n this.getScrollTransform = Modernizr.csstransforms3d ? \n this.getScroll3DTransform : this.getScroll2DTransform;\n \n // bind constructor to window.scroll event\n if ( Modernizr.csstransforms ) {\n window.addEventListener( 'scroll', this, false);\n }\n \n}", "title": "" }, { "docid": "e937550e29be215c19142f174ccec2ca", "score": "0.50275373", "text": "function Other(xpos, ypos)\n{\n this.xpos = xpos;\n this.ypos = ypos;\n this.origX = xpos;\n this.origY = ypos;\n this.aura = undefined;\n this.color = undefined;\n this.origColor = undefined;\n\n this.width = 30;\n this.height = 30;\n\n this.xmove = random(0.7);\n this.ymove = random(-0.7, -0.05);\n\n this.interact = false;\n this.distance;\n\n this.auraParticles = [];\n\n this.assignAura = function()\n {\n var auraIndex = floor(random(0, auraColours.length));\n var otherAuraName = auraColourNames[auraIndex];\n var otherAuraColour = auraColours[auraIndex];\n this.aura = otherAuraName;\n this.color = otherAuraColour;\n this.origColor = otherAuraColour;\n }\n\n this.createAura = function()\n {\n //Create the aura for the Other\n for(var i = 0; i < 2; i++)\n {\n this.auraParticles.push(new Aura(this.xpos + random(-5, 5), \n this.ypos + random(-5,10), \n this.color.levels[0],\n this.color.levels[1],\n this.color.levels[2]));\n }\n\n for(var i = this.auraParticles.length-1; i >= 0; i--)\n {\n this.auraParticles[i].update();\n this.auraParticles[i].draw();\n\n if(this.auraParticles[i].dead())\n {\n this.auraParticles.splice(i, 1); //remove that aura particle\n }\n }\n }\n\n this.draw = function()\n {\n imageMode(CENTER);\n \n if(this.interact)\n {\n tint(this.color);\n }\n else\n {\n noTint();\n }\n \n if(this.xmove >= 0 && this.xmove > this.ymove)\n {\n if(this.aura == \"pink\")\n {\n animation(pinkRight, this.xpos, this.ypos);\n }\n else if(this.aura == 'green')\n {\n animation(greenRight, this.xpos, this.ypos);\n }\n else if(this.aura == 'blue')\n {\n animation(blueRight, this.xpos, this.ypos);\n }\n else if(this.aura == 'yellow')\n {\n animation(yellowRight, this.xpos, this.ypos);\n }\n }\n else if(this.xmove <= 0 && this.xmove < this.ymove)\n {\n if(this.aura == \"pink\")\n {\n animation(pinkLeft, this.xpos, this.ypos);\n }\n else if(this.aura == 'green')\n {\n animation(greenLeft, this.xpos, this.ypos);\n }\n else if(this.aura == 'blue')\n {\n animation(blueLeft, this.xpos, this.ypos);\n }\n else if(this.aura == 'yellow')\n {\n animation(yellowLeft, this.xpos, this.ypos);\n }\n }\n \n else if(this.ymove >= 0 && this.xmove <= this.ymove)\n {\n if(this.aura == \"pink\")\n {\n animation(pinkDown, this.xpos, this.ypos);\n }\n else if(this.aura == 'green')\n {\n animation(greenDown, this.xpos, this.ypos);\n }\n else if(this.aura == 'blue')\n {\n animation(blueDown, this.xpos, this.ypos);\n }\n else if(this.aura == 'yellow')\n {\n animation(yellowDown, this.xpos, this.ypos);\n }\n }\n else if(this.ymove <= 0 && this.xmove >= this.ymove)\n {\n if(this.aura == \"pink\")\n {\n animation(pinkUp, this.xpos, this.ypos);\n }\n else if(this.aura == 'green')\n {\n animation(greenUp, this.xpos, this.ypos);\n }\n else if(this.aura == 'blue')\n {\n animation(blueUp, this.xpos, this.ypos);\n }\n else if(this.aura == 'yellow')\n {\n animation(yellowUp, this.xpos, this.ypos);\n }\n }\n \n else\n {\n if(this.aura == \"pink\")\n {\n image(pinkStill, this.xpos, this.ypos);\n }\n else if(this.aura == 'green')\n {\n image(greenStill, this.xpos, this.ypos);\n }\n else if(this.aura == 'blue')\n {\n image(blueStill, this.xpos, this.ypos);\n }\n else if(this.aura == 'yellow')\n {\n image(yellowStill, this.xpos, this.ypos);\n }\n }\n \n }\n\n this.move = function()\n { \n this.xpos += this.xmove;\n this.ypos += this.ymove;\n var border = 50;\n\n if(this.xpos >= this.origX + border)\n {\n this.xmove = random(-0.7, -0.05);\n \n }\n if(this.xpos < this.origX - border)\n {\n this.xmove = random(0.7);\n }\n if(this.ypos >= this.origY + border)\n {\n this.ymove = random(-0.7, -0.05);\n }\n if(this.ypos < this.origY - border)\n {\n this.ymove = random(0.7);\n }\n }\n\n this.checkInteraction = function()\n {\n var d = dist(this.xpos, this.ypos, playerWorldPosX, playerWorldPosY);\n this.distance = d;\n\n //if the player is close enough to others set the others' interact to true\n if (this.distance < 30)\n {\n this.interact = true;\n }\n else\n {\n this.interact = false;\n }\n }\n}", "title": "" }, { "docid": "5462fa8afff2e37562958792d24991f8", "score": "0.502631", "text": "constructor() {\n super();\n // Properties\n this.property.trigger = 'ready';\n this.property.action = function() {};\n // Expand properties\n super.expand();\n }", "title": "" }, { "docid": "e82e3e0333472b1c8f704b6e636c64f9", "score": "0.5013752", "text": "constructor() {\n super();\n this.log = log;\n this.config = {};\n this.plugins = [];\n this.extensions = [];\n const originalFire = this.fire;\n\n // Overide Pebo.fire() to log calls\n this.fire = function() {\n const nbListeners = this.events[arguments[0]] ? this.eventslength : 0;\n this.log.trace('Event ' + arguments[0] + ' has been fired for ' + nbListeners + ' listeners');\n return originalFire.apply(this, arguments);\n }.bind(this);\n }", "title": "" }, { "docid": "963e96e41fad891af0b36a287bebb057", "score": "0.5011159", "text": "function BaseObservable() {}", "title": "" }, { "docid": "9db494689c41a8ac82ab063cad7a3814", "score": "0.5001517", "text": "activity() {\n return {\n tick(name) {},\n end() {}\n };\n }", "title": "" }, { "docid": "9db494689c41a8ac82ab063cad7a3814", "score": "0.5001517", "text": "activity() {\n return {\n tick(name) {},\n end() {}\n };\n }", "title": "" }, { "docid": "6f1a9212cbb40c6ce3c605da268d0fa1", "score": "0.49987453", "text": "constructor(fragment, behaviors) {\n this.fragment = fragment;\n this.behaviors = behaviors;\n /**\n * The data that the view is bound to.\n */\n this.source = null;\n /**\n * The execution context the view is running within.\n */\n this.context = null;\n this.firstChild = fragment.firstChild;\n this.lastChild = fragment.lastChild;\n }", "title": "" }, { "docid": "1520ab401e5794e623ceea3413aebe3d", "score": "0.49975258", "text": "constructor(fragment, behaviors) {\n this.fragment = fragment;\n this.behaviors = behaviors;\n /**\n * The data that the view is bound to.\n */\n\n this.source = null;\n /**\n * The execution context the view is running within.\n */\n\n this.context = null;\n this.firstChild = fragment.firstChild;\n this.lastChild = fragment.lastChild;\n }", "title": "" }, { "docid": "7bccf90aeffb6b6444c82345265aef98", "score": "0.49949712", "text": "function Vehicle(x, y) {\n /*takes in the x and y coordinates for the coordinate aka the bee hive the pos stores the vector\n position of each bee, the target is the hive and the vel and acc are for its movement the last\n two limit its movement*/\n this.pos = createVector(random(width), random(height));\n this.target = createVector(x, y);\n this.vel = p5.Vector.random2D();\n this.acc = createVector();\n this.maxspeed = 10;\n this.maxforce = 1;\n\n this.behaviors = function() {\n /*These are the bees behaviors like running at the hive, I kept flee to animate the bees around the hive\n Because the scalar for the flee is higher it runs away faster than it finds the hive so\n it keeps doing the dance around the hive.*/\n var arrive = this.arrive(this.target);\n var mouse = createVector(width / 5, height / 2.7);\n var flee = this.flee(mouse);\n\n arrive.mult(1);\n flee.mult(5);\n\n this.applyForce(arrive);\n this.applyForce(flee);\n }\n\n this.applyForce = function(f) {\n /*adds the vectors to make it speed up instead of a constant vel*/\n this.acc.add(f);\n }\n\n this.update = function() {\n /*updats the position and speed*/\n this.pos.add(this.vel);\n this.vel.add(this.acc);\n this.acc.mult(0);\n }\n\n this.show = function() {\n /*shows the bee as a black point*/\n stroke(0);\n strokeWeight(5);\n point(this.pos.x, this.pos.y);\n }\n\n\n this.arrive = function(target) {\n /*this is how it finds the hive d is how close we want to be to be satisfied,\n we then take the position relative to the hive on the screen to decide how fast the bee should\n fly. As you get closer the bee slows down*/\n var desired = p5.Vector.sub(target, this.pos);\n var d = desired.mag();\n var speed = this.maxspeed;\n if (d < 100) {\n speed = map(d, 0, 100, 0, this.maxspeed);\n }\n desired.setMag(speed);\n var steer = p5.Vector.sub(desired, this.vel);\n steer.limit(this.maxforce);\n return steer;\n }\n\n this.flee = function(target) {\n /*This is similar to arrive, but instead it pushes you away from the hive\n I made the radius smaller so it wouldn't be flying too far away and it would still concentrate\n round the hive*/\n var desired = p5.Vector.sub(target, this.pos);\n var d = desired.mag();\n if (d < 20) {\n desired.setMag(this.maxspeed);\n desired.mult(-1);\n var steer = p5.Vector.sub(desired, this.vel);\n steer.limit(this.maxforce);\n return steer;\n } else {\n return createVector(0, 0);\n }\n }\n}", "title": "" }, { "docid": "4efeb6da727ae3bc7707fcfc8d0aadeb", "score": "0.49913198", "text": "constructor() {\n super();\n this.addMethod(this.setMovePower);\n this.addMethod(this.setMaxVelocity);\n }", "title": "" }, { "docid": "40f012fee4c96e79352fc074c3847187", "score": "0.49911022", "text": "constructor() {\n super();\n this._bindEvents();\n }", "title": "" }, { "docid": "b247d26c4c30643ba1868e90c7a76c11", "score": "0.49879342", "text": "function sayRedBeh(message) {\n console.log('[SAYING]: red');\n this.behavior = sayBlackBeh;\n}", "title": "" }, { "docid": "65f9ac69b5e1f9ce76657d0cec28ec84", "score": "0.49763182", "text": "constructor(_position) {\n // console.log(\"Bee constructor\");\n super(_position);\n if (_position)\n this.position = _position;\n else\n this.position = new L11_FlowerMeadow_Advanced.Vector(650, 450);\n this.velocity = new L11_FlowerMeadow_Advanced.Vector(600, 0);\n this.velocity.random(150, 30);\n }", "title": "" }, { "docid": "618275a5b42fe491d233bd9eab4f733b", "score": "0.4973715", "text": "constructor(element, animator, domBoundary, acl) {\n this.acl = acl;\n this.element = element;\n this.animator = animator;\n this.domBoundary = domBoundary;\n }", "title": "" }, { "docid": "922fed2149ed16946a6a946d28219bb1", "score": "0.4963302", "text": "function Active(){}", "title": "" }, { "docid": "2e328ede8faf92ed3d7e0db8df07755b", "score": "0.4961404", "text": "function Activity() { }", "title": "" }, { "docid": "85a7b3fe7ad62898e0ee8866b441ae38", "score": "0.4960091", "text": "constructor() {\n super();\n\n /** \n * @private \n * @type {Array<Texture>} \n */\n this.mTextures = [];\n\n /** \n * @private \n * @type {Array<Particle>} \n */\n this.mParticles = [];\n\n /** \n * @private \n * @type {Array<Particle>} \n */\n this.mRecycled = [];\n\n /** \n * @private \n * @type {Array<Modifier>} \n */\n this.mInitializers = [];\n\n /** \n * @private \n * @type {Array<Modifier>} \n */\n this.mActions = [];\n\n /** \n * @private \n * @type {GameObject} \n */\n this.mSpace = null;\n\n /** \n * @private \n * @type {boolean} \n */\n this.mIsLocal = true;\n\n /** \n * @private \n * @type {number} \n */\n this.mMaxParticles = 10000;\n\n /** \n * @private \n * @type {FloatScatter} \n */\n this.mEmitCount = new FloatScatter(10);\n\n /** \n * @private \n * @type {FloatScatter} \n */\n this.mEmitNumRepeats = new FloatScatter(0, Number.MAX_SAFE_INTEGER);\n\n /** \n * @private \n * @type {number} \n */\n this.mEmitNumRepeatsLeft = this.mEmitNumRepeats.getValue();\n\n /** \n * @private \n * @type {FloatScatter} \n */\n this.mEmitDuration = new FloatScatter(1 / 60);\n\n /** \n * @private \n * @type {number} \n */\n this.mEmitDurationLeft = this.mEmitDuration.getValue();\n\n /** \n * @private \n * @type {FloatScatter} \n */\n this.mEmitInterval = new FloatScatter(1 / 60);\n\n /** \n * @private \n * @type {number} \n */\n this.mEmitIntervalLeft = this.mEmitInterval.getValue();\n\n /** \n * @private \n * @type {FloatScatter} \n */\n this.mEmitDelay = new FloatScatter(1);\n\n /** \n * @private \n * @type {number} \n */\n this.mEmitDelayLeft = this.mEmitDelay.getValue();\n\n /** \n * @private \n * @type {number} \n */\n this.mNextUpdateAt = 0;\n\n /** \n * @private \n * @type {EmitterState} \n */\n this.mState = EmitterState.PENDING;\n\n /** \n * @private \n * @type {Matrix} \n */\n this.__tmpLocal = new Matrix();\n\n /** \n * @private \n * @type {Matrix} \n */\n this.__tmpWorld = new Matrix();\n\n /** \n * @private \n * @type {EmitterSortOrder} \n */\n this.mSortOrder = EmitterSortOrder.FRONT_TO_BACK;\n\n /**\n * @private\n * @type {Array<string>|null}\n */\n this.mTextureNames = null;\n\n /**\n * @private\n * @type {number}\n */\n this.mPresimulateSeconds = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.mCurrentPresimulationTime = 0;\n }", "title": "" }, { "docid": "7badf44a5b8900b299a207bf0dbf9d38", "score": "0.4958699", "text": "run() {\n this._move()\n this._decay()\n }", "title": "" }, { "docid": "980a792f088bd8c642a23f5c343f2502", "score": "0.49585095", "text": "constructor(options, element) {\n super(options, element);\n this.isBlazorTooltip = false;\n this.contentTargetValue = null;\n this.contentEvent = null;\n this.contentAnimation = null;\n }", "title": "" }, { "docid": "25fad799e25c177d62f11569ce30297f", "score": "0.49578255", "text": "act() {\n this.moveBy(this.velocity)\n handleFlickering(this)\n }", "title": "" }, { "docid": "f8108b87f7a271d36e22013ef7b19751", "score": "0.4957679", "text": "get bending() {\n return { \n position: { max: 4.0 },\n angularVelocity: { percent: 0.0 }\n };\n }", "title": "" }, { "docid": "f5a87e053b9bca88f72fa5f65255d744", "score": "0.4953053", "text": "run(){\n // This function will implement in sub class\n }", "title": "" }, { "docid": "6690e3064898c145aadb7887bd12685f", "score": "0.49478948", "text": "constructor(props){\n super(props);\n this.play = this.play.bind(this);\n this.AI = new AI({playCallback:this.play});\n this.aiplay = this.aiplay.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.onGameModeSwitchChange = this.onGameModeSwitchChange.bind(this);\n this.resetBoard = this.resetBoard.bind(this);\n this.state={first:0,victory:0,gameMode:0,turn:0,boardState:getZeros()}\n }", "title": "" }, { "docid": "0c8ab70962b904fc95a4a18fdd60f05b", "score": "0.49438146", "text": "function BehaviorTriggersBuilder(view, behaviors) {\n this._view = view;\n this._behaviors = behaviors;\n this._triggers = {};\n }", "title": "" } ]
bd86f23890059a65716ae865cf9e494e
Top level functions make requests for the ham and spam dictionaries
[ { "docid": "2859c8cd112005b355542145466c18b3", "score": "0.0", "text": "function getHam(){\n\t\t$.ajax({\n url: '/ham',\n type: 'get',\n dataType: 'json',\n async: false,\n success: function(data) {\n result = data;\n }\n });\n return result;\n\n\t}", "title": "" } ]
[ { "docid": "8a9cf70902dcb7f65679abe7e20c1768", "score": "0.5535709", "text": "function main(){\t \t\n\tvar G = new Array();\n\tredisClient.keys(\"PaloRequest*\",function(err,data){\t\t// Read all requests from Redis Database\n\t\tG['arrKeys']=data;\n\t\tif(data.length >=1){\n\t\t\tprocess(0,G);\t\t\t\t\t\t\t\t\t// Asynchronous processing each requests\n\t\t}else {\n\t\t\tsetTimeout(main,TIME_RESTART);\t\t\t\t\t// Restart this script after TIME_RESTART milliseconds\n\t\t}\t\t\n\t});\t\t\n}", "title": "" }, { "docid": "8b4188e70c281805ba9fb06b0a39caf2", "score": "0.54852015", "text": "function getRequest()\n{ \n //construct URL encode header to be request on app.js server side\n //include '#' 'FROM:' '@' with AND/OR operators plus the since ID for controling new stream tweet\n if(authorname=='' && mentioned!=''){\n var url = '/api/search/' +hashtag+' '+checkboxhash+' '+mentioned+' '+anyword+'/'+sinceID+'/'+resultType;\n }\n else if(mentioned=='' && authorname!=''){\n var url = '/api/search/' +hashtag+' '+checkboxhash+' '+authorname+' '+anyword+'/'+sinceID+'/'+resultType;\n }\n else if (authorname=='' && mentioned==''){\n var url = '/api/search/' +hashtag+' '+anyword+'/'+sinceID+'/'+resultType;\n }\n else{\n var url = '/api/search/' +hashtag+' '+checkboxhash+' '+authorname+' '+checkboxauthor+' '+mentioned+' '+anyword+'/'+sinceID+'/'+resultType;\n }\n\n //instance of request headers\n xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.send();\n xhr.onreadystatechange = function() \n {\n //check on server respond status OK then start processing the JSON obejcts\n if (this.status == 200 && this.readyState == 4) \n {\n //parse JSON object for deserialization\n myArr = JSON.parse(this.responseText);\n //console.log(\"original JSON\");\n //console.log(myArr);\n\n infoDBDiv = document.getElementById(\"dbinfo-results\");\n tweetCount+=myArr.statuses.length;\n infoDBDiv.innerHTML = \"Live Tweet: \"+ tweetCount + \"<br>Tweet Cache From DB: \" + tweetDBCount;\n \n \n myArr.statuses.reverse();\n sinceID = myArr.search_metadata.max_id_str;\n\n //send for box tweet display construction\n setTweet(); \n\n //send data for author top 10 ranking and word processing count\n //and print out on interface\n if(myArr.statuses.length!=0){\n authorArr.sort();\n authorWord = objCount(authorArr).slice(0,10);\n displaySubCount(subCount(myArr,authorWord),'authorBox','olAuthor',10,authorWord);\n }\n\n //send for general word count for whole collection\n //and print out on interface\n wordArr.sort();\n displayCount(objCount(wordArr),'analysisBox','olAnalysis',20); \n }\n //handling for bad response form server \n else if (this.status == 404){ \n showAlertDiv('404 - Oops. Something went wrong.');\n }\n };\n }", "title": "" }, { "docid": "ce6a549e0b92f49ffd60766178a429a9", "score": "0.53965926", "text": "hits(wasp) {\n\n }", "title": "" }, { "docid": "fb2cb23747a5e93f2260ce3ae1312878", "score": "0.5377302", "text": "function hmget() {\n}", "title": "" }, { "docid": "ebdb8e67dc64bb24b98eaf4a7188083b", "score": "0.5364977", "text": "function main(){\t \t\n\tvar G = new Array();\n\tredisClient.keys(\"PaloRequest*\",function(err,data){\n\t\tG['arrKeys']=data;\n\t\tif(data.length >=1){\n\t\t\tprocess(0,G);\n\t\t}else {\n\t\t\tconsole.log(\"Null\");\n\t\t\tsetTimeout(main,TIME_REPLAY);//3600000\n\t\t}\t\t\n\t});\t\t\n}", "title": "" }, { "docid": "f24ebbae7d48f122cbbca52813a1a470", "score": "0.53525436", "text": "function hashLookup() { // Retrieves scan results using a data hash\n console.log(\"Checking if hash exists in cache\");\n\n const options = {\n \"method\": \"GET\",\n \"hostname\": \"api.metadefender.com\",\n \"path\": `/v4/hash/${hash}`,\n \"headers\": {\n \"apikey\": process.env.APIKEY // Note: Your APIKEY should be in .env file\n }\n };\n\n const req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n\n try {\n const scanned_obj = JSON.parse(body);\n if (scanned_obj.scan_results) { // Hash found: displays results\n console.log(\"Hash found in cache!\");\n console.log('Retrieving scan results using a data hash...');\n showScanResult(scanned_obj); // showScanResult function will display the scan result\n }\n\n else if (scanned_obj.error) { // Hash not found: upload the file\n console.log(\"Hash not found! Uploading file for scanning...\");\n uploadFileToScan(filename); // uploadFileToScan function will upload the file and get the dataId\n }\n }\n\n catch(e) {\n console.log(e);\n }\n });\n });\n\n req.end();\n}", "title": "" }, { "docid": "cd8eb4ea793ea03fbdf404bb9c4ec365", "score": "0.5319273", "text": "function doStuff(processName, query){\n\tif(processName === 'spotify-this-song'){\n\t\tif(query === undefined){\n\t\t\tquery = 'The Sign Ace';\n\t\t}\n\t\tvar spotify = new Spotify({\n\t\t\tid: apiKeys.spotifyKeys.clientID,\n\t\t\tsecret: apiKeys.spotifyKeys.clientSecret\n\t\t});\n\t\tspotify.search({type: 'track', query: query}, function(err, data){\n\t\t\tif(err){\n\t\t\t\treturn console.log('Error ' + err);\n\t\t\t}\n\t\t\trequestData.artists = [];\n\t\t\trequestData.songName = data.tracks.items[0].name;\n\t\t\trequestData.url = data.tracks.items[0].external_urls.spotify;\n\t\t\trequestData.album = data.tracks.items[0].album.name;\n\t\t\tfor (var i = 0; i < data.tracks.items[0].artists.length; i++){\n\t\t\t\trequestData.artists.push(data.tracks.items[0].artists[i].name);\n\t\t\t\tconsole.log(\"Artist: \" + requestData.artists[i]);\n\t\t\t}\n\t\t\tconsole.log(\"Song: \" + requestData.songName + \"\\nPreview Link: \" + requestData.url + \"\\nAlbum: \" + requestData.album);\n\t\t\tlogData();\n\t\t})\n\t}\n\telse if(processName === 'my-tweets'){\n\t\tvar userName = {screen_name: 'umerjrathore'};\n\t\tvar twitter = new Twitter({\n\t\t\tconsumer_key: apiKeys.twitterKeys.consumer_key,\n\t\t\tconsumer_secret: apiKeys.twitterKeys.consumer_secret,\n\t\t\taccess_token_key: apiKeys.twitterKeys.access_token_key,\n\t\t\taccess_token_secret: apiKeys.twitterKeys.access_token_secret\n\t\t});\n\t\ttwitter.get('statuses/user_timeline', userName, function(error, tweets, response){\n\t\t\tif(!error){\n\t\t\t\tvar requestedTweets = parseInt(query);\n\t\t\t\tvar numTweets = 0;\n\t\t\t\t/*The logic for the user defined number of Tweets checks if the user actually entered a query and, if they did, that it is actually a number. If the user did not enter a number, then the default return number of tweets is 20, unless the number of tweets in the returned request is less than 20, then the number of tweets to return is the length of the tweets array returned from the request. \n\n\t\t\t\tIf the user did input a number greater than 0, then it is checked against the length of the returned tweets array. If the tweets array's length is greater than the user requested number of tweets, then we know that we have enough tweets to show the user. Another additional check limits the total number of tweets shown to the user to be 20 or less. If the user inputs a number greater than the length of the tweets array, then, if the tweets array length is 20 or more, then the number of returned tweets is 20. If the tweets array length is less than 20, then the number of returned tweets is the length of the tweets array.*/\n\t\t\t\tif(query != undefined && requestedTweets != 'NaN' && requestedTweets > 0){\n\t\t\t\t\tif(tweets.length >= requestedTweets){\n\t\t\t\t\t\tif(requestedTweets < 20){\n\t\t\t\t\t\t\tnumTweets = requestedTweets;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tnumTweets = 20;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(tweets.length >= 20){\n\t\t\t\t\t\tnumTweets = 20;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tnumTweets = tweets.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(tweets.length < 20){\n\t\t\t\t\t\tnumTweets = tweets.length;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tnumTweets = 20;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trequestData.tweets = [];\n\t\t\t\tfor (var i = 0; i < numTweets; i++){\n\t\t\t\t\trequestData.tweets.push(tweets[i].text)\n\t\t\t\t\tconsole.log(\"Tweet number \" + (i+1) + \": \" + requestData.tweets[i]);\n\t\t\t\t}\n\t\t\t\tlogData();\n\t\t\t}\n\t\t})\n\t}\n\telse if(processName === 'movie-this'){\n\t\tif(query === undefined){\n\t\t\tquery = \"Mr. Nobody\";\n\t\t}\n\t\tvar movieName = query.split(\" \").join(\"+\");\n\t\tvar omdbURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=40e9cece\"\n\t\tomdb(omdbURL, function(error, response, body){\n\t\t\tif (!error && response.statusCode === 200) {\n\t\t\t\trequestData.title = JSON.parse(body).Title;\n\t\t\t\trequestData.year = JSON.parse(body).Year;\n\t\t\t\trequestData.imdb = JSON.parse(body).Ratings[0].Value;\n\t\t\t\trequestData.rt = JSON.parse(body).Ratings[1].Value;\n\t\t\t\trequestData.country = JSON.parse(body).Country;\n\t\t\t\trequestData.language = JSON.parse(body).Language;\n\t\t\t\trequestData.plot = JSON.parse(body).Plot;\n\t\t\t\trequestData.actors = JSON.parse(body).Actors;\n\t\t\t\tconsole.log(\"Title: \" + requestData.title + \"\\nRelease Year: \" + requestData.year + \"\\nIMDB Rating: \" + requestData.imdb + \"\\nRotten Tomato Score: \" + requestData.rt + \"\\nProduction Country: \" + requestData.country + \"\\nMovie Language: \" + requestData.language + \"\\nActors: \" + requestData.actors + \"\\nMovie Plot: \" + requestData.plot);\n\t\t\t\tlogData();\n\t\t\t}\n\t\t})\n\t}\n\telse{\n\t\tconsole.log(\"Please enter a valid command.\");\n\t}\n}", "title": "" }, { "docid": "af4bf1157327c0a0cea448471dd8cbf9", "score": "0.5312118", "text": "function to_catch_rates(){\t\r\n\r\n\t//Tell users we are starting...\r\n\t$('#mhizer_autopost').val('Getting data...');\r\n\r\n\tGM_xmlhttpRequest({\r\n\t\tmethod: 'GET',\r\n\t\turl: 'http://apps.facebook.com/mousehunt/',\r\n\t\theaders: {\r\n\t\t\t\t'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',\r\n\t\t\t\t'Content-type':'application/x-www-form-urlencoded',\r\n\t\t},\r\n\t\tonload: function(response_xhr) {\r\n\t\t\tvar response_html = response_xhr.responseText;\t\t\t\t\r\n\t\t\t//var _trap=0, _base=1, _location=2, _cheese=3, _title=4, _cheese=5, _shield=6, _status=7;\t\t\t\t\r\n\t\t\tvar hunter_data = get_hunter_data(response_html);\r\n\t\t\tvar _found_trap=false, _found_base=false, _found_location=false, _found_cheese=false, _found_shield=false;\r\n\t\t\t\r\n\t\t\tif(hunter_data[_status] == \"KINGS REWARD\"){\r\n\t\t\t\talert(\"Please claim your King's Reward!\");\r\n\t\t\t\t$('#mhizer_autopost').val('MHizer - AutoPost data');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if(hunter_data[_status] == \"MAINTENANCE\"){\r\n\t\t\t\talert(\"MouseHunt is undergoing maintenance, so your details couldn't be retrieved.\");\r\n\t\t\t\t$('#mhizer_autopost').val('MHizer - AutoPost data');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if(hunter_data[_status] == \"NOT SIGNED IN\"){\r\n\t\t\t\talert(\"You need to be signed in to Facebook to retrieve data.\");\r\n\t\t\t\t$('#mhizer_autopost').val('MHizer - AutoPost data');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Trap\r\n\t\t\t$('#traps0 option').each(function(){\t\t\t\t\t\r\n\t\t\t\t\t$(this).attr('selected', false);\t\t\t\t\r\n\t\t\t});\t\t\t\t\r\n\t\t\t$('#traps0 option').each(function(){\r\n\t\t\t\tvar $this = $(this);\t\t\t\t\t\r\n\t\t\t\tvar option_text = $this.text().toLowerCase();\t\t\t\t\t\r\n\t\t\t\tif(option_text == hunter_data[_trap]){\r\n\t\t\t\t$this.attr('selected', true);\r\n\t\t\t\t_found_trap=true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Base\r\n\t\t\t$('#bases0 option').each(function(){\t\t\t\t\t\r\n\t\t\t\t\t$(this).attr('selected', false);\t\t\t\t\r\n\t\t\t});\t\t\t\t\r\n\t\t\t$('#bases0 option').each(function(){\r\n\t\t\t\tvar $this = $(this);\t\t\t\t\t\r\n\t\t\t\tvar option_text = $this.text().toLowerCase();\t\t\t\t\t\r\n\t\t\t\tif(option_text == hunter_data[_base]){\r\n\t\t\t\t$this.attr('selected', true);\r\n\t\t\t\t_found_base=true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Location\r\n\t\t\t$('#locations0 option').each(function(){\t\t\t\t\t\r\n\t\t\t\t\t$(this).attr('selected', false);\t\t\t\t\r\n\t\t\t});\t\t\t\t\r\n\t\t\t$('#locations0 option').each(function(){\r\n\t\t\t\tvar $this = $(this);\t\t\t\t\t\r\n\t\t\t\tvar option_text = $this.text().toLowerCase();\t\t\t\t\t\r\n\t\t\t\tif(option_text == hunter_data[_location]){\r\n\t\t\t\t$this.attr('selected', true);\r\n\t\t\t\t_found_location=true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Cheese\r\n\t\t\t$('#cheese0 option').each(function(){\t\t\t\t\t\r\n\t\t\t\t\t$(this).attr('selected', false);\t\t\t\t\r\n\t\t\t});\t\t\t\t\r\n\t\t\t$('#cheese0 option').each(function(){\r\n\t\t\t\tvar $this = $(this);\t\t\t\t\t\r\n\t\t\t\tvar option_text = $this.text().toLowerCase();\t\t\t\t\t\r\n\t\t\t\tif(option_text == hunter_data[_cheese]){\r\n\t\t\t\t$this.attr('selected', true);\r\n\t\t\t\t_found_cheese=true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//Shield\r\n\t\t\t$('#shield0 option').each(function(){\t\t\t\t\t\r\n\t\t\t\t\t$(this).attr('selected', false);\t\t\t\t\r\n\t\t\t});\t\t\t\t\r\n\t\t\t$('#shield0 option').each(function(){\r\n\t\t\t\tvar $this = $(this);\t\t\t\t\t\r\n\t\t\t\tvar option_text = $this.text().toLowerCase();\t\r\n\t\t\t\tif(option_text == hunter_data[_shield]){\r\n\t\t\t\t$this.attr('selected', true);\r\n\t\t\t\t_found_shield=true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar error='';\r\n\t\t\t\r\n\t\t\tif(_found_trap==false){\r\n\t\t\t\t$('#traps0 option:first').attr('selected', true);\t\r\n\t\t\t\terror += \"Couldn't find the trap '\"+hunter_data[_trap]+\"'\\n\";\r\n\t\t\t}\r\n\t\t\tif(_found_base==false){\r\n\t\t\t\t$('#bases0 option:first').attr('selected', true);\t\r\n\t\t\t\terror += \"Couldn't find the base '\"+hunter_data[_base]+\"'\\n\";\r\n\t\t\t}\r\n\t\t\tif(_found_location==false){\r\n\t\t\t\t$('#locations0 option:first').attr('selected', true);\t\r\n\t\t\t\terror += \"Couldn't find the location '\"+hunter_data[_location]+\"'\\n\";\r\n\t\t\t}\r\n\t\t\tif(_found_cheese==false){\r\n\t\t\t\t$('#cheese0 option:first').attr('selected', true);\t\r\n\t\t\t\terror += \"Couldn't find the cheese '\"+hunter_data[_cheese]+\"'\\n\";\r\n\t\t\t}\r\n\t\t\tif(_found_shield==false){\r\n\t\t\t\t$('#shield0 option:first').attr('selected', true);\t\r\n\t\t\t\terror += \"Couldn't find the shield '\"+hunter_data[_shield]+\"'\\n\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(error != \"\")\r\n\t\t\t\talert(error +\"\\n\\nPlease report these errors to rohan[at]furoma.com\");\r\n\t\t\t\t\r\n\t\t\t//Restore the button\t\t\t\t\r\n\t\t\t$('#mhizer_autopost').val('MHizer - AutoPost data');\r\n\t\t\t\r\n\t\t\tunsafeWindow.mhizer_gen();\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\t\t\t\r\n\r\n}", "title": "" }, { "docid": "e70cd6bbeff9dfd0a944c1cf95a9fa95", "score": "0.53076345", "text": "function request_bestseller_information(user_input, res) {\n const endpoint = `http://api.nytimes.com/svc/books/v3/lists.json?api-key=${NYT_credentials[\"api-key\"]}&list=${user_input.genre}&published-date=${user_input.daterange}`;\n const books_request = http.get(endpoint, { method: \"GET\" });\n books_request.once(\"response\", process_stream);\n books_request.end();\n function process_stream(books_stream) {\n let books_data = \"\";\n books_stream.on(\"data\", (chunk) => (books_data += chunk));\n books_stream.on(\"end\", () => {\n let books_object = JSON.parse(books_data);\n if (books_object.num_results === 0) {\n res.writeHead(404, { \"Content-Type\": \"text/plain\" });\n res.write(\"404 Not Found\");\n res.end();\n } else {\n isbn = books_object.results[0].isbns[0].isbn10;\n write_Bestseller_Cache(user_input, isbn);\n request_ebay_information(isbn, res);\n }\n });\n }\n}", "title": "" }, { "docid": "1cd4c5fc59e5fecc22893892f9724abb", "score": "0.5273955", "text": "function emailWater_Request() {\n}", "title": "" }, { "docid": "8240d7cb0b5fdcdb2d11eb74af5685c4", "score": "0.525315", "text": "async function h2hFunction(req, res) {\n let { match_hometeam_name, match_awayteam_name } = req.query;\n let key = process.env.SOCCER_API_KEY;\n const url = `https://apiv2.apifootball.com/?action=get_H2H&firstTeam=${match_hometeam_name}&secondTeam=${match_awayteam_name}&APIkey=${key}`;\n let h2hAgent = await superagent.get(url).then((data) => {\n return data.body.firstTeam_VS_secondTeam.map((match) => {\n return new H2hResult(match);\n });\n });\n let matchId = h2hAgent[0].match_id;\n let teamsBadge = await getBadge(matchId);\n res.render('pages/h2hResult', {\n matchArray: h2hAgent,\n badges: teamsBadge,\n });\n}", "title": "" }, { "docid": "c1c38efafe0c3743819ccf15a38b1ada", "score": "0.5218096", "text": "function at_hermit() {\r\n\t$('img').each(function() {\r\n\t\tvar onclick = this.getAttribute('onclick');\r\n\t\tif (onclick != undefined && onclick.indexOf(\":item\") != -1)\t// Hermit calls js:item(descid) instead of js:descitem(descid)\r\n\t\t{\r\n\t\t\tvar newclick = onclick.split(':')[0] + \":desc\" + onclick.split(':')[1];\r\n\t\t\tthis.setAttribute('onclick',newclick);\r\n\t\t\tAddInvCheck(this);\r\n\t\t}\r\n\t});\r\n\tif (GetPref('shortlinks') > 1) {\r\n\t\tvar p = $('p:first');\r\n\t\tvar txt = $('body').text();\r\n\t\tif (txt.indexOf(\"Hermit Permit required,\") != -1) {\t\t\t// no permit\r\n\t\t\tvar a = $('b:eq(1)');\r\n\t\t\ta.parent().prepend('<br>' + AppendBuyBox(42, 'm', 'Buy Permit', 1)+'<br>');\r\n\t\t}\r\n\t\telse if (txt.indexOf(\"disappointed\") != -1)\t{\t\t\t// no trinkets\r\n\t\t\tGM_get(server+'api.php?what=inventory&for=MrScript',function(response) {\t\t// Check gum and permit counts.\r\n\t\t\t\tvar invcache = $.parseJSON(response);\r\n\t\t\t\tvar gum = invcache[23]; if (gum === undefined) gum = 0;\r\n\t\t\t\tgum = integer(gum);\r\n\t\t\t\tvar hpermit = invcache[42]; if (hpermit === undefined) hpermit = 0;\r\n\r\n\t\t\t\tif (gum == 0) {\r\n\t\t\t\t\tp.get(0).innerHTML += '<br><br>' + AppendBuyBox(23, 'm', 'Buy Gum', 0);\r\n\t\t\t\t}\r\n\t\t\t\tp.append('<br><br><center><font color=\"blue\">You have '+(gum==0?\" no \":gum)+(gum!=1?\" gums \":\" gum \")\r\n//\t\t\t\t\t+\" and \"+(hpermit==0?\" no \":hpermit)+(hpermit!=1?\" permits \":\" permit \")\r\n\t\t\t\t\t+\"in inventory.</font></center><br>\");\r\n\t\t\t\tswitch (gum) {\r\n\t\t\t\tcase 0: //do nothing\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tp.append('<br><center><a href=\"'+inv_use(23)+'\">Use a chewing gum</a></center>');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tp.append('<br><center><a href=\"multiuse.php?whichitem=23&quantity=2&action=useitem&pwd='\r\n\t\t\t\t\t\t\t+pwd+'\">Use 2 chewing gums</a></center>');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tp.append('<br><center><a href=\"multiuse.php?whichitem=23&action=useitem&quantity=3&pwd='\r\n\t\t\t\t\t\t\t+pwd+'\">Use 3 chewing gums</a></center>');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar tr = $('table:first tr:contains(\"Results\")');\r\n\t\tif (tr.next().text().indexOf(\"You acquire\") != -1) {\r\n\t\t\tvar descId = $('img:first').get(0).getAttribute('onclick');\r\n\t\t\tvar bText = $('b:eq(1)').attr('valign','baseline');\r\n\t\t\tif (bText.text().indexOf(\"ten-leaf clovers\") != -1) {\r\n\t\t\t\tvar num = integer(bText.text().split(\" ten-leaf\")[0]);\r\n\t\t\t\tbText.parent().append(AppendLink('[disassemble]', 'multiuse.php?pwd=' +\r\n\t\t\t\tpwd + '&action=useitem&quantity=' + num + '&whichitem=24'));\r\n\t\t\t}\r\n\t\t\telse AddLinks(descId, bText.parent().parent().get(0), p, thePath);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "24ec08316fe23f935de8eabaf94791bb", "score": "0.51946205", "text": "function hmset() {\n}", "title": "" }, { "docid": "a9d70a4005529ad3fce256b4b1667404", "score": "0.51945764", "text": "function SendRequest(action, query) {\n\t if (query.length != 0) {\n\t \t var url = path + '?action=' + action + '&key=' + key\n\t\t + '&query=' + JSON.stringify(query);\n\t} else {\n\t \t var url = path + '?action=' + action + '&key=' + key;\n\t}\t\t \n\tconsole.log('url:, ' + url);\n\tvar get_options = {\n \t host: 'www.volunteermatch.org',\n \t path: url,\n \t };\t \n\n\n var get_req = http.get(get_options, function(res) {\n console.log('STATUS: ' + res.statusCode);\t \n console.log('HEADERS: ' + JSON.stringify(res.headers)); \n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n console.log('Response: ' + chunk);\n\t return chunk;\n \t});\n });\n \n // for debugging\n get_req.on('error', function(e) {\n \t console.log(\"Got error: \" + e.message);\n\t});\n console.log('host :' + get_options.host); \n return -1;\n}", "title": "" }, { "docid": "f4bccff0beb5a0645e7f6fac4b3b9e36", "score": "0.51802474", "text": "function oig(req, res) {\n /**\n * This is the response data.\n */\n var data = {};\n\n /**\n * The container to keep persistant cookies from our requests.\n */\n var cookieJar = request.jar();\n\n /**\n * The fields required from the prefetch request.\n */\n var prefetchFields = [\n '__VIEWSTATE',\n '__VIEWSTATEGENERATOR',\n '__EVENTVALIDATION'\n ];\n\n /**\n * Inelegant, but used to track the 3 promises needed\n */\n var prefetchDeferred = [\n Q.defer(),\n Q.defer(),\n Q.defer()\n ];\n\n /**\n * The promise array for the prefetch.\n */\n var prefetchPromises = [];\n\n /**\n * The html parser to use for the prefetch response.\n *\n * @var htmlparser2.Parser\n */\n var prefetchParser = new htmlparser.Parser({\n onopentag: function(name, attribs) {\n var indexOfField;\n if (_.contains(prefetchFields, attribs.id)) {\n indexOfField = _.indexOf(prefetchFields, attribs.id);\n prefetchDeferred[indexOfField].resolve(attribs);\n }\n },\n ontext: function (text) {\n // Not needed\n },\n onclosetag: function (tagname) {\n // Not needed\n }\n }, {decodeEntities: true});\n\n /**\n * The html parser to use to look for any results for the given name.\n *\n * @var htmlparser2.Parser\n */\n var resultParser = new htmlparser.Parser({\n onopentag: function(name, attribs) {\n if (attribs.class === \"searched-name\") {\n console.log(attribs);\n }\n },\n ontext: function (text) {\n },\n onclosetag: function (tagname) {\n }\n });\n\n // Setup our wrappered request object with default header values.\n request = request.defaults({\n jar: cookieJar,\n headers: {\n 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36'\n }\n });\n\n // Validation of endpoint request.\n if (validation(req) !== null) {\n res.status(400).send(validation(req));\n }\n\n // Start the fetch chain to oig.\n request('https://exclusions.oig.hhs.gov/', function(error, response, body) {\n /**\n * Initialize the prefetch promise mechanism.\n */\n _.each(prefetchDeferred, function(element, index, list) {\n prefetchPromises[index] = element.promise;\n });\n\n if (!error && response.statusCode === 200) {\n prefetchParser.write(body);\n prefetchParser.end();\n\n Q.allSettled(prefetchPromises)\n .then(function (results) {\n var prefetchParams = _.map(results, function(item){ return item.value });\n fullRequest(assembleParams(prefetchParams))\n .then(function(data) {\n // Find any entries\n //\n resultParser.write(data);\n resultParser.end();\n res.send(data);\n });\n });\n } else {\n res.status(500).send(error);\n }\n });\n\n /**\n * This pulls together all of the required parameters that we need for the search post.\n *\n * @param Object prefetch This is the fields we previously scraped from the starting page.\n *\n * @return Object The finalized post parameters.\n */\n function assembleParams(prefetch) {\n var paramList = {};\n\n // Map the dynamic values that we had to scrape from the starting page.\n _.each(prefetch, function(element) {\n paramList[element.id] = element.value;\n });\n\n /**\n * These are the settable fields for the request's post.\n */\n paramList['__EVENTTARGET'] = '';\n paramList['__EVENTARGUMENT'] = '';\n paramList['__SCROLLPOSITIONX'] = 0;\n paramList['__SCROLLPOSITIONY'] = 0;\n paramList['ctl00$cpExclusions$txtSPLastName'] = req.query.lastName;\n paramList['ctl00$cpExclusions$txtSPFirstName'] = req.query.firstName;\n\n // This is the anti-bot portion of the request. The OIG site posts what the coords\n // are for the button push (where on the button you clicked). We make this random\n // in an attempt to fool the app.\n paramList['ctl00$cpExclusions$ibSearchSP.x'] = Math.floor((Math.random() * 80) + 1);\n paramList['ctl00$cpExclusions$ibSearchSP.y'] = Math.floor((Math.random() * 24) + 1);\n\n return paramList;\n };\n\n /**\n * The main controller for the full request for individual OIG info.\n *\n * @param Object reqParams The main parameters to use for the request.\n *\n * @return Promise The promised results.\n */\n function fullRequest(reqParams) {\n // Create our promise structure.\n var fullDeferred = Q.defer();\n\n // Build request.\n var options = {\n url: 'https://exclusions.oig.hhs.gov',\n uri: '/default.aspx',\n method: 'POST',\n headers: [\n {\n name: 'content-type',\n value: 'application/x-www-form-urlencoded'\n }\n ],\n postData: {\n mimeType: 'aplication/x-www-form-urlencoded',\n params: reqParams\n }\n };\n\n // Fire main request function (which will recursively handle redirects).\n dataRequest(options.url, options.uri, reqParams, fullDeferred);\n\n return fullDeferred.promise;\n }\n\n /**\n * The raw data request for a specific name.\n *\n * @param String url The url (without trailing slash) of the OIG site.\n * @param String uri The endpoint to post to.\n * @param Object reqParams The post params to use for the request.\n * @param Promise reqDeferred The promise to use for resolving or rejecting.\n *\n * @return void The return is handled by the promise passed in.\n */\n function dataRequest(url, uri, reqParams, reqDeferred) {\n // Fire main request.\n request.post(url + uri, {form: reqParams}, function(error, response, body) {\n // Make sure we handle redirects gracefully and set a base rule for recursion.\n if (response.statusCode >= 300 && response.statusCode < 400) {\n // RECURSION!\n dataRequest(url, response.headers.location, reqParams, reqDeferred);\n } else {\n if (!error) {\n reqDeferred.resolve(body);\n } else {\n console.log(error);\n reqDeferred.resolve(error);\n }\n }\n });\n }\n}", "title": "" }, { "docid": "ccd08469fd7fdfab72e354c513d50526", "score": "0.51685023", "text": "function processKh(data) {\n putToMap(khMap['remoteDoor'], processVars(data['remoteDoorLock']) );\n putToMap(khMap['remoteStart'], processVars(data['remoteStart']) );\n putToMap(khMap['curfew'], processVars(data['curfewPrefSetNotif']) );\n putToMap(khMap['geofence'], processVars(data['geoFencePrefSetNotif']) );\n putToMap(khMap['speed'], processVars(data['speedPrefSetNotif']) );\n putToMap(khMap['oilChange'], processVars(data['oilChange']) );\n\n // KH Alerts come in a csv of S,P,E\n function processVars(flags) {\n if (flags) {\n return {\n 'sms':flags.indexOf('S') !== -1,\n 'push':flags.indexOf('P') !== -1,\n 'email':flags.indexOf('E') !== -1\n };\n } else {\n return {'sms':false,'push':false,'email':false};\n }\n }\n }", "title": "" }, { "docid": "d6d7dfb78b5f94aec133665b0a61b81c", "score": "0.51036286", "text": "async function reqAPI(world) {\n var players_res = await got(`${c.api}/players.php?world=${world}`) // Gather data from players.php\n var playerkillsall_res = await got(`${c.api}/playerKillsAll.php?world=${world}`) // Gather data from playerKillsAll.php\n var playerkillsoff_res = await got(`${c.api}/playerKillsAttack.php?world=${world}`) // Gather data from playerKillsAttack.php\n var playerkillsdef_res = await got(`${c.api}/playerKillsDefend.php?world=${world}`) // Gather data from playerKillsDefend.php\n var islands_res = await got(`${c.api}/islands.php?world=${world}`) // Gather data from islands.php\n var towns_res = await got(`${c.api}/towns.php?world=${world}`) // Gather data from towns.php\n var conquers_res = await got(`${c.api}/conquers.php?world=${world}`) // Gather data from conquers.php\n var alliances_res = await got(`${c.api}/alliances.php?world=${world}`) // Gather data from alliances.php\n var alliancekillsall_res = await got(`${c.api}/allianceKillsAll.php?world=${world}`) // Gather data from allianceKillsAll.php\n var alliancekillsoff_res = await got(`${c.api}/allianceKillsAttack.php?world=${world}`) // Gather data from allianceKillsAttack.php\n var alliancekillsdef_res = await got(`${c.api}/allianceKillsDefend.php?world=${world}`) // Gather data from allianceKillsDefend.php\n\n players_res = JSON.parse(players_res.body) // Parse response body for data objects\n playerkillsall_res = JSON.parse(playerkillsall_res.body)\n playerkillsoff_res = JSON.parse(playerkillsoff_res.body)\n playerkillsdef_res = JSON.parse(playerkillsdef_res.body)\n islands_res = JSON.parse(islands_res.body)\n towns_res = JSON.parse(towns_res.body)\n conquers_res = JSON.parse(conquers_res.body)\n alliances_res = JSON.parse(alliances_res.body)\n alliancekillsall_res = JSON.parse(alliancekillsall_res.body)\n alliancekillsoff_res = JSON.parse(alliancekillsoff_res.body)\n alliancekillsdef_res = JSON.parse(alliancekillsdef_res.body)\n\n var res = { // define response object with all responses inside\n \"players\": players_res.data.players,\n \"playerkillsall\": playerkillsall_res.data.players,\n \"playerkillsoff\": playerkillsoff_res.data.players,\n \"playerkillsdef\": playerkillsdef_res.data.players,\n \"islands\": islands_res.data.islands,\n \"towns\": towns_res.data.towns,\n \"conquers\": conquers_res.data.conquers,\n \"alliances\": alliances_res.data.alliances,\n \"alliancekillsall\": alliancekillsall_res.data.alliances,\n \"alliancekillsoff\": alliancekillsoff_res.data.alliances,\n \"alliancekillsdef\": alliancekillsdef_res.data.alliances\n }\n console.log(`[${timestamp('DD.MM.YYYY-HH:mm:ss')}] ${world} API Requests successful`)\n return res // Return response object\n}", "title": "" }, { "docid": "ad7b3c356eccafaa096aa769f2be9ccb", "score": "0.50752056", "text": "function respond() {\n\tvar request = JSON.parse(this.req.chunks[0]),\n\tbotRegexKya = /(.|)*lol/;\n\tbotsave = /(.|)*\\bsave\\b/;\n\tbotsavecode = /(.|)*\\breenter\\b/;\n\n\tvar waifuPhrases = [ \"https://pbs.twimg.com/media/B8YdqjxIQAAU87L.jpg\", \"It's not like I l-like you or anything...\", \n\t\t\"B-B-baka!\", \"My senpai is the best!\", \"But isn't that... lewd?\", \"Kemy-kun is sugoi, but not as sugoi as senpai!\", \"Noooo!\",\n\t\t\"http://i0.kym-cdn.com/photos/images/facebook/000/240/558/d76.jpg\", \"http://2.bp.blogspot.com/-6hX2FngcmZk/U1VlHs5CfNI/AAAAAAAAQNI/yxSWLiV-z94/s1600/waifu.png\"]\n\n\tif(request.text && botRegexKya.test(request.text)) {\n\t\tthis.res.writeHead(200);\n\t\tpostMessage(waifuPhrases[getRandomInt(0,waifuPhrases.length)]);\n\t\tthis.res.end();\n\t}\n\telse if(request.text && botsave.test(request.text)) {\n\t\tsaveProgress();\n\t\tthis.res.end();\n\t}\n\telse if(request.text && botsavecode.test(request.text)) {\n\t\tvar inputString = request.text;\n\t\tvar canDecode = inputString.replace(/^(reenter)/,\"\");\n\t\tdecode(canDecode);\n\t\tthis.res.end();\n\t}\n\telse {\n\t\tconsole.log(\"Nothing happened\");\n\t\tthis.res.writeHead(200);\n\t\tthis.res.end();\n\t}\n}", "title": "" }, { "docid": "a34579ea9583370f71b223df857d4b9e", "score": "0.50695837", "text": "function loadKnowledge ( page_title ) {\n serverRequest ( fe_reqtype.getUserKnowledge,0,page_title,function(data){\n _wfKnowledge = data;\n },function(){\n },'persist');\n }", "title": "" }, { "docid": "758863c56b85fdb6b158b812b1c3b61f", "score": "0.50657", "text": "function requestTracker(req, res, next) {\n const clientIp = requestIp.getClientIp(req);\n console.log(\"clientIp ::::>>>>> \", clientIp)\n let clientValue = {\n count: 1,\n lsm: Date.now()\n }\n let cache = req.app.locals.redisdb\n cache.hgetall(clientIp, async function (err, obj) {\n if (err) {\n console.error(err);\n res.json({\n status: \"failed\",\n msg: \"Something went wrong...\"\n })\n } else {\n let response = await obj;\n console.log(\"response ==>\", response);\n if (response == null) {\n cache.hmset(clientIp, clientValue, redis.print);\n cache.expire(clientIp, 60);\n next()\n } else {\n let getLsm = Date.now() - parseInt(response.lsm)\n if (getLsm < 60001 && parseInt(response.count) < requestCount) {\n let mClientValue = {\n count: parseInt(response.count) + 1,\n lsm: response.lsm\n }\n cache.hmset(clientIp, mClientValue, redis.print);\n next()\n } else {\n res.json({\n status: \"failed\",\n msg: \"Are you a hacker ????\"\n })\n }\n }\n }\n });\n}", "title": "" }, { "docid": "e19557c48578d0b0f8004d83237d76f7", "score": "0.50636286", "text": "function KRK_PrivateRequest2(stn) { \r\n // ** Load Hashes Libs\r\n var elibs = { hashes: \"https://sites.google.com/site/moosyresearch/projects/cryptos/botmon/script34/hashes.gs\" }; try { Object.keys(elibs).forEach(function(library) { newFunc = eval(UrlFetchApp.fetch(elibs[library]).getContentText()); eval('var ' + library + ' = ' + newFunc); }); } catch(e) { Logger.log(\"ERROR: \"+e); return (null); }\r\n \r\n // https://support.kraken.com/hc/en-us/categories/360001806372-Futures-API\r\n function KRK_Signature(postData, nonce, endpointPath, secret) {\r\n try {\r\n var message = postData + nonce + endpointPath, // 1 Concatenate postData + nonce + endpointPath\r\n sha256obj = new jsSHA (\"SHA-256\", \"BYTES\");\r\n sha256obj.update (message)\r\n var hash_digest = sha256obj.getHash (\"BYTES\"), // 2 Hash the result of step 1 with the SHA-256 algorithm\r\n sha512obj = new jsSHA (\"SHA-512\", \"BYTES\");\r\n sha512obj.setHMACKey (secret, \"B64\"); // 3 Base64-decode your api_secret\r\n sha512obj.update (hash_digest); // 4 Use the result of step 3 to hash the result of the step 2 with the HMAC-SHA-512 algorithm\r\n \r\n } catch(e) { return (null); }\r\n return sha512obj.getHMAC (\"B64\"); // 5 Base64-encode the result of step 4\r\n }\r\n \r\n \r\n if (stn.payload != '') {\r\n try { stn.payload = CreateURIQueryString(stn.payload,\"\") } catch (e) {Logger.log(\"\")};\r\n try { if (stn.payload[0] == \"?\") stn.payload = stn.payload.replace('?', '&'); } catch(e) { Logger.log(\"\");}\r\n }\r\n if (stn.payload.length < 3) stn.payload = \"\"; \r\n var nonce = new Date().getTime().toString(),\r\n authent = KRK_Signature (stn.payload, nonce, stn.command, stn.secret),\r\n params = {\r\n 'method' : stn.method,\r\n 'muteHttpExceptions': true,\r\n 'Accept': 'application/json',\r\n 'headers': {\r\n 'apiKey' : stn.apikey,\r\n 'nonce' : nonce,\r\n 'authent' : authent,\r\n },\r\n };\r\n if (stn.payload != '') stn.command = stn.command+'?'+ stn.payload;\r\n return { uri: stn.uri + stn.command, params: params};\r\n}", "title": "" }, { "docid": "ba72e162839ef4261832e3db08d5323b", "score": "0.5052541", "text": "async function searchPostsBySpam(key, mods, tags, domain) {\n return await searchPostsByModerated(key, mods, 'spam', tags, true, domain);\n}", "title": "" }, { "docid": "0470f07a18ff82cf79d1fc901f9d8c29", "score": "0.5050696", "text": "run() {\n // Register listeners with hubot\n this.robot.hear(/get id (.+)/i, res => this.respondToID(res, res.match[1]));\n this.robot.hear(/get name (.+)/i, res =>\n this.respondToName(res, res.match[1])\n );\n this.robot.hear(/view( raw)* blacklist/i, res =>\n this.respondToViewBlacklist(res)\n );\n this.robot.hear(/blacklist (.+)/i, res =>\n this.respondToBlacklist(res, res.match[1])\n );\n this.robot.hear(/whitelist (.+)/i, res =>\n this.respondToWhitelist(res, res.match[1])\n );\n\n // Mention @all command\n this.robot.hear(/(.*)@all(.*)/i, res => this.respondToAtAll(res));\n }", "title": "" }, { "docid": "24111d08c7025c5fc791caa30dc38639", "score": "0.5047013", "text": "function KRK_PrivateRequest1(stn) { \r\n\r\n function KRK_Signature (path, postdata, nonce, secret) {\r\n try {\r\n var sha256obj = new jsSHA (\"SHA-256\", \"BYTES\");\r\n sha256obj.update (nonce + postdata)\r\n var hash_digest = sha256obj.getHash (\"BYTES\"),\r\n sha512obj = new jsSHA (\"SHA-512\", \"BYTES\");\r\n sha512obj.setHMACKey (secret, \"B64\");\r\n sha512obj.update (path);\r\n sha512obj.update (hash_digest);\r\n } catch(e) { return (null); }\r\n return sha512obj.getHMAC (\"B64\");\r\n }\r\n \r\n // ** Load Hashes and possible other libs \r\n var elibs = { hashes: \"https://sites.google.com/site/moosyresearch/projects/cryptos/botmon/script34/hashes.gs\" }\r\n try {\r\n Object.keys(elibs).forEach(function(library) {\r\n newFunc = eval(UrlFetchApp.fetch(elibs[library]).getContentText()); \r\n eval('var ' + library + ' = ' + newFunc); \r\n }); } catch(e) { Logger.log(\"ERROR: \"+e); return (null); }\r\n\r\n if (stn.payload == \"\") { stn.payload = {'type':0}; }\r\n try { stn.payload = CreateURIQueryString(stn.payload,\"&\") } catch (e) {Logger.log(\"\")};\r\n try { if (stn.payload[0] == \"?\") stn.payload = stn.payload.replace('?', '&'); } catch(e) { Logger.log(\"\");}\r\n \r\n var nonce = new Date () * 1000,\r\n postdata = \"nonce=\" + nonce +stn.payload,\r\n signature = KRK_Signature (stn.command, postdata, nonce, stn.secret); \r\n \r\n // if (signature == null) { return(null); }\r\n var params = {\r\n 'method' : stn.method,\r\n 'muteHttpExceptions': true,\r\n 'headers': {\r\n 'API-Key': stn.apikey,\r\n 'API-Sign': signature,\r\n //'Content-Type' :'application/json', ** Don't enable these\r\n //'Accept' :'application/json' ** Don't enable these\r\n },\r\n payload: postdata\r\n }\r\n \r\n return { uri: stn.uri + stn.command, params: params};\r\n}", "title": "" }, { "docid": "6eba08412a317e3b60237d20a3f857d0", "score": "0.5042528", "text": "function TamperRequestResponse() {\r\n}", "title": "" }, { "docid": "1d63aea49098c152edabf4510b804106", "score": "0.5038823", "text": "function allmatchlink(link){\n\n request(link,function(error,response,data){\n parsebody(data);\n });\n\n}", "title": "" }, { "docid": "17a33776b898a2882d679f36d2fd263a", "score": "0.5022564", "text": "function hikingData (lat, long, dist){\n //https://www.hikingproject.com/data\n //api key for hiking project\n var hikingAPI = '200921607-a699ee88fe046c36c0221ff849e49662'\n // HIKING API KEY = '200922231-f42dcac72820a60fd70fc2690b0d09ea' //\n //search by lat/long using a max distance global var\n var urlQuery = `https://www.hikingproject.com/data/get-trails?lat=${lat}&lon=${long}&maxDistance=${dist}&key=${hikingAPI}`\n //get urlQuery\n $.get(urlQuery, function (response) {\n console.log(\"----------hiking api-------------\")\n //response hiking object\n var hikes = response.trails\n console.log(`hikes returned firing buildHike`, hikes)\n console.log(\"--------------End hiking API --------------\")\n buildHike(hikes);\n })\n //fire hikeBUild function passing in the array of objects as an argument\n }", "title": "" }, { "docid": "c673ab7753e617e7643c7dd89f826ab4", "score": "0.5019165", "text": "function try_extra(){\n var link_en = \"You must link your account (My account - Link my account)\",\n link_fr = \"Vous devez lier votre compte Twitter (Mon compte - Associer mon compte)\";\n\n // Facebook Share\n request('app_add_fb_share_tickets', function(xhr){\n var data = xhr.response;\n\n if(data.msg){\n if(data.ticket){\n add_tickets(data.ticket);\n log(\"Shared on Facebook! Earned \"+data.ticket+\" tickets!\");\n }\n else if(data.msg.text == link_en || data.msg.text == link_fr){\n log(\"Can't share on Facebook, please link your account!\");\n }\n console.log(\"FB SHARE: \"+data.msg.text);\n }\n else{\n error();\n }\n }, \"&id=959390494177796_972681042848741\") // Dummy post-id to validate the share!\n\n // Twitter Share\n request('app_add_twitter_share_tickets', function(xhr){\n var data = xhr.response;\n\n if(data.msg){\n if(data.ticket){\n add_tickets(data.ticket);\n log(\"Shared on Twitter! Earned \"+data.ticket+\" tickets!\");\n }\n else if(data.msg.text == link_en || data.msg.text == link_fr){\n log(\"Can't share on Twitter, please link your account!\");\n }\n console.log(\"TW SHARE: \"+data.msg.text);\n }\n else{\n error();\n }\n })\n \n // G2A Reflink\n request('app_add_g2a_reflink_tickets', function(xhr){\n var data = xhr.response;\n\n if(data.msg){\n if(data.ticket){\n add_tickets(data.ticket);\n log(\"Clicked G2A! Earned \"+data.ticket+\" tickets!\");\n }\n console.log(\"G2A CLICK: \"+data.msg.text);\n }\n else{\n error();\n }\n })\n \n // Twitter Follow\n request('app_add_twitter_follow_tickets', function(xhr){\n var data = xhr.response;\n\n if(data.msg){\n if(data.ticket){\n add_tickets(data.ticket);\n log(\"Followed on Twitter! Earned \"+data.ticket+\" tickets!\");\n }\n else if(data.msg.text == link_en || data.msg.text == link_fr){\n log(\"Can't follow on Twitter, please link your account!\");\n }\n console.log(\"TW FOLLOW: \"+data.msg.text);\n }\n else{\n error();\n }\n })\n \n // Steam Username\n request('app_add_steam_username_tickets', function(xhr){\n var data = xhr.response;\n\n if(data.msg){\n if(data.ticket){\n add_tickets(data.ticket);\n log(\"Steam username valid! Earned \"+data.ticket+\" tickets!\");\n }\n else if(data.msg.text == link_en || data.msg.text == link_fr){\n log(\"Can't check Steam username, please link your account!\");\n }\n console.log(\"STEAM USERNAME: \"+data.msg.text);\n }\n else{\n error();\n }\n })\n \n // YouTube Sub [NOT ACTIVE YET]\n /*request('app_add_youtube_subscribe_tickets', function(xhr){\n var data = xhr.response;\n\n if(data.msg){\n if(data.ticket){\n add_tickets(data.ticket);\n log(\"Subscribed on YouTube! Earned \"+data.ticket+\" tickets!\");\n }\n else if(data.msg.text == link_en || data.msg.text == link_fr){\n log(\"Can't check YouTube Subscription, please link your account!\");\n }\n console.log(\"YT SUB: \"+data.msg.text);\n }\n else{\n error();\n }\n })*/\n }", "title": "" }, { "docid": "63621e0e0f327a0595d30355629c5fe1", "score": "0.50147736", "text": "function create_petfinder_search_request(search_results,user_input,res){\n let query={\n \"type\":user_input\n } \n query=querystring.stringify(query);\n\n const headers={\n \"Authorization\":search_results.token_type+\" \"+search_results.access_token\n }\n\n const options2={\n \"method\":\"GET\",\n \"headers\":headers\n }\n\n let search_endpoint=\"https://api.petfinder.com/v2/animals?\"\n search_endpoint=search_endpoint+query;\n\n //checking search cashe\n const search_cashe='./cashe/'+user_input+'.json';\n if(fs.existsSync(search_cashe)){\n console.log(\"SERVING CASHED RESULTS\");\n let cashed_search=require(search_cashe);\n serve_results(cashed_search,res);\n }\n else{\n search_request=https.request(search_endpoint,options2,function(search_res){\n received_petfinder_search_results(search_res,user_input,res);\n console.log(\"SERVING NEW RESULTS\");\n });\n search_request.end();\n }\n}", "title": "" }, { "docid": "becd5463bbf6d9e29e97b2a43589c117", "score": "0.50084734", "text": "function people(link){\r\n request(link,cb1);\r\n}", "title": "" }, { "docid": "7fc714ecff862594970647c3a2ee35aa", "score": "0.49937958", "text": "function getdata(request, key) {\r\n var log = require(\"ringo/logging\").getLogger(module.id);\r\n var context = {};\r\n //var limit = request.params.limit || 1000;\r\n var {Host} = require('models/host');\r\n var h = null;\r\n try {\r\n h = Host.get(key);\r\n } catch(e) {\r\n return {\r\n status: 404,\r\n headers: {\"Content-Type\": \"application/json; charset=utf-8\"},\r\n body: ['{\"ERROR\": \"Not Found\"}']\r\n }\r\n }\r\n\r\n var callback = request.params.callback || null;\r\n /* if (!callback) {\r\n return {\r\n status: 400,\r\n headers: {\"Content-Type\": \"application/json; charset=utf-8\"},\r\n body: ['{ERROR: \"Bad Request\"}']\r\n }\r\n } */\r\n //context.url = h.url;\r\n\r\n /*var from = ((typeof request.params.from !== \"undefined\") && !isNaN(request.params.from))\r\n ? request.params.from : null;\r\n var to = ((typeof request.params.to !== \"undefined\") && !isNaN(request.params.to))\r\n ? request.params.to : null;*/\r\n var stats = loadData(h, request.params.from, request.params.to);\r\n\r\n //var json = uneval(stats).replace(/\\s/g, '');\r\n var json = JSON.stringify (stats); // correct way\r\n return {\r\n status: 200,\r\n headers: {\"Content-Type\": \"application/json\"}, // \"text/javascript\"\r\n body: ( callback ? ([callback + '(' + json + ');']) : [json] )\r\n };\r\n}", "title": "" }, { "docid": "24c870145ccc0fee45c7ebe52cf741ba", "score": "0.49897113", "text": "function handleRequest1(request, response) {\n\tresponse.end(phrases[Math.floor(Math.random() * phrases.length)]);\n}", "title": "" }, { "docid": "3ba9b55fc8c4f9d819cbe65b148d3901", "score": "0.49873543", "text": "async function makeRequest() {\n const config = {\n method: \"get\",\n url: \"https://adventofcode.com/2020/day/7/input\",\n headers: {\n Cookie:\n \"_ga=GA1.2.609869550.1606597228; session=53616c7465645f5f63514525ec0ca369628697393717ede015e6807e3d38f267e28b2dd447653f07ae169ac5bf6b8d15; _gid=GA1.2.1356660941.1606830201; _gat=1\",\n },\n withCredentials: true,\n };\n\n let res = await axios(config);\n res = res.data.trim();\n\n res = res.split(\"\\n\");\n\n function findBagsThatContainShinyGoldBag(res) {\n let bagsContainsShinyGold = new Set();\n for (var i = 0; i < res.length; i++) {\n if (res[i][1].includes(\"shiny gold\")) {\n if (!bagsContainsShinyGold.has(res[i][0])) {\n bagsContainsShinyGold.add(res[i][0]);\n }\n }\n }\n return bagsContainsShinyGold;\n }\n\n function findBags(res, set) {\n for (var i = 0; i < res.length; i++) {\n set.forEach((element) => {\n if (res[i][1].includes(element)) {\n if (!set.has(res[i][0])) {\n set.add(res[i][0]);\n }\n }\n });\n }\n return set;\n }\n\n // Split bag that contains and contained bags\n for (var i = 0; i < res.length; i++) {\n res[i] = res[i].split(\" bags contain \");\n }\n\n let bagContainsShinyGold = new Set();\n bagContainsShinyGold = findBagsThatContainShinyGoldBag(res);\n\n let oldBags = new Set();\n\n while (oldBags.size !== bagContainsShinyGold.size) {\n oldBags = new Set(bagContainsShinyGold);\n bagContainsShinyGold = findBags(res, bagContainsShinyGold);\n }\n\n console.log(bagContainsShinyGold.size);\n}", "title": "" }, { "docid": "cdd75e7f298a4ef18a77bab8c7bce55d", "score": "0.4984286", "text": "function main(data) {\n\t\tvar action = data.result.action;\n\t\tvar speech = data.result.fulfillment.speech;\n\t\t// use incomplete if u use required in api.ai questions in intent\n\t\t// check if actionIncomplete = false\n\t\tvar incomplete = data.result.actionIncomplete;\n\t\tif(data.result.fulfillment.messages) { // check if messages are there\n\t\t\tif(data.result.fulfillment.messages.length > 0) { //check if quick replies are there\n\t\t\t\tvar suggestions = data.result.fulfillment.messages[1];\n\t\t\t}\n\t\t}\n\t\tswitch(action) {\n\t\t\t// case 'your.action': // set in api.ai\n\t\t\t// Perform operation/json api call based on action\n\t\t\t// Also check if (incomplete = false) if there are many required parameters in an intent\n\t\t\t// if(suggestions) { // check if quick replies are there in api.ai\n\t\t\t// addSuggestion(suggestions);\n\t\t\t// }\n\t\t\t// break;\n\t\t\tdefault:\n\t\t\t\tsetBotResponse(speech);\n\t\t\t\tif(suggestions) { // check if quick replies are there in api.ai\n\t\t\t\t\taddSuggestion(suggestions);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "ec1cbace05c28fcd0a4feb425fce8fd7", "score": "0.49838942", "text": "async function processMessage(sender_psid, message, nlp) {\n \n if (nlp['intents'].length === 0) {\n \n // Check if greeting\n let traits = nlp['traits'];\n\n if (traits['wit$greetings'] && traits['wit$greetings'][0]['value'] === 'true') {\n console.log('Is greeting');\n // Add the getName function call here\n let name = await getName(PAGE_ACCESS_TOKEN,sender_psid);\n return getResponseFromMessage('Hi ' + name + '! Welcome to Bright. How can I help you?');\n }\n \n console.log('Returning default response');\n return getDefaultResponse();\n }\n\n console.log('Intents inferred from NLP model: ')\n console.table(nlp['intents']);\n\n // Get the intent with the highest confidence\n let intent = nlp['intents'][0]['name']\n let confidence = nlp['intents'][0]['confidence']\n\n // If confidence of intent is less than threshold, do not process\n if (confidence < 0.7) return getDefaultResponse();\n\n let entities = nlp['entities'];\n let highest_confidence = 0;\n\n switch (intent) {\n case 'enquiry_general':\n // Get entity with highest confidence\n let entity = null;\n for (const e in entities) {\n let confidence = entities[e][0]['confidence'];\n if (confidence > highest_confidence) {\n highest_confidence = confidence;\n entity = entities[e][0]['name'];\n }\n }\n\n console.log('Entity with highest confidence: ' + entity);\n\n return handleGeneralEnquiry(entity);\n case 'enquiry_delivery':\n // Get value with highest confidence\n let value = null;\n if ('wit$datetime:datetime' in entities) {\n for (const e of entities['wit$datetime:datetime']) {\n console.log(e);\n let confidence = e['confidence'];\n if (confidence > highest_confidence) {\n highest_confidence = confidence;\n // Type is either \"value\" or \"interval\"\n value = (e['type'] === 'value') ? e['value'] : e['to']['value'];\n }\n }\n console.log('Value with highest confidence: ' + value);\n }\n \n return handleDeliveryEnquiry(value);\n case 'recommendation':\n // For Option 1 only: Get products from database and assign it to a variable named \"products\"\n\n return generateCarouselOfProductsResponse(products);\n\n default:\n return getDefaultResponse();\n }\n\n}", "title": "" }, { "docid": "b737a06098ffe9dbf16a3ec8b70dc297", "score": "0.49759224", "text": "message_received(data){\n if (data.embeds.length >= 1){\n var embeds = data.embeds[0];\n if(embeds.title == undefined){ embeds.title = \"\"; }\n if(embeds.description == undefined){ embeds.description = \"\"; }\n if(embeds.footer == undefined){ embeds.footer = \"\"; }\n if(embeds.author == undefined){ embeds.author = {}; }\n if(embeds.author.name == undefined){ embeds.author.name = \"\"; }\n if(!embeds.title.includes(\"Slow it down\")){\n // console.log(\"embeds: \", embeds)\n var embeds_header = embeds.author.name;\n var embeds_description = embeds.description;\n if(embeds_header.includes(\"trivia question\")){\n var questionFinderStr = embeds_description.match(/\\*{2}(.*?)\\*{2}/g);\n var question = questionFinderStr[0].replace(\"*\", \"\").replace(\"*\", \"\").replace(\"*\", \"\").replace(\"*\", \"\");\n var awnsersSplit = embeds_description.split(\")\");\n var awnsers = []\n for(var y=1; y < awnsersSplit.length; y+=1){\n var curAwnser = awnsersSplit[y];\n var regexmatch = curAwnser.match(/\\*(.*?)\\*/g);\n if((regexmatch != undefined) && (regexmatch != null)){\n if (regexmatch.length >= 1){\n awnsers[awnsers.length] = regexmatch[0].replace(\"*\", \"\").replace(\"*\", \"\");\n }\n }\n }\n // console.log(\"question: \", question)\n // console.log(\"awnsers: \", awnsers)\n this.sendMessage(\"1\");\n // axios.get('https://www.googleapis.com/customsearch/v1', {params: {q: question, cx: '002356836092859882685:3jog9tt85tj', key: \"AIzaSyBleP7_InH4AElrDzhjiNHqPK2DaNlOIl8\"}}).then(function (response) {\n // var data = response.data;\n \n // for(var y=1; y < awnsers.length; y+=1){\n // var curAwnser = awnsers[y];\n // var awnserWords = curAwnser.split(\" \");\n // for (var z = 0; z < awnserWords.length; z += 1) {\n // for (var i = 0; i < data.items.length; i += 1) {\n // var item = data.items[i]\n // var snippet = item.snippet;\n // var awnserWord = awnserWords[z];\n // if (snippet.toLowerCase().includes(awnserWord.toLowerCase())){\n // sendMessage(y+1)\n // return true;\n // }\n // }\n\n // }\n // }\n // // If not found\n // sendMessage(\"1\");\n // })\n }\n }\n }\n var msg = data.content;\n // console.log(\"Message received: \", msg);\n if(msg.includes(\"The police are here, and they're after you!\")){\n this.sendMessage( this.message_get_quoted_string(msg) );\n }else if(msg.includes(\" need to buy a laptop in the shop to post memes\")){\n this.sendMessage(\"pls withdraw 1000\");\n var self = this\n setTimeout(function(){ \n self.sendMessage(\"pls buy laptop\");\n }, 1000 * 5);\n }else if(msg.includes(\"You can only share\")){\n this.sendMessage( \"pls share onno204 \"+(msg.replace(\"You can only share \", '').replace(\" with this user right now.\", '')) );\n }else if(msg.includes(\"What type of meme do you want to po\")){\n this.sendMessage( this.message_get_quoted_string(msg) );\n }else if(msg.includes(\"What type of meme do you want to po\")){\n this.sendMessage( this.message_get_quoted_string(msg) );\n }\n }", "title": "" }, { "docid": "4776ded28148fd3d1bbc1afddd44978f", "score": "0.49650842", "text": "function getData() {\n\n // if random beer, we have to change initial url\n if (randomBeer) {\n BREWERY_URL = \"https://api.brewerydb.com/v2/beer/random?&key=\";\n }\n // star building beer url\n var bUrl = PROXY_URL + BREWERY_URL;\n bUrl += BREWAPI_KEY;\n bUrl += \"&abv=\";\n\n // build food URL\n var url = YUMMLY_URL;\n url += YUMMLY_ID;\n url += \"&_app_key=\";\n url += YUMMLY_KEY;\n url += \"&q=\";\n\n // change the brewery_url back to the original/normal url\n BREWERY_URL = \"https://api.brewerydb.com/v2/beers?&key=\";\n\n // get value of form field\n value = document.querySelector(\"#searchterm\").value;\n\n // get rid of any leading and trailing spaces\n value = value.trim();\n\n // if we are in food state, search for food\n if (foodState) {\n value = encodeURI(value);\n if (cuisineKey) cuisineKey = cuisineKey.trim();\n if (courseKey) courseKey = courseKey.trim();\n\n // if there's no band to search then bail out of the function\n if (value.length < 1 && cuisineKey == null && courseKey == null && !dairy && !egg && !gluten && !peanut && !seafood && !sesame && !soy && !sulfite && !treeNut && !wheat) return;\n\n if (cuisineKey) cuisineKey = encodeURI(cuisineKey);\n if (courseKey) courseKey = encodeURI(courseKey);\n\n url += value;\n\n if (cuisineKey != null) {\n url += \"&allowedCuisine[]=cuisine^cuisine-\" + cuisineKey;\n }\n\n if (courseKey != null) {\n url += \"&allowedCourse[]=course^course-\" + courseKey;\n }\n\n if (dairy) {\n url += \"&allowedAllergy[]=\" + dairyId;\n }\n\n if (egg) {\n url += \"&allowedAllergy[]=\" + eggId;\n }\n\n if (gluten) {\n url += \"&allowedAllergy[]=\" + glutenId;\n }\n\n if (peanut) {\n url += \"&allowedAllergy[]=\" + peanutId;\n }\n\n if (seafood) {\n url += \"&allowedAllergy[]=\" + seafoodId;\n }\n\n if (sesame) {\n url += \"&allowedAllergy[]=\" + sesameId;\n }\n\n if (soy) {\n url += \"&allowedAllergy[]=\" + soyId;\n\n }\n if (sulfite) {\n url += \"&allowedAllergy[]=\" + sulfiteId;\n\n }\n if (treeNut) {\n url += \"&allowedAllergy[]=\" + treeNutId;\n }\n if (wheat) {\n url += \"&allowedAllergy[]=\" + wheatId;\n }\n\n url += \"&maxResult=10&start=\" + whatRecipes;\n\n var script = document.createElement('script');\n script.setAttribute('src', url);\n script.setAttribute('id', 'tempScript');\n document.querySelector('head').appendChild(script);\n\n }\n\n // if we are in the beer state, have to call proxy server\n // because the web service can only return json\n if (beerState) {\n bUrl += abvMin + \",\" + abvMax;\n\n if (value) {\n bUrl += \"&name=\" + value;\n }\n\n if (category >= 1) {\n bUrl += \"&styleId=\" + category;\n }\n\n if (vintageYear) {\n bUrl += \"&year=\" + vintageYear;\n }\n\n if (organic) {\n bUrl += \"&isOrganic=Y\";\n }\n\n if (label) {\n bUrl += \"&hasLabels=Y\";\n }\n\n if (breweryInfo) {\n bUrl += \"&withBreweries=Y\";\n }\n\n\n bUrl += \"&p=\" + pageNum;\n\n bUrl = bUrl.replace(/&/g, '%26');\n\n\n var xhr = new XMLHttpRequest();\n xhr.onload = function() {\n var myJSON = JSON.parse(xhr.responseText);\n jsonLoaded3(myJSON);\n }\n xhr.open('GET', bUrl, true);\n\n // try to prevent browser caching by sending a header to the server\n xhr.setRequestHeader(\"If-Modified-Since\", \"Sat, 1 Jan 2010 00:00:00 GMT\");\n xhr.send();\n }\n }", "title": "" }, { "docid": "10cba54175b72445391a3fa4b49cddec", "score": "0.4958468", "text": "function api_fetch(query,cb)\n{\nvar oauth = OAuth({\n consumer: {\n public: 'IBM',\n secret: 'F9715GJ48A3474E9C6E41FF989F0AF2'\n },\n signature_method: 'HMAC-SHA1',\n hash_function: function(base_string, key) {\n return crypto.createHmac('sha1', key).update(base_string).digest('base64');\n }\n \n});\nvar request_data = {\n //url: 'http://sandbox.api.burning-glass.com/v206/explorer/occupations/marketdata?'+query,\n // url: 'http://sandbox.api.burning-glass.com/v206/explorer/occupations/marketdata?bgtoccs=15-1199.06,15-1199.07,15-1199.91&areaId=506',\n url: 'http://sandbox.api.burning-glass.com/v206/explorer/occupations?'+query,\n method: 'GET',\n data: {oauth_token: 'Explorer',\n\toauth_consumer_key: 'IBM'}\n\t};\nconsole.log(request_data.url);\nvar token = {\n public: 'Explorer',\n secret: '95C93BE538BFG67J63B03E854AA84'\n};\n\n\nrequest({\n url: request_data.url,\n method: request_data.method,\n form: request_data.data,\n headers: oauth.toHeader(oauth.authorize(request_data, token))\n \t}, function(error, response, body) \n\t\t{//console.log(response.body);\n\t\tvar ar=[];\n/*\t\tfor (r in body.result.data)\n\t\t\t{\n\t\t\tar.push(r[name]);\n\t\t\t}\n\t\tconsole.log(ar);\n*/\t\t\n//\t\tconsole.log(typeof(body) );\n//\t\tconsole.log(body.result.data);\n\t\tcb(body);\n\t\t}\n\t\t\n );\n\n\n\n} // end of api fetch function", "title": "" }, { "docid": "27647d9446423d441374b0952fcdebd5", "score": "0.49582285", "text": "function make( server ) {\n\n /// Calculate the e-tag for a search request.\n function eTag( req ) {\n let { s, m, p } = req.query;\n let group = ACM.group( req );\n return fingerprint([ s, m, p, group ], 20 );\n }\n\n /**\n * The search request handler.\n * @param ctx The request context.\n * @param req The request.\n * @param res The response.\n * @param cneg A content negotiator.\n */\n async function handler( ctx, req, res, cneg ) {\n\n // Read repo info from request.\n let { account, repo, branch } = ctx;\n\n // Read search info from request.\n let { s, m, p } = req.query;\n\n // Prepare the response.\n res.set('Content-Type', 'application/json');\n res.set('Cache-Control','public, must-revalidate, max-age=600');\n res.set('Etag', eTag( req ) );\n let count = 0;\n\n try {\n // Perform the search.\n let result = await server.search( account, repo, branch, s, m, p );\n try {\n // Steam file records from the result.\n await streamJSONFile( result.file, record => {\n // Test if the record is accessible to the current user.\n if( ACM.accessible( req, record ) ) {\n // Following is done on an async queue to ensure correct\n // write ordering of rows and end of response.\n queue( ResponseQueue, async () => {\n // Check path is the preferred representation of the resource.\n let path = record.path;\n let valid = await cneg.isPreferredPathForRequest( ctx, req, path );\n if( valid ) {\n // Check if at start of response.\n res.write( count == 0 ? '[' : ',' );\n // Write the current record.\n res.write( JSON.stringify( record ) );\n count++;\n }\n });\n }\n });\n }\n catch( err ) {\n // Can't send an error response at this stage, as data may\n // have already be written to the client.\n Log.error('Writing search result', err );\n }\n // Close the response on the queue, to ensure it occurs after all rows\n // have been written.\n queue( ResponseQueue, async () => {\n if( count == 0 ) {\n res.end('[]'); // Empty result.\n }\n else {\n res.end(']');\n }\n });\n }\n catch( err ) {\n Log.error('Handling search request', err );\n res.end('[]'); // Empty result.\n }\n }\n\n // Export search endpoint.\n return {\n endpoints: { 'search.api': handler }\n }\n}", "title": "" }, { "docid": "c6388cef216c6216baf238d03b9595c8", "score": "0.4955315", "text": "function sendrequestformetadata() {\n\t\trequest = {\n\t\t\tWGPMG : Data_Group\n\t\t};\n\t\tsend(ws, request, var_gotmetadataresponse);\n\t\tconsole.log(\"meta data requests sent\");\n\t\t/* TODO, turn off for development only*/\n\t}", "title": "" }, { "docid": "ccf65af5553f40a12a01bef9d77d341f", "score": "0.4954536", "text": "function sendRequest(action, query, usrres) {\n var path = '/api/call';\n if (query.length != 0) {\n var url = path + '?action=' + action + '&key=' + volunteerMatch.accountKey + '&query=' + JSON.stringify(query);\n } else {\n var url = path + '?action=' + action + '&key=' + volunteerMatch.accountKey;\n }\n console.log('url:, ' + url);\n var get_options = {\n host: 'www.volunteermatch.org',\n path: url,\n };\n\n var get_req = http.get(get_options, function (res) {\n console.log('STATUS: ' + res.statusCode);\n console.log('HEADERS: ' + JSON.stringify(res.headers));\n res.setEncoding('utf8');\n var total = '';\n res.on('data', function (chunk) {\n total += chunk;\n });\n\n res.on('end', function () {\n var formatted_data = JSON.parse(total);\n var count = 0;\n\t if(formatted_data.opportunities){\n// formatted_data.opportunities.forEach(function (opportunity) {\n// get_address(decodeURIComponent(opportunity.vmUrl), function (address) {\n// opportunity.address = address;\n// count++;\n// if (count >= formatted_data.opportunities.length) {\n// console.log(formatted_data);\n usrres.end(JSON.stringify(formatted_data));\n// }\n\n// });\n// });\n\t }\n\t else{\n\t\tconsole.log(\"Sending the formatted_data anyway?\");\n usrres.end(\"Didn't Get anything\");\n\t }\n });\n });\n\n // for debugging\n get_req.on('error', function (e) {\n console.log(\"Got error: \" + e.message);\n });\n console.log('host :' + get_options.host);\n return -1;\n}", "title": "" }, { "docid": "2ed8b62f6aaa6284ea55692b7d123b39", "score": "0.49545342", "text": "async function sendApiRequestBreakfast() {\n let APP_ID = \"405a394c\"\n let API_KEY = \"3104f9ddfb4ee96509c47474e498a8e7\"\n let response = await fetch(`https://api.edamam.com/search?app_id=${APP_ID}&app_key=${API_KEY}&q=breakfast`);\n console.log(response)\n let data = await response.json()\n console.log(data)\n\n userAPIDataBreakfast(data)\n }", "title": "" }, { "docid": "633757c2eaf6b8ef5ff5a7d4a907fa37", "score": "0.49404114", "text": "function main(data) {\n if (data.message.text){\n var action = 'text';\n var speech = data.message.text;\n console.log('speech', speech)\n }else if(data.message.attachment.type === 'image'){\n var action = data.message.attachment.type\n var image = data.message.attachment.payload.url;\n console.log('speech', speech)\n }else if(data.message.attachment.type === 'template'){\n if (data.message.attachment.payload.template_type === 'generic'){\n var action = data.message.attachment.payload.template_type\n var elements = data.message.attachment.payload.elements\n }\n }\n //var speech = data.result.fulfillment.speech;\n\t\t// use incomplete if u use required in api.ai questions in intent\n\t\t// check if actionIncomplete = false\n /*\n\t\tvar incomplete = data.result.actionIncomplete;\n\t\tif(data.result.fulfillment.messages) { // check if messages are there\n\t\t\tif(data.result.fulfillment.messages.length > 0) { //check if quick replies are there\n\t\t\t\tvar suggestions = data.result.fulfillment.messages[1];\n\t\t\t}\n\t\t}\n */\n //TODO: estoy redundando?dejar o switch o if's!!\n\t\tswitch(action) {\n\t\t\t// case 'your.action': // set in api.ai\n\t\t\t// Perform operation/json api call based on action\n\t\t\t// Also check if (incomplete = false) if there are many required parameters in an intent\n\t\t\t// if(suggestions) { // check if quick replies are there in api.ai\n\t\t\t// addSuggestion(suggestions);\n\t\t\t// }\n\t\t\t// break;\n\t\t\tcase 'text': // set in api.ai\n\t\t\t\tsetBotResponse(speech);\n\t\t\t\tbreak;\n case 'image': \n setBotImageResponse(image);\n\t\t\t\tbreak;\n case 'generic': \n setGenericResponse(elements);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tsetBotResponse(speech);\n\t\t\t\tif(suggestions) { // check if quick replies are there in api.ai\n\t\t\t\t\taddSuggestion(suggestions);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "15a9d992846282c168f3cfbed763dbd4", "score": "0.49393696", "text": "function main(message,userAgent){\n\tvar redis_client = redis.createClient();\n\tvar oMessage=JSON.parse(message);\n\toMessage.userAgent=userAgent;\n\tvar id=oMessage.id;\n\tconsole.log(\"ID = \"+id);\n\tvar now=new Date().getTime();\n\tvar meta={\"userAgent\":userAgent, \"time\":now};\n\tmeta=JSON.stringify(meta);\n\tconsole.log(\"META = \"+meta);\n\t\n\tvar md5 =crypto.createHash('md5').update(JSON.stringify(message)).digest(\"hex\");\n\tredis_client.HMSET(\"PaloRequest \"+now+md5, \"message\",message, \"meta\", meta, function(){\n\t\tredis_client.end();\n\t});\n\t\n}", "title": "" }, { "docid": "27ec4f43af5282c27efdcf14f82a6577", "score": "0.4934091", "text": "function entry(u,a){\n 'use strict';\n ;\n var to={}\n var gists={}\n gists.user=u\n gists.authstring=a //basic ...........\n gists.headers={\n \"Authorization\":gists.authstring\n ,'Accept': 'application/json'\n ,'Content-Type': 'application/json'\n }\n gists.jsy=JSON.stringify\n gists.f=function(url,o){return fetch(url,o).then((d)=>{\n if(d.ok) return Promise.resolve(d).then(d=>d.json())\n else return Promise.reject(d.status)\n })}\n gists.create=function(data){\n let url=\"https://api.github.com/gists\"\n ,o={\n method:'POST'\n ,headers: gists.headers\n ,body: gists.jsy(data)\n }\n ; \n return gists.f(url,o) \n }\n gists.update=function(id,data){\n let url=\"https://api.github.com/gists/\" + id\n ,o={\n method:'PATCH'\n ,headers: gists.headers\n ,body: gists.jsy(data)\n }\n ; \n return gists.f(url,o) \n }\n gists.searchid=function(url,o){return gists.f(url,o) }\n gists.search=gists.searchid;\n\n to.togistdebug=false;\n\n //ary=[[c,f],[c,f]]... c is content, f is filename\n to.togist2=(async (_ary,gistid,desc)=>{\n\n //let fname= filename||'anonymous'\n let ary =_ary\n ,data={\"files\": { } }\n if(desc) data.description=desc; //bug fix desc\n data.public=false\n ary.map(d=>{\n let content=d[0],fname=d[1];\n if(to.togistdebug){\n console.log('content length',content.length)\n console.log('fname',fname)\n }\n\n data.files[fname] = {\"content\": content}\n })\n ;\n var ret =(gistid)?await gists.update(gistid,data) :await gists.create(data)\n ;\n if(to.togistdebug){\n console.log('gistid',ret.id)\n console.log('gist url',ret.html_url)\n }\n return ret;\n });\n\n\n to.togist=(async (content,gistid,filename,desc)=>{\n\n let fname= filename||'anonymous'\n ,data={\"files\": { } }\n if(desc) data.description=desc; //bug fix desc\n data.public=false\n data.files[fname] = {\"content\": content}\n ;\n var ret =(gistid)?await gists.update(gistid,data) :await gists.create(data)\n ;\n if(to.togistdebug){\n console.log('gistid',ret.id)\n console.log('filename',fname)\n console.log('gist url',ret.html_url)\n }\n return ret;\n });\n\n to.togistsearch=(async (gistid,file)=>{\n //search id\n let url =\"https://api.github.com/gists/\" + gistid\n ,o={method:'GET',mode:'cors',headers:gists.headers}\n var ret =await gists.searchid(url,o)\n ;\n if(to.togistdebug) console.log('url',url);\n if(!file) return ret;\n return ret.files[file].raw_url \n })\n to.togistpage=(async (num)=>{\n let _num=num||'1'\n ,user=gists.user\n ,url =`https://api.github.com/users/${user}/gists?page=${_num}`\n ,o={method:'GET',mode:'cors',headers:gists.headers}\n ;\n var ret =await gists.search(url,o)\n ;\n if(to.togistdebug) console.log('url',url)\n return ret;\n\n });\n\n return Object.assign({},to,gists)\n }", "title": "" }, { "docid": "9716c10c939fd91065a37fb0d260b352", "score": "0.493331", "text": "hit(){}", "title": "" }, { "docid": "7990e82d758664e1faf1285b79038b42", "score": "0.49286184", "text": "function callToAPI_check(textSentiments){\n var dataSentiment = {text: textSentiments};\n //Calls for use of sentiment analysis on data from callToAPI_check()\n // Tyler mentioned that you can reuse the function(err,resp,body), but I'll bother him\n // with a bigger problem down the line ¯\\_(ツ)_/¯\n client.call('analyzesentiment', dataSentiment, function(err1, resp1, body1) {\n if (!err1) {\n // Will go down a nested chain from a .json file which is generated from the api\n // It pulls the decimal value associated with how high/low a particular phrase is rated\n var score = resp1.body1.aggregate.score;\n if (score > 0) {\n\n var dataRelatedConcepts = dataSentiment;\n client.call('findrelatedconcepts', dataRelatedConcepts, function(err2, resp2, body2) {\n if (!err2) {\n //console.log('am i here 3?')\n var relatedConcepts = resp2.body2.entities;\n for (var i=0; i<relatedConcepts.length; i++) {\n var relatedConcept = relatedConcepts[i];\n var text = relatedConcept.text;\n console.log(text);\n }\n }\n });\n }\n }\n });\n}", "title": "" }, { "docid": "ec45a1f1f5f41f02256f90eac50f5286", "score": "0.49193928", "text": "function makeRequest() {\n var url = 'https://mothership.fightforthefuture.org/campaigns/query?limit=1&since_timestamp=0';\n var Request = require('sdk/request').Request;\n Request({\n url: url,\n onComplete: onResponse\n }).get();\n}", "title": "" }, { "docid": "d2b5d6b2dc5fe0123892af8679251649", "score": "0.49034312", "text": "function main(request, response){\n var arr = request.url.split('/');\n\n if (arr.length < 2 || arr[1] === ''){\n explain(request, response);\n } else {\n arr.shift();\n process(arr, response);\n }\n\n function explain(){\n\n try {\n fs.readFile('README.md', 'utf8', function(err, md){\n\n // Load README.tmpl and insert markdown\n fs.readFile('README.tmpl', 'utf8', function(err, tmpl){\n\n var html = tmpl\n .replace('{{name}}', 'Heartbeat - An EKG for your application.')\n .replace('{{readme}}', md);\n\n respond(html, null, 'text/html');\n });\n });\n\n } catch(e){\n respond(\"Couldn't find README.md.\", 404);\n }\n }\n\n function process(arr){\n\n // Map array to an object\n var obj = {}\n , fields = ['email', 'time', 'value', 'min', 'max'];\n\n fields.forEach(function(d, i){\n obj[d] = arr[i];\n });\n\n // Hidden feature: If \"time\" isn't numeric, we'll use the string as the subject line and execute the alert immediately.\n if (typeof(obj.time) !== 'undefined'){\n if (!validator.isNumeric(obj.time)){\n obj.subject = obj.time;\n obj.time = 0;\n }\n }\n\n // Add useragent & address\n obj.useragent = request.headers['user-agent'];\n obj.address = request.headers['x-forwarded-for'] || request.connection.remoteAddress;\n\n // Handle 'cancel' case\n if (obj.time && obj.time === 'cancel'){\n obj.cancel = true;\n delete obj.time;\n }\n\n // Create/update heartbeat\n heartbeat(obj, handle);\n }\n\n function handle(error, response){\n if (error){\n var string = \"There was a problem with your request. \" + error.toString();\n respond(string, 400);\n } else {\n respond(response);\n }\n }\n\n function respond(string, code, type){\n\n code = code || 200;\n type = type || \"text/plain\";\n\n log.verbose(code + ': ' + string);\n\n response.writeHead(code, {\n \"Content-Type\": type,\n \"Content-Length\": string.length\n });\n response.write(string + '\\n');\n response.end();\n }\n}", "title": "" }, { "docid": "49baa3dafc09de9834f2074069efd463", "score": "0.48995247", "text": "function procFriendRequests()\n{\n\tvar strSection = 'Family invite processing';\n\tlogThis(strSection, 10, 'Processing ' + objFriendResults.snapshotLength + ' friend request(s).');\n\t\n\tfunction doTimeout(_intCurItem)\n\t{\n\t\ttry\n\t\t{\n\t\t\t//accepting friend requests\n\t\t\tvar\tobjSnapshotItem = objFriendResults.snapshotItem(_intCurItem),\n\t\t\t\tstrAddToMafiaURL_FB = GM_getValue('strMWBaseURL'),\n\t\t\t\tstrAddToMafiaURL_Zy = GM_getValue('strZyngaBaseURL'),\n\t\t\t\tstrHelpURL = GM_getValue('strMWBaseURL'),\n\t\t\t\telemAcceptButton,\n\t\t\t\tintFriendId = 0,\n\t\t\t\tfnSendToTimeout_FRClick,\n\t\t\t\tfnSendToTimeout_MafiaAdd,\n\t\t\t\tfnSendToTimeout_JobCalls;\n\t\t\t\t\n\t\t\t\n\t\t\tfor(var elem in objSnapshotItem.elements)\n\t\t\t{\n\t\t\t\tif(objSnapshotItem.elements[elem].type)\n\t\t\t\t{\n\t\t\t\t\tif\n\t\t\t\t\t(\n\t\t\t\t\t \tobjSnapshotItem.elements[elem].type.toLowerCase() == 'button' &&\n\t\t\t\t\t\tobjSnapshotItem.elements[elem].value.toLowerCase() == 'confirm'\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\telemAcceptButton = objSnapshotItem.elements[elem];\n\t\t\t\t\t\tfor(var i in objSnapshotItem.elements[elem].getAttribute('onclick').split('\"'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(/[\\d]+/.test(objSnapshotItem.elements[elem].getAttribute('onclick').split('\"')[i]))\t\n\t\t\t\t\t\t\t\tintFriendId = objSnapshotItem.elements[elem].getAttribute('onclick').split('\"')[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// adding new friends to mafia\n\t\t\tstrAddToMafiaURL_FB = strAddToMafiaURL_FB.concat('status_invite.php?from=', intFriendId);\n\t\t\tstrAddToMafiaURL_Zy = strAddToMafiaURL_FB.replace(GM_getValue('strMWBaseURL'), GM_getValue('strZyngaBaseURL'));\n\t\t\t\n\t\t\t// this is temp until i get vanity URL's sorted out\n\t\t\tif(!/[^\\d]+/.test(strThisFBId))\n\t\t\t\tstrAddToMafiaURL_Zy += '&fb_sig_added=1&fb_sig_user=' + strThisFBId;\n\t\t\telse\n\t\t\t\tstrAddToMafiaURL_Zy += '&fb_sig_added=0';\n\t\t\t\n\t\t\t// checking for help requests\n\t\t\tstrHelpURL += '/index.php?xw_controller=job&xw_action=give_help&skip_interstitial=1';\n\t\t\tstrHelpURL = strHelpURL.concat('&target_id=', intFriendId);\n\t\t\tstrHelpURL += '&job_city=';\n\t\t}\n\t\tcatch(objErr)\n\t\t{\n\t\t\tlogError(strSection, 'The values needed to process a friend request have an error.', objErr);\n\t\t\treturn false;\n\t\t}\n\t\tfnSendToTimeout_FRClick = function()\n\t\t{\n\t\t\tlogThis(strSection, 20, 'Accepting a friend request (Id: ' + intFriendId + ').');\n\t\t\telemAcceptButton.click();\n\t\t};\n\t\tfnSendToTimeout_MafiaAdd = function()\n\t\t{\n\t\t\tlogThis(strSection, 20, 'Adding a new friend to your mafia (Id: ' + intFriendId + ').');\n\t\t\tgetURL(strAddToMafiaURL_FB);\n\t\t\tgetURL(strAddToMafiaURL_Zy);\n\t\t\t\n\t\t};\n\t\tfnSendToTimeout_JobCalls = function()\n\t\t{\n\t\t\tlogThis(strSection, 20, 'Checking for available jobs (Id: ' + intFriendId + ').');\n\t\t\t// NY\n\t\t\tgetURL(strHelpURL + '1');\n\t\t\t// Cuba\n\t\t\tgetURL(strHelpURL + '2');\n\t\t};\n\t\t\n\t\tsetTimeout(fnSendToTimeout_FRClick, addDelay(GM_getValue('intDefaultWait', 1000)));\n\t\tsetTimeout(fnSendToTimeout_MafiaAdd, addDelay(GM_getValue('intAddToMafiaWait', 2500)));\n\t\tsetTimeout(fnSendToTimeout_JobCalls, addDelay(GM_getValue('intDefaultWait', 1000)));\n\t}\n\t\n\tfor(var i = 0; i < objFriendResults.snapshotLength; i++)\n\t{\n\t\tif(objFriendResults.snapshotItem(i) == null)\n\t\t\tcontinue;\n\t\telse\n\t\t\tdoTimeout(i);\n\t}\n\t\t\n\tsetTimeout(function(){ logThis(strSection, 20, 'Friend request processing complete.', false); }, addDelay(1));\n}", "title": "" }, { "docid": "b0edd2f47841d08ef9644d7719d1c857", "score": "0.48946267", "text": "function handleRequest(_request, _response) {\n //console.log(Http.request.toString());\n _response.setHeader(\"content-type\", \"text/html; charset=utf-8\"); // Der Variablen _response wird mit .setHeader ein Header gesetzt mit dne Eigenschaften content-type, text/html und charset=utf-8\n _response.setHeader(\"Access-Control-Allow-Origin\", \"*\"); //Der Header bekommt \"Access-Control-Allow-Origin\" mitgegeben. Das bewirkt, das teilen der Antwort des Servers mit dem abgerufenen Quellcodes. ein nettes sternchen wird auch mitgegeben um \"Alles\" miteinzubeziehen.\n let query = Qs.parse(_request.url.toString());\n let counter = 1;\n for (let key in query) {\n console.log(key);\n console.log(query[key]);\n _response.write(\"<p> \" + key + \" = \" + query[key] + \" </p>\");\n /*if (key == '/?treesgroupradio' || key == '/?standgroupradio' || key == 'mailboygroupradio' || key == 'standgroupradio') {\n _response.write(\"<p>Produktname: \" + query[key] + \" </p>\");\n } else if (key == 'lname') {\n _response.write(\"<p>Name: \" + query[key] + \" </p>\");\n } else if (key == 'street') {\n _response.write(\"<p>Strasse: \" + query[key] + \" </p>\");\n } else if (query[key] == 0) {\n } else {\n _response.write(\"<p>Produktname: \" + key + \" Anzahl: \" + query[key] + \" </p>\");\n }*/\n }\n //console.log(\"I hear voices!\");// Die Konsole hoert Stimmen... sollte evtl zum Psychiater... und den Akuten befall von Comic Sans behandeln lassen.\n //diese Zeile wollte nicht beschrieben werden.\n //Diese Leerzeile wird Ihnen praesentiert von Seitenbacher.\n //_response.write(_request.url);// Die request.url wird an den Header mitgegeben. \"The first time response.write() is called, it will send the buffered header information and the first chunk of the body to the client. The second time response.write() is called, Node.js assumes data will be streamed, and sends the new data separately. That is, the response is buffered up to the first chunk of the body.\" \n // Seitenbacher Leerzeilen, NUR von Seitenbacher. \n _response.end(); //reponse wird be.endet. Signaliesiert dem Server das alles gesendet wurde und die Nachricht komplett ist. \n }", "title": "" }, { "docid": "65caf2ba7379cba9b3035713c2480837", "score": "0.4893515", "text": "function search_suggestions(msg, destiny, sender_function)\n\t{\n\t\tvar dest = destiny.replace(/-/g, \" \");\n\t\tconsole.log(dest);\n\t\t var options = {\n\t url: 'http://www.metacritic.com/search/game/' + dest + '/results',\n\t headers: {\n\t 'User-Agent': 'request'\n\t },\n\t enconding: 'ascii'\n\t };\n\t\t\n\t\t request(options, function(error, response, html){\n\t\tif (error)\n\t\tconsole.log(error);\n if(!error){\n var $ = cheerio.load(html);\n var suggestions;\n\t\t\tvar message;\n\t\t\tvar i=0;\n\t\t\tmessage = \"Maybe you meant: \\n\";\n\t\t\t\n\t\t\t$('ul.search_results.module').children().filter(function(){\n\t\t\t\t\tif ($(this).hasClass('result'))\n\t\t\t\t\t{\n\t\t\t\tvar data = $(this).children().last().children().first();\n\t\t\t\tvar title = data.children().first().children().first().text();\n\t\t\t\tvar release = data.children().last().children().children().first().children().last().text();\n\t\t\t\tvar type = $(this).children().first().children().last().text() + ' ' + $(this).children().first().children().first().text();\n\t\t\t\tmessage = message + title + \"\\n\" + \"Type: \" + type + \"\\n\" + \"Release date: \" + release + \"\\n\";\t\n\t\t\t\tmessage = message + \"\\n\";\n\t\t\t\t\t}\t\t\t\t\n })\n\t\t\tvar fromId = msg.chat.id;\n sender_function(fromId, message);\n }\n\t\t\t})\n\t\t\n\t\n\t}", "title": "" }, { "docid": "49a30a4679f9d90754a0da78591f8ace", "score": "0.48809946", "text": "function buzzWordHandler(req, res, next) {\r\n\t\r\n\thttps.get(\r\n\t\t'https://corporatebs-generator.sameerkumar.website/',\r\n\t\tresponseFromAPI => {\r\n\t\t\tlet completeResponse = ''\r\n\t\t\tresponseFromAPI.on('data', chunk => {\r\n\t\t\t\tcompleteResponse += chunk\r\n\t\t\t})\r\n\t\t\tresponseFromAPI.on('end', () => {\r\n\t\t\t\t\r\n\t\t\t\tconsole.log(completeResponse);\r\n\t\t\t\t\r\n\t\t\t\t//const mymath = JSON.parse(completeResponse.text);\r\n\t\t\t\t\r\n\t\t\t\tconst msg = JSON.parse(completeResponse);\r\n\r\n\t\t\t\tlet dataToSend ;\r\n\t\t\t\tdataToSend = `Cool Corporate Buzz Word: ${msg.phrase}`\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t\treturn res.json({\r\n\t\t\t\t\tfulfillmentText: dataToSend,\r\n\t\t\t\t\tsource: 'BuzzWord'\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t},\r\n\t\terror => {\r\n\t\t\treturn res.json({\r\n\t\t\t\tfulfillmentText: 'Could not get results at this time',\r\n\t\t\t\tsource: 'BuzzWord'\r\n\t\t\t})\r\n\t\t}\r\n\t)\r\n\t\t\r\n}", "title": "" }, { "docid": "b205c9ebf8d7e3a9040590b5bf47120f", "score": "0.4880554", "text": "function liriRequest(request)\n{ \n if (process.argv.length >= 4)\n {\n // Create a string of the user arguments to pass to the APIs\n let userParameters = process.argv.slice(3).join(' '); \n\n if (request === 'concert-this')\n {\n bandsInTown(userParameters);\n }\n else if (request == 'spotify-this-song')\n {\n spotifyRequest(userParameters);\n }\n else if (request == 'movie-this')\n {\n omdbRequest(userParameters);\n }\n else \n { \n console.log('Not a valid request please type on of the following commands followed by a search term:'\n + '\\n concert-this <artist/band name here>'\n + '\\n spotify-this-song <song name here>'\n + '\\n movie-this <movie name here>'\n + '\\n do-what-it-says');\n }\n } \n else \n {\n if (request === 'concert-this')\n {\n console.log('Looks like you are missing the name of the artist/band. Please try again with an artist/band name.');\n }\n else if (request == 'spotify-this-song')\n {\n spotifyRequest('The Sign by Ace of Base');\n }\n else if (request == 'movie-this')\n {\n console.log('Looks like you are missing the name of a movie. Please try again with a movie name.');\n }\n else if (request == 'do-what-it-says')\n {\n doWhatItIs();\n }\n else \n {\n console.log('Please type one of the following commands followed by a search terms:'\n + '\\n concert-this <artist/band name here>'\n + '\\n spotify-this-song <song name here>'\n + '\\n movie-this <movie name here>'\n + '\\n do-what-it-says');\n }\n } \n}", "title": "" }, { "docid": "da13fbb5f085174db8d463ade01e8f4e", "score": "0.48747098", "text": "function request_ebay_information(isbn, res) {\n let post_data = querystring.stringify({ grant_type: \"client_credentials\" });\n var options = {\n method: \"POST\",\n hostname: \"api.ebay.com\",\n path: \"/identity/v1/oauth2/token?grant_type=client_credentials&scope=https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope\",\n headers: {\n \"content-type\": \"application/x-www-form-urlencoded\",\n authorization: `Basic ${get_authorization(\n Ebay_credentials.client_id,\n Ebay_credentials.client_secret\n )}`,\n },\n };\n let cache_valid = false;\n if (fs.existsSync(authentication_cache)) {\n cached_auth = require(authentication_cache);\n if (new Date(cached_auth.expiration) > Date.now()) {\n cache_valid = true;\n } else {\n console.log(\"Token Expired\");\n }\n }\n if (cache_valid) {\n request_ebay_listings(cached_auth, isbn, res);\n } else {\n let auth_sent_time = new Date();\n let authentication_req = https.request(\n options,\n function (authentication_res) {\n recieved_authentication(authentication_res, isbn, auth_sent_time, res);\n }\n );\n authentication_req.on(\"error\", function (e) {\n console.log(e);\n });\n console.log(\"Requesting Token\");\n authentication_req.end(post_data);\n }\n}", "title": "" }, { "docid": "b5a8292156458e91d1820e02dc19397e", "score": "0.4874316", "text": "function request_ebay_listings(cached_auth, isbn, res) {\n headers = {\n \"Content-Type\": \"application/json\",\n \"X-EBAY-C-MARKETPLACE-ID\": \"EBAY_US\",\n Authorization: `Bearer ${cached_auth.access_token}`,\n scope: \"https://api.ebay.com/oauth/api_scope\",\n };\n endpoint = `https://api.ebay.com/buy/browse/v1/item_summary/search?q=${isbn}`;\n let listings_req = https.get(\n endpoint,\n { headers: headers },\n function (listings_res) {\n let body = \"\";\n listings_res.on(\"data\", function (chunk) {\n body += chunk;\n });\n listings_res.on(\"end\", function () {\n let resultset = JSON.parse(body);\n serve_results(resultset, res);\n });\n }\n );\n listings_req.on(\"error\", function (e) {\n console.log(e);\n });\n}", "title": "" }, { "docid": "51371d59a3f09d818f5f708922cf4729", "score": "0.48734045", "text": "function apiCall(keyWord, searchIngredients){\n\n\n var queryURL = \"https://api.edamam.com/search?q=\"+ keyWord +\n \"&app_id=17487a38&app_key=3fd9c70aefdd3c029f018cb69009d471&to=1000&from=\"+ offset +\"\"\n ;\n \n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then(function(response){\n\n var r = response.hits[0].recipe; \n\n var obj = { primary: response.q,\n name: r.label,\n image: r.image,\n ingredients: r.ingredientLines,\n instructions: r.url\n }\n searchArray(searchIngredients, obj); \n \n })\n\n}// end apicall", "title": "" }, { "docid": "b1ab4fc5235104949a8b7ce02c99fd35", "score": "0.4861422", "text": "function main() {\n\tconst lotr = new HashMap(); // whomever came up with this exercise is clearly a LOTR fan. :)\n lotr.MAX_LOAD_RATIO = 0.5;\n lotr.SIZE_RATIO = 3;\n // Thinkful shows items as {\"Hobbit\": \"Bilbo\"}\n\tlotr.set('Hobbit', 'Bilbo');\n\tlotr.set('Hobbit', 'Frodo');\n\tlotr.set('Wizard', 'Gandalf');\n\tlotr.set('Human', 'Aragorn');\n\tlotr.set('Elf', 'Legolas');\n\tlotr.set('Maiar', 'The Necromancer');\n\tlotr.set('Maiar', 'Sauron');\n\tlotr.set('RingBearer', 'Gollum');\n\tlotr.set('LadyOfLight', 'Galadriel');\n\tlotr.set('HalfElven', 'Arwen');\n\tlotr.set('Ent', 'Treebeard');\n\tconsole.log(lotr);\n\n\tconsole.log(lotr.get('Maiar'));\n\tconsole.log(lotr.get('Hobbit'));\n}", "title": "" }, { "docid": "5fbd538e1d8a2ace2334d47cb4f6ea0f", "score": "0.48588392", "text": "function makeRequest() {\n let artistName = id(\"artist-search\").value;\n let songName = id(\"song-search\").value;\n let url = BASE_URL + \"/\" + artistName + \"/\" + songName;\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(processData)\n .catch(handleError);\n }", "title": "" }, { "docid": "6661675066b483d32c0137dbe91f1107", "score": "0.48566115", "text": "function reqTweets(){\n //create a variable for the keys\n\tvar client = new Twitter(\n\t\tkeys.twitterKeys\n\t);\n //create a variable to input as parameters => Twitter username and count of tweets to grab\n\tvar params = {\n\t\tscreen_name: 'TheKingdomDev',\n\t\tcount: 20\n\t};\n //use the twitter key and parameters to get data from the API - loop over and print out each of the tweets to the console\n\t\tclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n\t\t \t// console.log(response)\n\t\t \tif (!error) {\n\t\t \tfor (i=0; i<tweets.length; i++){\n\t\t \t\tconsole.log(i + \" \" + tweets[i].text + \" Time Created: \" + tweets[i].created_at);\n\t\t \t\t// appendLog(i + \" \" + tweets[i].text + \" Time Created: \" + tweets[i].created_at);\n //create a variable to store the data from the request append that JSON data\n\t\t \t\tvar twitterLog ={\n\t\t \t\t\t\ttweetNumber: i,\n\t\t \t\t\t\ttweetText: tweets[i].text,\n\t\t \t\t\t\ttweetTime: tweets[i].created_at\n\t\t \t\t}\n //append to log.txt\n\t\t \t\tappendLog(JSON.stringify(twitterLog));\t\t \t\t \t\t\n\t\t \t}\n\t\t \t}else{\n\t\t \t\treturn console.log(\"Error!\");\n\t\t \t\t}\n\t\t\t});\n}", "title": "" }, { "docid": "d0bfefc2cdbe832cf274206d04ba750c", "score": "0.4856236", "text": "function api_call(){\n for (var i=0;i<twitterfeed.length;i++) \n {\n http_options.body = {\"text\":twitterfeed[i][Object.keys(twitterfeed[i])[0]]};\n xhrfetchcalllist.push(xhr.fetch(url,http_options));\n }\n\n \n return Promise.all(xhrfetchcalllist)\n .then(function (responses) {\n for (var j=0;j<responses.length;j++)\n {\n const body = JSON.parse(responses[j].body);\n \n // Iterating through the tweets\n for (var t=0;t<body.document_tone.tone_categories[0].tones.length;t++)\n {\n var scoredetails = body.document_tone.tone_categories[0].tones[t]\n // console.log(scoredetails);\n if (scoredetails.tone_id == \"anger\")\n {\n AngerAvgScore = AngerAvgScore+scoredetails.score;\n \n\n }\n if (scoredetails.tone_id == \"fear\")\n {\n FearAvgScore = FearAvgScore+scoredetails.score;\n \n }\n if (scoredetails.tone_id == \"disgust\")\n {\n \n DisgustAvgScore = DisgustAvgScore+scoredetails.score;\n \n }\n if (scoredetails.tone_id == \"sadness\")\n {\n SadnessAvgScore = SadnessAvgScore+scoredetails.score;\n }\n if (scoredetails.tone_id == \"joy\")\n {\n JoyAvgScore = JoyAvgScore+scoredetails.score;\n \n }\n\n \n }\n tonescoreDict = {\"tweetscore\":{\"AngerAvgScore\":AngerAvgScore,\"FearAvgScore\":FearAvgScore,\"SadnessAvgScore\":SadnessAvgScore,\"DisgustAvgScore\":DisgustAvgScore,\"JoyAvgScore\":JoyAvgScore},\"lastupdatedTime\":date_const.getTime()};\n console.log(\"INDIVIDUAL\",tonescoreDict);\n \n }\n\n console.log(\"FINAL TONE SCORE\",tonescoreDict);\n // storing the tonescore for that particular brandname in the database.\n db.set(brandname,tonescoreDict);\n var tweetscore_dict = {};\n var tweetscore_apicall = {};\n \n tweetscore_dict = tonescoreDict.tweetscore;\n\n console.log(tweetscore_dict,tweetlength,\"TWEET SCORE, TWEET LENGTH\");\n // Calculating the average of the tweet score\n for (var tweetkey in tweetscore_dict){\n tweetscore_apicall[tweetkey] = tweetscore_dict[tweetkey]/tweetlength;\n }\n console.log(\"AFTER AVERAGE CALCULATION\",tweetscore_apicall);\n delete request.message.twitterfeed;\n request.message.tonescore = tweetscore_apicall;\n console.log(request.message,\"REQUEST MESSAGE API CALL\");\n \n return request;\n \n });\n \n \n \n }", "title": "" }, { "docid": "0177758083541ceda6367d7024d8ec8e", "score": "0.48543888", "text": "function forge_hits() {\r\n var strength = $('#fighter_skill').text().replace(\",\",\"\");\r\n var rank_string = $('#rank_icon').attr('title').split(':')[1].trim();\r\n var military_rank = forge_rank[rank_string];\r\n forge_config.hitQ7 = forge_hits_calculate(military_rank, strength, 200, 1, 1);\r\n}", "title": "" }, { "docid": "b10054db0e66385cf8e7f8fe074fee4c", "score": "0.48530588", "text": "function RequestHandler() {\n\n /// funzione che cerca i token nell'header\n this.token = function() {\n return this.request.get('Authorization');\n }\n\n /// funzione che ottiene i dati cercati e li invia\n /// in risposta\n this.execute = function() {\n // execute MUST be overridden \\\n // by all RequestHandler subclasses to create \\\n // the respose object and send it');\n };\n}", "title": "" }, { "docid": "ebc4e66e30c86d466e8d78ad74942a09", "score": "0.48523256", "text": "async hotelSearchHandler(req, res) {\n let hotelData;\n try {\n hotelData = await requestHotelData();\n } catch (error) {\n res.status(400).json({ error });\n return;\n }\n const mergedData = mergeSortedArraysByEcstasy(parseHotelData(hotelData));\n res.status(200).json({\n results: mergedData\n });\n }", "title": "" }, { "docid": "da9206f1dc1e06faa4c2d4c38b0aef72", "score": "0.48512033", "text": "function fetchGuardianData() {\n\tvar bUrl = \"http://content.guardianapis.com/search\";\n\tvar parms = {\n\t\t'from-date': timeInterval.toISOString(),\n\t\t'order-by': 'oldest',\n\t\t'q': searchterm,\n\t\t'api-key': G_APIKEY\n\t\t};\n\n\trequest ( {uri: bUrl, qs: parms} , function(error, guardianResponse, body) {\n\t\tif (!error) {\n\t\t\t// process Guardian Data\n\t\t\tparseGuardianData(JSON.parse(body));\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Error retrieving from Guardian: \" + error);\n\t\t\t// notify the system that we're done getting Guardian Data.\t\n\t\t\tGuardianDone = true;\n\t\t}\n\t\t\n\t});\t\n}", "title": "" }, { "docid": "a8ca801718a67837447f57083c1a048b", "score": "0.48482007", "text": "async function hit(contract,address) {\n\tlet verified;\n\tawait contract.methods.verifyHit().call({from: address}).then((res)=>{\n\t\tverified = res; \n\t});\n\tif (!verified) {\n\t\tconsole.log(\"Invalid Hit\");\n\t\treturn;\n\t}\n\tlet randNum;\n\tdo {\n\t\trandNum = await randomatic('0',20);\n\t} while (randNum.charAt(0)=='0'); // Put into function\t\n\tawait makeEventListener(contract,10,async()=>{ // Change later to make sure it only responds to user's event\n\t\tawait contract.methods.hit().send({from: address});\n\t\t//Uncomment following lines to see player cards\n\t\t/*await contract.methods.showCards().call({from: address})\n\t\t\t.then(console.log);\n\t\tawait contract.methods.showSplitCards().call({from: address})\n\t\t\t.then(console.log);*/\n\t});\n\tawait makeEventListener(contract,8,async()=>{\n\t\tawait contract.methods.numRequest(randNum).send({from: address});\t\t//Randomize\n\t\tawait timeBurn(contract,ownerKey)\n\t});\n\tawait contract.methods.submitAutoHashRequest(randNum).send({from: address});\n\tawait timeBurn(contract,ownerKey);\n}", "title": "" }, { "docid": "1651b57af86f6f02c34c418dd9306b61", "score": "0.4847383", "text": "function search_game(msg, destiny, sender_function)\n\t{\n\t\tvar game = destiny.split('/');\n\t\tgame = game[1];\n\t\t//Converts abbreviations to full console names used in metacritic database\n\t\tdestiny = destiny.replace(/ps4/, \"playstation-4\");\n\t\tdestiny = destiny.replace(/ps3/, \"playstation-3\");\n\t\tdestiny = destiny.replace(/ps2/, \"playstation-2\");\n\t\tdestiny = destiny.replace(/ps/, \"playstation\");\n\t\tdestiny = destiny.replace(/n64/, \"nintendo-64\");\n\t\tdestiny = destiny.replace(/gc/, \"gamecube\");\n\t\tdestiny = destiny.replace(/gba/, \"game-boy-advance\");\n\t\tdestiny = destiny.replace(/gb/, \"game-boy\");\n\t //We need to send an user-agent to get metacritic's answer\n\t var options = {\n\t url: 'http://www.metacritic.com/game/' + destiny + '/',\n\t headers: {\n\t 'User-Agent': 'request'\n\t },\n\t enconding: 'ascii'\n\t };\n\t\t\n\t\t\n\t request(options, function(error, response, html){\n\t\tif (error)\n\t\tconsole.log(error);\n if(!error){\n var $ = cheerio.load(html);\n var title, release, description, critic_rating, user_rating;\n\t\t\tvar message;\n\t\t\tvar i = 0;\n\t\t\tvar j = 0;\n\t\t\tvar error = 0;\n\t\t\t\n\t\t\t$('.error_code').filter(function(){\n\n var data = $(this).text();\n if (data.localeCompare('404') == 0)\n\t error = 1;\n })\n\t\t\t\n $('.product_title').filter(function(){\n\n var data = $(this).children().first().children().first();\n\n title = data.text();\n\t\t\t\t\n\t\t\t\tconsole.log(\"Title:\" + title);\n if(j<1)\n message = title + \"\\n\";\n\t j++;\n\n })\n\t\t\t\n\t\t\t\t$('.summary_detail.release_data').filter(function(){\n\n var data = $(this).children().last();\n release = data.text();\n message = message + \"Release date: \" + release + \"\\n\";\n })\n\t\t\tmessage = message + \"\\n\";\t\n\t\t\t\n\t\t\t$('.summary_detail.product_summary').filter(function(){\n\n var data = $(this).children().last().children().first().children().eq(1);\n\n\t\t\t\tif (data.attr('itemprop') === 'description')\n\t\t\t\t{\n description = data.text();\n\t\t\t\tif (description.length>4096)\n\t\t\t\t{\n\t\t\t\t\tdata = $(this).children().last().children().first().children().eq(0);\n\t\t\t\t\tdescription = data.text();\n\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdata = $(this).children().last().children().first();\n\t\t\t\tdescription = data.text();\n\t\t\t}\n message = message + \"Summary: \" + description + \"\\n \\n\";\n })\n\t\t\tmessage = message + \"\\n\";\n\t\t\t\n\t\t\t$('.metascore_w.xlarge').filter(function(){\n\n var data = $(this);\n\n critic_rating = data.children().last().text();\n\n message = message + \"Critics rating: \" + critic_rating +\"/100 \\n\";\n\n })\n\t\t\t\n\t\t\t$('.metascore_w.user.large').filter(function(){\n\n var data = $(this);\n\n user_rating = data.text();\n if (i<1)\n message = message + \"Users rating: \" + Number(user_rating)*10 +\"/100 \\n\";\n\t\t i++;\n\n })\n\t\t\tif (error==1)\n\t\t\t{\n\t\t\t\t message = \"The game doesn't exists or can't be found. Check if you wrote its name correctly.\" + \n\t\t \"If it has a remake or several remakes, write its year at the end\";\n\t\t var fromId = msg.chat.id;\n sender_function(fromId, message);\n\t\t\t\tsearch_suggestions(msg, game, sender_function);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tvar fromId = msg.chat.id;\n sender_function(fromId, message);\n\t\t\t}\n }\n }) \n\t}", "title": "" }, { "docid": "0f44824416c5b5075fe8d40e0b09b87d", "score": "0.48473576", "text": "function requestData(){\n //request films \n axios.get(starWarsFilm).then(response =>{\n getLongestCrawl(response.data.results);\n\n \n }).catch(e =>{\n console.log(\"not available\")\n })\n // request people\n axios.get(starWarsPeople).then(response =>{\n getMostAppeared(response.data.results);\n getValidPeople(response.data.results);\n }).catch(e =>{\n console.log(\"not available\")\n })\n //request species\n axios.get(starWarsSpecies).then(response =>{\n getSpeciesAppearance(response.data.results);\n }).catch(e =>{\n console.log(\"not available\")\n })\n //request planet\n axios.get(starWarsPlanets).then(response =>{\n getPlanet_With_Largest_Vehicle_Pilot(response.data.results);\n\n }).catch(e =>{\n console.log(\"not available\")\n })\n\n \n}", "title": "" }, { "docid": "c0f2bfb6f4f2ac9b7772647e44195e1e", "score": "0.48450223", "text": "function requestHandler(request, response) {\n\n console.log('DialogFlow RQ from ' + request.headers.host);\n console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));\n console.log('Dialogflow Request body: ' + JSON.stringify(request.body));\n\n const agent = new WebhookClient({ request, response });\n\n function oneOf(arr) {\n let n = Math.round((arr.length-1)*Math.random());\n return arr[n];\n }\n \n function welcome(agent) {\n agent.add(oneOf([\n `Hi! It may be windy or not, do you want to know?`,\n `Carefull! water is very wet today!`, \n \"Yo! Do you want to go sailing?\",\n \"Is it a great day to go sailing?\",\n \"Ahoy Mate!\",\n \"It may be a great day to go sailing!\"]));\n }\n \n function fallback(agent) {\n agent.add(oneOf([`I didn't understand.`,`Say what?`,`Sorry, come again?','What was that?`]));\n }\n \n function doForecast(agent,name){\n name = name.toLowerCase();\n var zone = '';\n if(name=='bodega'||name=='bodega bay'||name=='bodega harbor'||name=='tomales'||name=='dillon'||name=='dillon beach')\n zone='pzz540';\n else {\n zone = findIdByName(noaaZones, name);\n console.log(\"findZoneCodeByName \" + name + \" => \" + zone);\n }\n if(zone!=='')\n {\n var p = promiseToFetchNWSForecast(zone)\n .then((fc) => {\n agent.add(formatForecast(fc));\n })\n .catch((err)=> { \n agent.add(\"Forecast fetch error:\" + err); \n });\n return p;\n } \n else\n agent.add('I do not know yet how to find forecast locations such as '+name);\n }\n \n function observations(agent){\n var par = agent.parameters.id;\n if(!par)\n return promiseFetchFormattedObservations().then((txt)=>{\n agent.add(txt);\n })\n .catch((err)=> { \n agent.add(\"Sorry, crashed.\");\n console.log('observations:' + err); \n });\n else\n return noaabuoy(agent);\n }\n \n function summery(agent) {\n var ftxt, otxt, ttxt;\n var p = [ \n promiseFetchFormattedObservations()\n .then((txt)=>{ otxt = txt; })\n .catch((err)=>{ otxt = \"No meteo information.\"; console.log(\"summery/meteo: \" + err); }),\n promiseToFetchNWSForecast('pzz540')\n .then((fc) => { ftxt = checkForWindFormatForecast(fc,true); })\n .catch((err)=>{ ftxt = \"No forcast information.\"; console.log(\"summery/forecast: \" + err); }),\n promiseToFetchTidePredictions('9415469')\n .then((t)=>{\n console.log(\"fetched tides for summery: \" + t );\n ttxt = \"Tide \" + formatTides({name:\"Tomales Bay Entrance\", stationid:'9415469'},t); \n })\n .catch((err)=>{ ttxt = \" No tides information.\"; console.log(\"summery/tides: \"+err); })\n ];\n return Promise.all(p).then(()=>{ agent.add(otxt + \"\\n\" + ftxt + \"\\n\" + ttxt); });\n }\n \n function doTides(agent,location) {\n console.log(\"doTides location=\"+location);\n if(location==='tomales') location='tomales point';\n if(location==='bodega') location='bodega harbor';\n var promise = promiseToFindTideStation(location)\n .then( (reply) => {\n console.log(\"doTides got station list \");\n var list = reply.stationList;\n if(!list) \n agent.add(\"No matching stations found, try again.\"); \n else if(list.length>1) {\n var s = \"\"; const MX = 5;\n for(var i = 0; i < MX && i < list.length; i++)\n {\n s += list[i].name.split(',')[0] + \",\";\n }\n agent.add(\"Many stations found: \"+s+(list.length>MX?' and more.':'.'));\n }\n else if(list.length==1) {\n var station = list[0];\n return promiseToFetchTidePredictions(station.stationId)\n .then((tides)=>{ \n var msg = \"Tides for \";\n try {msg += station.name.split(',')[0];} catch(e){ msg+= station.name; }\n msg += \". \"\n agent.add(msg + formatTides(station,tides)); \n })\n .catch((err)=>{ \n console.log(\"doTides.catch \" + err); \n agent.add(\"No predictions for \" + station.name); \n });\n }\n })\n .catch( (err) => { \n console.log(\"doTides promise.catch \" + err);\n agent.add(\"I could not contact 'tides and currents'. Error \" + err);\n });\n return promise;\n }\n \n function tidesfor(agent) {\n let location = agent.parameters.location;\n return doTides(agent,location);\n }\n \n function tides(agent) {\n try{\n const locationctx = agent.getContext('location');\n let location = locationctx.parameters.location;\n return doTides(agent,location);\n }\n catch(e)\n {\n }\n\t agent.add(\"I seem to have lost current location. Please ask for it again.\");\n }\n \n function forecastfor(agent) {\n var location = agent.parameters.location;\n return doForecast(agent,location);\n }\n\n function forecast(agent) {\n const locationctx = agent.getContext('location');\n let location = 'bodega';\n if(locationctx) {\n let location = locationctx.parameters.location;\n }\n return doForecast(agent,location);\n }\n \n function zoneforecastfor(agent) {\n const zone = agent.parameters.zone;\n return promiseToFetchNWSForecast(zone)\n .then((fc)=>{\n agent.add(formatForecast(fc));\n console.log('NWS zone fc for ' + zone);\n })\n .catch((err)=>{\n agent.add(\"I could not get zone forecast from NWS for \"+zone); \n console.log(err);\n });\n }\n \n function locate(agent) {\n let location = agent.parameters.location;\n return promiseToFetchGeocode(location)\n .then((resp)=>{\n if(!resp||!resp.candidates||resp.candidates.length===0) {\n agent.add(\"Could not find \"+location);\n return;\n } \n var s = '';\n if(resp.candidates.length>1) {\n s += \"Found \" + resp.candidates.length + \" candidates. \\n\";\n }\n for(var i = 0; i < resp.candidates.length && i < 3; i++) {\n var cand = resp.candidates[i];\n s += cand.address + \" - \";\n s += \" longitute: \" + round(cand.location.x,3);\n s += \" latitute: \" + round(cand.location.y,3);\n s += \".\\n\";\n }\n agent.add(s);\n })\n .catch((err)=>{\n agent.add(\"geocode access failed \"+err);\n });\n }\n\n function willitbewindy(agent) {\n var par = agent.parameters.location;\n var zone = par ? par : 'pzz540';\n return promiseToFetchNWSForecast(zone)\n .then((fc)=>{\n var msg = checkForWind(fc);\n agent.add(msg);\n console.log('will it be windy ' + msg);\n })\n .catch((err)=>{\n agent.add(\"failed getting zone forecast from NWS for \"+zone); \n console.log(err);\n });\n }\n \n function noaabuoy(agent) {\n var par = agent.parameters.id;\n var id = par ? par : '46013';\n id = findIdByName(noaaBuoys, id);\n return promiseToFetchNoaaBuoy(id)\n .then((buoy)=>{\n agent.add(formatObservation(buoy,true));\n console.log(buoy);\n })\n .catch((err)=>{\n agent.add(\"failed getting buoy data from NOAA for \"+id);\n console.log(err);\n });\n }\n \n \n // Run the proper function handler based on the matched Dialogflow intent name\n let intentMap = new Map();const fetch = require('node-fetch');\n intentMap.set('zoneforecastfor', zoneforecastfor);\n intentMap.set('forecastfor', forecastfor);\n intentMap.set('forecast', forecast);\n intentMap.set('tidesfor', tidesfor);\n intentMap.set('tides', tides);\n intentMap.set('locate', locate);\n intentMap.set('observations', observations);\n intentMap.set('noaabuoy', noaabuoy);\n intentMap.set('willitbewindy', willitbewindy);\n intentMap.set('summery', summery);\n return agent.handleRequest(intentMap);\n}", "title": "" }, { "docid": "35d136e4b59764c9b9b2c9a2118189de", "score": "0.4844898", "text": "function getScammer (){\r\n var counters = 0;\r\n var max = 50;\r\n $.ajax({\r\n method: \"GET\",\r\n url: 'http://steam-antiscam.eu/system/getEntries.php',\r\n success: function (response) {\r\n var split1 = response.split(\"|-|-|\");\r\n split1.forEach(function (entry) {\r\n var split2 = entry.split(\",\");\r\n // Don't spam to much Ajax Posts\r\n if (counters <= max && !alreadyBlocked(split2[0])) {\r\n if (split2[1] === \"support\") {\r\n blockUser(split2[0], split2[1]);\r\n counters++;\r\n }else if (split2[1] === \"Private Profile\" && syncPrivateProfiles) {\r\n blockUser(split2[0], split2[1]);\r\n counters++;\r\n } else if (split2[1] === \"Community Banned\" && syncCommunityBanned) {\r\n blockUser(split2[0], split2[1]);\r\n counters++;\r\n } else if (split2[1] === \"Trade Banned\" && syncTradeBanned) {\r\n blockUser(split2[0], split2[1]);\r\n counters++;\r\n } else if (split2[1] === \"Private Inventory\" && syncPrivateInventory) {\r\n blockUser(split2[0], split2[1]);\r\n counters++;\r\n }\r\n }\r\n });\r\n }\r\n });\r\n}", "title": "" }, { "docid": "ce459b19c2916926fff2092b61a7d94f", "score": "0.48440853", "text": "function run() {\n if (inputOne === \"my-tweets\") {\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n console.log('');\n console.log('My Last 20 Tweets: ');\n console.log('--------------------------');\n tweets.forEach(function(individualTweet) {\n console.log('Time Posted: ' + individualTweet.created_at);\n console.log('Tweet: ' + individualTweet.text);\n console.log('--------------------------');\n });\n } else {\n console.log(error);\n };\n });\n log();\n } else if (inputOne === \"spotify-this-song\") {\n if (inputTwo.length < 1) {\n\n inputTwo = \"Middle\";\n };\n spotify.search({ type: 'track', query: inputTwo }, function(err, data) {\n if (err) {\n console.log('Error occurred: ' + err);\n return;\n }\n console.log('');\n console.log('Spotify Song Information Results: ');\n console.log('--------------------------');\n console.log(\"Artist(s): \" + data.tracks.items[0].artists[0].name);\n console.log(\"Track Title: \" + data.tracks.items[0].name);\n console.log(\"Link to Song: \" + data.tracks.items[0].preview_url);\n console.log(\"Album Title: \" + data.tracks.items[0].album.name);\n console.log('--------------------------');\n });\n log();\n } else if (inputOne === \"movie-this\") {\n if (inputTwo.length < 1) {\n inputTwo = \"Fight Club\";\n };\n request(\"http://www.omdbapi.com/?t=\" + inputTwo + \"&y=&plot=short&r=json&tomatoes=true\", function(error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log('');\n console.log('OMDB Movie Information: ');\n console.log('--------------------------');\n console.log(\"Movie Title: \" + JSON.parse(body).Title);\n console.log(\"Year of Release: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Countries produced in: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Movie Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actor(s): \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n console.log('--------------------------');\n } else {\n console.log(error);\n }\n });\n log();\n } else if (inputOne === \"do-what-it-says\") {\n log();\n fs.readFile('random.txt', 'utf8', function(err, data) {\n if (err) throw err;\n let arr = data.split(',');\n inputOne = arr[0].trim();\n inputTwo = arr[1].trim();\n run();\n });\n }\n}", "title": "" }, { "docid": "ff0470d8ab70b75aa157fe8e6500be1b", "score": "0.48428035", "text": "function handleRequest2(request, response) {\n\tresponse.end(phrases[Math.floor(Math.random() * phrases.length)]);\n}", "title": "" }, { "docid": "411335941b63e921adde0db57c7f2427", "score": "0.4842413", "text": "function makeRequest() {\n\treturn { \n\t\tmethod: 'GET', \n\t\theaders: {\n\t\t\t'Authorization': 'Basic '+btoa('roeivierkamp:C47FG5MxUdJR7MmZ'),\n\t\t\t'User-Agent': 'H4KScreen'\n\t\t}};\n}", "title": "" }, { "docid": "db09a29a038baf2b85c636b20e92bac0", "score": "0.48340806", "text": "function loadchlgheader( )\r\n\t{\r\n\t\td = new Date( );\r\n\t\tthistime = d.getTime( ).toString( );\r\n\t\tGM_setValue( \"SHC.themelisttime\", thistime );\r\n\r\n\t\tGM_log( \"SHC: Started loading new challengeheaders (in background)\" );\r\n\r\n\t\tvar url = \"http://www.flickr.com/groups/1129391@N22/discuss/72157625898776350/\";\r\n\r\n\t\tGM_xmlhttpRequest(\r\n\t\t{\r\n\t\t\tmethod:\"GET\",\r\n\t\t\turl:url,\r\n\t\t\theaders:{\r\n\t\t\t\t\"User-Agent\":\"monkeyagent\",\r\n\t\t\t\t\"Accept\":\"text/monkey,text/xml\"\r\n\t\t},\r\n\r\n\t\tonload:function( responseDetails ) \r\n\t\t{\r\n try {\r\n var tempDiv = document.createElement('div');\r\n tempDiv.innerHTML = responseDetails.responseText;\r\n\r\n var replies = document.evaluate(\".//div[@id='DiscussTopic']//table[@class='TopicReply']//td[@class='Said']\",\r\n tempDiv, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i = 0, len = replies.snapshotLength; i < len; ++i) {\r\n var reply = replies.snapshotItem(i);\r\n var title = reply.innerHTML.split(\"===Start of Title===\")[1]\r\n .split(\"===End of Title===\")[0]\r\n .replace(/<[^>]+>/g, '');\r\n var header = reply.innerHTML.split(\"===Start of Header===\")[1]\r\n .split(\"===End of Header===\")[0];\r\n GM_setValue( \"SHC.header.\" + (i+1) + \".title\", title);\r\n GM_setValue( \"SHC.header.\" + (i+1) + \".text\", header); // 1-based\r\n if (reply.innerHTML.match(\"===Start of Theme===\")) {\r\n var theme = reply.innerHTML.split(\"===Start of Theme===\")[1]\r\n .split(\"===End of Theme===\")[0]\r\n .replace(/<[^>]+>/g, '');\r\n GM_setValue( \"SHC.header.\" + (i+1) + \".theme\", theme);\r\n }\r\n }\r\n GM_setValue( \"SHC.headers\", replies.snapshotLength );\r\n\t\t\t//GM_setValue( \"SHC.SHCchlgheader\", headerSHC );\r\n\r\n\t\t\tGM_log( \"SHC: Loading new challengeheaders complete\" );\r\n } catch (e) {\r\n GM_log(\"error loading headers: \" + e);\r\n }\r\n\t\t}} ); // end GM_xmlhttpRequest\r\n\r\n\t}", "title": "" }, { "docid": "5ab17d226e3eb9fe874360aedace3364", "score": "0.48266488", "text": "function httpGet(theUrl, calledFrom) {\n var xmlHttp = new XMLHttpRequest();\n var parsedJson;\n\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4) {\n console.log(\"xmlHttp response text is : \" + xmlHttp.response);\n\n parsedJson = JSON.parse(xmlHttp.response);\n\n if (calledFrom == 'guess'){\n\n console.log(\"parsedJson.name is : \" + parsedJson.name);\n\n for (var key in parsedJson) {\n if (parsedJson.hasOwnProperty(key)) {\n console.log(key + \" -> \" + parsedJson[key]);\n }\n }\n\n document.getElementById(\"contentHolder\").innerHTML = parsedJson.name;\n\n } else {\n result = parsedJson;\n for (var key in parsedJson) {\n if (parsedJson.hasOwnProperty(key)) {\n console.log(key + \" -> \" + parsedJson[key]);\n }\n }\n console.log(\"parsedJson['question'] is : \" + parsedJson.text);\n\n document.getElementById(\"contentHolder\").innerHTML = parsedJson.text;\n }\n\n\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // false for synchronous request\n xmlHttp.send();\n }", "title": "" }, { "docid": "a8647faa9ca287c5c0be18e02a0de86b", "score": "0.48242962", "text": "handleTextMessage() {\n\n console.log('+++++++CHECKME:',this.webhookEvent);\n\n let nlpIntent = this.searchNLP(this.webhookEvent.message.nlp,'intent')\n let nlpLocation = this.searchNLP(this.webhookEvent.message.nlp,'location')\n let greeting = this.firstEntity(this.webhookEvent.message.nlp, \"greetings\");\n \n let message = this.webhookEvent.message.text.trim().toLowerCase();\n let response;\n\n console.log(nlpIntent);\n\n //GREETINGS\n if ((greeting && greeting.confidence > 0.8) || message.includes(\"start over\")) {\n response = Response.genNuxMessage(this.user);\n \n\n } else if (Number(message)) {\n response = Order.handlePayload(\"ORDER_NUMBER\");\n \n\n } else if (message.includes(\"#\")) {\n response = Survey.handlePayload(\"CSAT_SUGGESTION\");\n \n\n } else if (message.includes(i18n.__(\"care.help\").toLowerCase())) {\n let care = new Care(this.user, this.webhookEvent);\n response = care.handlePayload(\"CARE_HELP\");\n \n\n } else if((nlpIntent ==='test_me' && nlpIntent.confidence > 0.8) || this.webhookEvent.message.text.includes(\"test\")){\n //THIS CANT BE THE PLACE FOR THIS, THE DIFFERENCE WITH THE PLACES API\n //IS THAT AT THIS POINT WE ARE CARRYING A WELL ESTABLISHED PLACE ID\n //WE NEED TO HANDLE PAYLOAD, NOT OPEN MESSAGES\n //THIS WAS MOVED TO LINE 385\n \n this.recordByPlace();\n\n response;\n \n\n } else if((nlpIntent ==='request_accessibility_info' && nlpIntent.confidence > 0.8) || this.webhookEvent.message.text.includes(\"access\")){\n let location = new Location(this.user, this.webhookEvent);\n response = location.handlePayload(\"ACCESSIBILITY_REQUEST\");\n console.log('ACCESSIBILITY_REQUEST RESPONSE:',response);\n \n\n } else if((nlpIntent ==='declare_location' && nlpIntent.confidence > 0.8) || this.webhookEvent.message.text.includes(\"loca\")){\n \n this.getPlaceByText(message);\n response;\n \n } else if((nlpIntent ==='request_braile' && nlpIntent.confidence > 0.8) || this.webhookEvent.message.text.includes(\"braile\")){\n\n this.recordUserQuestion(message);\n // let location = new Location(this.user, this.webhookEvent);\n // response = location.handlePayload(\"LOCATION_BRAILE\");\n\n response;\n\n }else if((nlpLocation.suggested && nlpLocation.confidence > 0.8)){\n \n console.log('BY LOCATION');\n this.getPlaceByText(message);\n\n response;\n\n }else {\n \n response = [\n Response.genText(\n i18n.__(\"fallback.any\", {\n message: this.webhookEvent.message.text\n })\n ),\n Response.genText(i18n.__(\"get_started.guidance\")),\n Response.genQuickReply(i18n.__(\"get_started.help\"), [\n {\n title: i18n.__(\"menu.review\"),\n payload: \"LOCATION_REVIEW\"\n },\n {\n title: i18n.__(\"menu.check\"),\n payload: \"LOCATION_CHECK\"\n },\n {\n title:\"X\",\n payload: \"LOCATION_CLEAR\"\n }\n //,\n // {\n // title: \"suggestion\",\n // payload: \"CURATION\"\n // },\n // {\n // title: i18n.__(\"menu.help\"),\n // payload: \"CARE_HELP\"\n // }\n ])\n ];\n \n }\n\n return response;\n }", "title": "" }, { "docid": "813d88ae11e5933a9c51a8c4fd330177", "score": "0.4821471", "text": "_handleHeadwordResponse(e) {\n var nextHeadwordRows = e.detail.response.rows;\n var query = this.get(\"query\");\n var headwordsList = nextHeadwordRows.filter(function (row) {\n return row.key.startsWith(query);\n }).map(function (row) {\n return row.key;\n });\n this.set(\"headwords\", Array.from(new Set(headwordsList)));\n console.log(e.detail.response);\n }", "title": "" }, { "docid": "6e52ba9fe1f5e079cac45b2b080887b1", "score": "0.4820078", "text": "function apiTopChoice(keyWord, searchIngredients){\n\n\n var queryURL = \"https://api.edamam.com/search?q=\"+ keyWord +\n \"&app_id=17487a38&app_key=3fd9c70aefdd3c029f018cb69009d471&to=1000&from=\"+ offset +\"\"\n ;\n \n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then(function(response){\n\n var r = response.hits[0].recipe; \n\n var obj = { primary: response.q,\n name: r.label,\n image: r.image,\n ingredients: r.ingredientLines,\n instructions: r.url\n }\n searchArray(searchIngredients, obj); \n \n })\n\n}// end apicall", "title": "" }, { "docid": "432751e394abde22d375e736358659df", "score": "0.4819441", "text": "static scrapper() {\n let router = Router();\n\n router.get('/start', async (req, res, next) => {\n try {\n let scrapper = new Scrapper();\n store.dispatch(actions.scrapping(scrapper))\n .then(() => {\n const state = store.getState();\n if (!state.scrapper.error) {\n res.json({\n statusCode: res.statusCode,\n scrapped: state.scrapper.scrapped,\n influencers: state.scrapper.influencers,\n state: state\n });\n }\n else {\n next(state.scrapper.error)\n }\n })\n .catch(err => {\n res.status(500).json({\n statusCode: res.statusCode,\n error: err\n });\n })\n }\n catch (err) {\n res.status(500).json({\n statusCode: res.statusCode,\n error: err.toString()\n });\n }\n });\n\n router.get('/hashtags', (req, res) => {\n res.json({\n statusCode: res.statusCode,\n hashtags: settings.scrapper.hashtags\n });\n });\n\n router.post('/hashtags/add', (req, res) => {\n let hashtags = req.query.array;\n res.json({\n statusCode: res.statusCode,\n success: true,\n msg: \"Hashtags added successfully!\"\n });\n });\n\n // TODO\n router.post('/hashtags/edit', (req, res) => {\n res.json({\n statusCode: res.statusCode,\n });\n });\n\n // TODO\n router.delete('/hashtags/delete', (req, res) => {\n res.json({\n statusCode: res.statusCode,\n deleted: true,\n msg: \"Hashtags deleted successfully!\"\n });\n })\n\n return router;\n }", "title": "" }, { "docid": "d878b8aec424dedc4587709530b54664", "score": "0.48174596", "text": "function get_hunter_data(hunter_html){\r\n\r\n\thunter_html = String( hunter_html.replace(/\\sfbcontext=\"(.+?)\"/g, \"\") );\r\n\t\r\n\tvar hunter_data = Array();\r\n\thunter_data[_trap] = \"\";\r\n\thunter_data[_base] = \"\";\r\n\thunter_data[_location] = \"\";\r\n\thunter_data[_title] = \"\";\r\n\thunter_data[_cheese] = \"\";\r\n\thunter_data[_shield] = \"\";\r\n\thunter_data[_status] = \"\";\r\n\t\r\n\tif ( hunter_html.indexOf('The King wants to give you a reward!')!=-1 ){\t\t\r\n\t\thunter_data[_status] = \"KINGS REWARD\";\r\n\t\treturn hunter_data;\r\n\t}\r\n\telse if ( hunter_html.indexOf('MouseHunt will return shortly')!=-1 || hunter_html.indexOf('MouseHunt is curently unavailable')!=-1 ){\t\t\r\n\t\thunter_data[_status] = \"MAINTENANCE\";\r\n\t\treturn hunter_data;\r\n\t}\r\n\telse if ( hunter_html.indexOf('Sign up for Facebook to use MouseHunt.')!=-1 ){\t\t\r\n\t\thunter_data[_status] = \"NOT SIGNED IN\";\r\n\t\treturn hunter_data;\r\n\t}\r\n\t\r\n\thunter_data[_status] = \"OK\";\r\n\t\r\n\tvar trap = String( hunter_html.match(/<span id=\"app10337532241_hud_weapon\">(.+?)<\\/span>/)[0] );\r\n\ttrap = String( trap.toLowerCase().replace(/<(.+?)>/g, \"\") );\t\t\r\n\t\r\n\tvar base = String( hunter_html.match(/<span id=\"app10337532241_hud_base\">(.+?)<\\/span>/)[0] );\r\n\tbase = String( base.toLowerCase().replace(/<(.+?)>/g, \"\") );\t\r\n\t\r\n\tvar location = String( hunter_html.match(/<span id=\"app10337532241_hud_location\">(.+?)<\\/span>/)[0] );\r\n\tlocation = String( location.toLowerCase().replace(/<(.+?)>/g, \"\") );\r\n\t\r\n\tvar hunter_title = String( hunter_html.match(/<span id=\"app10337532241_hud_title\">(.+?)<\\/span>/)[0] );\r\n\thunter_title = String( hunter_title.toLowerCase().replace(/<(.+?)>/g, \"\") );\r\n\t\r\n\tvar cheese = String( hunter_html.match(/<span id=\"app10337532241_hud_baitName\">(.+?)<\\/span>/)[0] );\r\n\tcheese = String( cheese.toLowerCase().replace(/(<(.+?)>|&nbsp;)/g, \"\") );\r\n\t\r\n\tvar shield='inactive';\r\n\tif(hunter_html.indexOf('header_golden_shield.gif') != -1)\r\n\t\tshield='active';\r\n\t\r\n\t\r\n\ttrap = fix_trap(trap);\r\n\tbase=fix_base(base);\r\n\tcheese=fix_cheese(cheese);\r\n\thunter_title = fix_title(hunter_title);\r\n\tlocation = fix_location(location);\r\n\t\r\n\t\r\n\t\r\n\thunter_data[_trap] = trap;\r\n\thunter_data[_base] = base;\r\n\thunter_data[_location] = location;\r\n\thunter_data[_title] = hunter_title;\r\n\thunter_data[_cheese] = cheese;\r\n\thunter_data[_shield] = shield;\r\n\treturn hunter_data;\t\r\n\r\n}", "title": "" }, { "docid": "0efa46c342a47b627f655899501c795e", "score": "0.48130548", "text": "function userinfoRoute() {\n var userinfo = new express.Router();\n userinfo.use(cors());\n userinfo.use(bodyParser());\n // TEST BASE URL - GET ENDPOINT - query params may or may not be populated\n userinfo.get('/', function(req, res) {\n var world = req.query && req.query.hello ? req.query.hello : 'World';\n res.json({\n msg: 'API ' + world\n });\n });\n\n\n\n\n /**\n * API end point to be called by drupal app and the like\n * \n * @param req\n * @param res\n * @returns\n */\n userinfo.get('/userinfo.json', function(req, res) {\n res.header(\"Content-Type\", \"application/json; charset=utf-8\");\n getMasterJSON();\n var email = req.query.email;\n lang = req.query.lang;\n var subscriptions = {};\n subscriptions.userEmail = email;\n var validTenants = JSONALL.master.tenants.filter(function(el) {\n return el.visible;\n });\n var tenantLenth = validTenants.length;\n var mastertenants = [];\n // iterate through all the tenants for the given user email\n async.each(validTenants, function(tenant, callback) {\n \n // create a tenant object\n var tenantToAdd = {};\n tenantToAdd.name = tenant.name;\n if (lang === 'en') {\n tenantToAdd.description = tenant.description_en;\n \n } else {\n tenantToAdd.description = tenant.description_fr;\n \n }\n // Chain the two promises..if the user does not exist based on the\n // resolution of the first promise..just move along\n var idPromise = getClientIdForTenant(tenant, email);\n idPromise.then(function(payLoad) {\n if (JSON.parse(payLoad).status) {\n callback(null);\n } else {\n var userid = JSON.parse(payLoad).account.id;\n var appPromise = getTenantSubscriptionKeysForUser(userid, tenant);\n appPromise.then(function(keyInfo) {\n \t\n \tvar apps = JSON.parse(keyInfo);\n \tvar arrayLength = apps.applications.length;\n \tfor (var i = 0; i < arrayLength; i++) {\n \t var newLink = {};\n \t newLink.rel = \"self_new\";\n \t \n \t \n \t\n \t if(JSONALL.master.env === 'prod')\n {\n \t\t newLink.href = \"https://\" + tenant.name + \".api.canada.ca/admin/applications/\" + apps.applications[i].application.id + \"?lang=\"+lang;\n }\n else\n {\n \t newLink.href = \"https://\" + tenant.name + \".dev.api.canada.ca/admin/applications/\" + apps.applications[i].application.id + \"?lang=\"+lang;\n }\n \t \n \t \n \t \n \t apps.applications[i].application.links.push(newLink);\n \t console.log(\"checking this key \" + tenant.name +'-'+ apps.applications[i].application.service_id +'-'+ lang )\n \t var cachedApiName = cache.get(tenant.name +'-'+ apps.applications[i].application.service_id +'-'+ lang);\n \t if(cachedApiName)\n \t {\n \t\t apps.applications[i].application.apiname = cachedApiName;\n \t }\n \t else\n \t {\n \t\t// grab default name. might be in wrong language but elegance will come one day!\n\t\t\t\tif (cache.get(tenant.name +'-'+ apps.applications[i].application.service_id +'-default')){\n\t\t\t\t apps.applications[i].application.apiname = cache.get(tenant.name +'-'+ apps.applications[i].application.service_id +'-default');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t apps.applications[i].application.apiname = apps.applications[i].application.service_id;\n\t\t\t\t}\n \t }\n \t }\n \ttenantToAdd.applications = apps;\n console.log(\"pushing to master ten\" + tenantToAdd.name);\n pushToMasterTenant(mastertenants, tenantToAdd);\n callback(null);\n })\n }\n });\n }, function(err) {\n console.log('Final resolve/ Final callback');\n // if any of the tenant additions lead to an error....not happening\n\t // in our case but\n if (err) {\n // One of the iterations produced an error.\n // All processing will now stop.\n console.log('Failed to add a tenant..bailing out');\n } else {\n console.log('Adding master tenants ' + mastertenants.length);\n // add tenants to this subscription... return the json\n subscriptions.tenants = mastertenants;\n res.json(subscriptions);\n }\n });\n\n\n\n\n });\n\n\n\n\n /**\n * Get the users client id for the tenant\n */\n function getClientIdForTenant(tenant, email) {\n return new Promise(function(resolve, reject) {\n var url = 'https://' + tenant.admin_domain + '/admin/api/accounts/find.json?access_token=' + tenant.access_token + '&email=' + encodeURIComponent(email);\n request(url, function(err, response, body) {\n if (err)\n return reject(err);\n try {\n resolve(body);\n } catch (e) {\n reject(e);\n }\n });\n });\n }\n\n /**\n * Get the subscription info for the user for a given tenant\n */\n function getTenantSubscriptionKeysForUser(id, tenant) {\n console.log(\"this is the user id \" + id);\n return new Promise(function(resolve, reject) {\n var url = 'https://' + tenant.admin_domain + '/admin/api/accounts/' + id + '/applications.json?access_token=' + tenant.access_token;\n console.log(\"this is the url\" + url);\n request(url, function(err, response, body) {\n if (err)\n return reject(err);\n try {\n resolve(body);\n } catch (e) {\n reject(e);\n }\n });\n });\n }\n\n /**\n * making sure we push unique tenants...probably don't need it since there\n * are no bad global var...\n */\n function pushToMasterTenant(arr, obj) {\n const index = arr.findIndex((e) => e.name === obj.name);\n if (index === -1) {\n arr.push(obj);\n } else {\n arr[index] = obj;\n }\n }\n\n return userinfo;\n}", "title": "" }, { "docid": "f1867b39014fb13eb5572dca24848080", "score": "0.48116073", "text": "function searchAddress(id, key,callback){\n request({\n url: 'https://myurl/oauth/token', //URL to hit\n // qs: {from: 'blog example', time: +new Date()}, //Query string data\n method: 'POST',\n headers: {\n\n 'Authorization': 'Basic ' + btoa(client_id + ':' + client_secret),\n 'Accept': 'application/x-www-form-urlencoded',\n 'Content-Type': 'application/json'\n\n\n },\n body: \"client_id=\"+client_id+\"&scope=trust&grant_type=client_credentials\"\n }, function(error, response, body){\n\n if(body!=null){\n var jbody=JSON.parse(body);\n // console.log(body);\n if(error) {\n console.log(error);\n }\n\n else if(jbody.hasOwnProperty(\"access_token\")){\n\n var resBody=JSON.parse(body);\n var token=resBody.access_token;\n // console.log(response.statusCode,token);\n\n\n\n\n var obj={\n url:'https://myurl/operator/service/accounts/'+id,\n method :'GET',\n headers:{\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Authorization': 'Bearer '+token\n }\n\n };\n\n\n request(obj,function(error, response, body){\n if(error) {\n\n console.log(error);\n } else {\n console.log('auth was reached');\n\n var res=JSON.parse(body);\n if(res.addresses!=null && (0 in res.addresses)){\n //console.log(res.addresses)\n if(res.addresses[0].hasOwnProperty('addressLineOne') && res.addresses[0].addressLineOne != null){\n addressNeeded=res.addresses[0].addressLineOne+', '\n }\n if(res.addresses[0].hasOwnProperty('addressLineTwo') && res.addresses[0].addressLineTwo != null){\n addressNeeded=addressNeeded+res.addresses[0].addressLineTwo+', '\n }\n if(res.addresses[0].hasOwnProperty('city') && res.addresses[0].city != null){\n addressNeeded=addressNeeded+res.addresses[0].city+', '\n }\n if(res.addresses[0].hasOwnProperty('state') && res.addresses[0].state != null){\n if((res.addresses[0].state != \"string\")){\n addressNeeded=addressNeeded+res.addresses[0].state+', '\n }\n }\n\n if(res.addresses[0].hasOwnProperty('countryCode') && res.addresses[0].countryCode != null){\n addressNeeded=addressNeeded+res.addresses[0].countryCode\n }\n //addressNeeded=res.addresses[0].addressLineOne+', '+res.addresses[0].addressLineTwo+', '+res.addresses[0].city+', '+res.addresses[0].state+', '+res.addresses[0].countryCode;\n console.log(id+\": \"+addressNeeded)\n callback(addressNeeded,key,id)\n\n }else{\n\n //status.modify(id,2);\n console.log('Printing status object ......');\n // console.log(status);\n status.changeStatus(id,2,function(){\n status.update(id)\n });\n console.log(id+\": No address found\");\n\n }\n\n }\n }\n\n );\n}else {\n //console.log(body.code);\n if(jbody.hasOwnProperty('code')){\n console.log(jbody.description);\n }\n else{\n console.log(\"Error from operator api\");\n }\n}\n }});\n\n}", "title": "" }, { "docid": "96234229fb4bc29041c527f0d6c63345", "score": "0.48032752", "text": "function respondFunction(req,res){\n\tvar query = url.parse(req.url).query;\n\tvar pathname = url.parse(req.url).pathname;\n\tconsole.log(\"Request for \" + pathname + \" \" + query + \" received.\");\n\n\tif (query == \"List\") {\n\t\t\n\t\tif (req.user.token){\n\t\t\tUser.findOne({'token': req.user.token},function (err, token) {\n\t\t\t\tif (token){\n\t\t\t\t\tconsole.log('MongoDB detects you and lists your available CS modules here');\n\t\t\t\t\tmode = 1;\n\t\t\t\t\texec(\"aimlist \"+mode, function (error, stdout, stderr) { \n\t\t\t\t\t\tres.writeHead(200, {\"Content-Type\": \"text/plain\", \"Access-Control-Allow-Origin\": \"*\"});\n\t\t\t\t\t\tres.write(stdout);\n\t\t\t\t\t\tres.end();\n\t\t\t\t\t});\n\t\t\t\t\tconsole.log(mode);\n\t\t\t\t\tconsole.log(token.secret);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tconsole.log('MongoDB does not detect you and only lists your available AI modules here');\n\t\t\t\t mode = 0;\n\t\t\t\t exec(\"aimlist \"+mode, function (error, stdout, stderr) { \n\t\t\t\t\t\tres.writeHead(200, {\"Content-Type\": \"text/plain\", \"Access-Control-Allow-Origin\": \"*\"});\n\t\t\t\t\t\tres.write(stdout);\n\t\t\t\t\t\tres.end();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t}\n\t\telse{\n\t\t\tconsole.log('Please log in via Edit-> CommonSense Login');\n\t\t\tmode = 0;\n\t\t\texec(\"aimlist \"+mode, function (error, stdout, stderr) { \n\t\t\t\tres.writeHead(200, {\"Content-Type\": \"text/plain\", \"Access-Control-Allow-Origin\": \"*\"});\n\t\t\t\tres.write(stdout);\n\t\t\t\tres.end();\n\t\t\t});\n\t\t}\n\t\t\n\t}\n\telse if (pathname == \"/aimports\") {\n\t\tconsole.log(\"I am in aimports\")\n\t\texec(\"aimports \" + query, function (error, stdout, stderr) { \n\t\t\tres.writeHead(200, {\"Content-Type\": \"text/plain\", \"Access-Control-Allow-Origin\": \"*\"});\n\t\t\tres.write(stdout);\n\t\t\tres.end();\n\t\t});\n\t}\n\telse if (pathname == \"/cslogin2\") {\n\t\tvar oauth_symbols = query.split(\"&\");\n\t\tvar token = ''; var verifier = '';\n\t\tfor (var i = 0; i < oauth_symbols.length; i++) {\n\t\t\tvar str = oauth_symbols[i].split(\"=\");\n\t\t\t// get second part of string after the = sign and sanitize it\n\t\t\tif (i == 0) token = str[1].replace(/[^a-z 0-9]+/gi,'');\n\t\t\tif (i == 1) verifier = str[1].replace(/[^a-z 0-9]+/gi,'');\n\t\t}\n\t\t// warning: this secret can be temporarily stored, but subsequent token and secret need to go in user db\n\t\tvar secret = req.session.oauthsecret.replace(/[^a-z 0-9]+/gi,'');\n\t\tif ((token == \"\") || (secret == \"\")) {\n\t\t\tconsole.log(\"Not successful login for CommonSense\");\n\t\t\tres.render('gui', {title: 'AIM GUI', layout: false });\n\t\t} \n\t\tconsole.log(\"aimlogin oauth1 \" + token + \" \" + secret + \" \" + verifier);\n\t\texec(\"aimlogin oauth1 \" + token + \" \" + secret + \" \" + verifier, function (error, stdout, stderr) {\n\t\t\tvar vars = stdout.split(\"\\n\");\n\t\t\t\n\t\t\t//var instance = new User();\n\t\t\tfor (var i = 0; i < vars.length-1; i++) { \n\t\t\t\tconsole.log(\"t:\" + vars[i]);\n\t\t\t\t// store oauthtoken and oauthsecret\n\t\t\t\tif (i == 0) req.user.token = vars[i]; \n\t\t\t\tif (i == 1) req.user.secret = vars[i];\n\t\t\t\t\n\t\t\t}\n\t\t\treq.user.save(function (err) { } );\n\n\t\t\tres.render('gui', {title: 'AIM GUI', layout: false });\n//\t\t\tres.writeHead(200, {\"Content-Type\": \"text/plain\", \"Access-Control-Allow-Origin\": \"*\"});\n//\t\t\tres.write(stdout);\n//\t\t\tres.end();\n\t\t});\n\t}\n\t// the /cslogin command comes from CSLoginCommand\n\telse if (pathname == \"/cslogin\") {\n\t\tvar param = 'id=123'\n\t\t// this will return a oauth token but should also return a secret\n\t\tconsole.log(\"I am in cslogin and will execute 'aimlogin oauth0 \" + param + \"'\");\n\t\t\n\t\texec(\"aimlogin oauth0 \" + param, function (error, stdout, stderr) { \n\t\t\tres.writeHead(200, {\"Content-Type\": \"text/plain\", \"Access-Control-Allow-Origin\": \"*\"});\n\t\t\tvar vars = stdout.split(\"\\n\");\n\t\t\tfor (var i = 0; i < vars.length-1; i++) { \n\t\t\t\tconsole.log(\"t:\" + vars[i]);\n\t\t\t\tif (i == 0) var token = vars[i]; \n\t\t\t\tif (i == 1) req.session.oauthsecret = vars[i]; \n\t\t\t}\n\t\t\tres.write(token);\n\t\t\tres.end();\n\t\t});\n\t} \n\telse {\n\t\tconsole.log(\"Very dangerous code... we can run anything we want...\");\n\t\tvar body = '';\n\t\treq.on('data', function (data) {\n\t\t\tbody += data;\n\t\t\tconsole.log(data.toString());\n\t\t});\n\t\tconsole.log(\"body\"+body);\n\t\treq.on('end', function () {\n\n\t\t\tvar body_split=body.split(\"\\n\");\n\t\t\t//console.log(body_split[0]);\n\t\t\tfor (var i = 0; i<body_split.length-1;i++){\n\t\t\t\tconsole.log(body_split[i]);\n\t\t\t\t// sanitizing\n\t\t\t\t// first check if it starts with \"aim\"...\n\t\t\t\t// aimrun arg0 arg1\n\t\t\t\t// aimconnect arg0 arg1 arg2 arg3\n\t\t\t\tvar aimcmd = body_split[i].replace(/[^a-z 0-9]+/gi,'');\n\t\t\t\t//check for CS....Module\n\t\t\t\t// and append token and secret to argument list\n\t\t\t\t\n\t\t\t\t// execute aimrun, aimconnect etc. \n\t\t\t\texec(aimcmd, function (error, stdout, stderr) {\n\t\t\t\t\tconsole.log(stdout);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "22859f8b0042ca4640c734e4c320f75e", "score": "0.48023307", "text": "function _dict() { return {\n'a':['ey1','dt'],\n'able':['ey1 b-ah-l','jj'],\n'about':['ah b-aw1-t','in jj rb rp rbr'],\n'above':['ah b-ah1-v','in jj rb'],\n'act':['ae1-k-t','nn vbp vb'],\n'add':['ae1-d','vb vbp'],\n'afraid':['ah f-r-ey1-d','jj'],\n'after':['ae1-f t-er','in rb rp'],\n'again':['ah g-eh1-n','rb'],\n'against':['ah g-eh1-n-s-t','in'],\n'age':['ey1-jh','nn vb vbp'],\n'ago':['ah g-ow1','rb in'],\n'agree':['ah g-r-iy1','vb vbp'],\n'air':['eh1-r','nn vb'],\n'all':['ao1-l','dt rb pdt'],\n'allow':['ah l-aw1','vb vbp'],\n'also':['ao1-l s-ow','rb .'],\n'always':['ao1-l w-ey-z','rb'],\n'am':['ae1-m','vbp rb'],\n'among':['ah m-ah1-ng','in'],\n'an':['ae1-n','dt cc jj nnp'],\n'and':['ae1-n-d','cc jj rb nnp'],\n'anger':['ae1-ng g-er','nn vb vbp'],\n'animal':['ae1 n-ah m-ah-l','nn jj'],\n'answer':['ae1-n s-er','nn vb vbp'],\n'any':['eh1 n-iy','dt rb'],\n'appear':['ah p-ih1-r','vb vbp'],\n'apple':['ae1 p-ah-l','nn'],\n'are':['aa1-r','vbp nnp'],\n'area':['eh1 r-iy ah','nn'],\n'arm':['aa1-r-m','nn vb'],\n'arrange':['er ey1-n-jh','vb vbp'],\n'arrive':['er ay1-v','vb vbp'],\n'art':['aa1-r-t','nn'],\n'as':['ae1-z','in nnp jj rb'],\n'ask':['ae1-s-k','vb vbp'],\n'at':['ae1-t','in rb rp'],\n'atom':['ae1 t-ah-m','nn'],\n'baby':['b-ey1 b-iy','nn uh'],\n'back':['b-ae1-k','rb in jj nn rp vb vbp'],\n'bad':['b-ae1-d','jj nn rb'],\n'ball':['b-ao1-l','nn vb'],\n'band':['b-ae1-n-d','nn vb'],\n'bank':['b-ae1-ng-k','nn vbp vb'],\n'bar':['b-aa1-r','nn vb vbp'],\n'base':['b-ey1-s','nn vbp jj vb'],\n'basic':['b-ey1 s-ih-k','jj nn'],\n'bat':['b-ae1-t','nn vb'],\n'be':['b-iy1','vb'],\n'bear':['b-eh1-r','vb nn vbp'],\n'beat':['b-iy1-t','vb jj nn vbd vbn vbp'],\n'beauty':['b-y-uw1 t-iy','nn'],\n'bed':['b-eh1-d','nn vb vbp'],\n'before':['b-ih f-ao1-r','in rb rp'],\n'begin':['b-ih g-ih1-n','vb vbp'],\n'behind':['b-ih hh-ay1-n-d','in nn rb rp'],\n'believe':['b-ih l-iy1-v','vbp vb'],\n'bell':['b-eh1-l','nn'],\n'best':['b-eh1-s-t','jjs rbs jjss nn rb vb'],\n'better':['b-eh1 t-er','jjr rbr jj rb vb'],\n'between':['b-ih t-w-iy1-n','in rb'],\n'big':['b-ih1-g','jj rb'],\n'bird':['b-er1-d','nn'],\n'bit':['b-ih1-t','nn vbd vbn jj rb vb'],\n'black':['b-l-ae1-k','jj nn vb'],\n'block':['b-l-aa1-k','nn vbp jj vb'],\n'blood':['b-l-ah1-d','nn vb'],\n'blow':['b-l-ow1','nn vb vbp'],\n'blue':['b-l-uw1','jj nn'],\n'board':['b-ao1-r-d','nn rb vb'],\n'boat':['b-ow1-t','nn vb'],\n'body':['b-aa1 d-iy','nn'],\n'bone':['b-ow1-n','nn vb'],\n'book':['b-uh1-k','nn vb'],\n'both':['b-aa1-th','jj rb prp'],\n'bottom':['b-aa1 t-ah-m','nn jj vb'],\n'box':['b-aa1-k-s','nn vb'],\n'boy':['b-oy1','nn uh'],\n'branch':['b-r-ae1-n-ch','nn vb'],\n'bread':['b-r-eh1-d','nn'],\n'break':['b-r-ey1-k','vb nn vbp'],\n'bright':['b-r-ay1-t','jj rb'],\n'bring':['b-r-ih1-ng','vb vbp'],\n'broad':['b-r-ao1-d','jj'],\n'broke':['b-r-ow1-k','vbd vbn jj rb vb'],\n'brother':['b-r-ah1 dh-er','nn'],\n'brown':['b-r-aw1-n','jj nn vb'],\n'build':['b-ih1-l-d','vb vbn vbp nn'],\n'burn':['b-er1-n','vb vbp nn'],\n'busy':['b-ih1 z-iy','jj'],\n'but':['b-ah1-t','cc in jj rb'],\n'buy':['b-ay1','vb vbp nn jj'],\n'by':['b-ay1','in rb rp'],\n'call':['k-ao1-l','vb nn vbp'],\n'camp':['k-ae1-m-p','nn vb'],\n'can':['k-ae1-n','md nn vb'],\n'capital':['k-ae1 p-ah t-ah-l','nn jj'],\n'captain':['k-ae1-p t-ah-n','nn vb vbp'],\n'car':['k-aa1-r','nn'],\n'card':['k-aa1-r-d','nn'],\n'care':['k-eh1-r','nn vb vbp'],\n'carry':['k-ae1 r-iy','vb nn vbp'],\n'case':['k-ey1-s','nn vb'],\n'cat':['k-ae1-t','nn'],\n'catch':['k-ae1-ch','vb vbp nn'],\n'cause':['k-aa1-z','nn vb vbg vbp'],\n'cell':['s-eh1-l','nn'],\n'cent':['s-eh1-n-t','nn'],\n'center':['s-eh1-n t-er','nn jj rb vb vbp'],\n'century':['s-eh1-n ch-er iy','nn'],\n'certain':['s-er1 t-ah-n','jj rb'],\n'chair':['ch-eh1-r','nn vb'],\n'chance':['ch-ae1-n-s','nn jj vb vbp'],\n'change':['ch-ey1-n-jh','nn vbp vb'],\n'character':['k-eh1 r-ih-k t-er','nn'],\n'charge':['ch-aa1-r-jh','nn vbp vb'],\n'chart':['ch-aa1-r-t','nn vb vbp'],\n'check':['ch-eh1-k','nn vbp vb'],\n'chick':['ch-ih1-k','nn'],\n'chief':['ch-iy1-f','jj nn'],\n'child':['ch-ay1-l-d','nn'],\n'choose':['ch-uw1-z','vb vbp'],\n'chord':['k-ao1-r-d','nn'],\n'circle':['s-er1 k-ah-l','nn vb'],\n'city':['s-ih1 t-iy','nn'],\n'claim':['k-l-ey1-m','nn vbp vb'],\n'class':['k-l-ae1-s','nn vb'],\n'clean':['k-l-iy1-n','jj vbp rb vb'],\n'clear':['k-l-ih1-r','jj rb vb vbp'],\n'climb':['k-l-ay1-m','vb vbp nn'],\n'clock':['k-l-aa1-k','nn vb vbp'],\n'close':['k-l-ow1-s','vb vbp jj'],\n'clothe':['k-l-ow1-dh','vb'],\n'cloud':['k-l-aw1-d','nn vb vbp'],\n'coast':['k-ow1-s-t','nn vb'],\n'coat':['k-ow1-t','nn vb'],\n'cold':['k-ow1-l-d','jj nn'],\n'collect':['k-ah l-eh1-k-t','vb jj vbp'],\n'colony':['k-aa1 l-ah n-iy','nn'],\n'color':['k-ah1 l-er','nn jj vb vbp'],\n'column':['k-aa1 l-ah-m','nn'],\n'come':['k-ah1-m','vb vbd vbn vbp vbz jj'],\n'common':['k-aa1 m-ah-n','jj nn'],\n'company':['k-ah1-m p-ah n-iy','nn'],\n'compare':['k-ah-m p-eh1-r','vb vbp nn'],\n'complete':['k-ah-m p-l-iy1-t','jj vb vbp'],\n'condition':['k-ah-n d-ih1 sh-ah-n','nn vbp vb'],\n'connect':['k-ah n-eh1-k-t','vb vbp'],\n'consider':['k-ah-n s-ih1 d-er','vb vbp'],\n'consonant':['k-aa1-n s-ah n-ah-n-t','jj nn'],\n'contain':['k-ah-n t-ey1-n','vb vbp'],\n'continent':['k-aa1-n t-ah n-ah-n-t','nn'],\n'continue':['k-ah-n t-ih1 n-y-uw','vb vbp'],\n'control':['k-ah-n t-r-ow1-l','nn jj vb vbp'],\n'cook':['k-uh1-k','nn vb vbp'],\n'cool':['k-uw1-l','jj nn rb vb vbp'],\n'copy':['k-aa1 p-iy','nn vbp vb'],\n'corn':['k-ao1-r-n','nn'],\n'corner':['k-ao1-r n-er','nn jj vb'],\n'correct':['k-er eh1-k-t','jj vbp vb'],\n'cost':['k-aa1-s-t','nn vbd vbn vbp vb'],\n'cotton':['k-aa1 t-ah-n','nn'],\n'could':['k-uh1-d','md'],\n'count':['k-aw1-n-t','nn vb vbp'],\n'country':['k-ah1-n t-r-iy','nn'],\n'course':['k-ao1-r-s','nn rb vb'],\n'cover':['k-ah1 v-er','vb nn vbp'],\n'cow':['k-aw1','nn vb'],\n'crease':['k-r-iy1-s','nn'],\n'create':['k-r-iy ey1-t','vb vbp'],\n'crop':['k-r-aa1-p','nn rp vb vbp'],\n'cross':['k-r-ao1-s','vb jj nn rb vbp'],\n'crowd':['k-r-aw1-d','nn vbp vb'],\n'cry':['k-r-ay1','nn vb vbp'],\n'current':['k-er1 ah-n-t','jj nn'],\n'cut':['k-ah1-t','vb vbd vbn vbp jj nn'],\n'dad':['d-ae1-d','nn'],\n'dance':['d-ae1-n-s','nn vb vbp'],\n'danger':['d-ey1-n jh-er','nn'],\n'dark':['d-aa1-r-k','jj nn rb'],\n'day':['d-ey1','nn'],\n'dead':['d-eh1-d','jj nn rb vbn'],\n'deal':['d-iy1-l','nn vb vbp'],\n'dear':['d-ih1-r','jj nn rb uh'],\n'death':['d-eh1-th','nn'],\n'decide':['d-ih s-ay1-d','vb vbp'],\n'decimal':['d-eh1 s-ah m-ah-l','nn jj'],\n'deep':['d-iy1-p','jj rb'],\n'degree':['d-ih g-r-iy1','nn'],\n'depend':['d-ih p-eh1-n-d','vb vbp'],\n'describe':['d-ih s-k-r-ay1-b','vb vbp'],\n'desert':['d-eh1 z-er-t','nn jj vb vbp'],\n'design':['d-ih z-ay1-n','nn vb vbp'],\n'determine':['d-ah t-er1 m-ah-n','vb vbp'],\n'develop':['d-ih v-eh1 l-ah-p','vb vbp'],\n'dictionary':['d-ih1-k sh-ah n-eh r-iy','nn'],\n'die':['d-ay1','vb vbp nn'],\n'differ':['d-ih1 f-er','vbp vb'],\n'difficult':['d-ih1 f-ah k-ah-l-t','jj'],\n'direct':['d-er eh1-k-t','jj vbp rb vb'],\n'discuss':['d-ih s-k-ah1-s','vb vbp'],\n'distant':['d-ih1 s-t-ah-n-t','jj'],\n'divide':['d-ih v-ay1-d','vb nn vbp'],\n'division':['d-ih v-ih1 zh-ah-n','nn'],\n'do':['d-uw1','vb'],\n'doctor':['d-aa1-k t-er','nn vb'],\n'dog':['d-ao1-g','nn'],\n'dollar':['d-aa1 l-er','nn'],\n'done':['d-ah1-n','vbn jj rb vbd'],\n'door':['d-ao1-r','nn rb'],\n'double':['d-ah1 b-ah-l','jj vbp nn rb vb'],\n'down':['d-aw1-n','rb in rbr vbp jj nn rp vb'],\n'draw':['d-r-ao1','vb vbp nn'],\n'dream':['d-r-iy1-m','nn vb vbp'],\n'dress':['d-r-eh1-s','nn vbp vb'],\n'drink':['d-r-ih1-ng-k','nn vbp vb'],\n'drive':['d-r-ay1-v','nn vbp vb'],\n'drop':['d-r-aa1-p','nn jj vb vbp'],\n'dry':['d-r-ay1','jj vb vbp'],\n'duck':['d-ah1-k','nn vb'],\n'during':['d-uh1 r-ih-ng','in'],\n'each':['iy1-ch','dt'],\n'ear':['ih1-r','nn'],\n'early':['er1 l-iy','jj rb'],\n'earth':['er1-th','nn'],\n'ease':['iy1-z','vb nn vbp'],\n'east':['iy1-s-t','jj nn rb'],\n'eat':['iy1-t','vb vbp'],\n'edge':['eh1-jh','nn vb'],\n'effect':['ih f-eh1-k-t','nn jj vb vbp'],\n'egg':['eh1-g','nn vb'],\n'eight':['ey1- t','cd'],\n'either':['iy1 dh-er','dt cc in rb rbr'],\n'electric':['ih l-eh1-k t-r-ih-k','jj nn'],\n'element':['eh1 l-ah m-ah-n-t','nn'],\n'else':['eh1-l-s','rb jj nn'],\n'end':['eh1-n-d','nn vbp jj rb vb'],\n'enemy':['eh1 n-ah m-iy','nn'],\n'energy':['eh1 n-er jh-iy','nn'],\n'engine':['eh1-n jh-ah-n','nn'],\n'enough':['ih-n ah1-f','rb jj nn'],\n'enter':['eh1-n t-er','vb vbn vbp'],\n'equal':['iy1 k-w-ah-l','jj nn vb vbp'],\n'equate':['ih k-w-ey1-t','vb vbp'],\n'especially':['ah s-p-eh1-sh l-iy','rb'],\n'even':['iy1 v-ih-n','rb vb'],\n'evening':['iy1-v n-ih-ng','nn vbg'],\n'event':['ih v-eh1-n-t','nn'],\n'ever':['eh1 v-er','rb rbr rp'],\n'every':['eh1 v-er iy','dt'],\n'exact':['ih-g z-ae1-k-t','jj vb'],\n'example':['ih-g z-ae1-m p-ah-l','nn'],\n'except':['ih-k s-eh1-p-t','in vb'],\n'excite':['ih-k s-ay1-t','vb'],\n'exercise':['eh1-k s-er s-ay-z','nn vbp vb'],\n'expect':['ih-k s-p-eh1-k-t','vbp vb in'],\n'experience':['ih-k s-p-ih1 r-iy ah-n-s','nn vbp vb'],\n'experiment':['ih-k s-p-eh1 r-ah m-ah-n-t','nn vbp vb'],\n'eye':['ay1','nn vb'],\n'face':['f-ey1-s','nn vbp jj rb vb'],\n'fact':['f-ae1-k-t','nn'],\n'fair':['f-eh1-r','jj nn rb'],\n'fall':['f-ao1-l','nn vbp vb'],\n'family':['f-ae1 m-ah l-iy','nn'],\n'famous':['f-ey1 m-ah-s','jj'],\n'far':['f-aa1-r','rb in jj'],\n'farm':['f-aa1-r-m','nn vb'],\n'fast':['f-ae1-s-t','rb jj nn rp'],\n'fat':['f-ae1-t','jj nn'],\n'father':['f-aa1 dh-er','nn vb'],\n'favor':['f-ey1 v-er','nn vbp vb'],\n'fear':['f-ih1-r','nn vb vbp'],\n'feed':['f-iy1-d','nn vb'],\n'feel':['f-iy1-l','vb vbp nn'],\n'fell':['f-eh1-l','vbd jj nn vbn'],\n'few':['f-y-uw1','jj'],\n'field':['f-iy1-l-d','nn jj vb vbp'],\n'fig':['f-ih1-g','nn'],\n'fight':['f-ay1-t','nn vb vbp'],\n'figure':['f-ih1 g-y-er','nn vb vbp vbz'],\n'fill':['f-ih1-l','vb vbp nn'],\n'final':['f-ay1 n-ah-l','jj'],\n'find':['f-ay1-n-d','vb vbp nn'],\n'fine':['f-ay1-n','jj nn rb vb'],\n'finger':['f-ih1-ng g-er','nn vb'],\n'finish':['f-ih1 n-ih-sh','vb nn vbp'],\n'fire':['f-ay1 er','nn vb'],\n'first':['f-er1-s-t','jj rb nn'],\n'fish':['f-ih1-sh','nn vb'],\n'fit':['f-ih1-t','vb vbn vbp jj nn rb vbd'],\n'five':['f-ay1-v','cd'],\n'flat':['f-l-ae1-t','jj nn rb'],\n'floor':['f-l-ao1-r','nn'],\n'flow':['f-l-ow1','nn vbp vb'],\n'flower':['f-l-aw1 er','nn vb vbp'],\n'fly':['f-l-ay1','vb nn vbp'],\n'follow':['f-aa1 l-ow','vb vbp'],\n'food':['f-uw1-d','nn'],\n'foot':['f-uh1-t','nn vbp jj vb'],\n'for':['f-ao1-r','in nnp cc jj rb rp'],\n'force':['f-ao1-r-s','nn vb nnp vbp'],\n'forest':['f-ao1 r-ah-s-t','nn'],\n'form':['f-ao1-r-m','nn vbp jj vb'],\n'forward':['f-ao1-r w-er-d','rb jj nn vb'],\n'found':['f-aw1-n-d','vbd vbn vb'],\n'four':['f-ao1-r','cd'],\n'fraction':['f-r-ae1-k sh-ah-n','nn'],\n'free':['f-r-iy1','jj rb vb vbp'],\n'fresh':['f-r-eh1-sh','jj rb'],\n'friend':['f-r-eh1-n-d','nn'],\n'from':['f-r-ah1-m','in rb rp'],\n'front':['f-r-ah1-n-t','nn jj vb'],\n'fruit':['f-r-uw1-t','nn'],\n'full':['f-uh1-l','jj rb'],\n'fun':['f-ah1-n','nn jj'],\n'game':['g-ey1-m','nn'],\n'garden':['g-aa1-r d-ah-n','nn vb'],\n'gas':['g-ae1-s','nn vb'],\n'gather':['g-ae1 dh-er','vb vbp'],\n'general':['jh-eh1 n-er ah-l','jj nn'],\n'gentle':['jh-eh1-n t-ah-l','jj vb'],\n'get':['g-eh1-t','vb vbp'],\n'girl':['g-er1-l','nn'],\n'give':['g-ih1-v','vb nn vbp'],\n'glad':['g-l-ae1-d','jj'],\n'glass':['g-l-ae1-s','nn'],\n'go':['g-ow1','vb jj nn rp vbp'],\n'gold':['g-ow1-l-d','nn jj'],\n'gone':['g-ao1-n','vbn jj'],\n'good':['g-uh1-d','jj nn rb'],\n'got':['g-aa1-t','vbd vbn vbp vb'],\n'govern':['g-ah1 v-er-n','vb vbp'],\n'grand':['g-r-ae1-n-d','jj'],\n'grass':['g-r-ae1-s','nn vb'],\n'gray':['g-r-ey1','jj nn vb'],\n'great':['g-r-ey1-t','jj rb'],\n'green':['g-r-iy1-n','jj nn vb'],\n'ground':['g-r-aw1-n-d','nn jj vb vbd vbn'],\n'group':['g-r-uw1-p','nn vb vbp'],\n'grow':['g-r-ow1','vb vbp'],\n'guess':['g-eh1-s','vbp nn vb'],\n'guide':['g-ay1-d','nn vbp vb'],\n'gun':['g-ah1-n','nn vb'],\n'hair':['hh-eh1-r','nn'],\n'half':['hh-ae1-f','nn jj prp'],\n'hand':['hh-ae1-n-d','nn rb vb vbp jj'],\n'happen':['hh-ae1 p-ah-n','vb vbp'],\n'happy':['hh-ae1 p-iy','jj'],\n'hard':['hh-aa1-r-d','jj rb'],\n'has':['hh-ae1-z','vbz vbn .'],\n'hat':['hh-ae1-t','nn'],\n'have':['hh-ae1-v','vbp jj nn vb vbn'],\n'he':['hh-iy1','prp vb'],\n'head':['hh-eh1-d','nn jj rb vb vbp'],\n'hear':['hh-ih1-r','vb vbp'],\n'heart':['hh-aa1-r-t','nn rb vb'],\n'heat':['hh-iy1-t','nn vb vbp'],\n'heavy':['hh-eh1 v-iy','jj nn rb'],\n'held':['hh-eh1-l-d','vbn vbd jj'],\n'help':['hh-eh1-l-p','vb nn vbp'],\n'her':['hh-er','prp$'],\n'here':['hh-ih1-r','rb'],\n'high':['hh-ay1','jj nn rb rp'],\n'hill':['hh-ih1-l','nn'],\n'him':['hh-ih1-m','prp'],\n'his':['hh-ih1-z','prp$'],\n'history':['hh-ih1 s-t-er iy','nn'],\n'hit':['hh-ih1-t','vbd jj nn vb vbn vbp'],\n'hold':['hh-ow1-l-d','vb nn rb vbp'],\n'hole':['hh-ow1-l','nn vbp vb'],\n'home':['hh-ow1-m','nn vbp rb vb'],\n'hope':['hh-ow1-p','nn vb vbp'],\n'horse':['hh-ao1-r-s','nn'],\n'hot':['hh-aa1-t','jj'],\n'hour':['aw1 er','nn'],\n'house':['hh-aw1-s','nn vbp vb'],\n'how':['hh-aw1','wrb'],\n'huge':['hh-y-uw1-jh','jj'],\n'human':['hh-y-uw1 m-ah-n','jj nn'],\n'hundred':['hh-ah1-n d-r-ah-d','nn'],\n'hunt':['hh-ah1-n-t','nn vb vbp'],\n'hurry':['hh-er1 iy','nn vbp vb'],\n'ice':['ay1-s','nn jj'],\n'idea':['ay d-iy1 ah','nn'],\n'if':['ih1-f','in'],\n'imagine':['ih m-ae1 jh-ah-n','vb vbp'],\n'in':['ih-n','in nn rb rp nnp rbr'],\n'inch':['ih1-n-ch','nn rb vb'],\n'include':['ih-n k-l-uw1-d','vbp vbn vb'],\n'indicate':['ih1-n d-ah k-ey-t','vb vbp'],\n'industry':['ih1-n d-ah-s t-r-iy','nn'],\n'insect':['ih1-n s-eh-k-t','nn jj'],\n'instant':['ih1-n s-t-ah-n-t','nn jj'],\n'instrument':['ih1-n s-t-r-ah m-ah-n-t','nn'],\n'interest':['ih1-n t-r-ah-s-t','nn vbp vb'],\n'invent':['ih-n v-eh1-n-t','vb vbp'],\n'iron':['ay1 er-n','nn vb'],\n'is':['ih1-s','vbz'],\n'island':['ay1 l-ah-n-d','nn'],\n'it':['ih1-t','prp'],\n'job':['jh-aa1-b','nn'],\n'join':['jh-oy1-n','vb vbp'],\n'joy':['jh-oy1','nn'],\n'jump':['jh-ah1-m-p','nn vbp jj vb'],\n'just':['jh-ah1-s-t','rb jj rp'],\n'keep':['k-iy1-p','vb nn vbp'],\n'key':['k-iy1','jj nn vb'],\n'kill':['k-ih1-l','vb vbp nn'],\n'kind':['k-ay1-n-d','nn jj rb'],\n'king':['k-ih1-ng','nn'],\n'know':['n-ow1','vb nn vbp'],\n'lady':['l-ey1 d-iy','nn'],\n'lake':['l-ey1-k','nn'],\n'land':['l-ae1-n-d','nn vbp vb'],\n'language':['l-ae1-ng g-w-ah-jh','nn'],\n'large':['l-aa1-r-jh','jj rb'],\n'last':['l-ae1-s-t','jj nn rb vb vbp'],\n'late':['l-ey1-t','jj rb'],\n'laugh':['l-ae1-f','nn vbp vb'],\n'law':['l-ao1','nn'],\n'lay':['l-ey1','vbd vbp jj vb'],\n'lead':['l-eh1-d','vb vbn vbp jj nn'],\n'learn':['l-er1-n','vb vbp'],\n'least':['l-iy1-s-t','jjs rbs jj'],\n'leave':['l-iy1-v','vb nn vbp'],\n'led':['l-eh1-d','vbn vbd vb'],\n'left':['l-eh1-f-t','vbn jj nn rb vbd'],\n'leg':['l-eh1-g','nn'],\n'length':['l-eh1-ng-k-th','nn'],\n'less':['l-eh1-s','jjr jjs cc rb rbr rbs'],\n'let':['l-eh1-t','vb vbd vbn vbp nn'],\n'letter':['l-eh1 t-er','nn vb'],\n'level':['l-eh1 v-ah-l','nn vbp jj vb'],\n'lie':['l-ay1','vb vbp nn'],\n'life':['l-ay1-f','nn rb'],\n'lift':['l-ih1-f-t','vb nn vbp'],\n'light':['l-ay1-t','nn jj rb vb vbp'],\n'like':['l-ay1-k','in jj nn vb vbp'],\n'line':['l-ay1-n','nn vbp rb vb'],\n'liquid':['l-ih1 k-w-ah-d','jj nn'],\n'list':['l-ih1-s-t','nn vbp vb'],\n'listen':['l-ih1 s-ah-n','vb vbp'],\n'little':['l-ih1 t-ah-l','jj rb'],\n'live':['l-ay1-v','vb rb vbp jj'],\n'locate':['l-ow1 k-ey-t','vb vbp'],\n'log':['l-ao1-g','nn vb vbp'],\n'lone':['l-ow1-n','jj'],\n'long':['l-ao1-ng','jj vb vbp rb'],\n'look':['l-uh1-k','vb nn vbp'],\n'lost':['l-ao1-s-t','vbd vbn jj'],\n'lot':['l-aa1-t','nn rb jj'],\n'loud':['l-aw1-d','jj rb'],\n'love':['l-ah1-v','nn nnp vb vbp'],\n'low':['l-ow1','jj nn rb rp'],\n'machine':['m-ah sh-iy1-n','nn'],\n'made':['m-ey1-d','vbn vbd jj'],\n'magnet':['m-ae1-g n-ah-t','nn'],\n'main':['m-ey1-n','jj nn'],\n'major':['m-ey1 jh-er','jj nn vb vbp'],\n'make':['m-ey1-k','vb nn vbp'],\n'man':['m-ae1-n','nn jj vb uh'],\n'many':['m-eh1 n-iy','jj dt rb vb pdt'],\n'map':['m-ae1-p','nn vbp vb'],\n'mark':['m-aa1-r-k','nn vbp vb'],\n'market':['m-aa1-r k-ah-t','nn vbp vb'],\n'mass':['m-ae1-s','nn jj rb vb'],\n'master':['m-ae1 s-t-er','nn jj vb jjr'],\n'match':['m-ae1-ch','vb vbp nn'],\n'material':['m-ah t-ih1 r-iy ah-l','nn jj'],\n'matter':['m-ae1 t-er','nn vbp vb'],\n'may':['m-ey1','md nnp'],\n'me':['m-iy1','prp'],\n'mean':['m-iy1-n','vb vbp jj'],\n'measure':['m-eh1 zh-er','nn vbp vb'],\n'meat':['m-iy1-t','nn'],\n'meet':['m-iy1-t','vb vbp nn'],\n'melody':['m-eh1 l-ah d-iy','nn'],\n'metal':['m-eh1 t-ah-l','nn'],\n'method':['m-eh1 th-ah-d','nn'],\n'middle':['m-ih1 d-ah-l','nn jj'],\n'might':['m-ay1-t','md nn'],\n'mile':['m-ay1-l','nn'],\n'milk':['m-ih1-l-k','nn vb'],\n'million':['m-ih1 l-y-ah-n','nn'],\n'mind':['m-ay1-n-d','nn rb vb'],\n'mine':['m-ay1-n','nn vb prp vbp'],\n'minute':['m-ih1 n-ah-t','nn jj'],\n'miss':['m-ih1-s','vb vbp nn'],\n'mix':['m-ih1-k-s','nn vbp vb'],\n'modern':['m-aa1 d-er-n','jj nn'],\n'molecule':['m-aa1 l-ah k-y-uw-l','nn'],\n'moment':['m-ow1 m-ah-n-t','nn'],\n'money':['m-ah1 n-iy','nn'],\n'month':['m-ah1-n-th','nn'],\n'moon':['m-uw1-n','nn vb'],\n'more':['m-ao1-r','jjr rbr nn jj rb rp'],\n'morning':['m-ao1-r n-ih-ng','nn'],\n'most':['m-ow1-s-t','rbs jj nn rb jjs'],\n'mother':['m-ah1 dh-er','nn vb'],\n'motion':['m-ow1 sh-ah-n','nn vb'],\n'mount':['m-aw1-n-t','vb nn vbp'],\n'mountain':['m-aw1-n t-ah-n','nn'],\n'mouth':['m-aw1-th','nn vb'],\n'move':['m-uw1-v','nn vbp vb'],\n'much':['m-ah1-ch','jj dt nn rb'],\n'multiply':['m-ah1-l t-ah p-l-ay','vb vbp'],\n'music':['m-y-uw1 z-ih-k','nn'],\n'must':['m-ah1-s-t','md'],\n'my':['m-ay1','prp$'],\n'name':['n-ey1-m','nn vb uh vbp'],\n'nation':['n-ey1 sh-ah-n','nn'],\n'natural':['n-ae1 ch-er ah-l','jj nn'],\n'nature':['n-ey1 ch-er','nn jj'],\n'near':['n-ih1-r','in rb vb jj'],\n'necessary':['n-eh1 s-ah s-eh r-iy','jj'],\n'neck':['n-eh1-k','nn rb vb'],\n'need':['n-iy1-d','nn vbp md vb'],\n'neighbor':['n-ey1 b-er','nn vb'],\n'never':['n-eh1 v-er','rb rbr'],\n'new':['n-uw1','jj'],\n'next':['n-eh1-k-s-t','jj in rb'],\n'night':['n-ay1-t','nn rb'],\n'nine':['n-ih1-n','cd'],\n'no':['n-ow1','dt jj nn rb uh'],\n'noise':['n-oy1-z','nn'],\n'noon':['n-uw1-n','nn'],\n'nor':['n-ao1-r','cc'],\n'north':['n-ao1-r-th','rb jj nn'],\n'nose':['n-ow1-z','nn vb'],\n'note':['n-ow1-t','nn vbp vb'],\n'nothing':['n-ah1 th-ih-ng','nn'],\n'notice':['n-ow1 t-ah-s','nn vb vbp'],\n'noun':['n-aw1-n','nn'],\n'now':['n-aw1','rb jj nn uh'],\n'number':['n-ah1-m b-er','nn vb vbp'],\n'numeral':['n-uw1 m-er ah-l','nn'],\n'object':['aa1-b jh-eh-k-t','nn vbp vb'],\n'observe':['ah-b z-er1-v','vb vbp'],\n'occur':['ah k-er1','vb vbp'],\n'ocean':['ow1 sh-ah-n','nn'],\n'of':['ah1-v','in rb rp nnp'],\n'off':['ao1-f','in rb jj nn rp'],\n'offer':['ao1 f-er','nn vb vbp'],\n'office':['ao1 f-ah-s','nn'],\n'often':['ao1 f-ah-n','rb'],\n'oh':['ow1','uh'],\n'oil':['oy1-l','nn'],\n'old':['ow1-l-d','jj'],\n'on':['aa1-n','in nnp rbr jj rb rp'],\n'once':['w-ah1-n-s','rb in'],\n'one':['w-ah1-n','cd'],\n'only':['ow1-n l-iy','rb in jj'],\n'open':['ow1 p-ah-n','jj vbp nn rb rp vb'],\n'operate':['aa1 p-er ey-t','vb vbp'],\n'opposite':['aa1 p-ah z-ah-t','jj in nn'],\n'or':['ao1-r','cc nnp'],\n'order':['ao1-r d-er','nn vbp in vb'],\n'organ':['ao1-r g-ah-n','nn'],\n'original':['er ih1 jh-ah n-ah-l','jj nn'],\n'other':['ah1 dh-er','jj nn'],\n'our':['aw1 er','prp$'],\n'out':['aw1-t','in jj nn rb rp'],\n'over':['ow1 v-er','in rp jj rb'],\n'own':['ow1-n','jj vbn vbp vb'],\n'oxygen':['aa1-k s-ah jh-ah-n','nn'],\n'page':['p-ey1-jh','nn vb'],\n'paint':['p-ey1-n-t','nn vb vbp'],\n'pair':['p-eh1-r','nn vb'],\n'paper':['p-ey1 p-er','nn vb'],\n'paragraph':['p-ae1 r-ah g-r-ae-f','nn'],\n'parent':['p-eh1 r-ah-n-t','nn jj'],\n'part':['p-aa1-r-t','nn jj rb vb'],\n'particular':['p-er t-ih1 k-y-ah l-er','jj nn rb'],\n'party':['p-aa1-r t-iy','nn vb'],\n'pass':['p-ae1-s','vb vbp nn'],\n'past':['p-ae1-s-t','jj in nn rb'],\n'path':['p-ae1-th','nn'],\n'pattern':['p-ae1 t-er-n','nn vb'],\n'pay':['p-ey1','vb vbd vbp nn'],\n'perhaps':['p-er hh-ae1-p-s','rb'],\n'period':['p-ih1 r-iy ah-d','nn'],\n'person':['p-er1 s-ah-n','nn'],\n'phrase':['f-r-ey1-z','nn vb'],\n'pick':['p-ih1-k','vb vbp nn'],\n'picture':['p-ih1-k ch-er','nn vb vbp'],\n'piece':['p-iy1-s','nn vb'],\n'pitch':['p-ih1-ch','nn jj vb vbp'],\n'place':['p-l-ey1-s','nn vbp rb vb'],\n'plain':['p-l-ey1-n','jj nn rb'],\n'plan':['p-l-ae1-n','nn vb vbn vbp'],\n'plane':['p-l-ey1-n','nn vb'],\n'planet':['p-l-ae1 n-ah-t','nn'],\n'plant':['p-l-ae1-n-t','nn vb'],\n'play':['p-l-ey1','vb nn vbp'],\n'please':['p-l-iy1-z','vb uh vbp'],\n'plural':['p-l-uh1 r-ah-l','nn jj'],\n'poem':['p-ow1 ah-m','nn'],\n'point':['p-oy1-n-t','nn vbp rb vb'],\n'poor':['p-uh1-r','jj nn nnp'],\n'populate':['p-aa1 p-y-ah l-ey-t','vb vbp'],\n'port':['p-ao1-r-t','nn jj'],\n'pose':['p-ow1-z','vb vbp nn'],\n'position':['p-ah z-ih1 sh-ah-n','nn vbp vb'],\n'possible':['p-aa1 s-ah b-ah-l','jj rb'],\n'post':['p-ow1-s-t','nn in jj vb vbd vbp'],\n'pound':['p-aw1-n-d','nn vb vbp'],\n'power':['p-aw1 er','nn vbp vb'],\n'practice':['p-r-ae1-k t-ah-s','nn vb vbp'],\n'prepare':['p-r-iy p-eh1-r','vb vbp'],\n'present':['p-r-eh1 z-ah-n-t','jj vbp rb nn vb'],\n'press':['p-r-eh1-s','nn vbp vb'],\n'pretty':['p-r-ih1 t-iy','rb jj'],\n'print':['p-r-ih1-n-t','nn vb vbp'],\n'probable':['p-r-aa1 b-ah b-ah-l','jj'],\n'problem':['p-r-aa1 b-l-ah-m','nn'],\n'process':['p-r-aa1 s-eh-s','nn vbp vb'],\n'produce':['p-r-ah d-uw1-s','vb vbp nn'],\n'product':['p-r-aa1 d-ah-k-t','nn'],\n'proper':['p-r-aa1 p-er','jj'],\n'property':['p-r-aa1 p-er t-iy','nn'],\n'protect':['p-r-ah t-eh1-k-t','vb vbp'],\n'prove':['p-r-uw1-v','vb vbp'],\n'provide':['p-r-ah v-ay1-d','vb vbp'],\n'pull':['p-uh1-l','vb vbp nn'],\n'push':['p-uh1-sh','vb vbp nn'],\n'put':['p-uh1-t','vb jj nn vbp vbd vbn'],\n'quart':['k-w-ao1-r-t','nn'],\n'question':['k-w-eh1-s ch-ah-n','nn vb vbp'],\n'quick':['k-w-ih1-k','jj nn rb'],\n'quiet':['k-w-ay1 ah-t','jj nn vb'],\n'quite':['k-w-ay1-t','rb pdt'],\n'quotient':['k-w-ow1 t-ih ah-n-t','nn'],\n'race':['r-ey1-s','nn vb'],\n'radio':['r-ey1 d-iy ow','nn vb'],\n'rail':['r-ey1-l','nn vb'],\n'rain':['r-ey1-n','nn vb'],\n'raise':['r-ey1-z','vb vbp nn'],\n'range':['r-ey1-n-jh','nn jj vb vbp vbz'],\n'rather':['r-ae1 dh-er','rb in'],\n'reach':['r-iy1-ch','vb vbp nn'],\n'read':['r-eh1-d','vb nn vbp vbd vbn'],\n'ready':['r-eh1 d-iy','jj rb vb'],\n'real':['r-iy1-l','jj nn rb'],\n'reason':['r-iy1 z-ah-n','nn vb vbp'],\n'receive':['r-ah s-iy1-v','vb vbp'],\n'record':['r-ah k-ao1-r-d','nn jj vb vbp'],\n'red':['r-eh1-d','jj nn'],\n'region':['r-iy1 jh-ah-n','nn'],\n'remember':['r-ih m-eh1-m b-er','vb vbp'],\n'repeat':['r-ih p-iy1-t','vb jj nn vbp'],\n'reply':['r-ih p-l-ay1','nn vb vbp'],\n'represent':['r-eh p-r-ah z-eh1-n-t','vb vbp'],\n'require':['r-iy k-w-ay1 er','vb vbp'],\n'rest':['r-eh1-s-t','nn vbp vb rb'],\n'result':['r-ih z-ah1-l-t','nn vbp vb'],\n'rich':['r-ih1-ch','jj'],\n'ride':['r-ay1-d','vb nn vbp'],\n'right':['r-ay1-t','nn rb vb in jj'],\n'ring':['r-ih1-ng','nn vb vbp'],\n'rise':['r-ay1-z','nn vbp vb'],\n'river':['r-ih1 v-er','nn'],\n'road':['r-ow1-d','nn'],\n'rock':['r-aa1-k','nn jj vb vbp'],\n'roll':['r-ow1-l','nn vb vbp'],\n'room':['r-uw1-m','nn vb'],\n'root':['r-uw1-t','nn vbp vb'],\n'rope':['r-ow1-p','nn vb'],\n'rose':['r-ow1-z','vbd jj nn'],\n'round':['r-aw1-n-d','nn in jj vbp rb vb'],\n'row':['r-ow1','nn vbp vb'],\n'rub':['r-ah1-b','nn vb vbp'],\n'rule':['r-uw1-l','nn vbp vb'],\n'run':['r-ah1-n','vb vbd vbn vbp nn'],\n'safe':['s-ey1-f','jj nn'],\n'said':['s-eh1-d','vbd vbn jj vb'],\n'sail':['s-ey1-l','vb vbp nn'],\n'salt':['s-ao1-l-t','nn jj vb'],\n'same':['s-ey1-m','jj'],\n'sand':['s-ae1-n-d','nn vb'],\n'save':['s-ey1-v','vb in vbp'],\n'saw':['s-ao1','vbd nn'],\n'say':['s-ey1','vbp nn nnp vb uh'],\n'scale':['s-k-ey1-l','nn vb'],\n'school':['s-k-uw1-l','nn vb'],\n'science':['s-ay1 ah-n-s','nn jj'],\n'score':['s-k-ao1-r','nn vb vbp'],\n'sea':['s-iy1','nn vb vbp'],\n'search':['s-er1-ch','nn vb vbp'],\n'season':['s-iy1 z-ah-n','nn vb'],\n'seat':['s-iy1-t','nn vb vbp'],\n'second':['s-eh1 k-ah-n-d','nn jj rb vb'],\n'section':['s-eh1-k sh-ah-n','nn nnp'],\n'see':['s-iy1','vb uh vbp'],\n'seed':['s-iy1-d','nn vb'],\n'seem':['s-iy1-m','vb vbp'],\n'segment':['s-eh1-g m-ah-n-t','nn vb vbp'],\n'select':['s-ah l-eh1-k-t','vb vbp jj'],\n'self':['s-eh1-l-f','nn prp'],\n'sell':['s-eh1-l','vb vbp nn'],\n'send':['s-eh1-n-d','vb vbp'],\n'sense':['s-eh1-n-s','nn vbp vb'],\n'sentence':['s-eh1-n t-ah-n-s','nn vb'],\n'separate':['s-eh1 p-er ey-t','jj vbp vb'],\n'serve':['s-er1-v','vb vbp'],\n'set':['s-eh1-t','vbn vbd vbp jj nn vb'],\n'settle':['s-eh1 t-ah-l','vb vbp'],\n'seven':['s-eh1 v-ah-n','cd'],\n'several':['s-eh1 v-r-ah-l','jj rb'],\n'shall':['sh-ae1-l','md'],\n'shape':['sh-ey1-p','nn vbp vb'],\n'share':['sh-eh1-r','nn vbp jj vb'],\n'sharp':['sh-aa1-r-p','jj'],\n'she':['sh-iy1','prp'],\n'sheet':['sh-iy1-t','nn'],\n'shell':['sh-eh1-l','nn jj vb'],\n'shine':['sh-ay1-n','nn vbp vb'],\n'ship':['sh-ih1-p','nn vbp vb'],\n'shoe':['sh-uw1','nn'],\n'shop':['sh-aa1-p','nn vb vbp'],\n'shore':['sh-ao1-r','nn jj rb vb'],\n'short':['sh-ao1-r-t','jj nn rb vb'],\n'should':['sh-uh1-d','md'],\n'shoulder':['sh-ow1-l d-er','nn vbp rb vb'],\n'shout':['sh-aw1-t','vb vbp nn'],\n'show':['sh-ow1','nn vb vbp'],\n'side':['s-ay1-d','nn vbp jj rb vb'],\n'sight':['s-ay1-t','nn vb'],\n'sign':['s-ay1-n','nn vbp vb'],\n'silent':['s-ay1 l-ah-n-t','jj'],\n'silver':['s-ih1-l v-er','nn jj jjr'],\n'similar':['s-ih1 m-ah l-er','jj'],\n'simple':['s-ih1-m p-ah-l','jj nn'],\n'since':['s-ih1-n-s','in rb'],\n'sing':['s-ih1-ng','vb vbp'],\n'single':['s-ih1-ng g-ah-l','jj vbp nn rb vb'],\n'sister':['s-ih1 s-t-er','nn jj'],\n'sit':['s-ih1-t','vb vbp'],\n'six':['s-ih1-k-s','cd'],\n'size':['s-ay1-z','nn vbp vb'],\n'skill':['s-k-ih1-l','nn vb'],\n'skin':['s-k-ih1-n','nn'],\n'sky':['s-k-ay1','nn'],\n'slave':['s-l-ey1-v','nn'],\n'sleep':['s-l-iy1-p','vb nn vbp'],\n'slip':['s-l-ih1-p','vb nn vbp'],\n'slow':['s-l-ow1','jj vbp rb vb'],\n'small':['s-m-ao1-l','jj'],\n'smell':['s-m-eh1-l','nn vb vbp'],\n'smile':['s-m-ay1-l','nn vb vbp'],\n'snow':['s-n-ow1','nn vb'],\n'so':['s-ow1','rb cc in'],\n'soft':['s-aa1-f-t','jj rb'],\n'soil':['s-oy1-l','nn vb'],\n'soldier':['s-ow1-l jh-er','nn'],\n'solution':['s-ah l-uw1 sh-ah-n','nn'],\n'solve':['s-aa1-l-v','vb vbp'],\n'some':['s-ah1-m','dt nn rb'],\n'son':['s-ah1-n','nn'],\n'song':['s-ao1-ng','nn'],\n'soon':['s-uw1-n','rb'],\n'sound':['s-aw1-n-d','nn jj rb vb vbp'],\n'south':['s-aw1-th','rb jj nn'],\n'space':['s-p-ey1-s','nn vb'],\n'speak':['s-p-iy1-k','vb vbp'],\n'special':['s-p-eh1 sh-ah-l','jj nn'],\n'speech':['s-p-iy1-ch','nn'],\n'speed':['s-p-iy1-d','nn vb'],\n'spell':['s-p-eh1-l','vb nn vbp'],\n'spend':['s-p-eh1-n-d','vb vbp'],\n'spoke':['s-p-ow1-k','vbd nn'],\n'spot':['s-p-aa1-t','nn jj vb vbp'],\n'spread':['s-p-r-eh1-d','nn vbd vbn vbp jj vb'],\n'spring':['s-p-r-ih1-ng','nn vb vbp'],\n'square':['s-k-w-eh1-r','nn jj rb vb vbp'],\n'stand':['s-t-ae1-n-d','vb nn vbp'],\n'star':['s-t-aa1-r','nn jj vb'],\n'start':['s-t-aa1-r-t','vb vbp nn rp'],\n'state':['s-t-ey1-t','nn jj vb vbp'],\n'station':['s-t-ey1 sh-ah-n','nn vb'],\n'stay':['s-t-ey1','vb vbp nn'],\n'stead':['s-t-eh1-d','nn'],\n'steam':['s-t-iy1-m','nn vb'],\n'steel':['s-t-iy1-l','nn jj'],\n'step':['s-t-eh1-p','nn vbp vb'],\n'stick':['s-t-ih1-k','vb vbp nn'],\n'still':['s-t-ih1-l','rb jj nn vb'],\n'stone':['s-t-ow1-n','nn rb vb'],\n'stop':['s-t-aa1-p','vb nn vbp'],\n'store':['s-t-ao1-r','nn vb vbp'],\n'story':['s-t-ao1 r-iy','nn'],\n'straight':['s-t-r-ey1-t','jj rb'],\n'strange':['s-t-r-ey1-n-jh','jj'],\n'stream':['s-t-r-iy1-m','nn vb'],\n'street':['s-t-r-iy1-t','nn'],\n'stretch':['s-t-r-eh1-ch','nn vbp jj vb'],\n'string':['s-t-r-ih1-ng','nn vb'],\n'strong':['s-t-r-ao1-ng','jj rb'],\n'student':['s-t-uw1 d-ah-n-t','nn'],\n'study':['s-t-ah1 d-iy','nn vbp vb'],\n'subject':['s-ah-b jh-eh1-k-t','nn jj vb'],\n'substance':['s-ah1-b s-t-ah-n-s','nn'],\n'subtract':['s-ah-b t-r-ae1-k-t','vb vbp'],\n'success':['s-ah-k s-eh1-s','nn'],\n'such':['s-ah1-ch','jj pdt dt'],\n'sudden':['s-ah1 d-ah-n','jj'],\n'suffix':['s-ah1 f-ih-k-s','nn'],\n'sugar':['sh-uh1 g-er','nn vb'],\n'suggest':['s-ah-g jh-eh1-s-t','vbp vb'],\n'suit':['s-uw1-t','nn vbp rb vb'],\n'summer':['s-ah1 m-er','nn'],\n'sun':['s-ah1-n','nn vb'],\n'supply':['s-ah p-l-ay1','nn vbp vb'],\n'support':['s-ah p-ao1-r-t','nn vb vbp'],\n'sure':['sh-uh1-r','jj pdt rb uh'],\n'surface':['s-er1 f-ah-s','nn vb vbp'],\n'surprise':['s-er p-r-ay1-z','nn jj rb vb'],\n'swim':['s-w-ih1-m','vb vbp nn'],\n'syllable':['s-ih1 l-ah b-ah-l','nn'],\n'symbol':['s-ih1-m b-ah-l','nn'],\n'system':['s-ih1 s-t-ah-m','nn'],\n'table':['t-ey1 b-ah-l','nn vb'],\n'tail':['t-ey1-l','nn jj vb'],\n'take':['t-ey1-k','vb nn vbp'],\n'talk':['t-ao1-k','vb vbp nn'],\n'tall':['t-ao1-l','jj'],\n'teach':['t-iy1-ch','vb vbp'],\n'team':['t-iy1-m','nn vb vbp'],\n'tell':['t-eh1-l','vb vbp'],\n'temperature':['t-eh1-m p-r-ah ch-er','nn'],\n'ten':['t-eh1-n','nn'],\n'term':['t-er1-m','nn vb vbp'],\n'test':['t-eh1-s-t','nn vbp vb'],\n'than':['dh-ae1-n','in rb rbr'],\n'thank':['th-ae1-ng-k','vb vbp'],\n'that':['dh-ae1-t','in dt nn rb rp uh wp wdt'],\n'the':['dh-ah','dt'],\n'their':['dh-eh1-r','prp$'],\n'them':['dh-eh1-m','prp dt'],\n'then':['dh-eh1-n','rb in jj'],\n'there':['dh-eh1-r','ex rb uh'],\n'these':['dh-iy1-z','dt'],\n'they':['dh-ey1','prp'],\n'thick':['th-ih1-k','jj nn rb'],\n'thin':['th-ih1-n','jj rb vb'],\n'thing':['th-ih1-ng','nn'],\n'think':['th-ih1-ng-k','vbp vb nn'],\n'third':['th-er1-d','nn jj rb'],\n'this':['dh-ih1-s','dt rb pdt'],\n'those':['dh-ow1-z','dt'],\n'though':['dh-ow1','in rb'],\n'thought':['th-ao1-t','vbd nn vbn'],\n'thousand':['th-aw1 z-ah-n-d','nn'],\n'three':['th-r-iy1','cd'],\n'through':['th-r-uw1','in jj rb rp'],\n'throw':['th-r-ow1','vb vbp nn'],\n'thus':['dh-ah1-s','rb'],\n'tie':['t-ay1','nn vbp vb'],\n'time':['t-ay1-m','nn vb'],\n'tiny':['t-ay1 n-iy','jj'],\n'tire':['t-ay1 er','nn vbp vb'],\n'to':['t-uw1','to rb'],\n'together':['t-ah g-eh1 dh-er','rb in rp'],\n'tone':['t-ow1-n','nn vb'],\n'too':['t-uw1','rb'],\n'tool':['t-uw1-l','nn vb'],\n'top':['t-aa1-p','jj nn vbp rb vb'],\n'total':['t-ow1 t-ah-l','jj nn vb vbp'],\n'touch':['t-ah1-ch','nn rb vb vbp'],\n'toward':['t-ah w-ao1-r-d','in'],\n'town':['t-aw1-n','nn'],\n'track':['t-r-ae1-k','nn vbp vb'],\n'trade':['t-r-ey1-d','nn vbp vb'],\n'train':['t-r-ey1-n','nn vb vbp'],\n'travel':['t-r-ae1 v-ah-l','nn vbp vb'],\n'tree':['t-r-iy1','nn'],\n'triangle':['t-r-ay1 ae-ng g-ah-l','nn'],\n'trip':['t-r-ih1-p','nn vb'],\n'trouble':['t-r-ah1 b-ah-l','nn vbd vbp jj vb'],\n'truck':['t-r-ah1-k','nn vb vbp'],\n'true':['t-r-uw1','jj'],\n'try':['t-r-ay1','vb vbp nn'],\n'tube':['t-uw1-b','nn'],\n'turn':['t-er1-n','vb nn rb vbp'],\n'twenty':['t-w-eh1-n t-iy','nn'],\n'two':['t-uw1','cd'],\n'type':['t-ay1-p','nn vb'],\n'under':['ah1-n d-er','in jj rb rp'],\n'unit':['y-uw1 n-ah-t','nn'],\n'until':['ah-n t-ih1-l','in'],\n'up':['ah1-p','in jj rb rp vb nnp rbr'],\n'us':['ah1-s','prp'],\n'use':['y-uw1-s','nn vb vbp'],\n'usual':['y-uw1 zh-ah w-ah-l','jj rb'],\n'valley':['v-ae1 l-iy','nn'],\n'value':['v-ae1-l y-uw','nn vbp vb'],\n'vary':['v-eh1 r-iy','vbp vb'],\n'verb':['v-er1-b','nn'],\n'very':['v-eh1 r-iy','rb jj'],\n'view':['v-y-uw1','nn vbp vb'],\n'village':['v-ih1 l-ah-jh','nn'],\n'visit':['v-ih1 z-ah-t','nn vb vbp'],\n'voice':['v-oy1-s','nn vbp vb'],\n'vowel':['v-aw1 ah-l','nn jj'],\n'wait':['w-ey1-t','vb vbp nn'],\n'walk':['w-ao1-k','vb vbp nn'],\n'wall':['w-ao1-l','nn vbp vb'],\n'want':['w-aa1-n-t','vbp vb nn'],\n'war':['w-ao1-r','nn nnp vb'],\n'warm':['w-ao1-r-m','jj vb'],\n'wash':['w-aa1-sh','nn vbp vb'],\n'watch':['w-aa1-ch','vb jj nn vbp'],\n'water':['w-ao1 t-er','nn vb jj'],\n'wave':['w-ey1-v','nn vb vbp'],\n'way':['w-ey1','nn rb'],\n'we':['w-iy1','prp'],\n'wear':['w-eh1-r','vb jj nn vbp'],\n'weather':['w-eh1 dh-er','nn vb vbp'],\n'week':['w-iy1-k','nn'],\n'weight':['w-ey1-t','nn vb'],\n'well':['w-eh1-l','rb vbp jj nn vb uh'],\n'were':['w-er','vbd vb'],\n'west':['w-eh1-s-t','nn jj rb jjs'],\n'what':['w-ah1-t','wp wdt in'],\n'wheel':['w-iy1-l','nn vb vbp'],\n'when':['w-eh1-n','wrb in'],\n'where':['w-eh1-r','wrb'],\n'whether':['w-eh1 dh-er','in cc'],\n'which':['w-ih1-ch','wdt wp'],\n'while':['w-ay1-l','in jj nn rb vb'],\n'white':['w-ay1-t','jj nn'],\n'who':['hh-uw1','wp nn'],\n'whole':['hh-ow1-l','jj nn rp'],\n'whose':['hh-uw1-z','wp$'],\n'why':['w-ay1','wrb'],\n'wide':['w-ay1-d','jj rb'],\n'wife':['w-ay1-f','nn'],\n'wild':['w-ay1-l-d','jj rb'],\n'will':['w-ih1-l','md vbp nn vb'],\n'win':['w-ih1-n','vb nn vbp'],\n'wind':['w-ay1-n-d','nn vbp vb'],\n'window':['w-ih1-n d-ow','nn'],\n'wing':['w-ih1-ng','nn vb'],\n'winter':['w-ih1-n t-er','nn vb'],\n'wire':['w-ay1 er','nn vb'],\n'wish':['w-ih1-sh','vbp nn vb'],\n'with':['w-ih1-dh','in jj rb rp'],\n'woman':['w-uh1 m-ah-n','nn vb'],\n'wonder':['w-ah1-n d-er','nn vbp jj vb jjr'],\n'wood':['w-uh1-d','nn'],\n'word':['w-er1-d','nn vb'],\n'work':['w-er1-k','nn vb vbp'],\n'world':['w-er1-l-d','nn rb'],\n'would':['w-uh1-d','md'],\n'write':['r-ay1-t','vb vbp'],\n'written':['r-ih1 t-ah-n','vbn jj'],\n'wrong':['r-ao1-ng','jj nn rb vb'],\n'yard':['y-aa1-r-d','nn'],\n'year':['y-ih1-r','nn jj'],\n'yellow':['y-eh1 l-ow','jj nn vb'],\n'yes':['y-eh1-s','uh rb'],\n'yet':['y-eh1-t','rb cc'],\n'you':['y-uw1','prp rp'],\n'young':['y-ah1-ng','jj'],\n'your':['y-ao1-r','prp$']\n}; }", "title": "" }, { "docid": "f75746972614129ee0399882330ff6e7", "score": "0.48019964", "text": "function getProbability(data_in, model_type) {\n\n var prob = 0.0\n //app.get('/scorepredictionv2/:scorea/:scoreh/:timeleft/:overunder/:teamaspread',\n var parser = location;\n //var hostname = $('<a>').prop('href', url).prop('hostname');\n //parser.href = \"http://example.com:3000/pathname/?search=test#hash\";\n //parser.protocol; // => \"http:\"\n\n console.log('hostname = '+ parser.host )\n\n if( parser.host.search(\"localhost\") == -1) {\n http_s = 'https://'\n } else {\n http_s = 'http://'\n }\n\n console.log('http_s = '+ http_s )\n\n\n console.log(http_s+parser.host+'/callwlm/' + model_type + '/' + data_in.loan_amount + '/' + data_in.annual_inc + '/' + data_in.dti.toFixed(2) + '/' + data_in.reason )\n //console.log('http://'+parser.host+'/callwlm/' + data_in.loan_amount + '/' + mpt.toFixed(2) + '/' + avgsp.toFixed(2) + '/' + gt80pt.toFixed(2) + '/' + pwkd.toFixed(2) + '/' + pln.toFixed(2) + '/' + prh.toFixed(2) + '/' + nept )\n\n var mytestquery = jQuery.ajax({\n url: http_s+parser.host+'/callwlm/' + model_type + '/' + data_in.loan_amount + '/' + data_in.annual_inc + '/' + data_in.dti.toFixed(2) + '/' + data_in.reason ,\n //url: 'http://'+parser.host+'/callwlm/' + trips + '/' + mpt.toFixed(2) + '/' + avgsp.toFixed(2) + '/' + gt80pt.toFixed(2) + '/' + pwkd.toFixed(2) + '/' + pln.toFixed(2) + '/' + prh.toFixed(2) + '/' + nept ,\n //url: 'http://169.55.24.28:6001/scorepredictionv2/' + scorea + '/' + scoreh + '/' + timeleft + '/' + overunder + '/' + teamaspread ,\n success: function (data){\n //console.log(\"output =\" + $.data)\n //console.log(\"data = \"+ JSON.stringify(data));\n updateChart(data.probability, model_type);\n },\n error: function (data) {\n console.log(\"Error in lendingclub.js getProbability\")\n }\n });\n\n return 0;\n}", "title": "" }, { "docid": "c576231db7d1b9ba5048665c76e78422", "score": "0.47968495", "text": "function requestKaAns(err,res,html){\n console.log(err);\n console.log(res.statusCode);\n //console.log(html);//html code of google will be printed by this\n if(err){\n console.log(\"sone error\",err);\n }else{\n //data->scrap\n console.log(html);\n }\n}", "title": "" }, { "docid": "ed0b78d8adf21459d0a9eea6aea0392e", "score": "0.4793888", "text": "constructor(hmid)\n {\n this._hmid = hmid;\n this.makeHotelRequest();\n }", "title": "" }, { "docid": "5e7e52fcd76233b08ac3251a423e0615", "score": "0.47917953", "text": "function ___callback() {\r\n \r\n // function get(url, cb) {\r\n // GM_xmlhttpRequest({\r\n // method: \"GET\",\r\n // url: url,\r\n // onload: function(xhr) { alert(1); cb(xhr.responseText); }\r\n // });\r\n // }\r\n // \r\n // get(\"http://xxxx.com:4567/?a=1111\", cc);\r\n \r\n cc(GM_xmlhttpRequest);\r\n \r\n GM_xmlhttpRequest({\r\n method: \"GET\",\r\n url: \"http://baidu.com/?a=1111\",\r\n onload: function(xhr) { alert(1); }\r\n });\r\n \r\n $( 'p' ).css( {border:'1px dashed red'} );\r\n \r\n ___Trace.logPage();\r\n \r\n}", "title": "" }, { "docid": "e7e41a58faf54fb7f175f1aed5197ad5", "score": "0.4791755", "text": "function allMatchHandler(url){\n request(url, cb);\n\n}", "title": "" }, { "docid": "1e57840479470afa8e8668351b60137e", "score": "0.4786397", "text": "static describe (module) {\n\t\tconst description = GetManyRequest.describe(module);\n\t\tdescription.description = 'Returns an array of posts for a given stream (given by stream ID), governed by the query parameters. Posts are fetched in pages of no more than 100 at a time. Posts are fetched in descending order unless otherwise specified by the sort parameter. To fetch in pages, continue to fetch until the \"more\" flag is not seen in the response, using the lowest sequence number fetched by the previous operation (or highest, if fetching in ascending order) along with the \"before\" operator (or \"after\" for ascending order).';\n\t\tdescription.access = 'User must be a member of the stream';\n\t\tObject.assign(description.input.looksLike, {\n\t\t\t'teamId*': '<ID of the team that owns the stream for which posts are being fetched>',\n\t\t\t'streamId': '<ID of the stream for which posts are being fetched>',\n\t\t\t'parentPostId': '<Fetch only posts that are replies to the post given by this ID>',\n\t\t\t'sort': '<Posts are sorted in descending order, unless this parameter is given as \\'asc\\'>',\n\t\t\t'limit': '<Limit the number of posts fetched to this number>',\n\t\t\t'before': '<Fetch posts before this sequence number, including the post with that sequence number if \"inclusive\" set>',\n\t\t\t'after': '<Fetch posts after this sequence number, including the post with that sequence number if \"inclusive\" is set>',\n\t\t\t'inclusive': '<If before or after or both are set, indicated to include the reference post in the returned posts>'\n\t\t});\n\t\tdescription.returns.summary = 'An array of post objects, plus possible codemark and marker objects, and more flag';\n\t\tObject.assign(description.returns.looksLike, {\n\t\t\tposts: '<@@#post objects#codemark@@ fetched>',\n\t\t\tcodemarks: '<associated @@#codemark objects#codemark@@>',\n\t\t\treviews: '<associated @@#review objects#review@@>',\n\t\t\tcodeErrors: '<associated @@#codeError objects#code errors@@>',\n\t\t\tmarkers: '<associated @@#markers#markers@@>',\n\t\t\tmore: '<will be set to true if more posts are available, see the description, above>'\n\t\t});\n\t\tdescription.errors = description.errors.concat([\n\t\t\t'invalidParameter',\n\t\t\t'notFound'\n\t\t]);\n\t\treturn description;\n\t}", "title": "" }, { "docid": "690e577b940cda47b760f4b940ebfd86", "score": "0.47847623", "text": "function getRecords(url, requestHandler) {\n requestHandler.makeRequest(\"GET\", url + \"recentMatches/\", function (data){\n let matches = JSON.parse(data);\n let maxDeaths = 0;\n let heroDMG = Number.MAX_SAFE_INTEGER;\n let xpm = Number.MAX_SAFE_INTEGER;\n let minXP;\n let kda = [0, 0 , 0];\n let gameTime = Number.MAX_SAFE_INTEGER;\n let gpm = Number.MAX_SAFE_INTEGER;\n let netWorth;\n let towerDMG = Number.MAX_SAFE_INTEGER;\n let lastHits = Number.MAX_SAFE_INTEGER;\n let streak = 0;\n let tempStreak = 0;\n for (i = 0; i < matches.length; i++) {\n let m = matches[i];\n if (maxDeaths < m.deaths) {\n maxDeaths = m.deaths;\n kda[0] = m.kills;\n kda[1] = m.deaths;\n kda[2] = m.assists;\n }\n\n if (heroDMG > m.hero_damage) {\n heroDMG = m.hero_damage;\n }\n\n if (xpm > m.xp_per_min) {\n xpm = m.xp_per_min;\n minXP = xpm * (m.duration/60);\n }\n\n if (gameTime > m.duration) {\n gameTime = m.duration;\n }\n\n if (gpm > m.gold_per_min) {\n gpm = m.gold_per_min;\n netWorth = gpm * (m.duration/60);\n }\n\n if (towerDMG > m.tower_damage) {\n towerDMG = m.tower_damage;\n }\n\n if (lastHits > m.last_hits) {\n lastHits = m.last_hits;\n }\n let flag = false;\n if (m.player_slot < 128) {\n //player is on radiant\n if (m.radiant_win == false) {\n tempStreak++;\n } else {\n flag = true;\n console.log(m.match_id);\n }\n } else {\n //player is on dire\n if (m.radiant_win == true) {\n tempStreak++;\n } else {\n flag = true;\n console.log(m.match_id);\n }\n }\n\n if (tempStreak > streak) {\n streak = tempStreak;\n }\n\n if (flag) {\n tempStreak = 0;\n }\n }\n document.getElementById(\"maxDeaths\").innerHTML = maxDeaths;\n document.getElementById(\"minHeroDMG\").innerHTML = heroDMG;\n document.getElementById(\"minXP\").innerHTML = Math.round(minXP);\n document.getElementById(\"worstKDA\").innerHTML = kda[0] + \"-\" + kda[1] + \"-\" + kda[2];\n document.getElementById(\"minTime\").innerHTML = Math.round(gameTime/60) + \":\" + gameTime % 60;\n document.getElementById(\"minNetWorth\").innerHTML = Math.round(netWorth);\n document.getElementById(\"minTowerDMG\").innerHTML = towerDMG;\n document.getElementById(\"minLastHits\").innerHTML = lastHits;\n document.getElementById(\"losingStreak\").innerHTML = streak;\n document.getElementById(\"loader\").innerHTML = \"\";\n });\n}", "title": "" }, { "docid": "876ee805835e94bd5aa767043ced1ded", "score": "0.4784556", "text": "function getWingRequests(req, res) {\n var tokenObj = auth.decode(req.headers['x-access-token']);\n var clientID = tokenObj.ID;\n var clientUsername = tokenObj.username;\n\n var results = [];\n\n db.getAllDuosOf(clientID).then(function(resp) {\n var users = resp.map(function(duo) {\n // grab a more specific status to pass to client\n var statusForClient = realStatus(duo, clientID);\n var user;\n\n // format the user to be front-end friendly\n user = filterDuo(duo, clientID);\n user.status = statusForClient;\n return user;\n });\n\n hp.sendJSON(res, true, 'Here are all of your wings!', results.concat(users));\n });\n\n}", "title": "" }, { "docid": "3c7a6244718ef1d53abae959df526906", "score": "0.47815615", "text": "function makeRequest(functionName, urlAdd) {\n\t\t$('graph').innerHTML = \"\";\n\t\t$('norankdata').style.display = \"none\";\n\t\t$('meaning').innerHTML = \"\";\n\t\t$('celebs').innerHTML = \"\";\n\t\t$('loadingcelebs').style.display = \"block\";\n\t\t$('loadingmeaning').style.display = \"block\";\n\t\t$('loadinggraph').style.display = \"block\";\n\n\t\tvar ajax = new XMLHttpRequest();\n\t\tajax.onload = functionName;\n\t\tajax.open(\"GET\", \"https://webster.cs.washington.edu/cse154/babynames.php\" + urlAdd, true);\n\t\tajax.send();\t\n\t}", "title": "" }, { "docid": "44a5a266bf2c4d9c4a43f519d726f097", "score": "0.47798547", "text": "function movieThis(thingToLookUp) {\n var queryUrl = 'http://www.omdbapi.com/?apikey=b6ef9f19&t=' + thingToLookUp;\n //figure out how to put key into .env\n request(queryUrl, function (error, response, body) {\n // If the request is successful...\n if (!error && response.statusCode === 200) {\n\n // Parses the body of the site and recovers movie info.\n var movie = JSON.parse(body);\n\n // Prints out movie info.\n console.log(\"Title of the movie: \" + movie.Title);\n console.log(\"Year the movie came out: \" + movie.Year);\n console.log(\"IMDB rating of the movie: \" + movie.imdbRating);\n //the function will break if the movie doesn't have a tomatoes rating\n console.log(\"Rotten Tomatoes Rating of the movie: \" + movie.Ratings[1].Value);\n console.log(\"Country(s) where the movie was produced: \" + movie.Country);\n console.log(\"Language of the movie: \" + movie.Language);\n console.log(\"Plot of the movie: \" + movie.Plot);\n console.log(\"Actors in the movie: \" + movie.Actors);\n }\n });\n}", "title": "" }, { "docid": "8d30a509212799a45856028c85a579a0", "score": "0.47748592", "text": "async function getHaulingData(hasQueryParams) {\n let from = [];\n let to = [];\n\n if (hasQueryParams) {\n // Converting From/To Query Params back to station names.\n hauling_request.from = getFromTradePreference(hauling_request.from);\n\n fromLocations = hauling_request.from.split(',');\n for(const flocation of fromLocations) {\n from.push(getNameFromUniverseStations(flocation.split(':')[1]).name)\n }\n hauling_request.from = `${fromPreference}-${hauling_request.from}`;\n\n from = collapseStationsToSystems(from);\n\n hauling_request.to = getToTradePreference(hauling_request.to);\n \n toLocations = hauling_request.to.split(',');\n for(const tlocation of toLocations) {\n to.push(getNameFromUniverseStations(tlocation.split(':')[1]).name)\n }\n hauling_request.to = `${toPreference}-${hauling_request.to}`;\n\n to = collapseStationsToSystems(to);\n\n from = from.join(',');\n to = to.join(',');\n } else {\n from = getStationNamesFromList('fromStations');\n to = getStationNamesFromList('toStations');\n\n tradePreference = $('#tradePreference').val();\n\n if (tradePreference.length > 0) {\n fromPreference = $('#tradePreference').val().split('-')[0];\n toPreference = $('#tradePreference').val().split('-')[1];\n }\n \n hauling_request = {\n from: `${fromPreference}-${getStationInfoFromList('fromStations')}`,\n to: `${toPreference}-${getStationInfoFromList('toStations')}`,\n maxBudget: parseInt($(\"#maxBudget\").val()) || Number.MAX_SAFE_INTEGER,\n maxWeight: parseInt($(\"#maxWeight\").val()) || Number.MAX_SAFE_INTEGER,\n minProfit: parseInt($(\"#minProfit\").val()) >= 0 ? parseInt($(\"#minProfit\").val()) : 500000,\n minROI: parseFloat((parseFloat($(\"#minROI\").val()/100) || 0.04).toFixed(2)),\n routeSafety: $(\"#routeSafety\").val() || \"shortest\",\n systemSecurity: $(\"#systemSecurity\").val() || \"high_sec,low_sec,null_sec\",\n tax: parseFloat((parseFloat($(\"#tax\").val()/100) || 0.08).toFixed(4))\n }\n }\n \n const qs = Object.keys(hauling_request)\n .map(key => `${key}=${hauling_request[key]}`)\n .join('&');\n \n if (history.pushState) {\n var newurl = `${window.location.protocol}//${window.location.host}${window.location.pathname}?${qs}`;\n window.history.pushState({urlPath:newurl}, '', newurl);\n }\n \n createTradeHeader(hauling_request, from, to);\n \n const qp = new URLSearchParams(hauling_request).toString();\n const requestUrl = `${API_ENDPOINT}?${qp}`;\n startTime = new Date();\n \n $(\"#hauling-form\").remove();\n \n return fetchWithRetry(\n url = requestUrl,\n tries = 3,\n errorMsg = `Error retrieving orders for this station hauling request. Please try refreshing this page.`\n ).then(function(response) {\n return response;\n });\n}", "title": "" }, { "docid": "320183b37854afe5d33c684d488df31d", "score": "0.47740042", "text": "function buildHandlers(event) {\n var handlers = {\n \"LaunchRequest\": function() {\n const greetingsIndex = Math.floor(Math.random() * greetings.length);\n const randomGreeting = greetings[greetingsIndex];\n const speechOutput = randomGreeting;\n\n this.response.cardRenderer(SKILL_NAME, randomGreeting);\n this.response.speak(speechOutput);\n this.emit(\":responseReady\");\n },\n \"getGreeting\": async function() {\n console.log(null);\n },\n \"findRestaurant\": function(){\n \n const myLocation = event.request.intent.slots.city.value;\n const myCategory = event.request.intent.slots.place.value;\n\n const search = {\n term: myCategory,\n radius: 10000,\n limit: 50,\n open_now: true,\n category: \"food,All\"\n };\n \n if (myLocation) {\n search.location = location;\n } else {\n search.location = await getLocation(event);\n }\n client\n .search(search)\n .then(response => {\n let clientResponse = response.jsonBody.businesses;\n let len = clientResponse.length;\n if (len === 0) {\n console.log(\"No Locations\");\n res.send(\"No Locations\");\n return;\n }\n let choice = Math.floor(Math.random() * (len + 1));\n let miles = clientResponse[choice].distance * 0.00062137;\n console.log(\"------------------------------------------\");\n console.log(`\n Picked: ${clientResponse[choice].name}\n Miles Away: ${miles}\n Options Length: ${len}\n Options Choice Number: ${choice}\n `);\n console.log(\"------------------------------------------\");\n this.response.speak(`How about trying out ${place}. It is ${miles} away from your location given and is currently open.`);\n })\n .catch(e => {\n console.log(e);\n res.send(e);\n });\n },\n \"AMAZON.HelpIntent\": function() {\n const speechOutput = HELP_MESSAGE;\n const reprompt = HELP_REPROMPT;\n\n this.response.speak(speechOutput).listen(reprompt);\n this.emit(\":responseReady\");\n },\n \"AMAZON.CancelIntent\": function() {\n this.response.speak(STOP_MESSAGE);\n this.emit(\":responseReady\");\n },\n \"AMAZON.StopIntent\": function() {\n this.response.speak(STOP_MESSAGE);\n this.emit(\":responseReady\");\n }\n };\n}", "title": "" }, { "docid": "c4380da8a1b688b8c1eb2aee1f442b1f", "score": "0.47726405", "text": "getData() {\n $.ajax({\n url: 'https://makevoid-skicams.p.mashape.com/cams.json',\n type: 'GET',\n dataType: 'json',\n\n success: function(data) {\n this.processData(data);\n }.bind(this),\n\n error(err) {\n alert(err);\n },\n\n beforeSend(xhr) {\n xhr.setRequestHeader(\n 'X-Mashape-Authorization',\n 'kxSXmUymofmshFHhhKxWOSJpqJsJp1I3zNnjsnqKwhITAiC1zw'\n );\n },\n });\n }", "title": "" }, { "docid": "c6b4dd70eb9686adc0ea7a7b91b5b835", "score": "0.47725365", "text": "function intentDispatch(req,res,cb){\n var intentName = req.body.request.intent.name;\n var responder = require('./responseBuilder');\n\n var exceptions = [\"AMAZON.LoopOffIntent\",\"AMAZON.LoopOnIntent\",\"AMAZON.RepeatIntent\",\"AMAZON.ShuffleOffIntent\",\"AMAZON.ShuffleOnIntent\",\"AMAZON.StartOverIntent\"];\n if(exceptions.indexOf(intentName)!=-1){throw \"Sorry <break time='0.5s'/> I can't do that.\";return;}\n\n switch(intentName){\n\n case \"getRadioTrack\":\n responder.trackRespond(req,res,cb);\n break;\n case \"getRadioStream\":\n responder.streamPlayRespond(req,res,cb);\n break;\n case \"AMAZON.PauseIntent\":\n responder.streamStopRespond(req,res,cb);\n break;\n case \"AMAZON.CancelIntent\":\n responder.streamStopRespond(req,res,cb);\n break;\n case \"AMAZON.PreviousIntent\":\n responder.streamGenreRespond(-1,req,res,cb);\n break;\n case \"AMAZON.NextIntent\":\n responder.streamGenreRespond(1,req,res,cb);\n break;\n case \"AMAZON.HelpIntent\":\n responder.simpleSpeechRespond(\"The shoutcas skill allows you to listen to any music registered at shoutcast.com. Try <break time='0.5s' /><emphasis level='reduced'>Alexa, ask shoutcast to start <emphasis>pandashowradio</emphasis></emphasis> <break time='0.5s' /> or <break time='0.5s' /> <emphasis level='reduced'>Alexa, ask shoutcast what song is <emphasis>jazz and lounge station</emphasis> playing</emphasis> <break time='1s' />If you don't know any radio station<break time='0.5s'/> try <break time='0.5s' /><emphasis level='reduced'>Alexa, ask shoutcast to play rock songs</emphasis>\",req,res,cb);\n break;\n case \"AMAZON.ResumeIntent\":\n responder.streamResumeRespond(req,res,cb);\n break;\n case \"AMAZON.CancelIntent\":\n responder.streamStopRespond(req,res, cb);\n break;\n case \"getRadioGenre\":\n responder.streamGenreRespond(0,req,res,cb);\n break;\n default:\n throw \"Sorry <break strength='medium'/> I can't do that.\";\n break;\n }\n\n}", "title": "" }, { "docid": "038b258837ad0fa10c0cfb4ab4b86baf", "score": "0.47661456", "text": "function respond() {\n var request = JSON.parse(this.req.chunks[0]),\n botRegex = /^\\/Bill$/,\n\t trigger = \"Bill\";\n\n\tvar req = request.text.toString();\n if((req.indexOf(\"Bill\") >= 0) && (req.indexOf(\"Bill\") <= 1000)) {//request.text && botRegex.test(request.text)) {\n this.res.writeHead(200);\t\n //postMessage();\n\t\n\t/////////////////\n\tvar botResponse, options, body, botReq;\n var str = \"Mmmhmm.\";\n\n botResponse = str;//this.req.toString();//cool();\n\n options = {\n hostname: 'api.groupme.com',\n path: '/v3/bots/post',\n method: 'POST'\n };\n\n body = {\n \"bot_id\" : botID,\n \"text\" : botResponse\n };\n\n console.log('sending ' + botResponse + ' to ' + botID);\n\n botReq = HTTPS.request(options, function(res) {\n if(res.statusCode == 202) {\n //neat\n } else {\n console.log('rejecting bad status code ' + res.statusCode);\n }\n });\n\n botReq.on('error', function(err) {\n console.log('error posting message ' + JSON.stringify(err));\n });\n botReq.on('timeout', function(err) {\n console.log('timeout posting message ' + JSON.stringify(err));\n });\n botReq.end(JSON.stringify(body));\n\t/////////////////\n\t\n this.res.end();\n } else {\n console.log(\"don't care\");\n this.res.writeHead(200);\n this.res.end();\n }\n}", "title": "" }, { "docid": "3041c9c9bb7f62249d70c9ed1accb78f", "score": "0.47617954", "text": "willSendRequest(request) {\n request.params.set('api_key', '4e911a064e43b9cd6fbb3137c572d89a');\n request.params.set('include_adult', false);\n }", "title": "" }, { "docid": "299afdd157ae6ad1cbd7a7d5b04913fa", "score": "0.47615343", "text": "function keyWordSearch() {\n gapi.client.setApiKey('AIzaSyBSlP4gPCojbCgP0kns_XgvDAa38-sx4vg');\n gapi.client.load('youtube', 'v1', function() {\n makeRequest();\n makeRequestViews();\n });\n}", "title": "" } ]
5394199c5475a54dca26baffd644af06
BI Variable object Contains information to describe a repository or session variable
[ { "docid": "bf1019948b0ced05e78e29ba82162a2d", "score": "0.7217074", "text": "function BIVariable(name, type) {\n\tthis.Name = name; // Variable name as defined in OBIEE\n\t\n\tthis.VarType = type || 'Repository'; // Type, repository or session\n\tif ($.inArray(this.VarType, ['Repository', 'Session']) == -1)\n\t\tthrow 'Invalid variable type \"' + type + '\" chosen.';\n\t\n\tvar code;\n\tswitch(this.VarType) {\n\t\tcase 'Repository':\n\t\t\tcode = 'VALUEOF(\"' + this.Name + '\")';\n\t\t\tbreak;\n\t\tcase 'Session':\n\t\t\tcode = 'VALUEOF(NQ_SESSION.\"' + this.Name + '\")';\n\t\t\tbreak;\n\t}\n\t\t\n\tthis.Code = code;\n\tthis.Value = '';\n\tthis.Type = 'Variable'\n}", "title": "" } ]
[ { "docid": "af7cd7fd0cfcca89dde718f195b138c2", "score": "0.64163244", "text": "getVariables() {\r\n return this.variableDesc;\r\n }", "title": "" }, { "docid": "d36d75b4bff25645849e54cb1b356f51", "score": "0.60860646", "text": "variable(value) {\n return new Variable_1.Variable(value);\n }", "title": "" }, { "docid": "66c58b750ecaf0da6c4c98cf6c168934", "score": "0.60559964", "text": "get VariableID() {\n return this._variableId;\n }", "title": "" }, { "docid": "8734ee9dee0d2f0486ab4e91a366e014", "score": "0.60182786", "text": "function Variable(args) {\n this.name = args.name;\n}", "title": "" }, { "docid": "696c5b256530e65f53786dee74bf59d8", "score": "0.59650815", "text": "static get Variable() {\n return Variable;\n }", "title": "" }, { "docid": "4927c4ee04c27ec9235ef7e829715b8c", "score": "0.5847711", "text": "function Variable() {\n var _this;\n\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n _classCallCheck(this, Variable);\n\n _this = _super.call(this, name);\n\n _defineProperty(_assertThisInitialized(_this), \"termType\", VariableTermType);\n\n _defineProperty(_assertThisInitialized(_this), \"base\", 'varid:');\n\n _defineProperty(_assertThisInitialized(_this), \"classOrder\", ClassOrder.Variable);\n\n _defineProperty(_assertThisInitialized(_this), \"isVar\", 1);\n\n _defineProperty(_assertThisInitialized(_this), \"uri\", void 0);\n\n _this.base = 'varid:';\n _this.uri = Uri.join(name, _this.base);\n return _this;\n }", "title": "" }, { "docid": "2351200cfde8753c0792ab61707d831f", "score": "0.57995814", "text": "get termType() {\n return 'Variable';\n }", "title": "" }, { "docid": "2351200cfde8753c0792ab61707d831f", "score": "0.57995814", "text": "get termType() {\n return 'Variable';\n }", "title": "" }, { "docid": "d4d832040d8a402e7f9d26713ce64334", "score": "0.5705979", "text": "function OpenPCS_Write_GetVariableObject (strVarPath_p, strVarType_p)\n {\n\n var VarTypeClass;\n var ObjVarInst;\n\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: strVarPath_p=' + strVarPath_p + ', strVarType_p=' + strVarType_p);\n\n switch (strVarType_p)\n {\n case 'VARTYPE_AUTO':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarAuto');\n try\n {\n VarTypeClass = ThisNode.m_ObjIpcClient.getVariableClassSync (strVarPath_p, IPC_GET_VAR_TYPE_TIMEOUT);\n ObjVarInst = new VarTypeClass (strVarPath_p);\n }\n catch (ErrInfo)\n {\n TraceMsg ('{OpenPCS_Write_Node} ERROR: ' + ErrInfo.message);\n ObjVarInst = null;\n\n // show IPC state in editor\n OpenPCS_Write_ShowIpcState (IPC_STATE_ERROR, ErrInfo.message);\n }\n break;\n }\n\n case 'VARTYPE_STRING':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarString');\n ObjVarInst = new Ipc.IpcVarString (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_BOOL':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarBool');\n ObjVarInst = new Ipc.IpcVarBool (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_BYTE':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarByte');\n ObjVarInst = new Ipc.IpcVarByte (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_USINT':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarUSInt');\n ObjVarInst = new Ipc.IpcVarUSInt (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_SINT':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarSInt');\n ObjVarInst = new Ipc.IpcVarSInt (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_WORD':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarWord');\n ObjVarInst = new Ipc.IpcVarWord (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_UINT':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarUInt');\n ObjVarInst = new Ipc.IpcVarUInt (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_INT':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarInt');\n ObjVarInst = new Ipc.IpcVarInt (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_DWORD':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarDWord');\n ObjVarInst = new Ipc.IpcVarDWord (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_UDINT':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarUDInt');\n ObjVarInst = new Ipc.IpcVarUDInt (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_DINT':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarDInt');\n ObjVarInst = new Ipc.IpcVarDInt (strVarPath_p);\n break;\n }\n\n case 'VARTYPE_REAL':\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ObjVarInst=IpcVarReal');\n ObjVarInst = new Ipc.IpcVarReal (strVarPath_p);\n break;\n }\n\n default:\n {\n TraceMsg ('{OpenPCS_Write_Node} OpenPCS_Write_GetVariableObject: ERROR: unknown/unsupported Type (ObjVarInst=null)');\n ObjVarInst = null;\n break;\n }\n }\n\n return (ObjVarInst);\n\n }", "title": "" }, { "docid": "37da91301fdbb5beeec0b951fb49cdc9", "score": "0.5691841", "text": "function Variable() {\n var _this;\n\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n (0, _classCallCheck2.default)(this, Variable);\n _this = _super.call(this, name);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"termType\", _types.VariableTermType);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"base\", 'varid:');\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"classOrder\", _classOrder.default.Variable);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"isVar\", 1);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"uri\", void 0);\n _this.base = 'varid:';\n _this.uri = Uri.join(name, _this.base);\n return _this;\n }", "title": "" }, { "docid": "c293500b517a287177fe1ef579f44b17", "score": "0.551242", "text": "get vars(){return this._vars;}", "title": "" }, { "docid": "6814171f6477660d93d2b4b9dbb2b608", "score": "0.5415799", "text": "generateNewVariable({name, isRow, definition}) {\n let id = `v_${this.variables.length + 1}`;\n name = name || id;\n return new DataVariable({id, name, isRow, definition});\n }", "title": "" }, { "docid": "c7a876c3dacc8fe0456c17a45748a33e", "score": "0.5404061", "text": "get VariableIDs() {\n return this._variableIds;\n }", "title": "" }, { "docid": "33c301d1b1878b3386f4d8208784f774", "score": "0.5395485", "text": "function Variable(scope,name,decl,options){\n\t\tthis._scope = scope;\n\t\tthis._name = name;\n\t\tthis._alias = null;\n\t\tthis._declarator = decl;\n\t\tthis._autodeclare = false;\n\t\tthis._declared = true;\n\t\tthis._resolved = false;\n\t\tthis._options = options || {};\n\t\tthis._type = this._options.type || 'var';\n\t\tthis._export = false;// hmmmm\n\t\t// @declarators = [] # not used now\n\t\tthis._references = [];// should probably be somewhere else, no?\n\t}", "title": "" }, { "docid": "54f71fbcc99370b73e6e4cf11bb0c011", "score": "0.5335328", "text": "get variables() {\n return this.items;\n }", "title": "" }, { "docid": "211f06376f14861f38099a35d45e6a58", "score": "0.5319764", "text": "function addVariableInfo(variableURI, usedBy, generatedBy, variableType, artifactValues) {\n\tif (processInfosCount == 0 && variableInfosCount == 0) {\n\t\t// resize the visualization container\n\t\tconsole.log(\"should reize\");\n translateVisualization();\n\t\t$vis.animate({\n \"width\": \"63%\"\n }, \"slow\");\n\t}\n\tconsole.log(artifactValues);\n\t// check that variable div thing is not over count\n\tif (variableInfosCount == 4) {\n\t\t\t// remove a variable\n\t\t\tremoveVariableInfo(variableSectionsShowing[0]);\n\t}\n\t\n\t// get name of node\n\tvar variableName = stripNameFromURI(variableURI);\n\tconsole.log(variableName);\n\t\t\n\tvar alreadyShowing = false;\n\t// Check that section is not already showing\n\tfor (i = 0; i < variableSectionsShowing.length; i++) {\n\t\t\tif (variableSectionsShowing[i] == variableName) {\n\t\t\t\talreadyShowing = true;\n\t\t\t}\n\t}\n\tif (alreadyShowing) {\n\t\t\tconsole.log(\"variable is already showing!\");\n\t}\n\t\n\t// panel isn't already displayed on page, so add it\n\tif (!alreadyShowing) {\n\t\tvariableSectionsShowing[variableInfosCount] = variableName;\n\t\tvar $newPanel = $templateVariables.clone();\n\t\t\n//\t\t$newPanel.find(\".collapse\").removeClass(\"in\");\n\t\t// set header name\n\t\t$newPanel.find(\".accordion-toggle\").attr(\"href\", \"#v\" + (variableInfosIndex)).text(\"Variable: \" + variableName);\n\t\t$newPanel.attr(\"id\", variableName);\n\t\t// link clicking on process name to expand collapse\n\t\t$newPanel.find(\".panel-collapse\").attr(\"id\", \"v\" + variableInfosIndex);\n\n\t\t// show variable type and generated by info\n\t\tvar textVarType = $newPanel.find(\"div\")[6];\n\t\tvar newName = document.createElement(\"strong\");\n\t\tnewName.innerHTML = variableType;\n\t\ttextVarType.append(newName);\n\t\t\n\t\t// Generated By\n\t\tvar textGeneratedBy = $newPanel.find(\"div\")[7];\n\t\tvar newGeneratedBy = document.createElement(\"strong\");\n\t\tnewGeneratedBy.innerHTML = \" - \";\n\t\t// ----------TODO----------\n\t\tif (typeof generatedBy != 'undefined') {\n\t\t\tnewGeneratedBy.innerHTML = stripNameFromURI(generatedBy[0]);\n\t\t} else {\n\t\t\tnewGeneratedBy.innerHTML = \"-\";\n\t\t}\n\t\ttextGeneratedBy.append(newGeneratedBy);\n\t\t\n\t\t// show list of used by processes\n\t\tvar listUsedBy = $newPanel.find(\"ul\")[0];\n\t\tif (typeof usedBy != 'undefined') {\n\t\t\tfor (var i = 0; i < usedBy.length; i++) {\n\t\t\t\tvar newListItem = document.createElement(\"li\");\n\t\t\t\tnewListItem.innerHTML = stripNameFromURI(usedBy[i]);\n\t\t\t\tlistUsedBy.append(newListItem);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check which tab is showing based on the selected/active index\n\t\t// if index 1 is selected, we are on the execution tab\n\t\t// otherwise, on the index 0 tab we are on the main workflow page and do not want any file info\n\t\t// displayed for variables\n\t\tvar fileInfo = $newPanel.find(\"div\")[11];\n\t\tif ($(\"ul.nav li.active\").index() == 0) {\n\t\t\tfileInfo.setAttribute(\"style\", \"display:none\");\n\t\t} else {\n\t\t\t\tfileInfo.setAttribute(\"style\", \"display:block\");\n\t\t\t\t// show list of files in dropdown and w/ handler to update link\n\t\t\t\tvar fileSelector = $newPanel.find(\"select\")[0];\n\n\t\t\t\t$($newPanel).find(\"#file-selector\").attr(\"id\",\"file-selector-\"+variableName);\n\t\t\t\tif (artifactValues.length == 0) {\n\t\t\t\t\t$($newPanel).find(\"#file-selector\").attr(\"disabled\",\"disabled\");\n\t\t\t\t} \n\t\t\t\tvar defaultFile = document.createElement(\"option\");\n\t\t\t\tdefaultFile.innerHTML = \" - \";\n\t\t\t\tfileSelector.append(defaultFile);\n\t\t\t\tconsole.log(artifactValues.bindings);\n\t\t\t\tfor (var i = 0; i < artifactValues.bindings.length; i++) {\n\t\t\t\t\tvar newFile = document.createElement(\"option\");\n\t\t\t\t\tnewFile.innerHTML = artifactValues.bindings[i].file.type;\n\t\t\t\t\tconsole.log(artifactValues.bindings[i].file.type);\n\t\t\t\t\tfileSelector.append(newFile);\n\t\t\t\t}\n\t\t\t\t// file download link\n\t\t\t\tvar downloadSpan = $newPanel.find(\"span\")[3];\n\t\t\t\tvar downloadLink = document.createElement(\"a\");\n\t\t\t\tdownloadLink.setAttribute(\"style\", \"margin-left:8px\");\n\t\t\t\tdownloadLink.innerHTML = \" - \";\n\t\t\t\tdownloadLink.setAttribute(\"id\", \"download-link-\"+variableName);\n\t\t\t\tdownloadSpan.append(downloadLink);\n\n\t\t\t\t$newPanel.on('change','#file-selector-'+variableName,function(){\n\t\t\t\t\tvar selector = document.getElementById(\"file-selector-\"+variableName);\n\t\t\t\t\tvar selectedText = selector.options[selector.selectedIndex].text;\n\t\t\t\t\tvar link = document.getElementById(\"download-link-\"+variableName);\n\t\t\t\t\tlink.innerHTML = selectedText;\n\t\t\t\t\tif (selector.selectedIndex !=0 ) {\n\t\t\t\t\t\t\tlink.setAttribute(\"href\", artifactValues.bindings[selector.selectedIndex-1].file.value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlink.removeAttribute(\"href\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\t\t\n\t\t// add new panel to the page\n\t\t$(\"#accordionVariables\").append($newPanel.fadeIn(\"slow\"));\n\n\t\tvariableInfosCount = variableInfosCount + 1;\n\t\tvariableInfosIndex = variableInfosIndex + 1;\n\t}\n}", "title": "" }, { "docid": "950928385356ce3b1cd10a6a48747af3", "score": "0.53135264", "text": "function track(variable) {\n\t\t// console.log(variable);\n\t\tvar varName = variable.id.name;\n\n\t\tswitch (variable.init.type) {\n\t\t\tcase 'Literal':\n\t\t\t\t// If variable.init.value is bad, mark variable as bad\n\t\t\t\tvars[varName] = variable.init.value;\n\t\t\t\tbreak;\n\t\t\tcase 'Identifier':\n\t\t\t\t// if variable is being set to a bad variable, mark it too as bad\n\t\t\t\tif (isVarableASource(variable.init.name)) {\n\t\t\t\t\tsources.push(varName);\n\t\t\t\t\tconsole.log('[BAD]'.red, varName);\n\t\t\t\t}\n\t\t\t\tvars[varName] = f(variable.init.name);\n\t\t\t\tbreak;\n\t\t\tcase 'BinaryExpression':\n\t\t\t\tclimb(variable.init).forEach(function (i) {\n\t\t\t\t\tif (i.type == 'Identifier') {\n\t\t\t\t\t\tif (isVarableASource(i.name)) {\n\t\t\t\t\t\t\tsources.push(varName);\n\t\t\t\t\t\t\tconsole.log('[BAD]'.red, varName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'CallExpression':\n\t\t\t\tvars[varName] = resolveCallExpression(variable.init);\n\t\t\t\tbreak;\n\t\t\tcase 'MemberExpression':\n\t\t\t\t// console.log(resolveMemberExpression(variable.init));\n\t\t\t\tswitch (variable.init.type){\n\t\t\t\t\tcase 'MemberExpression':\n\t\t\t\t\t\tvars[varName] = resolveMemberExpression(variable.init);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ObjectExpression': // json objects\n\t\t\t\tvars[varName] = resolveObjectExpression(variable.init);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconsole.log('[VAR]'.blue, pos(variable), varName, vars[varName]);\n\t\t\n\t}", "title": "" }, { "docid": "03105cb25c158dfaa92b07d80910917a", "score": "0.52400726", "text": "function dataToVar() {\r\n\t\r\n\tisolateCat(\"Asset_Type=\")\r\n\tassetType = catSelection\r\n\t\r\n\tisolateCat(\"Album=\")\r\n\talbum = catSelection\r\n\t\r\n\tisolateCat(\"Artist=\")\r\n\tartist = catSelection\r\n\t\r\n\tisolateCat(\"Category=\")\r\n\tcategory = catSelection\r\n\t\r\n\tisolateCat(\"Link_Product=\") \r\n\tlinkProduct = catSelection\r\n\t\r\n\tisolateCat(\"Link_Sponsor=\")\r\n\tlinkSponsor = catSelection\r\n\t\r\n\tisolateCat(\"Runtime=\")\r\n\truntime = catSelection\r\n\t\r\n\tisolateCat(\"ISRC=\")\r\n\tisrc = catSelection\r\n\t\r\n\tisolateCat(\"Title=\")\r\n\ttitle = catSelection\r\n\t\r\n\tisolateCat(\"TaskType=\")\r\n\ttaskType = catSelection\r\n\t\r\n\tisolateCat(\"TaskParamString=\")\r\n\ttaskParamString = catSelection\r\n\t\r\n\tisolateCat(\"ParentName=\")\r\n\tparentName = catSelection\r\n\t\r\n\tisolateCat(\"TaskCommandID=\")\r\n\ttaskCommandID = catSelection\r\n\t\r\n\tisolateCat(\"AlbumLabel=\")\r\n\talbumLabel = catSelection\r\n\t\r\n\tisolateCat(\"ReleaseYear=\")\r\n\treleaseYear = catSelection\r\n\t\r\n\tisolateCat(\"LinkOwner=\")\r\n\tlinkOwner = catSelection\r\n\t\r\n\tisolateCat(\"TritonSpot=\")\r\n\ttritonSpot = catSelection\r\n}", "title": "" }, { "docid": "fcf5833fa5e5ad9dfb450edb32ef3209", "score": "0.518815", "text": "function Registry() {\n this.variables = {};\n }", "title": "" }, { "docid": "c29c729745c8ccb18d51051ae16ee560", "score": "0.5184174", "text": "function is_variable(stmt) {\r\n return is_tagged_object(stmt, \"variable\");\r\n}", "title": "" }, { "docid": "1a54ea9972435a41799098e5793ef18b", "score": "0.5175643", "text": "getProjectVariables(projectId, limit) {\n return entities.ProjectLevelVariable.query({ projectId, limit });\n }", "title": "" }, { "docid": "3dff1e4b5b00877ba4437d6605ab76f6", "score": "0.5150051", "text": "static get_info() { \n\treturn {\n\t id : id , \n\t rules : [ \"?(create|make) ?(new) alias ?(please)\", \n\t\t ],\n\t vars : { \"input\" : { default_value : false , \n\t\t\t\t query : \"What is the input?\", \n\t\t\t\t filter : null } , \n\t\t\t \"output\" : { default_value : false , \n\t\t\t\t query : \"What is the output?\", \n\t\t\t\t filter : null }} \t\t\t \n\t}\n }", "title": "" }, { "docid": "4ce42e283377dc934d469be1dae46e74", "score": "0.51401585", "text": "initVariables() {\n\t\tconst variableDefinitions = [\n\t\t\t{\n\t\t\t\tlabel: 'Sample Variable',\n\t\t\t\tname: 'sample_variable',\n\t\t\t},\n\t\t]\n\n\t\tthis.setVariableDefinitions(variableDefinitions)\n\n\t\t// Set initial values\n\t\tthis.setVariable('sample_variable', 'Default Value')\n\t}", "title": "" }, { "docid": "2c79f043835362a3a71a609feb2a970a", "score": "0.51188815", "text": "_cloneWithResolutions(variableMap) {\n if (this.isVariable) {\n if (variableMap.has(this.variable)) {\n return new Type('Variable', variableMap.get(this.variable));\n } else {\n let newTypeVariable = __WEBPACK_IMPORTED_MODULE_3__type_variable_js__[\"a\" /* TypeVariable */].fromLiteral(this.variable.toLiteralIgnoringResolutions());\n if (this.variable.resolution)\n newTypeVariable.resolution = this.variable.resolution._cloneWithResolutions(variableMap);\n if (this.variable._canReadSubset)\n newTypeVariable.canReadSubset = this.variable.canReadSubset._cloneWithResolutions(variableMap);\n if (this.variable._canWriteSuperset)\n newTypeVariable.canWriteSuperset = this.variable.canWriteSuperset._cloneWithResolutions(variableMap);\n variableMap.set(this.variable, newTypeVariable);\n return new Type('Variable', newTypeVariable);\n }\n }\n if (this.data._cloneWithResolutions) {\n return new Type(this.tag, this.data._cloneWithResolutions(variableMap));\n }\n return Type.fromLiteral(this.toLiteral());\n }", "title": "" }, { "docid": "f680a99f3ccdc089ca40daec73e5a6e4", "score": "0.51048094", "text": "function VariableDeclaration(){ ListNode.apply(this,arguments) }", "title": "" }, { "docid": "c699a12e8ef4c4b8c41a1dff2e5fad6d", "score": "0.50951904", "text": "getBvar(id){\n if(this.bvars.hasOwnProperty(id))\n return this.bvars[id];\n return 0;\n }", "title": "" }, { "docid": "202da8c234ad4f702548ef63711c2d32", "score": "0.50783944", "text": "function put_variable(xn, ai) {\n\tthis.xn = xn;\n\tthis.ai = ai;\n\n\tthis.inspect = function(){\n\t\treturn \"put_variable \" + xn.inspect() + \" \" + ai.inspect();\n\t};\n\n\tthis.eval = function(ENV) {\n\t\t// throw \"Unimplemented Path: PUT_VARIABLE instruction.\";\n\t\tvar HEAP = ENV.HEAP();\n\t\tvar ref = new StoreRef(HEAP, HEAP.H());\n\t\tvar cell = new HeapCell(\"ref\", ref);\n\t\tHEAP.place(cell);\t\t\t\t\t\t\t// HEAP[H] <- <ref, H>\n\t\txn.set(cell);\t\t\t\t\t\t\t\t// Xn <- HEAP[H]\n\t\tai.set(cell);\t\t\t\t\t\t\t\t// Ai <- HEAP[H]\n\t\tHEAP.increment();\t\t\t\t\t\t\t// H <- H + 1\n\t};\n}", "title": "" }, { "docid": "d98dc20ae91608487206803cd9b1e218", "score": "0.50733006", "text": "initVariables(tag, object) {\n console.log('initVariables in variables');\n console.log(tag);\n console.log(object);\n var key = tag.replace('-counter','');\n if(!this.variables[key]){\n \n this.variables[key] = {}; \n this.variables[key].value = object.currentValue;\n this.variables[key].updateHud = tag;\n\n this.onInitVariables.dispatch(tag, object); // received in hud controller\n }\n }", "title": "" }, { "docid": "a1bf2c0770d4d9a5163ed39b320f3dc5", "score": "0.50677323", "text": "constructor(variables) {\n this.variables = variables;\n }", "title": "" }, { "docid": "fd917fbb6377b64d31d8585406ed821b", "score": "0.50582296", "text": "function FillVariableSelection () {\r\n\tvar ruleBlock = GetRuleAtNestLocation(curEntity.rules, curNestingPoint);\r\n\tvar variableType = GetVariableType(ruleBlock, curVariableSlot);\r\n\t// Global variables\r\n\tvar globalsBox = document.getElementById(\"select_variable_global_variables_box\");\r\n\twhile (globalsBox.firstChild) {\r\n\t\tglobalsBox.removeChild(globalsBox.lastChild);\r\n\t}\r\n\tvar globalVars = GetEntityGlobalVariablesOfType(curEntity, variableType);\r\n\tCreateEntityVariableElementsForSelection(globalsBox, globalVars);\r\n\t// Local variables\r\n\tvar localsBox = document.getElementById(\"select_variable_local_variables_box\");\r\n\twhile (localsBox.firstChild) {\r\n\t\tlocalsBox.removeChild(localsBox.lastChild);\r\n\t}\r\n\tvar localVars = GetEntityLocalVariablesOfType(curEntity, variableType);\r\n\tCreateEntityVariableElementsForSelection(localsBox, localVars);\r\n\r\n\t// Fill in text on page for information\r\n\tvar typeText = document.getElementById(\"variable_type_text\");\r\n\ttypeText.textContent = variableType;\r\n\r\n\t// Hide the variable construction boxes for other types of variables\r\n\tfor (var i = 0; i < variableTypes.length; i++) {\r\n\t\tvar variableTypeEntry = variableTypes[i];\r\n\t\tvar variableConstructionBox = document.querySelector(\"[data-id='variable_construction_\" + variableTypeEntry + \"']\");\r\n\t\tif (variableType === variableTypeEntry) {\r\n\t\t\t// Show this box\r\n\t\t\tvariableConstructionBox.classList.remove(\"hidden_choice_box\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Hide this box\r\n\t\t\tvariableConstructionBox.classList.add(\"hidden_choice_box\");\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "c1e504ab0a9ae39bfa6a30a6d06f00e6", "score": "0.50420624", "text": "updateVariableOverview(){\n document.getElementById('variableOverview').innerHTML = this.math.createVariableOverview(this.dictionary);\n }", "title": "" }, { "docid": "dad69a2e0957cdcaa25f54ab818a1c54", "score": "0.5031729", "text": "function CreateEntityVariableElementsForSelection (container, variables) {\r\n\tfor (var i = 0; i < variables.length; i++) {\r\n\t\tvar variable = variables[i];\r\n\t\tvar variableDiv = CreateNewDiv(container, \"selectable_variable\", undefined, undefined);\r\n\t\tvariableDiv.setAttribute(\"data-variable-id\", variable.id);\r\n\t\tvar varName = CreateNewDiv(variableDiv, \"variable_name\", variable.name, undefined);\r\n\t\t// Only show name, value is dynamic\r\n\t}\r\n}", "title": "" }, { "docid": "4aed06e22f69a472ffa80107fbea8af7", "score": "0.5028748", "text": "function get_com_var(){\n var com_var=[];\n var i, cs=components.length;\n if(cs!=0){\n for(i=0; i<cs; i++){\n com_var.push(components[i].data(\"variable\"));\n }\n return com_var;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "1305ded84bb75303eb980181135fa24a", "score": "0.5018499", "text": "function Variable(var_value, e_msg, min, max, is_even){\n\tthis.var_value = var_value;\n\tthis.e_msg = msg_obj.get_msg_node(e_msg);\n\tthis.min = min;\n\tthis.max = max;\n\tthis.is_even = is_even;\n}", "title": "" }, { "docid": "25864816c867e868bed51a92b7faae73", "score": "0.49911332", "text": "function UniqueVariableNames(context) {\n\t var knownVariableNames = Object.create(null);\n\t return {\n\t OperationDefinition: function OperationDefinition() {\n\t knownVariableNames = Object.create(null);\n\t },\n\t VariableDefinition: function VariableDefinition(node) {\n\t var variableName = node.variable.name.value;\n\t if (knownVariableNames[variableName]) {\n\t context.reportError(new _error.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n\t } else {\n\t knownVariableNames[variableName] = node.variable.name;\n\t }\n\t }\n\t };\n\t}", "title": "" }, { "docid": "819a0288dd5dc63431bdbf4f86df8402", "score": "0.49834466", "text": "function CreateEntityVariableElementsForMainList (container, variables) {\r\n\tfor (var i = 0; i < variables.length; i++) {\r\n\t\tvar variable = variables[i];\r\n\t\t// Only show global variables\r\n\t\t// Skip local variables - only accessible from their specific events\r\n\t\t// Skip literal variables - only available immediately when created\r\n\t\tif (!variable.local && !variable.literal && !variable.construction) {\r\n\t\t\tvar variableDiv = CreateNewDiv(container, \"variable\", undefined, undefined);\r\n\t\t\tvariableDiv.setAttribute(\"data-variable-id\", variable.id);\r\n\t\t\tvar varName = CreateNewDiv(variableDiv, \"variable_name\", \"Name: \" + variable.name, undefined);\r\n\t\t\tvar varType = CreateNewDiv(variableDiv, \"variable_type variable_\" + variable.type, \"Type: \" + variable.type, undefined);\r\n\t\t\tvar varValue = CreateNewDiv(variableDiv, \"variable_value\", \"Value: \" + GetReadableVariableString(variable.value, variable.type), undefined);\r\n\t\t\tvar varEdit = CreateNewDiv(variableDiv, \"variable_edit\", \"Edit\", undefined);\r\n\t\t\tvar varRemove = CreateNewDiv(variableDiv, \"variable_delete\", \"X\", undefined);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "9012974c34993cedc3e2c02215829927", "score": "0.4970813", "text": "function Ivar(){ Identifier.apply(this,arguments) }", "title": "" }, { "docid": "7be1a7daadc3c4edb60d832368bdd19a", "score": "0.49645033", "text": "function fetchVariables() {\n tags = store.get('tags');\n walls = store.get('walls');\n downloads = store.get('downloads');\n cache = store.get('cache');\n time = store.get('time');\n timer = store.get('timer');\n}", "title": "" }, { "docid": "d78be93979769cc725623e30de92a532", "score": "0.49644303", "text": "async fetchVariables() {\r\n const response = await fetch(\"https://src.cals.arizona.edu/api/v1/scrutinizer/variables\");\r\n const variables = await response.json();\r\n for (let i=0; i<variables.length; i++) {\r\n let desc = variables[i]['desc'] + ' (' + variables[i]['name'] + ')';\r\n this.variableDesc.push(desc);\r\n this.variableMap[desc] = variables[i];\r\n }\r\n }", "title": "" }, { "docid": "f8481915dc0e7b3337212e0918eafcaf", "score": "0.49575007", "text": "getVariables() {\n return {\n id: this.props.id\n };\n }", "title": "" }, { "docid": "ce62e3714d24fbabc04d03b60bd3c037", "score": "0.49499133", "text": "clone(variableMap) {\n let type = this.resolvedType();\n if (type.isVariable) {\n if (variableMap.has(type.variable)) {\n return new Type('Variable', variableMap.get(type.variable));\n } else {\n let newTypeVariable = __WEBPACK_IMPORTED_MODULE_3__type_variable_js__[\"a\" /* TypeVariable */].fromLiteral(type.variable.toLiteral());\n variableMap.set(type.variable, newTypeVariable);\n return new Type('Variable', newTypeVariable);\n }\n }\n if (type.data.clone) {\n return new Type(type.tag, type.data.clone(variableMap));\n }\n return Type.fromLiteral(type.toLiteral());\n }", "title": "" }, { "docid": "d0f955ac0a2784be72a8df9ca090b381", "score": "0.49422425", "text": "constructor() { \n \n VariableQueryParameterDto.initialize(this);\n }", "title": "" }, { "docid": "768b805868d4fffe928cc3c64eadac88", "score": "0.49422014", "text": "instantiate(options) {\r\n const addressSpace = this.addressSpace;\r\n // xx assert(!this.isAbstract, \"cannot instantiate abstract UAVariableType\");\r\n node_opcua_assert_1.assert(options, \"missing option object\");\r\n node_opcua_assert_1.assert(_.isString(options.browseName) || _.isObject(options.browseName), \"expecting a browse name\");\r\n node_opcua_assert_1.assert(!options.hasOwnProperty(\"propertyOf\"), \"Use addressSpace#addVariable({ propertyOf: xxx}); to add a property\");\r\n assertUnusedChildBrowseName(addressSpace, options);\r\n const baseVariableType = addressSpace.findVariableType(\"BaseVariableType\");\r\n node_opcua_assert_1.assert(baseVariableType, \"BaseVariableType must be defined in the address space\");\r\n let dataType = (options.dataType !== undefined) ? options.dataType : this.dataType;\r\n // may be required (i.e YArrayItemType )\r\n dataType = this.resolveNodeId(dataType); // DataType (NodeId)\r\n node_opcua_assert_1.assert(dataType instanceof node_opcua_nodeid_1.NodeId);\r\n const valueRank = (options.valueRank !== undefined) ? options.valueRank : this.valueRank;\r\n const arrayDimensions = (options.arrayDimensions !== undefined)\r\n ? options.arrayDimensions : this.arrayDimensions;\r\n // istanbul ignore next\r\n if (!dataType || dataType.isEmpty()) {\r\n console.warn(\" options.dataType\", options.dataType ? options.dataType.toString() : \"<null>\");\r\n console.warn(\" this.dataType\", this.dataType ? this.dataType.toString() : \"<null>\");\r\n throw new Error(\" A valid dataType must be specified\");\r\n }\r\n const opts = {\r\n arrayDimensions,\r\n browseName: options.browseName,\r\n componentOf: options.componentOf,\r\n dataType,\r\n description: options.description || this.description,\r\n eventSourceOf: options.eventSourceOf,\r\n minimumSamplingInterval: options.minimumSamplingInterval,\r\n modellingRule: options.modellingRule,\r\n nodeId: options.nodeId,\r\n notifierOf: options.notifierOf,\r\n organizedBy: options.organizedBy,\r\n typeDefinition: this.nodeId,\r\n value: options.value,\r\n valueRank\r\n };\r\n const namespace = addressSpace.getOwnNamespace();\r\n const instance = namespace.addVariable(opts);\r\n // xx assert(instance.minimumSamplingInterval === options.minimumSamplingInterval);\r\n initialize_properties_and_components(instance, baseVariableType, this, options.optionals);\r\n // if VariableType is a type of Structure DataType\r\n // we need to instantiate a dataValue\r\n // and create a bidirectional binding with the individual properties of this type\r\n instance.bindExtensionObject(options.extensionObject);\r\n node_opcua_assert_1.assert(instance.typeDefinition.toString() === this.nodeId.toString());\r\n instance.install_extra_properties();\r\n if (this._postInstantiateFunc) {\r\n this._postInstantiateFunc(instance, this);\r\n }\r\n return instance;\r\n }", "title": "" }, { "docid": "efe55de1376430f37e936faad0bc7fc9", "score": "0.4935899", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n if (knownVariableNames[variableName]) {\n context.reportError(new _error.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "efe55de1376430f37e936faad0bc7fc9", "score": "0.4935899", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n if (knownVariableNames[variableName]) {\n context.reportError(new _error.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "efe55de1376430f37e936faad0bc7fc9", "score": "0.4935899", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n if (knownVariableNames[variableName]) {\n context.reportError(new _error.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "6fcb878ac1cc15669b4b58fea9c99308", "score": "0.49210784", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _GraphQLError.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "6fcb878ac1cc15669b4b58fea9c99308", "score": "0.49210784", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _GraphQLError.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "6fcb878ac1cc15669b4b58fea9c99308", "score": "0.49210784", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _GraphQLError.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "6fcb878ac1cc15669b4b58fea9c99308", "score": "0.49210784", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _GraphQLError.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "6fcb878ac1cc15669b4b58fea9c99308", "score": "0.49210784", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _GraphQLError.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "fbf76555b7edce1035484ccfc436b18f", "score": "0.491909", "text": "function findAllVariables() {\r\n\tfindInputs();\r\n\tfindReturns();\r\n\tfindVars();\r\n}", "title": "" }, { "docid": "21f769e7087403d4db3a456d8a0083fe", "score": "0.49162883", "text": "function createVariable() {\n var id = nextVariableId++;\n var name = '$V';\n\n do {\n name += variableTokens[id % variableTokensLength];\n id = ~~(id / variableTokensLength);\n } while (id !== 0);\n\n return name;\n }", "title": "" }, { "docid": "dc25f600e28fda963ecc38457478f234", "score": "0.4913413", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "dc25f600e28fda963ecc38457478f234", "score": "0.4913413", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "c42f14948db1eebc5d314446ba0a252d", "score": "0.48675585", "text": "importVariables(variableMap) {\n let picture = this;\n _.pairs(variableMap).forEach(([key, value]) => {\n // First see if we already have a variable with this rows name\n let variable = picture.variables.find(v => v.name === key);\n\n if (_.isEmpty(value.slice(1).join(''))) {\n value = value[0];\n }\n let jsonVal = JSON.stringify(value);\n\n if (variable) {\n // Modify the existing variable with this definition\n variable = variable.cloneWithDefinition(new Expression(jsonVal));\n picture = picture.updateVariable(variable);\n } else {\n // Create a new variable\n variable = picture.generateNewVariable({\n name: key,\n isRow: _.isArray(value),\n definition: jsonVal\n });\n picture = picture.addVariable(variable);\n }\n });\n return picture;\n }", "title": "" }, { "docid": "5cd4286eb63a46947126ac9dd428a05c", "score": "0.48657742", "text": "function logger(variableObject) {\n const variableName = Object.keys(variableObject)[0]\n console.log(\n `${variableName}:`,\n JSON.stringify(variableObject[variableName], null, 2)\n )\n}", "title": "" }, { "docid": "78cb4672eb07b9c974bfd30f9fa490ea", "score": "0.48619103", "text": "function addVariable(server, parent, browseName){\n\tconsole.log(\"add Variable: \"+browseName);\n\tvar counter = 1;\n\n\t// emulate variable1 changing every 500 ms\n\tsetInterval(function(){ counter+=1; }, 500);\n\n\tserver.nodeVariable1 = server.engine.addVariableInFolder(parent,{\n\t browseName: browseName,\n\t dataType: \"Double\",\n\t value: {\n\t \t/**\n\t * returns the current value as a Variant\n\t * @method get\n\t * @return {Variant}\n\t */\n\t get: function () {\n\t return new opcua.Variant({dataType: opcua.DataType.Double, value: counter });\n\t }\n\t }\n\t});\n}", "title": "" }, { "docid": "b49498c7a39a214916c273039be0b225", "score": "0.48616725", "text": "function getOperationVariables(operation, variables) {\n var operationVariables = {};\n operation.argumentDefinitions.forEach(function (def) {\n var value = def.defaultValue;\n if (variables[def.name] != null) {\n value = variables[def.name];\n }\n operationVariables[def.name] = value;\n if (process.env.NODE_ENV !== 'production') {\n __webpack_require__(3)(value != null || def.type[def.type.length - 1] !== '!', 'RelayConcreteVariables: Expected a value for non-nullable variable ' + '`$%s: %s` on operation `%s`, got `%s`. Make sure you supply a ' + 'value for all non-nullable arguments.', def.name, def.type, operation.name, JSON.stringify(value));\n }\n });\n return operationVariables;\n}", "title": "" }, { "docid": "e14540c7f3786b30d39995ea2bacba5d", "score": "0.48531875", "text": "assignVariableIds(variableMap) {\n if (this.isVariableReference) {\n let name = this.data;\n let sharedVariable = variableMap.get(name);\n if (sharedVariable == undefined) {\n let id = nextVariableId++;\n sharedVariable = new __WEBPACK_IMPORTED_MODULE_3__type_variable_js__[\"a\" /* default */](name, id);\n variableMap.set(name, sharedVariable);\n }\n return Type.newVariable(sharedVariable);\n }\n\n if (this.isSetView) {\n return this.primitiveType().assignVariableIds(variableMap).setViewOf();\n }\n\n if (this.isInterface) {\n let shape = this.interfaceShape.clone();\n shape._typeVars.map(({object, field}) => object[field] = object[field].assignVariableIds(variableMap));\n return Type.newInterface(shape);\n }\n\n return this;\n }", "title": "" }, { "docid": "86b8ca47fadd9fc2ed342a7d46619fcc", "score": "0.48506644", "text": "function getOperationVariables(operation, variables) {\n var operationVariables = {};\n operation.argumentDefinitions.forEach(function (def) {\n var value = def.defaultValue;\n if (variables[def.name] != null) {\n value = variables[def.name];\n }\n operationVariables[def.name] = value;\n if (true) {\n __webpack_require__(7)(value != null || def.type[def.type.length - 1] !== '!', 'RelayConcreteVariables: Expected a value for non-nullable variable ' + '`$%s: %s` on operation `%s`, got `%s`. Make sure you supply a ' + 'value for all non-nullable arguments.', def.name, def.type, operation.name, JSON.stringify(value));\n }\n });\n return operationVariables;\n}", "title": "" }, { "docid": "2eb4340262899f16e43c4e87c28d8e11", "score": "0.4832353", "text": "function IsaInfoVariables()\r\n{\r\n this.lS_OK = 0; //default \"all ok\" return value\r\n this.iCacheMode = 4\r\n this.iFWMode = 59\r\n this.iIntegMode = 63\r\n this.lHKLM = 0x80000002;\r\n this.iArray = 2; //Ent Ed. in Array mode\r\n this.iMaxArgs = 8;\r\n this.iTier = 1; //scanning depth -default is 1\r\n this.fDebugMode = false; //determines logging level\r\n this.fPathSet = false; //parser check for save path option\r\n this.fTier = false; //parser check for scanning depth\r\n this.fIsa2k = false; //ISA 2000 == true\r\n this.fSA = false; //true if Isa2KEE in Standalone Mode\r\n this.fEE = false; //true if EntEd\r\n this.fEntMode = false; //true if scanning the entire Enterprise\r\n this.fAdminOnly = false; //true if admin host\r\n this.fLocal_RRAS = false; //RRAS running state for local server\r\n this.fIsW2K3 = false; //used for netstat variation\r\n this.fIsIIS = false; //used to scan IIS bindings\r\n this.fIsDns = false; //used to scan DNS bindings\r\n this.fSaveXml = false; //bool to trigger XML saves\r\n this.fMPSReports = false; //MPSReports compatibility flag\r\n this.fOneServer = false; //scan only this server\r\n this.fOneArray = true; //scan only the current array\r\n this.fServerOnly = false; //scan only this server; no export\r\n this.fQuiet = false; //no msgboxes\r\n this.szComSpec = \"\";\r\n this.szSysFolder = \"\"; //path to local system folder\r\n this.szISAInfoPath = \"\"; //path for all ISAInfo files\r\n this.szXmlFile = \"\"; //filename for the output XML\r\n this.szTempFilePath = \"\"; //path for the temp files\r\n this.szThisServer = \"\"; //placeholder for this computer name\r\n this.szThisArray = \"\"; //placeholder for this array\r\n this.szIsaServer = \"\"; //placeholder for the selected ISA server\r\n this.szIsaArray = \"\"; //placeholder for the selected ISA Array\r\n this.szConfServer = \"\"; //config strg server for 2k4ee\r\n this.szThisUser = \"\"; //placeholder for interactive acct name\r\n this.szCssName = \"\" //Configuration Storage Server\r\n this.szCssUser = \"\" //CSS user name\r\n this.szCssDomain = \"\" //CSS user domain\r\n this.szCssPass = \"\" //CSS User Password\r\n this.szErrNotFound = \"80070002\"; //E_NOT_FOUND\r\n this.szErrNotSupported = \"800A01B6\"; //method/property not supported\r\n this.szErrExists = \"800700B7\"; //item already exists\r\n this.szUAlpha = \"\\\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\\\"\";\r\n this.szLAlpha = \"\\\"abcdefghijklmnopqrstuvwxyz\\\"\";\r\n this.szIsaRegRoot = \"HKLM\\\\SOFTWARE\\\\Microsoft\\\\Fpc\\\\\";\r\n this.szIsaEdition = this.szIsaRegRoot + \"Edition\";\r\n this.szAcmeComp = this.szIsaRegRoot + \"AcmeComonents\";\r\n this.szArrayGuid = this.szIsaRegRoot + \"CurrentArrayGuid\";\r\n this.szSEGuid = \"{5933b383-0f51-46de-a54c-e9838062ecaf}\";\r\n this.szEEGuid = \"{563f7924-6ac8-4ae6-bbfb-189dca3dd594}\";\r\n this.szValidArgs = new Array( \"arr\", \"svr\" );\r\n this.vFilter = /\\%s/i; //\"%s\" is the insertion trigger for Fprintf\r\n}", "title": "" }, { "docid": "44d303a97633284d2acedf6c9686eec0", "score": "0.48252025", "text": "_getStateObj () {\n return {\n selectedBot: InsightsStore.getSelectedBot(),\n botStatus: InsightsStore.getStatus(),\n insights: InsightsStore.getInsights()\n }\n }", "title": "" }, { "docid": "38e7fce2e84748cf86751fa39df1372d", "score": "0.4824917", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = _Object$create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = _Object$create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n if (knownVariableNames[variableName]) {\n context.reportError(new _error.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "db46f99feb95658a191af17ba91d3435", "score": "0.48237002", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n if (knownVariableNames[variableName]) {\n context.reportError(new __WEBPACK_IMPORTED_MODULE_0__error__[\"a\" /* GraphQLError */](duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "32876ed5106c412f2c7b48fefe4671f5", "score": "0.4823554", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new _error__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "fe6bab8aec857d6c6d385ecd8ea2a8a3", "score": "0.48170984", "text": "constructor(message) {\n const msg = message.split(DELIMITER);\n this.variable = msg[0] + ASSIGN_SYMBOL + msg[1] + ASSIGN_SYMBOL + msg[2] + DELIMITER;\n this.variableName = msg[0];\n this.variableValue = msg[1];\n this.variableAddress = msg[2];\n this.scopeType = msg[3].split(ASSIGN_SYMBOL)[1];\n this.definingClassId = msg[4].split(ASSIGN_SYMBOL)[1];\n this.definingInstanceId = msg[5].split(ASSIGN_SYMBOL)[1];\n }", "title": "" }, { "docid": "b2abcaf373378cc84e591ec4fab94033", "score": "0.48166734", "text": "function getSurveyVariables(surveyID, variableMode) {\r\n var url = getBaseURL() + \"Surveys/Current/\" + surveyID + \"/\" + variableMode + \"/Variables\";//M0014\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "a9ee5f7bb5108bd88ee4bb7583754516", "score": "0.48140043", "text": "function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n if (knownVariableNames[variableName]) {\n context.reportError(new _error__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}", "title": "" }, { "docid": "66a03beb36a28b89f94a590025e20f38", "score": "0.4811574", "text": "function GetDataObject() {\n var dataObj = gateData || {};\n var scope = angular.element(document.querySelector('#gateControllerPanel')).scope();\n dataObj.name = scope.name;\n dataObj.desc = scope.desc;\n dataObj.gateType = scope.type.value;\n \n return dataObj;\n}", "title": "" }, { "docid": "75f32620553dde8cc91995a7cfe9ca15", "score": "0.4804452", "text": "getVariables() {\n return {\n bookId: this.props.bookId\n };\n }", "title": "" }, { "docid": "1c1e52f426d2d60c90cd3230bb26590b", "score": "0.4800695", "text": "function parseVariable(lexer) {\n\t var start = lexer.token;\n\t expect(lexer, _lexer.TokenKind.DOLLAR);\n\t return {\n\t kind: _kinds.VARIABLE,\n\t name: parseName(lexer),\n\t loc: loc(lexer, start)\n\t };\n\t}", "title": "" }, { "docid": "aaa5fae0d3b584e83ae97490117fa136", "score": "0.47913557", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expectToken(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "aaa5fae0d3b584e83ae97490117fa136", "score": "0.47913557", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expectToken(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "aaa5fae0d3b584e83ae97490117fa136", "score": "0.47913557", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expectToken(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "aaa5fae0d3b584e83ae97490117fa136", "score": "0.47913557", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expectToken(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "aaa5fae0d3b584e83ae97490117fa136", "score": "0.47913557", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expectToken(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "68fcec6d1ebb5474da2ff0b0091d08b6", "score": "0.47864646", "text": "setBvar(id, val){\n this.bvars[id] = val;\n }", "title": "" }, { "docid": "d5250f9ff6992116da88ee374dcda910", "score": "0.47788823", "text": "function isVariable(term) {\n return !!term && term.termType === 'Variable';\n}", "title": "" }, { "docid": "1d9df7cf8e44f3faca09cf6e4eacb573", "score": "0.47581977", "text": "function getVariableDetHTML(name){\n// console.log(ARCADE_ELEMENTS[\"Variables\"]);\n// console.log(ARCADE_ELEMENTS);\n let variable;\n if (nameSpace == \"arcade\") \n variable = ARCADE_ELEMENTS[\"Variables\"].filter(obj => { return obj.name == name})[0];\n else \n variable = CURRENT_ELEMENTS[\"Variables\"].filter(obj => { return obj.name == name})[0];\n console.log(CURRENT_ELEMENTS[\"Variables\"][0].name)\n console.log(name)\n console.log(variable)\n let HTML = `\n <h2 class=\"title\">` + name + `\n <ul class=\"detail\">\n <li class=\"edit\">Type: ` + variable.type + ` <i class=\"fas fa-edit\"></i></li>\n <li class=\"edit\">Value: ` + variable.value + ` <i class=\"fas fa-edit\"></i></li> \n </ul>\n </h2>\n`\n return HTML;\n}", "title": "" }, { "docid": "74240da2f4a9b19f5f5ba2f03e0f8351", "score": "0.47579578", "text": "function VariableDialogMorph(target, action, environment) {\n this.init(target, action, environment);\n}", "title": "" }, { "docid": "30d3aa9dfe7f13d053beaef5b1123234", "score": "0.47570446", "text": "function listVariables() {\n gdb.listVariables(['--skip-unavailable', '--simple-values'], onSimpleValues);\n\n function onSimpleValues(data) {\n if (!(data.result && data.result.variables)) return;\n \n data.result.variables.forEach(processSimpleVariable);\n gdb.listVariables(['--skip-unavailable', '--all-values'], onAllValues);\n }\n\n function onAllValues(data) {\n if (!(data.result && data.result.variables)) return;\n \n data.result.variables.forEach(processAllVariable);\n sendVariables();\n }\n\n var variablesData = {};\n\n function processSimpleVariable(variable) {\n variablesData[variable.name] = { type: variable.type };\n }\n\n function processAllVariable(variable) {\n variablesData[variable.name].value = variable.value;\n }\n\n function sendVariables() {\n var variables = [];\n for (var variable in variablesData) {\n variables.push({\n name: variable,\n type: variablesData[variable].type,\n value: variablesData[variable].value\n });\n }\n socket.emit('gdb-list-variables', variables);\n }\n }", "title": "" }, { "docid": "a8758c2715873fc87d2c93142d4c3b9d", "score": "0.47559103", "text": "function createVariable(definition) {\n var index = varIndex++;\n setVariable('VARL' + index, definition, {scope: 'global'})\n\n return { compile: function() { return '#VARL' + index; } };\n}", "title": "" }, { "docid": "1b1f2faa32148421fe0233cc5241c585", "score": "0.47460604", "text": "async compileVarDec () {\n this.pushScope('compile var dec')\n await this.pause()\n if (!this.lookAhead(KEYWORDS.VAR)) {\n this.popScope()\n return Promise.resolve()\n }\n this.assert({ [TOKEN_TYPE.KEYWORD]: KEYWORDS.VAR })\n await this.compileType()\n const type = this.tokenizer.tokenValue()\n while (true) {\n this.assert({ [TOKEN_TYPE.IDENTIFIER]: null })\n const name = this.tokenizer.tokenValue()\n this.symbolTable.define(name, type, KIND_TYPE.VAR)\n\n this.tokenizer.advance()\n if (this.tokenizer.tokenValue() !== ',') {\n this.tokenizer.back()\n break\n }\n }\n this.assert({ [TOKEN_TYPE.SYMBOL]: ';' })\n this.popScope()\n await this.compileVarDec()\n }", "title": "" }, { "docid": "1b410ad14ff3f5a7a76ba9bed6f8aff9", "score": "0.47453278", "text": "getInfo(key) {\n const location = this.getLocation(key);\n return {\n key,\n location,\n value: this.getPropertyValue(key),\n path: this.getPath(key),\n isLocal: () => location === \"Local\" /* LOCAL */,\n isGlobal: () => location === \"Global\" /* GLOBAL */,\n isEnvVar: () => location === \"Environment\" /* ENVIRONMENT */,\n };\n }", "title": "" }, { "docid": "a3bf1d43a9570333122c2fadf4723f39", "score": "0.47420743", "text": "function getOperationVariables(operation, variables) {\n var operationVariables = {};\n operation.argumentDefinitions.forEach(function (def) {\n var value = def.defaultValue;\n if (variables[def.name] != null) {\n value = variables[def.name];\n }\n operationVariables[def.name] = value;\n });\n return operationVariables;\n}", "title": "" }, { "docid": "c271bf21b8260e32f8b5598c7ae49505", "score": "0.4740439", "text": "get object() {\n const commitment = { ...this._commitment.object, variables: this._variables };\n return {\n ...(this._id !== undefined && { _id: this._id }),\n constants: this._constants,\n commitments: [commitment],\n };\n }", "title": "" }, { "docid": "98650d68cc9bc1f0a0aca0bee0cbb3ad", "score": "0.47288862", "text": "function getOperationVariables(operation, variables) {\n var operationVariables = {};\n operation.argumentDefinitions.forEach(function (def) {\n var value = def.defaultValue; // $FlowFixMe[cannot-write]\n\n if (variables[def.name] != null) {\n value = variables[def.name];\n }\n\n operationVariables[def.name] = value;\n });\n return operationVariables;\n}", "title": "" }, { "docid": "216cfe7497e280a1135fd8f3ad1bb14b", "score": "0.47232202", "text": "function getOperationVariables(operation, variables) {\n var operationVariables = {};\n operation.argumentDefinitions.forEach(function (def) {\n var value = def.defaultValue;\n\n if (variables[def.name] != null) {\n value = variables[def.name];\n }\n\n operationVariables[def.name] = value;\n });\n return operationVariables;\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "824c2d20049dda9d820194289b299ead", "score": "0.4713254", "text": "function parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "56b561888afe3cede95eebf970eb269b", "score": "0.47063717", "text": "function getDashboardVariables () {\n var i = 0;\n var dashboardNameValuesPairs = '{'; // { \n dashboardNameValuesPairs += '\"Dashboard_Variables\":\"These Variables are used to set the snapshots.\",'; // just the header for the json object\n for (var property in dashboard) { // for each attrubute of the variable dashboard, put it into the final string\n if (property.substring(0,7) == \"format_\" && dashboard[property]) { \n //if (i < dashboard.size ) { \n dashboardNameValuesPairs += '\"'+property.substring(7,property.length)+'\"'+':\"'+dashboard[property].replace(/['\"]/g,'') +'\",';\n // }\n //else { \n // dashboardNameValuesPairs += property.substring(7,property.length)+\":'\"+dashboard[property].replace(/['\"]/g,'') +\"'\";\n //}\n }\n else\n { \n }\n i++;\n }\n // the .size method is a custom method of the Object Class--and requires the instanstation from the previous script section\n dashboardNameValuesPairs += '\"length\":\"'+Object.size(dashboard) +'\"'; // ,name:'value' , put all the extra attrubutes of the json object here, in the form of name:'value'\n dashboardNameValuesPairs += '}'; // }\n return dashboardNameValuesPairs;\n}", "title": "" }, { "docid": "193443ef2f8424fab6115b747e86702b", "score": "0.47038147", "text": "loadOwnProperties(){\r\n\t\tvar self=this;\r\n\t\tself.varName=self.getAttrVal(\"getvar\");\r\n\t}", "title": "" } ]
eea155c3a1be5134480d065adc03fca5
Stops a sequence execution and resets its contents. LEDs linked to this sequence are not automatically updated anymore.
[ { "docid": "44cca10c4bf3023f101949f4ea8fcc0f", "score": "0.53425246", "text": "resetBlinkSeq(seqIndex)\n {\n this.liveFunc.resetBlinkSeq(seqIndex);\n return YAPI_SUCCESS;\n }", "title": "" } ]
[ { "docid": "3c0d041f311605201b49035b20a24a6a", "score": "0.6619432", "text": "stopSequence()\n {\n this.liveFunc.stopSequence();\n return YAPI_SUCCESS;\n }", "title": "" }, { "docid": "dfe933731e718dd5f8ecf8c9c7391819", "score": "0.62274224", "text": "function YColorLedCluster_stopBlinkSeq(seqIndex)\n {\n return this.sendCommand(\"XS\"+String(Math.round(seqIndex)));\n }", "title": "" }, { "docid": "767034576eba6808fc86be7d0236ac18", "score": "0.62162346", "text": "stop() {\n this.currentIteration = 0;\n this.isRunning = false;\n }", "title": "" }, { "docid": "b332e383874a10c3aadfea340a35c9bf", "score": "0.6197047", "text": "function stopSequence() {\n _Playing = false;\n}", "title": "" }, { "docid": "a997faafa45cdf1efcce06f094faf509", "score": "0.613734", "text": "stopBlinkSeq(seqIndex)\n {\n this.liveFunc.stopBlinkSeq(seqIndex);\n return YAPI_SUCCESS;\n }", "title": "" }, { "docid": "585bc6c8f2811014767a4cedfadad1b6", "score": "0.608899", "text": "stop()\n\t{\n\t\tthis._status = PsychoJS.Status.STOPPED;\n\t}", "title": "" }, { "docid": "d809d35ce85cd0ff3b497484e28290ec", "score": "0.6051636", "text": "function stopSequences(sequences)\r\n{\r\n //trace();\r\n if (null == sequences)\r\n {\r\n trace(\"no sequences provided\");\r\n return;\r\n }\r\n for (var i in sequences) \r\n {\r\n var seq = sequences[i];\r\n if ( 'string' != (typeof seq.seqname) )\r\n {\r\n trace('undefined seqname in ' + traceToString(seq));\r\n return;\r\n }\r\n\r\n trace(\"Stopping sequence \" + seq.seqname);\r\n Actions.StopExecutionGroup( seq.seqname, Execute.OnStopInternal );\r\n }\r\n}", "title": "" }, { "docid": "726f42507c72aec6d78b07ce70f35cdb", "score": "0.5910587", "text": "function stop() {\n running = false;\n }", "title": "" }, { "docid": "af78818d54345151bb24921836d813c7", "score": "0.58545566", "text": "stop()\n {\n this.is_running = false;\n }", "title": "" }, { "docid": "59135958792cba4c9d956493d0e12489", "score": "0.583934", "text": "async stop() {\n // FIXME: There's technically a problem here if the loop is\n // stopped and immedatiately started again. Two loops would\n // be created in this case.\n this._active = false;\n }", "title": "" }, { "docid": "de9253aa28bfd07b1378cda194e81761", "score": "0.5804204", "text": "function stopSimulation() {\n DroneSimulator.stop();\n allowKeyEvents = currentKeyEventsConfig;\n setIsExecuting(false);\n }", "title": "" }, { "docid": "5fb78c4544ac1f5bcf18dcc52f0fd42a", "score": "0.5796768", "text": "function stop(callback) {\n\t\n\tvar stopWrite = 'R' + String.fromCharCode(0) + '~';\n\tport430.write('T~', function(err) {\n\t\tportLeft.write(stopWrite, function(err) {\n\t\t\tportRight.write(stopWrite, function(err) {\n\t\t\t\tconsole.log('All reset');\n\t\t\t\tcallback();\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "da3ecac1ecce637191488ef4adef35d4", "score": "0.574806", "text": "stop()\n {\n this.flush();\n this.vao.unbind();\n }", "title": "" }, { "docid": "edc441aa063321a836cf19d2ece0d328", "score": "0.5720761", "text": "stop() {\n this.running = false;\n this.clearDependencies();\n }", "title": "" }, { "docid": "0a4d0f76aa58bf3cd119c7c02c445b75", "score": "0.5700254", "text": "stop() {\n this.started = false;\n this.reset();\n if (this.autodestroy) {\n this._destroy();\n }\n }", "title": "" }, { "docid": "40d85855ac2311c7f490526f018922ec", "score": "0.56684935", "text": "function stop() {\n exec(null, null, \"Accelerometer\", \"stop\", []);\n accel = null;\n running = false;\n}", "title": "" }, { "docid": "cd34b08b3b6d1999c3d554f06afbb156", "score": "0.5659698", "text": "function stopRunning() {\r\n\tCommandProcessor.stop();\r\n\t\r\n\tvar stepButton = document.getElementById(\"step\");\r\n\tvar runButton = document.getElementById(\"run\");\r\n\tvar runAllButton = document.getElementById(\"runAll\");\r\n\tvar stopButton = document.getElementById(\"stop\");\r\n\t\r\n\tvar openButton = document.getElementById(\"open\");\r\n\tvar saveButton = document.getElementById(\"save\");\r\n\tvar recordButton = document.getElementById(\"record\");\r\n\t\r\n\tstepButton.disabled = false;\r\n\trunButton.disabled = false;\r\n\trunAllButton.disabled = false;\r\n\tstopButton.disabled = true;\r\n\t\r\n\topenButton.disabled = false;\r\n\tsaveButton.disabled = false;\r\n\trecordButton.disabled = false;\r\n}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.5653503", "text": "stop() {}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.5653503", "text": "stop() {}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.5653503", "text": "stop() {}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.5653503", "text": "stop() {}", "title": "" }, { "docid": "2360518ff568779f40358c424de41cad", "score": "0.5641603", "text": "function stopExecution() {\n props.showModifyToolSection(false);\n changePreviewPicture(null);\n setTypeName('');\n }", "title": "" }, { "docid": "dd028db205d158ec37e7f685095ab9b9", "score": "0.5601109", "text": "stop()\n {\n if (this.started)\n {\n this.started = false;\n this._cancelIfNeeded();\n }\n }", "title": "" }, { "docid": "53701638d2d9afde822accb7fa704455", "score": "0.5597934", "text": "stop() {\n this.started = false;\n }", "title": "" }, { "docid": "35b871cd73c7b76eed43b10a7c43f2a7", "score": "0.558964", "text": "function stop() {\n asset.animations.play('stop');\n setState(_stop);\n }", "title": "" }, { "docid": "e6ad1c5fa22e87ef8ab7c77f7f743070", "score": "0.55854416", "text": "function stopSimulation() {\n noLoop();\n}", "title": "" }, { "docid": "e2ad8f019f5be1ef1faf181d4d0097d1", "score": "0.5580987", "text": "function stop() {\n\t\treset();\n\t\tsprite.animate.gotoFrame(sprite.animate.currentFrame);\n\t}", "title": "" }, { "docid": "2ae5d02e18a18c11df13051d2a3dbe0f", "score": "0.557748", "text": "stop() {\n this.mute();\n this.oscillators.clear();\n }", "title": "" }, { "docid": "a81e9a0548810ba800077a93afa59e8b", "score": "0.5568119", "text": "function stop() {\n exec(null, null, \"Accelerometer\", \"stop\", []);\n running = false;\n}", "title": "" }, { "docid": "0bba91bafd8ffd67429c7c003cd83e06", "score": "0.55678385", "text": "function stopMotor() {\n if (useDummys) {\n console.log(\"stop motor dummy\");\n return;\n }\n require('child_process').execSync('python \"scripts/reset.py\"', ['-i']); \n if (child !== undefined) {\n //console.log('child ' + `child ${child}`);\n child.kill();\n isMotorRunning = false;\n resetData();\n }\n}", "title": "" }, { "docid": "91a730eae0fd076a041658cb8bc25876", "score": "0.55674505", "text": "stop() {\n this.finishAll();\n }", "title": "" }, { "docid": "17c00d6e1d535588e7463b45f1200a71", "score": "0.55449206", "text": "stop (){\n this._each((src)=> src.stop())\n }", "title": "" }, { "docid": "9e3c909df590d3dfa8826fc7076263bf", "score": "0.5540357", "text": "function YColorLedCluster_resetBlinkSeq(seqIndex)\n {\n return this.sendCommand(\"ZS\"+String(Math.round(seqIndex)));\n }", "title": "" }, { "docid": "c70e0087d4b508f6d08bde6521306be2", "score": "0.5536083", "text": "stop() {\n\t\tif (this.state == SystemState.RUNNING) {\n\t\t\tthis.state = SystemState.STOPPED;\n\t\t}\n\t}", "title": "" }, { "docid": "0faac8a5b697d6e48d419980461ac1fd", "score": "0.5499564", "text": "stop() {\n this.finishAll();\n }", "title": "" }, { "docid": "b5b3a5dcbb8d36daabcc37b6e22bab2c", "score": "0.54983026", "text": "function stopAndReset()\n\t{\n\t\tif( _needsResetting ) \tresetMaterial();\n\t\t_needsResetting\t\t\t= false;\n\t\t_animate \t\t\t\t= false;\n\t\t_self.mesh.rotation \t= modulatedVect( _targetsVect ); // modulates the rotation so its within 360 ( 2 * Math.PI )\n\t}", "title": "" }, { "docid": "ed693a2137289a4e42efab4159edb32b", "score": "0.5487689", "text": "function stop() {\n internal.stop.apply(null, utils.toArray(arguments));\n}", "title": "" }, { "docid": "7f1fbc2b8fc9090eb2e93d07c7e6ba7f", "score": "0.5481155", "text": "function stop() {\n if (this._moveTimeoutId != null) {\n clearTimeout(this._moveTimeoutId);\n this._moveTimeoutId = null;\n }\n if (this._usePWM) {\n wpi.pwmWrite(this._stepPin, 0);\n }\n}", "title": "" }, { "docid": "3d4d2e1caa19d981918e73c1c7b541be", "score": "0.547342", "text": "stop() {\n this._isRunning = false;\n }", "title": "" }, { "docid": "0d2b35e3e0749c961b52c686ed874c8f", "score": "0.5463285", "text": "function simStop() {\n\tclearInterval(intRef);\n\tplaybtn.onclick = simPlay;\n\tplaybtn.innerHTML = \"Play\";\n\tstepbtn.disabled = false;\n\tnextfaultbtn.disabled = false;\n}", "title": "" }, { "docid": "a6c1f87aa925189de7d47ba9fcfc62dd", "score": "0.54594517", "text": "stop() {\n if (!this.isRunning_) {\n return;\n }\n\n this.isRunning_ = false;\n this.clear_();\n }", "title": "" }, { "docid": "e193bc188a3f5b64f47355601ab98d53", "score": "0.54578435", "text": "function stop() {\r\n send( 'stop' )\r\n}", "title": "" }, { "docid": "f41ea0bde2f190fe8e134f83f548ec5e", "score": "0.54567444", "text": "stop() {\n this.flush();\n }", "title": "" }, { "docid": "0445b04da13a9198b5bdd57eddf9003a", "score": "0.54520667", "text": "stop() {\n clearTimeout(this._stepTS)\n this._stepTS = undefined\n }", "title": "" }, { "docid": "0b58ac2790343ad022175d17c7735196", "score": "0.5428777", "text": "stop () {\n this.running = false\n }", "title": "" }, { "docid": "752b8876a1daa1fcb24251f166f7dc9c", "score": "0.5401475", "text": "stopAll() {\n\t\tfor (var i = 0; i < this.actions.length; i++) {\n\t\t\tthis.actions[i].stop();\n\t\t};\n\t\tthis.running = false;\n\t}", "title": "" }, { "docid": "ed6b077a48fffadf00b2bfc70493d711", "score": "0.53924775", "text": "function stop() {\n // TODO(mccreavy): stop the cycle interval\n\n if ('STOP' in this.hook) {\n for (var i = 0 ; i < this.hook['STOP'].length ; i++) {\n try {\n this.hook['STOP'][i]();\n } catch (e) {\n console.log(\"STOPHOOK EXCEPTION \" + e);\n }\n }\n }\n }", "title": "" }, { "docid": "3bdd15c39162a1c21b829690ab4b8c01", "score": "0.5389606", "text": "stop() {\n this.complete = true;\n }", "title": "" }, { "docid": "a8d9cce3a4dc3ec71ce4d6fb9bac4ef6", "score": "0.5386125", "text": "function _resetSequenceTimer() {\r\n\t clearTimeout(_resetTimer);\r\n\t _resetTimer = setTimeout(_resetSequences, 1000);\r\n\t }", "title": "" }, { "docid": "3cb0509371ddf1e11b5488cef1beadfe", "score": "0.53640807", "text": "reset() {\n\t\tthis.motor.lieDown();\n\t\tthis.motor.lookStraight();\n\t\tthis.light.stopBlinking();\n\t}", "title": "" }, { "docid": "1bbcbeb4f40bf66378d22e561b213725", "score": "0.5353728", "text": "stop() {\n this.running = false;\n this.started = false;\n cancelAnimationFrame(this.frameId);\n }", "title": "" }, { "docid": "7ea561c09455cb11bf6099903c656978", "score": "0.53452", "text": "stop() {\n this.isRunning = false;\n }", "title": "" }, { "docid": "ec6f245c9fac349a8cef7a274d893428", "score": "0.5343818", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "032bfeef40c6e9636b4ddef6d16eaae0", "score": "0.53418654", "text": "async stop() {\n this.ar() && await this.close(0 /* Initial */);\n }", "title": "" }, { "docid": "032bfeef40c6e9636b4ddef6d16eaae0", "score": "0.53418654", "text": "async stop() {\n this.ar() && await this.close(0 /* Initial */);\n }", "title": "" }, { "docid": "8de91202bcbe006898ba3d3646273b26", "score": "0.5339354", "text": "function stop(id) {\r\n id(false);\r\n}", "title": "" }, { "docid": "8de91202bcbe006898ba3d3646273b26", "score": "0.5339354", "text": "function stop(id) {\r\n id(false);\r\n}", "title": "" }, { "docid": "8de91202bcbe006898ba3d3646273b26", "score": "0.5339354", "text": "function stop(id) {\r\n id(false);\r\n}", "title": "" }, { "docid": "8de91202bcbe006898ba3d3646273b26", "score": "0.5339354", "text": "function stop(id) {\r\n id(false);\r\n}", "title": "" }, { "docid": "7cb9c4a8eb5af707c483c321a9199e32", "score": "0.5335269", "text": "stop() {\n this.flush();\n }", "title": "" }, { "docid": "2430419ee4650742a4db453732a8dd4b", "score": "0.53282577", "text": "function stop() {\n\tac.stop();\n}", "title": "" }, { "docid": "0f9446ce0ec15ce1918e75f7b466813e", "score": "0.53278154", "text": "stop() {\n this.timer = 0;\n }", "title": "" }, { "docid": "f22501594cd03dccffeddd9caa769fc3", "score": "0.5323142", "text": "function stop() {\n\n }", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "5bb82cd93e7f8e60f8a5c4f6e94f3130", "score": "0.53175473", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "df8921596426c8a854ff9d71012d096a", "score": "0.53166264", "text": "function stop() {\n clearInterval(intervalHolder);\n document.getElementById('runButton').disabled = false;\n document.getElementById('stopButton').disabled = true;\n document.getElementById('resetButton').disabled = false;\n }", "title": "" }, { "docid": "1cfa63637bc486981f2efae3286beeec", "score": "0.53112507", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "1cfa63637bc486981f2efae3286beeec", "score": "0.53112507", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "1cfa63637bc486981f2efae3286beeec", "score": "0.53112507", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "1cfa63637bc486981f2efae3286beeec", "score": "0.53112507", "text": "function stop(id) {\n id(false);\n}", "title": "" }, { "docid": "d96ab415952d53083975d67cabc3aeae", "score": "0.5302192", "text": "function stop() {\n stopTimerAndResetCounters();\n dispatchEvent('stopped', eventData);\n }", "title": "" }, { "docid": "d96ab415952d53083975d67cabc3aeae", "score": "0.5302192", "text": "function stop() {\n stopTimerAndResetCounters();\n dispatchEvent('stopped', eventData);\n }", "title": "" }, { "docid": "49f8c04c648d83b87487b64551aff5c9", "score": "0.5291917", "text": "stop() {\n this.target = null;\n }", "title": "" }, { "docid": "32127929b47b21de3a4416797874b713", "score": "0.5283397", "text": "stop () {\n console.log(this.id, '> Stopping Game');\n this.state = $GAME_STATE.finished;\n this.world.stop();\n }", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.5280953", "text": "async stopped() {}", "title": "" }, { "docid": "455ca3a1573312273d661506e3328a90", "score": "0.5280953", "text": "async stopped() {}", "title": "" }, { "docid": "2c29a4294a9d4ed0db71e80a0405d404", "score": "0.52780133", "text": "function _resetSequenceTimer() {\n clearTimeout(_reset_timer);\n _reset_timer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "1debd08b8a20e4d71fb4b2ba4b87f2d9", "score": "0.52740145", "text": "function sequenceEnded(){\n console.log(\"Sequence ended!\");\n}", "title": "" }, { "docid": "d71ef63f2388d25972c0749cb9f516f4", "score": "0.527224", "text": "function Sequence$cancel(){\n\t cancel();\n\t transformation && transformation.cancel();\n\t while(it = nextHot()) it.cancel();\n\t }", "title": "" }, { "docid": "56c0ca8c08bf4c181af7c7cd4535b5f1", "score": "0.52699167", "text": "static stop_Program() {\n new Audio('./audio/GoodJob.wav').play();\n // Set button to play arrow.\n document.getElementById(\n 'start_Button'\n ).innerHTML = `<i class=\"material-icons md-48 md-green\" id=\"play_Stop_Icon\">play_arrow</i>`;\n\n let current_Input = document.getElementById('user_input');\n\n // Set the input box to readonly again to disable typing after the test has stopped.\n current_Input.readOnly = true;\n\n // remove event listener for key presses as we no longer care what the user presses.\n current_Input.removeEventListener('keypress', UI.log_Key, false);\n\n // remmove any highlight if user pressed stop.\n document.querySelectorAll('.highlighted_Char').forEach(e => {\n e.classList.remove('highlighted_Char');\n });\n\n UI.clear_Input_Field();\n }", "title": "" }, { "docid": "2c3bc786f50e9f440a1dc6029b2c2f7f", "score": "0.52580434", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "14800eafd0bcda7516e4e964a8c30be5", "score": "0.5254387", "text": "function reset() {\n stop();\n init();\n }", "title": "" }, { "docid": "f92a2bd3700f377e781de3063c80d679", "score": "0.5249234", "text": "function startEmergencyStopProcess(){\n $(\".emergency_stop_bt\").off(); \n// intervalSpe = setInterval(function(){\n// sendSignal(\"002400806d68d7551407f09b861e3aad000549a844010000000007180500000000000000\");\n// },100); \n $(\".emergency_stop_bt\").html(\"Send CLR Command\");\n \n $(\".emergency_stop_bt\").on('click', function(){ \n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300143000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F0030014C000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300152000000\");\n $(\".emergency_stop_bt\").off();\n $(\".emergency_stop_bt\").html(\"Send SET Command\"); \n \n $(\".emergency_stop_bt\").on('click', function(){\n $(\".emergency_stop_bt\").off();\n $(\".emergency_stop_bt\").html(\"Send CLR Command\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300153000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300145000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300154000000\"); \n \n $(\".emergency_stop_bt\").on('click', function(){\n $(\".emergency_stop_bt\").off();\n $(\".emergency_stop_bt\").html(\"Send DWN Command\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300143000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F0030014C000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300152000000\");\n \n \n $(\".emergency_stop_bt\").on('click', function(){\n $(\".emergency_stop_bt\").off();\n $(\".emergency_stop_bt\").html(\"Send CLR Command\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300144000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300157000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F0030014E000000\");\n $(\".emergency_stop_bt\").on('click', function(){\n $(\".emergency_stop_bt\").html(\"Emergency Stop TEST\");\n $(\".emergency_stop_bt\").off();\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300143000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F0030014C000000\");\n sendSignal(\"002400806d68d7551407f09b861e3aad000549a844080000\"+cobID2+\"2F00300152000000\");\n //clearInterval(intervalSpe);\n $(\".emergency_stop_bt\").on('click', function(){\n startEmergencyStopProcess(); \n });\n });\n });\n });\n });\n });\n }", "title": "" }, { "docid": "6c3381af2405510e81f631e1ba6975bf", "score": "0.5247809", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "6c3381af2405510e81f631e1ba6975bf", "score": "0.5247809", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "6c3381af2405510e81f631e1ba6975bf", "score": "0.5247809", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "6c3381af2405510e81f631e1ba6975bf", "score": "0.5247809", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "6c3381af2405510e81f631e1ba6975bf", "score": "0.5247809", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" }, { "docid": "6c3381af2405510e81f631e1ba6975bf", "score": "0.5247809", "text": "function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }", "title": "" } ]
17261b0016d264463bce7602110ac239
Evento que se dispara al seleccionar un mes
[ { "docid": "1e0eec874b6d160c1dcc4e9d5170880e", "score": "0.0", "text": "function month_selected() {\n require([\n \"esri/tasks/query\",\n \"esri/tasks/QueryTask\"\n ], function (\n Query, QueryTask\n ) {\n var p = dojo.byId(\"Year_find\");\n p.disabled = true;\n\n var paramSelect = dojo.byId(\"Parameter_find\");\n PropiedadesMapa.value_param = paramSelect.options[paramSelect.selectedIndex].value;\n var monthSelect = dojo.byId(\"Month_find\");\n PropiedadesMapa.value_month = monthSelect.options[monthSelect.selectedIndex].value;\n\n var queryTask = new esri.tasks.QueryTask(\"http://barreto.md.ieo.es/arcgis/rest/services/UNESCO/CTD_NOAA_Layers/MapServer/\" + PropiedadesMapa.value_param);\n var queryParams = new esri.tasks.Query();\n queryParams.outSpatialReference = PropiedadesMapa.map.spatialReference;\n queryParams.outFields = [\"Year\"];\n queryParams.where = \"Month = \" + PropiedadesMapa.value_month;\n queryTask.execute(queryParams, showResultsYear);\n });\n}", "title": "" } ]
[ { "docid": "a761aa24b3a70a9884a963acdce7ff57", "score": "0.67069316", "text": "beforeUnSelect() {}", "title": "" }, { "docid": "3129b2c9a65e3a8296c5120ee49ba920", "score": "0.6658171", "text": "function deselectGizmo () {\n if(selectedGizmo != null) {\n selectedGizmo.deselect();\n }\n selectedGizmo = null;\n }", "title": "" }, { "docid": "676779e28d065b5206a8e80b37e0baf7", "score": "0.6562754", "text": "_onChatDeselect() {\n if (!this._selectedChat)\n return;\n\n this._selectedChat.elm.selected = false;\n this._selectedChat = null;\n\n this.render();\n }", "title": "" }, { "docid": "bcd09ae8f1e9998be8bd24dc2a62fc3b", "score": "0.65462655", "text": "_onAuthorUnselect(event) {\r\n this.$managers.prop('selectedIndex', 0);\r\n }", "title": "" }, { "docid": "3c08ea32b9dfaa07c5e0f3f11666d89b", "score": "0.653205", "text": "deselect () {\n if (this.player) {\n this.player.activeCard = false;\n }\n\t this.data.selected = false;\n this.element.dataset.selected = false;\n }", "title": "" }, { "docid": "e6402cf3013eb71362fd5d965d6204f4", "score": "0.6524122", "text": "function deseleccionarElemento(evt){\n\ttesting();\n\tif(elementSelect != 0){\t\t\n\t\t//se eliminan los elementos añadidos en la funcion seleccionarElemento\t\n\t\telementSelect.removeAttribute(\"onmousemove\");\n\t\telementSelect.removeAttribute(\"onmouseout\");\n\t\telementSelect.removeAttribute(\"onmouseup\");\n\t\telementSelect = 0;\n\t}\n}", "title": "" }, { "docid": "a540179e1b0786efdd69f83170ee88e1", "score": "0.65155494", "text": "deselect() {\n const el = this.getEl();\n this.selected = 0;\n const clsNameSel = this.getSelectedCls();\n el && (el.className = el.className.replace(clsNameSel, '').trim());\n this.emit('handler:deselect', this);\n }", "title": "" }, { "docid": "eb0a6edbbf241af3d029060c1d588aa2", "score": "0.64920765", "text": "unselect() {\n this.selected = false;\n this.removeclass('state_selected');\n elation.events.fire({type: 'unselect', element: this, data: this.value});\n }", "title": "" }, { "docid": "24e41f3490491c91326b6cc2f71c3178", "score": "0.6451249", "text": "onTeamUnselect() {\n Datas.Systems.soundCancel.playSound();\n this.windowChoicesTeam.unselect();\n }", "title": "" }, { "docid": "2e19647a9d8c6e83713a7cbbdac30ce0", "score": "0.64483464", "text": "function enmarcar(event) {\n selec = event.target;\n if (pintado == false) {\n selec.className += \" cambiarBorde\";\n pintado = true;\n letraSelec = selec.id;\n cantAct=cantAct+1;\n } else {\n $('.cambiarBorde').removeClass(\"cambiarBorde\");\n selec.className += \" cambiarBorde\";\n letraSelec = selec.id;\n cantAct=cantAct+2;\n }\n}", "title": "" }, { "docid": "6245b813dae4740c716a2f98affa6e6d", "score": "0.640715", "text": "function seleccion(){\n\t\tif( indice == null || indice == 0 ) {\n\t\t\talert(\"No haz seleccionado una opción, favor escoge\")\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "f30196f4dfa00fa34eca33ddd3de8267", "score": "0.6362335", "text": "function quitarLineaCompuestoActivos(seldetalle2) {\r\n\tvar listaDetalles = document.getElementById(\"listaDetalles2\");\r\n\tvar tr = document.getElementById(seldetalle2);\r\n\tlistaDetalles.removeChild(tr);\r\n\tdocument.getElementById(\"seldetalle2\").value = \"\";\r\n}", "title": "" }, { "docid": "3e83e62ce5f239137d899c6fb09cd1a6", "score": "0.6359262", "text": "function deselectAction(prevId) {\n\t//we have to deal with jQuery bug, cannot select 'cz/psp/97'\n\tvar shortPrevIdAr = prevId.split('/');\n var shortPrevId = shortPrevIdAr[shortPrevIdAr.length-1];\n //deselect\n\t$(\".mp-clicked-\"+shortPrevId).addClass('mp-clicked-off');\n\t$(\".mp-clicked-\"+shortPrevId).removeClass('ui-state-highlight mp-clicked-on');\n\t$(\".mp-\"+shortPrevId).draggable({ disabled: false });\n\t$(\".mp-clicked-\"+shortPrevId).draggable({ disabled: false });\n}", "title": "" }, { "docid": "86a05d5a5b9a4f3ebfcf27e10848fd68", "score": "0.6325949", "text": "function deleteSelected(){\n\t// If current selection is a state\n\tif( selectedState != null ){\n\t\tconsole.log(\"Deleting State \" + selectedState.label);\n\t\tselectedState.destroy();\n\t\tselectedState = null;\n\t\tnumStates -= 1;\n\t}\n\t\n\t// If current selection is a transition\n\tif( selectedTran != null ){\n\t\tconsole.log(\"Deleting Transition \" + selectedTran.character);\n\t\tselectedTran.destroy();\n\t}\n}", "title": "" }, { "docid": "9392ac25deea89ff140c7b0c93b921d1", "score": "0.63087434", "text": "handleDeselect(e) {\n e.preventDefault();\n this.setState({\n selected: \"\",\n selectionHappened: false,\n });\n }", "title": "" }, { "docid": "4e90676d4d6d2b560b043584012b0d7e", "score": "0.6297717", "text": "onSelectionChanged(msg) {\n /* no-op */\n }", "title": "" }, { "docid": "4e90676d4d6d2b560b043584012b0d7e", "score": "0.6297717", "text": "onSelectionChanged(msg) {\n /* no-op */\n }", "title": "" }, { "docid": "4e90676d4d6d2b560b043584012b0d7e", "score": "0.6297717", "text": "onSelectionChanged(msg) {\n /* no-op */\n }", "title": "" }, { "docid": "ec2c4268a16472de426fd40bf7874894", "score": "0.6234137", "text": "function selectTapToBeRemoved() {\n\n}", "title": "" }, { "docid": "28b441a5da9d229643e33c28700c4fff", "score": "0.6194052", "text": "onDeselect() {\n // Do something when a section instance is selected\n }", "title": "" }, { "docid": "28b441a5da9d229643e33c28700c4fff", "score": "0.6194052", "text": "onDeselect() {\n // Do something when a section instance is selected\n }", "title": "" }, { "docid": "ec811e2eb890bf2f1cd7357f6a53e7fd", "score": "0.619036", "text": "function trackDeselect(){\n\t\t Track.event(2, time + \"_button_deselected\", true);\n\t }", "title": "" }, { "docid": "1ee971975896d69090ace5038a55eea4", "score": "0.6189173", "text": "function eliminarCurso(e){\n if(e.target.classList.contains('borrar-curso')){\n const cursoId = e.target.getAttribute('data-id');\n\n //elimina del arreglo el articulo seleccionado por el data-id\n articulosCarrito = articulosCarrito.filter(curso => curso.id !==cursoId);\n\n carritoHtml();\n }\n \n \n}", "title": "" }, { "docid": "14c093766f46ae952ce2d35b71b7494e", "score": "0.61813414", "text": "function removeHeroFromSelection(){\n setSelectedHero([])\n }", "title": "" }, { "docid": "6454ab9265b50ade08957e511eb54a28", "score": "0.61640024", "text": "async deselect() {\n if (await this.isSelected()) {\n await this.toggle();\n }\n }", "title": "" }, { "docid": "e4c79e3af1b406eaca4a1796615d5608", "score": "0.6159203", "text": "function deselect() {\n const texts = [textOne, textTwo, textThree, textFour, textFive]\n texts.forEach((each) => {\n each.style('display', null)\n each.attr('fill', 'black')\n each.style('opacity', '1')\n })\n canvas.style('transform', 'translate(0px, 0px)')\n description.style('position', 'absolute')\n .style('top', '0px')\n .style('left', `${(canvasWidth / 4) + 50}px`)\n const descDOM = document.querySelector('.Onion_Theory__diagram__descriptions')\n descDOM.classList.remove('show')\n onionSelected = false\n }", "title": "" }, { "docid": "24579a79687283fe79673d6bd9ec3290", "score": "0.61217207", "text": "function deselecionar(tipo, escolha) {\n\tdocument.getElementById(tipo + '-escolha-' + escolha).classList.remove('selecionado');\n}", "title": "" }, { "docid": "615268c671a05d49bc84a98043c719f1", "score": "0.6098275", "text": "function selectedCardDisappears() {\n $(this).parent().empty();\n }", "title": "" }, { "docid": "8d296d445eebf1fee79ede8ddaf8d7b0", "score": "0.6093882", "text": "function supprimerReponseCourante() {\n // Si la classe Reponsefocused à déjà été retirée\n var aRetirerClasseReponsefocused = false;\n // Gestion des erreurs liés à l'interface\n if($(\"#Ul_Reponses\").children(\"li\").length == 1) {\n swal(\"Oups\", \"Vous ne pouvez pas avoir de question sans aucune réponse\", \"error\");\n }\n else if($(\".Reponsefocused\").length == 0) {\n swal(\"Oups\", \"Veuillez sélectionner une réponse pour la supprimer.\", \"warning\");\n }\n else {\n // Récupère l'index du li qui possède la classe Reponsefocused\n var indexReponseCourrante = $(\".Reponsefocused\").parent(\"li\").index();\n\n var indexNouveauFocus = indexReponseCourrante;\n // Ici == corresponderait au dernier élément de la liste. >= juste pour assurer et prévenir les bugs.\n if(indexNouveauFocus >= $(\"#Ul_Reponses\").children(\"li\").length - 1) {\n --indexNouveauFocus;\n }\n\n // .remove() gère automatiquement de supprimer la classe de l'élément (en supprimant l'élément)\n $(\".Reponsefocused\").parent().remove();\n // Empêche la suppression de la classe Reponsefocused du nouvel élément focus.\n aRetirerClasseReponsefocused = true\n\n\n $(\"#Ul_Reponses\").children(\"li:nth-child(\" + (indexNouveauFocus+1) + \")\").children(\".reponsesQuestion\").focus();\n }\n if(!aRetirerClasseReponsefocused) {\n // Si l'élément a déjà été supprimé, le sélecteur ne va correspondre à aucun élément et cette commande ne va pas être éxécutée.\n $(\".Reponsefocused\").removeClass(\"Reponsefocused\");\n }\n // Redistribut le tabIndex au travers des éléments de ma question\n attribuerTabIndexToElemQuestion();\n}", "title": "" }, { "docid": "d857d871cc7afde64cc5487d6f320b49", "score": "0.6082425", "text": "function chooseMonster(dueler) {\n\n switch (dueler) {\n case 0:\n\n let possibleMoves = document.getElementById(\"possibleMoves\");\n\n /*empties select list*/\n for (let i = 0; i < possibleMoves.length; i++) {\n possibleMoves.remove(i);\n }\n\n\n\n break;\n\n case 1:\n break;\n\n }\n\n}", "title": "" }, { "docid": "e648733bcb0ab1b7bcfb810f868728f4", "score": "0.60798186", "text": "function deSelectedItem(element) {\n mSelectedItems.items.forEach(function (item) {\n if (item.id == element.id) {\n item.selectChange(false);\n mSelectedItems.items.remove(item);\n }\n });\n\n if (mSelectedItems.items.count === 0) {\n mSelectedItems.items = new Collection();\n }\n}", "title": "" }, { "docid": "b04149ebc82f42066158c8d59776031a", "score": "0.6064322", "text": "unselect(type)\n {\n if (type) {\n this.swipe = type\n setTimeout(() => {\n this.selected = null\n }, 100)\n }\n }", "title": "" }, { "docid": "2ad7129db6775c3e383e0d9f6b897890", "score": "0.6054808", "text": "function deselect(e) {\n\t$('.pop').slideFadeToggle(function() {\n\t\te.removeClass('selected');\n\t});\n}", "title": "" }, { "docid": "785a7f39b0efeec1d787eb0e61e336a1", "score": "0.6040012", "text": "function selectedRemove (evente) {\n let divClassRemove = document.getElementsByClassName('selected');\n divClassRemove[0].classList.remove('selected');\n\n let eventeTarget = evente.target;\n eventeTarget.classList.add('selected');\n}", "title": "" }, { "docid": "0604b08456eae51b02b661809968c19c", "score": "0.6034268", "text": "clearSelection() {\n let state = this.state;\n state.requestMove.pieceID = \"\";\n state.requestMove.desiredMoves = [];\n state.selectionType = \"pieceID\"\n state.pieceLocation = -1;\n this.setState(state);\n }", "title": "" }, { "docid": "c5967ecd5c23b536baa2d1c631e7e443", "score": "0.6003551", "text": "desbloquear(moneda,dinero,pos){\n //Desactiva la interactividad de todos los botones\n this.spriteDerecha.disableInteractive();\n this.spriteIzquierda.disableInteractive();\n var i;\n for (i = 0; i < this.monedasButton.length; i++) {\n this.monedasButton[i].disableInteractive();\n }\n\n //Añade un tinte amarillo al botón seleccionado\n this.monedasButton[pos].setTint(0xDEDE7C);\n\n //Muestra el mensaje de desbloquear dependiendo del idioma\n if(espanol){\n this.mensajeDesbloquear = this.add.sprite(gameConfig.scale.width / 2,(gameConfig.scale.height/3)*2.4,'mensajeDesbloquear').setScale(gameConfig.scale.height / 600);\n }else{\n this.mensajeDesbloquear = this.add.sprite(gameConfig.scale.width / 2,(gameConfig.scale.height/3)*2.4,'mensajeDesbloqueari').setScale(gameConfig.scale.height / 600);\n }\n \n //Botones de si y no\n this.spriteDesbloquearNo = this.add.sprite(gameConfig.scale.width/2+(this.mensajeDesbloquear.displayWidth/4),(gameConfig.scale.height/3)*2.4+(this.mensajeDesbloquear.displayHeight/5),'botonDesbloquearNo').setScale(gameConfig.scale.height / 600);\n this.spriteDesbloquearNo.setInteractive().on('pointerdown',()=> {this.sound.play('buttonSound', { volume: 0.15 }); this.cerrarMensajeDesbloquear(pos)});\n\n this.spriteDesbloquearSi = this.add.sprite(gameConfig.scale.width/2-(this.mensajeDesbloquear.displayWidth/4),(gameConfig.scale.height/3)*2.4+(this.mensajeDesbloquear.displayHeight/5),'botonDesbloquearSi').setScale(gameConfig.scale.height / 600);\n this.spriteDesbloquearSi.setInteractive().on('pointerdown',()=> {this.sound.play('buttonSound', { volume: 0.15 }); this.comprarMonedas(moneda,dinero,pos)});\n\n }", "title": "" }, { "docid": "0af7e5a793574f6390cd67eae9aac648", "score": "0.5995864", "text": "static removePreSelection(){ \n quantityField.innerHTML = '';\n document.getElementById('reservation').removeAttribute('click');\n if(h2.style.display !== \"none\"){\n h2.style.display = \"none\";\n }\n if(eShopMessage.firstElementChild !== null){\n eShopMessage.removeChild(eShopMessage.firstElementChild)\n }\n let k = store.childNodes.length;\n if(store.firstElementChild !== null){ \n for(let i = 0; i < k ; i++){\n store.removeChild(store.childNodes[0]);\n } \n }\n }", "title": "" }, { "docid": "b88b088c70e6e768414df3ce132d4edd", "score": "0.5989084", "text": "function myFunctionDesplegable(){ // ESTA SERVIRÁ PARA EL DESPLEGABLE (tal vez)\r\n var inputElements = document.getElementByClassName('desp'); \r\n for(var i=0; inputElements[i]; ++i){\r\n if(inputElements[i].selected){\r\n posicionDesplegable = inputElements[i].value;\r\n }\r\n }\r\n console.log(\"Posicion \" + posicionDesplegable + \" del desplegable\");\r\n render() \r\n }", "title": "" }, { "docid": "c0d2210b7a73f24d1fc0130963012e69", "score": "0.59879535", "text": "function deleteSelected() {\n const btnDelete = document.querySelector('#remover-selecionado');\n btnDelete.addEventListener('click', () => {\n document.querySelector('.selected').remove();\n });\n}", "title": "" }, { "docid": "d46302c5e340db5e83946924eb526124", "score": "0.5980225", "text": "function enmarcarMas(event) {\n selec = event.target;\n console.log(selec);\n if (arregloSeleccion.length <= 3) {\n var objecto = {\n id: selec.id,\n dato: $('#' + selec.id).data(\"valor\")\n }\n if (estaEnArreglo(arregloSeleccion, objecto.dato)) {\n eliminarDato(arregloSeleccion, objecto.dato)\n $('#' + selec.id).removeClass(\"zoom\");\n $('#' + selec.id).removeClass(\"cambiarBorde\");\n } else {\n if (arregloSeleccion.length < 3) {\n selec.className += \" zoom\";\n selec.className += \" cambiarBorde\";\n\n arregloSeleccion.push(objecto);\n }\n }\n console.log(arregloSeleccion);\n }\n\n}", "title": "" }, { "docid": "b8f7c296cd3111268377a0779b3ee6ec", "score": "0.59773153", "text": "function un_selected(item) {\r\n jQuery(item).removeClass('hw-selected');//.remove(selection);\r\n }", "title": "" }, { "docid": "1a3bcd307d8d254007e9b50f364c7ba8", "score": "0.59724367", "text": "function disableDeselectAll() {\n self.displayArea\n .on(\"click\", null);\n }", "title": "" }, { "docid": "1d5ef71081dcc03007ad7d4921b8228e", "score": "0.59713006", "text": "function removeSelected(clickEvent){\n clickEvent.cancelBubble = true;\n this.isSelected = false;\n }", "title": "" }, { "docid": "9deb51e2b01c7849516bcc966439fe74", "score": "0.5970233", "text": "function elementDeselect(){\n select1 = false;\n select2 = false;\n d3.select(\"circle#\"+select1Id)\n .classed(\"selection-highlight\", false);\n\n d3.select(\"circle#\"+select2Id)\n .classed(\"selection-highlight\", false);\n select1Id = undefined;\n select2Id = undefined;\n}", "title": "" }, { "docid": "80b0bb649f4cf2ef204d3b1495c5ab9e", "score": "0.5970021", "text": "function handleSelectedItem(event) { /*Toda vez que a função é disparada, passa pra dentro dela um evento*/\n const itemLi = event.target;\n \n //adicionar ou remover com js\n itemLi.classList.toggle(\"selected\")\n\n //Pegar os número que tem no id do item selecionado*\n const itemId= itemLi.dataset.id; \n \n\n //Verificar se existem items selecionados, se sim\n //pegar os items selecionados\n const alreadySelected = selectedItems.findIndex(item=>{\n const itemFound = item == itemId\n return itemFound\n })\n\n //se já estiver selecionado, tirar da seleção\n if(alreadySelected >=0){\n //tirar da seleção\n\n }\n\n\n //se não estiver selecionado, add à seleção\n\n //atualizar o campo escondido com os items selecionados\n\n}", "title": "" }, { "docid": "4c418227213e5a45ab933a66d5f47fe5", "score": "0.5941346", "text": "function eliminarCurso(e) {\n e.preventDefault();\n if(e.target.classList.contains('borrar-curso') ) {\n // e.target.parentElement.parentElement.remove();\n const cursoId = e.target.getAttribute('data-id')\n \n // Se elimina del arreglo articulocarrito que le damos click.\n articulosCarrito = articulosCarrito.filter(curso => curso.id !== cursoId);\n\n carritoHTML();\n }\n}", "title": "" }, { "docid": "c1c0155daca438d349bd195d4731fc75", "score": "0.5910675", "text": "function limpiar(){\n $(\"#txtIdAvion\").val(\"\");\n $(\"#txtDescripcion\").val(\"\");\n $(\"#txtPlaca\").val(\"\");\n let select = document.getElementById(\"selMarca\");\n //Limpiar select\n while (select.length > 1) {\n select.remove(select.length - 1);\n }\n $(\"#selFabricante\").val(\"-1\");\n $(\"#selColor\").val(\"-1\");\n\n\n}", "title": "" }, { "docid": "467b24199a4f9e46fc919d91b668b609", "score": "0.5896782", "text": "function handleOnClick(item) {\n if (!selection.some(current => current.id === item.id)) {\n if (!multiSelect) {\n setSelection([item]);\n } else if (multiSelect) {\n setSelection([...selection, item]);\n }\n } else {\n let selectionAfterRemoval = selection;\n selectionAfterRemoval = selectionAfterRemoval.filter(\n current => current.id !== item.id\n );\n setSelection([...selectionAfterRemoval]);\n }\n }", "title": "" }, { "docid": "edc6c5dd1f29e8a14a33ace9a47c1b0d", "score": "0.5896471", "text": "function deselect()\r\n{\r\n\ttarget = null;\r\n\tFramework.terminal_target = null;\r\n}", "title": "" }, { "docid": "a843bf13386e70975a472658b147f2f2", "score": "0.5894107", "text": "function clicCase(event) {\n\n // recupere le bouton cliquer\n var boutonCliquer = event.target;\n\n //test si le bouton a deja etait cliquer\n if ($(boutonCliquer).attr('value') != '') {\n alert('bouton deja choisie');\n return;\n }\n\n //test si il reste des cases disponibles\n if (nbrCaseJeu == testfin) {\n alert('jeu finit en ' + nbrEssais + ' essais.');\n }\n //retourne la case cliquer\n $(boutonCliquer).attr('value', $(boutonCliquer).attr('nbrCacher'));\n\n //si premier clic initialise avantDernier et quitte\n if (choix1 == undefined) {\n choix1 = boutonCliquer;\n boutonCliquer = undefined;\n return;\n } else if (choix2 == undefined) { //deuxieme clic \n choix2 = boutonCliquer;\n boutonCliquer = undefined;\n } else if ($(choix1).attr('nbrCacher') == $(choix2).attr('nbrCacher')) { // si identiques desactive les cases et reset avantDernier\n $(choix1).css('visibility', 'hidden');\n $(choix2).css('visibility', 'hidden');\n choix1 = undefined;\n choix2 = undefined;\n testfin++;\n nbrEssais++;\n } else if ($(choix1).attr('nbrCacher') != $(choix2).attr('nbrCacher')) { //pas identique efface les valeurs et reset avantDernier \n $(choix1).attr('value', '');\n $(choix2).attr('value', '');\n choix1 = undefined;\n choix2 = undefined;\n nbrEssais++;\n }\n\n}", "title": "" }, { "docid": "e764435fe65c986742a0b477e6d08a70", "score": "0.5894019", "text": "onBeforeDetach(msg) {\n const node = this.selectNode;\n node.removeEventListener('change', this);\n }", "title": "" }, { "docid": "aa687c7b11ce4696c36b1735899e40d0", "score": "0.5889279", "text": "function desabilitaPlaca()\r\n{ \r\n var i = document.getElementById(\"tipoVeiculo\").selectedIndex;\r\n var v = \tdocument.getElementById(\"tipoVeiculo\").options[i].id;\r\n \r\n if(v=='N'){\t\t\r\n\t\t$('#placaVeiculo').hide('fast');\r\n\t\t$('#placaVeiculoLabel').hide('fast');\r\n\t\t$('#placaVeiculo').val('');\r\n\t}else{\r\n\t\t$('#placaVeiculo').show('fast');\r\n\t\t$('#placaVeiculoLabel').show('fast');\r\n\t\t$('#placaVeiculo').focus();\r\n\t}\r\n}", "title": "" }, { "docid": "f7603d0030f0aa8ee9d727effc795d58", "score": "0.58819747", "text": "function removeSelection(e) {\n if (e.propertyName !== 'transform') return;\n this.classList.remove('selected');\n}", "title": "" }, { "docid": "536b937b171a283e3571ee6bf2bbdd4e", "score": "0.58773905", "text": "function eliminarCurso(e) { \n \n if(e.target.classList.contains('borrar-curso')){\n const cursoId = e.target.getAttribute('data-id');\n \n //Elimina del arreglo el articulo de\n carritoCompras = carritoCompras.filter(curso => curso.id !== cursoId);\n\n carritoHTML(); //Iterar sobre el carrito y mostrar su HTML\n }\n\n\n}", "title": "" }, { "docid": "064a6b4205f8772a4491bcc2257428df", "score": "0.587585", "text": "onBeforeDetach(msg) {\n let node = this.selectNode;\n node.removeEventListener('change', this);\n }", "title": "" }, { "docid": "064a6b4205f8772a4491bcc2257428df", "score": "0.587585", "text": "onBeforeDetach(msg) {\n let node = this.selectNode;\n node.removeEventListener('change', this);\n }", "title": "" }, { "docid": "1715586edca51f15640c3d6428b6e549", "score": "0.5867528", "text": "function seleccion(){\n\t\tif( indice == null || indice == 0 ) {\n\t\t\t//alert(\"No haz seleccionado una opción, favor escoge\")\n\t\t\tvar lista = document.getElementsByClassName('form-group input-box')[1].classList.add('indice')\n\t\t\tvar contenedor = document.getElementsByClassName('indice')[0];\n\t\t\tvar nombreSpan = document.createElement('span');\n\t\t\tvar nodoAlerta = document.createTextNode(\"No haz seleccionado una opción, favor escoge\");\n\t\t\tnombreSpan.appendChild(nodoAlerta);\n\t\t\tcontenedor.appendChild(nombreSpan);\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "6794f91c3f6c8200043df707008db807", "score": "0.5863759", "text": "function deselect()\r\n\t\t{\r\n\t\tunselectPreviousFeatures();\r\n\t\tsetResults(''); \r\n\t\tsetResultsheader('<p>No plans selected - please click on a <strong>dark blue feature</strong> where you are interested in on the map to view details of plans</p>');\r\n\t\tcurrentID = '';\r\n\t\tupdateUrl();\r\n\t}", "title": "" }, { "docid": "0053e51bebde3b76aec43b8291e84e27", "score": "0.58623976", "text": "function cancelSelected(id,id2){\n scope.plan.current[id].isSelected = false;\n scope.plan.selected.splice(id2,1);\n }", "title": "" }, { "docid": "0c975f0d0b8b468b4ee5c70905d3bbe1", "score": "0.58438855", "text": "unselect() {\n this._selected = false;\n this._changeRadioButtonAppearance( this.interactionStateProperty.value );\n }", "title": "" }, { "docid": "7c247ba4318d423813e0dbce71686d1c", "score": "0.58419955", "text": "function boxRemEntrada() {\r\n if (numEntradas > 1) {\r\n document.getElementById('data-' + numEntradas).remove();\r\n numEntradas--;\r\n attEntrada();\r\n }\r\n }", "title": "" }, { "docid": "ca89d8c72ca74a3748360459fd58185e", "score": "0.58283144", "text": "function eliminarCurso(e) {\n e.preventDefault();\n if (e.target.classList.contains(\"borrar-curso\")) {\n const cursoId = e.target.getAttribute(\"data-id\");\n\n articulosCarrito = articulosCarrito.filter(\n (curso) => curso.id !== cursoId\n );\n carritoHTML();\n }\n }", "title": "" }, { "docid": "f6c349f29d11560d5283bbe98a31f218", "score": "0.5824303", "text": "deleteSelection(id) {\n if(this.mySelection != null) {\n for(let i = 0; i < this.mySelection.length; i++) {\n if(this.mySelection[i].getId() === id) {\n this.mySelection.splice(i,1); \n this.props.handleSelections(this.mySelection);\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "a4d52bcbcad31f9e6359572439300061", "score": "0.58122236", "text": "function selectedDone(event) {\n // Get id of selector \n let selectorId = event.target.id;\n let index = selectorId.trimLeft('selector_');\n \n // Hide selector on current object\n document.getElementById(selectorId).setAttribute('hidden','');\n document.getElementById(`selector_label_${index}`).setAttribute('hidden','');\n\n // Remove current div's highlighter\n document.getElementById(`group${index}`).classList.remove('highlight-ex');\n\n shiftHighlightToNextExercise(index);\n\n}", "title": "" }, { "docid": "8f379ff98bc3575e778d9420bdd67e3c", "score": "0.58104247", "text": "function eliminarBloqueSVIGENTE(){\n if(ultimo_bloque_svigente>1){\n \n $('#CANT_CAUSASVIGENTES').val(ultimo_bloque_svigente);\n $('#sancion-fieldset_svigente'+ultimo_bloque_svigente).hide();\n $('#input_nombre_programa_svigente'+ultimo_bloque_svigente).val('');\n $('#input_tiempo_total_condena_svigente'+ultimo_bloque_svigente).val('');\n $('#input_fecha_inicio_condena_svigente'+ultimo_bloque_svigente).val('');\n $('#input_ruk_svigente'+ultimo_bloque_svigente).val('');\n $('#input_detencion_svigente'+ultimo_bloque_svigente).val('');\n $('#input_fecha_control_detencion_svigente'+ultimo_bloque_svigente).val('');\n ultimo_bloque_svigente--;\n }\n}", "title": "" }, { "docid": "104947a7532ee160c82f42261afaf938", "score": "0.5808856", "text": "function onExclusaoItemClick(evento){\r\n\t\tvar codigoCerveja = $(evento.target).data('codigo-cerveja');\r\n\t\tvar resposta = $.ajax({\r\n\t\t\turl: 'item/' + this.uuid + '/' + codigoCerveja,\r\n\t\t\tmethod: 'DELETE'\r\n\t\t});\r\n\t\t\r\n\t\tresposta.done(onItemAtualizadoNoServidor.bind(this)); // atualiza a tabela com retorno vindo do servidor\r\n\t}", "title": "" }, { "docid": "09c54cbfc3097888d65b2e7567d06d6b", "score": "0.58084255", "text": "unselect() {\n if (this.#activeEditor) {\n this.#activeEditor.parent.setActiveEditor(null);\n }\n this.#allowClick = true;\n }", "title": "" }, { "docid": "daf332727104074e3119ad92167e0409", "score": "0.5808043", "text": "function unselect () {\n // Return previous selected object to original material\n if (selectedGroup !== null) {\n for (let i = 0; i < auxMaterials.length; ++i) {\n selectedGroup.children[i].material = auxMaterials[i];\n }\n }\n selectedGroup = null;\n auxMaterials = [];\n if (manipulCtrl !== null) {\n manipulCtrl.enable = false;\n scene.remove(manipulCtrl);\n }\n}", "title": "" }, { "docid": "95f102c40310b10e6ebabf173b176216", "score": "0.5799165", "text": "select() {\n const el = this.getEl();\n const handlers = this.gp.getHandlers();\n handlers.forEach(handler => handler.deselect());\n this.selected = 1;\n const clsNameSel = this.getSelectedCls();\n el && (el.className += ` ${clsNameSel}`);\n this.emit('handler:select', this);\n }", "title": "" }, { "docid": "63aede73ceaa6b05f36efbf3146202b2", "score": "0.57987356", "text": "function eliminaCollegamento(e) {\n var primaNota = e.data[0];\n var idx = e.data[1];\n var msg = \" <Strong>Elemento selezionato:</Strong> collegamento con la prima nota \" + primaNota.tipoCausale.descrizione + \" numero \" + primaNota.numeroRegistrazioneLibroGiornale + \".<br>\" +\n \t\t\" Stai per eliminare l'elemento selezionato: sei sicuro di voler proseguire?\" ;\n var btns = [{'label': 'no, indietro', \n \t\t\t'class': 'btn', \n \t\t\t'callback': $.noop\n \t\t\t},\n \t\t\t{'label': 'si, prosegui ', \n \t\t\t'class': 'btn btn-primary', \n \t\t\t'callback': eliminazioneCollegamento.bind(null, idx)\n \t\t\t}];\n \n bootboxAlert(msg, '', '', btns);\n\n }", "title": "" }, { "docid": "c84406509669da1cb84ebc23dc731ee0", "score": "0.579649", "text": "function quitarProducto(e) {\n\tlet idProducto = Number(e.target.getAttribute(\"data-id\"));\n\n\tcarrito = carrito.filter((p1) => p1.id != idProducto);\n\n\testructuraCarrito();\n}", "title": "" }, { "docid": "36242ef5769bb8099dde53bcd0c7e9be", "score": "0.57918316", "text": "function eliminarCurso(e){\n console.log(e.target.classList);\n\n if(e.target.classList.contains('borrar-curso')){\n const idcurso = e.target.getAttribute('data-id');\n\n // Elimina del arreglo articuloCarrito por el id \n\n articuloCarrito = articuloCarrito.filter(curso => curso.id !== idcurso);\n carritoHtml(); // iterar sobre el carrito\n }\n}", "title": "" }, { "docid": "572d609ae103536a8862326903e2f7d5", "score": "0.5788853", "text": "function quitarEventosNegro(){\n\n eligetn.removeEventListener(\"click\",cambiarPieza);\n eligean.removeEventListener(\"click\",cambiarPieza);\n eligecn.removeEventListener(\"click\",cambiarPieza);\n eligern.removeEventListener(\"click\",cambiarPieza);\n\n}", "title": "" }, { "docid": "ad20deceaa50480c70fb0a921feb67f7", "score": "0.5786546", "text": "onDeselect()\n {\n // this.effectIds = CombatController.\n }", "title": "" }, { "docid": "90c30530cdcab06392ce7dbeeed41b8c", "score": "0.57863677", "text": "exito() {\n this.boton.style.backgroundColor = '#FE8416';\n this.boton.style.color = 'white';\n this.boton.innerHTML = 'Seleccionada';\n }", "title": "" }, { "docid": "3e07fe326f7f88497c7de58bc2b3d52e", "score": "0.5785573", "text": "function deteleTask(event) {\n let parent = event.target.parentNode;\n let index = parent.dataset.index;\n taskList.splice(index, 1);\n // Siempre que modifico mi arreglo de tareas lo tengo que\n // Guardar -> Filtrar -> Renderar\n saveTasks();\n filterTasks();\n render();\n }", "title": "" }, { "docid": "adcfb70ca6629d526983e2bacbe5f49b", "score": "0.5782171", "text": "delete_selected () {\n var selected_nodes = this.getSelectedNodes(),\n selected_text_labels = this.get_selected_text_labels()\n if (Object.keys(selected_nodes).length >= 1 ||\n Object.keys(selected_text_labels).length >= 1)\n this.delete_selectable(selected_nodes, selected_text_labels, true)\n }", "title": "" }, { "docid": "6bfc3fb35df51d87168ffdce3d89a50d", "score": "0.57804775", "text": "function eliminaCurso(e) {\n e.preventDefault();\n let curso, cursoId;\n if(e.target.classList.contains('borrar-curso')) { // delegas el listener hacia la clase\n //borrar-curso que la posee el boton \"x\" de eliminar\n e.target.parentElement.parentElement.remove(); //remueves todo desde el padre \n //del padre de la \"x\"(todo el item del curso en el carrito);\n curso = e.target.parentElement.parentElement;\n cursoId= curso.querySelector('a').getAttribute('data-id');\n console.log(cursoId);\n }\n\n eliminarCursoLocalStorage(cursoId);\n}", "title": "" }, { "docid": "b0996dbabd9d2fb46ae49bab5a13b50d", "score": "0.5777331", "text": "function addDeleteListener() {\n $(\"#btn_delete\").bind('click', function(e) {\n e.preventDefault();\n \n url_param = getParamsUrl();\n \n in_array = $.inArray(url_param['item'],list_visites);\n if(in_array === -1) {\n text = \"Etez-vous sur de vouloir supprimer le/la/l' \" +\n url_param['item'] + \" \" + $(\"#select_id option:selected\").text() + \"?\";\n sub_item = undefined;\n }\n else {\n text = \"Etez-vous sur de vouloir supprimer la visite du \" +\n $(\"#select_id option:selected\").text() + \" avec le/l \" +\n list_fields[in_array] + \" \" + $(\"#select_\" + list_fields[in_array] + \n \" option:selected\").text() + \"?\";\n sub_item = \"select_\" + list_fields[in_array];\n }\n \n if(confirm(text)) { \n $.ajax({\n 'url': 'controller/gestion_ajax.php',\n 'type': 'post',\n //on retour le type de l'item et le contenu du form\n 'data': 'action=delete&item=' + url_param['item'] + '&id=' \n + $(\"#select_id\").val(),\n 'dataType': 'json',\n 'success': function(data) {\n if(data.success) {\n alert(data.message); \n\n //on refresh la liste des items\n refreshList(url_param['item']);\n\n //on revient sur la formulaire en mode ajout\n $(\"#select_id\").val('');\n $(\"#select_id\").change();\n }\n else\n {\n alert(data.erreur);\n }\n }\n });\n }\n });\n}", "title": "" }, { "docid": "636fb5d910b634d3ecd906d910a8a0f5", "score": "0.57766247", "text": "completado(element) {\r\n if (element.name === 'hecho') {\r\n element.parentElement.parentElement.parentElement.remove();\r\n this.showMessage('Recordatorio Completado', 'info');\r\n }\r\n }", "title": "" }, { "docid": "1f9c4ecd11b0e8cc65428b0e21ba164e", "score": "0.57749546", "text": "function eliminarCarrito(event) {\n event.stopPropagation();\n //Filtro donde voy a sobreescribir el array carrito con todos los productos menos el producto del id del target.\n carrito = carrito.filter(producto => producto.id != event.target.id);\n carritoUI(carrito);\n actualizarPrecio();\n localStorage.setItem('carrito', JSON.stringify(carrito)); \n }", "title": "" }, { "docid": "f6e4e72f7c61987f3eff360e2c3f8437", "score": "0.5774308", "text": "function _destroy() {\n selected = null;\n}", "title": "" }, { "docid": "125c6d07531deb743263af3a944273e1", "score": "0.57692224", "text": "function onCloseCliente(feature){\r\n selectFeatures.unselect( feature );\r\n var div1 = document.getElementById(\"sugerencia\");\r\n div1.style.display = \"none\";\r\n}", "title": "" }, { "docid": "a4fba05a22ed41618109bcbc102f4c04", "score": "0.576384", "text": "deselectAll_() {\n this.selectedChips_.forEach((chipFoundation) => {\n chipFoundation.setSelected(false);\n });\n this.selectedChips_.length = 0;\n }", "title": "" }, { "docid": "56f8a1ef6ab5936d08e5746bfe5d4e36", "score": "0.57629865", "text": "function deleteSelectedCell(e) {\n\t\tif (selected[0]) {\n\t\t\tselected[0].remove();\n\t\t\tselected.shift();\n\t\t}\n\t\tupdateCollabGraph();\t\n\t}", "title": "" }, { "docid": "bb5af92c88db71033f25bfb1d0eac0f2", "score": "0.57579374", "text": "function quitarEventosBlanco(){\n\n eligetb.removeEventListener(\"click\",cambiarPieza);\n eligeab.removeEventListener(\"click\",cambiarPieza);\n eligecb.removeEventListener(\"click\",cambiarPieza);\n eligerb.removeEventListener(\"click\",cambiarPieza);\n\n}", "title": "" }, { "docid": "a5e56708dde59a964646ebf6e9477b61", "score": "0.5750295", "text": "function eliminarU(){\n $('.deleteU').click((e) => {\n console.log(e.target.id)\n var removeU = seleccionUnitario.find(producto => producto.id == e.target.id);\n const indexU = seleccionUnitario.indexOf(removeU)\n console.log(indexU)\n if (removeU.cantidadUnitaria > 1) {\n removeU.cantidadUnitaria--;\n mostrarSeleccionU();\n precioFinal()\n } else {\n seleccionUnitario = seleccionUnitario.filter( (i)=> (i !== removeU) );\n mostrarSeleccionU();\n precioFinal()\n }\n })\n}", "title": "" }, { "docid": "d4e9cbe91e2eec52f0c73e825e0312d8", "score": "0.57445544", "text": "function deleteNecesario() {\n $(\".necesario\").change(function () {\n $(this).removeClass(\"error\");\n });\n}", "title": "" }, { "docid": "d4e9cbe91e2eec52f0c73e825e0312d8", "score": "0.57445544", "text": "function deleteNecesario() {\n $(\".necesario\").change(function () {\n $(this).removeClass(\"error\");\n });\n}", "title": "" }, { "docid": "e6da336eec78fd5f11bb35d68391d442", "score": "0.57444185", "text": "deselectAll () {\n this.setProperties({\n 'itemsToAdd': [],\n 'currentMessage': null\n });\n }", "title": "" }, { "docid": "3aa2e9e1aac0f2962c0a9e68c0a0fd75", "score": "0.5743735", "text": "function elmIndItem(e) {\n const parent = e.currentTarget.parentElement.parentElement.parentElement;\n lista.removeChild(parent);\n \n if (lista.children.length === 0) {\n despBtn.classList.remove('show-clear-items');\n mostrarAlerta('Lista vacía', 'warning');\n } else {\n mostrarAlerta('Elemento eliminado', 'warning');\n }\n \n // Eliminar del Local Storage\n const id = parent.dataset.id;\n eliminarDelLocalStorage(id);\n \n porDefecto();\n}", "title": "" }, { "docid": "ae9f69822bf34cb37add66248603d794", "score": "0.5741111", "text": "function deselect_it(ids){\r\n var mq = ids.split(\",\");\r\n for(var i=0 in mq){\r\n if(mq[i]!=''){\r\n\t var par=getById('mq_'+mq[i]);\r\n\t SimulateMouse(par, 'click');\r\n\t}\r\n } \r\n}", "title": "" }, { "docid": "04b30a3177eddaea1cf899c64bc69bbd", "score": "0.57369816", "text": "function seleccionarFila(e) {\n elementId = e.target.id;\n $('#' + elementId).toggleClass('table-seleccion');\n if ($('#' + elementId).hasClass('table-seleccion')) {\n // Guardo id de evento\n eventos.push(elementId);\n } else {\n // Elimino id de evento\n eventos.splice($.inArray(elementId, eventos), 1);\n }\n}", "title": "" }, { "docid": "8486dc460b5d28e783bfaa14f0225b70", "score": "0.5732731", "text": "function selectRemoveEventListeners(){\n const selectItems = document.getElementsByClassName(\"selectItem\")\n for(let i = 0; i < selectItems.length; i++){\n selectItems[i].removeEventListener(\"click\", setSelected)\n selectItems[i].removeEventListener(\"keypress\", setSelectedKey)\n\n }\n}", "title": "" }, { "docid": "a88141bb795b639bad3a44c62a770076", "score": "0.5732593", "text": "function deselectItems() {\n $j(\"#open_item\").addClass(\"disabled\");\n $j(\"#go_to_item_location\").addClass(\"disabled\");\n $j(\"#delete_item\").addClass(\"disabled\");\n $j(\".item.selected\").removeClass(\"selected\");\n }", "title": "" }, { "docid": "129a8e47b42f29723a7459ab67ec4499", "score": "0.57297564", "text": "function fnl_nuevo()\n{\n document.getElementById(\"orden\").selectedIndex = 0;\n document.getElementById(\"vc_descripcion\").value = \"\";\n var objAviso = $(\".textAviso\").html();\n\t$(\".textAviso\").css(\"display\",\"none\");\n}", "title": "" }, { "docid": "f59cceb9e6453a8a818f169bf6e26310", "score": "0.5728976", "text": "function desactivarCartas() {\n primeraCarta.removeEventListener('click', invertirCarta);\n segundaCarta.removeEventListener('click', invertirCarta);\n cont++; // Contador\n // Actualiza el contador de aciertos\n document.getElementById(\"input\").value = cont;\n // la añade la clase acertado para que se ponga el borde en verde\n primeraCarta.classList.add('acertado');\n segundaCarta.classList.add('acertado');\n resetBoard();\n}", "title": "" }, { "docid": "babfeac9e5692c17af3d0007542685ee", "score": "0.57270086", "text": "function comprobar() {\n pintado = false;\n $('.cambiarBorde').removeClass(\"cambiarBorde\"); //la imagen seleccionada se despinta\n if (letraSelec == letraActual) {\n confirmar();\n \n } else {\n alerta();\n }\n}", "title": "" }, { "docid": "a4652c38773c73d12732ef4988d48d60", "score": "0.57266444", "text": "function deselectSelectedItems() {\n updateSelectedItems();\n select.selected.splice(0, select.selected.length);\n }", "title": "" }, { "docid": "0bd99537f2a4dcb92ce057656a17a1a4", "score": "0.57257", "text": "unselect(id) {\n this.selection.remove(this.selection.get(id));\n }", "title": "" }, { "docid": "abddb05a3e44feeadb9ac0fc4a97b292", "score": "0.5724721", "text": "function drop(ev) {\n ev.preventDefault();\n //conseguir los datos cargados al iniciar el drag\n var data = ev.dataTransfer.getData(\"text\");\n var title = ev.dataTransfer.getData(\"title\");\n var idseccion = ev.dataTransfer.getData(\"idseccion\");\n var idramo = ev.dataTransfer.getData(\"idramo\");\n dragging = false\n // detokenizar y borrar cualquier otra seccion del mismo ramo arrastrado\n data = detokenize(data);\n // revisar si tiene choque de horarios\n var availability = currentSimulation.checkAvailability(data)\n if (availability.isPosible) {\n delSection(idramo)\n setFocus(idramo, idseccion)\n currentSimulation.addRamo({\n idRamo: idramo,\n idSeccion: idseccion,\n horarios: data,\n title: title,\n })\n } else {\n if(confirm(\"Se eliminarán \" + availability.ocurrences.length + \" ramos con tope, ¿Seguro que desea continuar?\")){\n delSection(idramo)\n availability.ocurrences.forEach((ramo) => {\n console.log(ramo)\n delSection(ramo.idRamo)\n })\n setFocus(idramo, idseccion)\n currentSimulation.addRamo({\n idRamo: idramo,\n idSeccion: idseccion,\n horarios: data,\n title: title,\n })\n }\n }\n var newRamo = $('#simulatorSelect').val()\n drawList(newRamo)\n drawHorario()\n}", "title": "" } ]
0d6f18d07eb233616c01bbe5ec4919f6
Starts the subscription service, keeping up the added subscriptions.
[ { "docid": "d2abbab08463a6c6a4405f760ac4310f", "score": "0.603872", "text": "run() {\n if (this._interval) {\n throw new Error('The FirebaseSubscriptionService is already running');\n }\n\n this._interval = setInterval(() => {\n this._keepUpSubscriptions();\n }, SUBSCRIPTION_KEEP_UP_INTERVAL.inMs());\n }", "title": "" } ]
[ { "docid": "3eb1c808167dbdd8a3a816898901a59d", "score": "0.73294234", "text": "async start () {\n\t\tawait this._restoreTopicSubscriptions()\n\n\t\t// Periodically fetch the subscriptions\n\t\twindow.setInterval(() => {\n\t\t\tlet subscriptions = JSON.parse(window.localStorage.getItem('topicSubscriptions') || '{}')\n\n\t\t\tfor (let element of Object.entries(subscriptions)) {\n\t\t\t\tthis.pullFromSubscription(element[1])\n\t\t\t}\n\t\t}, pullInterval)\n\t}", "title": "" }, { "docid": "d61bff02458b21df30e71f2d79d7c650", "score": "0.6460863", "text": "function subscribe(){\n performance.mark('subscribing');\n client.subscribe('payload/empty', function (err) {});\n performance.mark('subscribed');\n performance.measure('subscribing to subscribed', 'subscribing', 'subscribed');\n}", "title": "" }, { "docid": "bfaf463ea15d4e906f31e34a1456d812", "score": "0.64014155", "text": "function Subscription() {\n\n var logger = new Logger('Subscription');\n\n /**\n * Storage keywords for storing subscription settings\n * @type {Object}\n */\n var config = {\n storageKeywords: {\n\n VOIPTN: \"VoipTn\",\n VOIPCREF: \"VoipTnCipherRef\",\n MYPUBLICUSER: \"MyPublicUser\",\n services: 'services',\n serviceName: 'serviceName',\n serviceCatalog: {\n publicId: 'publicId',\n domain: 'domain',\n id: 'id',\n webSocketEndpoints: 'webSocketEndpoints',\n voipTnCipherRef: 'voipTnCipherRef'\n },\n RTCService: {\n Enabled : \"RTCServiceEnabled\",\n Exists : \"RTCServiceExists\",\n ProvisioningState : \"RTCServiceProvisioningState\",\n Uris : \"RTCUris\"\n }\n }\n };\n\n /**\n * Retrieve list of subscribed services\n * @return {Ctl.Promise} CTL promise object\n */\n function getSubscriptionServices() {\n var slRequest = new SubscriptionServiceIdentitiesRequest();\n return Ajax.request(\n slRequest.type,\n slRequest.getRequestUrl(),\n null,\n slRequest.getRequestHeaders()\n );\n }\n\n /**\n * Retrieve details of particular service\n * @param {String} serviceName Name of the service to get details about\n * @param {String} publicId Moniker (public ID) tied to the service\n * @return {Ctl.Promise} CTL promise object\n */\n function getSubscriptionServiceDetails(serviceName, publicId) {\n var seCatalogRequest = new SubscriptionServiceCatalogRequest(serviceName, publicId);\n return Ajax.request(\n seCatalogRequest.type,\n seCatalogRequest.getRequestUrl(),\n null,\n seCatalogRequest.getRequestHeaders()\n );\n }\n\n /**\n * Set services into storage\n * @param {Object} services Object with services\n * @protected\n */\n function setServices(services) {\n Utils.set(config.storageKeywords.services, JSON.stringify(services));\n }\n\n /**\n * Get services from the storage\n * @return {Object} Object with services\n * @protected\n */\n function getServices() {\n return Utils.get(config.storageKeywords.services);\n }\n\n /**\n * Set service catalog details into storage\n * @param {Object} serviceCatalog Object with service details\n */\n function setServiceCatalog(serviceCatalog) {\n Utils.setObject(config.storageKeywords.serviceName, serviceCatalog.productName);\n Utils.setObject(config.storageKeywords.services + '_' + serviceCatalog.productName, serviceCatalog);\n }\n\n /**\n * Get service details\n * @return {Object} Object with service details\n */\n function getServiceCatalog() {\n var serviceName = Utils.getObject(config.storageKeywords.serviceName);\n return Utils.getObject(config.storageKeywords.services + '_' + serviceName);\n }\n\n /**\n * Set moniker (public ID) in storage\n * @param {String} publicId user's public ID (moniker)\n */\n function setPublicId(publicId) {\n Utils.set(config.storageKeywords.serviceCatalog.publicId, publicId);\n }\n\n /**\n * Get moniker (public ID) from storage\n */\n function getPublicId() {\n return Utils.get(config.storageKeywords.serviceCatalog.publicId);\n }\n\n function parseWebRTCServers(uris) {\n\n var parsedServers = [];\n\n if (typeof uris === 'string') {\n uris = uris.replace(/ /g,'');\n try {\n uris = JSON.parse(uris);\n } catch (e) {\n if(uris.indexOf('$') >= 0) {\n uris = uris.split('$');\n }\n }\n }\n\n var addToServerList = function(server) {\n if(parsedServers.indexOf(server) === -1) {\n parsedServers.push(server);\n }\n };\n\n if (uris) {\n for (var key in uris) {\n if (uris.hasOwnProperty(key)) {\n if (uris[key] instanceof Array) {\n for (var i=0; i<uris[key].length; i++) {\n addToServerList(uris[key][i]);\n }\n } else {\n if (typeof uris[key] === 'string') {\n\n try {\n var parsedUris = JSON.parse(uris[key]);\n if (parsedUris instanceof Array) {\n for (var j=0; j<parsedUris.length; j++) {\n var parsedServerList = this.parseWebRTCServers(parsedUris[j]);\n for(var k = 0; k < parsedServerList.length; k++) {\n addToServerList(parsedServerList[k]);\n }\n }\n }\n }\n catch(e) {\n addToServerList(uris[key]);\n }\n } else {\n for (var p in uris[key]) {\n if (uris[key].hasOwnProperty(p)) {\n if (uris[key][p] instanceof Array) {\n for(var m = 0; m < uris[key][p].length; m++) {\n addToServerList(uris[key][p][m]);\n }\n }\n else {\n addToServerList(uris[key][p]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n localStorage.setItem(config.storageKeywords.RTCService.Uris, JSON.stringify(parsedServers));\n }\n\n function setOAuthCredentials(data) {\n\n var dynamicStorage = Utils.getDynamicStorage();\n\n var publicUser = '';\n\n dynamicStorage.setItem(config.storageKeywords.VOIPCREF, data.networkIdentity.authenticationandCipheringReference);\n dynamicStorage.setItem(config.storageKeywords.VOIPTN, data.networkIdentity.moniker);\n\n if(data.rtc) {\n publicUser = data.networkIdentity.moniker + data.rtc.domain;\n parseWebRTCServers(data.rtc.routing);\n }\n else {\n publicUser = data.networkIdentity.moniker;\n }\n\n localStorage.setItem(config.storageKeywords.MYPUBLICUSER, publicUser);\n }\n\n function setCtlIdCredentials(preRegData) {\n\n var dynamicStorage = Utils.getDynamicStorage();\n\n dynamicStorage.setItem(config.storageKeywords.VOIPTN, preRegData.HomePreRegisterResponse.VoipTn);\n dynamicStorage.setItem(config.storageKeywords.VOIPCREF, preRegData.HomePreRegisterResponse.VoipTnCipherRef);\n\n localStorage.setItem(config.storageKeywords.MYPUBLICUSER, preRegData.HomePreRegisterResponse.MyPublicUser);\n localStorage.setItem(config.storageKeywords.RTCService.Exists, preRegData.HomePreRegisterResponse.RTCServiceExists);\n\n parseWebRTCServers(preRegData.HomePreRegisterResponse.VoIPDomainURIs);\n }\n\n this.getSubscriptionServices = getSubscriptionServices;\n this.getSubscriptionServiceDetails = getSubscriptionServiceDetails;\n this.getServiceCatalog = getServiceCatalog;\n this.setServiceCatalog = setServiceCatalog;\n this.setPublicId = setPublicId;\n this.getPublicId = getPublicId;\n this.setCtlIdCredentials = setCtlIdCredentials;\n this.setOAuthCredentials = setOAuthCredentials;\n\n }", "title": "" }, { "docid": "cfce4872cb084d6cfb7a0fcac90f0e65", "score": "0.63745034", "text": "function start() {\n if (started || !isEnabled.value)\n return;\n if (isServer && currentOptions.value.prefetch === false)\n return;\n started = true;\n loading.value = true;\n var client = resolveClient(currentOptions.value.clientId);\n query.value = client.watchQuery(__assign(__assign({ query: currentDocument, variables: currentVariables }, currentOptions.value), isServer ? {\n fetchPolicy: 'network-only'\n } : {}));\n startQuerySubscription();\n if (!isServer && (currentOptions.value.fetchPolicy !== 'no-cache' || currentOptions.value.notifyOnNetworkStatusChange)) {\n var currentResult = query.value.getCurrentResult();\n if (!currentResult.loading || currentOptions.value.notifyOnNetworkStatusChange) {\n onNextResult(currentResult);\n }\n }\n if (!isServer) {\n for (var _i = 0, subscribeToMoreItems_1 = subscribeToMoreItems; _i < subscribeToMoreItems_1.length; _i++) {\n var item = subscribeToMoreItems_1[_i];\n addSubscribeToMore(item);\n }\n }\n }", "title": "" }, { "docid": "02ff76f18ce44d7d2f16989de71e2963", "score": "0.6343522", "text": "async start() {\n this.setState({ isRunning: true }, async () => {\n const response = await this._apiClient.zmqSubscribe({ events: ['tx'] }, (_, data) => {\n this.props.callback({ ...data });\n });\n\n this._subscriptions = [];\n if (response.subscriptionIds) {\n this._subscriptions.push({ event: 'tx', subscriptionId: response.subscriptionIds[0] });\n }\n });\n }", "title": "" }, { "docid": "281a5d76e68e3c3d25b4521d86c51a23", "score": "0.627653", "text": "async initSubscriptions() {\n\n }", "title": "" }, { "docid": "ea717a715866a3958fd4ae1cadf99dd4", "score": "0.6086698", "text": "constructor() {\n this.subscriptions = {}\n }", "title": "" }, { "docid": "195cf5baf0bcc25937993bcc1074c71c", "score": "0.60677946", "text": "function subscribe() {\n if( !supportsDesktopNotifications() ) { return; }\n navigator.serviceWorker.register('/serviceWorker.js').then(function() {\n return navigator.serviceWorker.ready;\n }).then(function(reg) {\n reg.pushManager.subscribe({\n userVisibleOnly: true\n }).then(function(sub) {\n if( !sub.endpoint ) { return console.error(\"Endpoint not provided\", sub); }\n var subscriptionId = sub.endpoint.split('/').slice(-1)[0];\n return fetch('/subscriptions', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({fcm_id: subscriptionId})\n }).then(function(res) {\n if( res.status > 299 ) { return console.error(\"Received unexpected status\", res.status); }\n console.log(\"Subscribed\", subscriptionId);\n window.localStorage && window.localStorage.setItem('subscribed', 1);\n $(document).find('.js-notifications').html(\"Thanks!\");\n }).catch(function(err) {\n console.error(\"Error adding subscription\", err);\n })\n }).catch(function(err) {\n console.error(\"Push subscription error :(\", err);\n });\n }).catch(function(err) {\n console.error(\"Service worker error :(\", err)\n })\n }", "title": "" }, { "docid": "a8284e867f72504d9ff39678a9961ae5", "score": "0.5993754", "text": "function startService() {\n $log.log(TAG + 'starting');\n running = true;\n }", "title": "" }, { "docid": "9fc88f63454f8216fc7e8bbd8dc58ce7", "score": "0.5919504", "text": "function startService() {\n $log.log(TAG + 'starting.');\n running = true;\n }", "title": "" }, { "docid": "1538f85f53d8e60ba1156f167910e353", "score": "0.591273", "text": "function requestSubs() {\n loadingProgress(1);\n buildServerRequest(\"/subscriptions\", {\"maxResults\": config.maxSimSubLoad})\n .then(processRequestSubs);\n}", "title": "" }, { "docid": "fa31067bfc5654a190a88b2a5505ee10", "score": "0.5871652", "text": "subscribe() {\n this.unsubscribe();\n this.sub_list.map(\n (value) => this.subscriptions.push(\n this.eventbus.subscribe(value[0], value[1])\n ));\n }", "title": "" }, { "docid": "8cc981b019eddfb2c3363dd955be829e", "score": "0.5854773", "text": "constructor() { \n \n Subscriptions.initialize(this);\n }", "title": "" }, { "docid": "c583188d8006966ec7c346bf0c7f561a", "score": "0.58493906", "text": "start() {\n // handle old polls\n if (this.pollHandle) {\n clearInterval(this.pollHandle);\n this.pollHandle = 0;\n }\n // start polling\n this.pollHandle = setInterval(this.poll, this.pollFrequency);\n }", "title": "" }, { "docid": "f85fb258c124d6a8f9c9d6b44954b05f", "score": "0.58326244", "text": "subscribe() {\n this.subscriptionID = this.client.subscribe(this.channel, this.onNewData)\n this.currencyCollection.subscribe(this.render)\n this.currencyCollection.subscribe(this.drawInitialSparkLine)\n this.currencyCollection.subscribeToSparkLineEvent(this.drawSparkLine)\n }", "title": "" }, { "docid": "30d3f4cd4495f58f18eb19b4de5f242a", "score": "0.5795691", "text": "function start() {\n listen();\n}", "title": "" }, { "docid": "99fbd4f5f4b985b371292b57e6e8224f", "score": "0.57762784", "text": "start() {\n this._scheduler.start();\n this._queues.start();\n }", "title": "" }, { "docid": "0e27519987f12c76584bd41b470f34a1", "score": "0.57663316", "text": "initService() {\n\t\tthis.settings = new ServiceSettings();\n\t\tthis.service = new Service({\n\t\t\tonDisconnect: (hadError) => {\n\t\t\t\tthis.stopCancellableQueues(!!hadError, !!hadError);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5ce8f7459e43f1f652f357db3fd065f9", "score": "0.5766183", "text": "function start () {\n listen()\n}", "title": "" }, { "docid": "ec48132697ffade18934a5ed9eea4662", "score": "0.574291", "text": "start() {\n\t\tthis.registerListeners();\n\t}", "title": "" }, { "docid": "eaa48214a5b3f8b804e1ec53fd9ddc57", "score": "0.573341", "text": "_subscribe(subscription) {\n return new Promise((resolve, reject) => {\n let watcherInfo = this._getWatcherInfo(subscription);\n\n // create the 'bare' options w/o 'since' or relative_root.\n // Store in watcherInfo for later use if we need to reset\n // things after an 'end' caught here.\n let options = watcherInfo.watchmanWatcher.createOptions();\n watcherInfo.options = options;\n\n // Dup the options object so we can add 'relative_root' and 'since'\n // and leave the original options object alone. We'll do this again\n // later if we need to resubscribe after 'end' and reconnect.\n options = Object.assign({}, options);\n\n if (this._relative_root) {\n options.relative_root = watcherInfo.relativePath;\n }\n\n options.since = watcherInfo.since;\n\n this._client.command(\n ['subscribe', watcherInfo.root, subscription, options],\n (error, resp) => {\n if (error) {\n reject(error);\n } else {\n resolve(resp);\n }\n }\n );\n });\n }", "title": "" }, { "docid": "094fd0c156e77762e06fa4ee71dda07a", "score": "0.5709369", "text": "start() {\n\t\t// Call service `started` handlers\n\t\tthis.services.forEach(service => {\n\t\t\tif (service && service.schema && isFunction(service.schema.started)) {\n\t\t\t\tservice.schema.started.call(service);\n\t\t\t}\n\t\t});\n\n\t\tif (this.options.metrics && this.options.metricsSendInterval > 0) {\n\t\t\tthis.metricsTimer = setInterval(() => {\n\t\t\t\t// Send event with node health info\n\t\t\t\tthis.getNodeHealthInfo().then(data => this.emit(\"metrics.node.health\", data));\n\n\t\t\t\t// Send event with node statistics\n\t\t\t\tif (this.statistics)\n\t\t\t\t\tthis.emit(\"metrics.node.stats\", this.statistics.snapshot());\n\t\t\t}, this.options.metricsSendInterval);\n\t\t\tthis.metricsTimer.unref();\n\t\t}\n\n\t\tthis.logger.info(\"Broker started.\");\n\n\t\tif (this.transit) {\n\t\t\treturn this.transit.connect().then(() => {\n\t\t\t\t\n\t\t\t\t// Start timers\n\t\t\t\tthis.heartBeatTimer = setInterval(() => {\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tthis.transit.sendHeartbeat();\n\t\t\t\t}, this.options.heartbeatInterval * 1000);\n\t\t\t\tthis.heartBeatTimer.unref();\n\n\t\t\t\tthis.checkNodesTimer = setInterval(() => {\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tthis.checkRemoteNodes();\n\t\t\t\t}, this.options.heartbeatTimeout * 1000);\n\t\t\t\tthis.checkNodesTimer.unref();\t\t\t\n\t\t\t});\n\t\t}\n\t\telse\n\t\t\treturn Promise.resolve();\n\t}", "title": "" }, { "docid": "a48d5e1f23205524c1a54ae86c93436f", "score": "0.5657824", "text": "listen() {\n const subscription = this.client.subscribe(\n this.subject,\n this.queueGroupName,\n this.subscriptionOptions()\n );\n\n subscription.on('message', (msg) => {\n console.log(\n 'Message Received: ' + this.subject + '/' + this.queueGroupName\n );\n\n const parsedData = this.parseMessage(msg);\n this.onMessage(parsedData, msg);\n });\n }", "title": "" }, { "docid": "df4ffda17a906d92eb2a20240cdd43a5", "score": "0.5655148", "text": "subscribe(path, initialDataGetter = defaultDataGetter, cleanup) {\n if (this.subscriptions.has(path)) {\n throw new Error('duplicate persistent subscription: ' + path)\n }\n\n this.subscriptions = this.subscriptions.set(path, {\n getter: initialDataGetter,\n cleanup,\n })\n for (const socket of this.sockets) {\n this.nydus.subscribeClient(socket, path, initialDataGetter(this, socket))\n }\n }", "title": "" }, { "docid": "1857fa2aeb44f8798ac746aabffb493a", "score": "0.56189865", "text": "start() {\n (0, rxjs_1.interval)(exports.NativeCardServiceUpdateInterval).pipe((0, operators_1.takeUntil)(this.statusSubject)).subscribe(() => {\n try {\n this.service.update();\n }\n catch (e) {\n this.serviceSubject.error(e);\n }\n });\n }", "title": "" }, { "docid": "55cd6986ccf90174318a1c1526994784", "score": "0.558568", "text": "listenForServices() {\n console.debug(\"dependency manager: listenForServices in \" + this.name);\n // wait until the microkernel stage is done so pubsub responders are available\n systemManagerClient_1.default.waitForBootStage(\"kernel\", \"stageEntered\", () => {\n this.RouterClient.subscribe(constants_1.SERVICES_STATE_CHANNEL, (err, event) => {\n this.onServiceStateChange(event.data);\n });\n // TODO: The pubsub responder doesnt seem to work here. IT works for the above when not closing.\n this.RouterClient.addListener(constants_1.SERVICE_CLOSED_CHANNEL, (err, event) => {\n let services = {};\n services[event.data.name] = {\n state: \"closed\"\n };\n this.onServiceStateChange(services);\n });\n this.RouterClient.subscribe(constants_1.APPLICATION_STATE_CHANNEL, (err, response) => {\n switch (response.data.state) {\n //authenticated will only be caught by components/services that are up before auth does its thing. Otherwise, a component/service coming up will have the 'ready' application state. In either case, we need to do the things below. But only once.\n case \"authenticated\":\n case \"ready\":\n break;\n case \"closing\":\n this.shutdown.checkDependencies();\n break;\n }\n });\n });\n }", "title": "" }, { "docid": "77634c75ce63a56f84ebac6d1e4b6a2c", "score": "0.5540583", "text": "streamingStart( subscriber ) {\n var id = this.getClientId(subscriber);\n console.log(\"Stream started for client \"+id)\n for ( var i = 0; i < this.clients.length; i++) {\n var client = this.clients[i];\n if ( client.id == id ) {\n // matched\n this.attachAudioStream(client.streamToMesh, this.getStream(subscriber));\n //this.clients.splice(i,1); // too eager, we may need to keep it for another stream\n console.log(\"Audio/video stream started for avatar of client \"+id)\n this.attachVideoStream(client, subscriber);\n break;\n }\n }\n this.subscribers.push(subscriber);\n }", "title": "" }, { "docid": "e7f1ce3d18fcc8457d99dd968b32e0eb", "score": "0.5532502", "text": "subscribe(mainWindow: BrowserWindow) {\n mainLog.info('Subscribing to Lightning gRPC streams')\n this.mainWindow = mainWindow\n\n this.subscriptions.channelGraph = subscribeToChannelGraph.call(this)\n this.subscriptions.invoices = subscribeToInvoices.call(this)\n this.subscriptions.transactions = subscribeToTransactions.call(this)\n }", "title": "" }, { "docid": "276bba42d0a8da7cae3a47fc31b90d41", "score": "0.54734975", "text": "start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n }", "title": "" }, { "docid": "d0f3de7ded93b8de200a051fa049d872", "score": "0.5461023", "text": "function startSSE() {\n\tauroraAPI.startSSE(function (data, error) {\n\t\t\tif (error) adapter.log.error(error);\n\t\t\telse {\n\t\t\t\tadapter.log.debug(\"SSE data '\" + JSON.stringify(data) + \"' received!\");\n\t\t\t\tstatusUpdate(false, data);\n\t\t\t}\n\t\t})\n\t\t.then(function () {\n\t\t\tadapter.log.debug(\"SSE subscription started, listening...\");\n\t\t})\n\t\t.catch(function (error) {\n\t\t\tthrow error;\n\t\t});\n}", "title": "" }, { "docid": "4d62cf89b260c87645d3faf9f5adedea", "score": "0.5450875", "text": "startPolling() {\n this.polling.start();\n }", "title": "" }, { "docid": "991243327dd7ef6ff6eaa8e10b1d4bf0", "score": "0.5441854", "text": "start() {\n Backend.init();\n Sessions.init();\n }", "title": "" }, { "docid": "6a0172403051c67ba60e88ead0f6eb6f", "score": "0.5409597", "text": "async onSubConnected() {\n if (process.env.NODE_ENV === \"development\")\n console.log(\"[Subscription] connected\");\n\n this.dispatch(appOperations.setSubscribed({ isSubscribed: true }));\n }", "title": "" }, { "docid": "85961682dc4a533fbf2875830fba9288", "score": "0.5407944", "text": "start() {\n if( !this._started ) {\n for( let wss of this._wss ) {\n wss.on( 'connection', this._handleConnection.bind( this ) );\n }\n // startup callbacks\n const cb = this._onStartCallbacks;\n for( const f of cb ) {\n f( this );\n }\n }\n return this;\n }", "title": "" }, { "docid": "1d92797310e2e102ce0fbca7ead9eba2", "score": "0.54068065", "text": "subscribeToChannels() {\n Object.values(CHANNELS).forEach(channel => {\n this.subscriber.subscribe(channel);\n });\n }", "title": "" }, { "docid": "691ad5dd2aecc5783e940e763372137c", "score": "0.5401077", "text": "subscribe() {\n if(this.subscription) {\n return;\n }\n this.subscription = subscribe(this.messageContext, MESSAGE_CHANNEL, (message) => {\n this.handleMessage(message);\n });\n }", "title": "" }, { "docid": "efb868f1374754591c2ba5388b90948f", "score": "0.5387427", "text": "function startUserStatusSubscription() {\n var icwsUser, payload, userCurrentStatusElement;\n\n // Start listening for IC status changes for the logged in user.\n icwsUser = session.getSessionUser();\n payload = { userIds:[icwsUser] };\n session.sendRequest('PUT', '/messaging/subscriptions/status/user-statuses', payload, function(status, jsonResponse) {\n if (!utilities.isSuccessStatus(status)) {\n console.log('failed to start user status subscription: ', icwsUser, status, jsonResponse)\n }\n });\n}", "title": "" }, { "docid": "d097ca58d156b77983e889224394b544", "score": "0.53639275", "text": "started() {\n\n\t\tthis.app.listen(Number(this.settings.port), err => {\n\t\t\tif (err)\n\t\t\t\treturn this.broker.fatal(err);\n\t\t\tthis.logger.info(`API Server started on port ${this.settings.port}`);\n\t\t});\n\n\t}", "title": "" }, { "docid": "59dd211712199926bffd2ae7ac2e86f8", "score": "0.5354283", "text": "initSubscription() {\n this.subscribe('OPERAND_INPUT', calculatorStore.reduce.bind(calculatorStore));\n this.subscribe('OPERATOR_INPUT', calculatorStore.reduce.bind(calculatorStore));\n this.subscribe('EVALUATE', calculatorStore.reduce.bind(calculatorStore));\n this.subscribe('DISPLAY_RESULT', calculatorStore.reduce.bind(calculatorStore));\n }", "title": "" }, { "docid": "d6995394f5150cc2b75a041c9eebd3e4", "score": "0.53513587", "text": "startService () {\n // Start the service\n this.timerReference = setInterval(() => {\n // Check to see if a password has expired\n this.databaseManagerMongo.crawlTrackedCollection();\n }, this.configurationOptions.serviceInterval);\n }", "title": "" }, { "docid": "fee371395bd242e526576c24d3183a75", "score": "0.5335488", "text": "start() {\n // Start ticking our safety timer. If the whole advertisement\n // thing doesn't resolve within our set time, then screw this.\n this._startSafetyTimer(12000, 'start()');\n\n // Subscribe to the AD_SDK_LOADER_READY event and clear the\n // initial safety timer set within the start of our start() method.\n this.eventBus.subscribe('AD_SDK_LOADER_READY', () => {\n this._clearSafetyTimer('AD_SDK_LOADER_READY');\n });\n\n // Subscribe to AD_SDK_MANAGER_READY, which is a custom event.\n // We will want to start and clear a timer when requestAds()\n // is called until the ads manager has been resolved.\n // As it can happen that an ad request stays on pending.\n // This will cause the IMA SDK adsmanager to do nothing.\n this.eventBus.subscribe('AD_SDK_MANAGER_READY', () => {\n this._clearSafetyTimer('AD_SDK_MANAGER_READY');\n });\n\n // Subscribe to the LOADED event as we will want to clear our initial\n // safety timer, but also start a new one, as sometimes advertisements\n // can have trouble starting.\n this.eventBus.subscribe('LOADED', () => {\n // Start our safety timer every time an ad is loaded.\n // It can happen that an ad loads and starts, but has an error\n // within itself, so we never get an error event from IMA.\n this._clearSafetyTimer('LOADED');\n this._startSafetyTimer(8000, 'LOADED');\n });\n\n // Show the advertisement container.\n this.eventBus.subscribe('CONTENT_PAUSE_REQUESTED', () => {\n this._show();\n });\n\n // Subscribe to the STARTED event, so we can clear the safety timer\n // started from the LOADED event. This is to avoid any problems within\n // an advertisement itself, like when it doesn't start or has\n // a javascript error, which is common with VPAID.\n this.eventBus.subscribe('STARTED', () => {\n this._clearSafetyTimer('STARTED');\n });\n }", "title": "" }, { "docid": "857a034d1e0721b5e08a888df3a9754a", "score": "0.53286403", "text": "async subscribe() {\n var subscription = await this.getSubscription();\n if (!subscription) {\n subscription = await this.registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(this.params.PUBLIC_KEY),\n }).then(subscription => {\n console.log('Subscribed to', subscription.endpoint);\n return subscription;\n });\n return await fetch(this.params.REGISTRATION_URL, {\n method: 'post',\n headers: {'Content-type': 'application/json', Accept: 'application/json'},\n body: JSON.stringify({subscription,}),\n }).then(response => response.json()).then(response => {\n console.log('Subscribed with Notifications server', response);\n return response;\n });\n }\n }", "title": "" }, { "docid": "99ba84e5584873ebb9db699f757c7383", "score": "0.5327102", "text": "function _subscribe() {\n\n _comapiSDK.on(\"conversationMessageEvent\", function (event) {\n console.log(\"got a conversationMessageEvent\", event);\n if (event.name === \"conversationMessage.sent\") {\n $rootScope.$broadcast(\"conversationMessage.sent\", event.payload);\n }\n });\n\n _comapiSDK.on(\"participantAdded\", function (event) {\n console.log(\"got a participantAdded\", event);\n $rootScope.$broadcast(\"participantAdded\", event);\n });\n\n _comapiSDK.on(\"participantRemoved\", function (event) {\n console.log(\"got a participantRemoved\", event);\n $rootScope.$broadcast(\"participantRemoved\", event);\n });\n\n _comapiSDK.on(\"conversationDeleted\", function (event) {\n console.log(\"got a conversationDeleted\", event);\n $rootScope.$broadcast(\"conversationDeleted\", event);\n });\n\n }", "title": "" }, { "docid": "8b1e794a5be2883fda221a32b2d724ca", "score": "0.530195", "text": "async function start() {\n await hydrate();\n\n new Search(\".search\");\n\n const keywords = new Keywords(\".keywords\");\n searchStore.subscribe(keywords);\n\n const menuDevices = new Devices(\".menu-devices\");\n deviceStore.subscribe(menuDevices);\n dataStore.subscribe(menuDevices);\n\n const menuIngredients = new Ingredients(\".menu-ingredients\");\n dataStore.subscribe(menuIngredients);\n ingredientStore.subscribe(menuIngredients);\n\n const menuUstensils = new Ustensils(\".menu-ustensils\");\n dataStore.subscribe(menuUstensils);\n ustensilStore.subscribe(menuUstensils);\n\n const recipes = new Recipes(\".recipes\");\n dataStore.subscribe(recipes);\n searchStore.subscribe(recipes);\n}", "title": "" }, { "docid": "7d260de85fc1901c0c2e03fb6fdce4e7", "score": "0.5293937", "text": "function Subscriptions(baseUrl, path) {\n if (path === void 0) { path = \"subscriptions\"; }\n return _super.call(this, baseUrl, path) || this;\n }", "title": "" }, { "docid": "7052e136d7467e3f48458f069b6be8ce", "score": "0.5287457", "text": "_renewSubscriptions () {\n let i;\n const subs = new Map(this._subscriptionsById);\n\n this._subscriptionsById.clear();\n this._subscriptionsByKey.clear();\n\n subs.forEach((sub) => {\n i = sub.callbacks.length;\n while (i--) {\n this.subscribe(sub.topic, sub.callbacks[i], sub.advancedOptions);\n }\n });\n }", "title": "" }, { "docid": "8088ab41d9bbba3fe6a65ac6fe6814af", "score": "0.52675116", "text": "start() {\n this._.on('request', this.onRequest.bind(this));\n this._.on('error', this.onError.bind(this));\n this._.on('listening', this.onListening.bind(this));\n\n this._.listen(this.config.port);\n }", "title": "" }, { "docid": "b2f37a66a8f104c7679cdbd90b100dff", "score": "0.52604693", "text": "function handleAPILoaded()\n{\n requestSubscriptionList();\n}", "title": "" }, { "docid": "fa7f3375a8ff088d174c438f1dab6a54", "score": "0.5248669", "text": "start() {\n this.expirationObserver.start();\n }", "title": "" }, { "docid": "a93f40ee3606afa8f857f1307e09ca15", "score": "0.52465445", "text": "function subscribe(request, variables, cacheConfig, observer) {\n const subscriptionId = next_subscription_id++\n subscription_ws.send(JSON.stringify({\n action: 'subscribe',\n subscriptionId,\n query: request.text,\n variables: variables,\n }))\n subscription_ws.onmessage = e => {\n observer.onNext({data: JSON.parse(e.data)})\n }\n subscription_ws.onerror = e => {\n console.log(e)\n // FIXME error handling\n }\n return {\n dispose: () => {\n subscription_ws.send(JSON.stringify({\n action: 'unsubscribe',\n subscriptionId,\n }))\n }\n }\n}", "title": "" }, { "docid": "8a77e5f2ea7ec8fbdadce545f615fbba", "score": "0.52264655", "text": "function main() {\r\n startMicroservice()\r\n registerWithCommMgr()\r\n}", "title": "" }, { "docid": "f89730338320d0e89168f5e033eb7e8a", "score": "0.5219345", "text": "async started () {\n\t\tthis.tortoise\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONCLOSED, () => {\n\t\t\t\tthis.logger.error('Tortoise connection is closed');\n\t\t\t})\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONDISCONNECTED, (error) => {\n\t\t\t\tthis.logger.error('Tortoise connection is disconnected', error);\n\t\t\t})\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONERROR, (error) => {\n\t\t\t\tthis.logger.error('Tortoise connection is error', error);\n\t\t\t});\n\n\t\tawait Promise.all(this.settings.jobs.map((job) => {\n\t\t\treturn this.tortoise\n\t\t\t\t.queue(job.name, { durable: true })\n\t\t\t\t.exchange(this.settings.amqp.exchange, 'direct', job.route, { durable: true })\n\t\t\t\t.prefetch(1)\n\t\t\t\t.subscribe(async (msg, ack, nack) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.broker.call(`${this.name}.${job.method}`, { msg, ack, nack });\n\t\t\t\t\t\tack();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthis.logger.error('Job processing has error', error);\n\t\t\t\t\t\tnack(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}), this);\n\t}", "title": "" }, { "docid": "c832d9a9d126501ead61e6b5d40c3fd5", "score": "0.52183986", "text": "function SubscriptionClient(serviceBus, configuration, transport){\n\t\t\n\t\tvar configuration = configuration;\n\t\tvar subscriptions = [];\n\t\tvar self = this;\n\t\t\n\t\tserviceBus.on(\"urn:message:MassTransit.Services.Subscriptions.Messages:SubscriptionRefresh\", consumeSubscriptionRefresh);\n\t\tserviceBus.on(\"urn:message:MassTransit.Services.Subscriptions.Messages:RemoveSubscription\", consumeSubscriptionRemove);\n\t\tserviceBus.on(\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscription\", \t consumeSubscriptionAdd);\n\t\n\t\t/**\n\t\t *\tRegisters a new client in the pool\n\t\t */\n\t\tfunction addSubscriptionClient(){ \n\n\t\t\tLog.info(\"registering a new client in the pool\");\n\t\t\t\n\t\t\tconfiguration.clientId = Math.uuid().toLowerCase();\n\t\t\t\n\t\t\tvar message = {\n\t\t\t correlationId: configuration.clientId,\n\t\t\t\tcontrolUri\t : configuration.receiveFrom.toString(),\n\t\t\t\tdataUri\t\t : configuration.receiveFrom.toString()\n\t\t\t};\n\t\t\t\n\t\t\ttransport.send({messageType:\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscriptionClient\", message:message });\n\t\t}\n\n\t\t/**\n\t\t *\tRegisters a new subscription\n\t\t */\n\t\tfunction addSubscription(messageName){ \n\n\t\t\tLog.info(\"adding a message consumer for: \" + messageName);\n\t\t\n\t\t\tvar message = {\n\t\t\t\tsubscription: {\n\t\t\t\t\tclientId: configuration.clientId,\n\t\t\t\t\tsequenceNumber: 1,\n\t\t\t\t\tmessageName: messageName,\n\t\t\t\t\tendpointUri: configuration.receiveFrom.toString(),\n\t\t\t\t\tsubscriptionId: Math.uuid() }};\n\n\t\t\ttransport.send({ messageType:\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscription\", message:message });\n\t\t}\n\t\t\n\t\t/**\n\t\t *\tConsume incomming subscription refresh messages\n\t\t */\n\t\tfunction consumeSubscriptionRefresh(message){\n\t\t\n\t\t\tLog.info(\"subscription refresh handling\");\n\t\t\n\t\t\t_.each(message.subscriptions, function(val){\n\t\t\t\tLog.info(\"subscription add: \" + val.messageName + \" from \" + val.endpointUri);\n\t\t\t\t// check for duplicates\n\t\t\t\tif( _.filter(subscriptions, function(v){return v.subscriptionId == val.subscriptionId}).length == 0){\n\t\t\t\t\tsubscriptions.push(val);\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\t\tthis.emit('subscriptionClientReady');\n\t\t}\n\n\t\t/**\n\t\t *\tConsume incomming subscription remove messages\n\t\t */\n\t\tfunction consumeSubscriptionRemove(message){\n\t\t\tLog.info(\"subscription remove handling: \" + message.subscription.messageName + \" from \" + message.subscription.endpointUri);\n\t\t\tsubscriptions = _.filter(subscriptions, function(v){ return v.subscriptionId != message.subscription.subscriptionId})\n\t\t}\n\n\t\t/**\n\t\t *\tConsume incomming subscription add messages\n\t\t */\n\t\tfunction consumeSubscriptionAdd(message){\n\t\t\tLog.info(\"subscription add handling: \" + message.subscription.messageName + \" from \" + message.subscription.endpointUri);\n\t\t\tif( _.filter(subscriptions, function(v){ return v.subscriptionId == message.subscription.subscriptionId}).length == 0)\n\t\t\t\tsubscriptions.push(message.subscription);\n\t\t}\n\t\t\n\t\t/**\n\t\t *\tGets the list of subscriptions\n\t\t */\n\t\tfunction getSubscriptions(){\n\t\t\treturn subscriptions;\n\t\t}\n\t\t\n\t\tthis.addSubscription = addSubscription;\n\t\tthis.addSubscriptionClient = addSubscriptionClient;\n\t\tthis.getSubscriptions = getSubscriptions;\n\t}", "title": "" }, { "docid": "8a5aa0f4f76626f03e88f8134aa3e301", "score": "0.5217205", "text": "subscribe() {}", "title": "" }, { "docid": "4c7b4c4b43ce8306457f4e1b6a19ddd4", "score": "0.5215866", "text": "function subscribe($scope) {\n socket.on('create reach', function (item) {\n listContainer.push(item);\n\n if (typeof(onListChangedFn) !== 'undefined') {\n onListChangedFn(listContainer);\n }\n });\n\n // Clean up.\n if(typeof($scope) !== 'undefined') {\n $scope.$on(\"$destroy\", function () {\n unsubscribe();\n });\n }\n }", "title": "" }, { "docid": "0ad177897cb1dccc0c325d4c79d3b372", "score": "0.5214425", "text": "activateSubscriptions() {\n this.subscriptions = new CompositeDisposable();\n\n // Register command that toggles this view.\n this.subscriptions.add(\n atom.commands.add('atom-workspace', {\n 'warn-before-quitting:toggle': () => this.toggle()\n })\n );\n }", "title": "" }, { "docid": "f6241b4ec4efe8e151b23ba010a08746", "score": "0.5209971", "text": "function configurePushSub() {\n console.log('Push subscription setup');\n //always check for feature availability\n if (!('serviceWorker' in navigator)) {\n return; //exit, cant listen to push notifications\n }\n\n var reg;\n //get sw registration and all subscriptions\n navigator.serviceWorker.ready\n .then(function(swreg) {\n reg = swreg;\n return swreg.pushManager.getSubscription();\n })\n .then(function(sub) {\n if (sub === null) {\n //create new subscription\n //with web-push package:\n var vapidPublicKey = 'BEwDbohq-fnCLZxm386PV5a1mL1T6071a0Bt7IJdytHo-CUbk7tw0Fo-3OzV5cMjRmAlTwCt_FlyZc-m0DRH7bs';\n var convertedVapidPublicKey = urlBase64ToUint8Array(vapidPublicKey);\n\n //identification for creating push messages\n return reg.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: convertedVapidPublicKey\n });\n } else {\n //we already have subscription\n }\n })\n .then(function(newSub) {\n //push new subscription to server\n fetch('https://pwagram-5acb8.firebaseio.com/subscriptions.json', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify(newSub)\n })\n .then(function(res) {\n if (res.ok) {\n displayConfirmNotification();\n }\n })\n .catch(function(err) {\n console.log('Error creating subscription...', err);\n });\n });\n}", "title": "" }, { "docid": "f022f180075360bebf706931914b55d0", "score": "0.51948273", "text": "start() {\n setInterval(() => {\n this.Services.forEach(function(entry)\n {\n entry.GetStatus();\n }); \n }, 10000);\n }", "title": "" }, { "docid": "a47a5f6a92d17e67ec5f75cb41a84be6", "score": "0.51932466", "text": "start() {\n this.isStarted = true;\n this._startRequest();\n }", "title": "" }, { "docid": "fb55e5beee2485daf2ed48f50b0fd304", "score": "0.51931995", "text": "function addSubscriptionClient(){ \n\n\t\t\tLog.info(\"registering a new client in the pool\");\n\t\t\t\n\t\t\tconfiguration.clientId = Math.uuid().toLowerCase();\n\t\t\t\n\t\t\tvar message = {\n\t\t\t correlationId: configuration.clientId,\n\t\t\t\tcontrolUri\t : configuration.receiveFrom.toString(),\n\t\t\t\tdataUri\t\t : configuration.receiveFrom.toString()\n\t\t\t};\n\t\t\t\n\t\t\ttransport.send({messageType:\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscriptionClient\", message:message });\n\t\t}", "title": "" }, { "docid": "47b1dbdd037fa6904a65dea1b4c8ca72", "score": "0.5192959", "text": "start() {\n this.debug('starting listening to queue');\n this.running = true;\n // Using setTimeout instead of nextTick because we want this to happen\n // after all the other jazz in the event loop happens, rather than starving\n // it by always forcing it to happen before using nextTick\n setTimeout(async () => {\n this.emit('starting');\n await this.__receiveMsg();\n }, 0);\n }", "title": "" }, { "docid": "8380ef71885fd86f61541928f44c93a9", "score": "0.51818424", "text": "static subscribeSubs(subs, props, state) {\n return todosStore.subscribeSubs(subs);\n }", "title": "" }, { "docid": "6839050d56ab7f4a80ec821cde0a823f", "score": "0.5173631", "text": "get subscriptions() {\r\n return new Subscriptions(this);\r\n }", "title": "" }, { "docid": "7b3006f6492f2a94dcb3f8024b9ac302", "score": "0.5143565", "text": "start$() {\n\n //default on error handler\n const onErrorHandler = error => {\n console.error(\"Error handling GraphQl incoming event\", error);\n process.exit(1);\n };\n\n //default onComplete handler\n const onCompleteHandler = () => {\n () => console.log(\"GraphQlService incoming event subscription completed\");\n };\n return Rx.Observable.from(this.getSubscriptionDescriptors())\n .map(aggregateEvent => { return { ...aggregateEvent, onErrorHandler, onCompleteHandler } })\n .map(params => this.subscribeEventHandler(params));\n }", "title": "" }, { "docid": "21015a17d0cd333d85fc425e874374a2", "score": "0.51409435", "text": "async initSubscriptions() {\n const instance = this;\n\n instance.stateManager.subscribe(\"clearSearch\", async d => {\n $(`#${instance.id}`).dropdown('clear', true);\n });\n\n instance.derivedClass && instance.derivedClass.initSubscriptions\n ? instance.derivedClass.initSubscriptions()\n : null;\n }", "title": "" }, { "docid": "4541dcee66a1551d74726a82ec4eb64b", "score": "0.51362485", "text": "start () {\n clearInterval(this._intervalId)\n this._intervalId = setInterval(() => this._sendMessage(), Live_INTERVAL)\n if (this._intervalId.unref) this._intervalId.unref()\n }", "title": "" }, { "docid": "d111e95b551aad999922a1bba1950dc8", "score": "0.51289195", "text": "setupDependencyBootStatusPubSubs() {\n // this is called from initialize() so routerInitial tasks hasn't ran yet, so wait here until router ready.\n routerClientInstance_1.default.onReady(() => {\n // define wildcard responder for all dependency pubsubs and checkpoint pubsubs\n routerClientInstance_1.default.addPubSubResponder(new RegExp(`${_constants_1.STATUS_CHANNEL_BASE}.*`), UNITIALIZED_BOOT_STATE);\n routerClientInstance_1.default.addPubSubResponder(new RegExp(`${_constants_1.CHECKPOINT_CHANNEL_BASE}.*`), UNITIALIZED_BOOT_STATE);\n routerClientInstance_1.default.addPubSubResponder(_constants_1.STAGE_CHANNEL, { stage: \"uninitialized\" });\n });\n }", "title": "" }, { "docid": "83f89e1a956d06e8beea14b51393c681", "score": "0.512732", "text": "function subscribeUser() {\n // TODO 3.4 - subscribe to the push service\n}", "title": "" }, { "docid": "8c19fc0becb263e07bd344bdd3b18a2d", "score": "0.51238495", "text": "start() {\n this.setupDoorbellSocket();\n this.setupMQTT();\n this.initLogin();\n }", "title": "" }, { "docid": "13e7f1351580b4b7aa2b7d3fd4c1a9c2", "score": "0.510627", "text": "function startAPIRequests()\t{\n // Get app configuration.\n loadConfig().then(() => {\n // -> Get save data.\n afterConfigLoaded();\n loadVideoInformation().then(() => {\n // -> start requesting subs.\n requestSubs();\n });\n });\n}", "title": "" }, { "docid": "f95a35fcc4a0f79aa2c5f9dab2c256b7", "score": "0.51002055", "text": "subscribe () {}", "title": "" }, { "docid": "0a4f4eeb01ac2138d577d64e64788425", "score": "0.5090648", "text": "async started() {\n\t\tthis.broker.waitForServices(\"steedos-server\").then(async () => {\n\t\t\tawait this.publicClientJS()\n\t\t});\n\t}", "title": "" }, { "docid": "2df18916fcf29e649a5049c5fa04bc98", "score": "0.5082198", "text": "start(key) {\n var service = _services[key];\n console.warn('Starting service', key, service);\n return service.start();\n }", "title": "" }, { "docid": "755bf87a0b98af000a9ffa5d28193913", "score": "0.5076813", "text": "start() {\n this.broadcast('wc:hello');\n }", "title": "" }, { "docid": "292350743fb6ac70b0b6a5ac58357950", "score": "0.5073148", "text": "async function startService () {\n try {\n app.use(express.json())\n app.use(express.static('public'))\n await startMicroLib()\n reloadCallback()\n startWebServer()\n } catch (e) {\n console.error(e)\n }\n}", "title": "" }, { "docid": "d901fab427c90ad4adb128ea32b9612d", "score": "0.5071025", "text": "function subscribe_all()\r\n{\r\n rt_mon.subscribe('A',{},handle_records);\r\n //sock_send_str('{ \"msg_type\": \"rt_subscribe\", \"request_id\": \"A\" }');\r\n}", "title": "" }, { "docid": "8a3ec178d0d313d4b9fc2a8cf8570625", "score": "0.50638753", "text": "startListening() {\n\t\tthis.server.listen(this.port, () => {\n\t\t\tconsole.log('Server started listening on port', this.port);\n\t\t});\n\t}", "title": "" }, { "docid": "834ccb12fe510ddecc1931ae47d823ee", "score": "0.50539935", "text": "function _subscribe(type, opts) {\n sc.subscribe(type, opts, (err, data) => {\n onCallback(\"Subscribe\", type, err, data);\n });\n\n setListener(type);\n}", "title": "" }, { "docid": "2958df3ec07212f2e64f1f98de53395a", "score": "0.50473225", "text": "start$() {\n //default on error handler\n const onErrorHandler = (error) => {\n ConsoleLogger.e(\"Error handling CQRS incoming event\", error);\n process.exit(1);\n };\n\n //default onComplete handler\n const onCompleteHandler = () => {\n () => ConsoleLogger.e(\"CqrsService incoming action subscription completed\");\n };\n\n return from(Object.keys(this.requestProcessMap)).pipe(\n map((aggregateType) => this.subscribeRequestHandler({ aggregateType, onErrorHandler, onCompleteHandler }))\n );\n }", "title": "" }, { "docid": "82a35320cd3a18d2b7343066929b4a84", "score": "0.5047124", "text": "async start() {\n /**\n * Only start service when service is stopped.\n */\n if (this.state === transport_1.DeviceState.on)\n return;\n debug_1.logger.debug('start nfc service');\n /**\n * Update service state.\n */\n this.state = transport_1.DeviceState.on;\n /**\n * Start native card service.\n */\n pcsc_1.pcsc.start();\n return;\n }", "title": "" }, { "docid": "94e42d5c1734af918ef98288a4de40fc", "score": "0.5040911", "text": "start() {\n\t\tthis._queue = this.config.queue || new Queue(this);\n\t\tthis._player = new Player(this);\n\t\tthis._search = new Search(this);\n\n\t\tthis.volume = new Map();\n\t\tthis.votes = new Map();\n\t\tthis.limits = new Map();\n\t\tthis.playCooldowns = new Map();\n\t\tthis.cooldownTime = 1000;\n\n\t\tthis.schedule('*/5 * * * *', this.runTasks.bind(this));\n\t\tthis.schedule('0,15,30,45 * * * * *', this.updateStats.bind(this));\n\t}", "title": "" }, { "docid": "20088805e6d24df4dd23558729d1cebb", "score": "0.50387454", "text": "function join_subscriptions (subscriptions, params) {\n var s = make_subscription(),\n wait_for = 0,\n deliveries = [],\n ready = [],\n use_array = false,\n x = 0;\n\n if (Array.isArray(subscriptions)) {\n use_array = true;\n } else {\n subscriptions = Array.prototype.slice.call(arguments);\n }\n wait_for = subscriptions.length;\n\n function partial(data, i, status) {\n deliveries[i] = data;\n if (false === status) {\n (use_array ? s.hold.call(s.hold, deliveries) : s.hold.apply(s.hold, deliveries));\n return;\n }\n if (undefined === ready[i]) {\n wait_for -= 1;\n }\n ready[i] = (new Date()).valueOf();\n if (0 === wait_for) {\n ready.forEach(function (item, i, arr) {\n ready[i] = undefined;\n wait_for = subscriptions.length;\n });\n (use_array ? s.deliver.call(s.hold, deliveries) : s.deliver.apply(s.hold, deliveries));\n }\n }\n\n // i substitutes as a unique token to identify\n // the subscription\n subscriptions.forEach(function (el, i, arr) {\n // increase the array to the appropriate size\n // for use in partial above\n deliveries.push(undefined);\n ready.push(undefined);\n el.subscribe(function (data) {\n partial(data, i, true);\n });\n // Hmm... difficult to say how to\n // handle a failure case such as this\n el.miss(function (data) {\n partial(data, i, false);\n });\n });\n return s;\n}", "title": "" }, { "docid": "d1e83a44cd7af7be77a306713a408b7e", "score": "0.5035381", "text": "function start() {\n getTodosFromLs();\n addTodoEventListeners();\n sidebar();\n updateTodaysTodoList();\n calendar();\n}", "title": "" }, { "docid": "b35d7b17ea2da8018d7d33e2f02c4b51", "score": "0.5032021", "text": "function subscribe(data) {\n\t\t\t\tconsole.log(data);\n\t\t\t\treturn Subscriber.save(data).$promise.then(function(success) {\n\t\t\t\t\tconsole.log(success);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "976f700d41ef56330968b96b06c889b1", "score": "0.5018059", "text": "function accountSubscriptionPipe() {\r\n accountSubscription();\r\n}", "title": "" }, { "docid": "9f13fc890f9e1bab6eece98ef1c612ee", "score": "0.501518", "text": "start() {\r\n Utils.log('ttt-pusher start() starting pusher');\r\n this.data.pusherContext && this.data.pusherContext.stop();\r\n if (this.data.detached) {\r\n Utils.log('ttt-pusher start() try to start pusher while component already detached');\r\n return;\r\n }\r\n this.data.pusherContext && this.data.pusherContext.start();\r\n }", "title": "" }, { "docid": "a5f24bc20c9c9e518c78610de95a4334", "score": "0.5006816", "text": "async function startIntervalServices() {\n await startLanIPIntervalService();\n await startLndIntervalService();\n await startImageIntervalService();\n}", "title": "" }, { "docid": "a6e3e9b8f48d8ea9f7e0a917e0636ff9", "score": "0.5002982", "text": "start() {\n logger.info('Starting 😡🐶')\n this._setNetworkConditions()\n this.tickToken = setInterval(() => {\n if (didPause) return\n if (this.currentlyPausedService) return\n const x = Math.random()\n if (x < DOWN_PROBABILITY) {\n this.currentlyPausedService = true\n this._pauseService()\n }\n }, TICK_INTERVAL_SEC * 1000)\n }", "title": "" }, { "docid": "0dc23a6baa1d84289458ded04ea98ddb", "score": "0.4999019", "text": "function hvac_subscribe(args){\n\tconsole.log(args);\n\targs = JSON.parse(args.value);\n\t//Add this node to the list of subscribers\n\n\t//Make sure this is defined if it hasn't been previously.\n\tif(rvi.settings.subscribers == undefined) rvi.settings.subscribers = [];\n\n\tif(rvi.settings.subscribers.indexOf(args['node']) == -1){\n\t\trvi.settings.subscribers.push(args['node']);\n\t\trvi.setRviSettings(rvi.settings);\n\t}\n\tconsole.log(\"Current Subscribers: \");\n\tconsole.log(rvi.settings.subscribers);\n\n\tsendCurrentValues();\n}", "title": "" }, { "docid": "c0f76151a73583b76bbedaab5e8177bc", "score": "0.49918094", "text": "start () {\n // stop old running task\n if (this._worker_executor !== undefined) {\n this.stop()\n }\n debug('Push interactor started')\n this._worker_executor = setInterval(this._worker.bind(this), cst.STATUS_INTERVAL)\n this._ipm2.bus.on('*', this._onPM2Event.bind(this))\n }", "title": "" }, { "docid": "b3cd1d3f591a7aabee3f468e2e2c3845", "score": "0.49916518", "text": "function main() {\n setReqURL()\n startMicroservice()\n registerWithCommMgr()\n}", "title": "" }, { "docid": "e9c085de958e541c7e7e69cab006362f", "score": "0.49893808", "text": "function start() {\n\t\tremoveClear();\n\t\taddRedandYellowListeners();\n\t\taddResetListener();\n\t}", "title": "" }, { "docid": "735605f691ed1e7fff76c5cf7539911a", "score": "0.498723", "text": "function startPeSubscription(m) {\n\n peSubcription = peSubcriptions.find( s => s.getMachine().id === m.id)\n if(!peSubcription) {\n peSubcription = new ProductionEngineSubscription(m)\n peSubcriptions.push(peSubcription);\n }\n\n grpcConnection = grpcConnections.find( c => c.machineId === m.id)\n\n channel = grpcConnection.connection.subscribeProdEngineStatus({ n: -1 });\n channel.on(\"data\", peSubcription.makeUpdater()); \n\n channel.on(\"error\", () => {\n //console.log('Connection lost to ', m.machineId)\n m.connected = false;\n }); \n channel.on(\"end\", () => {\n //console.log('Connection lost to ', m.machineId)\n m.connected = false;\n }); \n\n}", "title": "" }, { "docid": "68fd2c0f52ee3cd56de1a63b8e6cf0ca", "score": "0.49764705", "text": "subscribe() {\n Meteor.subscribe(this.collectionName);\n }", "title": "" }, { "docid": "922cf95ba11e95fc6e389ea790e8808f", "score": "0.49721068", "text": "static async startListening() {\r\n /** @type {CoffeeMaker[]} */\r\n const coffeeMakers = await this.getAll();\r\n \r\n for (let coffeeMaker of coffeeMakers) {\r\n coffeeMaker.startListening();\r\n }\r\n }", "title": "" }, { "docid": "387dbbac704bf76fdf794e211a981ab8", "score": "0.49660122", "text": "function subscribe() {\n const userIds = document.getElementById('userIdSubscribe').value\n client.presence.subscribe(userIds)\n log('Subscribing to: ' + userIds)\n}", "title": "" }, { "docid": "8db00fce42ba7b31ccca414ee7782e25", "score": "0.49617815", "text": "function _startBLEService() {\n SpecialBle.setConfig(config);\n SpecialBle.startBLEService();\n }", "title": "" }, { "docid": "9ab80f456226a271f8b5fe640cb45053", "score": "0.49603677", "text": "async function startLndIntervalService() {\n\n // Only start lnd management if another instance is not already running.\n if (lndManagementInterval !== {} || lndManagementRunning) {\n\n // Run lnd management immediately and then rerun every hour. This makes it more likely that the user skips the\n // initial login modal for lnd.\n await lndManagement();\n lndManagementInterval = setInterval(lndManagement, constants.TIME.ONE_HOUR_IN_MILLIS);\n }\n}", "title": "" }, { "docid": "e83fb2aa8eb4832b4a835922297adda3", "score": "0.49600574", "text": "subscribeOnServer(subscriptionData) {\n let requestData = {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(subscriptionData),\n };\n\n NotificationPushService.fetchServer(new Request(this.apiEndPointSubscribeUser, requestData));\n }", "title": "" }, { "docid": "c167b8727f13af35b08d1a69ca955c6c", "score": "0.49589065", "text": "start() {\n logger.debug(\"Exporter.start()\")\n const that = this\n\n // Create the export directory, if it didn't exists already.\n if (!fs.existsSync(this.config[\"export-dir\"])) {\n logger.debug(`Exporter.start(): creating export directory ${this.config[\"export-dir\"]}`)\n fs.mkdirSync(this.config[\"export-dir\"])\n }\n\n this.bookkeepingStore.initiateBookkeeping()\n .then(() => {\n that.startProcessMessages()\n that.started = true\n })\n .catch((error) => {\n logger.error(`Exporter.start(): Wasn't able to initialize the bookkeeping store due to : \"${error}\".`)\n that.started = false\n })\n }", "title": "" } ]
fcda00f6afbf1b5078ba301f2afb7104
Make a function named isFalsy(input)
[ { "docid": "ca781d8c658d89d4f1ce45990c1afc92", "score": "0.7942607", "text": "function isFalsy(input){\n return input == false;\n}", "title": "" } ]
[ { "docid": "d000905a6d8231dbdfa1804360dc6c6f", "score": "0.77649224", "text": "function isFalsy(input){\n return input == false;\n }", "title": "" }, { "docid": "495ec79d17abecae68c10da19ea1ced2", "score": "0.73364395", "text": "function isFalsy(input){\n if(input === false || input === 0 || input === \"\" || input === null || input === undefined || isNaN(input)){\n return true\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "aaaa13d9d25a9b6f5e0a2a53a13c5965", "score": "0.72694296", "text": "function not(input) {\n if (input === true || input === undefined){\n return false;\n }else{\n return true;\n }\n}", "title": "" }, { "docid": "43e998f72feee1f71aeb089b69b826f1", "score": "0.7055722", "text": "function noNot(input) {\n return !!input;\n }", "title": "" }, { "docid": "b2e740bf6cca3828cd2e38806abb4f2f", "score": "0.7027143", "text": "function notFalsy(n) {\n return !!n;\n}", "title": "" }, { "docid": "89a1507b71cc5c9c895e25918a58dd8f", "score": "0.6931012", "text": "function not(input) {\n return !input;\n }", "title": "" }, { "docid": "6cc77c117d2798250778036e3c14c8e4", "score": "0.6922301", "text": "function isFalse(input) {\n return input === false;\n}", "title": "" }, { "docid": "27c5c70e8e97d205debffd842ad83121", "score": "0.6795056", "text": "function default_not(x) {\n return !x;\n}", "title": "" }, { "docid": "c5209cafb107e65c13d2987ad9bc8465", "score": "0.67781234", "text": "function not(input){\n if(input === true){\n return false;\n\n }else if (input === false){\n return true;\n }\n}", "title": "" }, { "docid": "432fd32478f0b794ca37e2cb48782c6c", "score": "0.6722276", "text": "function isFalsy(val) {\n return !val;\n}", "title": "" }, { "docid": "7bde3a52cef457ca2446d0b5a2cf3373", "score": "0.66342074", "text": "function not(input) {\n // exclamation point is the \"not\" operator\n return !(input);\n}", "title": "" }, { "docid": "f250b25f613360d28ee029cba5c90b8d", "score": "0.6630349", "text": "function not(x) { return !x; }", "title": "" }, { "docid": "29a7e9d3c1d5ec2b0588bf919614488e", "score": "0.6526808", "text": "function unaryNot(input) {\n\t\t\treturn !input;\n\t\t}", "title": "" }, { "docid": "a7407a6f4cb6d84564804eb903eb3223", "score": "0.6459057", "text": "function notNot(input){\n\n}", "title": "" }, { "docid": "824180fa90ca98c7e11a3a730e220857", "score": "0.6389961", "text": "function not(f) {\n return (p) => !f(p);\n}", "title": "" }, { "docid": "2d15bb9f964b621789f36e11bbdb1edd", "score": "0.63647664", "text": "function isTruthy(input){\n if(input === false || input === 0 || input === \"\" || input === null || input === undefined || isNaN(input)){\n return false;\n }else{\n return true;\n }\n}", "title": "" }, { "docid": "81f7fb62b6437805f7d2d34c6902c19b", "score": "0.6350665", "text": "function isTruthy(input) {\n return input == true;\n}", "title": "" }, { "docid": "f8f1f8a7c61a0fd15ac35b0809268045", "score": "0.6330518", "text": "function not(f) {\n return function () {\n var originResult = f.apply(this, arguments);\n return !originResult;\n }\n}", "title": "" }, { "docid": "bfc41fdc91f7d454238f5cebd2d5b495", "score": "0.6322212", "text": "function hasFalsyValue(obj) {\n\n return false;\n}", "title": "" }, { "docid": "0ac24964ba15fdb2a31f728d8f4f59fe", "score": "0.6282282", "text": "_isFalsey(value) {\r\n return !value;\r\n }", "title": "" }, { "docid": "95653317bcf8e021cadb31aebacd52b8", "score": "0.62510985", "text": "function isTruthy(input) {\n return input == true;\n }", "title": "" }, { "docid": "0854afc19727a185e1136a0318338d41", "score": "0.62403524", "text": "function not(x) {\n return !Boolean(x);\n }", "title": "" }, { "docid": "9a2d83b2f85320887dff13d22bc9ffd1", "score": "0.61945057", "text": "function isFalsy() {\n // https://developer.mozilla.org/en-US/docs/Glossary/Falsy\n var value = true;\n\n value = false;\n value = 0;\n value = -0;\n value = '';\n value = \"\";\n value = null;\n value = undefined;\n value = NaN;\n value = [].length;\n\n // En lo posible es mejor ser explicito\n // value = 0\n // if(!value){\n // value = false\n // }\n\n return value;\n}", "title": "" }, { "docid": "1937ad1f46051c842bb0a5f7127da589", "score": "0.61931676", "text": "function unless(test , then){\n if(!test) then();\n}", "title": "" }, { "docid": "e063787cf1e8f5aefcdc32d189affe67", "score": "0.6191358", "text": "function toFalse() {\n return operator_1.or(stringToFalse(), finiteNumberToFalse());\n}", "title": "" }, { "docid": "efd5261f985b5b8e550b0cdbac1f58ff", "score": "0.6155559", "text": "function not(fn) {\n return () => {\n return !fn.apply(null, arguments)\n }\n}", "title": "" }, { "docid": "c9d9fcd6ccd187040ecf8b72e2a95376", "score": "0.61527336", "text": "function isInputEmpty(input) {\n return (input === undefined || typeof (input) === \"boolean\");\n}", "title": "" }, { "docid": "f47de50e2582760bf75635d42dbf48db", "score": "0.6148317", "text": "function unless(test, then){\n // then must be a function\n if(!test) then();\n}", "title": "" }, { "docid": "81b382f641a8962627dbf72e9175a9f0", "score": "0.61369395", "text": "function truthyFalsy(obj){\n return obj.number || obj.string;\n}", "title": "" }, { "docid": "f4540047f5e3b4764dfac9b16559112a", "score": "0.6076791", "text": "function unless(pred, f, x) {\n return ifElse(pred, I, f, x);\n }", "title": "" }, { "docid": "c6289af5423ce8772f9500c4e4c1c599", "score": "0.6045988", "text": "static filterUndef(n) {\n return n !== undefined;\n }", "title": "" }, { "docid": "30aec9595469dba3a08b96b82a4dda40", "score": "0.60240906", "text": "function truthFunction(){\n return function(input,target,replace)\n {\n input = input || \" \";\n input = input.replace(target,replace); //ignore single quotes while giving arguments as parameter\n return input;\n\n };\n }", "title": "" }, { "docid": "2a0d33b75f7949f35fc1e1c90dfa63c0", "score": "0.6019517", "text": "function isItTruthy(param) {\n return param ? 'Input is truthy' : 'Input is falsy';\n}", "title": "" }, { "docid": "09f1b48877b29196a602659ea26e339d", "score": "0.5958879", "text": "function falsyValues(){\n if(null){\n console.log('non falsy')\n }else if (undefined) {\n console.log('non falsy')\n }else if (NaN) {\n console.log('non falsy')\n }else if (0) {\n console.log('non falsy')\n }else if ('') {\n console.log('non falsy')\n } else {\n console.log('Above all are falsy values')\n }\n}", "title": "" }, { "docid": "ba302d77a58fb251335ce0b7eba5eadf", "score": "0.5942272", "text": "function unless(test, then) {\n if(!test) then();\n}", "title": "" }, { "docid": "141fe58172ef4c0771b7b10bd0457921", "score": "0.593002", "text": "function finiteNumberToFalse() {\n return operator_2.pipe(finiteNumberToBoolean(), literal_1.literal(false));\n}", "title": "" }, { "docid": "996576c7743096fd9ca1c18669ab1307", "score": "0.59116805", "text": "function is(x) {\n\treturn !not(x);\n}", "title": "" }, { "docid": "a972cacbc7fe3a8fbf86d89fdb4fd6e8", "score": "0.59012043", "text": "function not(input) {\n return input + \" \" + !input;\n\n}", "title": "" }, { "docid": "4282686950ea6e81707f1dd954ccf184", "score": "0.58936507", "text": "function sc_not(b) {\n return b === false;\n}", "title": "" }, { "docid": "4282686950ea6e81707f1dd954ccf184", "score": "0.58936507", "text": "function sc_not(b) {\n return b === false;\n}", "title": "" }, { "docid": "a8c519cc2bc2be56d100816078f22ed9", "score": "0.5887903", "text": "function noFalsy(value) {\n // Retreive primitive Boolean value based on the element in array currently being tested via filter method\n // This primitive Boolean value equates to false if the value being added is omitted or is 0, -0, null, false, NaN, undefined, or \"\"\n var x = new Boolean(value);\n if (x == false)\n//returning false to the filter method removes the element from the array\n return false;\n //returning true to the filter method keeps the element in the array\n else\n return true;\n }", "title": "" }, { "docid": "087a71ca76f09b5fb70e1a17f54e8415", "score": "0.58800507", "text": "function not(x) {\n return !x.valueOf();\n }", "title": "" }, { "docid": "a48d3f2534ebf2bbaf1955be43f66109", "score": "0.5874804", "text": "_notEmpty(value: string) {\n return Boolean(value || value === 0);\n }", "title": "" }, { "docid": "5b81a1cf57ee0716ebc8dc3f29a0ef55", "score": "0.58622307", "text": "function wrapFalsy(value) {\n if (!value && value != null) {\n var _ref;\n\n return _ref = {}, _ref[FALSY] = true, _ref.value = value, _ref;\n }\n\n return value;\n}", "title": "" }, { "docid": "f9c1bcc21b56002fe478c93b36928aea", "score": "0.5853407", "text": "function not(predicate) {\n return a => !predicate(a);\n}", "title": "" }, { "docid": "3269e52a2a99121562c2fb3f3a97af3a", "score": "0.58402306", "text": "function not(x) {\n\treturn (typeof x === 'undefined')\n\t\t|| (x == null)\n\t\t|| !x;\n}", "title": "" }, { "docid": "3373b56143c536fcbcfa10144990445b", "score": "0.58312243", "text": "function unless(test, then) {\n if (!test) then();\n}", "title": "" }, { "docid": "3373b56143c536fcbcfa10144990445b", "score": "0.58312243", "text": "function unless(test, then) {\n if (!test) then();\n}", "title": "" }, { "docid": "3373b56143c536fcbcfa10144990445b", "score": "0.58312243", "text": "function unless(test, then) {\n if (!test) then();\n}", "title": "" }, { "docid": "3373b56143c536fcbcfa10144990445b", "score": "0.58312243", "text": "function unless(test, then) {\n if (!test) then();\n}", "title": "" }, { "docid": "c4036717706f69b7e22b1a20ead82d72", "score": "0.5816483", "text": "function getFalsyFlags(type){return type.flags&65536/* Union */?getFalsyFlagsOfTypes(type.types):type.flags&32/* StringLiteral */?type.text===\"\"?32/* StringLiteral */:0:type.flags&64/* NumberLiteral */?type.text===\"0\"?64/* NumberLiteral */:0:type.flags&128/* BooleanLiteral */?type===falseType?128/* BooleanLiteral */:0:type.flags&7406/* PossiblyFalsy */;}", "title": "" }, { "docid": "d3877c50e0bcf82c06f987605e0f4047", "score": "0.580335", "text": "function f(p) {\n\t\t return !!p;\n\t\t}", "title": "" }, { "docid": "97a77d7787f72b085f0fed1c1aa960dd", "score": "0.58000684", "text": "function negate(fn) {\n return function() {\n return !fn.apply(null, arguments)\n }\n}", "title": "" }, { "docid": "e3f1aaa0d0e7f7c5c2c3316c7c734d60", "score": "0.5795164", "text": "function f(p) {\n return !!p;\n }", "title": "" }, { "docid": "d28c4a2d12a2e01c09620be10de5bd5c", "score": "0.576605", "text": "function f(p) {\r\n return !!p;\r\n }", "title": "" }, { "docid": "6ad16688ed9f231978c86cb69ef3fabd", "score": "0.57356673", "text": "function inputHasValue(value) {\n return value && value != \"\" && value != undefined;\n}", "title": "" }, { "docid": "40fba133caaef27684749e6dfd37390e", "score": "0.57322234", "text": "function Dy(a){return null!=a&&\"false\"!==\"\"+a}", "title": "" }, { "docid": "5938aa1e6017a74a9d03aef2e2254ef4", "score": "0.5718266", "text": "function isUndef( val ) { return val === void 0; }", "title": "" }, { "docid": "6d8577ea5f9c42e2b5ad793b73717d1b", "score": "0.57105964", "text": "function empty$1(s) {\r\n return (s ? false : true);\r\n}", "title": "" }, { "docid": "28fc28b9a19ddc5a816d468cd079a975", "score": "0.5692077", "text": "function\nXATS2JS_bool_neg\n (b0)\n{ return !b0 ; }", "title": "" }, { "docid": "28fc28b9a19ddc5a816d468cd079a975", "score": "0.5692077", "text": "function\nXATS2JS_bool_neg\n (b0)\n{ return !b0 ; }", "title": "" }, { "docid": "dc39ee42f53c1c1fc3505459128d4fa0", "score": "0.5664857", "text": "function removeFalseVar(value) {\n return Boolean(value);\n}", "title": "" }, { "docid": "e717540c8ce0071c3257a6d3f090324a", "score": "0.56583124", "text": "function False () {\n}", "title": "" }, { "docid": "5a8c0ad0d7b034fae4cb4e232e9d2c9b", "score": "0.5655463", "text": "function not(func) {\n return function() {\n return !func.apply(null, slice.call(arguments));\n };\n }", "title": "" }, { "docid": "5a8c0ad0d7b034fae4cb4e232e9d2c9b", "score": "0.5655463", "text": "function not(func) {\n return function() {\n return !func.apply(null, slice.call(arguments));\n };\n }", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" }, { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.5653294", "text": "function emptyFunction() {}", "title": "" } ]
2dfea8165fb047794c9498c36b3ad952
A nicer version with regex Found at
[ { "docid": "7ad49f714fb3c573a0f87ebbfdfe0e66", "score": "0.0", "text": "function gup() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, \n\t\t\t\t\t function(m,key,value) {\n\t\t\t\t\t\t vars[key] = value;\n\t\t\t\t\t });\n return vars;\n}", "title": "" } ]
[ { "docid": "db0e6994978f21371c2714381a1c2e59", "score": "0.6490275", "text": "function Regexp() {}", "title": "" }, { "docid": "35f9d0aa27d5aa3cdf9efef6e702fce6", "score": "0.6157109", "text": "function adjustRegexLiteral(e,t){\"use strict\";e===\"value\"&&t instanceof RegExp&&(t=t.toString());return t}", "title": "" }, { "docid": "d6bfb524f10abf4201032cd924ccdb08", "score": "0.61398613", "text": "transform($input){\n return String($input).length>0 ? new RegExp($input,'i'):undefined;\n }", "title": "" }, { "docid": "6d97ca731b9bee2148e2415663beafe2", "score": "0.61107576", "text": "function e(a){var b=/^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\\\(.)/g,\"$1\"):\"\"}", "title": "" }, { "docid": "ad421ffd32f56903676de926736aa228", "score": "0.6101839", "text": "function h(e,f){var g,h,i,j,k;// IE[78] returns '' for unmatched groups instead of null\nreturn g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||(\"*\"==e[1]?\".*\":null),j=O.type(h||\"string\")||d(O.type(\"string\"),{pattern:new RegExp(h,b.caseInsensitive?\"i\":c)}),{id:g,regexp:h,segment:i,type:j,cfg:k}}", "title": "" }, { "docid": "b0f08ec88f026b187a18ac3914effbd3", "score": "0.60890466", "text": "function e(e,r){return new RegExp(n(e),\"m\"+(t.case_insensitive?\"i\":\"\")+(r?\"g\":\"\"))}", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.60831946", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.60831946", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.60831946", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.60831946", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.60831946", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.60831946", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "14cf3b9b9706df067084096949d1c2b8", "score": "0.5887939", "text": "transform(str) {\n if (str === undefined) {\n return new RegExp('');\n }\n return new RegExp('^' + str.replace(this._re, '\\\\$&').replace(/\\?/g, '.').replace(/\\*/g, '.*') + '$');\n }", "title": "" }, { "docid": "c3a814f184c310e3298624cda9378ac2", "score": "0.5811256", "text": "function patternRegex() {\n\t return /\\$\\{|[ \\t]|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n\t}", "title": "" }, { "docid": "722ed967675e39f9e814d24e11c53719", "score": "0.58087647", "text": "doTransormRegExp (originalRegexp) {\n if (originalRegexp.source.indexOf(dotInternal) !== -1) {\n if (this.logger.mustDo('logging')) {\n console.log(`doTransormRegExp: skip converting for |${originalRegexp}|`)\n }\n return originalRegexp\n }\n return this.dotForger.doForgeDots(originalRegexp)\n }", "title": "" }, { "docid": "60db2ab7c7b154eaefbf8a745e52f332", "score": "0.578725", "text": "getPattern() {\n return /^\\[(\\d+)\\/(\\d+)-(\\d+)@.*\\((.*)\\).*\\]:\\[(.*)\\]\\t (.*)/;\n }", "title": "" }, { "docid": "9621c1c11648be3fa91ad5a3266b2666", "score": "0.5770477", "text": "substitute(e,t){let n=Object.keys(t).map((e)=>e.replace(/[.?*+^$[\\]\\\\(){}|-]/g,'\\\\$&')).join('|'),r=new RegExp('('+n+')','g');return e.replace(r,function(e){return t[e]})}", "title": "" }, { "docid": "58c5143c36d9087e12643e7e0dabd52b", "score": "0.5756812", "text": "function regexVar() {\n \n const re = /^([aeiou]).+\\1$/;\n \n return re;\n}", "title": "" }, { "docid": "5bdc3215ebf49b06ac96664252d35887", "score": "0.5677784", "text": "function s(a){function b(a){return function(b){return b.from===a}}function c(a){var c=n(m(w.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),G(a)?w.type.$normalize(a):q()}", "title": "" }, { "docid": "43c35115fdec855f909603dbd1d9e366", "score": "0.56737095", "text": "function tst(r, s){\r\n /* r = \"^(?:\" + r +\")$\"; */\r\n var reg = new RegExp(r);\r\n console.log(reg.toString());\r\n var t = s.match(reg);\r\n console.log(t.length);\r\n console.log(t.index);\r\n console.log(t);\r\n }", "title": "" }, { "docid": "c8481c813abb4407092173cbfd989899", "score": "0.5663464", "text": "classRegex(c) {\n return new RegExp(\"(^|\\\\s+)\" + c + \"(\\\\s+|$)\");\n }", "title": "" }, { "docid": "1cf8b1f704d9832d1b697ac4186e4443", "score": "0.5652408", "text": "function prepareRegex(regex, flags, input) {\n\n function handleEscapes(regex, i) {\n // Given an integer such as 10, generate the \\u hex escaped form \\u000A\n function toU(code) {\n var h = code.toString(16);\n while (h.length < 4) {\n h = \"0\" + h;\n }\n return \"\\\\u\" + (fullUnicode && h.length > 4 ? \"{\" + h + \"}\" : h);\n }\n\n // Given a monotonic sequence of integers such as (2, 5, 10, 12), treated as\n // a sequence of pairs ((2 - 5), (10 - 12)), generate the set of\n // ranges in regex form \\u0002-\\u0003\\u000A-\\u000C etc\n function expandPairs(bounds) {\n var output = \"\";\n for (var p = 0; p < bounds.length; p += 2) {\n if (fullUnicode || bounds[p + 1] < 65536) {\n output += toU(bounds[p]);\n if (bounds[p + 1] > bounds[p]) {\n output += \"-\" + toU(bounds[p + 1]);\n }\n }\n }\n return output;\n }\n\n // Given a sequence of implicitly-paired integers representing subranges, e.g. (2, 5, 10, 12)\n // representing (2..5, 10..12), generate the inverse ranges, (0..1, 6..9, 13..65535)\n function invertBounds(bounds) {\n var out = [];\n if (bounds[0] !== 0) {\n out.push(0);\n out.push(bounds[0] - 1);\n }\n for (var i = 2; i < bounds.length; i += 2) {\n out.push(bounds[i - 1] + 1);\n out.push(bounds[i] - 1);\n }\n var last = bounds[bounds.length - 1];\n if (fullUnicode || last < 65535) {\n out.push(last + 1);\n out.push(fullUnicode ? 1114111 : 65535);\n }\n return out;\n }\n\n // Expand a sequence of bounds in the form of implicitly-paired integers e.g. [10, 13, 48, 60]\n // meaning (10 to 13, 48 to 60)\n\n function expandIntRanges(bounds, inBrackets, inverse) {\n if (inverse) {\n bounds = invertBounds(bounds);\n }\n var output = expandPairs(bounds);\n if (!inBrackets) {\n output = \"[\" + output + \"]\";\n }\n return output;\n }\n\n // Expand a sequence of bounds in the form of hex strings, e.g [[\"A\", \"D\"], [\"31\", \"3A\"]]\n\n function expandStringRanges(ranges, inBrackets, inverse) {\n var bounds = [];\n ranges.forEach(function (range) {\n bounds.push(parseInt(range[0], 16));\n bounds.push(parseInt(range[1], 16));\n });\n return expandIntRanges(bounds, inBrackets, inverse);\n }\n\n var next = regex.charAt(i + 1);\n if (STRICT && \"nrt\\\\|.-^?*+{}()[]pPsSiIcCdDwW$\".indexOf(next) < 0 && !(bracketDepth === 0 && /[0-9]/.test(next))) {\n error(\"\\\\\" + next + \" is not allowed in XPath regular expressions\");\n }\n if ((next == \"p\" || next == \"P\")) {\n //print(\"found \\\\p{}\");\n var end = regex.indexOf(\"}\", i);\n var cat = regex.substring(i + 3, end);\n if (hasFlag(\"x\")) {\n cat = cat.replace(/[ \\n\\r\\t]+/g, \"\"); //cat = cat.replace(\" \", \"\");\n }\n var regexCE = obtainCategoryEscapes();\n var data = regexCE[cat];\n if (!data) {\n error(\"Unknown category \" + cat);\n }\n var ranges;\n if (cat.length == 1) {\n // e.g. \\P{L}\n ranges = [];\n data.split(\"\\|\").forEach(function (subRange) {\n ranges = ranges.concat(regexCE[subRange]);\n });\n } else {\n ranges = data;\n }\n output += expandStringRanges(ranges, bracketDepth > 0, next == \"P\");\n\n i = end;\n } else if (next == \"d\") {\n output += expandStringRanges(obtainCategoryEscapes().Nd, bracketDepth > 0, false);\n i++;\n } else if (next == \"i\") {\n output += expandIntRanges(iniNameChar, bracketDepth > 0, false);\n i++;\n } else if (next == \"c\") {\n output += expandIntRanges(nameChar, bracketDepth > 0, false);\n i++;\n } else if (next == \"I\") {\n output += expandIntRanges(iniNameChar, bracketDepth > 0, true);\n i++;\n } else if (next == \"C\") {\n output += expandIntRanges(nameChar, bracketDepth > 0, true);\n i++;\n } else if (/[0-9]/.test(next)) {\n if (bracketDepth > 0) {\n error(\"Numeric escape within charclass\");\n } else {\n // TODO: check multi-digit back-references\n if (!rParenClosed[parseInt(next, 10)]) {\n error(\"No capturing expression #\" + next);\n } else {\n print(\"Capture #\" + next + \" ok\");\n }\n output += \"\\\\\" + next;\n i++;\n }\n } else if(next == \"-\" || next==\"$\") {\n output += next;\n i++;\n } else {\n output += \"\\\\\" + next;\n i++;\n }\n return {output: output, i: i};\n }\n\n var STRICT = true;\n\n flags = flags ? flags.toString() : \"\";\n\n if (!fullUnicode && input && Expr.isAstral(input)) {\n throw new XError(\"Cannot handle non-BMP characters with regular expressions in this browser\", \"SXJS0002\");\n }\n //print(\"flags \" + flags);\n function hasFlag(flag) {\n return flags.indexOf(flag) >= 0;\n }\n\n function error(msg) {\n throw new XError(\"Invalid XPath regular expression: \" + msg, \"FORX0002\");\n }\n\n var jsFlags = (hasFlag(\"i\") ? \"i\" : \"\") + (hasFlag(\"m\") ? \"m\" : \"\") + (hasFlag(\"g\") ? \"g\" : \"\") + (fullUnicode ? \"u\" : \"\");\n\n if (hasFlag(\"j\")) {\n // Flag \"j\" means use the regex with JS syntax and semantics\n return new RegExp(regex, flags.replace(\"j\", \"\"));\n }\n if (hasFlag(\"q\")) {\n return new RegExp(regex.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\"), jsFlags);\n }\n var output = \"\";\n var bracketDepth = 0;\n\n var iniNameChar = [\n // Read this as a sequence of start..end pairs representing ranges\n 0x3A, 0x3A, 0x41, 0x5A, 0x5F, 0x5F, 0x61, 0x7A, 0xC0, 0xD6, 0xD8, 0xF6, 0xF8, 0x2FF, 0x370, 0x37D,\n 0x37F, 0x1FFF, 0x200C, 0x200D, 0x2070, 0x218F, 0x2C00, 0x2FEF, 0x3001, 0xD7FF, 0xF900, 0xFDCF,\n 0xFDF0, 0xFFFD, 0x10000, 0xEFFFF\n ];\n var nameChar = [\n // Read this as a sequence of start..end pairs representing ranges\n 0x2D, 0x2E, 0x30, 0x3A, 0x41, 0x5A, 0x5F, 0x5F, 0x61, 0x7A, 0xB7, 0xB7, 0xC0, 0xD6,\n 0xD8, 0xF6, 0xF8, 0x37D, 0x37F, 0x1FFF, 0x200C, 0x200D, 0x203F, 0x2040, 0x2070, 0x218F,\n 0x2C00, 0x2FEF, 0x3001, 0xD7FF, 0xF900, 0xFDCF, 0xFDF0, 0xFFFD, 0x10000, 0xEFFFF\n ];\n\n\n //print(\"PrepareRegex /\" + regex + \"/\");\n\n var parenStack = [];\n var rParenClosed = [];\n var parenNr = 1;\n\n var i;\n for (i = 0; i < regex.length; i++) {\n var c = regex.charAt(i);\n switch (c) {\n case \"[\":\n if (STRICT && bracketDepth > 0) {\n if (regex.charAt(i - 1) == \"-\") {\n error(\"Regex subtraction not implemented\");\n // TODO: rewrite [A-[B]] as (?![B])[A]\n } else {\n error(\"Nested square brackets\");\n }\n }\n if (regex.charAt(i + 1) == \"]\") {\n error(\"Character group is empty\");\n }\n bracketDepth++;\n output += c;\n break;\n case \"]\":\n if (bracketDepth === 0) {\n error(\"Unmatched ']'\");\n }\n bracketDepth--;\n output += c;\n break;\n case \"(\":\n var capture = true;\n if (i + 2 < regex.length) {\n if (regex.charAt(i + 1) == \"?\") {\n if (regex.charAt(i + 2) != \":\") {\n error(\"'(?' must be followed by ':'\");\n } else {\n capture = false;\n }\n }\n }\n parenStack.push(capture ? parenNr++ : -1);\n output += c;\n break;\n case \")\":\n if (parenStack.length === 0) {\n error(\"Unmatched ')'\");\n }\n var closer = parenStack.pop();\n if (closer > 0) {\n rParenClosed[closer] = true;\n }\n output += c;\n break;\n case \".\":\n if (bracketDepth === 0 && hasFlag(\"s\")) {\n output += \"[^]\"; // Matches any (single) character\n } else {\n output += c;\n }\n break;\n case \"{\":\n if (STRICT && regex.charAt(i + 1) == \",\") {\n throw XError(\"{,x} not allowed in XPath regex dialect\", \"FORX0002\");\n }\n output += c;\n break;\n case \" \":\n case \"\\n\":\n case \"\\r\":\n case \"\\t\":\n if (!hasFlag(\"x\") || bracketDepth > 0) {\n output += c;\n }\n break;\n case \"\\\\\":\n //print(\"found escape\");\n if (hasFlag(\"q\")) {\n output += \"\\\\\\\\\";\n } else if (i + 1 < regex.length) {\n var escapes = handleEscapes(regex, i);\n output = escapes.output;\n i = escapes.i;\n } else {\n throw XError(\"No character for escape code in XPath regex\", \"FORX0002\");\n }\n break;\n default:\n output += c;\n }\n }\n if (bracketDepth > 0) {\n error(\"Unmatched '['\");\n }\n if (parenStack.length !== 0) {\n error(\"Unmatched '(\");\n }\n //print(\"Preprocessed regex: \" + output);\n try {\n return new RegExp(output, jsFlags);\n } catch (e) {\n if (/^[imsxjqg]*$/.test(flags)) {\n throw new XError(\"Invalid regular expression /\" + regex + \"/: \" + e.message, \"FORX0002\");\n } else {\n throw new XError(\"Invalid regex flags: \" + flags, \"FORX0001\");\n }\n }\n }", "title": "" }, { "docid": "22a54cb7288df87bfe0c7fabb8792714", "score": "0.5649989", "text": "function ae(e){var t=e.lastIndexOf(\"*\"),r=Math.max(t+1,e.lastIndexOf(\"/\"));return{length:r,regEx:new RegExp(\"^(\"+e.substr(0,r).replace(/[.+?^${}()|[\\]\\\\]/g,\"\\\\$&\").replace(/\\*/g,\"[^\\\\/]+\")+\")(\\\\/|$)\"),wildcard:-1!==t}}", "title": "" }, { "docid": "6776c5bd012d9f0b6a0ea3f261005568", "score": "0.56345975", "text": "function genRegex(regex){\n\tif(regex.length > 1){\n\t\treturn new RegExp(regex[0], regex[1]);\n\t}else if(regex.length == 1){\n\t\treturn new RegExp(regex[0]);\n\t}else{\n\t\treturn /.*/;\n\t}\n}", "title": "" }, { "docid": "71095de1b3b5e23c5c30ddf86594a649", "score": "0.563332", "text": "_matchConstantFormat(line) {\n return line.match(/(.+) is ['\"](.+)['\"]/i);\n }", "title": "" }, { "docid": "da99b4b2511e2c4960f8749803add084", "score": "0.56122243", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n const re = /\\b([aeiou])[a-z]+\\1\\b/i;\n /**\n * \\b - leading word boundary (because the pattern after it matches a word character)\n * ([aeiou]) - Group 1 capturing a vowel from the specified range\n * [a-z]+ - one or more letters (both upper- and lowercase since the /i modifier is used)\n * \\1 - backreference to the vowel captured with the first group\n * \\b - trailing word boundary\n */\n\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "cea310479d015b416bc0a7ca129d29ce", "score": "0.5612113", "text": "function getTextRegex(o) {\n\n var text_for_re = o.text_for_re.replace(/\\+|\\*/g, \"\") || \"\";\n\n var text_for_string = o.text_for_string || \"\";\n var type = o.type;\n var replacement_string = o.replacement_string || \"\";\n\n var match = {};\n var regex;\n\n if (type == undefined) {\n match.string = text_for_string;\n match.re = new RegExp(text_for_re, \"i\");\n\n return match;\n }\n\n if (type === \"title\") {\n regex = /\\,|\\d|\\.|_|(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|(Nov|Dec)(?:ember)?)/g;\n }\n\n if (type === \"body text\") {\n regex = /\\(|\\)|\\+|\\-|−|\\d|_|\\$|(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|(Nov|Dec)(?:ember)?)/g;\n }\n\n if (type === \"helper\") { //used to enter text in input from helper click\n regex = /\\,\\d+|\\d|_|\\$|(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|(Nov|Dec)(?:ember)?)/g;\n }\n\n\n if (type === \"program office\") {\n regex = /\\(|\\)|_/g;\n }\n\n if (type === \"list\") {\n regex = /\\n/g;\n }\n\n match.string = $.trim(text_for_string.replace(regex, replacement_string));\n\n match.re = new RegExp($.trim(text_for_re.replace(regex, replacement_string)), \"i\");\n\n\n\n return match;\n\n}", "title": "" }, { "docid": "76fd9c796dfa64aa79c805a03e61c717", "score": "0.5599228", "text": "function regexVar() {\n // let re = /([0-9])+/g;\n // let re = /\\d+/g;\n // const re = new RegExp(/\\d+/g);\n const re = new RegExp(\"\\\\d+\", \"g\");\n return re;\n}", "title": "" }, { "docid": "76b6ffcd56dec7d28ee5c8a502af4734", "score": "0.55820346", "text": "function a(e){return e.replace((0,s.SPACE_REG_EXP_END)(),\"\").replace((0,s.SPACE_REG_EXP_START)(),\"\")}", "title": "" }, { "docid": "dbd125bd81d16435288b50cfb5e1016e", "score": "0.557022", "text": "function regExpPrefix(re){var prefix=/^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);return prefix != null?prefix[1].replace(/\\\\(.)/g,\"$1\"):'';} // Interpolates matched values into a String.replace()-style pattern", "title": "" }, { "docid": "a7c31cf95b431acb9da0e191b46f618b", "score": "0.55683094", "text": "get basic() {\n return /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/;\n }", "title": "" }, { "docid": "b1455b542954cfdfe004e96791b57911", "score": "0.55682904", "text": "function regExpPrefix(re){var prefix=/^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);return prefix!=null?prefix[1].replace(/\\\\(.)/g,\"$1\"):'';} // Interpolates matched values into a String.replace()-style pattern", "title": "" }, { "docid": "240d8e9d7f3cacbda81ce4ffe2b2d75b", "score": "0.55680084", "text": "function fromRegex (r) {\n\t return function (o) { return typeof o === 'string' && r.test(o) }\n\t}", "title": "" }, { "docid": "240d8e9d7f3cacbda81ce4ffe2b2d75b", "score": "0.55680084", "text": "function fromRegex (r) {\n\t return function (o) { return typeof o === 'string' && r.test(o) }\n\t}", "title": "" }, { "docid": "f2e47d609c814bd5b946c433f22c07d5", "score": "0.5562864", "text": "function fe(e){var t=e.lastIndexOf(\"*\"),r=Math.max(t+1,e.lastIndexOf(\"/\"));return{length:r,regEx:new RegExp(\"^(\"+e.substr(0,r).replace(/[.+?^${}()|[\\]\\\\]/g,\"\\\\$&\").replace(/\\*/g,\"[^\\\\/]+\")+\")(\\\\/|$)\"),wildcard:-1!==t}}", "title": "" }, { "docid": "5e7cee61ddd48eda3eaea520cf4e42c8", "score": "0.5550394", "text": "function getRegEx()\n{\n var str = \"\";\n var pStr = \"\";\n var recordPattern = arguments[0];\n for(i = 1; i < arguments.length; i++)\n {\n var arg = arguments[i];\n if(arg == \"\\\\.\")\n pStr += \".\";\n else\n pStr += arg;\n if(m_constants[arg] != null && m_constants[arg] != undefined && m_constants[arg] != \"\")\n {\n str += m_constants[arg]; \n }\n else\n {\n str += arg;\n }\n }\n \n if(recordPattern)\n m_patternStr[m_patternStrIdx++] = pStr;\n return new RegExp(\"^\" + str + \"$\", \"i\");\n\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.55454403", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.55454403", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.55454403", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.55454403", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.55454403", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "1c570a74ea59f0a46e1101d002f17e5a", "score": "0.55454403", "text": "function patternRegex() {\n return /\\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\\\,(?=.*[{}])|\\/\\.(?=.*[{}])|\\\\\\.(?={)|\\\\{|\\\\}/;\n}", "title": "" }, { "docid": "04136eae84fb00a34b1724944f4e7553", "score": "0.55433977", "text": "function i(t){return t.replace(/[.?*+^$[\\]\\\\(){}|-]/g,\"\\\\$&\")}", "title": "" }, { "docid": "777c453c2676d3c4d54572c711dc2d92", "score": "0.55361414", "text": "function matchReg(s, s1, s2)\n\t\t{\n\t\t\treturn (s1 + (Number(s2) + _extraSize));\n\t\t}", "title": "" }, { "docid": "84fec9839c89f88a35eb571465360c4b", "score": "0.5535979", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts with 'Mr.', 'Mrs.', 'Ms.', 'Dr.', or 'Er.', \n * followed by one or more letters.\n */\n \n const re = new RegExp('^(Mr|Mrs|Ms|Dr|Er)\\\\.[a-zA-Z]+$');\n \n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "4667c980acd1fb15dd68c0424efb1074", "score": "0.5531094", "text": "regex() {\r\n if (this.chars.length === this.consumed) {\r\n return { kind: \"eof\" };\r\n }\r\n\r\n const startAnchor = this.matchesChar(\"^\");\r\n\r\n let value = this.expression();\r\n if (value && value.kind === \"expression\") {\r\n value = value.value;\r\n }\r\n\r\n return {\r\n kind: \"regex\",\r\n startAnchor,\r\n value\r\n };\r\n }", "title": "" }, { "docid": "d139736e97cd69e399996eb48f399893", "score": "0.55276966", "text": "getRegEx(match) {\n const regex = Filter.getRegEx(match);\n if (regex) {\n return new RegExp(regex.text, regex.flags);\n }\n }", "title": "" }, { "docid": "63511e1aa3980c50eb5f58c33ae950a0", "score": "0.55257976", "text": "function sc_pregexp(re) {\n return new RegExp(re);\n}", "title": "" }, { "docid": "bae1691e22ee0bb6f6eb1e60c6d3b464", "score": "0.55024654", "text": "function runRegExpBenchmark() {\n var re0 = /^ba/;\n var re1 = /(((\\w+):\\/\\/)([^\\/:]*)(:(\\d+))?)?([^#?]*)(\\?([^#]*))?(#(.*))?/;\n var re2 = /^\\s*|\\s*$/g;\n var re3 = /\\bQBZPbageby_cynprubyqre\\b/;\n var re4 = /,/;\n var re5 = /\\bQBZPbageby_cynprubyqre\\b/g;\n var re6 = /^[\\s\\xa0]+|[\\s\\xa0]+$/g;\n var re7 = /(\\d*)(\\D*)/g;\n var re8 = /=/;\n var re9 = /(^|\\s)lhv\\-h(\\s|$)/;\n var str0 = 'Zbmvyyn/5.0 (Jvaqbjf; H; Jvaqbjf AG 5.1; ra-HF) NccyrJroXvg/528.9 (XUGZY, yvxr Trpxb) Puebzr/2.0.157.0 Fnsnev/528.9';\n var re10 = /\\#/g;\n var re11 = /\\./g;\n var re12 = /'/g;\n var re13 = /\\?[\\w\\W]*(sevraqvq|punaaryvq|tebhcvq)=([^\\&\\?#]*)/i;\n var str1 = 'Fubpxjnir Synfu 9.0 e115';\n var re14 = /\\s+/g;\n var re15 = /^\\s*(\\S*(\\s+\\S+)*)\\s*$/;\n var re16 = /(-[a-z])/i;\n function runBlock0() {\n for (var i = 0; i < 6511; i++) {\n re0.exec('pyvpx');\n }\n for (var i = 0; i < 1844; i++) {\n re1.exec('uggc://jjj.snprobbx.pbz/ybtva.cuc');\n }\n for (var i = 0; i < 739; i++) {\n 'QBZPbageby_cynprubyqre'.replace(re2, '');\n }\n for (var i = 0; i < 598; i++) {\n re1.exec('uggc://jjj.snprobbx.pbz/');\n }\n for (var i = 0; i < 454; i++) {\n re1.exec('uggc://jjj.snprobbx.pbz/fepu.cuc');\n }\n for (var i = 0; i < 352; i++) {\n /qqqq|qqq|qq|q|ZZZZ|ZZZ|ZZ|Z|llll|ll|l|uu|u|UU|U|zz|z|ff|f|gg|g|sss|ss|s|mmm|mm|m/g.exec('qqqq, ZZZ q, llll');\n }\n for (var i = 0; i < 312; i++) {\n re3.exec('vachggrkg QBZPbageby_cynprubyqre');\n }\n for (var i = 0; i < 282; i++) {\n re4.exec('/ZlFcnprUbzrcntr/Vaqrk-FvgrUbzr,10000000');\n }\n for (var i = 0; i < 177; i++) {\n 'vachggrkg'.replace(re5, '');\n }\n for (var i = 0; i < 170; i++) {\n '528.9'.replace(re6, '');\n re7.exec('528');\n }\n for (var i = 0; i < 156; i++) {\n re8.exec('VCPhygher=ra-HF');\n re8.exec('CersreerqPhygher=ra-HF');\n }\n for (var i = 0; i < 144; i++) {\n re0.exec('xrlcerff');\n }\n for (var i = 0; i < 139; i++) {\n '521'.replace(re6, '');\n re7.exec('521');\n re9.exec('');\n /JroXvg\\/(\\S+)/.exec(str0);\n }\n for (var i = 0; i < 137; i++) {\n 'qvi .so_zrah'.replace(re10, '');\n 'qvi .so_zrah'.replace(/\\[/g, '');\n 'qvi.so_zrah'.replace(re11, '');\n }\n for (var i = 0; i < 117; i++) {\n 'uvqqra_ryrz'.replace(re2, '');\n }\n for (var i = 0; i < 95; i++) {\n /(?:^|;)\\s*sevraqfgre_ynat=([^;]*)/.exec('sevraqfgre_naba=nvq%3Qn6ss9p85n868ro9s059pn854735956o3%26ers%3Q%26df%3Q%26vpgl%3QHF');\n }\n for (var i = 0; i < 93; i++) {\n 'uggc://ubzr.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');\n re13.exec('uggc://ubzr.zlfcnpr.pbz/vaqrk.psz');\n }\n for (var i = 0; i < 92; i++) {\n str1.replace(/([a-zA-Z]|\\s)+/, '');\n }\n for (var i = 0; i < 85; i++) {\n 'svefg'.replace(re14, '');\n 'svefg'.replace(re15, '');\n 'uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');\n 'ynfg'.replace(re14, '');\n 'ynfg'.replace(re15, '');\n re16.exec('qvfcynl');\n re13.exec('uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz');\n }\n }\n var re17 = /(^|[^\\\\])\\\"\\\\\\/Qngr\\((-?[0-9]+)\\)\\\\\\/\\\"/g;\n var str2 = '{\"anzr\":\"\",\"ahzoreSbezng\":{\"PheeraplQrpvznyQvtvgf\":2,\"PheeraplQrpvznyFrcnengbe\":\".\",\"VfErnqBayl\":gehr,\"PheeraplTebhcFvmrf\":[3],\"AhzoreTebhcFvmrf\":[3],\"CrepragTebhcFvmrf\":[3],\"PheeraplTebhcFrcnengbe\":\",\",\"PheeraplFlzoby\":\"\\xa4\",\"AnAFlzoby\":\"AnA\",\"PheeraplArtngvirCnggrea\":0,\"AhzoreArtngvirCnggrea\":1,\"CrepragCbfvgvirCnggrea\":0,\"CrepragArtngvirCnggrea\":0,\"ArtngvirVasvavglFlzoby\":\"-Vasvavgl\",\"ArtngvirFvta\":\"-\",\"AhzoreQrpvznyQvtvgf\":2,\"AhzoreQrpvznyFrcnengbe\":\".\",\"AhzoreTebhcFrcnengbe\":\",\",\"PheeraplCbfvgvirCnggrea\":0,\"CbfvgvirVasvavglFlzoby\":\"Vasvavgl\",\"CbfvgvirFvta\":\"+\",\"CrepragQrpvznyQvtvgf\":2,\"CrepragQrpvznyFrcnengbe\":\".\",\"CrepragTebhcFrcnengbe\":\",\",\"CrepragFlzoby\":\"%\",\"CreZvyyrFlzoby\":\"\\u2030\",\"AngvirQvtvgf\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"],\"QvtvgFhofgvghgvba\":1},\"qngrGvzrSbezng\":{\"NZQrfvtangbe\":\"NZ\",\"Pnyraqne\":{\"ZvaFhccbegrqQngrGvzr\":\"@-62135568000000@\",\"ZnkFhccbegrqQngrGvzr\":\"@253402300799999@\",\"NytbevguzGlcr\":1,\"PnyraqneGlcr\":1,\"Renf\":[1],\"GjbQvtvgLrneZnk\":2029,\"VfErnqBayl\":gehr},\"QngrFrcnengbe\":\"/\",\"SvefgQnlBsJrrx\":0,\"PnyraqneJrrxEhyr\":0,\"ShyyQngrGvzrCnggrea\":\"qqqq, qq ZZZZ llll UU:zz:ff\",\"YbatQngrCnggrea\":\"qqqq, qq ZZZZ llll\",\"YbatGvzrCnggrea\":\"UU:zz:ff\",\"ZbaguQnlCnggrea\":\"ZZZZ qq\",\"CZQrfvtangbe\":\"CZ\",\"ESP1123Cnggrea\":\"qqq, qq ZZZ llll UU\\':\\'zz\\':\\'ff \\'TZG\\'\",\"FubegQngrCnggrea\":\"ZZ/qq/llll\",\"FubegGvzrCnggrea\":\"UU:zz\",\"FbegnoyrQngrGvzrCnggrea\":\"llll\\'-\\'ZZ\\'-\\'qq\\'G\\'UU\\':\\'zz\\':\\'ff\",\"GvzrFrcnengbe\":\":\",\"HavirefnyFbegnoyrQngrGvzrCnggrea\":\"llll\\'-\\'ZZ\\'-\\'qq UU\\':\\'zz\\':\\'ff\\'M\\'\",\"LrneZbaguCnggrea\":\"llll ZZZZ\",\"NooerivngrqQnlAnzrf\":[\"Fha\",\"Zba\",\"Ghr\",\"Jrq\",\"Guh\",\"Sev\",\"Fng\"],\"FubegrfgQnlAnzrf\":[\"Fh\",\"Zb\",\"Gh\",\"Jr\",\"Gu\",\"Se\",\"Fn\"],\"QnlAnzrf\":[\"Fhaqnl\",\"Zbaqnl\",\"Ghrfqnl\",\"Jrqarfqnl\",\"Guhefqnl\",\"Sevqnl\",\"Fngheqnl\"],\"NooerivngrqZbaguAnzrf\":[\"Wna\",\"Sro\",\"Zne\",\"Nce\",\"Znl\",\"Wha\",\"Why\",\"Nht\",\"Frc\",\"Bpg\",\"Abi\",\"Qrp\",\"\"],\"ZbaguAnzrf\":[\"Wnahnel\",\"Sroehnel\",\"Znepu\",\"Ncevy\",\"Znl\",\"Whar\",\"Whyl\",\"Nhthfg\",\"Frcgrzore\",\"Bpgbore\",\"Abirzore\",\"Qrprzore\",\"\"],\"VfErnqBayl\":gehr,\"AngvirPnyraqneAnzr\":\"Tertbevna Pnyraqne\",\"NooerivngrqZbaguTravgvirAnzrf\":[\"Wna\",\"Sro\",\"Zne\",\"Nce\",\"Znl\",\"Wha\",\"Why\",\"Nht\",\"Frc\",\"Bpg\",\"Abi\",\"Qrp\",\"\"],\"ZbaguTravgvirAnzrf\":[\"Wnahnel\",\"Sroehnel\",\"Znepu\",\"Ncevy\",\"Znl\",\"Whar\",\"Whyl\",\"Nhthfg\",\"Frcgrzore\",\"Bpgbore\",\"Abirzore\",\"Qrprzore\",\"\"]}}';\n var str3 = '{\"anzr\":\"ra-HF\",\"ahzoreSbezng\":{\"PheeraplQrpvznyQvtvgf\":2,\"PheeraplQrpvznyFrcnengbe\":\".\",\"VfErnqBayl\":snyfr,\"PheeraplTebhcFvmrf\":[3],\"AhzoreTebhcFvmrf\":[3],\"CrepragTebhcFvmrf\":[3],\"PheeraplTebhcFrcnengbe\":\",\",\"PheeraplFlzoby\":\"$\",\"AnAFlzoby\":\"AnA\",\"PheeraplArtngvirCnggrea\":0,\"AhzoreArtngvirCnggrea\":1,\"CrepragCbfvgvirCnggrea\":0,\"CrepragArtngvirCnggrea\":0,\"ArtngvirVasvavglFlzoby\":\"-Vasvavgl\",\"ArtngvirFvta\":\"-\",\"AhzoreQrpvznyQvtvgf\":2,\"AhzoreQrpvznyFrcnengbe\":\".\",\"AhzoreTebhcFrcnengbe\":\",\",\"PheeraplCbfvgvirCnggrea\":0,\"CbfvgvirVasvavglFlzoby\":\"Vasvavgl\",\"CbfvgvirFvta\":\"+\",\"CrepragQrpvznyQvtvgf\":2,\"CrepragQrpvznyFrcnengbe\":\".\",\"CrepragTebhcFrcnengbe\":\",\",\"CrepragFlzoby\":\"%\",\"CreZvyyrFlzoby\":\"\\u2030\",\"AngvirQvtvgf\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"],\"QvtvgFhofgvghgvba\":1},\"qngrGvzrSbezng\":{\"NZQrfvtangbe\":\"NZ\",\"Pnyraqne\":{\"ZvaFhccbegrqQngrGvzr\":\"@-62135568000000@\",\"ZnkFhccbegrqQngrGvzr\":\"@253402300799999@\",\"NytbevguzGlcr\":1,\"PnyraqneGlcr\":1,\"Renf\":[1],\"GjbQvtvgLrneZnk\":2029,\"VfErnqBayl\":snyfr},\"QngrFrcnengbe\":\"/\",\"SvefgQnlBsJrrx\":0,\"PnyraqneJrrxEhyr\":0,\"ShyyQngrGvzrCnggrea\":\"qqqq, ZZZZ qq, llll u:zz:ff gg\",\"YbatQngrCnggrea\":\"qqqq, ZZZZ qq, llll\",\"YbatGvzrCnggrea\":\"u:zz:ff gg\",\"ZbaguQnlCnggrea\":\"ZZZZ qq\",\"CZQrfvtangbe\":\"CZ\",\"ESP1123Cnggrea\":\"qqq, qq ZZZ llll UU\\':\\'zz\\':\\'ff \\'TZG\\'\",\"FubegQngrCnggrea\":\"Z/q/llll\",\"FubegGvzrCnggrea\":\"u:zz gg\",\"FbegnoyrQngrGvzrCnggrea\":\"llll\\'-\\'ZZ\\'-\\'qq\\'G\\'UU\\':\\'zz\\':\\'ff\",\"GvzrFrcnengbe\":\":\",\"HavirefnyFbegnoyrQngrGvzrCnggrea\":\"llll\\'-\\'ZZ\\'-\\'qq UU\\':\\'zz\\':\\'ff\\'M\\'\",\"LrneZbaguCnggrea\":\"ZZZZ, llll\",\"NooerivngrqQnlAnzrf\":[\"Fha\",\"Zba\",\"Ghr\",\"Jrq\",\"Guh\",\"Sev\",\"Fng\"],\"FubegrfgQnlAnzrf\":[\"Fh\",\"Zb\",\"Gh\",\"Jr\",\"Gu\",\"Se\",\"Fn\"],\"QnlAnzrf\":[\"Fhaqnl\",\"Zbaqnl\",\"Ghrfqnl\",\"Jrqarfqnl\",\"Guhefqnl\",\"Sevqnl\",\"Fngheqnl\"],\"NooerivngrqZbaguAnzrf\":[\"Wna\",\"Sro\",\"Zne\",\"Nce\",\"Znl\",\"Wha\",\"Why\",\"Nht\",\"Frc\",\"Bpg\",\"Abi\",\"Qrp\",\"\"],\"ZbaguAnzrf\":[\"Wnahnel\",\"Sroehnel\",\"Znepu\",\"Ncevy\",\"Znl\",\"Whar\",\"Whyl\",\"Nhthfg\",\"Frcgrzore\",\"Bpgbore\",\"Abirzore\",\"Qrprzore\",\"\"],\"VfErnqBayl\":snyfr,\"AngvirPnyraqneAnzr\":\"Tertbevna Pnyraqne\",\"NooerivngrqZbaguTravgvirAnzrf\":[\"Wna\",\"Sro\",\"Zne\",\"Nce\",\"Znl\",\"Wha\",\"Why\",\"Nht\",\"Frc\",\"Bpg\",\"Abi\",\"Qrp\",\"\"],\"ZbaguTravgvirAnzrf\":[\"Wnahnel\",\"Sroehnel\",\"Znepu\",\"Ncevy\",\"Znl\",\"Whar\",\"Whyl\",\"Nhthfg\",\"Frcgrzore\",\"Bpgbore\",\"Abirzore\",\"Qrprzore\",\"\"]}}';\n var str4 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str5 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var re18 = /^\\s+|\\s+$/g;\n var str6 = 'uggc://jjj.snprobbx.pbz/vaqrk.cuc';\n var re19 = /(?:^|\\s+)ba(?:\\s+|$)/;\n var re20 = /[+, ]/;\n var re21 = /ybnqrq|pbzcyrgr/;\n var str7 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(d1)c=d1.EbyybssCnary;ine bo=IjTrgBow(\"IjCnayNQ_VQ_\"+c);vs(bo&&bo.fglyr.ivfvovyvgl==\"ivfvoyr\"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe(\"U\")+fns,pheL=r.pyvragL+IjBOFpe(\"I\")+fns;ine y=IjBOEC(NQ_VQ,bo,\"Y\"),g=IjBOEC(NQ_VQ,bo,\"G\");ine e=y+d1.Cnaryf[c].Jvqgu,o=g+d1.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,\"\");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z=\"zbhfrzbir\",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(d1&&d1.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(d1)d1.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag(\"ba\"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z=\"zbhfrzbir\",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(d1)d1.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag(\"ba\"+z,s);}pngpu(r){}};;d1.IjTc=d2(n,c){ine nq=d1;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;d1.IjTpy=d2(n,c,p){ine cn=d1.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;d1.IjGenpr=d2(n,f){gel{vs(jvaqbj[\"Ij\"+\"QtQ\"])jvaqbj[\"Ij\"+\"QtQ\"](n,1,f);}pngpu(r){}};;d1.IjYvzvg1=d2(n,f){ine nq=d1,vh=f.fcyvg(\"/\");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+=\"/\";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;d1.IjYvzvg0=d2(n,f){ine nq=d1,vh=f.fcyvg(\"/\");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+=\"/\";nq.OvC+=vh[v];}}};;d1.IjRVST=d2(n,c){jvaqbj[\"IjCnayNQ_VQ_\"+c+\"_Bow\"]=IjTrgBow(\"IjCnayNQ_VQ_\"+c+\"_Bow\");vs(jvaqbj[\"IjCnayNQ_VQ_\"+c+\"_Bow\"]==ahyy)frgGvzrbhg(\"IjRVST(NQ_VQ,\"+c+\")\",d1.rvsg);};;d1.IjNavzSHC=d2(n,c){ine nq=d1;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j==\"100%\"){j=sf;en=snyfr;yn=snyfr;}vs(u==\"100%\"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY==\"Y\")yn=snyfr;vs(cn.YnY==\"E\")en=snyfr;vs(cn.GnY==\"G\")nn=snyfr;vs(cn.GnY==\"O\")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg((\"IjNavzSHC(NQ_VQ,\"+c+\")\"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;d1.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;d1.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&cay.UgU!=\"\"){pyrneGvzrbhg(cay.UgU);}};;d1.IjPnapryNyyGvzrbhgf=d2(n){vs(d1.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<d1.bac;c++)IjPnapryGvzrbhg(n,c);};;d1.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;d1.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny(\"IjFgnegGvzrbhg(NQ_VQ,c\"+(nethzragf.yratgu==3?\",bG\":\"\")+\")\");};;d1.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<d1.bac;c++)IjErfrgGvzrbhg(n,c);};;d1.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny(\"jvaqbj.qrgnpuRirag(\\'ba\"+rig+\"\\',\"+sap+\"NQ_VQ)\");ryfr vs(!IjQVRZnp)riny(\"jvaqbj.erzbirRiragYvfgrare(\\'\"+rig+\"\\',\"+sap+\"NQ_VQ,snyfr)\");}pngpu(r){}};;d1.IjPyrnaHc=d2(n){IjCvat(n,\"G\");ine nq=d1;sbe(ine v=0;v<nq.Cnaryf.yratgu;v++){IjUvqrCnary(n,v,gehr);}gel{IjTrgBow(nq.gya).vaareUGZY=\"\";}pngpu(r){}vs(nq.gya!=nq.gya2)gel{IjTrgBow(nq.gya2).vaareUGZY=\"\";}pngpu(r){}gel{d1=ahyy;}pngpu(r){}gel{IjQrgnpure(n,\"haybnq\",\"IjHayNQ_VQ\");}pngpu(r){}gel{jvaqbj.IjHayNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,\"fpebyy\",\"IjFeNQ_VQ\");}pngpu(r){}gel{jvaqbj.IjFeNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,\"erfvmr\",\"IjEmNQ_VQ\");}pngpu(r){}gel{jvaqbj.IjEmNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n';\n var str8 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow(\"IjCnayNQ_VQ_\"+c);vs(bo&&bo.fglyr.ivfvovyvgl==\"ivfvoyr\"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe(\"U\")+fns,pheL=r.pyvragL+IjBOFpe(\"I\")+fns;ine y=IjBOEC(NQ_VQ,bo,\"Y\"),g=IjBOEC(NQ_VQ,bo,\"G\");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,\"\");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z=\"zbhfrzbir\",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag(\"ba\"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z=\"zbhfrzbir\",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag(\"ba\"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=shapgvba(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=shapgvba(n,f){gel{vs(jvaqbj[\"Ij\"+\"QtQ\"])jvaqbj[\"Ij\"+\"QtQ\"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg(\"/\");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+=\"/\";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg(\"/\");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+=\"/\";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=shapgvba(n,c){jvaqbj[\"IjCnayNQ_VQ_\"+c+\"_Bow\"]=IjTrgBow(\"IjCnayNQ_VQ_\"+c+\"_Bow\");vs(jvaqbj[\"IjCnayNQ_VQ_\"+c+\"_Bow\"]==ahyy)frgGvzrbhg(\"IjRVST(NQ_VQ,\"+c+\")\",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j==\"100%\"){j=sf;en=snyfr;yn=snyfr;}vs(u==\"100%\"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY==\"Y\")yn=snyfr;vs(cn.YnY==\"E\")en=snyfr;vs(cn.GnY==\"G\")nn=snyfr;vs(cn.GnY==\"O\")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg((\"IjNavzSHC(NQ_VQ,\"+c+\")\"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=shapgvba(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=shapgvba(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=\"\"){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=shapgvba(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny(\"IjFgnegGvzrbhg(NQ_VQ,c\"+(nethzragf.yratgu==3?\",bG\":\"\")+\")\");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=shapgvba(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=shapgvba(n,rig,sap){gel{vs(IjQVR5)riny(\"jvaqbj.qrgnpuRirag(\\'ba\"+rig+\"\\',\"+sap+\"NQ_VQ)\");ryfr vs(!IjQVRZnp)riny(\"jvaqbj.erzbir';\n var str9 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow(\"IjCnayNQ_VQ_\"+c);vs(bo&&bo.fglyr.ivfvovyvgl==\"ivfvoyr\"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe(\"U\")+fns,pheL=r.pyvragL+IjBOFpe(\"I\")+fns;ine y=IjBOEC(NQ_VQ,bo,\"Y\"),g=IjBOEC(NQ_VQ,bo,\"G\");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,\"\");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z=\"zbhfrzbir\",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag(\"ba\"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z=\"zbhfrzbir\",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag(\"ba\"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=d2(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=d2(n,f){gel{vs(jvaqbj[\"Ij\"+\"QtQ\"])jvaqbj[\"Ij\"+\"QtQ\"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg(\"/\");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+=\"/\";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg(\"/\");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+=\"/\";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=d2(n,c){jvaqbj[\"IjCnayNQ_VQ_\"+c+\"_Bow\"]=IjTrgBow(\"IjCnayNQ_VQ_\"+c+\"_Bow\");vs(jvaqbj[\"IjCnayNQ_VQ_\"+c+\"_Bow\"]==ahyy)frgGvzrbhg(\"IjRVST(NQ_VQ,\"+c+\")\",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j==\"100%\"){j=sf;en=snyfr;yn=snyfr;}vs(u==\"100%\"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY==\"Y\")yn=snyfr;vs(cn.YnY==\"E\")en=snyfr;vs(cn.GnY==\"G\")nn=snyfr;vs(cn.GnY==\"O\")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg((\"IjNavzSHC(NQ_VQ,\"+c+\")\"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=\"\"){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=d2(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny(\"IjFgnegGvzrbhg(NQ_VQ,c\"+(nethzragf.yratgu==3?\",bG\":\"\")+\")\");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny(\"jvaqbj.qrgnpuRirag(\\'ba\"+rig+\"\\',\"+sap+\"NQ_VQ)\");ryfr vs(!IjQVRZnp)riny(\"jvaqbj.erzbirRiragYvfgrare(\\'\"+rig+\"\\',\"+sap+\"NQ_VQ,snyfr)\");}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjPyrna';\n function runBlock1() {\n for (var i = 0; i < 81; i++) {\n re8.exec('VC=74.125.75.1');\n }\n for (var i = 0; i < 78; i++) {\n '9.0 e115'.replace(/(\\s)+e/, '');\n 'k'.replace(/./, '');\n str2.replace(re17, '');\n str3.replace(re17, '');\n re8.exec('144631658');\n re8.exec('Pbhagel=IIZ%3Q');\n re8.exec('Pbhagel=IIZ=');\n re8.exec('CersreerqPhygherCraqvat=');\n re8.exec(str4);\n re8.exec(str5);\n re8.exec('__hgzp=144631658');\n re8.exec('gvzrMbar=-8');\n re8.exec('gvzrMbar=0');\n /Fnsnev\\/(\\d+\\.\\d+)/.exec(str0);\n re3.exec('vachggrkg QBZPbageby_cynprubyqre');\n re0.exec('xrlqbja');\n re0.exec('xrlhc');\n }\n for (var i = 0; i < 77; i++) {\n 'uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');\n re13.exec('uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz');\n }\n for (var i = 0; i < 73; i++) {\n 'FrffvbaFgbentr=%7O%22GnoThvq%22%3N%7O%22thvq%22%3N1231367125017%7Q%7Q'.replace(re18, '');\n }\n for (var i = 0; i < 72; i++) {\n re1.exec(str6);\n }\n for (var i = 0; i < 71; i++) {\n re19.exec('');\n }\n for (var i = 0; i < 70; i++) {\n '3.5.0.0'.replace(re11, '');\n str7.replace(/d1/g, '');\n str8.replace(/NQ_VQ/g, '');\n str9.replace(/d2/g, '');\n 'NI%3Q1_CI%3Q1_PI%3Q1_EI%3Q1_HI%3Q1_HP%3Q1_IC%3Q0.0.0.0_IH%3Q0'.replace(/_/g, '');\n 'svz_zlfcnpr_ubzrcntr_abgybttrqva,svz_zlfcnpr_aba_HTP,svz_zlfcnpr_havgrq-fgngrf'.split(re20);\n re21.exec('ybnqvat');\n }\n for (var i = 0; i < 68; i++) {\n re1.exec('#');\n /(?:ZFVR.(\\d+\\.\\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\\d+\\.\\d+))|(?:Bcren.(\\d+\\.\\d+))|(?:NccyrJroXvg.(\\d+(?:\\.\\d+)?))/.exec(str0);\n /(Znp BF K)|(Jvaqbjf;)/.exec(str0);\n /Trpxb\\/([0-9]+)/.exec(str0);\n re21.exec('ybnqrq');\n }\n for (var i = 0; i < 49; i++) {\n re16.exec('pbybe');\n }\n for (var i = 0; i < 44; i++) {\n 'uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');\n re13.exec('uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz');\n }\n }\n var re22 = /\\bso_zrah\\b/;\n var re23 = /^(?:(?:[^:\\/?#]+):)?(?:\\/\\/(?:[^\\/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/;\n var re24 = /uggcf?:\\/\\/([^\\/]+\\.)?snprobbx\\.pbz\\//;\n var re25 = /\"/g;\n var re26 = /^([^?#]+)(?:\\?([^#]*))?(#.*)?/;\n function runBlock2() {\n for (var i = 0; i < 40; i++) {\n 'fryrpgrq'.replace(re14, '');\n 'fryrpgrq'.replace(re15, '');\n }\n for (var i = 0; i < 39; i++) {\n 'vachggrkg uvqqra_ryrz'.replace(/\\buvqqra_ryrz\\b/g, '');\n re3.exec('vachggrkg ');\n re3.exec('vachggrkg');\n re22.exec('HVYvaxOhggba');\n re22.exec('HVYvaxOhggba_E');\n re22.exec('HVYvaxOhggba_EJ');\n re22.exec('zrah_ybtva_pbagnvare');\n /\\buvqqra_ryrz\\b/.exec('vachgcnffjbeq');\n }\n for (var i = 0; i < 37; i++) {\n re8.exec('111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904');\n re8.exec('SbeprqRkcvengvba=633669315660164980');\n re8.exec('FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904');\n }\n for (var i = 0; i < 35; i++) {\n 'puvyq p1 svefg'.replace(re14, '');\n 'puvyq p1 svefg'.replace(re15, '');\n 'sylbhg pybfrq'.replace(re14, '');\n 'sylbhg pybfrq'.replace(re15, '');\n }\n for (var i = 0; i < 34; i++) {\n re19.exec('gno2');\n re19.exec('gno3');\n re8.exec('44132r503660');\n re8.exec('SbeprqRkcvengvba=633669316860113296');\n re8.exec('AFP_zp_dfctwzs-aowb_80=44132r503660');\n re8.exec('FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696');\n re8.exec('s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696');\n }\n for (var i = 0; i < 32; i++) {\n /puebzr/i.exec(str0);\n }\n for (var i = 0; i < 31; i++) {\n 'uggc://jjj.snprobbx.pbz/'.replace(re23, '');\n re8.exec('SbeprqRkcvengvba=633669358527244818');\n re8.exec('VC=66.249.85.130');\n re8.exec('FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58');\n re8.exec('s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58');\n re24.exec('uggc://jjj.snprobbx.pbz/');\n }\n for (var i = 0; i < 30; i++) {\n '419'.replace(re6, '');\n /(?:^|\\s+)gvzrfgnzc(?:\\s+|$)/.exec('gvzrfgnzc');\n re7.exec('419');\n }\n for (var i = 0; i < 29; i++) {\n 'uggc://jjj.snprobbx.pbz/ybtva.cuc'.replace(re23, '');\n }\n for (var i = 0; i < 28; i++) {\n 'Funer guvf tnqtrg'.replace(re25, '');\n 'Funer guvf tnqtrg'.replace(re12, '');\n re26.exec('uggc://jjj.tbbtyr.pbz/vt/qverpgbel');\n }\n }\n var re27 = /-\\D/g;\n var re28 = /\\bnpgvingr\\b/;\n var re29 = /%2R/gi;\n var re30 = /%2S/gi;\n var re31 = /^(mu-(PA|GJ)|wn|xb)$/;\n var re32 = /\\s?;\\s?/;\n var re33 = /%\\w?$/;\n var re34 = /TNQP=([^;]*)/i;\n var str10 = 'FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669315660164980&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str11 = 'FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904; __hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1; __hgzo=144631658.0.10.1231363570; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669315660164980&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str12 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231363514065&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231363514065&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Subzr.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1326469221.1231363557&tn_fvq=1231363557&tn_uvq=1114636509&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str13 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669315660164980&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str14 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669315660164980&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var re35 = /[<>]/g;\n var str15 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=44132r503660';\n var str16 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; AFP_zp_dfctwzs-aowb_80=44132r503660; __hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1; __hgzo=144631658.0.10.1231363638; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str17 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231363621014&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231363621014&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=348699119.1231363624&tn_fvq=1231363624&tn_uvq=895511034&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str18 = 'uggc://jjj.yrobapbva.se/yv';\n var str19 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str20 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n function runBlock3() {\n for (var i = 0; i < 27; i++) {\n 'e115'.replace(/[A-Za-z]/g, '');\n }\n for (var i = 0; i < 23; i++) {\n 'qvfcynl'.replace(re27, '');\n 'cbfvgvba'.replace(re27, '');\n }\n for (var i = 0; i < 22; i++) {\n 'unaqyr'.replace(re14, '');\n 'unaqyr'.replace(re15, '');\n 'yvar'.replace(re14, '');\n 'yvar'.replace(re15, '');\n 'cnerag puebzr6 fvatyr1 gno'.replace(re14, '');\n 'cnerag puebzr6 fvatyr1 gno'.replace(re15, '');\n 'fyvqre'.replace(re14, '');\n 'fyvqre'.replace(re15, '');\n re28.exec('');\n }\n for (var i = 0; i < 21; i++) {\n 'uggc://jjj.zlfcnpr.pbz/'.replace(re12, '');\n re13.exec('uggc://jjj.zlfcnpr.pbz/');\n }\n for (var i = 0; i < 20; i++) {\n 'cntrivrj'.replace(re29, '');\n 'cntrivrj'.replace(re30, '');\n re19.exec('ynfg');\n re19.exec('ba svefg');\n re8.exec('VC=74.125.75.3');\n }\n for (var i = 0; i < 19; i++) {\n re31.exec('ra');\n }\n for (var i = 0; i < 18; i++) {\n str10.split(re32);\n str11.split(re32);\n str12.replace(re33, '');\n re8.exec('144631658.0.10.1231363570');\n re8.exec('144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.3426875219718084000.1231363570.1231363570.1231363570.1');\n re8.exec(str13);\n re8.exec(str14);\n re8.exec('__hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1');\n re8.exec('__hgzo=144631658.0.10.1231363570');\n re8.exec('__hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re34.exec(str10);\n re34.exec(str11);\n }\n for (var i = 0; i < 17; i++) {\n str0.match(/zfvr/gi);\n str0.match(/bcren/gi);\n str15.split(re32);\n str16.split(re32);\n 'ohggba'.replace(re14, '');\n 'ohggba'.replace(re15, '');\n 'puvyq p1 svefg sylbhg pybfrq'.replace(re14, '');\n 'puvyq p1 svefg sylbhg pybfrq'.replace(re15, '');\n 'pvgvrf'.replace(re14, '');\n 'pvgvrf'.replace(re15, '');\n 'pybfrq'.replace(re14, '');\n 'pybfrq'.replace(re15, '');\n 'qry'.replace(re14, '');\n 'qry'.replace(re15, '');\n 'uqy_zba'.replace(re14, '');\n 'uqy_zba'.replace(re15, '');\n str17.replace(re33, '');\n str18.replace(/%3P/g, '');\n str18.replace(/%3R/g, '');\n str18.replace(/%3q/g, '');\n str18.replace(re35, '');\n 'yvaxyvfg16'.replace(re14, '');\n 'yvaxyvfg16'.replace(re15, '');\n 'zvahf'.replace(re14, '');\n 'zvahf'.replace(re15, '');\n 'bcra'.replace(re14, '');\n 'bcra'.replace(re15, '');\n 'cnerag puebzr5 fvatyr1 ps NU'.replace(re14, '');\n 'cnerag puebzr5 fvatyr1 ps NU'.replace(re15, '');\n 'cynlre'.replace(re14, '');\n 'cynlre'.replace(re15, '');\n 'cyhf'.replace(re14, '');\n 'cyhf'.replace(re15, '');\n 'cb_uqy'.replace(re14, '');\n 'cb_uqy'.replace(re15, '');\n 'hyJVzt'.replace(re14, '');\n 'hyJVzt'.replace(re15, '');\n re8.exec('144631658.0.10.1231363638');\n re8.exec('144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.965867047679498800.1231363638.1231363638.1231363638.1');\n re8.exec('4413268q3660');\n re8.exec('4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n');\n re8.exec('SbeprqRkcvengvba=633669321699093060');\n re8.exec('VC=74.125.75.20');\n re8.exec(str19);\n re8.exec(str20);\n re8.exec('AFP_zp_tfwsbrg-aowb_80=4413268q3660');\n re8.exec('FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n');\n re8.exec('__hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1');\n re8.exec('__hgzo=144631658.0.10.1231363638');\n re8.exec('__hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re34.exec(str15);\n re34.exec(str16);\n }\n }\n var re36 = /uers|fep|fryrpgrq/;\n var re37 = /\\s*([+>~\\s])\\s*([a-zA-Z#.*:\\[])/g;\n var re38 = /^(\\w+|\\*)$/;\n var str21 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str22 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; __hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1; __hgzo=144631658.0.10.1231367822; __hgzp=144631658; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str23 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367803797&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367803797&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Szrffntvat.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1192552091.1231367807&tn_fvq=1231367807&tn_uvq=1155446857&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str24 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str25 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str26 = 'hy.ynat-fryrpgbe';\n var re39 = /\\\\/g;\n var re40 = / /g;\n var re41 = /\\/\\xc4\\/t/;\n var re42 = /\\/\\xd6\\/t/;\n var re43 = /\\/\\xdc\\/t/;\n var re44 = /\\/\\xdf\\/t/;\n var re45 = /\\/\\xe4\\/t/;\n var re46 = /\\/\\xf6\\/t/;\n var re47 = /\\/\\xfc\\/t/;\n var re48 = /\\W/g;\n var re49 = /uers|fep|fglyr/;\n function runBlock4() {\n for (var i = 0; i < 16; i++) {\n ''.replace(/\\*/g, '');\n /\\bnpgvir\\b/.exec('npgvir');\n /sversbk/i.exec(str0);\n re36.exec('glcr');\n /zfvr/i.exec(str0);\n /bcren/i.exec(str0);\n }\n for (var i = 0; i < 15; i++) {\n str21.split(re32);\n str22.split(re32);\n 'uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');\n str23.replace(re33, '');\n 'yv'.replace(re37, '');\n 'yv'.replace(re18, '');\n re8.exec('144631658.0.10.1231367822');\n re8.exec('144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.4127520630321984500.1231367822.1231367822.1231367822.1');\n re8.exec(str24);\n re8.exec(str25);\n re8.exec('__hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1');\n re8.exec('__hgzo=144631658.0.10.1231367822');\n re8.exec('__hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re34.exec(str21);\n re34.exec(str22);\n /\\.([\\w-]+)|\\[(\\w+)(?:([!*^$~|]?=)[\"']?(.*?)[\"']?)?\\]|:([\\w-]+)(?:\\([\"']?(.*?)?[\"']?\\)|$)/g.exec(str26);\n re13.exec('uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz');\n re38.exec('yv');\n }\n for (var i = 0; i < 14; i++) {\n ''.replace(re18, '');\n '9.0 e115'.replace(/(\\s+e|\\s+o[0-9]+)/, '');\n 'Funer guvf tnqtrg'.replace(/</g, '');\n 'Funer guvf tnqtrg'.replace(/>/g, '');\n 'Funer guvf tnqtrg'.replace(re39, '');\n 'uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz'.replace(re12, '');\n 'grnfre'.replace(re40, '');\n 'grnfre'.replace(re41, '');\n 'grnfre'.replace(re42, '');\n 'grnfre'.replace(re43, '');\n 'grnfre'.replace(re44, '');\n 'grnfre'.replace(re45, '');\n 'grnfre'.replace(re46, '');\n 'grnfre'.replace(re47, '');\n 'grnfre'.replace(re48, '');\n re16.exec('znetva-gbc');\n re16.exec('cbfvgvba');\n re19.exec('gno1');\n re9.exec('qz');\n re9.exec('qg');\n re9.exec('zbqobk');\n re9.exec('zbqobkva');\n re9.exec('zbqgvgyr');\n re13.exec('uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz');\n re26.exec('/vt/znvytnqtrg');\n re49.exec('glcr');\n }\n }\n var re50 = /(?:^|\\s+)fryrpgrq(?:\\s+|$)/;\n var re51 = /\\&/g;\n var re52 = /\\+/g;\n var re53 = /\\?/g;\n var re54 = /\\t/g;\n var re55 = /(\\$\\{nqiHey\\})|(\\$nqiHey\\b)/g;\n var re56 = /(\\$\\{cngu\\})|(\\$cngu\\b)/g;\n function runBlock5() {\n for (var i = 0; i < 13; i++) {\n 'purpx'.replace(re14, '');\n 'purpx'.replace(re15, '');\n 'pvgl'.replace(re14, '');\n 'pvgl'.replace(re15, '');\n 'qrpe fyvqrgrkg'.replace(re14, '');\n 'qrpe fyvqrgrkg'.replace(re15, '');\n 'svefg fryrpgrq'.replace(re14, '');\n 'svefg fryrpgrq'.replace(re15, '');\n 'uqy_rag'.replace(re14, '');\n 'uqy_rag'.replace(re15, '');\n 'vape fyvqrgrkg'.replace(re14, '');\n 'vape fyvqrgrkg'.replace(re15, '');\n 'vachggrkg QBZPbageby_cynprubyqre'.replace(re5, '');\n 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re14, '');\n 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re15, '');\n 'cb_guz'.replace(re14, '');\n 'cb_guz'.replace(re15, '');\n 'fhozvg'.replace(re14, '');\n 'fhozvg'.replace(re15, '');\n re50.exec('');\n /NccyrJroXvg\\/([^\\s]*)/.exec(str0);\n /XUGZY/.exec(str0);\n }\n for (var i = 0; i < 12; i++) {\n '${cebg}://${ubfg}${cngu}/${dz}'.replace(/(\\$\\{cebg\\})|(\\$cebg\\b)/g, '');\n '1'.replace(re40, '');\n '1'.replace(re10, '');\n '1'.replace(re51, '');\n '1'.replace(re52, '');\n '1'.replace(re53, '');\n '1'.replace(re39, '');\n '1'.replace(re54, '');\n '9.0 e115'.replace(/^(.*)\\..*$/, '');\n '9.0 e115'.replace(/^.*e(.*)$/, '');\n '<!-- ${nqiHey} -->'.replace(re55, '');\n '<fpevcg glcr=\"grkg/wninfpevcg\" fep=\"${nqiHey}\"></fpevcg>'.replace(re55, '');\n str1.replace(/^.*\\s+(\\S+\\s+\\S+$)/, '');\n 'tzk%2Subzrcntr%2Sfgneg%2Sqr%2S'.replace(re30, '');\n 'tzk'.replace(re30, '');\n 'uggc://${ubfg}${cngu}/${dz}'.replace(/(\\$\\{ubfg\\})|(\\$ubfg\\b)/g, '');\n 'uggc://nqpyvrag.hvzfrei.arg${cngu}/${dz}'.replace(re56, '');\n 'uggc://nqpyvrag.hvzfrei.arg/wf.at/${dz}'.replace(/(\\$\\{dz\\})|(\\$dz\\b)/g, '');\n 'frpgvba'.replace(re29, '');\n 'frpgvba'.replace(re30, '');\n 'fvgr'.replace(re29, '');\n 'fvgr'.replace(re30, '');\n 'fcrpvny'.replace(re29, '');\n 'fcrpvny'.replace(re30, '');\n re36.exec('anzr');\n /e/.exec('9.0 e115');\n }\n }\n var re57 = /##yv4##/gi;\n var re58 = /##yv16##/gi;\n var re59 = /##yv19##/gi;\n var str27 = '<hy pynff=\"nqi\">##yv4##Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';\n var str28 = '<hy pynff=\"nqi\"><yv vq=\"YvOYG4\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)\">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';\n var str29 = '<hy pynff=\"nqi\"><yv vq=\"YvOYG4\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)\">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq=\"YvOYG16\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)\">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';\n var str30 = '<hy pynff=\"nqi\"><yv vq=\"YvOYG4\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)\">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq=\"YvOYG19\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)\">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq=\"YvOYG16\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)\">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>';\n var str31 = '<hy pynff=\"nqi\"><yv vq=\"YvOYG4\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)\">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq=\"YvOYG19\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)\">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq=\"YvOYG16\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)\">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.<oe> <oe> ##N##Yrnea zber##/N##</hy>';\n var str32 = '<hy pynff=\"nqi\"><yv vq=\"YvOYG4\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)\">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq=\"YvOYG19\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)\">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq=\"YvOYG16\" fglyr=\"onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)\">Ybgf bs fgbentr &#40;5 TO&#41; - zber pbby fghss ba gur jnl.<oe> <oe> <n uers=\"uggc://znvy.yvir.pbz/znvy/nobhg.nfck\" gnetrg=\"_oynax\">Yrnea zber##/N##</hy>';\n var str33 = 'Bar Jvaqbjf Yvir VQ trgf lbh vagb <o>Ubgznvy</o>, <o>Zrffratre</o>, <o>Kobk YVIR</o> \\u2014 naq bgure cynprf lbh frr #~#argjbexybtb#~#';\n var re60 = /(?:^|\\s+)bss(?:\\s+|$)/;\n var re61 = /^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/;\n var re62 = /^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;\n var str34 = '${1}://${2}${3}${4}${5}';\n var str35 = ' O=6gnyg0g4znrrn&o=3&f=gc; Q=_lyu=K3bQZGSxnT4lZzD3OS9GNmV3ZGLkAQxRpTyxNmRlZmRmAmNkAQLRqTImqNZjOUEgpTjQnJ5xMKtgoN--; SCF=qy';\n function runBlock6() {\n for (var i = 0; i < 11; i++) {\n str27.replace(/##yv0##/gi, '');\n str27.replace(re57, '');\n str28.replace(re58, '');\n str29.replace(re59, '');\n str30.replace(/##\\/o##/gi, '');\n str30.replace(/##\\/v##/gi, '');\n str30.replace(/##\\/h##/gi, '');\n str30.replace(/##o##/gi, '');\n str30.replace(/##oe##/gi, '');\n str30.replace(/##v##/gi, '');\n str30.replace(/##h##/gi, '');\n str31.replace(/##n##/gi, '');\n str32.replace(/##\\/n##/gi, '');\n str33.replace(/#~#argjbexybtb#~#/g, '');\n / Zbovyr\\//.exec(str0);\n /##yv1##/gi.exec(str27);\n /##yv10##/gi.exec(str28);\n /##yv11##/gi.exec(str28);\n /##yv12##/gi.exec(str28);\n /##yv13##/gi.exec(str28);\n /##yv14##/gi.exec(str28);\n /##yv15##/gi.exec(str28);\n re58.exec(str28);\n /##yv17##/gi.exec(str29);\n /##yv18##/gi.exec(str29);\n re59.exec(str29);\n /##yv2##/gi.exec(str27);\n /##yv20##/gi.exec(str30);\n /##yv21##/gi.exec(str30);\n /##yv22##/gi.exec(str30);\n /##yv23##/gi.exec(str30);\n /##yv3##/gi.exec(str27);\n re57.exec(str27);\n /##yv5##/gi.exec(str28);\n /##yv6##/gi.exec(str28);\n /##yv7##/gi.exec(str28);\n /##yv8##/gi.exec(str28);\n /##yv9##/gi.exec(str28);\n re8.exec('473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29');\n re8.exec('SbeprqRkcvengvba=633669325184628362');\n re8.exec('FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29');\n /AbxvnA[^\\/]*/.exec(str0);\n }\n for (var i = 0; i < 10; i++) {\n ' bss'.replace(/(?:^|\\s+)bss(?:\\s+|$)/g, '');\n str34.replace(/(\\$\\{0\\})|(\\$0\\b)/g, '');\n str34.replace(/(\\$\\{1\\})|(\\$1\\b)/g, '');\n str34.replace(/(\\$\\{pbzcyrgr\\})|(\\$pbzcyrgr\\b)/g, '');\n str34.replace(/(\\$\\{sentzrag\\})|(\\$sentzrag\\b)/g, '');\n str34.replace(/(\\$\\{ubfgcbeg\\})|(\\$ubfgcbeg\\b)/g, '');\n str34.replace(re56, '');\n str34.replace(/(\\$\\{cebgbpby\\})|(\\$cebgbpby\\b)/g, '');\n str34.replace(/(\\$\\{dhrel\\})|(\\$dhrel\\b)/g, '');\n 'nqfvmr'.replace(re29, '');\n 'nqfvmr'.replace(re30, '');\n 'uggc://${2}${3}${4}${5}'.replace(/(\\$\\{2\\})|(\\$2\\b)/g, '');\n 'uggc://wf.hv-cbegny.qr${3}${4}${5}'.replace(/(\\$\\{3\\})|(\\$3\\b)/g, '');\n 'arjf'.replace(re40, '');\n 'arjf'.replace(re41, '');\n 'arjf'.replace(re42, '');\n 'arjf'.replace(re43, '');\n 'arjf'.replace(re44, '');\n 'arjf'.replace(re45, '');\n 'arjf'.replace(re46, '');\n 'arjf'.replace(re47, '');\n 'arjf'.replace(re48, '');\n / PC=i=(\\d+)&oe=(.)/.exec(str35);\n re60.exec(' ');\n re60.exec(' bss');\n re60.exec('');\n re19.exec(' ');\n re19.exec('svefg ba');\n re19.exec('ynfg vtaber');\n re19.exec('ba');\n re9.exec('scnq so ');\n re9.exec('zrqvgobk');\n re9.exec('hsgy');\n re9.exec('lhv-h');\n /Fnsnev|Xbadhrebe|XUGZY/gi.exec(str0);\n re61.exec('uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf');\n re62.exec('#Ybtva_rznvy');\n }\n }\n var re63 = /\\{0\\}/g;\n var str36 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_tfwsbrg-aowb_80=4413268q3660';\n var str37 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; AFP_zp_tfwsbrg-aowb_80=4413268q3660; __hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1; __hgzo=144631658.0.10.1231364074; __hgzp=144631658; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str38 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231364057761&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364057761&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Ssevraqf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1667363813.1231364061&tn_fvq=1231364061&tn_uvq=1917563877&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str39 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str40 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n function runBlock7() {\n for (var i = 0; i < 9; i++) {\n '0'.replace(re40, '');\n '0'.replace(re10, '');\n '0'.replace(re51, '');\n '0'.replace(re52, '');\n '0'.replace(re53, '');\n '0'.replace(re39, '');\n '0'.replace(re54, '');\n 'Lrf'.replace(re40, '');\n 'Lrf'.replace(re10, '');\n 'Lrf'.replace(re51, '');\n 'Lrf'.replace(re52, '');\n 'Lrf'.replace(re53, '');\n 'Lrf'.replace(re39, '');\n 'Lrf'.replace(re54, '');\n }\n for (var i = 0; i < 8; i++) {\n 'Pybfr {0}'.replace(re63, '');\n 'Bcra {0}'.replace(re63, '');\n str36.split(re32);\n str37.split(re32);\n 'puvyq p1 svefg gnournqref'.replace(re14, '');\n 'puvyq p1 svefg gnournqref'.replace(re15, '');\n 'uqy_fcb'.replace(re14, '');\n 'uqy_fcb'.replace(re15, '');\n 'uvag'.replace(re14, '');\n 'uvag'.replace(re15, '');\n str38.replace(re33, '');\n 'yvfg'.replace(re14, '');\n 'yvfg'.replace(re15, '');\n 'at_bhgre'.replace(re30, '');\n 'cnerag puebzr5 qbhoyr2 NU'.replace(re14, '');\n 'cnerag puebzr5 qbhoyr2 NU'.replace(re15, '');\n 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re14, '');\n 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re15, '');\n 'cnerag puebzr6 fvatyr1'.replace(re14, '');\n 'cnerag puebzr6 fvatyr1'.replace(re15, '');\n 'cb_qrs'.replace(re14, '');\n 'cb_qrs'.replace(re15, '');\n 'gnopbagrag'.replace(re14, '');\n 'gnopbagrag'.replace(re15, '');\n 'iv_svefg_gvzr'.replace(re30, '');\n /(^|.)(ronl|qri-ehf3.wbg)(|fgberf|zbgbef|yvirnhpgvbaf|jvxv|rkcerff|punggre).(pbz(|.nh|.pa|.ux|.zl|.ft|.oe|.zk)|pb(.hx|.xe|.am)|pn|qr|se|vg|ay|or|ng|pu|vr|va|rf|cy|cu|fr)$/i.exec('cntrf.ronl.pbz');\n re8.exec('144631658.0.10.1231364074');\n re8.exec('144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.2294274870215848400.1231364074.1231364074.1231364074.1');\n re8.exec('4413241q3660');\n re8.exec('SbeprqRkcvengvba=633669357391353591');\n re8.exec(str39);\n re8.exec(str40);\n re8.exec('AFP_zp_kkk-gdzogv_80=4413241q3660');\n re8.exec('FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7');\n re8.exec('__hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1');\n re8.exec('__hgzo=144631658.0.10.1231364074');\n re8.exec('__hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7');\n re34.exec(str36);\n re34.exec(str37);\n }\n }\n var re64 = /\\b[a-z]/g;\n var re65 = /^uggc:\\/\\//;\n var re66 = /(?:^|\\s+)qvfnoyrq(?:\\s+|$)/;\n var str41 = 'uggc://cebsvyr.zlfcnpr.pbz/Zbqhyrf/Nccyvpngvbaf/Cntrf/Pnainf.nfck';\n function runBlock8() {\n for (var i = 0; i < 7; i++) {\n str1.match(/\\d+/g);\n 'nsgre'.replace(re64, '');\n 'orsber'.replace(re64, '');\n 'obggbz'.replace(re64, '');\n 'ohvygva_jrngure.kzy'.replace(re65, '');\n 'ohggba'.replace(re37, '');\n 'ohggba'.replace(re18, '');\n 'qngrgvzr.kzy'.replace(re65, '');\n 'uggc://eff.paa.pbz/eff/paa_gbcfgbevrf.eff'.replace(re65, '');\n 'vachg'.replace(re37, '');\n 'vachg'.replace(re18, '');\n 'vafvqr'.replace(re64, '');\n 'cbvagre'.replace(re27, '');\n 'cbfvgvba'.replace(/[A-Z]/g, '');\n 'gbc'.replace(re27, '');\n 'gbc'.replace(re64, '');\n 'hy'.replace(re37, '');\n 'hy'.replace(re18, '');\n str26.replace(re37, '');\n str26.replace(re18, '');\n 'lbhghor_vtbbtyr/i2/lbhghor.kzy'.replace(re65, '');\n 'm-vaqrk'.replace(re27, '');\n /#([\\w-]+)/.exec(str26);\n re16.exec('urvtug');\n re16.exec('znetvaGbc');\n re16.exec('jvqgu');\n re19.exec('gno0 svefg ba');\n re19.exec('gno0 ba');\n re19.exec('gno4 ynfg');\n re19.exec('gno4');\n re19.exec('gno5');\n re19.exec('gno6');\n re19.exec('gno7');\n re19.exec('gno8');\n /NqborNVE\\/([^\\s]*)/.exec(str0);\n /NccyrJroXvg\\/([^ ]*)/.exec(str0);\n /XUGZY/gi.exec(str0);\n /^(?:obql|ugzy)$/i.exec('YV');\n re38.exec('ohggba');\n re38.exec('vachg');\n re38.exec('hy');\n re38.exec(str26);\n /^(\\w+|\\*)/.exec(str26);\n /znp|jva|yvahk/i.exec('Jva32');\n /eton?\\([\\d\\s,]+\\)/.exec('fgngvp');\n }\n for (var i = 0; i < 6; i++) {\n ''.replace(/\\r/g, '');\n '/'.replace(re40, '');\n '/'.replace(re10, '');\n '/'.replace(re51, '');\n '/'.replace(re52, '');\n '/'.replace(re53, '');\n '/'.replace(re39, '');\n '/'.replace(re54, '');\n 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/{0}?[NDO]&{1}&{2}&[NDR]'.replace(re63, '');\n str41.replace(re12, '');\n 'uggc://jjj.snprobbx.pbz/fepu.cuc'.replace(re23, '');\n 'freivpr'.replace(re40, '');\n 'freivpr'.replace(re41, '');\n 'freivpr'.replace(re42, '');\n 'freivpr'.replace(re43, '');\n 'freivpr'.replace(re44, '');\n 'freivpr'.replace(re45, '');\n 'freivpr'.replace(re46, '');\n 'freivpr'.replace(re47, '');\n 'freivpr'.replace(re48, '');\n /((ZFVR\\s+([6-9]|\\d\\d)\\.))/.exec(str0);\n re66.exec('');\n re50.exec('fryrpgrq');\n re8.exec('8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn');\n re8.exec('SbeprqRkcvengvba=633669340386893867');\n re8.exec('VC=74.125.75.17');\n re8.exec('FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn');\n /Xbadhrebe|Fnsnev|XUGZY/.exec(str0);\n re13.exec(str41);\n re49.exec('unfsbphf');\n }\n }\n var re67 = /zrah_byq/g;\n var str42 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str43 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; __hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1; __hgzo=144631658.0.10.1231364380; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str44 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_vzntrf_wf&qg=1231364373088&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364373088&punaary=svz_zlfcnpr_hfre-ivrj-pbzzragf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Spbzzrag.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1158737789.1231364375&tn_fvq=1231364375&tn_uvq=415520832&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str45 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str46 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var re68 = /^([#.]?)((?:[\\w\\u0128-\\uffff*_-]|\\\\.)*)/;\n var re69 = /\\{1\\}/g;\n var re70 = /\\s+/;\n var re71 = /(\\$\\{4\\})|(\\$4\\b)/g;\n var re72 = /(\\$\\{5\\})|(\\$5\\b)/g;\n var re73 = /\\{2\\}/g;\n var re74 = /[^+>] [^+>]/;\n var re75 = /\\bucpyv\\s*=\\s*([^;]*)/i;\n var re76 = /\\bucuvqr\\s*=\\s*([^;]*)/i;\n var re77 = /\\bucfie\\s*=\\s*([^;]*)/i;\n var re78 = /\\bhfucjrn\\s*=\\s*([^;]*)/i;\n var re79 = /\\bmvc\\s*=\\s*([^;]*)/i;\n var re80 = /^((?:[\\w\\u0128-\\uffff*_-]|\\\\.)+)(#)((?:[\\w\\u0128-\\uffff*_-]|\\\\.)+)/;\n var re81 = /^([>+~])\\s*(\\w*)/i;\n var re82 = /^>\\s*((?:[\\w\\u0128-\\uffff*_-]|\\\\.)+)/;\n var re83 = /^[\\s[]?shapgvba/;\n var re84 = /v\\/g.tvs#(.*)/i;\n var str47 = '#Zbq-Vasb-Vasb-WninFpevcgUvag';\n var str48 = ',n.svryqOgaPnapry';\n var str49 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_kkk-gdzogv_80=4413241q3660';\n var str50 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; AFP_zp_kkk-gdzogv_80=4413241q3660; AFP_zp_kkk-aowb_80=4413235p3660; __hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1; __hgzo=144631658.0.10.1231367708; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str51 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367691141&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367691141&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sjjj.zlfcnpr.pbz%2S&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=320757904.1231367694&tn_fvq=1231367694&tn_uvq=1758792003&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str52 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N38%3N42%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=1024k768&p=24&x=L&oj=994&ou=634&uc=A&{2}&[NDR]';\n var str53 = 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq qbhoyr2 ps';\n var str54 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str55 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str56 = 'ne;ng;nh;or;oe;pn;pu;py;pa;qr;qx;rf;sv;se;to;ux;vq;vr;va;vg;wc;xe;zk;zl;ay;ab;am;cu;cy;cg;eh;fr;ft;gu;ge;gj;mn;';\n var str57 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886&GHVQ=1';\n var str58 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886';\n var str59 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1';\n var str60 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF';\n var str61 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/29/4RQP4969777N048NPS4RRR3PO2S7S.wct';\n var str62 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/OQ/63NP9O94NS5OQP1249Q9S1ROP7NS3.wct';\n var str63 = 'zbmvyyn/5.0 (jvaqbjf; h; jvaqbjf ag 5.1; ra-hf) nccyrjroxvg/528.9 (xugzy, yvxr trpxb) puebzr/2.0.157.0 fnsnev/528.9';\n function runBlock9() {\n for (var i = 0; i < 5; i++) {\n str42.split(re32);\n str43.split(re32);\n 'svz_zlfcnpr_hfre-ivrj-pbzzragf,svz_zlfcnpr_havgrq-fgngrf'.split(re20);\n str44.replace(re33, '');\n 'zrah_arj zrah_arj_gbttyr zrah_gbttyr'.replace(re67, '');\n 'zrah_byq zrah_byq_gbttyr zrah_gbttyr'.replace(re67, '');\n re8.exec('102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98');\n re8.exec('144631658.0.10.1231364380');\n re8.exec('144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.3931862196947939300.1231364380.1231364380.1231364380.1');\n re8.exec('441326q33660');\n re8.exec('SbeprqRkcvengvba=633669341278771470');\n re8.exec(str45);\n re8.exec(str46);\n re8.exec('AFP_zp_dfctwzssrwh-aowb_80=441326q33660');\n re8.exec('FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98');\n re8.exec('__hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1');\n re8.exec('__hgzo=144631658.0.10.1231364380');\n re8.exec('__hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n }\n for (var i = 0; i < 4; i++) {\n ' yvfg1'.replace(re14, '');\n ' yvfg1'.replace(re15, '');\n ' yvfg2'.replace(re14, '');\n ' yvfg2'.replace(re15, '');\n ' frneputebhc1'.replace(re14, '');\n ' frneputebhc1'.replace(re15, '');\n str47.replace(re68, '');\n str47.replace(re18, '');\n ''.replace(/&/g, '');\n ''.replace(re35, '');\n '(..-{0})(\\|(\\d+)|)'.replace(re63, '');\n str48.replace(re18, '');\n '//vzt.jro.qr/vij/FC/${cngu}/${anzr}/${inyhr}?gf=${abj}'.replace(re56, '');\n '//vzt.jro.qr/vij/FC/tzk_uc/${anzr}/${inyhr}?gf=${abj}'.replace(/(\\$\\{anzr\\})|(\\$anzr\\b)/g, '');\n '<fcna pynff=\"urnq\"><o>Jvaqbjf Yvir Ubgznvy</o></fcna><fcna pynff=\"zft\">{1}</fcna>'.replace(re69, '');\n '<fcna pynff=\"urnq\"><o>{0}</o></fcna><fcna pynff=\"zft\">{1}</fcna>'.replace(re63, '');\n '<fcna pynff=\"fvtahc\"><n uers=uggc://jjj.ubgznvy.pbz><o>{1}</o></n></fcna>'.replace(re69, '');\n '<fcna pynff=\"fvtahc\"><n uers={0}><o>{1}</o></n></fcna>'.replace(re63, '');\n 'Vzntrf'.replace(re15, '');\n 'ZFA'.replace(re15, '');\n 'Zncf'.replace(re15, '');\n 'Zbq-Vasb-Vasb-WninFpevcgUvag'.replace(re39, '');\n 'Arjf'.replace(re15, '');\n str49.split(re32);\n str50.split(re32);\n 'Ivqrb'.replace(re15, '');\n 'Jro'.replace(re15, '');\n 'n'.replace(re39, '');\n 'nwnkFgneg'.split(re70);\n 'nwnkFgbc'.split(re70);\n 'ovaq'.replace(re14, '');\n 'ovaq'.replace(re15, '');\n 'oevatf lbh zber. Zber fcnpr (5TO), zber frphevgl, fgvyy serr.'.replace(re63, '');\n 'puvyq p1 svefg qrpx'.replace(re14, '');\n 'puvyq p1 svefg qrpx'.replace(re15, '');\n 'puvyq p1 svefg qbhoyr2'.replace(re14, '');\n 'puvyq p1 svefg qbhoyr2'.replace(re15, '');\n 'puvyq p2 ynfg'.replace(re14, '');\n 'puvyq p2 ynfg'.replace(re15, '');\n 'puvyq p2'.replace(re14, '');\n 'puvyq p2'.replace(re15, '');\n 'puvyq p3'.replace(re14, '');\n 'puvyq p3'.replace(re15, '');\n 'puvyq p4 ynfg'.replace(re14, '');\n 'puvyq p4 ynfg'.replace(re15, '');\n 'pbclevtug'.replace(re14, '');\n 'pbclevtug'.replace(re15, '');\n 'qZFAZR_1'.replace(re14, '');\n 'qZFAZR_1'.replace(re15, '');\n 'qbhoyr2 ps'.replace(re14, '');\n 'qbhoyr2 ps'.replace(re15, '');\n 'qbhoyr2'.replace(re14, '');\n 'qbhoyr2'.replace(re15, '');\n 'uqy_arj'.replace(re14, '');\n 'uqy_arj'.replace(re15, '');\n 'uc_fubccvatobk'.replace(re30, '');\n 'ugzy%2Rvq'.replace(re29, '');\n 'ugzy%2Rvq'.replace(re30, '');\n str51.replace(re33, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${4}${5}'.replace(re71, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${5}'.replace(re72, '');\n str52.replace(re73, '');\n 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&{1}&{2}&[NDR]'.replace(re69, '');\n 'vztZFSG'.replace(re14, '');\n 'vztZFSG'.replace(re15, '');\n 'zfasbbg1 ps'.replace(re14, '');\n 'zfasbbg1 ps'.replace(re15, '');\n str53.replace(re14, '');\n str53.replace(re15, '');\n 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re14, '');\n 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re15, '');\n 'cevznel'.replace(re14, '');\n 'cevznel'.replace(re15, '');\n 'erpgnatyr'.replace(re30, '');\n 'frpbaqnel'.replace(re14, '');\n 'frpbaqnel'.replace(re15, '');\n 'haybnq'.split(re70);\n '{0}{1}1'.replace(re63, '');\n '|{1}1'.replace(re69, '');\n /(..-HF)(\\|(\\d+)|)/i.exec('xb-xe,ra-va,gu-gu');\n re4.exec('/ZlFcnprNccf/NccPnainf,45000012');\n re8.exec('144631658.0.10.1231367708');\n re8.exec('144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.2770915348920628700.1231367708.1231367708.1231367708.1');\n re8.exec('4413235p3660');\n re8.exec('441327q73660');\n re8.exec('9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473');\n re8.exec('SbeprqRkcvengvba=633669350559478880');\n re8.exec(str54);\n re8.exec(str55);\n re8.exec('AFP_zp_dfctwzs-aowb_80=441327q73660');\n re8.exec('AFP_zp_kkk-aowb_80=4413235p3660');\n re8.exec('FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473');\n re8.exec('__hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1');\n re8.exec('__hgzo=144631658.0.10.1231367708');\n re8.exec('__hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re34.exec(str49);\n re34.exec(str50);\n /ZFVR\\s+5[.]01/.exec(str0);\n /HF(?=;)/i.exec(str56);\n re74.exec(str47);\n re28.exec('svefg npgvir svefgNpgvir');\n re28.exec('ynfg');\n /\\bp:(..)/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF');\n re75.exec(str57);\n re75.exec(str58);\n re76.exec(str57);\n re76.exec(str58);\n re77.exec(str57);\n re77.exec(str58);\n /\\bhfucce\\s*=\\s*([^;]*)/i.exec(str59);\n re78.exec(str57);\n re78.exec(str58);\n /\\bjci\\s*=\\s*([^;]*)/i.exec(str59);\n re79.exec(str58);\n re79.exec(str60);\n re79.exec(str59);\n /\\|p:([a-z]{2})/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1');\n re80.exec(str47);\n re61.exec('cebgbglcr.wf');\n re68.exec(str47);\n re81.exec(str47);\n re82.exec(str47);\n /^Fubpxjnir Synfu (\\d)/.exec(str1);\n /^Fubpxjnir Synfu (\\d+)/.exec(str1);\n re83.exec('[bowrpg tybony]');\n re62.exec(str47);\n re84.exec(str61);\n re84.exec(str62);\n /jroxvg/.exec(str63);\n }\n }\n var re85 = /eaq_zbqobkva/;\n var str64 = '1231365729213';\n var str65 = '74.125.75.3-1057165600.29978900';\n var str66 = '74.125.75.3-1057165600.29978900.1231365730214';\n var str67 = 'Frnepu%20Zvpebfbsg.pbz';\n var str68 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str69 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; __hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1; __hgzo=144631658.0.10.1231365779; __hgzp=144631658; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str70 = 'I=3%26THVQ=757q3ss871q44o7o805n8113n5p72q52';\n var str71 = 'I=3&THVQ=757q3ss871q44o7o805n8113n5p72q52';\n var str72 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365765292&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365765292&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sohyyrgvaf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1579793869.1231365768&tn_fvq=1231365768&tn_uvq=2056210897&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str73 = 'frnepu.zvpebfbsg.pbz';\n var str74 = 'frnepu.zvpebfbsg.pbz/';\n var str75 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str76 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n function runBlock10() {\n for (var i = 0; i < 3; i++) {\n '%3Szxg=ra-HF'.replace(re39, '');\n '-8'.replace(re40, '');\n '-8'.replace(re10, '');\n '-8'.replace(re51, '');\n '-8'.replace(re52, '');\n '-8'.replace(re53, '');\n '-8'.replace(re39, '');\n '-8'.replace(re54, '');\n '1.5'.replace(re40, '');\n '1.5'.replace(re10, '');\n '1.5'.replace(re51, '');\n '1.5'.replace(re52, '');\n '1.5'.replace(re53, '');\n '1.5'.replace(re39, '');\n '1.5'.replace(re54, '');\n '1024k768'.replace(re40, '');\n '1024k768'.replace(re10, '');\n '1024k768'.replace(re51, '');\n '1024k768'.replace(re52, '');\n '1024k768'.replace(re53, '');\n '1024k768'.replace(re39, '');\n '1024k768'.replace(re54, '');\n str64.replace(re40, '');\n str64.replace(re10, '');\n str64.replace(re51, '');\n str64.replace(re52, '');\n str64.replace(re53, '');\n str64.replace(re39, '');\n str64.replace(re54, '');\n '14'.replace(re40, '');\n '14'.replace(re10, '');\n '14'.replace(re51, '');\n '14'.replace(re52, '');\n '14'.replace(re53, '');\n '14'.replace(re39, '');\n '14'.replace(re54, '');\n '24'.replace(re40, '');\n '24'.replace(re10, '');\n '24'.replace(re51, '');\n '24'.replace(re52, '');\n '24'.replace(re53, '');\n '24'.replace(re39, '');\n '24'.replace(re54, '');\n str65.replace(re40, '');\n str65.replace(re10, '');\n str65.replace(re51, '');\n str65.replace(re52, '');\n str65.replace(re53, '');\n str65.replace(re39, '');\n str65.replace(re54, '');\n str66.replace(re40, '');\n str66.replace(re10, '');\n str66.replace(re51, '');\n str66.replace(re52, '');\n str66.replace(re53, '');\n str66.replace(re39, '');\n str66.replace(re54, '');\n '9.0'.replace(re40, '');\n '9.0'.replace(re10, '');\n '9.0'.replace(re51, '');\n '9.0'.replace(re52, '');\n '9.0'.replace(re53, '');\n '9.0'.replace(re39, '');\n '9.0'.replace(re54, '');\n '994k634'.replace(re40, '');\n '994k634'.replace(re10, '');\n '994k634'.replace(re51, '');\n '994k634'.replace(re52, '');\n '994k634'.replace(re53, '');\n '994k634'.replace(re39, '');\n '994k634'.replace(re54, '');\n '?zxg=ra-HF'.replace(re40, '');\n '?zxg=ra-HF'.replace(re10, '');\n '?zxg=ra-HF'.replace(re51, '');\n '?zxg=ra-HF'.replace(re52, '');\n '?zxg=ra-HF'.replace(re53, '');\n '?zxg=ra-HF'.replace(re54, '');\n 'PAA.pbz'.replace(re25, '');\n 'PAA.pbz'.replace(re12, '');\n 'PAA.pbz'.replace(re39, '');\n 'Qngr & Gvzr'.replace(re25, '');\n 'Qngr & Gvzr'.replace(re12, '');\n 'Qngr & Gvzr'.replace(re39, '');\n 'Frnepu Zvpebfbsg.pbz'.replace(re40, '');\n 'Frnepu Zvpebfbsg.pbz'.replace(re54, '');\n str67.replace(re10, '');\n str67.replace(re51, '');\n str67.replace(re52, '');\n str67.replace(re53, '');\n str67.replace(re39, '');\n str68.split(re32);\n str69.split(re32);\n str70.replace(re52, '');\n str70.replace(re53, '');\n str70.replace(re39, '');\n str71.replace(re40, '');\n str71.replace(re10, '');\n str71.replace(re51, '');\n str71.replace(re54, '');\n 'Jrngure'.replace(re25, '');\n 'Jrngure'.replace(re12, '');\n 'Jrngure'.replace(re39, '');\n 'LbhGhor'.replace(re25, '');\n 'LbhGhor'.replace(re12, '');\n 'LbhGhor'.replace(re39, '');\n str72.replace(re33, '');\n 'erzbgr_vsenzr_1'.replace(/^erzbgr_vsenzr_/, '');\n str73.replace(re40, '');\n str73.replace(re10, '');\n str73.replace(re51, '');\n str73.replace(re52, '');\n str73.replace(re53, '');\n str73.replace(re39, '');\n str73.replace(re54, '');\n str74.replace(re40, '');\n str74.replace(re10, '');\n str74.replace(re51, '');\n str74.replace(re52, '');\n str74.replace(re53, '');\n str74.replace(re39, '');\n str74.replace(re54, '');\n 'lhv-h'.replace(/\\-/g, '');\n re9.exec('p');\n re9.exec('qz p');\n re9.exec('zbqynory');\n re9.exec('lhv-h svefg');\n re8.exec('144631658.0.10.1231365779');\n re8.exec('144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.1877536177953918500.1231365779.1231365779.1231365779.1');\n re8.exec(str75);\n re8.exec(str76);\n re8.exec('__hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1');\n re8.exec('__hgzo=144631658.0.10.1231365779');\n re8.exec('__hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re34.exec(str68);\n re34.exec(str69);\n /^$/.exec('');\n re31.exec('qr');\n /^znk\\d+$/.exec('');\n /^zva\\d+$/.exec('');\n /^erfgber$/.exec('');\n re85.exec('zbqobkva zbqobk_abcnqqvat ');\n re85.exec('zbqgvgyr');\n re85.exec('eaq_zbqobkva ');\n re85.exec('eaq_zbqgvgyr ');\n /frpgvba\\d+_pbagragf/.exec('obggbz_ani');\n }\n }\n var re86 = /;\\s*/;\n var re87 = /(\\$\\{inyhr\\})|(\\$inyhr\\b)/g;\n var re88 = /(\\$\\{abj\\})|(\\$abj\\b)/g;\n var re89 = /\\s+$/;\n var re90 = /^\\s+/;\n var re91 = /(\\\\\\\"|\\x00-|\\x1f|\\x7f-|\\x9f|\\u00ad|\\u0600-|\\u0604|\\u070f|\\u17b4|\\u17b5|\\u200c-|\\u200f|\\u2028-|\\u202f|\\u2060-|\\u206f|\\ufeff|\\ufff0-|\\uffff)/g;\n var re92 = /^(:)([\\w-]+)\\(\"?'?(.*?(\\(.*?\\))?[^(]*?)\"?'?\\)/;\n var re93 = /^([:.#]*)((?:[\\w\\u0128-\\uffff*_-]|\\\\.)+)/;\n var re94 = /^(\\[) *@?([\\w-]+) *([!*$^~=]*) *('?\"?)(.*?)\\4 *\\]/;\n var str77 = '#fubhgobk .pybfr';\n var str78 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzssrwh-aowb_80=441326q33660';\n var str79 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; AFP_zp_dfctwzssrwh-aowb_80=441326q33660; __hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1; __hgzo=144631658.0.10.1231365869; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str80 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=441327q73660';\n var str81 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; AFP_zp_dfctwzs-aowb_80=441327q73660; __hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1; __hgzo=144631658.0.10.1231367054; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str82 = '[glcr=fhozvg]';\n var str83 = 'n.svryqOga,n.svryqOgaPnapry';\n var str84 = 'n.svryqOgaPnapry';\n var str85 = 'oyvpxchaxg';\n var str86 = 'qvi.bow-nppbeqvba qg';\n var str87 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_nccf_wf&qg=1231367052227&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367052227&punaary=svz_zlfcnpr_nccf-pnainf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2SZbqhyrf%2SNccyvpngvbaf%2SCntrf%2SPnainf.nfck&nq_glcr=grkg&rvq=6083027&rn=0&sez=1&tn_ivq=716357910.1231367056&tn_fvq=1231367056&tn_uvq=1387206491&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str88 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365851658&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365851658&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyrrqvg.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1979828129.1231365855&tn_fvq=1231365855&tn_uvq=2085229649&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22';\n var str89 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N12%3N47%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=0k0&p=43835816&x=A&oj=994&ou=634&uc=A&{2}&[NDR]';\n var str90 = 'zrgn[anzr=nwnkHey]';\n var str91 = 'anpuevpugra';\n var str92 = 'b oS={\\'oT\\':1.1};x $8n(B){z(B!=o9)};x $S(B){O(!$8n(B))z A;O(B.4L)z\\'T\\';b S=7t B;O(S==\\'2P\\'&&B.p4){23(B.7f){12 1:z\\'T\\';12 3:z/\\S/.2g(B.8M)?\\'ox\\':\\'oh\\'}}O(S==\\'2P\\'||S==\\'x\\'){23(B.nE){12 2V:z\\'1O\\';12 7I:z\\'5a\\';12 18:z\\'4B\\'}O(7t B.I==\\'4F\\'){O(B.3u)z\\'pG\\';O(B.8e)z\\'1p\\'}}z S};x $2p(){b 4E={};Z(b v=0;v<1p.I;v++){Z(b X 1o 1p[v]){b nc=1p[v][X];b 6E=4E[X];O(6E&&$S(nc)==\\'2P\\'&&$S(6E)==\\'2P\\')4E[X]=$2p(6E,nc);17 4E[X]=nc}}z 4E};b $E=7p.E=x(){b 1d=1p;O(!1d[1])1d=[p,1d[0]];Z(b X 1o 1d[1])1d[0][X]=1d[1][X];z 1d[0]};b $4D=7p.pJ=x(){Z(b v=0,y=1p.I;v<y;v++){1p[v].E=x(1J){Z(b 1I 1o 1J){O(!p.1Y[1I])p.1Y[1I]=1J[1I];O(!p[1I])p[1I]=$4D.6C(1I)}}}};$4D.6C=x(1I){z x(L){z p.1Y[1I].3H(L,2V.1Y.nV.1F(1p,1))}};$4D(7F,2V,6J,nb);b 3l=x(B){B=B||{};B.E=$E;z B};b pK=Y 3l(H);b pZ=Y 3l(C);C.6f=C.35(\\'6f\\')[0];x $2O(B){z!!(B||B===0)};x $5S(B,n8){z $8n(B)?B:n8};x $7K(3c,1m){z 1q.na(1q.7K()*(1m-3c+1)+3c)};x $3N(){z Y 97().os()};x $4M(1U){pv(1U);pa(1U);z 1S};H.43=!!(C.5Z);O(H.nB)H.31=H[H.7q?\\'py\\':\\'nL\\']=1r;17 O(C.9N&&!C.om&&!oy.oZ)H.pF=H.4Z=H[H.43?\\'pt\\':\\'65\\']=1r;17 O(C.po!=1S)H.7J=1r;O(7t 5B==\\'o9\\'){b 5B=x(){};O(H.4Z)C.nd(\"pW\");5B.1Y=(H.4Z)?H[\"[[oN.1Y]]\"]:{}}5B.1Y.4L=1r;O(H.nL)5s{C.oX(\"pp\",A,1r)}4K(r){};b 18=x(1X){b 63=x(){z(1p[0]!==1S&&p.1w&&$S(p.1w)==\\'x\\')?p.1w.3H(p,1p):p};$E(63,p);63.1Y=1X;63.nE=18;z 63};18.1z=x(){};18.1Y={E:x(1X){b 7x=Y p(1S);Z(b X 1o 1X){b nC=7x[X];7x[X]=18.nY(nC,1X[X])}z Y 18(7x)},3d:x(){Z(b v=0,y=1p.I;v<y;v++)$E(p.1Y,1p[v])}};18.nY=x(2b,2n){O(2b&&2b!=2n){b S=$S(2n);O(S!=$S(2b))z 2n;23(S){12\\'x\\':b 7R=x(){p.1e=1p.8e.1e;z 2n.3H(p,1p)};7R.1e=2b;z 7R;12\\'2P\\':z $2p(2b,2n)}}z 2n};b 8o=Y 18({oQ:x(J){p.4w=p.4w||[];p.4w.1x(J);z p},7g:x(){O(p.4w&&p.4w.I)p.4w.9J().2x(10,p)},oP:x(){p.4w=[]}});b 2d=Y 18({1V:x(S,J){O(J!=18.1z){p.$19=p.$19||{};p.$19[S]=p.$19[S]||[];p.$19[S].5j(J)}z p},1v:x(S,1d,2x){O(p.$19&&p.$19[S]){p.$19[S].1b(x(J){J.3n({\\'L\\':p,\\'2x\\':2x,\\'1p\\':1d})()},p)}z p},3M:x(S,J){O(p.$19&&p.$19[S])p.$19[S].2U(J);z p}});b 4v=Y 18({2H:x(){p.P=$2p.3H(1S,[p.P].E(1p));O(!p.1V)z p;Z(b 3O 1o p.P){O($S(p.P[3O]==\\'x\\')&&3O.2g(/^5P[N-M]/))p.1V(3O,p.P[3O])}z p}});2V.E({7y:x(J,L){Z(b v=0,w=p.I;v<w;v++)J.1F(L,p[v],v,p)},3s:x(J,L){b 54=[];Z(b v=0,w=p.I;v<w;v++){O(J.1F(L,p[v],v,p))54.1x(p[v])}z 54},2X:x(J,L){b 54=[];Z(b v=0,w=p.I;v<w;v++)54[v]=J.1F(L,p[v],v,p);z 54},4i:x(J,L){Z(b v=0,w=p.I;v<w;v++){O(!J.1F(L,p[v],v,p))z A}z 1r},ob:x(J,L){Z(b v=0,w=p.I;v<w;v++){O(J.1F(L,p[v],v,p))z 1r}z A},3F:x(3u,15){b 3A=p.I;Z(b v=(15<0)?1q.1m(0,3A+15):15||0;v<3A;v++){O(p[v]===3u)z v}z-1},8z:x(1u,I){1u=1u||0;O(1u<0)1u=p.I+1u;I=I||(p.I-1u);b 89=[];Z(b v=0;v<I;v++)89[v]=p[1u++];z 89},2U:x(3u){b v=0;b 3A=p.I;6L(v<3A){O(p[v]===3u){p.6l(v,1);3A--}17{v++}}z p},1y:x(3u,15){z p.3F(3u,15)!=-1},oz:x(1C){b B={},I=1q.3c(p.I,1C.I);Z(b v=0;v<I;v++)B[1C[v]]=p[v];z B},E:x(1O){Z(b v=0,w=1O.I;v<w;v++)p.1x(1O[v]);z p},2p:x(1O){Z(b v=0,y=1O.I;v<y;v++)p.5j(1O[v]);z p},5j:x(3u){O(!p.1y(3u))p.1x(3u);z p},oc:x(){z p[$7K(0,p.I-1)]||A},7L:x(){z p[p.I-1]||A}});2V.1Y.1b=2V.1Y.7y;2V.1Y.2g=2V.1Y.1y;x $N(1O){z 2V.8z(1O)};x $1b(3J,J,L){O(3J&&7t 3J.I==\\'4F\\'&&$S(3J)!=\\'2P\\')2V.7y(3J,J,L);17 Z(b 1j 1o 3J)J.1F(L||3J,3J[1j],1j)};6J.E({2g:x(6b,2F){z(($S(6b)==\\'2R\\')?Y 7I(6b,2F):6b).2g(p)},3p:x(){z 5K(p,10)},o4:x(){z 69(p)},7A:x(){z p.3y(/-\\D/t,x(2G){z 2G.7G(1).nW()})},9b:x(){z p.3y(/\\w[N-M]/t,x(2G){z(2G.7G(0)+\\'-\\'+2G.7G(1).5O())})},8V:x(){z p.3y(/\\b[n-m]/t,x(2G){z 2G.nW()})},5L:x(){z p.3y(/^\\s+|\\s+$/t,\\'\\')},7j:x(){z p.3y(/\\s{2,}/t,\\' \\').5L()},5V:x(1O){b 1i=p.2G(/\\d{1,3}/t);z(1i)?1i.5V(1O):A},5U:x(1O){b 3P=p.2G(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);z(3P)?3P.nV(1).5U(1O):A},1y:x(2R,f){z(f)?(f+p+f).3F(f+2R+f)>-1:p.3F(2R)>-1},nX:x(){z p.3y(/([.*+?^${}()|[\\]\\/\\\\])/t,\\'\\\\$1\\')}});2V.E({5V:x(1O){O(p.I<3)z A;O(p.I==4&&p[3]==0&&!1O)z\\'p5\\';b 3P=[];Z(b v=0;v<3;v++){b 52=(p[v]-0).4h(16);3P.1x((52.I==1)?\\'0\\'+52:52)}z 1O?3P:\\'#\\'+3P.2u(\\'\\')},5U:x(1O){O(p.I!=3)z A;b 1i=[];Z(b v=0;v<3;v++){1i.1x(5K((p[v].I==1)?p[v]+p[v]:p[v],16))}z 1O?1i:\\'1i(\\'+1i.2u(\\',\\')+\\')\\'}});7F.E({3n:x(P){b J=p;P=$2p({\\'L\\':J,\\'V\\':A,\\'1p\\':1S,\\'2x\\':A,\\'4s\\':A,\\'6W\\':A},P);O($2O(P.1p)&&$S(P.1p)!=\\'1O\\')P.1p=[P.1p];z x(V){b 1d;O(P.V){V=V||H.V;1d=[(P.V===1r)?V:Y P.V(V)];O(P.1p)1d.E(P.1p)}17 1d=P.1p||1p;b 3C=x(){z J.3H($5S(P';\n var str93 = 'hagreunyghat';\n var str94 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str95 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q';\n var str96 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str97 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=';\n var str98 = 'shapgvba (){Cuk.Nccyvpngvba.Frghc.Pber();Cuk.Nccyvpngvba.Frghc.Nwnk();Cuk.Nccyvpngvba.Frghc.Synfu();Cuk.Nccyvpngvba.Frghc.Zbqhyrf()}';\n function runBlock11() {\n for (var i = 0; i < 2; i++) {\n ' .pybfr'.replace(re18, '');\n ' n.svryqOgaPnapry'.replace(re18, '');\n ' qg'.replace(re18, '');\n str77.replace(re68, '');\n str77.replace(re18, '');\n ''.replace(re39, '');\n ''.replace(/^/, '');\n ''.split(re86);\n '*'.replace(re39, '');\n '*'.replace(re68, '');\n '*'.replace(re18, '');\n '.pybfr'.replace(re68, '');\n '.pybfr'.replace(re18, '');\n '//vzt.jro.qr/vij/FC/tzk_uc/fperra/${inyhr}?gf=${abj}'.replace(re87, '');\n '//vzt.jro.qr/vij/FC/tzk_uc/fperra/1024?gf=${abj}'.replace(re88, '');\n '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/${inyhr}?gf=${abj}'.replace(re87, '');\n '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/992/608?gf=${abj}'.replace(re88, '');\n '300k120'.replace(re30, '');\n '300k250'.replace(re30, '');\n '310k120'.replace(re30, '');\n '310k170'.replace(re30, '');\n '310k250'.replace(re30, '');\n '9.0 e115'.replace(/^.*\\.(.*)\\s.*$/, '');\n 'Nppbeqvba'.replace(re2, '');\n 'Nxghryy\\x0a'.replace(re89, '');\n 'Nxghryy\\x0a'.replace(re90, '');\n 'Nccyvpngvba'.replace(re2, '');\n 'Oyvpxchaxg\\x0a'.replace(re89, '');\n 'Oyvpxchaxg\\x0a'.replace(re90, '');\n 'Svanamra\\x0a'.replace(re89, '');\n 'Svanamra\\x0a'.replace(re90, '');\n 'Tnzrf\\x0a'.replace(re89, '');\n 'Tnzrf\\x0a'.replace(re90, '');\n 'Ubebfxbc\\x0a'.replace(re89, '');\n 'Ubebfxbc\\x0a'.replace(re90, '');\n 'Xvab\\x0a'.replace(re89, '');\n 'Xvab\\x0a'.replace(re90, '');\n 'Zbqhyrf'.replace(re2, '');\n 'Zhfvx\\x0a'.replace(re89, '');\n 'Zhfvx\\x0a'.replace(re90, '');\n 'Anpuevpugra\\x0a'.replace(re89, '');\n 'Anpuevpugra\\x0a'.replace(re90, '');\n 'Cuk'.replace(re2, '');\n 'ErdhrfgSvavfu'.split(re70);\n 'ErdhrfgSvavfu.NWNK.Cuk'.split(re70);\n 'Ebhgr\\x0a'.replace(re89, '');\n 'Ebhgr\\x0a'.replace(re90, '');\n str78.split(re32);\n str79.split(re32);\n str80.split(re32);\n str81.split(re32);\n 'Fcbeg\\x0a'.replace(re89, '');\n 'Fcbeg\\x0a'.replace(re90, '');\n 'GI-Fcbg\\x0a'.replace(re89, '');\n 'GI-Fcbg\\x0a'.replace(re90, '');\n 'Gbhe\\x0a'.replace(re89, '');\n 'Gbhe\\x0a'.replace(re90, '');\n 'Hagreunyghat\\x0a'.replace(re89, '');\n 'Hagreunyghat\\x0a'.replace(re90, '');\n 'Ivqrb\\x0a'.replace(re89, '');\n 'Ivqrb\\x0a'.replace(re90, '');\n 'Jrggre\\x0a'.replace(re89, '');\n 'Jrggre\\x0a'.replace(re90, '');\n str82.replace(re68, '');\n str82.replace(re18, '');\n str83.replace(re68, '');\n str83.replace(re18, '');\n str84.replace(re68, '');\n str84.replace(re18, '');\n 'nqiFreivprObk'.replace(re30, '');\n 'nqiFubccvatObk'.replace(re30, '');\n 'nwnk'.replace(re39, '');\n 'nxghryy'.replace(re40, '');\n 'nxghryy'.replace(re41, '');\n 'nxghryy'.replace(re42, '');\n 'nxghryy'.replace(re43, '');\n 'nxghryy'.replace(re44, '');\n 'nxghryy'.replace(re45, '');\n 'nxghryy'.replace(re46, '');\n 'nxghryy'.replace(re47, '');\n 'nxghryy'.replace(re48, '');\n str85.replace(re40, '');\n str85.replace(re41, '');\n str85.replace(re42, '');\n str85.replace(re43, '');\n str85.replace(re44, '');\n str85.replace(re45, '');\n str85.replace(re46, '');\n str85.replace(re47, '');\n str85.replace(re48, '');\n 'pngrtbel'.replace(re29, '');\n 'pngrtbel'.replace(re30, '');\n 'pybfr'.replace(re39, '');\n 'qvi'.replace(re39, '');\n str86.replace(re68, '');\n str86.replace(re18, '');\n 'qg'.replace(re39, '');\n 'qg'.replace(re68, '');\n 'qg'.replace(re18, '');\n 'rzorq'.replace(re39, '');\n 'rzorq'.replace(re68, '');\n 'rzorq'.replace(re18, '');\n 'svryqOga'.replace(re39, '');\n 'svryqOgaPnapry'.replace(re39, '');\n 'svz_zlfcnpr_nccf-pnainf,svz_zlfcnpr_havgrq-fgngrf'.split(re20);\n 'svanamra'.replace(re40, '');\n 'svanamra'.replace(re41, '');\n 'svanamra'.replace(re42, '');\n 'svanamra'.replace(re43, '');\n 'svanamra'.replace(re44, '');\n 'svanamra'.replace(re45, '');\n 'svanamra'.replace(re46, '');\n 'svanamra'.replace(re47, '');\n 'svanamra'.replace(re48, '');\n 'sbphf'.split(re70);\n 'sbphf.gno sbphfva.gno'.split(re70);\n 'sbphfva'.split(re70);\n 'sbez'.replace(re39, '');\n 'sbez.nwnk'.replace(re68, '');\n 'sbez.nwnk'.replace(re18, '');\n 'tnzrf'.replace(re40, '');\n 'tnzrf'.replace(re41, '');\n 'tnzrf'.replace(re42, '');\n 'tnzrf'.replace(re43, '');\n 'tnzrf'.replace(re44, '');\n 'tnzrf'.replace(re45, '');\n 'tnzrf'.replace(re46, '');\n 'tnzrf'.replace(re47, '');\n 'tnzrf'.replace(re48, '');\n 'ubzrcntr'.replace(re30, '');\n 'ubebfxbc'.replace(re40, '');\n 'ubebfxbc'.replace(re41, '');\n 'ubebfxbc'.replace(re42, '');\n 'ubebfxbc'.replace(re43, '');\n 'ubebfxbc'.replace(re44, '');\n 'ubebfxbc'.replace(re45, '');\n 'ubebfxbc'.replace(re46, '');\n 'ubebfxbc'.replace(re47, '');\n 'ubebfxbc'.replace(re48, '');\n 'uc_cebzbobk_ugzy%2Puc_cebzbobk_vzt'.replace(re30, '');\n 'uc_erpgnatyr'.replace(re30, '');\n str87.replace(re33, '');\n str88.replace(re33, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${4}${5}'.replace(re71, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${5}'.replace(re72, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${4}${5}'.replace(re71, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${5}'.replace(re72, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${4}${5}'.replace(re71, '');\n 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${5}'.replace(re72, '');\n str89.replace(re73, '');\n 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&{1}&{2}&[NDR]'.replace(re69, '');\n str6.replace(re23, '');\n 'xvab'.replace(re40, '');\n 'xvab'.replace(re41, '');\n 'xvab'.replace(re42, '');\n 'xvab'.replace(re43, '');\n 'xvab'.replace(re44, '');\n 'xvab'.replace(re45, '');\n 'xvab'.replace(re46, '');\n 'xvab'.replace(re47, '');\n 'xvab'.replace(re48, '');\n 'ybnq'.split(re70);\n 'zrqvnzbqgno lhv-anifrg lhv-anifrg-gbc'.replace(re18, '');\n 'zrgn'.replace(re39, '');\n str90.replace(re68, '');\n str90.replace(re18, '');\n 'zbhfrzbir'.split(re70);\n 'zbhfrzbir.gno'.split(re70);\n str63.replace(/^.*jroxvg\\/(\\d+(\\.\\d+)?).*$/, '');\n 'zhfvx'.replace(re40, '');\n 'zhfvx'.replace(re41, '');\n 'zhfvx'.replace(re42, '');\n 'zhfvx'.replace(re43, '');\n 'zhfvx'.replace(re44, '');\n 'zhfvx'.replace(re45, '');\n 'zhfvx'.replace(re46, '');\n 'zhfvx'.replace(re47, '');\n 'zhfvx'.replace(re48, '');\n 'zlfcnpr_nccf_pnainf'.replace(re52, '');\n str91.replace(re40, '');\n str91.replace(re41, '');\n str91.replace(re42, '');\n str91.replace(re43, '');\n str91.replace(re44, '');\n str91.replace(re45, '');\n str91.replace(re46, '');\n str91.replace(re47, '');\n str91.replace(re48, '');\n 'anzr'.replace(re39, '');\n str92.replace(/\\b\\w+\\b/g, '');\n 'bow-nppbeqvba'.replace(re39, '');\n 'bowrpg'.replace(re39, '');\n 'bowrpg'.replace(re68, '');\n 'bowrpg'.replace(re18, '');\n 'cnenzf%2Rfglyrf'.replace(re29, '');\n 'cnenzf%2Rfglyrf'.replace(re30, '');\n 'cbchc'.replace(re30, '');\n 'ebhgr'.replace(re40, '');\n 'ebhgr'.replace(re41, '');\n 'ebhgr'.replace(re42, '');\n 'ebhgr'.replace(re43, '');\n 'ebhgr'.replace(re44, '');\n 'ebhgr'.replace(re45, '');\n 'ebhgr'.replace(re46, '');\n 'ebhgr'.replace(re47, '');\n 'ebhgr'.replace(re48, '');\n 'freivprobk_uc'.replace(re30, '');\n 'fubccvatobk_uc'.replace(re30, '');\n 'fubhgobk'.replace(re39, '');\n 'fcbeg'.replace(re40, '');\n 'fcbeg'.replace(re41, '');\n 'fcbeg'.replace(re42, '');\n 'fcbeg'.replace(re43, '');\n 'fcbeg'.replace(re44, '');\n 'fcbeg'.replace(re45, '');\n 'fcbeg'.replace(re46, '');\n 'fcbeg'.replace(re47, '');\n 'fcbeg'.replace(re48, '');\n 'gbhe'.replace(re40, '');\n 'gbhe'.replace(re41, '');\n 'gbhe'.replace(re42, '');\n 'gbhe'.replace(re43, '');\n 'gbhe'.replace(re44, '');\n 'gbhe'.replace(re45, '');\n 'gbhe'.replace(re46, '');\n 'gbhe'.replace(re47, '');\n 'gbhe'.replace(re48, '');\n 'gi-fcbg'.replace(re40, '');\n 'gi-fcbg'.replace(re41, '');\n 'gi-fcbg'.replace(re42, '');\n 'gi-fcbg'.replace(re43, '');\n 'gi-fcbg'.replace(re44, '');\n 'gi-fcbg'.replace(re45, '');\n 'gi-fcbg'.replace(re46, '');\n 'gi-fcbg'.replace(re47, '');\n 'gi-fcbg'.replace(re48, '');\n 'glcr'.replace(re39, '');\n 'haqrsvarq'.replace(/\\//g, '');\n str93.replace(re40, '');\n str93.replace(re41, '');\n str93.replace(re42, '');\n str93.replace(re43, '');\n str93.replace(re44, '');\n str93.replace(re45, '');\n str93.replace(re46, '');\n str93.replace(re47, '');\n str93.replace(re48, '');\n 'ivqrb'.replace(re40, '');\n 'ivqrb'.replace(re41, '');\n 'ivqrb'.replace(re42, '');\n 'ivqrb'.replace(re43, '');\n 'ivqrb'.replace(re44, '');\n 'ivqrb'.replace(re45, '');\n 'ivqrb'.replace(re46, '');\n 'ivqrb'.replace(re47, '');\n 'ivqrb'.replace(re48, '');\n 'ivfvgf=1'.split(re86);\n 'jrggre'.replace(re40, '');\n 'jrggre'.replace(re41, '');\n 'jrggre'.replace(re42, '');\n 'jrggre'.replace(re43, '');\n 'jrggre'.replace(re44, '');\n 'jrggre'.replace(re45, '');\n 'jrggre'.replace(re46, '');\n 'jrggre'.replace(re47, '');\n 'jrggre'.replace(re48, '');\n /#[a-z0-9]+$/i.exec('uggc://jjj.fpuhryreim.arg/Qrsnhyg');\n re66.exec('fryrpgrq');\n /(?:^|\\s+)lhv-ani(?:\\s+|$)/.exec('sff lhv-ani');\n /(?:^|\\s+)lhv-anifrg(?:\\s+|$)/.exec('zrqvnzbqgno lhv-anifrg');\n /(?:^|\\s+)lhv-anifrg-gbc(?:\\s+|$)/.exec('zrqvnzbqgno lhv-anifrg');\n re91.exec('GnoThvq');\n re91.exec('thvq');\n /(pbzcngvoyr|jroxvg)/.exec(str63);\n /.+(?:ei|vg|en|vr)[\\/: ]([\\d.]+)/.exec(str63);\n re8.exec('144631658.0.10.1231365869');\n re8.exec('144631658.0.10.1231367054');\n re8.exec('144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('144631658.1670816052019209000.1231365869.1231365869.1231365869.1');\n re8.exec('144631658.1796080716621419500.1231367054.1231367054.1231367054.1');\n re8.exec(str94);\n re8.exec(str95);\n re8.exec(str96);\n re8.exec(str97);\n re8.exec('__hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1');\n re8.exec('__hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1');\n re8.exec('__hgzo=144631658.0.10.1231365869');\n re8.exec('__hgzo=144631658.0.10.1231367054');\n re8.exec('__hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re8.exec('__hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)');\n re34.exec(str78);\n re34.exec(str79);\n re34.exec(str81);\n re74.exec(str77);\n re74.exec('*');\n re74.exec(str82);\n re74.exec(str83);\n re74.exec(str86);\n re74.exec('rzorq');\n re74.exec('sbez.nwnk');\n re74.exec(str90);\n re74.exec('bowrpg');\n /\\/onfr.wf(\\?.+)?$/.exec('/uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf');\n re28.exec('uvag ynfgUvag ynfg');\n re75.exec('');\n re76.exec('');\n re77.exec('');\n re78.exec('');\n re80.exec(str77);\n re80.exec('*');\n re80.exec('.pybfr');\n re80.exec(str82);\n re80.exec(str83);\n re80.exec(str84);\n re80.exec(str86);\n re80.exec('qg');\n re80.exec('rzorq');\n re80.exec('sbez.nwnk');\n re80.exec(str90);\n re80.exec('bowrpg');\n re61.exec('qlaYvo.wf');\n re61.exec('rssrpgYvo.wf');\n re61.exec('uggc://jjj.tzk.arg/qr/?fgnghf=uvajrvf');\n re92.exec(' .pybfr');\n re92.exec(' n.svryqOgaPnapry');\n re92.exec(' qg');\n re92.exec(str48);\n re92.exec('.nwnk');\n re92.exec('.svryqOga,n.svryqOgaPnapry');\n re92.exec('.svryqOgaPnapry');\n re92.exec('.bow-nppbeqvba qg');\n re68.exec(str77);\n re68.exec('*');\n re68.exec('.pybfr');\n re68.exec(str82);\n re68.exec(str83);\n re68.exec(str84);\n re68.exec(str86);\n re68.exec('qg');\n re68.exec('rzorq');\n re68.exec('sbez.nwnk');\n re68.exec(str90);\n re68.exec('bowrpg');\n re93.exec(' .pybfr');\n re93.exec(' n.svryqOgaPnapry');\n re93.exec(' qg');\n re93.exec(str48);\n re93.exec('.nwnk');\n re93.exec('.svryqOga,n.svryqOgaPnapry');\n re93.exec('.svryqOgaPnapry');\n re93.exec('.bow-nppbeqvba qg');\n re81.exec(str77);\n re81.exec('*');\n re81.exec(str48);\n re81.exec('.pybfr');\n re81.exec(str82);\n re81.exec(str83);\n re81.exec(str84);\n re81.exec(str86);\n re81.exec('qg');\n re81.exec('rzorq');\n re81.exec('sbez.nwnk');\n re81.exec(str90);\n re81.exec('bowrpg');\n re94.exec(' .pybfr');\n re94.exec(' n.svryqOgaPnapry');\n re94.exec(' qg');\n re94.exec(str48);\n re94.exec('.nwnk');\n re94.exec('.svryqOga,n.svryqOgaPnapry');\n re94.exec('.svryqOgaPnapry');\n re94.exec('.bow-nppbeqvba qg');\n re94.exec('[anzr=nwnkHey]');\n re94.exec(str82);\n re31.exec('rf');\n re31.exec('wn');\n re82.exec(str77);\n re82.exec('*');\n re82.exec(str48);\n re82.exec('.pybfr');\n re82.exec(str82);\n re82.exec(str83);\n re82.exec(str84);\n re82.exec(str86);\n re82.exec('qg');\n re82.exec('rzorq');\n re82.exec('sbez.nwnk');\n re82.exec(str90);\n re82.exec('bowrpg');\n re83.exec(str98);\n re83.exec('shapgvba sbphf() { [angvir pbqr] }');\n re62.exec('#Ybtva');\n re62.exec('#Ybtva_cnffjbeq');\n re62.exec(str77);\n re62.exec('#fubhgobkWf');\n re62.exec('#fubhgobkWfReebe');\n re62.exec('#fubhgobkWfFhpprff');\n re62.exec('*');\n re62.exec(str82);\n re62.exec(str83);\n re62.exec(str86);\n re62.exec('rzorq');\n re62.exec('sbez.nwnk');\n re62.exec(str90);\n re62.exec('bowrpg');\n re49.exec('pbagrag');\n re24.exec(str6);\n /xbadhrebe/.exec(str63);\n /znp/.exec('jva32');\n /zbmvyyn/.exec(str63);\n /zfvr/.exec(str63);\n /ag\\s5\\.1/.exec(str63);\n /bcren/.exec(str63);\n /fnsnev/.exec(str63);\n /jva/.exec('jva32');\n /jvaqbjf/.exec(str63);\n }\n }\n for (var i = 0; i < 5; i++) {\n runBlock0();\n runBlock1();\n runBlock2();\n runBlock3();\n runBlock4();\n runBlock5();\n runBlock6();\n runBlock7();\n runBlock8();\n runBlock9();\n runBlock10();\n runBlock11();\n }\n}", "title": "" }, { "docid": "ed797c5898de04de152b301de4f377fb", "score": "0.5499719", "text": "function shortHand(re,str){\n if(re.test(str)){\n console.log(`${str} matches ${re.source}`); //this returns fgsjgjhbxh matches x(?!y)\n }else{\n console.log(`${str} does not match ${re.source}`); // this returns nothing\n }\n}", "title": "" }, { "docid": "cb9ca4b90b89a699d8aa51042d513bbb", "score": "0.5499637", "text": "function t(r){let t=e$1;return r.split(\"/\").forEach((r=>{t&&(t=t[r]);})),t}", "title": "" }, { "docid": "1eb496a8a85e0794b457532e16a9e64d", "score": "0.5495685", "text": "function regularExpression() {\nlet cadena =\"entrenando hola mundo ej javaScript lorem \";\nlet expReg = new RegExp(\"lorem\", \"i\"); // banderas i ignora myusculas y minisculas, g rodas\nlet expReg2= /lorem/i;\nconsole.log(expReg.test(cadena));\nconsole.log(expReg.exec(cadena));\nconsole.log(expReg2.test(cadena));\nconsole.log(expReg2.exec(cadena));\n }", "title": "" }, { "docid": "8a20629c7c496b4898c3fdb9d37ab633", "score": "0.54875064", "text": "function regexExpression() {\n /**\n * accessing the regexExpression method from util\n */\n access.regexExpression();\n}", "title": "" }, { "docid": "690ffc222048b78b105bb88630c8ac25", "score": "0.54600954", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n let re = /^([aeiou]).*\\1$/;\n\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "ee2ad7ccb171b946d0bf4bb07a0ffff4", "score": "0.5454382", "text": "match(regEx) {\n // this.s can either be a string, if it's made up only of ASCII chars\n // or an array of graphemes, if it's more complicated.\n let execResult;\n if (typeof this.s === 'string') {\n execResult = regEx.exec(this.s.slice(this.pos));\n }\n else {\n execResult = regEx.exec(this.s.slice(this.pos).join(''));\n }\n if (execResult === null || execResult === void 0 ? void 0 : execResult[0]) {\n this.pos += execResult[0].length;\n return execResult[0];\n }\n return null;\n }", "title": "" }, { "docid": "aec04ba68cbf598359c849ef562cbe7f", "score": "0.54502076", "text": "function t$1(r){let t=e$1;return r.split(\"/\").forEach((r=>{t&&(t=t[r]);})),t}", "title": "" }, { "docid": "ae4e097b1d5b9dbd4b0ffa06cc399a01", "score": "0.54484683", "text": "function regexHelper(regex, os) {\n return (regex.test(os.dist) ||\n (!(0, utils_1.isNullOrUndefined)(os.id_like) ? os.id_like.filter((v) => regex.test(v)).length >= 1 : false));\n}", "title": "" }, { "docid": "219495308e99c153dd109ccace4b631c", "score": "0.54472476", "text": "function forceToRegExp(text,regexp){\n\t\n}", "title": "" }, { "docid": "f55ca360ac6716cd77bf5dc86136f22f", "score": "0.54426897", "text": "function composer_re(email) {\n let lines = email.body.split(/\\r?\\n/);\n for (let i = 0; i < lines.length; i++) {\n lines[i] = '> ' + lines[i];\n }\n let re = `\\n\\nOn ${email.date} ${email.from.replace(/\\s*<.+?>/, '')} wrote:\\n`;\n re += lines.join(\"\\n\");\n return re;\n}", "title": "" }, { "docid": "108d12482d8422557f1563d57eff82cb", "score": "0.54417366", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts with 'Mr.', 'Mrs.', 'Ms.', 'Dr.', or 'Er.', \n * followed by one or more letters.\n */\n\n\n const re = /^(Mr|Mrs|Ms|Dr|Er)[.][a-zA-Z]*$/;\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "3a01d0c398f828952496c0097968839f", "score": "0.5430461", "text": "function convertTypescriptMatchToJestRegex(match) {\n const regex = match\n .split('/')\n .map((segment) =>\n segment.trim() === '*' ? '(.*)' : segment.replace(/[-\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n )\n .join('/');\n\n return `^${regex}$`;\n}", "title": "" }, { "docid": "8d952a6fd24dcbb4d54086533424acde", "score": "0.54302657", "text": "function match_name(name) { }", "title": "" }, { "docid": "53374acaf99634104e0a8a1963f0818b", "score": "0.5426097", "text": "function case8(){\r\n var text = \"helloherk\";\r\n var pattern = /llo(?!j)/;\r\n var matches = pattern.exec(text);\r\n console.log(matches);\r\n}", "title": "" }, { "docid": "208854c3f1af797cff38b1d582484ddb", "score": "0.5405614", "text": "function patternToRegExp(str) {\r\n\t\t\treturn new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');\r\n\t\t}", "title": "" }, { "docid": "693b4ddeba9325533587710bfac2d6ae", "score": "0.5396834", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n\n let re = /^([aeiou]).*\\1$/;\n\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "1082a68395a08716f361efedef201b26", "score": "0.5391507", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n var re = new RegExp('^([aeiou]).*\\\\1$');\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "3904cf72d5fc50261b4634311b9cd7e0", "score": "0.53874934", "text": "function comprovaRegex() {\n let valid = true;\n let missatgeError = 'No concorda amb el format.';\n\n // http://emailregex.com/\n let regexEmail = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\n\n let regexTelefon = /^(\\+[0-9]{2,4}\\s)?[0-9]{3,14}$/;\n\n // https://regexr.com/3e4a2\n let regexWeb = /^(https?:\\/\\/)?(www\\.)[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)|(https?:\\/\\/)?(www\\.)?(?!ww)[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$/;\n\n if ($('#email').val() && !regexEmail.test($('#email').val())) {\n valid = false;\n $('#erroremail').html(missatgeError);\n $('#grupemail').css('border', '1px solid red');\n }\n\n if (!regexTelefon.test($('#telefon').val())) {\n valid = false;\n $('#errortelefon').html(missatgeError);\n $('#gruptelefon').css('border', '1px solid red');\n }\n\n if ($('#paginaweb').val() && !regexWeb.test($('#paginaweb').val())) {\n valid = false;\n $('#errorpaginaweb').html(missatgeError);\n $('#gruppaginaweb').css('border', '1px solid red');\n }\n\n return valid;\n}", "title": "" }, { "docid": "d888c2eb03f22d6a38847d018ea5e212", "score": "0.5382901", "text": "function yb(a){return a.substring(0,a.indexOf(\"/\",a.indexOf(\"//\")+2))}", "title": "" }, { "docid": "85b1e28abcc062d8dc61e02e03eb4c87", "score": "0.53782845", "text": "function tryCreateRegexp(src,flags,throwErrorAt,parser){try{return new RegExp(src,flags);}catch(e){if(throwErrorAt!==undefined){if(e instanceof SyntaxError)parser.raise(throwErrorAt,\"Error parsing regular expression: \"+e.message);throw e;}}}", "title": "" }, { "docid": "23247dd49b4a3ef0a72dba90c9915cee", "score": "0.5375261", "text": "function getClenRegExp(){\r\n var re = /([\\s\\+]+\\(\\d+\\)|(%2C|,)[\\s\\+]The|(%2C|,)[\\s\\+]The[\\s\\+]+\\(\\d+\\))$/i;\r\n return re;\r\n}", "title": "" }, { "docid": "7e43420f48a2988a4edeb0a549390d90", "score": "0.5362991", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "645bf9ffebe26d79453efacb1a8311a1", "score": "0.5344738", "text": "function returnOneSubstring(regex,input){\n\t\tregex.exec(input);\t \n\t\treturn RegExp.$1;\n\t}", "title": "" }, { "docid": "43b17737d7f1f54b397162366bda6a94", "score": "0.53421503", "text": "function zd(a){return a.substring(0,a.indexOf(\"/\",a.indexOf(\"//\")+2))}", "title": "" }, { "docid": "9c8bf6040db6988384898b20c09ac4f9", "score": "0.5341772", "text": "function b1(e,t){var n=new RegExp(\"^\".concat(!e&&e!==0?\"\":e,\"$\")),r=Wd(t);return r.findIndex(function(a){return n.test(a)})}", "title": "" }, { "docid": "6ae01952807d2f9da19173f801ff155f", "score": "0.5337374", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match ALL occurrences of numbers in a string.\n */\n\n\n let re = /(?!=\\.)[0-9]+/g;\n}", "title": "" }, { "docid": "6ef3032e7b25500783e0f43c56d7f3bb", "score": "0.5335879", "text": "function r(a){\n//match single stars\nfor(var b=a.split(\".\"),c=x.$current.name.split(\".\"),d=0,e=b.length;e>d;d++)\"*\"===b[d]&&(c[d]=\"*\");\n//match greedy starts\n//match greedy ends\nreturn\"**\"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift(\"**\")),\"**\"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push(\"**\")),b.length!=c.length?!1:c.join(\"\")===b.join(\"\")}", "title": "" }, { "docid": "a4f838b52acd734647ddd0f4be5cf24e", "score": "0.53303087", "text": "function f(e){var t=String(e);if(o.test(t))return t;if(t.length>0&&!a.test(t))throw new TypeError(\"invalid parameter value\");return'\"'+t.replace(c,\"\\\\$1\")+'\"'}", "title": "" }, { "docid": "89b354810f25fa5042d85b8740814a28", "score": "0.5326234", "text": "function extendRegExp(regex, pre, post) {\n\tvar pattern = regex.toString(),\n\t\tflags = \"\",\n\t\tresult;\n\t\t\n\tif (pre === null || pre === undefined)\n\t{\n\t\tpre = \"\";\n\t}\n\t\n\tif(post === null || post === undefined)\n\t{\n\t\tpost = \"\";\n\t}\n\n\t// Replace the flags with empty space and store them.\n\t// Technically, this can match incorrect flags like \"gmm\".\n\tresult = pattern.match(/\\/([gim]*)$/);\n\t\n\tif (result) {\n\t\tflags = result[1];\n\t} else {\n\t\tflags = \"\";\n\t}\n\t\n\t// Remove the flags and slash delimiters from the regular expression.\n\tpattern = pattern.replace(/(^\\/|\\/[gim]*$)/g, \"\");\n\tpattern = pre + pattern + post;\n\t\n\treturn new RegExp(pattern, flags);\n}", "title": "" }, { "docid": "884882e18dc1a7228cf49d0a9589d078", "score": "0.53216386", "text": "function pattern(elem) {\n return stringOrIdentifier(elem, \"pattern\");\n}", "title": "" }, { "docid": "600941a50a32aa320ffb6c755138ebb7", "score": "0.53162706", "text": "function ae(se,le){\"/\"!==se.charAt(0)&&(se=\"/\"+se);var de=$(se),ce=de.regexpSource,ue=de.paramNames,pe=de.tokens;\"/\"!==se.charAt(se.length-1)&&(ce+=\"/?\"),\"*\"===pe[pe.length-1]&&(ce+=\"$\");var me=le.match(new RegExp(\"^\"+ce,\"i\"));if(null==me)return null;var he=me[0],fe=le.substr(he.length);if(fe){// Require that the match ends at a path separator, if we didn't match\n// the full path, so any remaining pathname is a new path segment.\nif(\"/\"!==he.charAt(he.length-1))return null;// If there is a remaining pathname, treat the path separator as part of\n// the remaining pathname for properly continuing the match.\nfe=\"/\"+fe}return{remainingPathname:fe,paramNames:ue,paramValues:me.slice(1).map(function(ge){return ge&&decodeURIComponent(ge)})}}", "title": "" }, { "docid": "9984c3b643917e078087766c7af6c545", "score": "0.5311579", "text": "function gameresult( txt ){\n var t = txt.trim();\n if ( t.endsWith(\"1-0\")) {\n return \"1-0\";\n } else if ( t.endsWith(\"0-1\")){\n return \"0-1\";\n } else if ( t.endsWith(\"1/2-1/2\")){\n return \"1/2-1/2\";\n } else if ( t.endsWith(\"*\")){\n return \"1/2-1/2\";\n } else {\n return \"?\";\n }\n}", "title": "" }, { "docid": "dde4153e4391c4f3a07d6e07de226fa4", "score": "0.52930105", "text": "function regex_match(inputname,msg,pattern)\n{\n\treturn regex_match_msg(inputname,msg,pattern,ILLEGAL_REGEX);\n}", "title": "" }, { "docid": "997c76e6d246dc2c8241d6c52deabce1", "score": "0.52903014", "text": "function matchtag(f,g) {return new RegExp('<'+f+'(?: xml:space=\"preserve\")?>([^\\u2603]*)</'+f+'>',(g||\"\")+\"m\");}", "title": "" }, { "docid": "8816aa6ac2b8152693cf1daddffb54e9", "score": "0.52902937", "text": "function main() {\n\tvar s = 'hi1234there567';\n\tvar reString = '\\\\D+' + '\\\\d+';\n\tvar re = new RegExp(reString);\n\n\tprint(s.match(re)[0]);\n}", "title": "" }, { "docid": "7a2ec6a2cbfc22b16e62cb548dd5ac89", "score": "0.52896285", "text": "function patternToRegExp(str) {\n\t\t\treturn new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');\n\t\t}", "title": "" }, { "docid": "7a2ec6a2cbfc22b16e62cb548dd5ac89", "score": "0.52896285", "text": "function patternToRegExp(str) {\n\t\t\treturn new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');\n\t\t}", "title": "" }, { "docid": "4851d726b30d1eea82aa078aa0aed1bd", "score": "0.52881736", "text": "static get descriptionRegex1() {\n return /^v([\\d.]+)-(\\d+)-g(\\w+)-?(\\w+)*/g;\n }", "title": "" }, { "docid": "4a8ed6a90ce1c6e5fa993a8c1aa2a947", "score": "0.52866256", "text": "function testReg (reg, str) {\n console.log(str.match(reg))\n}", "title": "" }, { "docid": "5411312c146c92275cc1a0113a2a8a98", "score": "0.52835184", "text": "function case2(){\r\n var text = \"cat, bat, sat, fat\";\r\n var pattern = /.at/g;\r\n \r\n var matches = pattern.exec(text);\r\n console.log(RegExp.lastMatch);\r\n \r\n text = \"this has been a short summer\";\r\n pattern = /(..)or(.)/g;\r\n \r\n if(pattern.test(text)) {\r\n console.log(RegExp.$1);\r\n console.log(RegExp.$2);\r\n }\r\n \r\n var result = /hello/.test(\"jkjkj\");\r\n console.log(result);\r\n}", "title": "" }, { "docid": "2eba1beaf1a13d2fe915d511e4f5004f", "score": "0.5277093", "text": "function y(t,e){var n=t&&t.exec(e);return n&&0===n.index}", "title": "" }, { "docid": "4405b411176d83148b2719a37f8fb846", "score": "0.52759194", "text": "function case4() {\r\n var pattern = /(some)/;\r\n var pattern2 = /(?:some)/;\r\n var text = \"something\";\r\n var matches = pattern.exec(text);\r\n var matches2 = pattern2.exec(text);\r console.log(matches);\r\n console.log(matches2);\r\n}", "title": "" }, { "docid": "cde3e0b522c5b5f74ea059f557d38e57", "score": "0.5275334", "text": "function helper1(r) {\n assertTrue(r.test(\"firstuxz89second\"));\n }", "title": "" }, { "docid": "42a48f6fa2f08e28e5b8041d448273f0", "score": "0.52743614", "text": "function regi(string){\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}", "title": "" }, { "docid": "e1f157b2eaf5214ff805ec051d93db09", "score": "0.5273655", "text": "wrappedEvalTextContainsExpression(exp, regex) {\n return exp\n .split('')\n .reverse()\n .join('')\n .replace(regex, (sub) => this.evalExpression(sub.split('').reverse().join('')).toString().split('').reverse().join(''))\n .split('')\n .reverse()\n .join('');\n }", "title": "" }, { "docid": "7ec6ec325e6eec3672ea933f36496595", "score": "0.527331", "text": "static regex(qualifyingIoEventTypes, fullPathRegex, regexFlags) {\n\n var parsedRegex = null;\n var typeEvaluator = EvaluatorUtil.ioEventType(qualifyingIoEventTypes);\n\n if (typeof(regexFlags) != 'undefined') {\n parsedRegex = new RegExp(fullPathRegex,regexFlags);\n } else {\n parsedRegex = new RegExp(fullPathRegex);\n }\n\n return function(ioEvent) {\n if (typeEvaluator(ioEvent)) {\n parsedRegex.lastIndex = 0;\n return parsedRegex.exec(ioEvent.fullPath);\n } else {\n return false;\n }\n };\n }", "title": "" }, { "docid": "13ea45ab03649de7635b7bca6f907e03", "score": "0.5271355", "text": "function createRegExp(data) {\n return new RegExp(data, \"i\");\n }", "title": "" }, { "docid": "c2794ebe4c993da9b4f444bd05125df1", "score": "0.52704895", "text": "function match1(re) {\n return match(re)[1];\n }", "title": "" }, { "docid": "5ea459a96177a30c1fc92ba72c740a13", "score": "0.5269755", "text": "function deComposeMatch (where) {\n \n var file = /at\\s(.*):/.exec(where);\n var line =/:(\\d*)/.exec(where);\n var caller =/:.*\\((.*)\\)/.exec(where);\n\n return {file: file ? file[1] : 'unknown'};\n\n //return {caller:caller ? caller[1] : 'unknown' ,line: line ? line[1] : \n //'unknown',file: file ? file[1] : 'unknown'};\n\n }", "title": "" }, { "docid": "20938f81e59c62f21bb32491da313367", "score": "0.5259184", "text": "function getPrimNameRegex() {\r\n\treturn \"^[\\\\w\\\\-\\\\.\\\\+\\\\^\\\\s]+$\";\r\n}", "title": "" }, { "docid": "df91aba08f7fe7be9826c85744f96153", "score": "0.5257346", "text": "function generateregex()\r\n{\r\n\ttest = [\"sample\", \"test\", \"join\", \"center\"];\r\n\tvar regexp = new RegExp(test.join(\"|\"));\r\n\r\ndocument.getElementById(\"demo1\").innerHTML = regexp;\r\n}", "title": "" }, { "docid": "e2268bf1f9169390bd0c460fbcc82022", "score": "0.52558255", "text": "function regexpToRegexp(path, keys) {\n if (!keys)\n return path;\n // Use a negative lookahead to match only capturing groups.\n const groups = path.source.match(/\\((?!\\?)/g);\n if (groups) {\n for (let i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n });\n }\n }\n return path;\n }", "title": "" } ]
d03668dc541db5068d007cc45918fbd1
Executing both pixelPosition & boxSizingReliable tests require only one layout so they're executed at the same time to save the second computation.
[ { "docid": "267a9a3dbc96190ab433ee4e4fa4c918", "score": "0.0", "text": "function computeStyleTests(){// This is a singleton, we need to execute it only once\nif(!div){return;}div.style.cssText=\"box-sizing:border-box;\"+\"position:relative;display:block;\"+\"margin:auto;border:1px;padding:1px;\"+\"top:1%;width:50%\";div.innerHTML=\"\";documentElement.appendChild(container);var divStyle=window.getComputedStyle(div);pixelPositionVal=divStyle.top!==\"1%\";// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\nreliableMarginLeftVal=divStyle.marginLeft===\"2px\";boxSizingReliableVal=divStyle.width===\"4px\";// Support: Android 4.0 - 4.3 only\n// Some styles come back with percentage values, even though they shouldn't\ndiv.style.marginRight=\"50%\";pixelMarginRightVal=divStyle.marginRight===\"4px\";documentElement.removeChild(container);// Nullify the div so it wouldn't be stored in the memory and\n// it will also be a sign that checks already performed\ndiv=null;}", "title": "" } ]
[ { "docid": "734bd7937701bcfa8baf98d76927a716", "score": "0.7663661", "text": "function computePixelPositionAndBoxSizingReliable() {\n div[$fog$565][$fog$573] =\n // Support: Firefox<29, Android 2.3\n // Vendor-prefix box-sizing\n $fog$576 +\n $fog$577 +\n $fog$578;\n div[$fog$196] = $fog$20;\n docElem[$fog$60]( container );\n\n var divStyle = window[$fog$564]( div, $fog$23 );\n pixelPositionVal = divStyle[$fog$179] !== $fog$579;\n boxSizingReliableVal = divStyle[$fog$567] === $fog$580;\n\n docElem[$fog$58]( container );\n }", "title": "" }, { "docid": "ea5144ef22f3783a381495bf6d307905", "score": "0.7208431", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t\tdiv.style.cssText =\n\t\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t\t// Vendor-prefix box-sizing\n\t\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocElem.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\tdocElem.removeChild( container );\n\t\t}", "title": "" }, { "docid": "ea5144ef22f3783a381495bf6d307905", "score": "0.7208431", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t\tdiv.style.cssText =\n\t\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t\t// Vendor-prefix box-sizing\n\t\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocElem.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\tdocElem.removeChild( container );\n\t\t}", "title": "" }, { "docid": "ea5144ef22f3783a381495bf6d307905", "score": "0.7208431", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t\tdiv.style.cssText =\n\t\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t\t// Vendor-prefix box-sizing\n\t\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocElem.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\tdocElem.removeChild( container );\n\t\t}", "title": "" }, { "docid": "42e5f629cc2451974564f8c463f16073", "score": "0.72075", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t\tdiv.style.cssText =\n\t\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t\t// Vendor-prefix box-sizing\n\t\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocElem.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\tdocElem.removeChild( container );\n\t\t}", "title": "" }, { "docid": "42e5f629cc2451974564f8c463f16073", "score": "0.72075", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t\tdiv.style.cssText =\n\t\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t\t// Vendor-prefix box-sizing\n\t\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocElem.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\tdocElem.removeChild( container );\n\t\t}", "title": "" }, { "docid": "d242be84c31e4cb6def88f695929a955", "score": "0.72008705", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" + \"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" + \"border:1px;padding:1px;width:4px;position:absolute\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocElem.appendChild(container);\n\n\t\t\tvar divStyle = window.getComputedStyle(div, null);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\tdocElem.removeChild(container);\n\t\t}", "title": "" }, { "docid": "4d091b16af1608403032b92fc7db92e6", "score": "0.7151385", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t\t\t\"position:absolute;top:1%\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "4d091b16af1608403032b92fc7db92e6", "score": "0.7151385", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t\t\t\"position:absolute;top:1%\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "4d091b16af1608403032b92fc7db92e6", "score": "0.7151385", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t\t\t\"position:absolute;top:1%\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "4d091b16af1608403032b92fc7db92e6", "score": "0.7151385", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t\t\t\"position:absolute;top:1%\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "4d091b16af1608403032b92fc7db92e6", "score": "0.7151385", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\t// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t\tdiv.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t\t\t\"position:absolute;top:1%\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "3536f6979073f6c456d46bdaf0f224cb", "score": "0.7132828", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}", "title": "" }, { "docid": "766e46e1d76025ec1ba53bb917948561", "score": "0.71149755", "text": "function computePixelPositionAndBoxSizingReliable() {\n div.style.cssText =\n // Support: Firefox<29, Android 2.3\n // Vendor-prefix box-sizing\n \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n \"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n \"border:1px;padding:1px;width:4px;position:absolute\";\n div.innerHTML = \"\";\n docElem.appendChild(container);\n\n var divStyle = window.getComputedStyle(div, null);\n pixelPositionVal = divStyle.top !== \"1%\";\n boxSizingReliableVal = divStyle.width === \"4px\";\n\n docElem.removeChild(container);\n }", "title": "" }, { "docid": "ab612f699c11a70c92b0e076277b76ed", "score": "0.69938284", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t div.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t \"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t \"position:absolute;top:1%\";\n\t docElem.appendChild(container);\n\t\n\t var divStyle = window.getComputedStyle(div, null);\n\t pixelPositionVal = divStyle.top !== \"1%\";\n\t boxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t docElem.removeChild(container);\n\t}", "title": "" }, { "docid": "ab612f699c11a70c92b0e076277b76ed", "score": "0.69938284", "text": "function computePixelPositionAndBoxSizingReliable() {\n\t // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).\n\t div.style.cssText = \"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t \"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;\" +\n\t \"position:absolute;top:1%\";\n\t docElem.appendChild(container);\n\t\n\t var divStyle = window.getComputedStyle(div, null);\n\t pixelPositionVal = divStyle.top !== \"1%\";\n\t boxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t docElem.removeChild(container);\n\t}", "title": "" }, { "docid": "23b425d7da4920f1562052bbf6ca1ef2", "score": "0.6621201", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif (!div) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText = \"box-sizing:border-box;\" + \"position:relative;display:block;\" + \"margin:auto;border:1px;padding:1px;\" + \"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild(container);\n\n\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "23b425d7da4920f1562052bbf6ca1ef2", "score": "0.6621201", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif (!div) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText = \"box-sizing:border-box;\" + \"position:relative;display:block;\" + \"margin:auto;border:1px;padding:1px;\" + \"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild(container);\n\n\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "23b425d7da4920f1562052bbf6ca1ef2", "score": "0.6621201", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif (!div) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText = \"box-sizing:border-box;\" + \"position:relative;display:block;\" + \"margin:auto;border:1px;padding:1px;\" + \"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild(container);\n\n\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "23b425d7da4920f1562052bbf6ca1ef2", "score": "0.6621201", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif (!div) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText = \"box-sizing:border-box;\" + \"position:relative;display:block;\" + \"margin:auto;border:1px;padding:1px;\" + \"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild(container);\n\n\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "23b425d7da4920f1562052bbf6ca1ef2", "score": "0.6621201", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif (!div) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText = \"box-sizing:border-box;\" + \"position:relative;display:block;\" + \"margin:auto;border:1px;padding:1px;\" + \"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild(container);\n\n\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "f8b92a3e743c6ee9b7ee69d1a0b826b6", "score": "0.6570715", "text": "function computeStyleTests() {\n\n\t\t\t\t// This is a singleton, we need to execute it only once\n\t\t\t\tif (!div) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdiv.style.cssText = \"box-sizing:border-box;\" + \"position:relative;display:block;\" + \"margin:auto;border:1px;padding:1px;\" + \"top:1%;width:50%\";\n\t\t\t\tdiv.innerHTML = \"\";\n\t\t\t\tdocumentElement.appendChild(container);\n\n\t\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t\t// it will also be a sign that checks already performed\n\t\t\t\tdiv = null;\n\t\t\t}", "title": "" }, { "docid": "a9730bc310b6d48f1db31231b9ecc1d3", "score": "0.6488426", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"width:60%;top:1%\";\n\t\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.right = \"60%\";\n\t\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t\t// Support: IE 9 - 11 only\n\t\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t\t// Support: IE 9 only\n\t\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t\t// Support: Chrome <=64\n\t\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\t\tdiv.style.position = \"absolute\";\n\t\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "a9730bc310b6d48f1db31231b9ecc1d3", "score": "0.6488426", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"width:60%;top:1%\";\n\t\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.right = \"60%\";\n\t\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t\t// Support: IE 9 - 11 only\n\t\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t\t// Support: IE 9 only\n\t\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t\t// Support: Chrome <=64\n\t\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\t\tdiv.style.position = \"absolute\";\n\t\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "d030967d9991f4c97e25d7cbcadc1758", "score": "0.647867", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "d030967d9991f4c97e25d7cbcadc1758", "score": "0.647867", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "d030967d9991f4c97e25d7cbcadc1758", "score": "0.647867", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "d030967d9991f4c97e25d7cbcadc1758", "score": "0.647867", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "d030967d9991f4c97e25d7cbcadc1758", "score": "0.647867", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "d030967d9991f4c97e25d7cbcadc1758", "score": "0.647867", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "d030967d9991f4c97e25d7cbcadc1758", "score": "0.647867", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\n\t\t\tdocumentElement.removeChild( container );\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "375c0c3306b6221a7090eabcced8793a", "score": "0.64766717", "text": "function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container); // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n\n div = null;\n }", "title": "" }, { "docid": "375c0c3306b6221a7090eabcced8793a", "score": "0.64766717", "text": "function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container); // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n\n div = null;\n }", "title": "" }, { "docid": "375c0c3306b6221a7090eabcced8793a", "score": "0.64766717", "text": "function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container); // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n\n div = null;\n }", "title": "" }, { "docid": "375c0c3306b6221a7090eabcced8793a", "score": "0.64766717", "text": "function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container); // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n\n div = null;\n }", "title": "" }, { "docid": "375c0c3306b6221a7090eabcced8793a", "score": "0.64766717", "text": "function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container); // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n\n div = null;\n }", "title": "" }, { "docid": "375c0c3306b6221a7090eabcced8793a", "score": "0.64766717", "text": "function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container); // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n\n div = null;\n }", "title": "" }, { "docid": "117a157f3d1ee8d17ee523c6449dc288", "score": "0.6462988", "text": "function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (div) {\n div.style.cssText = \"box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%\", \n div.innerHTML = \"\", documentElement.appendChild(container);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = \"1%\" !== divStyle.top, // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n reliableMarginLeftVal = \"2px\" === divStyle.marginLeft, boxSizingReliableVal = \"4px\" === divStyle.width, \n // Support: Android 4.0 - 4.3 only\n // Some styles come back with percentage values, even though they shouldn't\n div.style.marginRight = \"50%\", pixelMarginRightVal = \"4px\" === divStyle.marginRight, \n documentElement.removeChild(container), // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n div = null;\n }\n }", "title": "" }, { "docid": "dc67040fb4f90c3fde84a37baa863a6e", "score": "0.6458906", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif (!div) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n\t\t\tdiv.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n\t\t\tdocumentElement.appendChild(container).appendChild(div);\n\n\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.right = \"60%\";\n\t\t\tpixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;\n\n\t\t\t// Support: IE 9 - 11 only\n\t\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\t\tboxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;\n\n\t\t\t// Support: IE 9 only\n\t\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t\tdiv.style.position = \"absolute\";\n\t\t\tscrollboxSizeVal = div.offsetWidth === 36 || \"absolute\";\n\n\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "dc67040fb4f90c3fde84a37baa863a6e", "score": "0.6458906", "text": "function computeStyleTests() {\n\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif (!div) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n\t\t\tdiv.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n\t\t\tdocumentElement.appendChild(container).appendChild(div);\n\n\t\t\tvar divStyle = window.getComputedStyle(div);\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;\n\n\t\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.right = \"60%\";\n\t\t\tpixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;\n\n\t\t\t// Support: IE 9 - 11 only\n\t\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\t\tboxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;\n\n\t\t\t// Support: IE 9 only\n\t\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t\tdiv.style.position = \"absolute\";\n\t\t\tscrollboxSizeVal = div.offsetWidth === 36 || \"absolute\";\n\n\t\t\tdocumentElement.removeChild(container);\n\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "c39689bc1f3890b61407b216c401ddfa", "score": "0.6450342", "text": "function computeStyleTests() {\n\t\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\t\n\t\t\tdocumentElement.removeChild( container );\n\t\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "c39689bc1f3890b61407b216c401ddfa", "score": "0.6450342", "text": "function computeStyleTests() {\n\t\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\t\n\t\t\tdocumentElement.removeChild( container );\n\t\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "c39689bc1f3890b61407b216c401ddfa", "score": "0.6450342", "text": "function computeStyleTests() {\n\t\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\t\n\t\t\tdocumentElement.removeChild( container );\n\t\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "c39689bc1f3890b61407b216c401ddfa", "score": "0.6450342", "text": "function computeStyleTests() {\n\t\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\t\n\t\t\tdocumentElement.removeChild( container );\n\t\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "c39689bc1f3890b61407b216c401ddfa", "score": "0.6450342", "text": "function computeStyleTests() {\n\t\n\t\t\t// This is a singleton, we need to execute it only once\n\t\t\tif ( !div ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tdiv.style.cssText =\n\t\t\t\t\"box-sizing:border-box;\" +\n\t\t\t\t\"position:relative;display:block;\" +\n\t\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\t\"top:1%;width:50%\";\n\t\t\tdiv.innerHTML = \"\";\n\t\t\tdocumentElement.appendChild( container );\n\t\n\t\t\tvar divStyle = window.getComputedStyle( div );\n\t\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\t\treliableMarginLeftVal = divStyle.marginLeft === \"2px\";\n\t\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\t\n\t\t\t// Support: Android 4.0 - 4.3 only\n\t\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\t\tdiv.style.marginRight = \"50%\";\n\t\t\tpixelMarginRightVal = divStyle.marginRight === \"4px\";\n\t\n\t\t\tdocumentElement.removeChild( container );\n\t\n\t\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t\t// it will also be a sign that checks already performed\n\t\t\tdiv = null;\n\t\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" }, { "docid": "2bc8cba96a76d595aa6fff4ec4f55efd", "score": "0.6427907", "text": "function computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}", "title": "" } ]
28a143fae6a366415d372b51b1d0f64f
v8 likes predictible objects
[ { "docid": "5eda6cb4f4707fa36cbceb42f873714d", "score": "0.0", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}", "title": "" } ]
[ { "docid": "c7077755399a4f71bbeb1168c6f61419", "score": "0.50904286", "text": "function VObject() {\n\t\n}", "title": "" }, { "docid": "65b9b1fb78c9d3b68ca91fc431e8b540", "score": "0.5080385", "text": "function censor(censor) {\n var i = 0; \n return function(key, value) {\n if(i !== 0 && typeof(censor) === 'object' && typeof(value) == 'object' && censor == value) \n return '[Circular]'; \n if(i >= 29) // seems to be a harded maximum of 30 serialized objects?\n return '[Unknown]';\n ++i; // so we know we aren't using the original object anymore\n return value; \n }\n}", "title": "" }, { "docid": "842a7431cf8fc64fa10f1ef29238695e", "score": "0.5069075", "text": "function u(n,o,r){(r?Reflect.getOwnMetadataKeys(o,r):Reflect.getOwnMetadataKeys(o)).forEach(function(t){var e=r?Reflect.getOwnMetadata(t,o,r):Reflect.getOwnMetadata(t,o);r?Reflect.defineMetadata(t,e,n,r):Reflect.defineMetadata(t,e,n)})}", "title": "" }, { "docid": "f0ed4b07b91f6906ac3bfa911c3a0dee", "score": "0.50053036", "text": "function u(e,t,r,o){l=l||n(29);const i=Object.keys(e),u=i.length;let c,p;for(let n=0;n<u;++n){c=e[p=i[n]],a(p,s.isPOJO(c)&&Object.keys(c).length&&(!c[o.typeKey]||\"type\"===o.typeKey&&c.type.type)?c:null,t,r,i,o)}}", "title": "" }, { "docid": "ac1150b3e0b631400cae1740aab12713", "score": "0.50034225", "text": "likesFind(person_or_thing) {\n const traversal_props = ['_isa', '_inverse_isa', '_likes'];\n let results = walk_graph(this, person_or_thing, traversal_props);\n\n if (results[0]) {\n if (results[1].length === 2) {\n // A -> B\n return [true, results[1].pop()];\n } else {\n // A -> N -> B <- C\n return [true, results[1].slice(-2, -1)[0]];\n }\n } else {\n return [false, null];\n }\n }", "title": "" }, { "docid": "52f8d48aaa867b9455f371cf2e3ffa76", "score": "0.49745074", "text": "function a(e,t,i,o){s=s||n(15);const a=Object.keys(e),p=a.length;let l,u;for(let n=0;n<p;++n){l=e[u=a[n]],c(u,r.isPOJO(l)&&Object.keys(l).length&&(!l[o.typeKey]||\"type\"===o.typeKey&&l.type.type)?l:null,t,i,a,o)}}", "title": "" }, { "docid": "863dc3092276fdce8ef742fb97d2fd0a", "score": "0.48939705", "text": "function c(e,t,n,r){s=s||i(10);const o=Object.keys(e),c=o.length;let l,p;for(let i=0;i<c;++i){l=e[p=o[i]],u(p,a.isPOJO(l)&&Object.keys(l).length&&(!l[r.typeKey]||\"type\"===r.typeKey&&l.type.type)?l:null,t,n,o,r)}}", "title": "" }, { "docid": "1c22dc5b2bf85e6cc0cbee652564147a", "score": "0.48609015", "text": "function like(liked){\n\t\tpic.liked = liked;\n\t\tpic.likes += liked ? 1 : -1;//condicional abreviada \n\t\tvar newEl = render(pic);\n\t\tyo.update(el, newEl);\n\t\treturn false;\n\t}", "title": "" }, { "docid": "04804445f72c751e527a0a320d6f46a5", "score": "0.4843557", "text": "function myObject() {\n this.A = 1;\n} // PTH", "title": "" }, { "docid": "92775c4a5f255e5be29e520bb9158fed", "score": "0.48293966", "text": "function getLikes(){\n\tvar likes = \"\";\n\t\n\tvar nouns = ['кошки', 'мечи', 'эльфы', 'пауки', 'магия', 'рабство',\n\t'драконы', 'королевская власть', 'рыцари', 'ослы', 'огры', 'орки', 'люди',\n\t'горы', 'снег', 'дождь', 'еда', 'яблоки', 'выпечка', 'мясо', \n\t'эль', 'сыр', 'вино', 'мужчины', 'женщины', 'дети', 'курица', 'искусство', 'овощи', 'огонь', 'рыба',\n\t'религия'];\n\t\n\tvar idList = makeTraitsIdList(nouns.length, 8)\n\t\n\tlikes+=\"Любит: \" +nouns[idList[0]]+\"<br>\";\n\tlikes+=\"Нравится: \" +nouns[idList[1]]+\" \"+nouns[idList[2]]+\" \"+nouns[idList[3]]+\"<br>\";\n\tlikes+=\"Не нравится: \" +nouns[idList[4]]+\" \"+nouns[idList[5]]+\" \"+nouns[idList[6]]+\"<br>\";\n\tlikes+=\"Страхи: \" +nouns[idList[7]]+\"<br><br>\";\n\t\n\treturn likes;\n}", "title": "" }, { "docid": "3edd28e74a0a7188a6dbfb01b4e40a7d", "score": "0.48141038", "text": "function Car(best){\n this.favorite = best; // 'thing' can be any word\n}", "title": "" }, { "docid": "72b88a5b9d9163c3901958058fcc6e80", "score": "0.48060018", "text": "function filter(response){\r\n\tvar len = response.results[0][\"result\"][\"tag\"][\"classes\"].length;\r\n for(i=0;i<len;i++)\r\n {\r\n \tword = response.results[0][\"result\"][\"tag\"][\"classes\"][i];\r\n \tfor(j=0;j<klen;j++)\r\n \t{\r\n \t\tif(word == keywords[j])\r\n \t\t{\r\n \t\t\tif(word=='sharp')\r\n \t\t\t\twords.push('a sharp object please be careful');\r\n \t\t\telse\r\n \t\t\t\twords.push(response.results[0][\"result\"][\"tag\"][\"classes\"][i]);\t\r\n \t\t\t\r\n \t\t\tbreak;\r\n \t\t}\r\n \t}\r\n }\r\n}", "title": "" }, { "docid": "f3d43b80a22d9638451785f92a46980e", "score": "0.48039156", "text": "objectIsBehavingAs({ object: object, classificationObject: classificationObject }) {\n const classificationInstantiation = this.objectGetClassificationInstantiationOn({\n object: object,\n classificationObject: classificationObject,\n })\n\n return classificationInstantiation !== undefined\n }", "title": "" }, { "docid": "7e5eff82b73a3632aa346faff0fc3bfc", "score": "0.47963437", "text": "async function like() {\n let response = await post_request(endpoints.subject() + \"/\" + id + \"/like\", {});\n if (response.status == 200) {\n let data = await response.text();\n let data_json = JSON.parse(data);\n change_like(data_json.likes);\n dislike_button();\n }\n}", "title": "" }, { "docid": "33bde0f0f38e05534b7b11997c1fa3b5", "score": "0.4787462", "text": "function SampleObject() {\n}", "title": "" }, { "docid": "c9084964a0eea51c53250dd380184bd8", "score": "0.4784575", "text": "function predictionObj() {\nlet prediction = {\n1 : 'Today it\\'s up to you to create the peacefulness you long for.',\n2 : 'If you refuse to accept anything but the best, you very often get it.',\n3 : 'Change can hurt, but it leads a path to something better.',\n4 : 'People are naturally attracted to you.',\n5 : 'A chance meeting opens new doors to success and friendship.',\n6 : 'Be on the lookout for coming events; They cast their shadows beforehand.',\n7 : 'The man or woman you desire feels the same about you.',\n}\nreturn prediction;\n}", "title": "" }, { "docid": "b29b33393fddb3a8d8c27a27349aac6b", "score": "0.47587085", "text": "function checkIlike(){\r\n\t\t\r\n\t}", "title": "" }, { "docid": "0c14bfe6c5495bc65b4d3af8aaca77e3", "score": "0.47433367", "text": "function a(e,t,r){(r?Reflect.getOwnMetadataKeys(t,r):Reflect.getOwnMetadataKeys(t)).forEach((function(n){var i=r?Reflect.getOwnMetadata(n,t,r):Reflect.getOwnMetadata(n,t);r?Reflect.defineMetadata(n,i,e,r):Reflect.defineMetadata(n,i,e)}))}", "title": "" }, { "docid": "8505bb465a7b42bba1f44f275df5f4d7", "score": "0.47271958", "text": "function z(Vt){return P(Vt)===!0&&Object.prototype.toString.call(Vt)===\"[object Object]\"}", "title": "" }, { "docid": "05c696821e29205ccc16798e18157012", "score": "0.47015223", "text": "visitObjectLiteral(ctx) {\n console.log(\"visitObjectLiteral\");\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "449b26e8ddafa54d11b6f926478cc60c", "score": "0.4684466", "text": "calculateFieldsDislikes(ar) {\n var reversed = ar\n var dict = {};\n for (var i in ar) {\n dict[i] = ar[i].dislikes\n }\n var sortable = [];\n for (var v in dict) {\n sortable.push([v, dict[v]]);\n }\n sortable.sort(function(a, b) {\n return b[1] - a[1];\n });\n reversed = []\n for (var k in sortable) {\n reversed.push(ar[sortable[k][0]])\n }\n return reversed\n }", "title": "" }, { "docid": "61adcbcb1c3b3e325c3a0f3b38143a79", "score": "0.467813", "text": "function likes(names) {\n return {\n 0: 'no one likes this',\n 1: `${names[0]} likes this`, \n 2: `${names[0]} and ${names[1]} like this`, \n 3: `${names[0]}, ${names[1]} and ${names[2]} like this`, \n 4: `${names[0]}, ${names[1]} and ${names.length - 2} others like this`, \n }[Math.min(4, names.length)]\n }", "title": "" }, { "docid": "6ee04b72ed9684ac987b2bfab2780e2a", "score": "0.46642983", "text": "function Y(e){if(null==e)return!1;var t=typeof e;return\"string\"!==t&&(\"number\"!==t&&(!Buffer.isBuffer(e)&&\"ObjectID\"!==e.constructor.name))}", "title": "" }, { "docid": "e2524c9c09344e554bff57d87af89023", "score": "0.4624827", "text": "async function objects() {\r\n cocoSsd.load().then(model => {\r\n // detect objects in the image.\r\n model.detect(video).then(predictions => {\r\n console.log('Predictions: ', predictions);\r\n });\r\n });\r\n\r\n}", "title": "" }, { "docid": "9cf504f30577580181a6200bec343b95", "score": "0.4617622", "text": "function byPrototype() {\nvar person3= new peopleProto();\nperson3.name='john';\nperson3.age=23;\nperson3.city='CA';\nperson3.printInfo();\n}", "title": "" }, { "docid": "9722a0da3e09a4732f1816bb5d78fa94", "score": "0.46158507", "text": "function Villain(name) {\n this.name = name;\n}", "title": "" }, { "docid": "4d495f7a70713e89ea6d9707c1101e03", "score": "0.45960227", "text": "function makeAwesomeness(obj){\n\t var n = ACRESSCALE * obj.skiableAcres\n\t \t+ SNOWFALLSCALE * obj.yearlySnowfall \n\t \t+ EXPERTSCALE * obj.expert \n\t \t+ ADVANCEDSCALE * obj.advanced\n\t \t+ VERTSCALE * (obj.top - obj.base)\n\t return n / AWESOMESCALE;\n\t}", "title": "" }, { "docid": "240d9f625197f082c60b1ff8f34a34d9", "score": "0.45753202", "text": "function classifyVideo() {\n classifier.predict(gotResult);\n}", "title": "" }, { "docid": "240d9f625197f082c60b1ff8f34a34d9", "score": "0.45753202", "text": "function classifyVideo() {\n classifier.predict(gotResult);\n}", "title": "" }, { "docid": "439836ec65aabfe11ead7e68baeb59f1", "score": "0.45734924", "text": "renderVerdict() {\n\n }", "title": "" }, { "docid": "031282bc49c9f0eb10360c94783017ef", "score": "0.4569293", "text": "static EnableFor(obj) {\n obj._tags = obj._tags || {};\n obj.hasTags = () => {\n return Tags.HasTags(obj);\n };\n obj.addTags = (tagsString) => {\n return Tags.AddTagsTo(obj, tagsString);\n };\n obj.removeTags = (tagsString) => {\n return Tags.RemoveTagsFrom(obj, tagsString);\n };\n obj.matchesTagsQuery = (tagsQuery) => {\n return Tags.MatchesQuery(obj, tagsQuery);\n };\n }", "title": "" }, { "docid": "db59df76dc6c1485fc47779bb5ec1260", "score": "0.45640036", "text": "function testsOnObjectObject() {\n\t\tlog('\\n%cObject %c// An object of type function', code, comment);\n\t\tinspect(Object); //An object of type function\n\n\t\tlog('%cObject.__proto__ %c// equal to Function.prototype i.e., prototype of Function (its parent)', code, comment);\n\t\tinspect(Object.__proto__); // equal to Function.prototype i.e., prototype of Function (its parent)\n\n\t\tlog('%cObject.__proto__.__proto__ %c// equal to Object.prototype i.e., prototype of Object', code, comment);\n\t\tinspect(Object.__proto__.__proto__); // equal to Object.prototype i.e., prototype of Object\n\n\t\tlog('%cObject.__proto__.__proto__.__proto__ %c// equal to null (end of __proto__ chain)', code, comment);\n\t\tinspect(Object.__proto__.__proto__.__proto__); // equal to null (end of __proto__ chain)\n\t}", "title": "" }, { "docid": "489eb63c400081416e05487ee09c51f4", "score": "0.45593128", "text": "function like(gekozenBoek){\n boekenLijst[gekozenBoek].likes = boekenLijst[gekozenBoek].likes + 1;\n}", "title": "" }, { "docid": "86389477dcaa9493ebffb0cb43905990", "score": "0.4557141", "text": "function Nevis() {}", "title": "" }, { "docid": "5853dd2cf4fa7ee4dfc3ed89607a19c7", "score": "0.4552235", "text": "info(ignore=[]) {\r\n\t\tlet always = ['data','session','player','results','videos','playlists','channels','zip','common','spmap','compress','more'];\r\n\t\tlet exclude = [...new Set([...always ,...ignore])]\r\n\t\ttry{\r\n\t\t\tlet props = Object.keys(this);\r\n\t\t\tlet meta = {};\r\n\t\t\tprops.forEach((k)=>{\r\n\t\t\t\tif (!exclude.includes(k)) {\r\n\t\t\t\t\tswitch (typeof this[k]) {\r\n\t\t\t\t\t\tcase 'boolean':\r\n\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'string':\r\n\t\t\t\t\t\t\tif (this[k].length) {\r\n\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'number':\r\n\t\t\t\t\t\t\tif (this[k]>0) {\r\n\t\t\t\t\t\t\t\tif (['published','updated','downloaded','joined','profiled','latest'].includes(k)) {\r\n\t\t\t\t\t\t\t\t\tmeta[k]=ut.tsAge(this[k])+' ago'; \r\n\t\t\t\t\t\t\t\t\tif (meta[k] == 'now ago') meta[k] = 'now';\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'function': break;\r\n\t\t\t\t\t\tcase 'object':\r\n\t\t\t\t\t\t\tif ((Array.isArray(this[k])) && (this[k].length)) {\r\n\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t} else if ((this[k]) && (Object.keys(this[k]).length)) {\r\n\t\t\t\t\t\t\t\tmeta[k]=this[k];\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn meta;\r\n\t\t} catch(e) {\r\n\t\t\tthis.debug(e);\r\n\t\t\treturn {\r\n\t\t\t\terror: e\r\n\t\t\t};\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "bf5a4f26661a5b08d79b53cb70c985ba", "score": "0.45467123", "text": "function H(e){if(null==e)return!1;var t=typeof e;return\"string\"!==t&&(\"number\"!==t&&(!Buffer.isBuffer(e)&&\"ObjectID\"!==e.constructor.name))}", "title": "" }, { "docid": "47fb5ffb284cf1f3a68c83aa91342232", "score": "0.45465496", "text": "function isCustomObject(dictionary) {\n return dictionary.type.startsWith('$');\n}", "title": "" }, { "docid": "fb2163ce1f617e0ad351b6cc8c34e9bc", "score": "0.45415312", "text": "function Classic(data) {\n console.dir(data);\n this._data = Object.freeze({\n responseMetadata: prop(data, \"response_metadata\"),\n name: prop(data, \"name\"),\n musicbrainzGid: prop(data, \"musicbrainz_gid\"),\n associatedActs: prop(data, \"associated_acts\"),\n birthname: prop(data, \"birthname\"),\n birthplace: prop(data, \"birthplace\"),\n labels: prop(data, \"labels\"),\n locationFormed: prop(data, \"location_formed\"),\n website: prop(data, \"website\"),\n bio: prop(data, \"bio\"),\n profileImage: prop(data, \"profile_image\"),\n profileAltSizes: prop(data, \"profile_alt_sizes\"),\n artistImages: prop(data, \"artist_images\")\n });\n}", "title": "" }, { "docid": "73c8affca53a5e4d49a16e3f694e2338", "score": "0.4535443", "text": "function monkeyPatcher(input) {\n\n switch (input) {\n case \"upvote\":\n this.upvotes += 1;\n break;\n case \"downvote\":\n this.downvotes += 1;\n break;\n case \"score\":\n return score(this);\n }\n\n function score(obj) {\n let modifier = 0;\n if (obj.upvotes + obj.downvotes > 50) {\n modifier = Math.ceil(Math.max(obj.upvotes, obj.downvotes) * 0.25)\n }\n\n let score = obj.upvotes - obj.downvotes;\n let rating = \"\";\n if (obj.upvotes / (obj.upvotes + obj.downvotes) > 0.66) {\n rating = \"hot\";\n } else if ((obj.upvotes > 100 || obj.downvotes > 100) && obj.upvotes >= obj.downvotes) {\n rating = \"controversial\";\n } else if (obj.downvotes > obj.upvotes) {\n rating = \"unpopular\";\n } else {\n rating = \"new\";\n }\n\n if (obj.upvote + obj.downvote < 10) {\n rating = \"new\";\n }\n\n return [obj.upvotes + modifier, obj.downvotes + modifier, score, rating];\n }\n}", "title": "" }, { "docid": "3ca7e4ca10561faee953ca28b3df282e", "score": "0.45295534", "text": "function QubyObject() {\r\n // map JS toString to the Quby toString\r\n}", "title": "" }, { "docid": "68e898c4aec855f31edeea3437741701", "score": "0.45210496", "text": "function AV(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "title": "" }, { "docid": "50652e827bf410a0ef4ae01e7d1d4905", "score": "0.45179987", "text": "function pythiaObject() {}", "title": "" }, { "docid": "6c7a7ce6540b26b2cc0a3afa16406384", "score": "0.45092988", "text": "function object() {\n}", "title": "" }, { "docid": "974adad6850ebfc611c5cc292f2024b2", "score": "0.44998807", "text": "function testsOnSimpleObject() {\n\t\tlog('\\n%caObj %c// aObj object i.e., Object of A (typeof Object and instanceof A & Object)', code, comment);\n\t\tinspect(aObj); // aObj object i.e., Object of A (typeof Object and instanceof A & Object)\n\n\t\tlog('%caObj.__proto__ %c// equal to A.prototype i.e., prototype of A (its parent)', code, comment);\n\t\tinspect(aObj.__proto__); // equal to A.prototype i.e., prototype of A (its parent)\n\n\t\tlog('%caObj.__proto__.__proto__ %c// equal to Object.prototype i.e., prototype of Object', code, comment);\n\t\tinspect(aObj.__proto__.__proto__); // equal to Object.prototype i.e., prototype of Object\n\n\t\tlog('%caObj.__proto__.__proto__.__proto__ %c// equal to null (end of __proto__ chain)', code, comment);\n\t\tinspect(aObj.__proto__.__proto__.__proto__); // equal to null (end of __proto__ chain)\n\t}", "title": "" }, { "docid": "2a3c6f8f7bea2a2189df32b1b9784d50", "score": "0.44982827", "text": "function CatProto(name, age, color, breed){\n this.name = name,\n this.age = age,\n this.color = color,\n this.breed = breed\n \n}", "title": "" }, { "docid": "fc321cab78fb0982837636b2e66348e3", "score": "0.44955283", "text": "function v9(v10,v11) {\n const v14 = v10(v1);\n // v14 = .unknown\n const v16 = \"sO0KQ7OSCy\".indexOf(0,-65535);\n // v16 = .integer\n let v17 = v16;\n v17 = \"k**baeaDif\";\n const v19 = v17.__proto__;\n // v19 = .object()\n const v21 = new WeakSet(v19);\n // v21 = .object(ofGroup: WeakSet, withProperties: [\"__proto__\"], withMethods: [\"delete\", \"has\", \"add\"])\n const v22 = v21.has(v8);\n // v22 = .boolean\n}", "title": "" }, { "docid": "a35bfb241a1bcc64e89fd876a167a173", "score": "0.44950795", "text": "function PR(e){return\"__proto__\"!==e&&\"constructor\"!==e&&\"prototype\"!==e}", "title": "" }, { "docid": "d99593d5aba470bc525110cdcaf7ed9c", "score": "0.44948137", "text": "objects() {\n throw new Error('Must be overloaded');\n }", "title": "" }, { "docid": "edbe54c40e0912664ae7e78cfc5f231d", "score": "0.4490046", "text": "function getCount(obj)\n {\n return obj.likes - obj.dislikes\n }", "title": "" }, { "docid": "7b15e454fa6fedc1677a31bc22069120", "score": "0.44788608", "text": "function Vo(){var t=this;Xt()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&ke()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "title": "" }, { "docid": "dc0fc91262cfaaf1ae2ce5aebe9b6bf6", "score": "0.44779214", "text": "function handleLike(name) {\n let copy = [].concat(props.data, addedCandies).map(x => x);\n copy.forEach(function(obj) {\n if (obj.competitorname === name) {\n obj.liked = true;\n }\n })\n setCandydata(copy);\n }", "title": "" }, { "docid": "03d7b5d45fc0d35428a0c17818776e4b", "score": "0.44762835", "text": "getSimilarWords() {\n\n }", "title": "" }, { "docid": "66f4404a0ae8e9879fc2ff674831507f", "score": "0.44647017", "text": "[util.inspect.custom]() {\n const publicObj = this.publicSerializer();\n\n return Object.keys(publicObj)\n .reduce((acc, key, index, arr) => `${\n index === 0 ? `<${this.constructor.name}> {\\n` : ''\n }${\n acc\n }${\n index > 0 ? ',\\n' : ''\n }${'\\t'}${key}: ${publicObj[key]}${\n index === arr.length - 1 ? '\\n}' : ''\n }`, '');\n }", "title": "" }, { "docid": "ce9cf0cd0cb240f96b0191c08db23eea", "score": "0.44571516", "text": "function showInferences() {\n\t\tlog('\\n%c- (dot)%c__proto__ %ccan be chained to give us the parent\\'s prototype ' +\n\t\t\t'(for e.g., %cA.__proto__ === Function.prototype %c)', normalText, code, normalText, code, normalText);\n\n\t\tlog('%c- %cObject %cis actually an object of type %cFunction', normalText, code, normalText, code);\n\n\t\tlog('%c- instanceof and typeof use %c__proto__ %cto figure out what they should reply with', normalText, code, normalText);\n\n\t\tlog('%c- Therefore, if you change the %c__proto__ %cproperty then instanceof and typeof return values' +\n\t\t\t' depending on new %c__proto__ %cvalue', normalText, code, normalText, code, normalText);\n\t}", "title": "" }, { "docid": "9cf267fcb1d58510d1db251a4702527b", "score": "0.44546807", "text": "function Proto(navn,test){\r\n this.navn = navn;\r\n this.test = test;\r\n}", "title": "" }, { "docid": "f4a531877af4472092886b53e2e5d566", "score": "0.4447813", "text": "function obj(publicAPI = {}, model = {}) {\n // Ensure each instance as a unique ref of array\n safeArrays(model);\n\n const callbacks = [];\n if (!Number.isInteger(model.mtime)) {\n model.mtime = ++globalMTime;\n }\n model.classHierarchy = ['vtkObject'];\n\n function off(index) {\n callbacks[index] = null;\n }\n\n function on(index) {\n function unsubscribe() {\n off(index);\n }\n return Object.freeze({\n unsubscribe,\n });\n }\n\n publicAPI.isDeleted = () => !!model.deleted;\n\n publicAPI.modified = (otherMTime) => {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return;\n }\n\n if (otherMTime && otherMTime < publicAPI.getMTime()) {\n return;\n }\n\n model.mtime = ++globalMTime;\n callbacks.forEach((callback) => callback && callback(publicAPI));\n };\n\n publicAPI.onModified = (callback) => {\n if (model.deleted) {\n vtkErrorMacro('instance deleted - cannot call any method');\n return null;\n }\n\n const index = callbacks.length;\n callbacks.push(callback);\n return on(index);\n };\n\n publicAPI.getMTime = () => model.mtime;\n\n publicAPI.isA = (className) => {\n let count = model.classHierarchy.length;\n // we go backwards as that is more likely for\n // early termination\n while (count--) {\n if (model.classHierarchy[count] === className) {\n return true;\n }\n }\n return false;\n };\n\n publicAPI.getClassName = (depth = 0) =>\n model.classHierarchy[model.classHierarchy.length - 1 - depth];\n\n publicAPI.set = (map = {}, noWarning = false, noFunction = false) => {\n let ret = false;\n Object.keys(map).forEach((name) => {\n const fn = noFunction ? null : publicAPI[`set${capitalize(name)}`];\n if (fn && Array.isArray(map[name]) && fn.length > 1) {\n ret = fn(...map[name]) || ret;\n } else if (fn) {\n ret = fn(map[name]) || ret;\n } else {\n // Set data on model directly\n if (['mtime'].indexOf(name) === -1 && !noWarning) {\n vtkWarningMacro(\n `Warning: Set value to model directly ${name}, ${map[name]}`\n );\n }\n model[name] = map[name];\n ret = true;\n }\n });\n return ret;\n };\n\n publicAPI.get = (...list) => {\n if (!list.length) {\n return model;\n }\n const subset = {};\n list.forEach((name) => {\n subset[name] = model[name];\n });\n return subset;\n };\n\n publicAPI.getReferenceByName = (val) => model[val];\n\n publicAPI.delete = () => {\n Object.keys(model).forEach((field) => delete model[field]);\n callbacks.forEach((el, index) => off(index));\n\n // Flag the instance being deleted\n model.deleted = true;\n };\n\n // Add serialization support\n publicAPI.getState = () => {\n const jsonArchive = Object.assign({}, model, {\n vtkClass: publicAPI.getClassName(),\n });\n\n // Convert every vtkObject to its serializable form\n Object.keys(jsonArchive).forEach((keyName) => {\n if (jsonArchive[keyName] === null || jsonArchive[keyName] === undefined) {\n delete jsonArchive[keyName];\n } else if (jsonArchive[keyName].isA) {\n jsonArchive[keyName] = jsonArchive[keyName].getState();\n } else if (Array.isArray(jsonArchive[keyName])) {\n jsonArchive[keyName] = jsonArchive[keyName].map(getStateArrayMapFunc);\n }\n });\n\n // Sort resulting object by key name\n const sortedObj = {};\n Object.keys(jsonArchive)\n .sort()\n .forEach((name) => {\n sortedObj[name] = jsonArchive[name];\n });\n\n // Remove mtime\n if (sortedObj.mtime) {\n delete sortedObj.mtime;\n }\n\n return sortedObj;\n };\n\n // Add shallowCopy(otherInstance) support\n publicAPI.shallowCopy = (other, debug = false) => {\n if (other.getClassName() !== publicAPI.getClassName()) {\n throw new Error(\n `Cannot ShallowCopy ${other.getClassName()} into ${publicAPI.getClassName()}`\n );\n }\n const otherModel = other.get();\n\n const keyList = Object.keys(model).sort();\n const otherKeyList = Object.keys(otherModel).sort();\n\n otherKeyList.forEach((key) => {\n const keyIdx = keyList.indexOf(key);\n if (keyIdx === -1) {\n if (debug) {\n vtkDebugMacro(`add ${key} in shallowCopy`);\n }\n } else {\n keyList.splice(keyIdx, 1);\n }\n model[key] = otherModel[key];\n });\n if (keyList.length && debug) {\n vtkDebugMacro(`Untouched keys: ${keyList.join(', ')}`);\n }\n\n publicAPI.modified();\n };\n\n // Allow usage as decorator\n return publicAPI;\n}", "title": "" }, { "docid": "62518d3317dda2f4191b7b5953902f93", "score": "0.44476524", "text": "function snowWhite(obj) {\n return freeze(whitelistAll(obj));\n }", "title": "" }, { "docid": "499457135fee666987e85364fbcfc360", "score": "0.44464657", "text": "function classifyVideo() {\n classifier.classify(gotResult);\n}", "title": "" }, { "docid": "364cd2ee9da7a42b9f825a4591a1a2de", "score": "0.44426888", "text": "function classProto() {}", "title": "" }, { "docid": "d139a3d53df9ed1e3a7f64d039646295", "score": "0.44353336", "text": "function protoAugment(target,src,keys){ /* eslint-disable no-proto */target.__proto__ = src; /* eslint-enable no-proto */}", "title": "" }, { "docid": "f7d0650b6e159f89a658a22f67a52c6c", "score": "0.44315693", "text": "function hubbleClassification(hubbleClass){\n milkyWay.summary();\n console.log(`Also classified as a/an ${hubbleClass} type galaxy, under the Hubble Classification Scheme.`);\n}", "title": "" }, { "docid": "27e483c48efc70ad70ca4a0a64cf2d98", "score": "0.44286785", "text": "checkConfidence(nlp){\n if(nlp['intent'][0]['confidence'] < 0.8 ) return true;\n let branch = nlp['intent'][0]['value'];\n if (branch in nlp){\n if (nlp[branch][0]['confidence'] < 0.8) return true;\n }\n }", "title": "" }, { "docid": "b9f1b806af677affebbd8918a1ced4c4", "score": "0.44283", "text": "function objectForKey(object, key, primitives){\n\t\t var proto = primitives.getPrototypeOf(object)\n\t\t if (!proto || hasOwnProperty(object, key)){\n\t\t return object\n\t\t } else {\n\t\t return objectForKey(proto, key, primitives)\n\t\t }\n\t\t}", "title": "" }, { "docid": "27f44c27d8541523d579f091078eb8c0", "score": "0.44264257", "text": "function setupSingleLike(review) {\n review.numLikes = review.likes.length;\n\n Review.prototype$isLikedByUser({id: review.id},\n function (data) {\n review.isLiked = data.isLiked;\n }, function (err) {\n console.error(err);\n });\n }", "title": "" }, { "docid": "3a8bddb1e09bbb7513f327fd26fb7eed", "score": "0.4420813", "text": "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "title": "" }, { "docid": "8bd6ab85cbadaa5101eb42ae6205f89c", "score": "0.44176024", "text": "hit() {\n }", "title": "" }, { "docid": "283ae8cf079b48c20e0d898d4f1cf673", "score": "0.4415069", "text": "function createLikes(likes) {\n var like = \"\";\n if (likes.length > 0) {\n for (var i = 0; i < likes.length; i++) {\n like += \"<p>\" + likes[i].userName + \"</p>\";\n }\n }\n return like;\n}", "title": "" }, { "docid": "1a0aca3747aa2b1afbb9e703c0a5bb00", "score": "0.44110245", "text": "function ClientFacebookLikesPredicate(data) {\n goog.base(this, data);\n this.id = data['id'];\n}", "title": "" }, { "docid": "f31b91fa970e4b40c7e5ae496584fe44", "score": "0.4406073", "text": "function Obj() {}", "title": "" }, { "docid": "7521d1531aa87e7fd79e0afd06a12812", "score": "0.44044796", "text": "function revealMystery(obj) {\n console.log(\"Mystery revealed: \");\n Object.keys(obj).forEach(function(key) {\n console.log(key+\":\", obj[key]);\n });\n}", "title": "" }, { "docid": "0b8e96ad9d48c9ab61970c90cb8328bb", "score": "0.44034645", "text": "function HornAnimal(obj, array) {\n this.image_url = obj.image_url;\n this.name = obj.title;\n this.body = obj.description;\n this.keyword = obj.keyword;\n this.horns = obj.horns;\n array.push(this);\n}", "title": "" }, { "docid": "7604358757f53fa0e067ba3c72041ca2", "score": "0.4403174", "text": "function ProdObject(value,rank) {\n this.value = value;\n this.rank = rank;\n}", "title": "" }, { "docid": "50180031f06ca85c0597fe7bbea4b8a0", "score": "0.44024977", "text": "function markRaw(obj) {\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\n return obj;\n }\n // set the vue observable flag at obj\n var ob = createObserver();\n ob.__raw__ = true;\n def(obj, '__ob__', ob);\n // mark as Raw\n rawSet.set(obj, true);\n return obj;\n}", "title": "" }, { "docid": "bb9dda5d41570a233f281d7c86de4451", "score": "0.44022703", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n }", "title": "" }, { "docid": "dc7584f824d2e4a80f337e54288bc085", "score": "0.4401543", "text": "function Proto() {}", "title": "" }, { "docid": "dc7584f824d2e4a80f337e54288bc085", "score": "0.4401543", "text": "function Proto() {}", "title": "" }, { "docid": "3e6ccd61afc317a83b9fe769f2a0004a", "score": "0.43995225", "text": "static objectLike(pattern) {\n return new ObjectMatch('objectLike', pattern);\n }", "title": "" }, { "docid": "4e24100776ef5625341effc6a2ee802b", "score": "0.4399063", "text": "function vr(t) {\n return new pe(t, /* useProto3Json= */ !0);\n}", "title": "" }, { "docid": "9d7dccffdfb3ded12e53d75ad35228c8", "score": "0.43961936", "text": "function yn(e){return!0==(null!=(t=e)&&\"object\"===mn(t)&&!1===Array.isArray(t))&&\"[object Object]\"===Object.prototype.toString.call(e);var t}", "title": "" }, { "docid": "e2b0c82797ee4873d23fdb83892473d1", "score": "0.4395894", "text": "function createAddLike (post) {\n return {\n type: ADD_LIKE,\n value: post\n };\n}", "title": "" }, { "docid": "77c7b1c928e4a7402a853c0fd5b6849f", "score": "0.43904552", "text": "function createKnowHOWAttribute() {\n const metaObj = KnowHowHOW.$$STable.REPR.allocate(KnowHowHOW.$$STable);\n\n const r = new reprs.KnowHOWAttribute();\n const typeObj = r.typeObjectFor(metaObj);\n\n const methods = {};\n methods.name = function(ctx, _NAMED, self) {\n return new NQPStr(self.$$name);\n };\n methods['new'] = function(ctx, _NAMED, self) {\n const attr = r.allocate(self.$$STable);\n attr.$$name = _NAMED.name.$$getStr();\n attr.$$type = _NAMED.type;\n attr.$$boxTarget = _NAMED.box_target ? _NAMED.box_target.$$getInt() : 0;\n return attr;\n };\n\n typeObj.$$STable.methodCache = new Map();\n typeObj.$$STable.modeFlags = constants.METHOD_CACHE_AUTHORITATIVE;\n\n for (const method of Object.keys(methods)) {\n typeObj.$$STable.ObjConstructor.prototype['p6$' + method] = methods[method];\n typeObj.$$STable.methodCache.set(method, wrapMethod(method, methods[method]));\n }\n\n return typeObj;\n}", "title": "" }, { "docid": "62cbc63d48072e1b32be61f784870488", "score": "0.4389318", "text": "objectPushBehaviour({ object: object, classificationObject: classificationObject }) {\n ClassificationObject.attachBehaviour({\n classificationObject: classificationObject,\n object: object,\n })\n }", "title": "" }, { "docid": "b034cb7dde72441afc309940d13a8c16", "score": "0.4388304", "text": "function Vegetable(name){\n this.name = name; // properties\n}", "title": "" }, { "docid": "315a77dd61e752bff2c6ea075608017b", "score": "0.43850788", "text": "findUsersLikeUsername(username) {\n return fetch(HEROKU_URL + '/api/user/' + username + '/similar').then(response => {\n return response.json();\n })\n }", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "ddb59ed41f09866496bfef0298b7731f", "score": "0.43845382", "text": "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}", "title": "" }, { "docid": "ad7d05845469f78949b80947754ea117", "score": "0.43839183", "text": "function Idea(title, body) {\n this.title = title;\n this.body = body;\n this.rating = 'swill'\n}", "title": "" }, { "docid": "9992f71739d6eb6e526f1649041b4338", "score": "0.43836558", "text": "function objectHighlighter() {\n \n //each object will in the array has two properties\n //the first property is the object that will be highlighted\n //the second property is the phaser graphics object that does the highlighting\n //ex: highlights[0] = {object: someOrc, graphics: someGraphicsObject}\n this.highlights = [];\n}", "title": "" }, { "docid": "a60e4777e9f6bd79a91025f000a52eb4", "score": "0.4382719", "text": "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n }", "title": "" }, { "docid": "cdfc5679ff2ab69adb5dcda12ec9f8d6", "score": "0.43766686", "text": "predict(instances) {\n let pred = [];\n for (let i = 0; i < instances.length; i++) {\n let inst = instances[i];\n pred.push(this.classify(inst));\n }\n return pred;\n }", "title": "" }, { "docid": "cdfc5679ff2ab69adb5dcda12ec9f8d6", "score": "0.43766686", "text": "predict(instances) {\n let pred = [];\n for (let i = 0; i < instances.length; i++) {\n let inst = instances[i];\n pred.push(this.classify(inst));\n }\n return pred;\n }", "title": "" }, { "docid": "cdfc5679ff2ab69adb5dcda12ec9f8d6", "score": "0.43766686", "text": "predict(instances) {\n let pred = [];\n for (let i = 0; i < instances.length; i++) {\n let inst = instances[i];\n pred.push(this.classify(inst));\n }\n return pred;\n }", "title": "" }, { "docid": "817a80a324f49d2bdd6288eb9c2fdc94", "score": "0.43670088", "text": "function Villain(attributes){\n Humanoid.call(this, attribtes);\n this.armorClass = attributes.armorClass;\n this.attackBonus = attributes.attackBonus;\n this.magic = attributes.magic;\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" }, { "docid": "96cb509f294fbc6af500f55111ef5884", "score": "0.43648756", "text": "function h$isMarked(obj) {\n return (typeof obj === 'object' || typeof obj === 'function') &&\n ((typeof obj.m === 'number' && (obj.m & 3) === h$gcMark) || (obj.m && typeof obj.m === 'object' && obj.m.m === h$gcMark));\n}", "title": "" } ]
e8cb375732d56cd8795ee8baf75414e1
Removing the menu element from the DOM and remove all associated event listeners and backdrop
[ { "docid": "6ec64b70831558846b16e047b74d4cc1", "score": "0.0", "text": "function onRemove(scope,element,opts){opts.cleanupInteraction();opts.cleanupResizing();opts.hideBackdrop();// For navigation $destroy events, do a quick, non-animated removal,\n// but for normal closes (from clicks, etc) animate the removal\nreturn opts.$destroy===true?detachAndClean():animateRemoval().then(detachAndClean);/**\n\t * For normal closes, animate the removal.\n\t * For forced closes (like $destroy events), skip the animations\n\t */function animateRemoval(){return $animateCss(element,{addClass:'_md-leave'}).start();}/**\n\t * Detach the element\n\t */function detachAndClean(){element.removeClass('_md-active');detachElement(element,opts);opts.alreadyOpen=false;}}", "title": "" } ]
[ { "docid": "6a1d829dd4c80a333a7760a3adb4b190", "score": "0.7368978", "text": "function detach() {\n if (!isAttached) return;\n isAttached = false;\n\n state.menu = null;\n\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('focus', onFocus, true);\n document.removeEventListener('blur', onBlur, true);\n}", "title": "" }, { "docid": "8709226cfba383d1fee74f45eb608d63", "score": "0.7184196", "text": "removeInterfaceMenu() {\n this.controlsElt.mainMenu.empty()\n this.controlsElt.mainMenu.remove()\n }", "title": "" }, { "docid": "77b9091b2e6e16b1fbb8e6c3649f90d1", "score": "0.68898815", "text": "function removeEventListener(){\n\tmenu.removeEventListener('mouseleave', leaveAnimation, false)\n\tmenu.removeEventListener('mouseenter', enterAnimation, false)\n}", "title": "" }, { "docid": "0d9d84699c3fbb76eaa916cb74cdf5d4", "score": "0.6888642", "text": "function deactivateMenu() {\n $('#menu-button').off();\n}", "title": "" }, { "docid": "f665b1056503c3086379964ef5b03e4f", "score": "0.6811703", "text": "function closeMenu() {\n setClickForMenu(false, () => {\n document.removeEventListener(\"click\", closeMenu);\n });\n }", "title": "" }, { "docid": "7d64e6920838eacbe5b7aed3b58e6442", "score": "0.6806558", "text": "closeMenu() {\n this.menu.classList.remove(CSS.menuAnimation);\n this.menu.classList.add(CSS.hidden);\n this.unsetDeleteConfirmation();\n }", "title": "" }, { "docid": "bb7379293a623e6e68b640bc4cf04243", "score": "0.68042505", "text": "clear() {\n log.debug('Removing all menu popup windows.');\n for (const win of this.menuWindows.values()) {\n win.destroy();\n }\n }", "title": "" }, { "docid": "a69f93b0b48fc121353f8a09724e3a61", "score": "0.6776545", "text": "function unload() {\n //$('.menuButton')\n\n }", "title": "" }, { "docid": "876af500dbe62a142926315513ab39af", "score": "0.6735685", "text": "function close_menu() {\n\t\t\t\tvar w;\n\t\t\t\t\n\t\t\t\tif (menu_chunk.parentNode) {\n\t\t\t\t\tmenu_chunk.parentNode.removeChild(menu_chunk);\n\t\t\t\t\t\n\t\t\t\t\tvar w = _loki.window;\n\t\t\t\t\twhile (w) {\n\t\t\t\t\t\tw.document.removeEventListener('click', close_menu, false);\n\t\t\t\t\t\tw.document.removeEventListener('contextmenu', close_menu, false);\n\t\t\t\t\t\tw = (w != w.parent) ? w.parent : null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "cb17dff57bbb0e25656a8828a34b486c", "score": "0.67155206", "text": "function closeMenu() {\n\tmenuElement.classList.remove('visible');\n\toof.classList.remove('visible');\n}", "title": "" }, { "docid": "7b400a8de5c0c57c55e97a09c88cfdd5", "score": "0.6707398", "text": "function closeMenu(ul) {\r\n document.body.removeChild(ul);\r\n document.onclick = null;\r\n document.onmousedown = null;\r\n document.oncontextmenu = null;\r\n document.onkeydown = null;\r\n}", "title": "" }, { "docid": "228ca6607ca3a180aa92df43e210e5e1", "score": "0.6622677", "text": "closeMenu() {\n if (this.isMenuOpen()) {\n this.closed.next();\n this._overlayRef.detach();\n }\n this._closeSiblingTriggers();\n }", "title": "" }, { "docid": "263618bdd90e1f615d72c61d31d38db4", "score": "0.6620678", "text": "function closeMenu() {\n helperBtn.classList.remove('is-active');\n helperContainer.classList.remove('is-active');\n }", "title": "" }, { "docid": "3591ce964876eb05b8cbeb4c39a72c9d", "score": "0.66087794", "text": "function closeMenu() {\n\n document.getElementById(\"overlay-menu\").classList.remove(\"show-overlay-menu\");\n document.getElementById(\"burger-menu\").classList.remove(\"d-none\");\n}", "title": "" }, { "docid": "e450e825ca4e10916a8f437ba66e1e95", "score": "0.65887076", "text": "delete () {\n if (this.reactionCollector) this.reactionCollector.stop()\n if (this.menu) this.menu.delete()\n }", "title": "" }, { "docid": "1c9e02023ffca532ce21ba038925ddc1", "score": "0.65640515", "text": "destroy() {\n this.element.removeClass('active');\n this.element.setStyles(this.originalStyle);\n\n this.grip.removeEventListener('mousedown', this._handleMouseDown);\n PrimeDocument.removeEventListener('mousemove', this._handleMouseMove);\n PrimeDocument.removeEventListener('mouseup', this._handleMouseUp);\n }", "title": "" }, { "docid": "a8c0850f31dbe126fb5797966e5255a7", "score": "0.6561395", "text": "function CherCats_CloseMenu() {\n CherCats_Stop = 1; //pour arrêter le script s'il est en cours\n var Menu = document.getElementById('CherCats_IdMenu');\n if (Menu) $(Menu).remove();\n}", "title": "" }, { "docid": "5983953ea5a9e670a59c9d8ee6ab214b", "score": "0.65499693", "text": "function closeMenu() {\n $('body').removeClass('no-scroll');\n $('.menu-list').removeClass('open');\n $(BURGER_ICON).removeClass('open');\n}", "title": "" }, { "docid": "662d29928ea43b264fa3b1388b022032", "score": "0.6543874", "text": "closeOverlayAndMenu() {\n document.getElementById('menuOverlay').style = \"display: none\";\n document.getElementById('menuContainer').style = \"display: none\";\n }", "title": "" }, { "docid": "084116335a7db15f62bc43cda44797c0", "score": "0.6534781", "text": "function destroyClickedElement(event){document.body.removeChild(event.target);}", "title": "" }, { "docid": "084116335a7db15f62bc43cda44797c0", "score": "0.6534781", "text": "function destroyClickedElement(event){document.body.removeChild(event.target);}", "title": "" }, { "docid": "be67c58f04b7eaf26de3d640a8f60dd5", "score": "0.652675", "text": "function closeMenu () {\n $menu.fadeOut('fast');\n isOpen = false;\n }", "title": "" }, { "docid": "4680bb625717802421d53091ef40581a", "score": "0.65259033", "text": "closeMenu() {\n if (!this.openMenuItem_) {\n return;\n }\n this.openMenuItem_.style.display = 'none';\n this.openMenuItem_ = null;\n }", "title": "" }, { "docid": "3a6fb97dd2fba65aa84f107e20f92731", "score": "0.6509766", "text": "hide() {\n this.menu.style.pointerEvents = 'none';\n \n this.nav.classList.add(`${this.selectors.navCloseClass}`);\n this.nav.classList.remove(`${this.selectors.menuOpenClass}`);\n this.overlay.classList.remove(`${this.selectors.activeClass}`);\n \n this.expanded = false;\n this.menu.setAttribute('aria-expanded', this.expanded);\n \n this.timer = window.setTimeout(() => {\n this.nav.classList.remove(`${this.selectors.navOpenClass}`);\n this.nav.classList.remove(`${this.selectors.navCloseClass}`);\n this.body.classList.remove(`${this.selectors.overflowClass}`);\n this.timer = false\n this.menu.style.pointerEvents = 'all';\n }, this.duration)\n this.open = false;\n }", "title": "" }, { "docid": "75fdac8503f2c9670c85c7f176706b39", "score": "0.6503518", "text": "closeToolboxMenu() {\n this.menu.classList.remove(CSS.menuAnimation);\n this.menu.classList.add(CSS.hidden);\n this.unsetDeleteConfiramtion();\n }", "title": "" }, { "docid": "4c33d7b97fbfe4fa753ad639e2acb51b", "score": "0.6500512", "text": "function closeMenu() {\n menu.classList.remove(\"menu-open\");\n}", "title": "" }, { "docid": "3325060d7682f95b177ae54f54505c25", "score": "0.64948875", "text": "_onMenuDisposed(menu) {\n this.removeMenu(menu);\n let index = algorithm_1.ArrayExt.findFirstIndex(this._items, item => item.menu === menu);\n if (index !== -1) {\n algorithm_1.ArrayExt.removeAt(this._items, index);\n }\n }", "title": "" }, { "docid": "9df0ee76a19bc8c60b338fb9ca41702c", "score": "0.6474243", "text": "function _destroy() {\n $backdrop.remove();\n $wrapper.remove();\n $.removeData(element, \"modal\");\n }", "title": "" }, { "docid": "ad59572853dec623856c7dac303ad9ff", "score": "0.64723396", "text": "function closeMenu() {\n nav.classList.remove('nav-active');\n ham.classList.remove('ham-active');\n}", "title": "" }, { "docid": "93a02d60f3dd258d60fd9405c3adc91c", "score": "0.6462233", "text": "destroy() {\n // TODO: There's a memory leak somewhere\n\n this.container.classList.remove(\"genome-spy\");\n this.container.classList.remove(\"loading\");\n\n for (const [type, listeners] of this._keyboardListeners) {\n for (const listener of listeners) {\n document.removeEventListener(type, listener);\n }\n }\n\n this._glHelper.finalize();\n\n while (this.container.firstChild) {\n this.container.firstChild.remove();\n }\n }", "title": "" }, { "docid": "b03832073cedd3940f11aa7dc83dbfcf", "score": "0.6457668", "text": "_destroy() {\n this.collapse(false);\n this.$element.off('.zf.trigger .zf.offcanvas');\n this.$element.find('.off-canvas-menu-generated').foundation('destroy');\n this.$element.find('.off-canvas-menu-generated').remove();\n this.offcanvas._destroy();\n }", "title": "" }, { "docid": "b4b8dff76f3d8c29cebe3436f40a0af0", "score": "0.64501846", "text": "_destroyMenu(reason) {\n if (!this._overlayRef || !this.menuOpen) {\n return;\n }\n const menu = this.menu;\n this._closingActionsSubscription.unsubscribe();\n this._overlayRef.detach();\n // Always restore focus if the user is navigating using the keyboard or the menu was opened\n // programmatically. We don't restore for non-root triggers, because it can prevent focus\n // from making it back to the root trigger when closing a long chain of menus by clicking\n // on the backdrop.\n if (this.restoreFocus && (reason === 'keydown' || !this._openedBy || !this.triggersSubmenu())) {\n this.focus(this._openedBy);\n }\n this._openedBy = undefined;\n if (menu instanceof _MatMenuBase) {\n menu._resetAnimation();\n if (menu.lazyContent) {\n // Wait for the exit animation to finish before detaching the content.\n menu._animationDone.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.filter)(event => event.toState === 'void'), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.take)(1),\n // Interrupt if the content got re-attached.\n (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.takeUntil)(menu.lazyContent._attached)).subscribe({\n next: () => menu.lazyContent.detach(),\n // No matter whether the content got re-attached, reset the menu.\n complete: () => this._setIsMenuOpen(false)\n });\n } else {\n this._setIsMenuOpen(false);\n }\n } else {\n this._setIsMenuOpen(false);\n menu?.lazyContent?.detach();\n }\n }", "title": "" }, { "docid": "9a99f24e95a80f5dc25f03044969dfe8", "score": "0.6447249", "text": "function cleanup () {\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "f1f7524209249038e7a91794bee08873", "score": "0.64324516", "text": "function removeMenuElements()\n{\n document.getElementById(\"niJu\").remove();\n document.getElementById(\"optionsList\").remove();\n}", "title": "" }, { "docid": "db8077db510da809353a62fb774780b8", "score": "0.6431335", "text": "function clearMenuItems() {\n $(\".menu-item-list li\").remove();\n $(\".menu-item-list div\").remove();\n }", "title": "" }, { "docid": "01daaaff3384af71e4c7ce28e3cef402", "score": "0.643073", "text": "destroy() {\n this.element.removeEventListener('contextmenu', preventDefault);\n\n this.wheelInput.destroy();\n this.moveInput.destroy();\n this.keyInput.destroy();\n this.manager.destroy();\n }", "title": "" }, { "docid": "0bfba624ad571f0d3e2e231eaa744d16", "score": "0.64222777", "text": "destroy() {\n this.emit('destroy');\n this._popoutEvent = undefined;\n this._maximiseToggleEvent = undefined;\n this._clickEvent = undefined;\n this._touchStartEvent = undefined;\n this._componentRemoveEvent = undefined;\n this._componentFocusEvent = undefined;\n this._componentDragStartEvent = undefined;\n this._tabsContainer.destroy();\n globalThis.document.removeEventListener('mouseup', this._documentMouseUpListener);\n this._element.remove();\n }", "title": "" }, { "docid": "0bfe574b1fad1ac3d9dbeb0bea55f9a6", "score": "0.639843", "text": "closeCurrentMenu_() {\n this.clearFocusRing_();\n if (this.node_) {\n this.node_ = null;\n }\n this.menuPanel_.clear();\n this.actions_ = [];\n this.menuNode_ = null;\n }", "title": "" }, { "docid": "ac4af5cef8dedf631a260b2a0b9abf76", "score": "0.63920736", "text": "destroy() {\n this.removeEventListeners()\n this.el = null\n }", "title": "" }, { "docid": "ad805afc83c9091e4013a3764b4c2654", "score": "0.6382516", "text": "closeMenu() {\n this.menu.close();\n }", "title": "" }, { "docid": "ad805afc83c9091e4013a3764b4c2654", "score": "0.6382516", "text": "closeMenu() {\n this.menu.close();\n }", "title": "" }, { "docid": "5da4a480863cd9643c6e4901bda293ce", "score": "0.6366897", "text": "function menuFromCredits(){\n credits.removeChildren();\n stage.removeChild(credits);\n titleLoader();\n}", "title": "" }, { "docid": "556f03367b5ec724088c1b905c14ac20", "score": "0.63651323", "text": "function closeMenu() {\n\n // find elements that will be modified on close\n var menu = $(el).find(\"ul[role='listbox']\");\n var toggle = $(el).find(\"button.listbox-toggle\");\n\n // modify attributes\n menu.addClass(\"hidden\");\n toggle.attr(\"aria-expanded\", \"false\");\n toggle.find(\".toggle-icon\").removeClass(\"rotated\");\n }", "title": "" }, { "docid": "5c7cf89d20b3042481e71d823abce7eb", "score": "0.63614124", "text": "cleanNavigation() {\n // clean hammer bindings\n if (this.navigationHammers.length != 0) {\n for (let i = 0; i < this.navigationHammers.length; i++) {\n this.navigationHammers[i].destroy();\n }\n this.navigationHammers = [];\n }\n\n // clean up previous navigation items\n if (\n this.navigationDOM &&\n this.navigationDOM[\"wrapper\"] &&\n this.navigationDOM[\"wrapper\"].parentNode\n ) {\n this.navigationDOM[\"wrapper\"].parentNode.removeChild(\n this.navigationDOM[\"wrapper\"]\n );\n }\n\n this.iconsCreated = false;\n }", "title": "" }, { "docid": "3fd5e1be5f92db88fa689d7bb2a866b8", "score": "0.63339347", "text": "function cleanup() {\n if (!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if (elements) {\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key) {\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "9465ba33f7071f41c3dfb0ee15e82683", "score": "0.6328421", "text": "function cleanup () {\n if(!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "9465ba33f7071f41c3dfb0ee15e82683", "score": "0.6328421", "text": "function cleanup () {\n if(!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "e197fba3f907f12ef015312c18640797", "score": "0.6321712", "text": "function closeMenu() {\n getElById('new-streamer').value = '';\n getElById('add-streamer-error').innerHTML = '';\n \n let overlay = getElById('add-stream-overlay');\n overlay.animate([{opacity: 1}, {opacity: 0}], {fill: 'forwards', duration: 500});\n setTimeout(() => overlay.style.display = 'none', 500);\n \n getElById('add-stream-menu').animate({'margin-top':'0'});\n }", "title": "" }, { "docid": "dddb15fb6c541f90c692108d05d60294", "score": "0.63144296", "text": "destroy() {\n this.events.unbindGlobal.call(this);\n this.DOM.scope.parentNode.removeChild(this.DOM.scope);\n this.dropdown.hide(true);\n clearTimeout(this.dropdownHide__bindEventsTimeout);\n }", "title": "" }, { "docid": "ebf67e06107081ce7d033f25c0696c7e", "score": "0.6310856", "text": "function exitMenu(){\n optionsTL.reverse()\n addEventListeners()\n}", "title": "" }, { "docid": "8ff3862a7b124e456c6fee4991065ac7", "score": "0.63080156", "text": "destroy() {\n // Remove helper element\n if (this._dom.helper) {\n document.body.removeChild(this._dom.helper)\n delete this._dom.helper\n }\n\n // Remove sorting class\n this.container.classList.remove(this.constructor.css['sortable'])\n this.container.classList.remove(this.constructor.css['sorting'])\n\n // Remove event handlers\n $.ignore(\n document,\n {\n 'mousedown': this._handlers.grab,\n 'mousemove': this._handlers.drag,\n 'mouseup': this._handlers.drop,\n 'touchstart': this._handlers.grab,\n 'touchmove': this._handlers.drag,\n 'touchend': this._handlers.drop\n }\n )\n\n // Remove the sortable reference from the container\n delete this._dom.container._mhSortable\n }", "title": "" }, { "docid": "29f75b4d4bee0f987e45a8dfd4fadc05", "score": "0.63038015", "text": "destroy () {\n // Clone the old elements first, which will remove all existing event\n // handlers\n const newEl = this.wrapper.node().cloneNode(true);\n\n // Replace the old DOM elements with new ones\n this.baseEl.node().replaceChild(newEl, this.wrapper.node());\n\n // Remove all DOM elements\n this.baseEl.node().removeChild(newEl);\n }", "title": "" }, { "docid": "b20b6aa3558503bc29b80ab7d282d6c1", "score": "0.6300173", "text": "function closeMenu() {\n menu.classList.remove(\"open\");\n}", "title": "" }, { "docid": "d40cfe47c36ef8957aac64f40dbe8069", "score": "0.629941", "text": "function removeAllMenuItems() {\n if (logLevel >= 4) { logToWorkflow(\"entering removeAllMenuItems()\", \"DEBUG\", false); }\n if (isAndroid()) {\n _WorkflowContainer.getData(\"http://localhost/sup.amp?querytype=removeallmenuitems&\" + versionURLParam); \n } \n else if (isWindowsMobile()) {\n var xmlhttp = getXMLHTTPRequest();\n xmlhttp.open(\"GET\", \"/sup.amp?querytype=removeallmenuitems&\" + versionURLParam, false);\n xmlhttp.send(\"\");\n }else if ( isIOS()){\n // Get current screen and find header and footer , then remove all the buttons on the header/footer bars. \n \t var curScreenDivId = getCurrentScreen() + \"ScreenDiv\";\n var curScreenDiv = document.getElementById(curScreenDivId);\n if (hasjQueryMobile) {\n var divs = curScreenDiv.getElementsByTagName('div');\n \t var menuEl = curScreenDiv.getElementsByTagName('div')[0];\n \t //This is header div, check to see if we can add it into header.\n \t var headerBts = menuEl.getElementsByTagName('a');\n \t var length = headerBts.length;\n \t var keepCancelBt = false;\n \t for( var i = 0; i < length ; i++ ) {\n \t\t\t $( headerBts[0]).remove();\n \t }\n \t \n \t for( var divIdx = 0; divIdx < divs.length; divIdx++ ) {\n \t\t\t if ( divs[ divIdx].getAttribute('data-role') === 'footer'){\n \t\t\t\t menuEl = divs[ divIdx]; //This should be footer\n \t\t\t\t var footerBts = menuEl.getElementsByTagName('a');\n \t\t\t\t var length = footerBts.length;\n \t\t\t\t for( var i = 0; i <length; i++ ) {\n \t \t\t $( footerBts[0]).remove()\n \t \t }\n $(menuEl).css('display',\"none\");\n break;\n \t\t\t }\n \t }\n }else {\n var uls = curScreenDiv.getElementsByTagName('ul');\n \t for( var i =0; i < uls.length ; i++ )\n \t {\n \t\tvar cls = uls[i].getAttribute('class') ;\n \t\tif ( cls === 'menu')\n \t\t{\n \t\t\tuls[i].innerHTML= \"\";\n \t\t\tbreak;\n \t\t}\t\n \t }\n }\n }\n else {\n var xmlhttp = getXMLHTTPRequest();\n xmlhttp.open(\"GET\", \"http://localhost/sup.amp?querytype=removeallmenuitems&\" + versionURLParam, isIOS());\n xmlhttp.send(\"\");\n }\n if (logLevel >= 4) { logToWorkflow(\"exiting removeAllMenuItems()\", \"DEBUG\", false); }\n}", "title": "" }, { "docid": "fa0cd75c4a1f8356e100ea9534e0ab63", "score": "0.6297092", "text": "destroy(){\n if( this.hide_on_outside_click ) {\n events.off('body', 'click', this.onClickOutside);\n }\n events.off(this.btn, 'click', this.onClickToggleBtn);\n window.removeEventListener('resize', this.onWindowResize);\n }", "title": "" }, { "docid": "9cf42cba7894a5b02cd9b9851811c188", "score": "0.62931085", "text": "destroy(){\n\t\tthis._waitForBody().then(() => {\n\t\t\tthis.element.remove();\n\t\t});\n\t}", "title": "" }, { "docid": "b99e027628f0b679a59a0b2d0d468877", "score": "0.6284166", "text": "_clean() {\n for (var i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }", "title": "" }, { "docid": "996be4500d618e3b9a87633762d7210b", "score": "0.6270759", "text": "function setClose(setMenu) {\n document.querySelector(\"body\").removeChild(setMenu);\n settingsButton.addEventListener(\"click\", setOpen);\n}", "title": "" }, { "docid": "3e7cf8b92e3e722e6aa39615a8f9e841", "score": "0.6260252", "text": "destroyClickedElement(event)\n {\n document.body.removeChild(event.target);\n }", "title": "" }, { "docid": "d9308b92c5cf9b0140aad5f63c617af4", "score": "0.62577605", "text": "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n // Add code to restore the element to its original state...\n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n var id = $el.attr(\"id\");\n $('#' + id + '_ul').remove();\n $el.removeClass();\n/* if($el.option(\"pop\")){\n if($el.parents('body').find('#mask').remov()){\n $el.parents('body').append(\"<div id='mask' class='close_modal'></div>\");\n }\n if($el.parents('body').find('#modal_window').length == 0){\n $el.parents('body').append(\"<div id='modal_window' class='modal_window'></div>\");\n }\n }\n */ });\n }", "title": "" }, { "docid": "41245a0befdc70494e2a5f337b939808", "score": "0.6256877", "text": "function cleanup () {\r\n if(!ctrl.hidden) {\r\n $mdUtil.enableScrolling();\r\n }\r\n\r\n angular.element($window).off('resize', positionDropdown);\r\n if ( elements ){\r\n var items = 'ul scroller scrollContainer input'.split(' ');\r\n angular.forEach(items, function(key){\r\n elements.$[key].remove();\r\n });\r\n }\r\n }", "title": "" }, { "docid": "1623680fdf689ad01abedd1041b712ee", "score": "0.6256221", "text": "hide(){\n //hide the menu screen\n this.containerElement.style.display=\"none\";\n }", "title": "" }, { "docid": "9420c2ccc1d3605d41e43a0fd298f61e", "score": "0.6253105", "text": "destroy() {\n\t\tif(!this.container){\n\t\t\treturn;\n\t\t}\n\t\tthis.container.remove();\n\t\tthis.container = null;\n\t\tthis.element = null;\n\t\tif(!this.button){\n\t\t\treturn;\n\t\t}\n\t\tthis.button.remove();\n }", "title": "" }, { "docid": "e8d85a3d3faedcd2cba8523ae6ef4a60", "score": "0.62528014", "text": "close() {\n this._isOpen = false;\n this._menuElm.classList.add(Config.CSS.Hidden);\n }", "title": "" }, { "docid": "514adb48d9a01b2791ef7d28361f1e82", "score": "0.6244791", "text": "close() {\n assert(openMenus.has(this), 'Menu was already closed!');\n if (this.#openedSubMenu) {\n if (this.#openedSubMenu.isOpen()) {\n this.#openedSubMenu.close();\n }\n this.#openedSubMenu = null;\n }\n\n this.#dom.style = MENU_CLOSED_STYLE;\n openMenus.delete(this);\n this.dispatchEvent(new MenuEvent(this, MenuEventType.CLOSE));\n\n if (openMenus.size === 0) {\n overlay.style = MENU_OVERLAY_CLOSED_STYLE;\n }\n }", "title": "" }, { "docid": "cd62f742e6dd85ff188ab071b3c20929", "score": "0.6241157", "text": "function cleanUp() {\n if (options.mode > 1) {\n inputArea.removeEventListener('keydown', jConsoleInputEventListener);\n }\n\n if (options.styling.sticky) {\n if (options.styling.overlay) {\n overlay.remove();\n }\n window.removeEventListener('resize', _resizeFn);\n }\n\n consoleArea.remove();\n if (options.mode > 1) {\n jConsoleHistory.clear();\n }\n _style.removeStyle();\n }", "title": "" }, { "docid": "2462e21afc1224fc14bc637287c4c968", "score": "0.6231279", "text": "function closeMenu(){\n\t$(\".menu-drop\").fadeOut('fast');\n}", "title": "" }, { "docid": "1a4f56477092a8fc6c2f7070dab92005", "score": "0.62280756", "text": "function hideMenu() {\n\t\tmenu.Hide();\n\t\ttileTouchController.enableInput();\n\t\tcameraMovement.enableInput();\n\t}", "title": "" }, { "docid": "8b1fa307c1d0bc7eb78e6884f399788d", "score": "0.6226885", "text": "function destroy() {\n\t\t\t\tif (!apActive) return;\n\n\t\t\t\tplayBtn.removeEventListener('click', playToggle, false);\n\t\t\t\tvolumeBtn.removeEventListener('click', volumeToggle, false);\n\t\t\t\trepeatBtn.removeEventListener('click', repeatToggle, false);\n\t\t\t\tplBtn.removeEventListener('click', plToggle, false);\n\n\t\t\t\tprogressBar.parentNode.parentNode.removeEventListener('mousedown', handlerBar, false);\n\t\t\t\tprogressBar.parentNode.parentNode.removeEventListener('mousemove', seek, false);\n\t\t\t\tdocument.documentElement.removeEventListener('mouseup', seekingFalse, false);\n\n\t\t\t\tvolumeBar.parentNode.parentNode.removeEventListener('mousedown', handlerVol, false);\n\t\t\t\tvolumeBar.parentNode.parentNode.removeEventListener('mousemove', setVolume);\n\t\t\t\tdocument.documentElement.removeEventListener('mouseup', seekingFalse, false);\n\n\t\t\t\tprevBtn.removeEventListener('click', prev, false);\n\t\t\t\tnextBtn.removeEventListener('click', next, false);\n\n\t\t\t\taudio.removeEventListener('error', error, false);\n\t\t\t\taudio.removeEventListener('timeupdate', update, false);\n\t\t\t\taudio.removeEventListener('ended', doEnd, false);\n\t\t\t\tplayer.parentNode.removeChild(player);\n\n\t\t\t\t// Playlist\n\t\t\t\tpl.removeEventListener('click', listHandler, false);\n\t\t\t\tpl.parentNode.removeChild(pl);\n\n\t\t\t\taudio.pause();\n\t\t\t\tapActive = false;\n\t\t\t}", "title": "" }, { "docid": "87a9427e0182067e57d8ef0420356a53", "score": "0.6218147", "text": "function destroyClickedElement(event)\n{\n document.body.removeChild(event.target);\n}", "title": "" }, { "docid": "87a9427e0182067e57d8ef0420356a53", "score": "0.6218147", "text": "function destroyClickedElement(event)\n{\n document.body.removeChild(event.target);\n}", "title": "" }, { "docid": "87a9427e0182067e57d8ef0420356a53", "score": "0.6218147", "text": "function destroyClickedElement(event)\n{\n document.body.removeChild(event.target);\n}", "title": "" }, { "docid": "476f47d000624a2c43ba3146a144c281", "score": "0.62063646", "text": "function removeOverlayAfterClick() {\n const buttons = document.querySelectorAll(\"ul a\");\n const input = document.querySelectorAll(\"#menuToggle input\");\n\n buttons.forEach(function (item) {\n item.addEventListener(\"click\", () => {\n input[0].checked = false;\n });\n });\n }", "title": "" }, { "docid": "71bbb8fcd487b284a19a74a508c615c2", "score": "0.6204904", "text": "removeHlMenus() {\n let ic = this.icn3d,\n me = ic.icn3dui\n $('#' + ic.pre + 'atomsCustom').val('')\n $('#' + ic.pre + 'atomsCustom')[0].blur()\n }", "title": "" }, { "docid": "3b1e7c68f834c76834bced404994928a", "score": "0.6204674", "text": "function closeMenu() {\n hamburger.classList.remove('active');\n navMenu.classList.remove('active');\n}", "title": "" }, { "docid": "54a31ea6e2d50e5281d2bcf4174574d7", "score": "0.6202433", "text": "destroy() {\n // Remove event listeners\n $.ignore(\n document,\n {\n 'dragenter dragover': this._handlers.dragStart,\n 'dragleave drop': this._handlers.dragEnd\n }\n )\n\n // Remove the acceptor element\n if (this.acceptor !== null) {\n this.acceptor.parentNode.removeChild(this.acceptor)\n }\n\n // Clear DOM element references\n this._dom.acceptor = null\n this._dom.dropZone = null\n this._dom.faceplate = null\n this._dom.input = null\n }", "title": "" }, { "docid": "8aa6e078a5c308bc8792b2d64b467b1e", "score": "0.6192851", "text": "function destroy() {\n if($(component).length) {\n console.log('restaurantSearch destroy'); \n $(component).remove();\n // $(component).detach();\n // can either .detach() which keeps event handlers\n // or can .remove() and re-run assignEventHandlers() in render()\n }\n }", "title": "" }, { "docid": "5ca783de111369f8679e539a29666fa4", "score": "0.61884606", "text": "destroy() {\n\t\tthis.listen( false );\n\t\tthis.parent.children.splice( this.parent.children.indexOf( this ), 1 );\n\t\tthis.parent.controllers.splice( this.parent.controllers.indexOf( this ), 1 );\n\t\tthis.parent.$children.removeChild( this.domElement );\n\t}", "title": "" }, { "docid": "b26e0e13b202310dbb50d75814b242b0", "score": "0.61883926", "text": "function destroy() {\n\t\t\tClasses.forEach(function (cls) {\n\t\t\t\tif (!cls) {\n\t\t\t\t\treturn;\n\t\t\t\t} // Ignore empty classes\n\t\t\t\tremoveClass(scope_Target, cls);\n\t\t\t});\n\t\t\tscope_Target.innerHTML = '';\n\t\t\tdelete scope_Target.noUiSlider;\n\t\t}", "title": "" }, { "docid": "bd9065eee3204c922152cba01e312dbd", "score": "0.6188235", "text": "function destroyClickedElement(event)\n{\n\tdocument.body.removeChild(event.target);\n}", "title": "" }, { "docid": "9a8f5351983dcaa0f76b90a2eeb2d1ec", "score": "0.618607", "text": "detached() {\n $('.fixed-header .dropdown').off();\n }", "title": "" }, { "docid": "ce71a95fca6b802d6481956acd02dc31", "score": "0.6185348", "text": "function menuFromStruct(){\n instructions.removeChildren();\n stage.removeChild(instructions);\n titleLoader();\n}", "title": "" }, { "docid": "6121ac16d3245670ab0cfee723116983", "score": "0.61695427", "text": "function exitMenu(){\n document.body.removeChild(startButton);\n document.body.removeChild(guiContainer);\n document.body.removeChild(ship1Name);\n document.body.removeChild(ship2Name);\n document.body.removeChild(logotext);\n document.body.removeChild(infoImage);\n document.body.removeChild(randomButton);\n\n localStorage.setItem(\"ship1opts\", JSON.stringify(ship1Opts));\n localStorage.setItem(\"ship2opts\", JSON.stringify(ship2Opts));\n}", "title": "" }, { "docid": "5328a7b221ac65902d13c195671e2ca8", "score": "0.61518884", "text": "_removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }", "title": "" }, { "docid": "5328a7b221ac65902d13c195671e2ca8", "score": "0.61518884", "text": "_removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }", "title": "" }, { "docid": "5328a7b221ac65902d13c195671e2ca8", "score": "0.61518884", "text": "_removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }", "title": "" }, { "docid": "dd8af985c4cfdaadb226228c7183cfe9", "score": "0.614518", "text": "function deinit() {\n $.cancel.removeEventListener('click', dismiss);\n $.apply.removeEventListener('click', dismiss);\n $.list_view.removeEventListener('click', onListSelect);\n $.stopListening();\n $.destroy();\n}", "title": "" }, { "docid": "7e9ab9c8cdb4d6263361a43819f42abc", "score": "0.6137973", "text": "function removeMainMenuBg() {\n mainMenuBg.remove();\n mainMenuBg = '';\n }", "title": "" }, { "docid": "b2d074c801317fcbdd84c0a2f21da7eb", "score": "0.61261064", "text": "clear() {\n if (this.resizeListener_) {\n window.removeEventListener('resize', this.resizeListener_);\n this.resizeListener_ = null;\n }\n for (let listener of this.keydownListeners) {\n document.removeEventListener('keydown', listener);\n }\n this.keydownListeners = [];\n this.manager_ = null;\n }", "title": "" }, { "docid": "3a78045db2361268c7a3fe99a96c9a4d", "score": "0.61219174", "text": "_removeListeners(elem) {\n try {\n elem.removeEventListener( 'mouseout', this._hideSubmenuManager.bind( this, this._submenu ), false );\n this._moveListener.removeEventListener( 'mousemove', this._coolMenuShow.bind( this, event ), false );\n }\n catch ( error ) {\n console.log( error.name );\n }\n }", "title": "" }, { "docid": "6b70840358802cfe36c93a16d9a9d448", "score": "0.6111024", "text": "function cleanElement() {\n destroyListener();\n\n element\n .removeClass('md-active')\n .attr('aria-hidden', 'true')\n .css('display', 'none');\n element.parent().find('md-select-value').removeAttr('aria-hidden');\n\n announceClosed(opts);\n\n if (!opts.$destroy && opts.restoreFocus) {\n opts.target.focus();\n }\n }", "title": "" }, { "docid": "1268290b25ff5f75875fcedc1673d5a4", "score": "0.61026865", "text": "function _destroy() {\r\n selected = null;\r\n\t\tdocument.removeEventListener(\"mousemove\", _move_elem);\r\n\t\tdocument.removeEventListener(\"mouseup\", _destroy);\r\n}", "title": "" }, { "docid": "1e57a5bf2f40205a6ef5824ec0a1982d", "score": "0.609145", "text": "function cleanEmpireMenus()\r\n{\r\n\t//Clear out additional menus cause i'm tired of having multiple ones loading if you run seperate scripts\r\n\tvar cleanmenus = document.evaluate(\"//table[@class='header']\",\r\n\tdocument, null, XPathResult.UNORDERED_NODE_TYPE, null);\r\n\tif (cleanmenus.snapshotLength>1)\r\n\t{\r\n\t\tfor (var i = 0; i < cleanmenus.snapshotLength; i++){\r\n\t\t\tcleanmenus.parentNode.removeChild(cleanmenus.previousSibling);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "78430c7d9b096f9f77b96bdf20119e59", "score": "0.609014", "text": "function clearCtxMenu() {\n const ctxMenu = document.getElementById(\"ctxMenu\");\n if (ctxMenu) {\n setTimeout(function hideContextMenu(e) {\n ctxMenu.innerHTML = '';\n ctxMenu.style.visibility = 'hidden';\n }, 50);\n }\n}", "title": "" }, { "docid": "25efbda689d6bd2040d3c514be0b24f5", "score": "0.60839564", "text": "function cancelMenu() {\n state.done = true;\n if (state.currentPlayback) {\n state.currentPlayback.stop(function(err) {\n // ignore errors\n });\n }\n\n // remove listeners as future calls to playIntroMenu will create new ones\n channel.removeListener('ChannelDtmfReceived', cancelMenu);\n channel.removeListener('StasisEnd', cancelMenu);\n }", "title": "" }, { "docid": "3301f0d58e1ecb6f3ab97c6fb0aae987", "score": "0.60797983", "text": "function _beforeMenuPopup() {\n removeCurrentPopUp();\n }", "title": "" }, { "docid": "4b02b30ffa6f7ce2216757d0c3ed229f", "score": "0.60673374", "text": "function menuRemove(actionElem) {\n // Reset everything, hide the text and swap the icon\n actionElem.find(\"span\").addClass(\"hidden\"); \n actionElem.find(\"i\").removeClass(menuIconActive);\n actionElem.find(\"i\").addClass(menuIconPassive);\n}", "title": "" }, { "docid": "7f6577612428fb6d599a77d5cc3846ce", "score": "0.60662466", "text": "function hideMenu() {\n\t\tmenu.classList.add('header-nav-closed');\n\t\tdocument.body.classList.remove('noscroll');\n\t\tcontentOverlay.classList.remove('header-nav-overlay-visible');\t\n\t}", "title": "" }, { "docid": "555b3de6e2a51f64573adc9e116340e3", "score": "0.60652405", "text": "function mcom_removeMenu(menuName) {\n\t// Mac-change old code was: if(!(menuName in this.menus)) {\n\tif(!this.menus[menuName]) {\n\t\tthrow new MCException(\"'\" + menuName + \"' is not a MenuContainer\", 202);\n\t}\n\t\n\tvar menu = this.menus[menuName];\n\t\n\tif(menu.HTMLElement != null) {\n\t\t// Remove the DOM element if it has been created\n\t\tdocument.body.removeChild(menu.HTMLElement);\n\t}\n\t\n\tdelete this.menus[menu.name];\n}", "title": "" }, { "docid": "50a2cafeebd5e64f15eeda38a0397f2d", "score": "0.6062549", "text": "destroy() {\n // The dropdown may not be in ToolbarView#children at the moment of toolbar destruction\n // so let's make sure it's actually destroyed along with the toolbar.\n this.groupedItemsDropdown.destroy();\n\n this.resizeObserver.destroy();\n }", "title": "" }, { "docid": "860ed9b3e4dcc85ba910d10c8d3c6208", "score": "0.6061391", "text": "removeMenu(id) {\n check(id, String);\n delete Context.menus[id];\n }", "title": "" } ]
da5211f79791523127604a5b280ef964
Parses end time into JSON object
[ { "docid": "ac63d52d55ed4e09c9893a59b987aac4", "score": "0.59029794", "text": "function end_time() \n{\n var time_string = $('#end_time').val() || \"01:00 AM\";\n var arr = time_string.replace(':',' ').split(' ');\n return{\n 'h' : parseInt( arr[0] ) + ( arr[2] == \"AM\" ? 0 : 12 ),\n 'm' : parseInt( arr[1] )\n };\n}", "title": "" } ]
[ { "docid": "088b1bd66bf41110fae0cef8ac9c5b70", "score": "0.6286324", "text": "function getTimeRemaining(endtime) {\n var t = Date.parse(endtime) - Date.parse(new Date());\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n return {\n 'total': t,\n 'minutes': minutes,\n 'seconds': seconds\n };\n }", "title": "" }, { "docid": "a6bc11ce9f8e1e39561a74404bbb014a", "score": "0.61867636", "text": "function getEndTime(ev) {\n return ev.endtime === '' ? '' : ev.endtime.getTime();\n}", "title": "" }, { "docid": "a5156e8a5ba1678f805ddc1c6d98c3a0", "score": "0.6085181", "text": "function getTimeRemaining(endtime) {\n const t = Date.parse(endtime) - Date.parse(new Date());\n const seconds = Math.floor((t / 1000) % 60);\n const minutes = Math.floor((t / 1000 / 60) % 60);\n const hours = Math.floor((t / (1000 * 60 * 60)));\n const days = Math.floor(t / (1000 * 60 * 60 * 24));\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n }", "title": "" }, { "docid": "2567b0bda6dc24307c3eef3599d16c19", "score": "0.601109", "text": "function getEndTime(layer) {\n var time;\n var times = getLayerTimes(layer);\n if (times && times.length) {\n time = times[times.length - 1];\n // Check if the time value is actually a string that combines\n // begin and end time information into one string instead of\n // providing separate time values for every step.\n if (undefined !== time && null !== time && 1 === times.length) {\n // Make sure time is string before checking syntax.\n time = time + \"\";\n var timeSplits = time.split(\"/\");\n if (timeSplits.length > 1) {\n // End time is the second part of the split.\n time = timeSplits[1];\n }\n }\n // Time is expected to be time format string if it is not a number.\n // Convert time value into Date object.\n time = new Date(isNaN(time) ? time : parseInt(time, TIME_RADIX));\n }\n return time;\n }", "title": "" }, { "docid": "bff85a9e63625734dfa7d7c88841f794", "score": "0.60048044", "text": "function getTimeRemaining(endtime) {\n const t = Date.parse(endtime) - Date.parse(new Date()), //вычисляем разницу между дедлайном и текущей датой\n days = Math.floor(t / (1000 * 60 * 60 * 24)), //метод получения целых частей (дней) с округлением\n hours = Math.floor((t / (1000 * 60 * 60) % 24)), //% дает возможность получить хвостик отбросив целые части, которые уходят к дням\n minutes = Math.floor((t / 1000 / 60) % 60),\n seconds = Math.floor((t / 1000) % 60);\n\n return {\n 'total': t, //возвращаем наружу полученные ранее значения\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "title": "" }, { "docid": "9ed12dd8965b378f143e25ff4f6bc393", "score": "0.6000726", "text": "function getTimeRemaining(endtime) {\n const t = Date.parse(endtime) - Date.parse(new Date()),\n days = Math.floor( t / (1000*60*60*24) ),\n hours = Math.floor((t / (1000*60*60) ) % 24 ),\n minutes = Math.floor((t / 1000 / 60) % 60 ),\n seconds = Math.floor((t / 1000) % 60 );\n \n return {\n 'total' : t,\n 'days' : days,\n 'hours' : hours,\n 'minutes' : minutes,\n 'seconds' : seconds\n };\n }", "title": "" }, { "docid": "71eb013aec04232a4529e7f87e6fd66b", "score": "0.594661", "text": "setEndTime(endTime) {\n this.endTime = endTime;\n }", "title": "" }, { "docid": "278bae076d8852e975d3111bae1bf3b4", "score": "0.59435105", "text": "function getTimeRemaining(endtime) {\n let timeRemaining = Date.parse(endtime) - Date.parse(new Date());\n let seconds = Math.floor((timeRemaining / 1000) % 60);\n let minutes = Math.floor((timeRemaining / 1000 / 60) % 60);\n let hours = Math.floor((timeRemaining / 1000 / 60 / 60) % 24);\n let days = Math.floor((timeRemaining / 1000/ 60 / 60/ 24));\n//3. Creating the Object with all data, that will be returned by this function\n return {\n 'total': timeRemaining,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n }\n}", "title": "" }, { "docid": "a1c6a4d2be757c40081f8d6c3b8f8b8f", "score": "0.5896532", "text": "function time_remaining(endTime) {\n var t = Date.parse(endTime) - Date.parse(new Date());\n\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n\n return { 'total': t, 'minutes': minutes, 'seconds': seconds };\n}", "title": "" }, { "docid": "c9076e57a4d99266baf7f04fc7f3da6a", "score": "0.58751106", "text": "function getTimeRemaining(endtime) {\n var t = endtime - Date.parse(new Date());//already parsed deadline\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n var hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n var days = Math.floor(t / (1000 * 60 * 60 * 24));\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "title": "" }, { "docid": "d495aee8eeefea8a95aa152977297d78", "score": "0.5825593", "text": "displayEnd(e) {\n var endTime = this.timeString(\n e.event.endDate._time.hour,\n e.event.endDate._time.minute\n );\n return \"End Time: \" + endTime;\n }", "title": "" }, { "docid": "afaeeb09c54a28b7d0e1508f827a5757", "score": "0.57713526", "text": "function getTimeRemaining(endtime){\n var t = Date.parse(endtime) - (new Date()).getTime();\n var seconds = Math.floor( (t/1000) % 60 );\n var minutes = Math.floor( (t/1000/60) % 60 );\n var hours = Math.floor( (t/(1000*60*60)) % 24 );\n var days = Math.floor( t/(1000*60*60*24) );\n\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "title": "" }, { "docid": "2515c2d64683ba35313333644adb5814", "score": "0.56984735", "text": "async getEndTime(): Promise<BigNumber> {\n return this._contract.endTime.call();\n }", "title": "" }, { "docid": "ac7b49f4226efaa41c16fd672198ce54", "score": "0.5686709", "text": "function showEndTime() {\n if (this.item.StartTime) {\n var duration = parseInt(this.item.Duration);\n var endTime = new Date(this.item.StartTime);\n endTime.setMinutes(this.item.StartTime.getMinutes() + duration);\n return formatTime(endTime);\n }\n return null;\n \n }", "title": "" }, { "docid": "d571213ac63e427fbedcfd71719c7e8b", "score": "0.56437624", "text": "function getTimeRemaining(endtime) {\n const total = Date.parse(endtime) - Date.parse(new Date());\n const seconds = Math.floor((total / 1000) % 60);\n const minutes = Math.floor((total / 1000 / 60) % 60);\n const hours = Math.floor((total / (1000 * 60 * 60)) % 24);\n const days = Math.floor(total / (1000 * 60 * 60 * 24));\n\n return {\n total,\n days,\n hours,\n minutes,\n seconds\n };\n}", "title": "" }, { "docid": "e367cb7ec2f504a24fbba1a5dfc23677", "score": "0.56372434", "text": "setEndTime(rawEndTime) {\n\t\tif (rawEndTime === \"\") {\n\t\t\tthis.endTime = null;\n\t\t}\n\t\t\n\t\tthis.endTime = new Date(rawEndTime);\n\t}", "title": "" }, { "docid": "814f7d102259841b6492f90a55b5c58b", "score": "0.5626759", "text": "get availableEndTime () {\n\t\treturn this._availableEndTime;\n\t}", "title": "" }, { "docid": "6f1c056fbcbd438ddcc5850cf9c81542", "score": "0.56264585", "text": "function getTimeRemaining(endtime){\n const total = Date.parse(endtime) - Date.parse(new Date());\n const seconds = Math.floor( (total/1000) % 60 );\n const minutes = Math.floor( (total/1000/60) % 60 );\n const hours = Math.floor( (total/(1000*60*60)) % 24 );\n const days = Math.floor( total/(1000*60*60*24) );\n \n return {\n total,\n days,\n hours,\n minutes,\n seconds\n };\n }", "title": "" }, { "docid": "eb34969a930e39d20c2d220aaa2f3783", "score": "0.5607809", "text": "function getTimeRemaining(endtime){\n\tvar t = endtime - Date.parse(new Date());\n\tconsole.log(endtime, t);\n\tvar seconds = Math.floor( (t/1000) % 60 );\n\tvar minutes = Math.floor( (t/1000/60) % 60 );\n\tvar hours = Math.floor( (t/(1000*60*60)) % 24 );\n\tvar days = Math.floor( t/(1000*60*60*24) );\n\treturn {\n\t\t'total': t,\n\t\t'days': days,\n\t\t'hours': hours,\n\t\t'minutes': minutes,\n\t\t'seconds': seconds\n\t};\n}", "title": "" }, { "docid": "21474d5431c22eeddc3ed4c1660189fa", "score": "0.5606888", "text": "function getRemainingTime(endtime) {\n let t = Date.parse(endtime) - Date.parse(new Date()),//difference between the date when timer expires and the moment when the function is executed (ms)\n seconds = Math.floor((t/1000) % 60),\n minutes = Math.floor((t/1000/60) % 60),\n hours = Math.floor((t/(1000*60*60)));\n\n if (t < 0){ //making the timer look nice on the page in case the date has expired\n seconds = 0;\n minutes = 0;\n hours = 0;\n }\n\n return {\n 'total' : t,\n 'seconds' : seconds,\n 'minutes' : minutes,\n 'hours' : hours\n };\n }", "title": "" }, { "docid": "4729a9e680d9c757c04f226e1f772326", "score": "0.5597196", "text": "function getEndTime(){\n\t\tstartTime = new Date();\n\t\tendTime = new Date(startTime.getTime() + timer*60000);\n\t\tconsole.log(startTime);\n\t\tconsole.log(endTime);\n\t}", "title": "" }, { "docid": "15b37dbced1d5ba017b9c635ed7356ed", "score": "0.5595846", "text": "function compare_time(begin_time,end_time){\n var begin=standardParse(begin_time).date-standardParse(end_time).date<=0?begin_time:end_time;\n var end=standardParse(begin_time).date-standardParse(end_time).date>=0?begin_time:end_time;\n return{\n begin:begin,\n end:end\n }\n}", "title": "" }, { "docid": "1b74bb75f712c1f9c21fad8d8ad4b9c4", "score": "0.5572877", "text": "end_time() {\n return this.approx_server_time() - this.buffer_duration;\n }", "title": "" }, { "docid": "e56333b57cc6d42c2c536c09e4f8b983", "score": "0.557251", "text": "function getResponseTime(start,end){\n var startTimes = convertTimestamp(start);\n var endTimes = convertTimestamp(end);\n \n //Calculate the total start and end times in seconds\n var totalStart = (startTimes.hour*3600) + (startTimes.minute*60) + startTimes.seconds + (startTimes.partial_seconds*1000000)\n var totalEnd = (endTimes.hour*3600) + (endTimes.minute*60) + endTimes.seconds + (endTimes.partial_seconds*1000000)\n\n if (startTimes.day != endTimes.day){\n totalEnd += (24*3600);\n }\n\n //If the call took more than an hour calculate the number of hours it took\n if((totalEnd-totalStart)>3600){\n var hours = ((totalEnd-totalStart) - (totalEnd-totalStart)%3600)/3600; \n }\n else{\n var hours = 0;\n }\n //If the call took more than a minute calculate the number of minutes it took\n if((totalEnd-totalStart)>60){ \n var minutes = ((totalEnd-(hours*3600)-totalStart)-(totalEnd-(hours*3600)-totalStart)%60)/60; \n }\n else{\n var minutes = 0;\n }\n //Calculate seconds as the end time minus the hours and minutes previously calculated\n var seconds = (totalEnd-(hours*3600)-(minutes*60)-totalStart); \n\n //Return the response time in minutes\n return (hours*60)+minutes+(seconds/60.0);\n}", "title": "" }, { "docid": "42a01938eb9f7f483a301812cb6dca0a", "score": "0.55539757", "text": "function preProcessEndData(params){\r\n\t// Concats the end date and time together.\r\n if (document.getElementById(\"end_date\").value !== \"\" && document.getElementById(\"end_time\").value !== \"\") {\r\n params[\"end\"] = document.getElementById(\"end_date\").value + \"T\" + document.getElementById(\"end_time\").value + \"Z\";\r\n }\r\n // No end time given. Use 23:59:59.\r\n else if (document.getElementById(\"end_date\").value !== \"\") {\r\n params[\"end\"] = document.getElementById(\"end_date\").value + \"T23:59:59Z\";\r\n }\r\n}", "title": "" }, { "docid": "d88091f3d2073659fda5d77386405da3", "score": "0.5545658", "text": "async find_time(start, end){\n let r_data;\n let i;\n let data = await fetch(this.uri);\n r_data = await data.json();\n data = [];\n for(i in r_data){\n let t = (new Date(r_data[i].createdAt)).getTime();\n // console.log(\"D1:\", r_data[i].createdAt);\n // console.log(\"D2:\", (new Date(start)))\n if((t >= start) && (t <= end)){\n data.push(r_data[i]);\n }\n }\n // this.note = data;\n if(data.length == 0){\n console.log(\"Nhớ lưu ý mỗi ngày có đến 86400 * 1000 giây nhe!. Hệ thống đang tính theo micro_seconds\");\n }\n return data;\n }", "title": "" }, { "docid": "3a08d0c7f1a6760ac4a18820b4f0fdb8", "score": "0.5490058", "text": "function readtime(data)\n{\n lastFedtime = data.val();\n foodObject.fedtime = lastFedtime;\n console.log(lastFedtime);\n}", "title": "" }, { "docid": "f5f367a0e546872fa4f33c1f39cd220e", "score": "0.54776096", "text": "get packetEnd() {\n return hpTimeToDateTime(parseInt(this.hppacketend));\n }", "title": "" }, { "docid": "39f824b4a45a043c8563d87c5b6c8e0b", "score": "0.54773945", "text": "endTime(value) {\n doMomentGetterSetter(this, \"endTime\", value);\n return this;\n }", "title": "" }, { "docid": "39f824b4a45a043c8563d87c5b6c8e0b", "score": "0.54773945", "text": "endTime(value) {\n doMomentGetterSetter(this, \"endTime\", value);\n return this;\n }", "title": "" }, { "docid": "39f824b4a45a043c8563d87c5b6c8e0b", "score": "0.54773945", "text": "endTime(value) {\n doMomentGetterSetter(this, \"endTime\", value);\n return this;\n }", "title": "" }, { "docid": "39f824b4a45a043c8563d87c5b6c8e0b", "score": "0.54773945", "text": "endTime(value) {\n doMomentGetterSetter(this, \"endTime\", value);\n return this;\n }", "title": "" }, { "docid": "39f824b4a45a043c8563d87c5b6c8e0b", "score": "0.54773945", "text": "endTime(value) {\n doMomentGetterSetter(this, \"endTime\", value);\n return this;\n }", "title": "" }, { "docid": "c763b428da0e9ff09ece3a26021d4414", "score": "0.5469414", "text": "get endDate() {\n return this._data.ends_at ? new Date(this._data.ends_at) : null;\n }", "title": "" }, { "docid": "3aa98f78fc5edfbcda88f65d895f3020", "score": "0.54627776", "text": "function meetingObjects() {\n for (i=0; i<details.length; i++) {\n details[i] = jsonMeetingNotation(details[i]);\n }\n // console.log(details)\n\n function jsonMeetingNotation(input) {\n var output=[];\n for (var j in input) {\n var thisMeeting = new Object\n thisMeeting.day = input[j].split(' // ')[0].trim()\n \n // turn start time into 24 hour\n if (input[j].split(' // ')[1].slice(-2) == 'PM') {\n var shour = Number(input[j].split(' // ')[1].slice(-8,-6).trim()) + 12\n var smin = Number(input[j].split(' // ')[1].slice(-5,-2).trim())\n thisMeeting.startH = shour\n thisMeeting.startM = smin\n thisMeeting.start = shour + ':' + smin\n } else {\n var shour = Number(input[j].split(' // ')[1].slice(-8,-6).trim())\n var smin = Number(input[j].split(' // ')[1].slice(-5,-2).trim())\n thisMeeting.startH = shour\n thisMeeting.startM = smin\n thisMeeting.start = shour + ':' + smin\n }\n \n // turn end time into 24 hour\n if (input[j].split(' // ')[2].slice(-2) == 'PM') {\n var ehour = Number(input[j].split(' // ')[2].slice(-8,-6).trim()) + 12\n var emin = Number(input[j].split(' // ')[2].slice(-5,-2).trim())\n thisMeeting.endH = ehour\n thisMeeting.endM = emin\n thisMeeting.end = ehour + ':' + emin\n } else {\n var ehour = Number(input[j].split(' // ')[2].slice(-8,-6).trim())\n var emin = Number(input[j].split(' // ')[2].slice(-5,-2).trim())\n thisMeeting.endH = ehour\n thisMeeting.endM = emin\n thisMeeting.end = ehour + ':' + emin\n }\n \n // input meeting type\n if (input[j].split(' // ')[4] == 'Topic') {\n thisMeeting.type = 'No Meeting Type'\n } else {\n thisMeeting.type = input[j].split(' // ')[4]\n }\n \n if (input[j].split(' // ')[4] == 'Women') {\n thisMeeting.type = 'No Meeting Type'\n } else {\n thisMeeting.type = input[j].split(' // ')[4]\n }\n \n if (input[j].split(' // ')[4] == undefined) {\n thisMeeting.type = 'No Meeting Type'\n } else {\n thisMeeting.type = input[j].split(' // ')[4]\n }\n \n // input special interest\n if (input[j].split(' // ')[5] == undefined) {\n thisMeeting.interest = 'No Special Interest'\n } else {\n thisMeeting.interest = input[j].split(' // ')[5]\n }\n \n output.push(thisMeeting);\n }\n return output;\n }\n}", "title": "" }, { "docid": "fa438f7782ca0519315c2c9bc6be01c2", "score": "0.53788203", "text": "function _entry(data) {\n var entry = {};\n try {\n var idx = data.indexOf(\"begin=\\\"\");\n data = data.substr(idx + 7);\n idx = data.indexOf(\"\\\" end=\\\"\");\n entry['begin'] = _seconds(data.substr(0, idx));\n data = data.substr(idx + 7);\n idx = data.indexOf(\"\\\">\");\n entry['end'] = _seconds(data.substr(0, idx));\n data = data.substr(idx + 2);\n entry['text'] = data;\n } catch (error) {}\n return entry;\n }", "title": "" }, { "docid": "a35ccd8aad1720d3137c3f078a9fd7d7", "score": "0.5295797", "text": "function endTime(map_id, round, link) {\n var data = {\n submission_viewing_event: {\n map_id: map_id,\n round: round\n }\n };\n\n if (link) {\n data.submission_viewing_event.link = link;\n }\n\n $.ajax({\n type: 'POST',\n dataType: 'json',\n async: false,\n url: '/submission_viewing_events/end_timing',\n data: $.param(data)\n });\n}", "title": "" }, { "docid": "bfed2e37130b779153be98845aa75871", "score": "0.52923083", "text": "function endOPT (str){\n var date = new Date(str);\n var dateTemp = new Date(date.setFullYear(date.getFullYear()+ optDuration))\n var endDate = dateTemp.toJSON().slice(0,10);\n return endDate;\n}", "title": "" }, { "docid": "ec09348e39d17e88435b048855db866a", "score": "0.5260586", "text": "function i(t){const s=null==t?void 0:t.time;if(s&&(null!=s.start||null!=s.end)){const o=[];null!=s.start&&o.push(s.start),null!=s.end&&-1===o.indexOf(s.end)&&o.push(s.end),t.time=o.join(\",\");}}", "title": "" }, { "docid": "520b985b3dea654492a4812c1513b790", "score": "0.5256982", "text": "function validTimes(start,end) {\n endParts = end.split(':');\n startParts = start.split(':');\n endHr = (parseInt(endParts[0])+19) % 24;\n startHr = (parseInt(startParts[0])+19) % 24;\n edge = endHr==startHr ? endParts[1]>startParts[1] : true;\n return (start!='')&&(end!='')&&(endHr>=startHr)&&edge;\n}", "title": "" }, { "docid": "e3483dd6421dfbc08adfb0ec5c86f5ef", "score": "0.5249935", "text": "function getStatusEndTime(blockHeight, endBlock) {\n return new Date(\n new Date().getTime() + (endBlock - blockHeight) * 6000\n ).toUTCString()\n}", "title": "" }, { "docid": "587569c9ad44ed4ede45aa712e7f309a", "score": "0.5228176", "text": "static _parseTimeRange(start, end) {\n const absStart = moment(start);\n const absEnd = moment(end);\n const isValidAbsStart = absStart.isValid();\n const isValidAbsEnd = absEnd.isValid();\n let mode = 'absolute';\n let from;\n let to;\n let reverse;\n\n if (isValidAbsStart && isValidAbsEnd) {\n // Both are valid absolute dates.\n from = absStart;\n to = absEnd;\n reverse = absStart.isAfter(absEnd);\n } else {\n // Try to parse as relative dates too (absolute dates will also be accepted)\n const startDate = dateMath.parse(start);\n const endDate = dateMath.parse(end);\n if (!startDate || !endDate || !startDate.isValid() || !endDate.isValid()) {\n throw new Error(\n i18n.translate('visTypeVega.vegaParser.baseView.timeValuesTypeErrorMessage', {\n defaultMessage:\n 'Error setting time filter: both time values must be either relative or absolute dates. {start}, {end}',\n values: {\n start: `start=${JSON.stringify(start)}`,\n end: `end=${JSON.stringify(end)}`,\n },\n })\n );\n }\n reverse = startDate.isAfter(endDate);\n if (isValidAbsStart || isValidAbsEnd) {\n // Mixing relative and absolute - treat them as absolute\n from = startDate;\n to = endDate;\n } else {\n // Both dates are relative\n mode = 'relative';\n from = start;\n to = end;\n }\n }\n\n if (reverse) {\n [from, to] = [to, from];\n }\n\n return { from, to, mode };\n }", "title": "" }, { "docid": "2da269a31c003296bd95b4616b0df839", "score": "0.5221643", "text": "function updateEndTimestamp(){\r\n\tcontract.end().then((result) =>\r\n\t{\r\n\t\thandleResult(result, a_end, 0, \"none\");\r\n\t});\r\n}", "title": "" }, { "docid": "2acc417b2c5c0949ea18aba5803cee64", "score": "0.521293", "text": "get loopEnd() {\n return new TimeClass(this.context, this._loopEnd, \"i\").toSeconds();\n }", "title": "" }, { "docid": "a057be34d485f0b2e15c541ef0cdcce0", "score": "0.5209984", "text": "finish() {\n let endTime = process.hrtime(this.startTime);\n this.attributes['runtime'] = endTime[0] * 1000 + Math.round(endTime[1] / 10000) / 100;\n return this.attributes;\n }", "title": "" }, { "docid": "3152472704fc65443c9996a42a148145", "score": "0.5192545", "text": "function parse_replay_start(time) {\n var hr;\n var min;\n var sec;\n var tsplit = time.split(GRU_TDEL);\n \n // times should always be separated by a colon\n if (tsplit.length == 2) {\n hr = '0';\n min = tsplit[0];\n sec = tsplit[1];\n }\n else if (tsplit.length == 3) {\n hr = tsplit[0];\n min = tsplit[1];\n sec = tsplit[2];\n }\n else {\n console.log('Invalid replay start time in video description.');\n }\n \n // check that parts of the time are integer\n if (isNaN(hr) || (parseInt(hr) != parseFloat(hr))) {\n throw new InvalidTimeError('Invalid replay start time in video description.');\n }\n else if (isNaN(min) || (parseInt(min) != parseFloat(min)) || (parseInt(min) >= 60)) {\n throw new InvalidTimeError('Invalid replay start time in video description.');\n }\n else if (isNaN(sec) || (parseInt(sec) != parseFloat(sec)) || (parseInt(sec) >= 60)) {\n throw new InvalidTimeError('Invalid replay start time in video description.');\n }\n \n return parseFloat(hr)*3600 + parseFloat(min)*60 + parseFloat(sec);\n}", "title": "" }, { "docid": "ff53ff6811799fd158886c458b3b1eac", "score": "0.5190768", "text": "function parseVideoDuration(time) {\n // PT4H32M3S\n time = time.replace(\"PT\", \"\");\n var parsedHour = '';\n var parsedMinute = '0';\n var parsedSecond = '00';\n var arrayTime = [];\n var parsedTime = '';\n\n // PARSES THE HOUR\n // 4H32M3S\n if (time.indexOf('H') != -1) {\n arrayTime = time.split('H');\n parsedHour = arrayTime[0];\n time = arrayTime[1];\n }\n\n // PARSES THE MINUTES\n // 32M3S\n if (time.indexOf('M') != -1) {\n arrayTime = time.split('M')\n parsedMinute = arrayTime[0];\n if (parsedHour != '' && parseInt(parsedMinute) < 10) {\n parsedMinute = '0' + parsedMinute;\n }\n time = arrayTime[1];\n }\n else {\n if (parsedHour != '') {\n parsedMinute = '00'\n }\n }\n\n // PARSES THE SECONDS\n //3S\n if (time.indexOf('S') != -1) {\n time = time.replace(\"S\", \"\");\n parsedSecond = time;\n if (parseInt(parsedSecond) < 10) {\n parsedSecond = '0' + parsedSecond;\n }\n }\n\n // Puts them all together\n if (parsedHour != '') {\n parsedTime = parsedHour + ':' + parsedMinute + ':' + parsedSecond;\n }\n else {\n parsedTime = parsedMinute + ':' + parsedSecond; \n } \n return parsedTime;\n}", "title": "" }, { "docid": "7678ab2051e1d8e4a6afe47465c62f98", "score": "0.5190624", "text": "static parseTime(text) {\n // '65&#189; Hours/Mins'; '--' if not known\n if (text.startsWith('--')) {\n return 0;\n }\n if (text.indexOf(' - ') > -1) {\n return HowLongToBeatParser.handleRange(text);\n }\n return HowLongToBeatParser.getTime(text);\n }", "title": "" }, { "docid": "8280f993ab01898fc76821ecdb0555c4", "score": "0.5181963", "text": "function updateEndTime(){\r\n let start = document.getElementById(\"settimestart\").value;\r\n let end = document.getElementById(\"settimeend\");\r\n end.innerHTML = \"\";\r\n let st = start.split(\":\");\r\n let hrs = parseInt(st[0]) + 1;\r\n let mins = parseInt(st[1]);\r\n while(hrs<=24){\r\n label = hrs + \":\" + 0 + mins;\r\n let option = document.createElement(\"OPTION\");\r\n option.innerHTML=label;\r\n if(hrs < 10){\r\n option.value = \"0\" + label + \":00\";\r\n }else{option.value = label + \":00\";}\r\n end.appendChild(option);\r\n hrs++;\r\n }\r\n }", "title": "" }, { "docid": "1be7f68058da7799d9558c03ce00555d", "score": "0.51704985", "text": "function getTimeFromServer() {\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function () {\r\n var value = null;\r\n if (this.readyState === 4 && this.status === 200) {\r\n value = JSON.parse(this.responseText).value;\r\n }\r\n if (value != null)\r\n setHTMLObjectValueById(\"time\", value);\r\n };\r\n xhttp.open(\"GET\", SERVER_BASE_URL + TIME_ENDPOINT_PATH, true);\r\n xhttp.send();\r\n}", "title": "" }, { "docid": "5684f1dddb4e16f4bad8d46d230394c8", "score": "0.5168369", "text": "getEndTime() {\n const lastRunnerInfo = this.getLastRunnerInfo();\n const lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0;\n const lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : this._time;\n return lastStartTime + lastDuration;\n }", "title": "" }, { "docid": "4d0f015fb80df5986b7110280b8390cf", "score": "0.5147289", "text": "endDate() {\n return this.props.end_time ? this.props.end_time : new Date();\n }", "title": "" }, { "docid": "3c1406a2eb9365a58aa4eed0bc3bd115", "score": "0.51275396", "text": "function parseTime(isoTime){\n let date = new Date(isoTime);\n let result = {\n \"hour\": date.getHours(),\n \"minute\": date.getMinutes(),\n \"second\": date.getSeconds()\n };\n \n return JSON.stringify(result);\n}", "title": "" }, { "docid": "0b248cc97ee6897809529f4dd19b7af4", "score": "0.50950146", "text": "function parse_helper_times(){\n\tif(request.readyState == 4 && request.status==200){\n\t\ttimes_list=JSON.parse(request.responseText);\n\t\tt_locations(); //make tlocations on map\n\t\tdrawLine(); //draw polyline\n\t}\n\telse if(request.status==0){\n\t\talert(\"Error! Please refresh page\");\n\t}\n}", "title": "" }, { "docid": "2c0f6894eff90c928145aed22135d1cd", "score": "0.5084297", "text": "function parseJson(e,t,s){var n=e.schedule,o=[],i=[],r=0,a=0;n.forEach(function(e,t,s){var n=[];s[t].date=getDateString(e.date),s[t].tableid=\"table-\"+t,e.slots.forEach(function(e,o,i){var r=e.sessions;o===0&&(s[t].start=getIST(getTimeString(e.sessions[0].start))),o===i.length-1&&(s[t].end=getIST(getTimeString(e.sessions[r.length-1].end))),r.forEach(function(e,i){e.room&&n.indexOf(e.room)===-1&&n.push(e.room),s[t].slots[o].sessions[i].start=getIST(getTimeString(e.start)),s[t].slots[o].sessions[i].end=getIST(getTimeString(e.end))}),s[t].type=\"conference\"}),n.sort(),n.forEach(function(e,t,s){s[t]={name:e,title:getAudiTitle(e),shorttitle:getShortAudiTitle(e),track:t}}),s[t].rooms=n,e.slots.forEach(function(e,o){var i=e.sessions;i.forEach(function(e,i){e.room&&(s[t].slots[o].sessions[i].track=getTrack(e.room,n),s[t].slots[o].sessions[i].roomTitle=getAudiTitle(e.room))})}),s[t].type===\"conference\"?(i.push({date:s[t].date,tableid:s[t].tableid,rooms:s[t].rooms,start:s[t].start,end:s[t].end}),createTable(i[r]),r+=1):(o.push({date:s[t].date,rooms:s[t].rooms,start:s[t].start,end:s[t].end}),createTable(o[a]),a+=1)}),r=0,a=0,n.forEach(function(e){e.slots.forEach(function(e){e.sessions.length>1&&e.sessions.sort(function(e,t){return e.track-t.track})}),e.type===\"conference\"?(pushSessions(i[r],e.slots),addRowSpan(i[r]),checkColumns(i[r]),r+=1):(pushSessions(o[a],e.slots),addRowSpan(o[a]),checkColumns(o[a]),a+=1)}),t===\"conference\"?renderScheduleTable(i,\"conference\",s):renderScheduleTable(o,\"workshop\",s)}", "title": "" }, { "docid": "0e68f5b221ab8524deb2a31b83685349", "score": "0.50803006", "text": "function createTimeOutEvent(obj, time) {\n let hour = parseInt(time.split(' ')[1])\n let date = time.split(' ')[0] \n obj.timeOutEvents.push({type: \"TimeOut\", hour: hour, date : date}) \n return obj\n}", "title": "" }, { "docid": "53ea447fe4733158eb4de87055a54dce", "score": "0.5077666", "text": "function displayEndTime(timestamp) {\n const end = new Date(timestamp);\n const hour = end.getHours();\n const minutes = end.getMinutes();\n endTime.textContent = `${hour > 12 ? `${hour - 12}` : hour}:${minutes < 10 ? `0${minutes}` : minutes}${hour > 12 ? \"pm\" : \"am\"}`;\n}", "title": "" }, { "docid": "60fa866a4080806001040efcb790a45f", "score": "0.50769097", "text": "function handleResponseBasedOnEnding(ending, data, controller) {\n if(ending == \"getinfo\") {\n minutesRemaining = NSString.alloc().initWithDataEncoding(data, NSUTF8StringEncoding);\n controller.pushControllerWithNameContext(\"TimeInterfaceController\", null);\n } else if (ending == \"adduser\") {\n minutesRemaining = parkingDuration;\n controller._sliderLabel.setText(\"Time set successfully.\");\n } else {\n console.log(\"What the hell happened: \" + ending);\n }\n}", "title": "" }, { "docid": "4591ad404fa98d18322683defa4e3af7", "score": "0.5060271", "text": "parseTime() {\n let parseTimeRegex = /^(\\d):?(\\d{2})?\\s*?([apmAPM]{2})?/g;\n let timeMatch = parseTimeRegex.exec(this.rawTime);\n if (timeMatch) {\n let hours = Number(timeMatch[1]);\n let minutes = Number(timeMatch[2]);\n let period12Hours = timeMatch[3];\n\n if (!hours) {\n hours = 12\n }\n if (!minutes) {\n minutes = 0\n }\n if (period12Hours) {\n period12Hours = period12Hours.toLowerCase()\n } else {\n period12Hours = \"pm\"\n }\n if (period12Hours.indexOf(\"pm\") !== -1 && hours < 12) {\n hours += 12;\n }\n\n this.dateTime.setHours(hours);\n this.dateTime.setMinutes(minutes);\n console.log(\"Set time to \" + this.dateTime + \" for event \" + this.name + \" (id \" + this.id + \")\");\n }\n }", "title": "" }, { "docid": "8b13e7e35c612ab9edf1206d93a37ca2", "score": "0.5053178", "text": "function addEnd() {\n $('.end').timepicker({\n 'timeFormat': 'HH:mm',\n 'minTime': '08:00',\n 'maxTime': '22:00'\n });\n }", "title": "" }, { "docid": "392da1f6aed58c26c5309892dd4345d8", "score": "0.50477606", "text": "function parseJson(e,s,t){var n=e.schedule,o=[],i=[],r=0,a=0;n.forEach(function(e,s,t){var n=[];t[s].date=getDateString(e.date),t[s].tableid=\"table-\"+s,e.slots.forEach(function(e,o,i){var r=e.sessions;o===0&&(t[s].start=getIST(getTimeString(e.sessions[0].start))),o===i.length-1&&(t[s].end=getIST(getTimeString(e.sessions[r.length-1].end))),r.forEach(function(e,i){e.section_name&&e.section_name.toLowerCase().indexOf(\"workshop\")!==-1&&(t[s].type=\"workshop\"),e.room&&n.indexOf(e.room)===-1&&n.push(e.room),t[s].slots[o].sessions[i].start=getIST(getTimeString(e.start)),t[s].slots[o].sessions[i].end=getIST(getTimeString(e.end))}),t[s].type!==\"workshop\"&&(t[s].type=\"conference\")}),n.sort(),n.forEach(function(e,s,t){t[s]={name:e,title:getAudiTitle(e),shorttitle:getShortAudiTitle(e),track:s}}),t[s].rooms=n,e.slots.forEach(function(e,o){var i=e.sessions;i.forEach(function(e,i){e.room&&(t[s].slots[o].sessions[i].track=getTrack(e.room,n),t[s].slots[o].sessions[i].roomTitle=getAudiTitle(e.room))})}),t[s].type===\"conference\"?(i.push({date:t[s].date,tableid:t[s].tableid,rooms:t[s].rooms,start:t[s].start,end:t[s].end}),createTable(i[r]),r+=1):(o.push({date:t[s].date,rooms:t[s].rooms,start:t[s].start,end:t[s].end}),createTable(o[a]),a+=1)}),r=0,a=0,n.forEach(function(e){e.slots.forEach(function(e){e.sessions.length>1&&e.sessions.sort(function(e,s){return e.track-s.track})}),e.type===\"conference\"?(pushSessions(i[r],e.slots),addRowSpan(i[r]),checkColumns(i[r]),r+=1):(pushSessions(o[a],e.slots),addRowSpan(o[a]),checkColumns(o[a]),a+=1)}),s===\"conference\"?renderScheduleTable(i,\"conference\",t):renderScheduleTable(o,\"workshop\",t)}", "title": "" }, { "docid": "76409d40180c72f8616ab143944dcb08", "score": "0.5036873", "text": "function processJSON(){\n\t\t\tvar arrivalDiv,\n\t\t\t\tbus,\n\t\t\t\ti,\n\t\t\t\tulEl,\n\t\t\t\tliEl,\n\t\t\t\ttime,\n\t\t\t\tmin,\n\t\t\t\thr,\n\t\t\t\thrStr,\n\t\t\t\tminStr,\n\t\t\t\tampm,\n\t\t\t\tjsonObj;\n\n\t\t\tarrivalDiv = document.getElementById(\"arrival_data\");\n\t\t\t// Clear the old data\n\t\t\tclearDiv(arrivalDiv);\n\t\t\tjsonObj = JSON.parse(arrivals_xhr.responseText);\n\t\t\tbus = jsonObj.resultSet;\n\t\t\tif (typeof(bus.arrival)!= \"undefined\") {\n\t\t\t\t\tul = document.createElement('ul');\n\t\t\t\t\tfor(i=0;i<bus.arrival.length;i+=1){\n\t\t\t\t\t\tliEl = document.createElement('li');\n\t\t\t\t\t\t//parse the hour and format it\n\t\t\t\t\t\thr = parseInt(bus.arrival[i].scheduled.slice(11,13));\n\t\t\t\t\t\tif (hr < 12) {\n\t\t\t\t\t\t\tampm = \"AM\";\n\t\t\t\t\t\t} else if (hr>=12) {\n\t\t\t\t\t\t\tampm= \"PM\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hr==0) {\n\t\t\t\t\t\t\thr=12;\n\t\t\t\t\t\t} else if (hr>12) {\n\t\t\t\t\t\t\thr = hr-12;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hr<10) {\n\t\t\t\t\t\t\thrStr = \"0\"+hr;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thrStr = hr.toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//parse the minute and format it\n\t\t\t\t\t\tmin = parseInt(bus.arrival[i].scheduled.slice(14,16));\n\t\t\t\t\t\tif (min<10) {\n\t\t\t\t\t\t\tminStr = \"0\"+min;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tminStr = min.toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tliEl.innerHTML = \"[\"+ hrStr +\":\"+ minStr+ ampm+ \"] \" + bus.arrival[i].fullSign;\n\t\t\t\t\t\tul.appendChild(liEl);\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tarrivalDiv.appendChild(ul);\n\t\t\t} else {\n\t\t\t\tarrivalDiv.innerHTML = \"No upcoming arrivals found for this stop\";\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "44f816a511b1fe815f44750dd15e4bbe", "score": "0.5021234", "text": "function displayEndTime(timestamp) {\n // ------------============ Start Here ============------------\n const date = new Date(timestamp);\n const hours = date.getHours();\n const minutes = date.getMinutes();\n endTime.innerHTML = `${hours}:${minutes < 10 ? `0${minutes}` : minutes}`;\n\n // ------------============ End Here ==============------------\n}", "title": "" }, { "docid": "bfcfbe90a7c9287fbf51815b19085b1f", "score": "0.50145733", "text": "function formatDate_Time(results,callback){\n\tvar formatedResult = [];\n\t\n\tvar results = sortJson(results, 'event_start');\n\t\n\tasync.forEach(results, function(data, cb) {\n\t\tvar timezone = momentz().tz(data.event_start.timezone).format('z');;\n\t\t\n\t\tvar start_time = momentz.tz(data.event_start.local,data.event_start.timezone);\n\t\tvar end_time = momentz.tz(data.event_end.local,data.event_start.timezone);\n\t\t\n\t\tvar start_time_hours = start_time.hour() > 12 ? start_time.hour() - 12 : start_time.hour();\n\t\tvar start_time_minutes = start_time.minute() < 10 ? \"0\" + start_time.minute() : start_time.minute();\n\t\tvar start_am_pm = start_time.hour() >= 12 ? \"PM\" : \"AM\";\n\t\tvar start_day = start_time.day();\n\t\tvar start_month = start_time.month();\n\t\tvar start_date = start_time.date();\n\t\tvar start_year = start_time.format('YYYY');\n\t\t\n\t\tvar startDate = { \n\t\t\ttime : start_time,\n\t\t\ttime_hours : start_time_hours,\n\t\t\ttime_minutes : start_time_minutes,\n\t\t\tam_pm : start_am_pm,\n\t\t\tday : start_day,\n\t\t\tmonth : start_month,\n\t\t\tdate : start_date,\n\t\t\tyear : start_year,\n\t\t\ttz : timezone\n\t\t}\n\t\t\n\t\tvar end_time_hours = end_time.hour() > 12 ? end_time.hour() - 12 : end_time.hour();\n\t\tvar end_time_minutes = end_time.minute() < 10 ? \"0\" + end_time.minute() : end_time.minute();\n\t\tvar end_am_pm = end_time.hour() >= 12 ? \"PM\" : \"AM\";\n\t\tvar end_day = end_time.day();\n\t\tvar end_month = end_time.month();\t\n\t\tvar end_date = end_time.date();\t\n\t\tvar end_year = end_time.format('YYYY');\t\n\t\t\n\t\tvar endDate = { \n\t\t\ttime : end_time,\n\t\t\ttime_hours : end_time_hours,\n\t\t\ttime_minutes : end_time_minutes,\n\t\t\tam_pm : end_am_pm,\n\t\t\tday : end_day,\n\t\t\tmonth : start_month,\n\t\t\tdate : end_date,\n\t\t\tyear : end_year,\n\t\t\ttz : timezone\n\t\t}\n\t\t\n\t\tdata.event_start.date = startDate;\n\t\tdata.event_end.date = endDate;\n\t\tformatedResult.push(data);\n\t\tcb();\n\t\t\n\t},function(err){\n\t\tif(err) {\n\t\t\tres.status(400).send({ msg: 'There is some error please contact administrate.' });\n\t\t}else {\n\t\t\tcallback(formatedResult);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "31e2382df0344614449357af5f7a565f", "score": "0.50126606", "text": "function jsonTime(isoTime) {\n return convertDate(sliceQuery(isoTime), \"json\");\n}", "title": "" }, { "docid": "faf288a77dc48386c81b39e798cc9305", "score": "0.5009581", "text": "get endMS() {\n return this._endMS;\n }", "title": "" }, { "docid": "5ab923a3f2f7c94dc4f8e34289349f40", "score": "0.5005315", "text": "get ended() {\n // If no ended time, then calculate one from began time & took ms (if available)\n return this._ended ? this._ended : calculateEnded(this._began, this._took);\n }", "title": "" }, { "docid": "3a9319f29e167a8a78bb942214e78208", "score": "0.5004277", "text": "function getEndDate(){\n \n return Date.parse(vm.endDate);\n \n }", "title": "" }, { "docid": "b400089abbfe9b53bb40992097c899fa", "score": "0.4988964", "text": "function parseLunchScheduleJson(jsonObj) {\r\n \r\n\r\n set_start_date();\r\n \r\n if(activities_overwrite === false)\r\n {\r\n activities_overwrite = testDates(\"Lunch\");\r\n }\r\n\r\n if(activities_overwrite === true)\r\n {\r\n\r\n var sTime, eTime, enPath, exit, exPath, duration = undefined;\r\n //alert(jsonObj.length);\r\n for(var i = 0; i<jsonObj.length; i++)\r\n {\r\n \r\n sTime = jsonObj[i][0];\r\n if(sTime!==null)\r\n {//Start time is taken from jsonobject returned from Handsontable\r\n //Calculate DURATION\r\n var date = $( \"#datepicker\" ).datepicker('getDate');\r\n date.setHours(sTime.substring(0, 2));\r\n date.setMinutes(sTime.substring(3, 5));\r\n// console.log(sTime);\r\n// console.log(sTime.substring(3, 5));\r\n eTime = jsonObj[i][1];\r\n var date2 = $( \"#datepicker\" ).datepicker('getDate');\r\n date2.setHours(eTime.substring(0, 2));\r\n date2.setMinutes(eTime.substring(3, 5));\r\n// console.log(eTime.substring(3, 5));\r\n duration = date2 - date;\r\n\r\n exit = jsonObj[i][2]; //Indicates destination (where lunch takes place)\r\n enPath = jsonObj[i][3]; //Indicates path taken (to location of lunch)\r\n exPath = jsonObj[i][4]; //Indicates path returned (from of lunch to work place/office)\r\n //alert(jsonObj[i][4]);\r\n// console.log(exit + \" : \" + enPath + \" : \" + officeName);\r\n var pathTo = checkPathTo(officeName, enPath, exit); //bobbb\r\n var pathFrom = checkPathFrom(exit, exPath, officeName);\r\n set_current_date();\r\n //Must fix start day by converting to integer to add \"i\"\r\n query = \"DELETE WHERE{\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasUserID> ?userID.\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasRoomNumber> ?officeNumber.\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasStartDate> ?queryDate.\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasStartTime> ?startTime.\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasDuration> ?duration.\"+\r\n// \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n// \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasPathTo> ?pathTo.\"+\r\n// \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n// \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasPathFrom> ?pathFrom.\"+\r\n \"}\" ;\r\n \r\n sparql_delete (query);\r\n var query = \"\";\r\n\r\n query = \"INSERT DATA{ <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#LunchActivity\"+userID+\"-\"+queryDate+\">\"+\r\n \"<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>\" +\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#Lunch>; \"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasUserID> \\\"\" + userID +\"\\\";\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasStartDate> \\\"\" + queryDate +\"\\\";\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasStartTime> \\\"\" + sTime + \":00\\\";\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasDuration> \\\"\"+ duration + \"\\\";\"+\r\n \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasRoomNumber> \\\"\"+ exit + \"\\\";\"+\r\n// \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasPathTo> <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#\"+pathTo+\">;\"+\r\n// \"<http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#hasPathFrom> <http://www.semanticweb.org/ontologies/2012/9/knoholem.owl#\"+pathFrom+\">;\r\n \"}\";\r\n console.log(query);\r\n if(sTime!==\"\")\r\n {\r\n sparql_update (query);\r\n }\r\n\r\n }\r\n currentDay++;\r\n if(currentDay > daysInMonth)\r\n {\r\n currentDay = 1;\r\n currentMonth++;\r\n }\r\n }\r\n }\r\n \r\n\t//console.log (jsonObj); // print it out series to console for checking\r\n\r\n}", "title": "" }, { "docid": "7cea32ce557f14c28189989ab9672bb9", "score": "0.4987335", "text": "get loopEnd() {\n return new _core_type_Time__WEBPACK_IMPORTED_MODULE_0__[\"TimeClass\"](this.context, this._loopEnd, \"i\").toSeconds();\n }", "title": "" }, { "docid": "ff00556d791460850870e010304dcc02", "score": "0.49845716", "text": "function calcDuration(starttime, endtime){\n var start = new Date(starttime);\n var end = new Date(endtime);\n\n var difference_ms = end - start;\n return difference_ms;\n }", "title": "" }, { "docid": "fa8718300c7976e65129ea52a392c792", "score": "0.49843186", "text": "function getEndTime(hr, min, sec) {\n // Calculate the amount of time, in ms, to add to the date\n let timeToAdd = 1000 * getSeconds(hr, min, sec);\n return new Date(new Date().getTime() + timeToAdd);\n}", "title": "" }, { "docid": "97d817ba0b7cbfa7d044cb61193f5f1b", "score": "0.49835888", "text": "function setAudioEndTime() {\n\t\t\tvar curr_clip_info = SessionData.getCurrClipInfo();\n\t\t\tvar clip_dur = curr_clip_info.endtime - curr_clip_info.starttime;\n\t\t\t$endtime.val(clip_dur.trimNum(3, 'floor'));\n\t\t}", "title": "" }, { "docid": "745e716ea80fc394d97a42f725916499", "score": "0.49831316", "text": "function convert(day, time) {\n // console.log(time);\n var timeList = time.split(\"-\");\n var boundaries = {\n \"startTime\" : dayConvert(day, timeList[0]),\n \"endTime\" : dayConvert(day, timeList[1])\n };\n return boundaries;\n}", "title": "" }, { "docid": "a1e84ec062addae8625b0b9d21feb82b", "score": "0.49785894", "text": "function parse_time(value)\r\n{\r\n var time = 0;\r\n if (value == \"\")\r\n return -1;\r\n var pos = value.search(/:/);\r\n if (pos < 1)\r\n return -1;\r\n var hour = Number(value.substr(0, pos));\r\n if (isNaN(hour) || hour < 0 || hour > 23)\r\n return -1;\r\n time = hour * 3600;\r\n value = value.substr(pos+1, value.length);\r\n pos = value.search(/:/);\r\n var minute = 0;\r\n if (pos == -1)\r\n minute = Number(value);\r\n else\r\n minute = Number(value.substr(0, pos));\r\n\r\n if (isNaN(minute) || minute < 0 || minute > 59)\r\n return -1;\r\n time = time + minute * 60;\r\n value = value.substr(pos+1, value.length);\r\n pos = value.search(/:/);\r\n if (pos >= 1) {\r\n var second = Number(value.substr(0, pos));\r\n if (isNaN(second) || second < 0 || second > 59)\r\n return -1;\r\n time = time + second;\r\n }\r\n return time;\r\n}", "title": "" }, { "docid": "a76f501ebd0045910599e4d82c6ee3c7", "score": "0.49776512", "text": "function getDataFromDB() {\r\n\tvar timeSlotObjects = [];\r\n\r\n\tvar rawEntries = document.getElementsByClassName('eventDataEntry');\r\n\r\n\tfor (var entry of rawEntries) {\r\n\t\tvar parsedEntry = JSON.parse(entry.innerText);\r\n\t\ttimeSlotObjects.push(parsedEntry);\r\n\t}\r\n\r\n\twhile (rawEntries.length > 0) rawEntries[0].remove();\r\n\r\n\twhile (dbSlots.length > 0)\r\n\t\tdbSlots.pop();\r\n\r\n\tfor (let i = 0; i < timeSlotObjects.length; i++)\r\n\t{\r\n\t\tdbSlots.push(timeSlotObjects[i]);\r\n\t}\r\n\r\n\tfor (let i = 0; i < dbSlots.length; i++) {\t\t// Remove the seconds field off start and end time (i.e :00)\r\n\t\tdbSlots[i].startTime = dbSlots[i].startTime.substring(0, dbSlots[i].startTime.length-3);\r\n\t\tdbSlots[i].endTime = dbSlots[i].endTime.substring(0, dbSlots[i].endTime.length-3);\r\n\t}\r\n\r\n\t//console.log(dbSlots);\r\n}", "title": "" }, { "docid": "68980b55240b4e5e94f65a9a5f6d13d7", "score": "0.49695256", "text": "set_duration(){\r\n if(this.player.video.duration >= 3600){this.hours = true;}\r\n this.end.innerHTML = \" / \" + this.format_time(this.player.video.duration);\r\n }", "title": "" }, { "docid": "6c33eeb4459bd5ad3e90a6e7e93a7fa1", "score": "0.49665922", "text": "function getDataFromTimeRange(start, end, requestedUri, data) {\n if (!data) {\n return null;\n }\n let startStrs = start.toString().split('-');\n let startDate = new Date(parseInt(startStrs[0]), parseInt(startStrs[1]) - 1, parseInt(startStrs[2]));\n let unixStart = startDate.getTime();\n let endStrs = end.toString().split('-');\n let endDate = new Date(parseInt(endStrs[0]), parseInt(endStrs[1]) - 1, parseInt(endStrs[2]));\n endDate.setDate(endDate.getDate() + 1);\n let unixEnd = endDate.getTime();\n let numDays = 0;\n\n let result = {};\n result.data = [];\n result.labels = [];\n result.unixTimeLabels = [];\n\n let current = new Date(parseInt(startStrs[0]), parseInt(startStrs[1]) - 1, parseInt(startStrs[2]));\n while (current <= endDate) {\n ++numDays;\n let label = `${current.getMonth() + 1}-${current.getDate()}`;\n result.labels.push(label);\n result.unixTimeLabels.push(current.getTime());\n current.setDate(current.getDate() + 1);\n }\n numDays -= 1;\n // console.log('num day == ' + numDays);\n\n let zeros = [];\n for (let i = 0; i < numDays; ++i)\n zeros.push(0);\n\n requestedUri.forEach(uri => {\n result.data.push({\n name: uri,\n traffic: [...zeros],\n });\n });\n\n let unixTimeRange = result.unixTimeLabels;\n\n for (let i = 0; i < data.length; ++i) {\n let unixTime = data[i].utime * 1000;\n if (unixTime < unixStart || unixTime >= unixEnd) {\n // out of range, skip to next data row.\n continue;\n }\n\n let uri = data[i].uri;\n // console.log('on i = ' + i + ' ' + uri);\n for (let j = 0; j < numDays; ++j) {\n let current = unixTimeRange[j];\n let next = unixTimeRange[j + 1];\n // console.log(`${current} ${unixTime} ${next}`);\n if (unixTime >= current && unixTime < next) {\n // console.log('match time');\n for (let k = 0; k < requestedUri.length; ++k) {\n if (uri === requestedUri[k]) {\n result.data[k].traffic[j] += 1;\n break;\n }\n }\n break;\n }\n }\n }\n result.labels.pop();\n result.unixTimeLabels.pop();\n console.log(result);\n return result;\n}", "title": "" }, { "docid": "09f7e0dd9ad36e43b2b42e3405a8f0b7", "score": "0.49610853", "text": "convertTime(){\r\n var d = new Date(this.props.track.duration);\r\n return ( d.toISOString().slice(14,-5)); // \"4:59\"\r\n }", "title": "" }, { "docid": "c3dd9772cf329e666fc5c0ee4102122e", "score": "0.4959181", "text": "function parseTimeAttrib(time) {\r\n\tvar timeArray = new Object();\r\n\t\r\n\ttimeArray.hour = time.match(/(\\d+):/)[1];\r\n\ttimeArray.min = time.match(/:(\\d+)/)[1];\r\n\ttimeArray.ampm = time.match(/\\d+([am|pm])/)[1];\r\n\t\r\n\treturn timeArray;\r\n\t\r\n}", "title": "" }, { "docid": "ff34fb783b5626f69044fd6f03379a9c", "score": "0.49511886", "text": "duration () {\n if (this.endTime === null) {\n return null;\n }\n return this.endTime.getTime() - this.startTime.getTime();\n }", "title": "" }, { "docid": "96802ae2ec538fe8afedba6546c307e1", "score": "0.49497446", "text": "function parseTimeForRecurringEvent(vevent, start, end, timezone) {\n\t\tvar dtstart = vevent.getFirstPropertyValue('dtstart');\n\t\tvar dtend = calculateDTEnd(vevent);\n\t\tvar duration = dtend.subtractDate(dtstart);\n\t\tvar fcDataContainer = [];\n\n\t\tvar iterator = new ICAL.RecurExpansion({\n\t\t\tcomponent: vevent,\n\t\t\tdtstart: dtstart\n\t\t});\n\n\t\tvar next;\n\t\twhile ((next = iterator.next())) {\n\t\t\tif (next.compare(start) < 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (next.compare(end) > 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar dtstartOfRecurrence = next.clone();\n\t\t\tvar dtendOfRecurrence = next.clone();\n\t\t\tdtendOfRecurrence.addDuration(duration);\n\n\t\t\tif (isTimezoneConversionNecessary(dtstartOfRecurrence) && timezone) {\n\t\t\t\tdtstartOfRecurrence = dtstartOfRecurrence.convertToZone(timezone);\n\t\t\t}\n\t\t\tif (isTimezoneConversionNecessary(dtendOfRecurrence) && timezone) {\n\t\t\t\tdtendOfRecurrence = dtendOfRecurrence.convertToZone(timezone);\n\t\t\t}\n\n\t\t\tfcDataContainer.push({\n\t\t\t\tallDay: isEventAllDay(dtstartOfRecurrence, dtendOfRecurrence),\n\t\t\t\tstart: dtstartOfRecurrence.toJSDate(),\n\t\t\t\tend: dtendOfRecurrence.toJSDate(),\n\t\t\t\trepeating: true\n\t\t\t});\n\t\t}\n\n\t\treturn fcDataContainer;\n\t}", "title": "" }, { "docid": "d5dcffdad150791fe038870293d0a0a6", "score": "0.4948532", "text": "function parseSrt(srtString) {\n var lines = srtString.split('\\n');\n var subs = [];\n\n\n var SRT_STATE_SUBNUMBER = 0;\n var SRT_STATE_TIME = 1;\n var SRT_STATE_TEXT = 2;\n var SRT_STATE_BLANK = 3;\n\n var state = SRT_STATE_SUBNUMBER;\n var subNum = 0;\n var subText = '';\n var subTime = '';\n var subTimes = '';\n\n for (var i = 0; i < lines.length; i++) {\n switch(state) {\n case SRT_STATE_SUBNUMBER:\n subNum = lines[i].trim();\n state = SRT_STATE_TIME;\n break;\n\n case SRT_STATE_TIME:\n subTime = lines[i].trim();\n state = SRT_STATE_TEXT;\n break;\n\n case SRT_STATE_TEXT:\n if (lines[i].trim() === '' && subTime.indexOf(' --> ') !== -1) {\n subTimes = subTime.split(' --> ');\n\n subs.push({\n number: subNum,\n startTime: (parseInt(subTimes[0].substr(0, 2), 10) * 3600000) + (parseInt(subTimes[0].substr(3, 2), 10) * 60000) + (parseInt(subTimes[0].substr(6, 2), 10) * 1000) + parseInt(subTimes[0].substr(9, 3), 10),\n stopTime: (parseInt(subTimes[1].substr(0, 2), 10) * 3600000) + (parseInt(subTimes[1].substr(3, 2), 10) * 60000) + (parseInt(subTimes[1].substr(6, 2), 10) * 1000) + parseInt(subTimes[1].substr(9, 3), 10),\n text: subText\n });\n subText = '';\n state = SRT_STATE_SUBNUMBER;\n } else {\n if (subText.length > 0) {\n subText += '\\n';\n }\n subText += lines[i];\n }\n break;\n }\n }\n\n return subs;\n }", "title": "" }, { "docid": "d324b1adec88d110b10a681b611ebb33", "score": "0.49435565", "text": "function parseTimeEntry(timeEntryString) {\r\n\tlog (\"########################################## parsing time entry in '\" + timeEntryString + \"'\\r\\n\");\r\n\tvar parts = timeEntryString.split(\" \");\r\n\tvar parsedClient = parts[0];\r\n\tvar parsedHours = parseFloat(parts[1]);\r\n\tvar date = \"today\";\r\n\tif (parts.length == 3) {\r\n\t\tdate = parts[2];\r\n\t}\r\n\tvar parsedDate = parseDate(date);\r\n\t\r\n\treturn { \r\n\t\temployee: lookupEmployee(),\r\n\t\thours: parsedHours,\r\n\t\tclient: parsedClient,\r\n\t\tdate: parsedDate\r\n\t}\r\n}", "title": "" }, { "docid": "5235653be796d9929a7fc150d0dd8e36", "score": "0.49404243", "text": "function parseDuration(/*String*/ duration){\n\n traceBegin(\"parseDuration\", duration);\n\n var d = duration;\n var val = 0;\n var unit=\"\";\n var valid=false;\n var negative=false;\n var unit_translated=\"\";\n\n if (d==\"\") {\n return {\"amount\":\"\", \"unit\":\"\", \"negative\":\"\", \"unit_translated\":\"\"};\n }\n\n // remove sign\n if ( d.charAt(0)==\"-\" ){\n d=d.substr(1);\n negative=true;\n }\n\n // check if this is a valid duration\n if ( d.charAt(0)==\"P\" ){\n\n d=d.substr(1); //remove \"P\"\n // string now 5Y or T5M\n\n // currently we support only one unit, i.e P7Y, or PT5M\n if (d.charAt(0)==\"T\") {\n // we have a time as unit\n val=d.slice(1,-1);\n switch (d.slice(-1)) {\n case \"H\":\n unit=\"hours\";\n unit_translated=timeDialog_messages[\"TIMEDIALOG.HOURS\"];\n break;\n case \"S\":\n unit=\"seconds\";\n unit_translated=timeDialog_messages[\"TIMEDIALOG.SECONDS\"];\n break;\n case \"M\":\n default:\n unit=\"minutes\";\n unit_translated=timeDialog_messages[\"TIMEDIALOG.MINUTES\"];\n break;\n }\n } else {\n // we have a date as unit\n val=d.slice(0,-1);\n switch (d.slice(-1)) {\n case \"Y\":\n unit=\"years\";\n unit_translated=timeDialog_messages[\"TIMEDIALOG.YEARS\"];\n break;\n case \"M\":\n unit=\"months\";\n unit_translated=timeDialog_messages[\"TIMEDIALOG.MONTHS\"];\n break;\n case \"D\":\n default:\n unit=\"days\";\n unit_translated=timeDialog_messages[\"TIMEDIALOG.DAYS\"];\n break;\n }\n }\n } else {\n //set default of duration if nothing set\n val=\"1\";\n unit=\"days\";\n }\n if (val > 0 && negative == true) {\n val=val*(-1);\n }\n\n var result={\"amount\":val, \"unit\":unit, \"negative\":negative, \"unit_translated\":unit_translated};\n\n traceEnd(\"parseDuration\", result);\n return result;\n}", "title": "" }, { "docid": "faad65f5dd4f2ca41c6a428ee5e0b96b", "score": "0.49343765", "text": "parse(obj) {\n this.url = obj.url;\n this.connections = obj.connections;\n this.cocurrency = obj.cocurrency;\n this.tps = obj.tps;\n this.total_response_ms = obj.total_response_ms;\n this.max_response_ms = obj.max_response_ms;\n this.min_response_ms = obj.min_response_ms;\n this.avg_response_ms = obj.avg_response_ms;\n this.total_request = obj.total_request;\n this.duration_in_sec = obj.duration_in_sec;\n this.start_time = new Date(obj.start_time);\n this.end_time = new Date(obj.end_time);\n this.errors = obj.errors;\n }", "title": "" }, { "docid": "f3557e58ae30112000f7ff5f218c45cd", "score": "0.49067402", "text": "function processRuntimesResponse(data) {\n jt = JSON.parse(data);\n if (jt.Errors != null) {\n alert(jt.Errors);\n //return;\n }\n ja = jt.Runtimes;\n for (i = 0; i < ja.length; i++) {\n date = new Date(ja[i][\"Date\"]);\n dateStr = DateString(date);\n g.runtimeHistory[dateStr] = ja[i][\"Runtimes\"];\n }\n log(\"processRuntimesResponse:\");\n log(JSON.stringify(g.runtimeHistory, null, 2));\n}", "title": "" }, { "docid": "5edfbe4297ebfcc5d7345f933c17c94b", "score": "0.4902958", "text": "get duration() {\n assert(this.start !== undefined, `Invalid handler start time`);\n assert(this.end !== undefined, `Invalid handler end time`);\n return Math.floor(this.end - this.start);\n }", "title": "" }, { "docid": "29b7192a78b29e0cd9c5ea0627f45cef", "score": "0.4882023", "text": "restTime() {\n return (this.time.getTime() + this.maxTime - Date.now())\n }", "title": "" }, { "docid": "e507ae6a767cd98ff0ad7d6154918ee6", "score": "0.48745695", "text": "function findRangeForPlaybackTime(buf, time) {\n\tvar ranges = buf.buffered;\n\tfor (var i = 0; i < ranges.length; i++) {\n\t\tif (ranges.start(i) <= time && ranges.end(i) >= time) {\n\t\t return {'start': ranges.start(i), 'end': ranges.end(i)};\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e3803ac97028d7774e5b0f495edacb24", "score": "0.48727456", "text": "_parseHours() {\n return this.value.substring(0, this.value.indexOf(\":\"));\n }", "title": "" }, { "docid": "df0978f62b0b99f591aea5e9b83d6ac0", "score": "0.48688024", "text": "function fixTrip(trip){\n\n // If the endTime and startTime are equal\n if(trip.endTime == trip.startTime){\n\n // And if the trip has sensorData\n if(trip.hasOwnProperty(\"sensorData\")){\n console.log(\"has own property!\");\n\n // Loop through the sensorData\n $.each(trip.sensorData, function(index, sensorValue){\n\n // Check whether the sensors timestamp is later than the trips endTime\n if(new Date(sensorValue.timestamp) > new Date(trip.endTime)){\n\n // If so, set the endTime to the timestamp\n trip.endTime = sensorValue.timestamp;\n }\n });\n }\n }\n }", "title": "" }, { "docid": "5c22cfadeda10098602bdcf78b75d57e", "score": "0.48687255", "text": "function set_end_time() {\n //We store it, and if it already exist, we use it as start.\n // The end timer will be the last key timestamp or this timer\n console.log(\"End time set\");\n localStorage.setItem(\"end_timer\", Date.now());\n}", "title": "" }, { "docid": "8959f27bc4dac995e2d2ada71352ba97", "score": "0.48612088", "text": "function displayEndTime(timestamp) {\n const end = new Date(timestamp);\n const hour = end.getHours();\n const minutes = end.getMinutes();\n const adjustedHour = hour > 12 ? hour - 12 : hour;\n endTime.textContent = `Be back at ${adjustedHour}:${minutes < 10 ? '00' : ''}${minutes}`;\n\n}", "title": "" }, { "docid": "e66859874cc54200fc741ef33f072c12", "score": "0.4856273", "text": "function getEndTime(event) {\n let date = event.end.date || event.end.dateTime\n let dateMoment = moment(date)\n\n // we need to subtract a day from all day events since Google returns the end date of an all day event as the next date\n // for example, if a single all day event started on Jan 1 and ended on Jan 2, then Google would return an end date of Jan 3\n if (allDayEvent(event)) {\n dateMoment.subtract(1, 'day')\n }\n\n return dateMoment\n}", "title": "" }, { "docid": "6e4373603d7d8b3896696d7601397e21", "score": "0.4851479", "text": "getWorkEndTime () {\n this.TimerModelService.endTime = this.TimerModelService.startTime + (60000 * this.TimerModelService.workTimerInitialSetting);\n }", "title": "" }, { "docid": "1a00805d57dcf58da7317bedf6e798fd", "score": "0.48423463", "text": "function endTimeUpdate() {\n\t\t\tvar curr_clip_info = SessionData.getCurrClipInfo();\n\t\t\tvar clip_dur = curr_clip_info.endtime - curr_clip_info.starttime;\n\t\t\tvar new_end = clip_dur * (this.value / 100);\n\t\t\tif (new_end < +$starttime.val())\n\t\t\t{\n\t\t\t\tnew_end = +$starttime.val(); \n\t\t\t\t$end_time_slider.val((new_end/clip_dur)*100);\n\t\t\t}\n\t\t\tnew_end = new_end.toFixed(3);\n\t\t\t$endtime.val(new_end);\n\t\t}", "title": "" }, { "docid": "c4c32c51dd15866f1fec12678f8733fb", "score": "0.48379114", "text": "function validTime(strTime, objTime)\n{\n if (strTime == \"\") {\n return false;\n }\n //strTime = strTime.trim();\n arrTime = strTime.split(\":\");\n if (arrTime.length == 1 ) {\n strTime = strTime.substr(0,2) + \":\" + strTime.substr(2,2);\n objTime.value = strTime;\n alert(strTime);\n }\n arrTime = strTime.split(\":\");\n if (arrTime.length == 3) {\n if (isNaN(arrTime[0]) || isNaN(arrTime[1]) || isNaN(arrTime[2])) {\n return false;\n } else {\n jam = parseFloat(arrTime[0]);\n menit = parseFloat(arrTime[1]);\n detik = parseFloat(arrTime[2]);\n\n if (isNaN(jam) || isNaN(menit) || isNaN(detik)) return false;\n if (jam < 0 || jam > 23) return false;\n if (menit < 0 || menit > 59) return false;\n if (detik < 0 || detik > 59) return false;\n\n }\n } else if (arrTime.length == 2) {\n if (isNaN(arrTime[0]) || isNaN(arrTime[1])) {\n return false;\n } else {\n jam = parseFloat(arrTime[0]);\n menit = parseFloat(arrTime[1]);\n\n if (isNaN(jam) || isNaN(menit)) return false;\n if (jam < 0 || jam > 23) return false;\n if (menit < 0 || menit > 59) return false;\n\n }\n } else {\n return false;\n }\n\n return true;\n}//validTime", "title": "" }, { "docid": "cf6c07284be9ecb248db215470f72f03", "score": "0.48377055", "text": "validateTime() {\n\t\tlet start = moment(this.state.start, \"HH:mm\");\n\t\tlet end = moment(this.state.end, \"HH:mm\");\n\t\tlet date = moment(this.state.date, \"YYYY-MM-DD\");\n\t\tlet duration = parseInt(this.state.duration, 10);\n\t\t\n\t\tlet startTime, appointmentSlots;\n\n\t\tif (start.isValid()\n\t\t\t\t&& end.isValid()\n\t\t\t\t&& date.isValid()\n\t\t\t\t&& !Number.isNaN(duration)) {\n\t\t\t\n\t\t\t// Do not allow end of block to be before start\n\t\t\tif (start > end) {\n\t\t\t\tend = moment(start);\n\t\t\t}\n\t\t\t\n\t\t\t// Need to update block's actual startTime which includes date\n\t\t\tstartTime = moment(date)\n\t\t\t\t.hour(start.hour())\n\t\t\t\t.minute(start.minute())\n\t\t\t\t.second(start.second())\n\t\t\t\t.millisecond(start.millisecond())\n\t\t\t\t.toISOString();\n\t\t\t\n\t\t\t// Do not allow duration to be negative\n\t\t\tif (duration < 0) {\n\t\t\t\tduration = 0;\n\t\t\t}\n\t\t\t\n\t\t\t// Generate appointmentSlots array\n\t\t\tif (duration === 0) {\n\t\t\t\t// Do not divide by zero\n\t\t\t\tappointmentSlots = [];\n\t\t\t} else {\n\t\t\t\tlet slotNumber = this.calculateSlotNumber(start, end, duration);\n\t\t\t\tif (slotNumber === 0) {\n\t\t\t\t\t// Create array with no slots\n\t\t\t\t\tappointmentSlots = [];\n\t\t\t\t} else {\n\t\t\t\t\t// Create array of empty slots\n\t\t\t\t\tappointmentSlots = [...Array(slotNumber)].map(() => \n\t\t\t\t\t\t({identity: \"\", courseCode: \"\", note: \"\"}));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn {\n\t\t\t\tstartTime: startTime,\n\t\t\t\tappointmentDuration: duration,\n\t\t\t\tappointmentSlots: appointmentSlots\n\t\t\t};\n\t\t}\n\t}", "title": "" }, { "docid": "7537e7723759ed3c730da4d117246b3e", "score": "0.48266363", "text": "constructor() {\n super(Parser.start()\n .int8(\"status\")\n .doublebe(\"startTime\")\n .doublebe(\"endTime\"));\n this.rec = {};\n this.rec.status = 0;\n this.rec.startTime = 0;\n this.rec.endTime = 0;\n }", "title": "" } ]
507b5691f8fe63c816cd4aea7efa871e
=================================== getVerifyCode input parameter ===================================
[ { "docid": "124f88bb56ae1573739b1b277c19b8fd", "score": "0.0", "text": "async getHistoryDetail(io_data){\n try {\n const token = io_data.token;\n const iv_oid = io_data.oid;\n const reqData = {token,iv_oid};\n const res = await HistoryApi.getHistoryDetail(reqData);\n if(res.ev_error == 0){\n // if(res.result == 0){\n return res.ea_order_detail;\n }else{\n Alert.errorAlert(res.ev_message)\n }\n\n } catch (e) {\n console.log(e)\n }\n }", "title": "" } ]
[ { "docid": "2f02b8b171d1cf67106f2fe9a15f1212", "score": "0.6983274", "text": "function validateVerificationCode(verificationCode) {\n //\n // initially a no-op\n //\n return verificationCode;\n}", "title": "" }, { "docid": "b7d56aeecfb5cebda554dbe66cb8223e", "score": "0.69058216", "text": "function getVerificationCode() {\n //Verify the cellphone cannot be empty.\n if (!vm.verificationMode.cellphone) {\n $fdPopup.alert({\n template: $translate.instant('SECURITY_FORGOTPASSWORD_CELLPHONENOTNULL')\n });\n return;\n }\n if (vm.verificationMode.cellphone.length !== 11) {\n $fdPopup.alert({\n template: $translate.instant('SECURITY_LOGIN_CELLPHONENOTVALID')\n });\n return;\n }\n if (!(/^1[3|4|5|7|8]\\d{9}$/.test(vm.verificationMode.cellphone))) {\n $fdPopup.alert({\n template: $translate.instant('SECURITY_LOGIN_CELLPHONENOTVALID')\n });\n return;\n }\n //Verify whether the user is exist.\n ForgotPasswordService.verifyUserExist({cellphone: vm.verificationMode.cellphone}, function(response) {\n //TODO\n if (response.status === 200) {\n ForgotPasswordService.getVerificationCodeByCellphone({cellphone: vm.verificationMode.cellphone})\n .$promise\n .then(generateVCode)\n .catch(generateVCodeWrong);\n } else {\n //TODO\n $fdPopup.alert({\n template: $translate.instant('SECURITY_FORGOTPASSWORD_USERNAMENOTEXIST')\n });\n }\n });\n }", "title": "" }, { "docid": "d3ef941b63b02d2785513f87b4e419f3", "score": "0.66374767", "text": "async generateCodeVerifierAsync() {\n // base64 encoding uses 6 bits per character, and we want to generate128\n // characters. 6*128/8 = 96.\n const crypto = crypto_1.createCrypto();\n const randomString = crypto.randomBytesBase64(96);\n // The valid characters in the code_verifier are [A-Z]/[a-z]/[0-9]/\n // \"-\"/\".\"/\"_\"/\"~\". Base64 encoded strings are pretty close, so we're just\n // swapping out a few chars.\n const codeVerifier = randomString\n .replace(/\\+/g, '~')\n .replace(/=/g, '_')\n .replace(/\\//g, '-');\n // Generate the base64 encoded SHA256\n const unencodedCodeChallenge = await crypto.sha256DigestBase64(codeVerifier);\n // We need to use base64UrlEncoding instead of standard base64\n const codeChallenge = unencodedCodeChallenge\n .split('=')[0]\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n return { codeVerifier, codeChallenge };\n }", "title": "" }, { "docid": "d3ef941b63b02d2785513f87b4e419f3", "score": "0.66374767", "text": "async generateCodeVerifierAsync() {\n // base64 encoding uses 6 bits per character, and we want to generate128\n // characters. 6*128/8 = 96.\n const crypto = crypto_1.createCrypto();\n const randomString = crypto.randomBytesBase64(96);\n // The valid characters in the code_verifier are [A-Z]/[a-z]/[0-9]/\n // \"-\"/\".\"/\"_\"/\"~\". Base64 encoded strings are pretty close, so we're just\n // swapping out a few chars.\n const codeVerifier = randomString\n .replace(/\\+/g, '~')\n .replace(/=/g, '_')\n .replace(/\\//g, '-');\n // Generate the base64 encoded SHA256\n const unencodedCodeChallenge = await crypto.sha256DigestBase64(codeVerifier);\n // We need to use base64UrlEncoding instead of standard base64\n const codeChallenge = unencodedCodeChallenge\n .split('=')[0]\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n return { codeVerifier, codeChallenge };\n }", "title": "" }, { "docid": "783d0e2cee53ee9694857aec138c6657", "score": "0.6529053", "text": "function createVerificationCode() {\n let code = Math.random().toString(36).substr(2, 10)\n return code\n}", "title": "" }, { "docid": "0fde517a79d327ab7f77285f42a27a81", "score": "0.6467162", "text": "constructor(verificationCode) {\n this.verificationCode = verificationCode;\n }", "title": "" }, { "docid": "f15a50c154a98665ff9ce7751d9f6a1c", "score": "0.6451769", "text": "function updateCodeVerifier() {\n const codeVerifier = getCodeVerifier();\n const code = new URL(window.location.href).searchParams.get(\"code\");\n\n if (!code || !codeVerifier) {\n setCodeVerifier(pkcePair.current.codeVerifier);\n }\n }", "title": "" }, { "docid": "f15a50c154a98665ff9ce7751d9f6a1c", "score": "0.6451769", "text": "function updateCodeVerifier() {\n const codeVerifier = getCodeVerifier();\n const code = new URL(window.location.href).searchParams.get(\"code\");\n\n if (!code || !codeVerifier) {\n setCodeVerifier(pkcePair.current.codeVerifier);\n }\n }", "title": "" }, { "docid": "c8d933eb0cbc0a06618a9e8c2b751c2e", "score": "0.64382964", "text": "getCode({\n\t\tcommit,\n\t\tstate\n\t}, params) {\n\t\tcommit(mutationTypes.UPDATE_REQUSET_STATE, true);\n\t\tcommit(mutationTypes.HNADLE_ERROR, null);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfetch('/patron/verifyCode/sms', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: params\n\t\t\t}).then(res => {\n\t\t\t\tcommit(mutationTypes.UPDATE_REQUSET_STATE, false);\n\t\t\t\treturn res.json();\n\t\t\t}).then(data => {\n\t\t\t\tconst code = data.bizCode,\n\t\t\t\t\toriginData = data.data || {};\n\n\t\t\t\tcommit(mutationTypes.SAVE_TOKEN, originData);\n\n\t\t\t\tif (code === 10000) {\n\t\t\t\t\tcommit(mutationTypes.SAVE_SMS_INFO, originData);\n\t\t\t\t\tcommit(mutationTypes.UPDATE_MODULE_NAME, 'code');\n\n\t\t\t\t\tresolve(data);\n\t\t\t\t} else {\n\t\t\t\t\tconst errorMsg = data.message || defaultError;\n\n\t\t\t\t\tif (code === 11703 || code === 11705) {\n\t\t\t\t\t\tcommit(mutationTypes.SAVE_SMS_INFO, originData);\n\n\t\t\t\t\t\tif (!state.moduleName) {\n\t\t\t\t\t\t\tcommit(mutationTypes.UPDATE_MODULE_NAME, 'sms');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcommit(mutationTypes.HNADLE_ERROR, {\n\t\t\t\t\t\t\t\ttype: 'dialog',\n\t\t\t\t\t\t\t\tmoduleName: 'sms',\n\t\t\t\t\t\t\t\tmsg: errorMsg\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommit(mutationTypes.HNADLE_ERROR, {\n\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\tmsg: errorMsg\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treject(data);\n\t\t\t\t}\n\t\t\t}).catch(err => {\n\t\t\t\tcommit(mutationTypes.UPDATE_REQUSET_STATE, false);\n\t\t\t\tcommit(mutationTypes.HNADLE_ERROR, {\n\t\t\t\t\ttype: '',\n\t\t\t\t\tmsg: err.message || defaultError\n\t\t\t\t});\n\t\t\t\treject(err);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "2bbf53874e9e4e7d0cb43480ba646f6a", "score": "0.64018714", "text": "verifyCode({\n\t\tcommit,\n\t\tstate\n\t}, params) {\n\t\tcommit(mutationTypes.UPDATE_REQUSET_STATE, true);\n\t\tcommit(mutationTypes.HNADLE_ERROR, null);\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfetch('/patron/password/completeReset', {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tbody: {\n\t\t\t\t\ttoken: state.token,\n\t\t\t\t\tphoneVerifyCode: params.code\n\t\t\t\t}\n\t\t\t}).then(res => {\n\t\t\t\tcommit(mutationTypes.UPDATE_REQUSET_STATE, false);\n\t\t\t\treturn res.json();\n\t\t\t}).then(data => {\n\t\t\t\tcommit(mutationTypes.SAVE_TOKEN, data.data);\n\n\t\t\t\tconst code = data.bizCode;\n\t\t\t\tif (code === 10000) {\n\t\t\t\t\tcommit(mutationTypes.UPDATE_MODULE_NAME, 'sucsess');\n\t\t\t\t} else {\n\t\t\t\t\tif (code === 11810) {\n\t\t\t\t\t\t// 过期回到首页\n\t\t\t\t\t\tcommit(mutationTypes.HNADLE_ERROR, {\n\t\t\t\t\t\t\ttype: 'dialog',\n\t\t\t\t\t\t\tisTimeout: true,\n\t\t\t\t\t\t\tmsg: 'Your session has timed out. Please try again.'\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommit(mutationTypes.HNADLE_ERROR, {\n\t\t\t\t\t\t\ttype: '',\n\t\t\t\t\t\t\tmsg: data.message || defaultError,\n\t\t\t\t\t\t\tisCodeError: [11700, 11701, 11702].includes(code) || false\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treject(data);\n\t\t\t\t}\n\t\t\t}).catch(err => {\n\t\t\t\tcommit(mutationTypes.UPDATE_REQUSET_STATE, false);\n\t\t\t\tcommit(mutationTypes.HNADLE_ERROR, {\n\t\t\t\t\ttype: '',\n\t\t\t\t\tmsg: err.message || defaultError\n\t\t\t\t});\n\t\t\t\treject(err);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "44a2ccbd3c7e852c989cc45f90398981", "score": "0.6174533", "text": "function getCode() {\n const urlParams = new URLSearchParams(window.location.search);\n let authcode = urlParams.get(\"code\");\n return new Promise((resolve, reject) => {\n if (authcode !== \"\" || authcode !== undefined) {\n resolve(authcode);\n } else {\n reject(\"Auth code not found\");\n }\n });\n}", "title": "" }, { "docid": "d50229b4b7f890577ddd5617b2af6430", "score": "0.6026371", "text": "signature () {\n return this._code\n }", "title": "" }, { "docid": "223985bf00d8d8fb7079556a470e8fe6", "score": "0.6020278", "text": "_getCodeLocation() {\n \n }", "title": "" }, { "docid": "a242cdef9dd7f6f7011af33233103e71", "score": "0.59845626", "text": "async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }", "title": "" }, { "docid": "be5fc7752a19d8ac636c086359939c6a", "score": "0.5976097", "text": "function verifyCode(vercode) {\n var vercodekey = '777';\n var regexDigit = /\\D/;\n\n if (vercodekey == vercode && !regexDigit.test(vercode))\n return true;\n else\n console.log(\"failed code number\");\n return false;\n}", "title": "" }, { "docid": "6c47d185f9073ab173d6f3154e7aeb31", "score": "0.59720254", "text": "function qCQABlLeQDiwzrLDtMtBPQ()\r\n {\r\n var b;\r\n\r\n b = HwwABl68TjSNGEYeKATu5A('code');\r\n return b;\r\n }", "title": "" }, { "docid": "d2af5d0feba736eb8542f5f49c2c4e07", "score": "0.5952013", "text": "verifyPaymentCode(options) {\n return this.payement.save('payement/verify-payement-code', options);\n }", "title": "" }, { "docid": "d2af5d0feba736eb8542f5f49c2c4e07", "score": "0.5952013", "text": "verifyPaymentCode(options) {\n return this.payement.save('payement/verify-payement-code', options);\n }", "title": "" }, { "docid": "b96b6152a054c76d246776190423636e", "score": "0.5949036", "text": "verifyEmailCode() {\n this.getCognitoUser().getAttributeVerificationCode('email', {\n onSuccess: function (result) {\n logger.log(result)\n },\n onFailure: function(err) {\n logger.log(err)\n },\n inputVerificationCode() {\n //two step varification, call verifyAttr separately\n }\n })\n }", "title": "" }, { "docid": "1bf457f75db297d9ce0b168dafd1e2b5", "score": "0.5942426", "text": "function checkCode(code, callback) {\n\n var fourLetter = ['ANUS', 'ARSE', 'CLIT', 'COCK', 'COON', 'CUNT', 'DAGO', 'DAMN', 'DICK', 'DIKE', 'DYKE', 'FUCK', 'GOOK', 'HEEB', 'HECK', 'HELL', 'HOMO', 'JIZZ', 'KIKE', 'KUNT', 'KYKE', 'LICK', 'MICK', 'MUFF', 'PAKI', 'PISS', 'POON', 'PUTO', 'SHIT', 'SHIZ', 'SLUT', 'SMEG', 'SPIC', 'TARD', 'TITS', 'TWAT', 'WANK', 'POOP', 'FUCK', 'FCUK', 'FUKK', 'KILL', 'JERK', 'CRAP', 'FOOK', 'DORK', 'DOPE', 'DUNG', 'FAGS', 'FART', 'GAYS', 'HELL', 'HOAR', 'JAPS', 'NAZI', 'ORGY', 'PORN', 'PUKE', 'RAPE', 'SEXY', 'SPIG', 'SUCK', 'STAB', 'SMUT', 'SPAZ', 'TWIT'];\n var threeLetter = ['ASS','FUC','FUK','FUQ','FUX','FCK','COC','COK','COQ','KOX','KOC','KOK','KOQ','CAC','CAK','CAQ','KAC','KAK','KAQ','DIC','DIK','DIQ','DIX','DCK','PNS','PSY','FAG','FGT','NGR','NIG','CNT','KNT','SHT','DSH','TWT','BCH','CUM','CLT','KUM','KLT','SUC','SUK','SUQ','SCK','LIC','LIK','LIQ','LCK','JIZ','JZZ','GAY','GEY','GEI','GAI','VAG','VGN','SJV','FAP','PRN','LOL','JEW','JOO','GVR','PUS','PIS','PSS','SNM','TIT','FKU','FCU','FQU','HOR','SLT','JAP','WOP','KIK','KYK','KYC','KYQ','DYK','DYQ','DYC','KKK','JYZ','PRK','PRC','PRQ','MIC','MIK','MIQ','MYC','MYK','MYQ','GUC','GUK','GUQ','GIZ','GZZ','SEX','SXX','SXI','SXE','SXY','XXX','WAC','WAK','WAQ','WCK','POT','THC','VAJ','VJN','NUT','STD','LSD','POO','AZN','PCP','DMN','ORL','ANL','ANS','MUF','MFF','PHK','PHC','PHQ','XTC','TOK','TOC','TOQ','MLF','RAC','RAK','RAQ','RCK','SAC','SAK','SAQ','PMS','NAD','NDZ','NDS','WTF','SOL','SOB','FOB','SFU'];\n\n if (_.contains (fourLetter, code))\n checkCode(generateCode(), callback);\n \n else if(threeLetter.some(function(s) { return code.indexOf(s) >= 0; }))\n checkCode(generateCode(), callback);\n\n else\n callback(code);\n\n }", "title": "" }, { "docid": "afed03f7f931fa1502501c7167ea2020", "score": "0.59295547", "text": "async verifyPasswordResetCode({ commit }, code) {\n try {\n const db = await database();\n const auth = await db.auth();\n const email = await auth.verifyPasswordResetCode(code);\n commit(\"verifyPasswordResetCode\", email);\n return email;\n }\n catch (e) {\n commit(\"error\", {\n stack: e.stack,\n message: `Failure to verify password reset code: ${e.message} [ ${e.code} ${e.name} ]`\n });\n throw e;\n }\n }", "title": "" }, { "docid": "251d37456064e8c5beb76caed4106ed7", "score": "0.5925778", "text": "function verifyCode(){\n const num = Math.floor((Math.random()*1000000)+1);\n console.log(\"random number is: \"+num)\n let str = ''+num;\n while (str.length < 6){\n str = '0'+str;\n }\n const hashedVerify = bcrypt.hashSync(str, 8);\n return hashedVerify;\n}", "title": "" }, { "docid": "e9b860ef64e2d0f6f856541719aa681e", "score": "0.5907447", "text": "codeFromReceipt(receipt) {\n let code = '';\n const p = receipt.event_logs[0].params;\n if (p) { // p = [ { vname: 'code', type: 'Uint32', value: '4' } ]\n const c = p.find(o => o.vname == 'code');\n if (c) {\n const v = c.value;\n if (v) {\n code = v;\n }\n }\n }\n return code;\n }", "title": "" }, { "docid": "bc349b48a5a0c53fdad89746fa6965a4", "score": "0.58657837", "text": "extractCode (callback) {\n\t\tthis.firstConfirmationCode = this.data.confirmationCode;\n\t\tcallback();\n\t}", "title": "" }, { "docid": "925206798bfcdf3e2d7d204e846189f0", "score": "0.58151186", "text": "function getAuthCode() {\n\t\t\tvar code = getUrlParam(\"code\");\n\t\t\t//update DOM\n\t\t\tif (code != \"\" ) {\n\t\t\t\tmsgBox.innerHTML=\"This is your authorization code: \" + code;\n\t\t\t\taccessTokenBtn.disabled = false;\n\t\t\t\taccessTokenBtn.title = \"\";\n\t\t\t\tauthCodeBtn.disabled = true;\n\t\t\t\tauthCodeBtn.title = \"\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmsgBox.innerHTML=\"No code available!\";\n\t\t\t}\n\t\t\tauthCode = code;\n\t\t\treturn code;\n\t\t}", "title": "" }, { "docid": "ef9a706107fba17892aa7bae2bbbb54f", "score": "0.5799273", "text": "function verifyCodeFailure(error) {\n return {\n type: VERIFY_CODE_FAILURE,\n payload: {\n error\n }\n };\n}", "title": "" }, { "docid": "28a247301ffe24981c69d0683f7162d7", "score": "0.5794178", "text": "function findCode(code) {\n var exists = false;\n var data = \"\";\n\n for(var x = 0; x < examCodes.length; x++){\n var decryptedBytes = CryptoJS.AES.decrypt(examCodes[x], key);\n var plaintext = decryptedBytes.toString(CryptoJS.enc.Utf8);\n\n if(plaintext.split(\";\")[0] == code){\n return plaintext;\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "9d879eea50c44903709e7784141c0c9b", "score": "0.57827216", "text": "codeFlowCallback(urlToCheck) {\n const code = this.urlService.getUrlParameter(urlToCheck, 'code');\n const state = this.urlService.getUrlParameter(urlToCheck, 'state');\n const sessionState = this.urlService.getUrlParameter(urlToCheck, 'session_state') || null;\n if (!state) {\n this.loggerService.logDebug('no state in url');\n return throwError('no state in url');\n }\n if (!code) {\n this.loggerService.logDebug('no code in url');\n return throwError('no code in url');\n }\n this.loggerService.logDebug('running validation for callback', urlToCheck);\n const initialCallbackContext = {\n code,\n refreshToken: null,\n state,\n sessionState,\n authResult: null,\n isRenewProcess: false,\n jwtKeys: null,\n validationResult: null,\n existingIdToken: null,\n };\n return of(initialCallbackContext);\n }", "title": "" }, { "docid": "10766c89d497d11abc9c44ab2b2d16cf", "score": "0.57799834", "text": "async getActualAuthenticationCode() {\n if (typeof this.params.authenticationCode === \"string\") {\n return this.params.authenticationCode;\n }\n else if (this.params.authenticationCode !== undefined) {\n return this.params.authenticationCode();\n }\n else if (this.params.getBearerToken !== undefined) {\n return this.params.getBearerToken();\n }\n else {\n return undefined;\n }\n }", "title": "" }, { "docid": "106be8fdcb7cb86de88eff8af5abe077", "score": "0.5737519", "text": "setVerificationCode(verification_code) {\n this.verification_code = verification_code;\n }", "title": "" }, { "docid": "9a66e3b3ffeaaa93fe11088bcc853348", "score": "0.57353944", "text": "getCode() {\n var index = window.location.href.indexOf(\"code=\");\n if (index == -1){\n return null;\n }\n var token = window.location.href.substring(index+5);\n var eindex = token.search(/[&#\\/]/);\n if (eindex > -1){\n return token.substring(0, eindex);\n }\n return token;\n }", "title": "" }, { "docid": "aee9ba85853a7eb4b6ff22f5b19c3dc4", "score": "0.5721052", "text": "function getCode(msg) {\n var info = '' + msg.data;\n if (info.indexOf('code:') !== -1 && !isReady) {\n ucode = info.replace(/code:/g, '');\n isReady = true;\n if (typeof options.on_code_ready === \"function\") {\n options.on_code_ready(ucode);\n deleteCookie('etaguid');\n if (idnSaveLocalCookie) {\n setCookie('etaguid', ucode, 1000);\n }\n }\n }\n }", "title": "" }, { "docid": "8b6b1911b16f97e94bd508c053b5ff86", "score": "0.57200795", "text": "getCode() {\n\t\treturn this._code;\n\t}", "title": "" }, { "docid": "a6cac3d8a0de65509651d92e58523a50", "score": "0.57192904", "text": "function getDeviceCode() {\n fetch(location.origin + '/MBP/oauth/authorize?client_id=device-client&response_type=code&scope=write', {\n headers: {\n // Basic http authentication with username \"device-client\" and the according password from MBP\n 'Authorization': 'Basic ZGV2aWNlLWNsaWVudDpkZXZpY2U='\n }\n }).then(function (response) {\n let chars = response.url.split('?');\n let code = chars[1].split('=');\n vm.parameterValues.push({\n \"name\": \"device_code\",\n \"value\": code[1]\n });\n });\n }", "title": "" }, { "docid": "91741f2bf10adf996932309f5775dcfa", "score": "0.57192385", "text": "verify(data = {}) {\n const endpoint = '2fa/verify';\n\n const requiredParams = ['number', 'token'];\n Validator.validateRequiredParams(requiredParams, data, endpoint);\n\n return this._call(endpoint, data);\n }", "title": "" }, { "docid": "fb5796d9bf870728d090191aea0bb2a0", "score": "0.56999266", "text": "getAuthCode() {\n // check for code\n var url_string = window.location.href;\n var url = new URL(url_string);\n var code = url.searchParams.get(\"code\");\n if (!code) {\n this._store.dispatch(push('/'));\n }\n else {\n this._store.dispatch(setupActions.setAuthCode(code));\n this._store.dispatch(push('/pairing-code'));\n }\n }", "title": "" }, { "docid": "633f7fc73957d273a30857792616295f", "score": "0.5681528", "text": "static getVerifyCode(id) {\n const response = new BaseResponse();\n return new Promise((resolve, reject) => {\n redis.get(`verify_code:${id}`, (err, res) => {\n if (err) {\n console.log('Redis get verify code error', err);\n reject(err);\n } else {\n response.code = constant.RES_STATUS_SUCCESS;\n response.message = constant.RES_MESSAGE_SUCCESS;\n response.setValues(res);\n resolve(response);\n }\n });\n });\n }", "title": "" }, { "docid": "637222d412147a8b6da61db74b7b2e4a", "score": "0.56475693", "text": "codeFlowCodeRequest(callbackContext) {\n const isStateCorrect = this.tokenValidationService.validateStateFromHashCallback(callbackContext.state, this.flowsDataService.getAuthStateControl());\n if (!isStateCorrect) {\n this.loggerService.logWarning('codeFlowCodeRequest incorrect state');\n return throwError('codeFlowCodeRequest incorrect state');\n }\n const authWellKnown = this.storagePersistanceService.read('authWellKnownEndPoints');\n const tokenEndpoint = authWellKnown === null || authWellKnown === void 0 ? void 0 : authWellKnown.tokenEndpoint;\n if (!tokenEndpoint) {\n return throwError('Token Endpoint not defined');\n }\n let headers = new HttpHeaders();\n headers = headers.set('Content-Type', 'application/x-www-form-urlencoded');\n const bodyForCodeFlow = this.urlService.createBodyForCodeFlowCodeRequest(callbackContext.code);\n return this.dataService.post(tokenEndpoint, bodyForCodeFlow, headers).pipe(switchMap((response) => {\n let authResult = new Object();\n authResult = response;\n authResult.state = callbackContext.state;\n authResult.session_state = callbackContext.sessionState;\n callbackContext.authResult = authResult;\n return of(callbackContext);\n }), catchError((error) => {\n const errorMessage = `OidcService code request ${this.configurationProvider.openIDConfiguration.stsServer}`;\n this.loggerService.logError(errorMessage, error);\n return throwError(errorMessage);\n }));\n }", "title": "" }, { "docid": "1d5444bf1f8f6a3e10977b10c3893be6", "score": "0.5617172", "text": "async function onVerifyOTP() {\n console.log(`Code: ${code}`);\n let requestOptions = {\n method: \"POST\",\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({'code': code}),\n };\n let res = await fetch(`${REACT_APP_API_BACKEND}/auth/otp/verify`, requestOptions);\n console.log(res.status);\n if (res.status === 200) {\n success();\n setCode(\"\");\n authUpdate(true);\n navigate(\"/map\", true);\n }\n }", "title": "" }, { "docid": "40935154c91fe33e6b23918a6dadb1ba", "score": "0.56152374", "text": "function getVerificationChallenge(verificationCode) {\n const today = new Date().toISOString().split('T')[0];\n const fullKey = {\n createdDate: {\n S: today\n },\n smsCode: {\n N: String(verificationCode)\n }\n };\n const params = {\n TableName: 'VerificationChallenges',\n Key: fullKey\n };\n return new Promise(resolve => {\n dynamo.getItem(params, (err, data) => {\n resolve({\n requestParams: params,\n response: err || data\n });\n });\n });\n}", "title": "" }, { "docid": "311858f4806bc06a05894a8c33d03eae", "score": "0.5614538", "text": "verify(phone, code) {\n if (code === '') {\n this.presentAlert2('Confirmation code is required!');\n }\n else {\n this.presentLoading();\n // setTimeout(() => this.spinnerDialog.hide(), 3000);\n return this.http.get(this.env.API_URL + `checkRegCode/${phone}/${code}`).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"tap\"])(t => {\n this.data = t;\n if (this.data.response === 'success') {\n this.dismiss();\n return t;\n }\n else {\n this.dismiss();\n this.presentAlert1(this.data.message);\n return t;\n }\n }));\n }\n }", "title": "" }, { "docid": "69b3f3e0791ac6f6bd6751963c910948", "score": "0.56002563", "text": "get verifier() {\n return this._verifier;\n }", "title": "" }, { "docid": "98883175b78a9f5c3a9a5c3d5187e001", "score": "0.55967444", "text": "get code () { return this._code }", "title": "" }, { "docid": "80827b078cb89ee43b5f3e91c006b29c", "score": "0.55668026", "text": "get code () {\r\n\t\treturn this._code;\r\n\t}", "title": "" }, { "docid": "f23438fd29c8621faa7fb28b1aebfaaf", "score": "0.5557488", "text": "static generateVerifyUrl(assetUrl) {\n const url = new URL('https://verify.contentauthenticity.org/inspect');\n url.searchParams.set('source', assetUrl);\n return url.toString();\n }", "title": "" }, { "docid": "907ef40f59dc528a3ea20b79b594fec9", "score": "0.5555304", "text": "get code() {\n return this._data.code;\n }", "title": "" }, { "docid": "907ef40f59dc528a3ea20b79b594fec9", "score": "0.5555304", "text": "get code() {\n return this._data.code;\n }", "title": "" }, { "docid": "8a54a03d31de597f1eec156350f95b07", "score": "0.55294573", "text": "get code () {\n\t\treturn this._code;\n\t}", "title": "" }, { "docid": "8a54a03d31de597f1eec156350f95b07", "score": "0.55294573", "text": "get code () {\n\t\treturn this._code;\n\t}", "title": "" }, { "docid": "8a54a03d31de597f1eec156350f95b07", "score": "0.55294573", "text": "get code () {\n\t\treturn this._code;\n\t}", "title": "" }, { "docid": "8a54a03d31de597f1eec156350f95b07", "score": "0.55294573", "text": "get code () {\n\t\treturn this._code;\n\t}", "title": "" }, { "docid": "1b77346d10fec433df2057f21e840e56", "score": "0.54889864", "text": "function getTokenCode(profileName, mfaSerial, callback) {\n // Prompt the user to enter an MFA token from a configured device\n inquirer_1.prompt([\n {\n type: 'string',\n name: 'tokenCode',\n message: `Enter the MFA code for ${mfaSerial} (profile: ${profileName})`\n }\n ])\n .then(answers => callback(null, answers.tokenCode))\n .catch(error => callback(error));\n}", "title": "" }, { "docid": "4a5bb2922a0c03c9c4078123a1e9d2a9", "score": "0.5486064", "text": "function checkCodeChallenge(request, authRecord) {\n const code_verifier = request.code_verifier;\n const code_challenge = authRecord.code_challenge;\n \n if (authRecord.code_challenge_method != 'S256') {\n throw new ValidationError('Bad code challenge method, must be S256: ' + authRecord.code_challenge_method + '. Client ID: ' + request.client_id);\n }\n \n if (code_challenge != encodeVerifier(code_verifier)) {\n throw new UnauthorizedError('Bad code verifier: ' + code_verifier + '. Client ID: ' + request.client_id);\n }\n}", "title": "" }, { "docid": "5e8af1347a2bc4af0e9aa0cdf80d91a9", "score": "0.5475336", "text": "function validateCode() {\n\tremoveError(codeInput, codeError);\n\n\tif (validateRequired(codeInput)) {\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"/register/validate\",\n\t\t\tdata: new FormData($('#register-form').get(0)),\n\t\t\tprocessData: false,\n\t\t\tcontentType: false,\n\t\t\tsuccess: function (data, textStatus, jqXHR) {\n\t\t\t\tif (jqXHR.responseText === 'verified') {\n\t\t\t\t\tchangeStep(personalDataStep);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\t\tif (jqXHR.responseText === 'not_verified') {\n\t\t\t\t\tsetError(codeInput, codeError, 'The verification code is not correct.');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsetError(codeInput, codeError, 'The verification code field is required.');\n\t}\n}", "title": "" }, { "docid": "03c40f8971cb0e17babd2b87d6c8d199", "score": "0.5468208", "text": "function getAuthCode(url){\n var error = url.match(/[&\\?]error=([^&]+)/);\n if (error) {\n throw 'Error getting authorization code: ' + error[1];\n }\n return url.match(/[&\\?]code=([\\w\\/\\-]+)/)[1];\n}", "title": "" }, { "docid": "f472d2a0cc9d448fe3f4956102e0e125", "score": "0.545382", "text": "get code() {\n\t\treturn this.__code;\n\t}", "title": "" }, { "docid": "f472d2a0cc9d448fe3f4956102e0e125", "score": "0.545382", "text": "get code() {\n\t\treturn this.__code;\n\t}", "title": "" }, { "docid": "f472d2a0cc9d448fe3f4956102e0e125", "score": "0.545382", "text": "get code() {\n\t\treturn this.__code;\n\t}", "title": "" }, { "docid": "56625efa22b9a8044274c17d42665fa0", "score": "0.5452761", "text": "function onVerifyCodeSubmit(code, phoneNumber) {\n\n\n confirmationResult.confirm(code).then(function (result) {\n\n // User signed in successfully.\n //var user = result.user;\n\n firebase.auth().currentUser.getIdToken(true).then(function(idToken) {\n\n login(idToken, phoneNumber);\n\n }).catch(function(error) {\n\n showErrorMsg(error);\n });\n\n }).catch(function (error) {\n\n showErrorMsg(error);\n\n });\n}", "title": "" }, { "docid": "17eb3ad2344528b5f08a6a5b6d900556", "score": "0.54330754", "text": "getCodeText()\n {\n return this.getJavaClass().getCodeTextSync();\n }", "title": "" }, { "docid": "44d993c56afbd5a8e89a7add8c473877", "score": "0.5432959", "text": "function receiveAuthCode( code )\n{\n\t$J(document).trigger( 'SteamMobile_ReceiveAuthCode', [ code ] );\n}", "title": "" }, { "docid": "539054baee0770e444a55c59e9008aaa", "score": "0.5398276", "text": "function _webBarcode(params, cb){\n //TODO Web barcode decoding not supported yet.\n $fh.forms.log.e(\"Web Barcode Decoding not supported yet.\");\n return cb(\"Web Barcode Decoding not supported yet.\");\n }", "title": "" }, { "docid": "dfebf9e34088e9d0dde4226e401c3447", "score": "0.53924835", "text": "verifyAttr(key, verificationCode) {\n this.getCognitoUser().verifyAttribute(key, verificationCode, function(err, result) {\n if (err) {\n logger.log(err)\n return\n }\n logger.log(result)\n })\n }", "title": "" }, { "docid": "9fa422fb1e432e1ca2fb0a376b3bcdee", "score": "0.53839797", "text": "async checkCode() {\n const code = await this.eth.getCode(this.contract.address)\n if (code === '0x') {\n throw new Error('NO CODE')\n }\n return true\n }", "title": "" }, { "docid": "9fa422fb1e432e1ca2fb0a376b3bcdee", "score": "0.53839797", "text": "async checkCode() {\n const code = await this.eth.getCode(this.contract.address)\n if (code === '0x') {\n throw new Error('NO CODE')\n }\n return true\n }", "title": "" }, { "docid": "ed25a50cd5150b221096fb24975abd1a", "score": "0.53536147", "text": "static setVerifyCode(id, code) {\n const response = new BaseResponse();\n const redisRes = redis.set(`verify_code:${id}`, code);\n if (!redisRes) {\n console.log('Redis set verify code error', redisRes);\n response.message = `Redis set verify code error ${redisRes}`;\n return Promise.reject(response);\n }\n response.code = constant.RES_STATUS_SUCCESS;\n response.message = constant.RES_MESSAGE_SUCCESS;\n response.setValues(redisRes);\n return Promise.resolve(response);\n }", "title": "" }, { "docid": "70293b78073a3ecedd36677b76d538d0", "score": "0.53282624", "text": "getCode128()\n {\n return this._code128Parameters;\n }", "title": "" }, { "docid": "12a5a803c544e434437f51ebd9db9df9", "score": "0.53243786", "text": "function getCodeFromKey(key) {\r\n //Constants for key\r\n if (key == STUDENT_INBOX_KEY) return 1;\r\n if (key == ADMIN_INBOX_KEY) return 2;\r\n if (key == STUDENT_SENT_ITEMS_KEY) return 3;\r\n if (key == ADMIN_SENT_ITEMS_KEY) return 4;\r\n}", "title": "" }, { "docid": "2cab645540940e6e44cd2ab56db03948", "score": "0.53227973", "text": "ChaKeyConFirmPay(VerfCode)\r\n{\r\n var n;\r\n var nlen=(VerfCode.length);\r\n if(nlen>IChaKey.CHAKEY_PWD_LEN)nlen=IChaKey.CHAKEY_PWD_LEN;\r\n\r\n var array_in = new Uint8Array(MAX_TRANSE_LEN) ;\r\n var Buf=this.stringToBytes(VerfCode);\r\n\r\n for( n = 0 ;n<= nlen - 1;n++)\r\n {\r\n array_in[1 + n] =Buf[n];\r\n }\r\n this.SendWithData(CONFIRM_PAY, array_in);\r\n return this.lasterror;\r\n}", "title": "" }, { "docid": "3ec4282628ee6e04d33e1ffeee8035af", "score": "0.5318846", "text": "function getVerifier(address racer) constant public returns (address verifier) {\n return racers[racer].verifier;\n }", "title": "" }, { "docid": "6b420975aa1e3466916c23c9bac96a1c", "score": "0.53079945", "text": "static async getChallengeFromVerifier(v) {\n const hashed = await this.sha256(v);\n return this.base64urlencode(hashed);\n }", "title": "" }, { "docid": "9f809a07ac52cba26fa46585211fc4f6", "score": "0.5307963", "text": "function exchangeCode(req, callback){\n\tvar params = req.body;\n\n\t// get parameters from query string\n\tvar request_body = {\n\t\tgrant_type: params.grant_type,\n\t\tclient_id: params.client_id,\n\t\tcode_verifier: params.code_verifier,\n\t\tcode: params.code,\n\t\tredirect_uri: params.redirect_uri\n\t};\n\n\t// build the request to auth0\n\tvar options = {\n\t\tmethod: 'POST',\n\t\turl: 'https://' + req.webtaskContext.secrets.TENANT_DOMAIN + '/oauth/token',\n\t\tjson: request_body\n\t};\n\n\t// make the request\n\trequest(options, function (error, response, body) {\n\n\t\tif(error) return callback(error, null);\n\t\tif(body.error) return callback(body, null);\n\n\t\t// if the request was succesfully, build the response\n\t\tvar response = {\n\t\t access_token: body.access_token,\n\t\t acr: \"https://verified.me/loa/can/auth/standard\", // TODO: we will ignore acr for now\n\t\t expires_in: body.expires_in,\n\t\t id_token: body.id_token,\n\t\t refresh_token: body.refresh_token,\n\t\t token_type: body.token_type\n\t\t};\n\n\t\t// if we have an access token and scopes are defined\n\t\tif(body.access_token){\n\t\t\tvar decoded = jwt.decode(body.access_token);\n\t\t\tconsole.log('decoded token: ', decoded);\n\t\t\tresponse.scope = (decoded && decoded.scope)? decoded.scope : \"\";\n\t\t}\n\n\t\t// callback with the response\n\t\tcallback(null, response);\n\t});\n\n}", "title": "" }, { "docid": "e7c9f2eeeeda22ff0c5b24a367fde6df", "score": "0.5301889", "text": "function updateVerifyCode(email, strNewVerifyCode, callback) {\n sql = \"UPDATE users SET verify_code = $1 WHERE email = $2\";\n query(sql, [strNewVerifyCode, email], function(err) {\n\n if(err) return callback(err, false);\n return callback(null, true);\n });\n}", "title": "" }, { "docid": "70c992f6fabeb0e49dabc15ddaa01137", "score": "0.5299754", "text": "getCode() {\n return 200;\n }", "title": "" }, { "docid": "ccc12141da0284866697931a556b5b90", "score": "0.5297758", "text": "async \"Filecoin.WalletVerify\"(inputAddress, data, serializedSignature) {\n await __classPrivateFieldGet(this, _blockchain).waitForReady();\n const signature = new signature_1.Signature(serializedSignature);\n const protocol = address_1.Address.parseProtocol(inputAddress);\n const isBLS = protocol === address_1.AddressProtocol.BLS && signature.type === sig_type_1.SigType.SigTypeBLS;\n const isSecp = protocol === address_1.AddressProtocol.SECP256K1 &&\n signature.type === sig_type_1.SigType.SigTypeSecp256k1;\n const isValid = isBLS || isSecp;\n if (isValid) {\n const address = new address_1.Address(inputAddress);\n return await address.verifySignature(Buffer.from(data, \"base64\"), signature);\n }\n else {\n throw new Error(\"Invalid address protocol with signature. Address protocol should match the corresponding signature Type. Only BLS or SECP256K1 are supported\");\n }\n }", "title": "" }, { "docid": "af3ddf6cf6a31eb5f74a02d97dab1b0b", "score": "0.5294358", "text": "async function getExtCodeHash(contractAddr, contractAbi, inspectedAddr) {\n const examerContract = new web3.eth.Contract(contractAbi, contractAddr)\n let codehash = await examerContract.methods.detect(inspectedAddr).call()\n return codehash\n}", "title": "" }, { "docid": "69638482f63d1910dc0eab780acbb270", "score": "0.52914655", "text": "function test() {\n verifyrsa.verificationcost()\n}", "title": "" }, { "docid": "5c0692710ef06111846243b1039808a4", "score": "0.5287585", "text": "function sendVerifcationCode() {\n var randomNumber = Math.floor(1000 + Math.random() * 9000)\n CONFIG_VERIFICATION_CODE = 'VC-' + randomNumber\n\n var message = 'Your login verification code is: ' + CONFIG_VERIFICATION_CODE\n\n console.log('Sending Message...')\n sms.send({\n to: CONFIG_PHONE_NUMBER,\n message: message,\n })\n .then(function(response) {\n console.log('Message Sent')\n console.log(response)\n })\n .catch(function(error) {\n console.log('Message Failed!')\n console.log(error)\n })\n}", "title": "" }, { "docid": "0ac972e2d654753ec8bed2b8475d6fc2", "score": "0.52583027", "text": "function testCode(event,code){\n\tvar valid = false;\n\tvar action;\n\tvar __event = event;\n\tconsole.log(code)\n\tfor(var i = 0;i < __event.codes.length; i++){\n\t\tif(code === __event.codes[i].code){\n\t\t\tvalid = true;\n\t\t\taction = __event.codes[i].action;\n\t\t}\n\t}\n\n\tif(valid === false){\n\t\tconsole.log('invalid')\n\t\treturn \"invalid\";\n\t} else {\n\t\treturn action;\n\t}\n}", "title": "" }, { "docid": "842939343cc79504480a70a4565e53da", "score": "0.52463377", "text": "getChangeCode()\n {\n let code = this.currentLineChangeCode;\n this.currentLineChangeCode = undefined; // reset\n return code;\n }", "title": "" }, { "docid": "0df38185fe3a0e4109801b893275dc46", "score": "0.5242454", "text": "function RawCode() {\r\n this.value = 0;\r\n this.address = 0;\r\n this.compare = 0;\r\n this.hasCompare = 0;\r\n }", "title": "" }, { "docid": "651ff0bcc6f1a26ab5206d5edf7c4fc8", "score": "0.5238554", "text": "handleAuthorizationCode() {\n /** @type {any} */\n let token;\n\n assert(() => token = jwt.verify(this.request.body.code, config.jwtSecret), errors.authorization_code.invalid_code);\n \n assert(token.redirect_uri, errors.authorization_code.invalid_code);\n\n assert(this.request.body.redirect_uri, {\n type : \"oauth\",\n code : 400,\n error: \"invalid_request\",\n msg : \"Missing redirect_uri parameter\"\n });\n\n assert(token.redirect_uri === this.request.body.redirect_uri, {\n type : \"oauth\",\n code : 401,\n error: \"invalid_request\",\n msg : \"Invalid redirect_uri parameter\"\n });\n\n if (token.code_challenge_method === 'S256') {\n const hash = crypto.createHash('sha256');\n hash.update(this.request.body.code_verifier || \"\");\n const code_challenge = jose.util.base64url.encode(hash.digest());\n if (code_challenge !== token.code_challenge) {\n throw Lib.OAuthError.from({\n code : 401,\n error: \"invalid_grant\",\n msg : \"Invalid grant or Invalid PKCE Verifier, '%s' vs '%s'.\"\n }, code_challenge, token.code_challenge);\n }\n }\n\n return this.finish(token);\n }", "title": "" }, { "docid": "5af11667c6a1936d412d4965e7d56a10", "score": "0.52342147", "text": "getToken(code) {\n throw new Error(\"Cannot make a call to the abstract method. Method needs to be implemented\");\n }", "title": "" }, { "docid": "3308ed71d38fb765891be1cd3b323dc2", "score": "0.5198373", "text": "getChaincodeId(): string {\n return this.chaincodeId\n }", "title": "" }, { "docid": "ac8b10bd252e783ad2b4402bb4495b56", "score": "0.5188406", "text": "function resendCodeCallback(data){\n if(data.code == error_codes.verify_code_resend){\n $.alertHandler('', data.msg, alert_box_success);\n }else if(data.code == 1060 || data.code == 1061){\n $.alertHandler('', data.msg, alert_box_failure);\n }else{\n $.alertHandler('', data.msg, alert_box_warning);\n }\n }", "title": "" }, { "docid": "7629721adfc5b4ca6c36c62164fae0fa", "score": "0.5179604", "text": "VerifyHash() {\n\n }", "title": "" }, { "docid": "24eb16f8af31d7eb9dbda5b4c0659744", "score": "0.51681113", "text": "VerifyData() {\n\n }", "title": "" }, { "docid": "0ac949d437c76f82f2303dbfb931ee0a", "score": "0.51662403", "text": "function code(cmd) {\n return exec(cmd).code;\n}", "title": "" }, { "docid": "bfd0b713e5853ed6ad44446f06252548", "score": "0.51631886", "text": "async function confirmCode() {\n try {\n const credential = firebase.auth.PhoneAuthProvider.credential(verificationId, code);\n console.log(credential);\n let userData = await firebase.auth().currentUser.linkWithCredential(credential);\n console.log(userData.user);\n setUser(userData.user);\n } catch (error) {\n if (error.code == 'auth/invalid-verification-code') {\n console.log('Invalid code.');\n } else {\n console.log(error);\n }\n }\n }", "title": "" }, { "docid": "08cdc742c325dcd08cf2d7495e475ead", "score": "0.51482177", "text": "function GetCommandString(compilerParams, code) {\n\t\n\tif (compilerParams[\"targetOnlineCompiler\"] == \"coliru\")\n\t\treturn JSON.stringify( { \"cmd\": compilerParams[\"compilationCommand\"], \"src\": code });\n\t\t\n\t//Else we have an error because we support only coliru. There are plans to support VC++ on another online service.\n\treturn \"ERROR\";\n}", "title": "" }, { "docid": "c09c2c22673b2dbe5fb2accc343af4ff", "score": "0.5146492", "text": "function onSuccessScanBarcode(code) {\n console.log(\"Member card scan success on scanner device \"+code);\n \n alert(\"Barcode: \"+code);\n \n}", "title": "" }, { "docid": "fc82e5448dbe21526e2822f53fa6918e", "score": "0.5140878", "text": "getCodeName() {\n var codes = {\n 0: \"API Unreachable\",\n 1: \" \",\n 200: \"Granted\",\n 401: \"No Credentials/Token\",\n 403: \"Invalid Credentials/Token\"\n };\n return codes[this.state.code] || \"Code \" + this.state.code;\n }", "title": "" }, { "docid": "0f714ee2ae1e29dc89d819eab31d1858", "score": "0.51273483", "text": "function doVerifyMailCode(ctxt) {\n return new Promise((resolve, reject) => {\n if (ctxt.result.error) return resolve(ctxt);\n ctxt.conn.query(_selMailCode, [ctxt.mailCode], (err, rows) => {\n if (err) return reject(err);\n try {\n ctxt.result.error = \"badcode\";\n // No such code\n if (rows.length != 1) return resove(ctxt);\n // Is \"token\" still OK?\n var expiry = new Date(rows[0].expiry)\n if (expiry < new Date()) return resolve(ctxt); // Expired\n ctxt.userId = rows[0].user_id;\n delete ctxt.result.error;\n resolve(ctxt);\n }\n catch (ex) {\n return reject(ex);\n }\n });\n });\n }", "title": "" }, { "docid": "e9637ad2eb0c36f8891e736aea08df57", "score": "0.5126409", "text": "verify(data, sig) {\n return this.key.verify(data, sig);\n }", "title": "" }, { "docid": "453667ee5fd184292c35f4492ec2d4e3", "score": "0.5113802", "text": "getCodeBytes()\n {\n let str = this.getJavaClass().getCodeBytesSync();\n return str.split(\",\");\n }", "title": "" }, { "docid": "5eeb7a2a8864f48f8269435a78530367", "score": "0.5105869", "text": "verifyEmail(){\n\n sendVerifCodeViaEmail({uname: this.username})\n .then((result) => {\n this.verifCode = result;\n console.log('this.verifCode: '+JSON.stringify(this.verifCode));\n this.displayLoginScreen = false;\n this.displayVerifMethodScreen = false;\n this.displayVerifCodeScreen = true;\n this.displaySmsVerifButton = false;\n this.displayEmailVerifButton = true;\n })\n .catch((error) => {\n this.error = error; \n this.errorCheck = true;\n this.errorMessage = error.body.message;\n console.log('sendVerifCodeViaTwilioSMS error: '+JSON.stringify(this.error));\n });\n }", "title": "" }, { "docid": "fc87998ed6aab87fd1178789b8b5aced", "score": "0.51039386", "text": "getCodeType()\n {\n return this.getJavaClass().getCodeTypeSync();\n }", "title": "" }, { "docid": "4f13f09df476bae2d8c6d7fe667a8bf3", "score": "0.5092923", "text": "function sendVerifycode(type, phoneNumber) {\n $.ajax({\n type: \"GET\",\n url: \"../message/sendMessage.php\",\n dataType: 'json',\n data: {\n type: type,\n phoneNumber: phoneNumber\n },\n success: function (data) {\n if (data.state == \"sendVerifycode_success\") {\n toastr.success(\"验证码已发送,请查收\");\n } else if (data.state == \"sendVerifycode_failed\") {\n toastr.success(\"验证码发送出错,请重试获取\");\n $('.Secondtext').text(\"1\");\n }\n },\n error: function () {\n toastr.clear();\n toastr.error(\"验证码请求错误\");\n }\n });\n }", "title": "" }, { "docid": "14a6f3a0f635de4964e0742aea0f662c", "score": "0.50912", "text": "function checkCode(hashCode, timestamp) {\n\tconsole.log(\"check Hash Code\");\n\tconst devCode = \"bfa86fdd-398c-462e-9b4e-9cb52ffafb58\";\n\tvar today = new Date();\n\tvar tStamp = new Date(timestamp.replace(/T/, ' '));\n\tif((today - tStamp)/1000 > 100000) {\n\t\treturn 2; //timeout\n\t} else {\n\t\tvar code = devCode + timestamp;\n\t\tvar localHashCode = crypto.createHash('sha256').update(code).digest('hex');\n\t\t\n\t\tconsole.log(\"primljeni hash:\" + hashCode);\n\t\tconsole.log(\"lokalni hash: \" + String(localHashCode));\n\t\tif(hashCode == String(localHashCode)) {\n\t\t\tconsole.log(hashCode)\n\t\t\tconsole.log(localHashCode)\n\t\t\treturn 1; //right hash\n\t\t} else {\n\t\t\tconsole.log(code)\n\t\t\tconsole.log(localHashCode)\n\t\t\treturn 0; //wrong hash\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "7d427aeb39a12b7815a515acf78373cb", "score": "0.50843894", "text": "static executeProgram(code) {\n const mem = {};\n let rawMask = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';\n let mask = {};\n\n for (let i = 0; i < code.length; i += 1) {\n if (code[i].trim() === '') {\n continue;\n }\n\n let key;\n let value;\n [key, value] = code[i].split(' = ');\n\n if (key === 'mask') {\n rawMask = value;\n for (let c = 0; c < rawMask.length; c += 1) {\n const char = rawMask[c];\n if (char !== 'X') {\n mask[c] = char;\n }\n }\n } else {\n const address = parseInt(key.match(/\\[(\\d+)\\]/)[1], 10);\n value = parseInt(value, 10).toString(2);\n\n let arrValue = [...value];\n // console.log({i, arrValue, address, mask});\n\n let finalValue = '';\n for (let b = 0; b < 36; b += 1) {\n finalValue += mask[b] ? mask[b].char : (arrValue[b] || '0');\n }\n mem[address] = finalValue;\n\n console.log({i, arrValue, address, mask, finalValue});\n }\n }\n\n return mem;\n }", "title": "" }, { "docid": "49c52aa81a79e6fbfb36dc4b1416e1a3", "score": "0.5074707", "text": "function resendVerifyCode(req, res, next) {\n var query = User.where( 'username', new RegExp('^'+req.params.username+'$', 'i') );\n query.findOne(function (err, user) {\n if (err) {\n res.send(err);\n return next();\n } else if (!user) {\n return next(new restify.NotAuthorizedError(\"Invalid username.\"));\n return next();\n } else {\n mail.generateVerifyCode(req, res, next, user);\n return next();\n }\n\n });\n }", "title": "" } ]
f9d7f9723b255009eb6d997de6918951
wrapper function for providing a more flexible interface without getting yelled at by flow
[ { "docid": "77e1fdc2990927809c99bc07ae82ea95", "score": "0.0", "text": "function createElement (\n context,\n tag,\n data,\n children,\n normalizationType,\n alwaysNormalize\n) {\n if (Array.isArray(data) || isPrimitive(data)) {\n normalizationType = children;\n children = data;\n data = undefined;\n }\n if (isTrue(alwaysNormalize)) {\n normalizationType = ALWAYS_NORMALIZE;\n }\n return _createElement(context, tag, data, children, normalizationType)\n}", "title": "" } ]
[ { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.6185405", "text": "function Wrapper() {}", "title": "" }, { "docid": "1226bccfb9553b375fc0362f444496bc", "score": "0.60045", "text": "function PipeDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "ac651a088fd31058b096696c90ea2fe2", "score": "0.5736741", "text": "function PipeDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "ac651a088fd31058b096696c90ea2fe2", "score": "0.5736741", "text": "function PipeDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "ac651a088fd31058b096696c90ea2fe2", "score": "0.5736741", "text": "function PipeDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "ac651a088fd31058b096696c90ea2fe2", "score": "0.5736741", "text": "function PipeDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "d4660a3abffc193ab87c442a51a05107", "score": "0.5714228", "text": "function generic()\r\n{\r\n \r\n}", "title": "" }, { "docid": "9cfe1467b03bf139c57eebc1d3f5858a", "score": "0.5671855", "text": "function OptionalDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "e31c547822f66215ef4a12b8ed84d1b1", "score": "0.56114763", "text": "_fromValue () { utils.abstractFunction(); }", "title": "" }, { "docid": "b92210eae35991fa9f00d42f56168130", "score": "0.55876297", "text": "function SelfDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "6485e9b5b33160ec01571cc01f955e3d", "score": "0.55722237", "text": "function HostDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "1b1f6e91e4744e048d3490ad5a08202a", "score": "0.55618715", "text": "decorateInternal() {}", "title": "" }, { "docid": "4d29ae708a6b956469859a64c6311de6", "score": "0.5518585", "text": "function OutputDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "f950845223a5fa361d113cf7c94729d3", "score": "0.54576236", "text": "function returns(returnInterface) {}", "title": "" }, { "docid": "f2c4efc32cff6354af23af6158b59eb6", "score": "0.53999275", "text": "function SkipSelfDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "367265316a9a2311e792bc44067539c1", "score": "0.5294389", "text": "Encapsulate() {}", "title": "" }, { "docid": "2cb6e09fdad4280ee05f4d3eee04c356", "score": "0.5293775", "text": "function Interface () {}", "title": "" }, { "docid": "99de0f54be4d9b86696baa21353c0a23", "score": "0.52813417", "text": "function v(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n return t;\n}", "title": "" }, { "docid": "8e28bbfa73c659d55ebadda323466303", "score": "0.527458", "text": "_fromBuffer () { utils.abstractFunction(); }", "title": "" }, { "docid": "f43afc8f8c60f3b1b984951a8e1aff1a", "score": "0.52549785", "text": "function HostBindingDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.52361596", "text": "function Interfaz() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.52361596", "text": "function Interfaz() {}", "title": "" }, { "docid": "7ad248aa650608db6a91a71401ad8da8", "score": "0.52361596", "text": "function Interfaz() {}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.52318674", "text": "function dummy(){}", "title": "" }, { "docid": "55dc82bd74db8f541cf53e2136015d74", "score": "0.52318674", "text": "function dummy(){}", "title": "" }, { "docid": "968df7bad421e9ca8c7ba820b520d25f", "score": "0.519113", "text": "function AttributeDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "9a80839656dcbc140dcd2d66517f6efb", "score": "0.5163492", "text": "get Generic() {}", "title": "" }, { "docid": "cb38ab3c7b4ef08a64ee0d90d69a62b6", "score": "0.51560426", "text": "function v(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nn) {\n return t;\n}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.51241726", "text": "function dummy() {}", "title": "" }, { "docid": "44a4c5ea58e481d92724c783281e6466", "score": "0.51173013", "text": "function oS(){return function(R){return R}}", "title": "" }, { "docid": "f528052e5adbc98780ae436bc6d32775", "score": "0.5104268", "text": "function Mixed() {}", "title": "" }, { "docid": "24e51454ab8d6e7e1843c764261149c9", "score": "0.5102658", "text": "function OutputDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "24e51454ab8d6e7e1843c764261149c9", "score": "0.5102658", "text": "function OutputDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "24e51454ab8d6e7e1843c764261149c9", "score": "0.5102658", "text": "function OutputDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "24e51454ab8d6e7e1843c764261149c9", "score": "0.5102658", "text": "function OutputDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "e79c775242c51e5ed6d1aef367baf5b8", "score": "0.5082931", "text": "function type(thing) {\n\n}", "title": "" }, { "docid": "e383232da17e1ad89ee5ac79b14eae6a", "score": "0.507572", "text": "function Interfas() {}", "title": "" }, { "docid": "b23aab8bdf40e26951e48ad1924d6263", "score": "0.506936", "text": "function impure (fn) {\n return {\n meta: {\n type: \"special\",\n algebra: \"io\",\n operation: \"run\"\n },\n body: {\n fn: fn\n }\n };\n}", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.5047531", "text": "apply() {}", "title": "" }, { "docid": "80068fd9c4ecc7909911f4817971b1ff", "score": "0.5047531", "text": "apply() {}", "title": "" }, { "docid": "eb377607ebb19e4a5c680b18f7ac0458", "score": "0.50297546", "text": "apply () {}", "title": "" }, { "docid": "1f4212b5673e912a6f8127c617c798b0", "score": "0.49989223", "text": "function mi(){return mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mi.apply(this,arguments)}", "title": "" }, { "docid": "8ea31c396c97944e67a3b18a509aa11c", "score": "0.49818158", "text": "function be(a){return a&&a.tc?a.ob():a}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.4960761", "text": "function miFuncion(){}", "title": "" }, { "docid": "b13721fdc0df68a596240e7e3e92fa77", "score": "0.49553564", "text": "function HostListenerDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "94e394a7a2af278c6ada33840d2e83ee", "score": "0.49543294", "text": "function ll(){return ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ll.apply(this,arguments)}", "title": "" }, { "docid": "a0c52590d77b7398ca46c979bebcba97", "score": "0.4941899", "text": "function LibGeneric(){// NOTES:\n}", "title": "" }, { "docid": "bf01742cd09eeb5503a518dc0641e349", "score": "0.49400592", "text": "function awrap(arg) {\n return {\n __await: arg\n };\n}", "title": "" }, { "docid": "847753d65f1376bb85ddd07103d833dc", "score": "0.49132505", "text": "function NgModuleDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "5d2f9940c6e93ed70025e31925e5a8c9", "score": "0.49087292", "text": "function PropagationAPI() {}", "title": "" }, { "docid": "4b53a9a0bf91884cce83c6c2938086a6", "score": "0.49063838", "text": "get LeftLittleProximal() {}", "title": "" }, { "docid": "4ac1d10229017ffd71021d1149d9e2ea", "score": "0.4900909", "text": "get forward() {}", "title": "" }, { "docid": "29aee4babebbb205d37d0bb1f3eec83b", "score": "0.48892796", "text": "function _2class(vb, vl, _in, ch) {\n NOT_IMPLEMENTED();\n}", "title": "" }, { "docid": "e3e2bb4d0241a12cbb016aa67b1e7dca", "score": "0.48883864", "text": "function Composition() {}", "title": "" }, { "docid": "8d633cacefe4fe0a97006b3e1293b05e", "score": "0.4884277", "text": "fn(t) {\n let e;\n return e = \"object\" == typeof t ? t.value : t, q(e) ? null : e;\n }", "title": "" }, { "docid": "151fd9364c785e3c3053f2461415dadd", "score": "0.48666885", "text": "function Interfaz(){} // inicializa vacio, lo cargamos con prototipos", "title": "" }, { "docid": "2ae59fecaa161507155162dab2e41852", "score": "0.4864404", "text": "function oq(){return function(l){return l}}", "title": "" }, { "docid": "c3f93927de504b91773c52813da337a5", "score": "0.48638892", "text": "get ETC() {}", "title": "" }, { "docid": "dac3d73937103347991dd3c3ee9fa790", "score": "0.48638722", "text": "function i(e){return void 0===e&&(e=null),Object(r[\"l\"])(null!==e?e:o)}", "title": "" }, { "docid": "4401366cd3d017515d79d6466de332ce", "score": "0.4848123", "text": "function GeneralSupport(){\n\n}", "title": "" }, { "docid": "0ce8e1593861f0822677f44aad88739c", "score": "0.48417506", "text": "function getAccess(returnInterface) {}", "title": "" }, { "docid": "d1cec2bbbf3467755693bd876888bc1f", "score": "0.48387024", "text": "function id(@x){ return x; }", "title": "" }, { "docid": "60daf0d4bf78a8deaa206c3bda74dcec", "score": "0.4837679", "text": "function O_(){var t=this;lr()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&cc()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "title": "" }, { "docid": "6ad92b52e92a3c8e2f3bd0873f018d14", "score": "0.48341244", "text": "get RightLittleProximal() {}", "title": "" }, { "docid": "9ebe35ac29f1f1b3e1939c0f6284fa5a", "score": "0.4823395", "text": "function IDispatchable() { }", "title": "" }, { "docid": "f1f76ab67b287c356f600e863c6a0a27", "score": "0.4819996", "text": "function f(e){const t={inspect:function(){return e}};return u.inspect.custom&&(t[u.inspect.custom]=t.inspect),t}", "title": "" }, { "docid": "e781346e6560962caf08135219e521b7", "score": "0.48192233", "text": "function ordenada(){}", "title": "" }, { "docid": "6ba95307d01ea1344cacb33e7a7cd411", "score": "0.4816548", "text": "function Util () {\n var instance = Object.create({});\n \n /// <summary>Choose between object or a default value.</summary>\n instance.extractValue = function (objectValue, defaultValue) {\n \n if (objectValue !== null && objectValue !== undefined) {\n \n return objectValue;\n }\n \n return defaultValue;\n };\n \n /// <summary>Extracts field value with support for observable fields and a default value in case of failure.</summary>\n instance.extractFieldValue = function (fieldValue, defaultValue) {\n \n var extractedValue;\n \n if (fieldValue !== null && fieldValue !== undefined) {\n\n if (typeof (fieldValue) === \"function\") {\n\n extractedValue = fieldValue();\n\n if (extractedValue === null || extractedValue === undefined) {\n\n if (defaultValue !== null && defaultValue !== undefined) {\n\n return defaultValue;\n }\n }\n return extractedValue;\n }\n \n return fieldValue;\n\n } else {\n \n return defaultValue;\n }\n };\n \n /// <summary>Evaluates flex (html or functions) object items.</summary>\n instance.getFlexOutput = function (options) {\n\n var output;\n\n if (options !== null && options !== undefined) {\n\n if (options.flexobject !== null && options.flexobject !== undefined) {\n\n var flexitems = options.flexobject.items;\n if (flexitems !== null && flexitems !== undefined) {\n\n if (flexitems.length === 1) {\n\n //output object already produced.\n return flexitems[0];\n\n } else if (flexitems.length > 10) {\n\n var key = flexitems[0];\n var evaluator = flexitems[1];\n var result = flexitems[2];\n var content = flexitems[3];\n\n if (result === \"object-output\"\n || result === \"function-output\") {\n\n //if result is object-output or function-output then it \n //is considered that the evaluator is a function construct.\n //\n //\n //if content is not object then take string content items \n //as input with key value\n\n var typeFunction = evaluator;\n\n var options1 = Object.create(options);\n options1.key = key;\n options1.items = Array.splice(0, 10);\n\n if (result === \"object-output\") {\n\n output = new typeFunction.constructor(options1);\n\n } else if (result === \"function-output\") {\n\n output = typeFunction.constructor(options1);\n }\n\n } else {\n\n if (content === \"object\") {\n\n //content: object\n //items are list of objects that are to be evaluated in\n //a string / text / html view\n //\n //\n //and its not object-output or function-output\n\n output = \"\";\n for (var i = 10; i < flexitems.length; i++) {\n\n var options1 = Object.create(options);\n options1.flexobject = flexitems[i];\n\n output += Util().extractValue(instance.getFlexOutput(options1), \"\");\n }\n\n } else {\n\n //content: html, text, string\n\n if (result === \"html\"\n || result === \"string\"\n || result === \"text\") {\n\n //get html format\n output = evaluator;\n\n //replace key value\n var keyValue = new RegExp('a0_', 'gi');\n output = output.replace(keyValue, Util().extractValue(flexitems[0], \"\"));\n\n var pathValue = new RegExp('cp_', 'gi');\n output = output.replace(pathValue, Util().extractValue(options.contextpath, \"\"));\n\n //replace remaining items\n for (var i = 10; i < flexitems.length; i++) {\n\n var flexitem = flexitems[i];\n var expValue = new RegExp('a' + i + '_', 'gi');\n\n output = output.replace(expValue, Util().extractValue(flexitem, \"\"));\n }\n }\n }\n }\n }\n }\n }\n }\n\n return ((output !== null && output !== undefined) ? output : \"\");\n };\n \n return instance;\n}", "title": "" }, { "docid": "76191702ed7826a4fcd550899ca1329a", "score": "0.48149177", "text": "function adapt (fn) {\n return function adapter (ctx){\n return Promise.resolve(fn(ctx, ctx.response, ctx.next)).then(x => {\n return x === undefined && fn.length < 3? false : x;\n });\n };\n}", "title": "" }, { "docid": "27da66deb012be750b76379358289941", "score": "0.4810559", "text": "function getSomething() {\n // whatevs\n}", "title": "" }, { "docid": "31ca3b893a7e6d0a12e6b7e3e7293b64", "score": "0.48043355", "text": "function BasicProxy() {}", "title": "" }, { "docid": "87618186b5f6f2752b2fb71f00c0fc3e", "score": "0.4802112", "text": "dom(...a) { return dom(...a); }", "title": "" }, { "docid": "e34b567522a487ff396e5ffdeea2e72c", "score": "0.47967508", "text": "function u(){return u=Object.assign?Object.assign.bind():function(be){for(var ke=1;ke<arguments.length;ke++){var We=arguments[ke];for(var Be in We)Object.prototype.hasOwnProperty.call(We,Be)&&(be[Be]=We[Be])}return be},u.apply(this,arguments)}", "title": "" }, { "docid": "1cdd7b07b5c7b07c13a74aec9baed6de", "score": "0.47892356", "text": "function gu(){return gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gu.apply(this,arguments)}", "title": "" }, { "docid": "5bf87cf3dfff54c9a484425a56ebd875", "score": "0.47839078", "text": "function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Us.apply(this,arguments)}", "title": "" }, { "docid": "0707e2276203dfe049e92d77ca4d36f7", "score": "0.4783547", "text": "extend() {}", "title": "" }, { "docid": "6f538edd5dd2d9352264ce611f649c20", "score": "0.47831872", "text": "function Io(t,e){for(var n in e)t[n]=e[n];return t}", "title": "" }, { "docid": "6f538edd5dd2d9352264ce611f649c20", "score": "0.47831872", "text": "function Io(t,e){for(var n in e)t[n]=e[n];return t}", "title": "" }, { "docid": "fd880c923306478e2142560af2be1b06", "score": "0.478131", "text": "function Rest(valueInterface) {}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.47801337", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.47801337", "text": "function ba(){}", "title": "" }, { "docid": "6b2c3365475968136d6cb24401fef205", "score": "0.47801337", "text": "function ba(){}", "title": "" }, { "docid": "3b9a84e884349ed028d5791c21948e79", "score": "0.4777643", "text": "get(){ return this.wrapped_call( \"get\", arguments ) }", "title": "" }, { "docid": "98adfbb90f50d96a6bcd5139b0b0cf43", "score": "0.47764882", "text": "function o(){return o=Object.assign?Object.assign.bind():function(C){for(var z=1;z<arguments.length;z++){var E=arguments[z];for(var ce in E)Object.prototype.hasOwnProperty.call(E,ce)&&(C[ce]=E[ce])}return C},o.apply(this,arguments)}", "title": "" }, { "docid": "1d54fde7b2b11339650680c226a15b4a", "score": "0.47743323", "text": "static compose(...args){\n return Helpers.flow(...Helpers.reverse(args))\n }", "title": "" }, { "docid": "df9393c6a6fdd0ac474c681b7eed250d", "score": "0.4770306", "text": "function ha(){}", "title": "" }, { "docid": "2fc750f3794ff5f4eb4f698d2d036426", "score": "0.47677097", "text": "function o(){}", "title": "" }, { "docid": "f84fdf079860f235df33ba4a56c6018f", "score": "0.4767647", "text": "logic() {}", "title": "" }, { "docid": "cce5296e1a7d575ac7223be638765bf5", "score": "0.4763814", "text": "function r(e){return function(){return e}}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.47636163", "text": "function func() {}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.47636163", "text": "function func() {}", "title": "" }, { "docid": "1e58ee551e1cc7ee192989b619d514fa", "score": "0.4757572", "text": "function i(t){return void 0===t&&(t=null),Object(r[\"l\"])(null!==t?t:o)}", "title": "" }, { "docid": "5ec894c3fc1a4acef8b3b9545dee5fb1", "score": "0.4754462", "text": "function Eventful({time, place}) {\n function getTime() { return time }\n function getPlace() { return place }\n return { getTime, getPlace }\n}", "title": "" }, { "docid": "952130849e7845ef4006857b43a2936a", "score": "0.47533816", "text": "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "952130849e7845ef4006857b43a2936a", "score": "0.47533816", "text": "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "952130849e7845ef4006857b43a2936a", "score": "0.47533816", "text": "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "952130849e7845ef4006857b43a2936a", "score": "0.47533816", "text": "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "2973666126fbc7a76fc8c82b751d646f", "score": "0.4748994", "text": "readInt(){notImplemented(this.name,\"readInt\")}", "title": "" }, { "docid": "d5b0d5605968726b31c56f8a13f19313", "score": "0.47433433", "text": "function UnderstandProto(firstName, lastName){\n return function (){\n this.firstName = firstName;\n this.lastName = lastName;\n }\n}", "title": "" }, { "docid": "0f5b454c2443af947a13b741287df306", "score": "0.4742191", "text": "function getTarget() {\n return {\n dummy: function (arg) { return arg; }\n };\n }", "title": "" }, { "docid": "f3c890c4e568f0665e811032165793e8", "score": "0.4741092", "text": "function flow(input, funcArray) {\n return (funcArray[0] === undefined) ? input : flow (funcArray.shift()(input), funcArray);\n }", "title": "" } ]
2ef12015f874072cb658a50a4507808a
operation(string/char), value1(number), value2(number). The function should return result of numbers after applying the chosen operation.
[ { "docid": "a72b6f2f32a434c6d59797c8fcf15d54", "score": "0.77289087", "text": "function basicOp(operation, value1, value2) {\n if (operation === \"+\") {\n return value1 + value2;\n }\n if (operation === \"-\") {\n return value1 - value2;\n }\n if (operation === \"*\") {\n return value1 * value2;\n }\n if (operation === \"/\") {\n return value1 / value2;\n } else {\n console.log(\"Invalid operator\");\n }\n}", "title": "" } ]
[ { "docid": "99003ff4f2ce076b64befbbafd941d28", "score": "0.78949773", "text": "function basicOp(operation, value1, value2){\n if (operation === \"+\"){\n return value1 + value2;\n }\n else if (operation === \"-\"){\n return value1 - value2;\n }\n else if (operation === \"*\"){\n return value1 * value2;\n }\n else if (operation === \"/\"){\n return value1 / value2;\n }\n}", "title": "" }, { "docid": "d94b616e39e485a23c07a05ab8d5d9ca", "score": "0.78466094", "text": "function getResult (val1, val2, operation) {\r\n\t\tif (operation === '+') {\r\n\t\t\treturn val1 + val2;\r\n\t\t} else if (operation === '-') {\r\n\t\t\treturn val1 - val2;\r\n\t\t} else if (operation === '*') {\r\n\t\t\treturn val1 * val2;\r\n\t\t} else if (operation === '/') {\r\n\t\t\treturn val1 / val2;\r\n\t\t}\r\n}", "title": "" }, { "docid": "723d0e8336688c5758c7c553f31ec12f", "score": "0.7738352", "text": "function basicOp(operation, value1, value2)\n{\n // Code\n if( operation == \"+\") {\n return value1 + value2\n }\n if( operation == \"-\") {\n return value1 - value2\n }\n if( operation == \"*\") {\n return value1 * value2\n }\n if( operation == \"/\") {\n return value1 / value2\n }\n}", "title": "" }, { "docid": "584565eae611e975a8aeda6cfe3b8450", "score": "0.7695841", "text": "function basicOp(operation, value1, value2) {\n switch (operation) {\n case '+':\n return value1 + value2;\n case '-':\n return value1 - value2;\n case '*':\n return value1 * value2;\n case '/':\n return value1 / value2;\n default:\n return 0;\n }\n}", "title": "" }, { "docid": "74392fd26510903458e80d6320a2dca7", "score": "0.76753163", "text": "function basicOp(operation, value1, value2) {\n switch(operation) {\n case '+':\n return value1 + value2;\n case '-':\n return value1 - value2;\n case '*':\n return value1 * value2;\n case '/':\n return value1 / value2;\n default:\n return 'Input +, -, *, / as a first argument'\n }\n}", "title": "" }, { "docid": "2313127e6968ddfb157bd1cb5b503991", "score": "0.7671401", "text": "function basicOp(operation, value1, value2) {\n switch (operation) {\n case \"+\":\n return value1 + value2;\n case \"-\":\n return value1 - value2;\n case \"*\":\n return value1 * value2;\n case \"/\":\n return value1 / value2;\n default:\n return 0;\n }\n}", "title": "" }, { "docid": "c5120eab11fe3916763b77d409a30997", "score": "0.7663855", "text": "function basicOp(operation, value1, value2)\n{\nif(operation==='+'){\nlet sum =value1 + value2\nreturn sum\n}else if(operation==='-'){\nlet sum = value1 - value2\nreturn sum\n}else if(operation==='*'){\nlet sum = value1 * value2\nreturn sum\n}else if(operation==='/'){\nlet sum = value1 / value2\nreturn sum\n}else return 'no'\n\n}", "title": "" }, { "docid": "2534bef1f0705b2514fd9a3e9931d42a", "score": "0.7629945", "text": "function operate(operation,num1,num2){\n switch (operation) {\n case '+':\n return add(num1,num2)\n break;\n case '-':\n return subtract(num1,num2)\n break;\n case \"x\":\n return multiply(num1,num2)\n break;\n case \"÷\":\n return divide(num1,num2)\n break;\n default:\n\n }\n}", "title": "" }, { "docid": "3ac6e63ba71b4d57f8712f8099beedb4", "score": "0.7627633", "text": "function basicOp(operation, value1, value2)\n\t{\n\t if (operation == '+'){\n\t return (value1 + value2);\n\t } else if (operation == '-'){\n\t return (value1 - value2);\n\t } else if (operation == '*'){\n\t return (value1 * value2);\n\t } else {\n\t return (value1 / value2);\n\t }\n\t}", "title": "" }, { "docid": "5cafc260e5cdb90b015f296833fe9616", "score": "0.7421618", "text": "function operate (operator, num1, num2) {\n var code = operator.charCodeAt(0); \n var total; \n switch (code) { //calls functions on number parameters and saves results into a variable\n case 43:\n total = add(num1,num2);\n break;\n case 45:\n total = subtract(num1,num2);\n break;\n case 42:\n total = multiply(num1,num2);\n break;\n case 47:\n total = divide(num1,num2);\n break;\n }\n return total; // return value is variable containing solution\n }", "title": "" }, { "docid": "2931bc0295961643b98b7daedd796cc8", "score": "0.7394803", "text": "function operate(num1, num2, operator) {\n switch(operator) {\n case '+':\n return truncate(add(num1, num2));\n case '-':\n return truncate(subtract(num1, num2));\n case 'x':\n return truncate(multiply(num1, num2));\n case '/':\n return truncate(divide(num1, num2));\n default:\n return 'An error occured'\n }\n}", "title": "" }, { "docid": "b8ef5c1910f6940da95b956b089a40c6", "score": "0.7390248", "text": "function calculator(operation, num1, num2) {\n var result;\n switch (operation) {\n case 'suma':\n result = num1 + num2;\n break;\n case 'resta':\n result = num1 - num2;\n break;\n case 'multiplicacion':\n result = num1 * num2;\n break;\n case 'division':\n result = num1 / num2;\n break;\n }\n return result;\n}", "title": "" }, { "docid": "2f0e1d13e2afa69890deecd7a1ef914f", "score": "0.73423547", "text": "function performOperation(nr1, nr2, operator)\n{\n if(operator==\"+\")\n {\n return parseFloat(nr1) + parseFloat(nr2);\n }\n if(operator==\"-\")\n {\n return parseFloat(nr1) - parseFloat(nr2);\n }\n if(operator==\"*\")\n {\n return parseFloat(nr1) * parseFloat(nr2);\n }\n if(operator==\"/\")\n {\n return parseFloat(nr1) / parseFloat(nr2);\n }\n}", "title": "" }, { "docid": "d7ca0ef5596d003f57034eb418917bb3", "score": "0.7314506", "text": "function operate(number01, number02, operation) {\n let result = 0\n\n // Perform the given operation.\n if (operation == '+') {\n result = number01 + number02\n } else if (operation == '-') {\n result = number01 - number02\n } else if (operation == '*') {\n result = number01 * number02\n } else if (operation == '/') {\n result = number01 / number02\n } else if (operation == '%') {\n // TODO Implement the percentage operation.\n } else if (operation == 'square-root') {\n // TODO Implement the square root operation.\n }\n\n // Return the calculated result.\n return result\n}", "title": "" }, { "docid": "a4c57111448364bc56a935e762d6f7e9", "score": "0.7311307", "text": "function operate(operation, a, b){\n\tlet result = null\n\tswitch (operation){\n\t\tcase `+`:\n\t\t\toperation = add\n\t\t\tbreak\n\t\tcase `-`:\n\t\t\toperation = subtract\n\t\t\tbreak;\n\t\tcase `*`:\n\t\t\toperation = multiply\n\t\t\tbreak\n\t\tcase `/`:\n\t\t\toperation = divide\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(`invalid operation`)\n\t\t\treturn\n\t}\n\tresult = Number(operation(a,b))\n\tresult = truncateDecimals(result)\n\tresult = truncateIntegers(result)\n return Number(result)\n}", "title": "" }, { "docid": "dab72723620291b0ff5615e4df4e816c", "score": "0.7307215", "text": "function operation(num1, num2, funct){\n \tlet result= funct(num1, num2);\n \treturn result;\n }", "title": "" }, { "docid": "7aeaf2b396bba31651510f820a272605", "score": "0.72549134", "text": "function operate(operator, num1, num2){\n switch (operator){\n case '+':\n return add(num1,num2);\n break;\n case '-':\n return subtract(num1,num2);\n break;\n case '×': //alt code 0215 to match entity code in html\n return multiply(num1,num2);\n break;\n case '÷': //alt code 0247 to match entity code in html\n return divide(num1,num2);\n break;\n case '^':\n return exponent(num1,num2);\n }\n}", "title": "" }, { "docid": "8141ddfab23d8fb3e7461db634b7fb0b", "score": "0.72156614", "text": "function calc (num1, num2, operation) {\n\nswitch (operation) {\n case \"add\":\n return num1 + num2;\n break;\n case \"sub\":\n return num1 - num2;\n break;\n case \"mult\":\n return num1 * num2;\n break;\n case \"div\":\n return num1 / num2;\n break;\n case \"exp\":\n return Math.pow(num1, num2);\n break;\n default:\n return \"Please enter an operation\";\n }\n}", "title": "" }, { "docid": "9f07d3065cf88d5acfa5db6d04ff3bbd", "score": "0.7212908", "text": "function getResult(num1, num2, operation) {\n\tif (operation === '+') {\n\t\treturn num1 + num2; \n\t} else if (operation === '-') {\n\t\treturn num1 - num2; \n\t} else if (operation === '*') {\n\t\treturn num1 * num2; \n\t} else if (operation === '/') {\n\t\treturn num1 / num2; \n\t} else if (operation === '**') {\n\t\treturn Math.pow(num1, num2); \n\t} else if (operation === '%') {\n\t\treturn (num1/num2)*100; \n\t} else if (operation === '√') {\n\t\treturn Math.pow(num1, 1/num2); \n\t} else if (operation === 'l') {\n\t\treturn Math.log(num1)/Math.log(num2); \n\t}\n}", "title": "" }, { "docid": "468c5f359e064e4d670cec2069b41291", "score": "0.71764636", "text": "function calculate(operation){\r\n let firstInput = parseInt(document.getElementById(\"input1\").value);\r\n let secondInput = parseInt(document.getElementById(\"input2\").value);\r\n let result = calculator[operation](firstInput,secondInput);\r\n document.getElementById(\"result\").innerHTML=result;\r\n}", "title": "" }, { "docid": "22262f22f50a9ed634c019e77ed013d4", "score": "0.7173293", "text": "function operate(a,b,op){\r\n switch(op){\r\n case '+':\r\n return a+b;\r\n break;\r\n\r\n case '-':\r\n return a-b;\r\n break;\r\n\r\n case '*':\r\n return a*b;\r\n break;\r\n\r\n case '/':\r\n return a/b;\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "255caf16a68f778d82caa5bc223d1ede", "score": "0.7143388", "text": "function calculator(a,b,operation){\n if (operation === 'add') \n {\n return a + b;\n } else if (operation === 'subtract'){\n return a - b;\n }\n\n}", "title": "" }, { "docid": "a90e1792ad2e8939335f395b23a0f572", "score": "0.70764333", "text": "function operate(firstInput, operator, secondInput) {\n switch (operator) {\n case 'add':\n return add(firstInput, secondInput)\n break;\n case 'subtract':\n return subtract(firstInput, secondInput)\n break;\n case 'multiply':\n return multiply(firstInput, secondInput)\n break;\n case 'divide':\n return divide(firstInput, secondInput)\n break;\n }\n}", "title": "" }, { "docid": "f522c780a73fd017dff53b5fd0c589c5", "score": "0.7076018", "text": "function calculator(num1, operator, num2) {\n if (operator === \"+\") {\n return num1 + num2;\n }\n if (operator === \"-\") {\n return num1 - num2;\n }\n if (operator === \"*\") {\n return num1 * num2;\n }\n if (operator === \"/\") {\n return num1 / num2;\n }\n}", "title": "" }, { "docid": "0401593c8b327cd71f3de1f77e97fa2d", "score": "0.7071649", "text": "function basicas(number1,number2,op){\n switch(op){\n case 1://Suma\n return number1 + number2;\n case 2://Resta\n return number1 - number2;\n case 3://Mult\n return number1 * number2;\n case 4://div\n return number1 / number2 \n default:\n return -1;//error\n \n }\n}", "title": "" }, { "docid": "79a016351bee5cc42a4d7fd67b7daf7d", "score": "0.7049454", "text": "function performOp(a,b,operator){\n switch(operator){\n case '+':\n console.log(parseFloat(a)+parseFloat(b));\n return parseFloat(a)+parseFloat(b);\n break;\n case '-':\n console.log(parseFloat(a)-parseFloat(b));\n return parseFloat(a)-parseFloat(b);\n break;\n case '*':\n console.log(parseFloat(a)*parseFloat(b));\n return parseFloat(a)*parseFloat(b);\n break;\n case '/':\n console.log(parseFloat(a)/parseFloat(b));\n if(b === \"0\"){\n return \"ERROR\";\n }else{\n return parseFloat(a)/parseFloat(b);\n }\n break;\n }\n}", "title": "" }, { "docid": "c36c8ad3772b3703b7dceeadfe1ea199", "score": "0.7040635", "text": "evaluate(op1, operator, op2) {\n if (operator === '+') {\n return this.parseNumber(op1) + this.parseNumber(op2);\n } else if (operator === '-') {\n return this.parseNumber(op1) - this.parseNumber(op2);\n } else if (operator === '*') {\n return this.parseNumber(op1) * this.parseNumber(op2);\n } else if (operator === '/') {\n return this.parseNumber(op1) / this.parseNumber(op2);\n } else if (operator === '%') {\n return this.parseNumber(op1) % this.parseNumber(op2);\n }\n }", "title": "" }, { "docid": "7492a1625f65e44eda68739c71198deb", "score": "0.70340484", "text": "function performOperator(d1, d2, op){\n switch (op){\n case '+':\n return parseFloat(d2) + parseFloat(d1); // JS be like \"let me just add two strings unless parseFloat\"\n case '-':\n return d2 - d1;\n case '*':\n return d2 * d1;\n case '/':\n return d2 / d1;\n case '^':\n return Math.pow(d2, d1);\n default:\n return null;\n }\n}", "title": "" }, { "docid": "b29d70e94e9a5bd2d64d5e9bc81f8023", "score": "0.703192", "text": "function operation(a, b, operator) {\n if (a != \"\" && operator != \"\" && b != \"\") {\n switch (operator) {\n case \"+\":\n plus(a, b);\n break;\n case \"-\":\n minus(a, b);\n break;\n case \"x\":\n multiply(a, b);\n break;\n case \"/\":\n divide(a, b);\n break;\n }\n }\n}", "title": "" }, { "docid": "5ad7da8a2f8b0d33997b071c7238415c", "score": "0.70267004", "text": "function operate(operator, a, b) {\n a = Number(a);\n b = Number(b);\n switch (operator) {\n case \"+\":\n return add(a, b);\n\n case \"-\":\n return subtract(a, b);\n\n case \"/\":\n return divide(a, b);\n\n case \"X\":\n return multiply(a, b);\n\n default:\n break;\n }\n}", "title": "" }, { "docid": "3b4a63fb7b43ef3a21b0091076844d78", "score": "0.7021098", "text": "function basicop(str, num1, num2) {\n // let defineop = parseInt(str)\n return eval(num1 + str + num2);\n}", "title": "" }, { "docid": "d4085e7cad56c338ee684ab40c58dd21", "score": "0.70201534", "text": "function doMath(num1, num2, operation){\n\t\tnum1 = parseFloat(num1);\n\t\tnum2 = parseFloat(num2);\n\n\t\tif(percentage){\n\t\t\tnum2 = parseFloat(num1 * (num2 / 100));\n\t\t}\n\n\t\tswitch(operation){\n\t\t\tcase '+':\n\t\t\t\treturn num1 + num2;\n\t\t\t\tbreak;\n\t\t\tcase '-':\n\t\t\t\treturn num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase '/':\n\t\t\t\treturn num1 / num2;\n\t\t\t\tbreak;\n\t\t\tcase 'X':\n\t\t\t\treturn num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "82bd9933450aaa264a9fa93ce2b810ff", "score": "0.7012014", "text": "function operate (operator, a,b){\n a= Number(a.join(' '));\n b= Number(b.join (' '));\n if (operator === '+'){return add(a,b);};\n if (operator === '-'){return subtract(a,b);};\n if (operator === '*'){return multiply(a,b);};\n if (operator === '/' && b !==0){return divide(a,b);};\n if (operator === '/' && b ===0){return '!KABOOM!'};\n}", "title": "" }, { "docid": "e6a0a1e21abc0830a99086620a27d8e2", "score": "0.69865716", "text": "function operate(operator, operand1, operand2){\n return operator(operand1, operand2);\n}", "title": "" }, { "docid": "cd9d06f81e5128fd5d84560fe6b0f2cf", "score": "0.6938565", "text": "function calculator (num1 , num2 , operator ) {\r\n if(operator === \"+\")\r\n {\r\n return num1 + num2;\r\n }\r\n else if(operator === \"-\")\r\n {\r\n return num1 - num2;\r\n }\r\n else if(operator === \"*\")\r\n {\r\n return num1 * num2;\r\n }\r\n else if(operator === \"/\")\r\n {\r\n return num1 / num2;\r\n }\r\n else if(operator === \"%\")\r\n {\r\n return num1 % num2;\r\n }\r\n \r\n}", "title": "" }, { "docid": "af82f655dfb0ba08cf1c844b87e87ea3", "score": "0.6908577", "text": "function calculate(num1, operation, num2) {\n //TODO: make a basic calculator.\n switch (operation) {\n case \"+\":\n return num1 + num2;\n case \"-\":\n return num1 - num2;\n case \"*\":\n return num1 * num2;\n case \"/\":\n if (num2 === 0) {\n return null;\n } else {\n return num1 / num2;\n }\n default:\n return null;\n }\n}", "title": "" }, { "docid": "71fa70a1be81bc326a5e81fe5731026c", "score": "0.6890594", "text": "function calculator(num1, operator, num2) {\n\tif(operator == \"*\") {\n\t\treturn num1*num2;\n\t} else if(operator == \"/\") {\n\t\treturn num1/num2;\n\t} else if(operator == \"+\") {\n\t\treturn num1+num2;\n\t} else if(operator == \"-\") {\n\t\treturn num1-num2;\n\t} else if(operator == \"%\") {\n\t\treturn num1%num2;\n\t} else {\n\t\tconsole.log(\"Error\");\n\t}\n}", "title": "" }, { "docid": "976cf8fe8412e58a7fdda96261a7b6c0", "score": "0.6885636", "text": "function operate(a, b, operator) {\n switch(operator) {\n case '+':\n res = add(a, b);\n break;\n case '-':\n res = subtract(a, b);\n break;\n case '*':\n res = multiply(a, b); \n break;\n case('/'):\n res = divide(a, b);\n break; \n } \n\n // TO DO shall look closely into it \n screen.innerHTML = res;\n \n console.log(`Operate after: Result: ${res}, first number ${firstNumber}, enteredNumber ${enteredNumber}, digit count ${digitCount}, operation ${operation}, operation count ${operationCount}`);\n\n}", "title": "" }, { "docid": "71397d6d716b0db8bbb7b8c9d2537920", "score": "0.6881948", "text": "function computeData(op1, op2, op) {\n var result;\n\n // choose the correct operator depending on operator input string\n switch (op) {\n case '/':\n result = op1 / op2;\n break;\n case '*':\n result = op1 * op2;\n break;\n case '+':\n result = op1 + op2;\n break;\n case '-':\n result = op1 - op2;\n break;\n }\n\n // display our computed result in the page\n displayResult(result);\n}", "title": "" }, { "docid": "80939701e7c29ef9e3c36715d7275896", "score": "0.6870529", "text": "function runOperation(operation, numbers) {\n switch (operation) {\n case '+':\n return numbers.reduce((a, b) => (a + b), 0);\n\n case '*':\n return numbers.reduce((a, b) => (a * b), 1);\n\n default:\n throw new Error('bad operation: ' + operation);\n }\n}", "title": "" }, { "docid": "969be431ce5bb36ec5bdb53596fd8b97", "score": "0.68618834", "text": "function operate(operator, a, b){\n\treturn operator(a,b);\n}", "title": "" }, { "docid": "7a2486aeb818e16f33e563676d6be1a0", "score": "0.6847469", "text": "function calculator(num1, operator, num2) {\n\t\n\t\tif(operator == '+') return num1+num2;\n\t\tif(operator == '-') return num1-num2;\n\t\tif(operator == '*') return num1*num2;\n\t\tif(operator == '/' && num2 != 0) return num1/num2;\n\t\telse return \"Can't divide by 0!\";\n\t}", "title": "" }, { "docid": "3f5209c72d18135a2f15b31ccd296a96", "score": "0.6845157", "text": "function answer(){\n if(operation=='+'){\n const ans=Number(num1)+Number(num2)\n display(ans)\n }\n else if(operation=='-'){\n const ans=Number(num1)-Number(num2)\n display(ans)\n }\n else if(operation=='*'){\n const ans=Number(num1)*Number(num2)\n display(ans)\n }\n else if(operation=='/'){\n const ans=Number(num1)/Number(num2)\n display(ans)\n }\noperation=''\n}", "title": "" }, { "docid": "ac071e823209a57c8942a810a1068957", "score": "0.682808", "text": "function doLogic(value1, value2, operator) {\n switch (operator) {\n case \"&&\":\n value = Number(value1 && value2);\n break;\n case \"||\":\n value = Number(value1 || value2);\n break;\n case \"==\":\n value = Number(value1 == value2);\n break;\n default:\n break;\n }\n return value;\n}", "title": "" }, { "docid": "e23c6a4e909e6cef4071b5a3703c5c53", "score": "0.6827794", "text": "function calculator2(operation){\n\tswitch(operation){ \n\t\tcase \"+\": \n\t\treturn function(number1, number2){ return number1 + number2 };\n\t\tbreak; \n\t\tcase \"-\": \n\t\treturn function(number1, number2){ return number1 - number2 };\n\t\tbreak; \n\t\tdefault: \n\t\tconsole.log(\"ERROR\")\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "1883251775d084aa02317284198d168e", "score": "0.68106896", "text": "function calculator(num1, operator, num2) {\n\tif (operator === \"/\" && num2 === 0) {\n\t\treturn \"Can't divide by 0!\";\n\t} else if (operator === \"+\") {\n return num1 + num2;\n\t} else if (operator === \"-\") {\n return num1 - num2;\n\t} else if (operator === \"*\") {\n return num1 * num2;\n\t} else if (operator === \"/\") {\n return num1 / num2;\n\t}\n}", "title": "" }, { "docid": "91fc44fdcb7fff6822f6f18c2f9e74ba", "score": "0.6784125", "text": "function operate(operation, operand1, operand2){\n var x = operators[operation];\n // console.log(operation);\n if(typeof x === \"function\")\n return x(operand1,operand2);\n else throw \"operator not defined\";\n}", "title": "" }, { "docid": "0ae1dfa4304816a11583d1b0f4d252c5", "score": "0.6782591", "text": "function executeOperation(firstOperand, secondOperand, operator) {\n firstOperand = Number(firstOperand);\n secondOperand = Number(secondOperand);\n switch (operator) {\n case '+':\n return checkSize(firstOperand + secondOperand);\n case '–':\n return checkSize(firstOperand - secondOperand);\n case 'x':\n return checkSize(firstOperand * secondOperand);\n case '÷':\n if (!secondOperand) {\n return 'Ouch!';\n }\n else return checkSize(firstOperand / secondOperand);\n }\n\n /* Checks the size of the argument and converts to exponential notation\n * with very large and small values. Returns a string. */\n function checkSize(number) {\n let strNumber = number.toString();\n let absNumber = Math.abs(number);\n\n if (absNumber >= 1e100) return 'Huge!!';\n if (number && absNumber <= 1e-100) return 'Tiny!!';\n if (strNumber.length > 7) {\n strNumber = number.toExponential(2).toString();\n if (strNumber.length > 7) return number.toExponential(1).toString();\n else return strNumber;\n }\n return strNumber;\n }\n }", "title": "" }, { "docid": "efe55a3bfd83c26ee5558897a70d4dbf", "score": "0.67797136", "text": "function calculer2(x, operation, y) {\n var resultat;\n switch (operation) {\n case \"+\":\n resultat = x + y;\n break;\n case \"-\":\n resultat = x - y;\n break;\n case \"*\":\n resultat = x * y;\n break;\n case \"/\":\n resultat = x / y;\n break;\n }\n return resultat;\n}", "title": "" }, { "docid": "9ef2102108e59fdef627e40e6fc4a38f", "score": "0.6754289", "text": "function calculate (a, b, operation){\n if(operation === 'add'){\n return a + b;\n }else if(operation === 'substract'){\n return a - b;\n }else if ( operation === 'multiply'){\n return a*b;\n }else (operation === 'divide')\n return a/b;\n }", "title": "" }, { "docid": "6488f684c126eae87fc2d6bac36a10e2", "score": "0.6721484", "text": "function operate(a,b,operator) {\n if (!(result === 0)) {\n if (operator === \"+\") {output.textContent = sum(result,b)}\n if (operator === \"-\") {output.textContent = subtract(result,b)}\n if (operator === \"*\") {output.textContent = multiply(result,b)}\n if (operator === \"/\") {output.textContent = divide(result,b)}\n }\n else if (result === 0) {\n if (operator === \"+\") {output.textContent = sum(a,b)}\n if (operator === \"-\") {output.textContent = subtract(a,b)}\n if (operator === \"*\") {output.textContent = multiply(a,b)}\n if (operator === \"/\") {output.textContent = divide(a,b)}\n };\n}", "title": "" }, { "docid": "a32eec1abe7aa4930a7f62f441871512", "score": "0.6719246", "text": "function operate (operator, a, b){ \n a = displVals[0]; \n b = displVals[2]; \n operator = displVals[1]; \n if(operator === '+'){ \n return add(a,b); \n } else if (operator === '-'){ \n return subtract(a,b);\n } else if (operator === '*'){ \n return multiply(a,b);\n } else { \t\n return division(a,b);\n } \n}", "title": "" }, { "docid": "2b2cb89b923af7cd2bd77f2022ba5266", "score": "0.6716396", "text": "function calculator (op, num1, num2) { // eslint-disable-line no-unused-vars\n var sum = function (x, y) {\n return x + y\n }\n var subs = function (x, y) {\n return x - y\n }\n var multi = function (x, y) {\n return x * y\n }\n var div = function (x, y) {\n return x / y\n }\n switch (op) {\n case 'suma':\n return sum(num1, num2)\n case 'resta':\n return subs(num1, num2)\n case 'multiplicacion':\n return multi(num1, num2)\n case 'division':\n return div(num1, num2)\n default:\n console.log('Please especify a valid operator!')\n break\n }\n}", "title": "" }, { "docid": "617155f39cbdc4dbb46af4ea57d20adc", "score": "0.6712868", "text": "function operate(operator, a, b) {\n switch (operator) {\n // Floating point rounding trick used for decimal placing\n case \"+\":\n return Math.round((a + b) * 1e12) / 1e12;\n case \"-\":\n return Math.round((a - b) * 1e12) / 1e12;\n case \"×\":\n return Math.round(a * b * 1e12) / 1e12;\n case \"÷\":\n return Math.round(a / b * 1e12) / 1e12;\n case \"%\":\n return Math.round(a % b * 1e12) / 1e12;\n default:\n return `Invalid operator: ${operator}`;\n }\n}", "title": "" }, { "docid": "c49b22fa181575ca8645e168cbafe52d", "score": "0.6695919", "text": "function operation(operator) {\n var screen = document.getElementById('screen');\n if (expecting == \"operator/number\" && performOperation != \"?\") {\n oper2 = parseFloat(screen.value);\n addSubMulDiv(oper2,performOperation);\n performOperation = operator ;\n screen.value = \"\";\n expecting = \"number\";\n }\n \n else if (performOperation == \"?\") {\n oper1 = parseFloat(screen.value);\n performOperation = operator;\n screen.value = \"\";\n expecting = \"number\";\n }\n \n else if (expecting == \"number\" && performOperation != \"?\") {\n performOperation = operator;\n screen.value = \"\";\n } \n}", "title": "" }, { "docid": "588e60752153f9757ec8e83d10e4fa1a", "score": "0.6683232", "text": "function operation(a, b, op) {\r\n\treturn op[0] == 'a'? +a + +b: \r\n\t\t\t\t op[0] == 's'? +a - +b:\r\n\t\t\t\t op[0] == 'd'? b == 0? 'undefined': +a / +b:\r\n\t\t\t\t op[0] == 'm'? +a * +b:\r\n\t\t\t\t 'undefined';\r\n}", "title": "" }, { "docid": "25233b92571c76a1ea73443ed2ffadf5", "score": "0.66809237", "text": "function operate(primary, secondary, operator) {\n let result = window[operator](Number(primary), Number(secondary));\n if (typeof result === \"string\") return result;\n result = +result.toFixed(10);\n return result;\n}", "title": "" }, { "docid": "c9fce50f52991c9589e629327b0b3c0b", "score": "0.6680432", "text": "function calculate( n1 , n2, operation) {\n return operation(n1, n2)\n}", "title": "" }, { "docid": "6e5f8eacc249abd4636d0dd6d277a181", "score": "0.6672273", "text": "function operate(a, operator, b) {\r\n // store the answer in the result variable\r\n let result;\r\n if (operator == '+') {\r\n result = add(a, b);\r\n } else if (operator == '-') {\r\n result = subtract(a, b);\r\n } else if (operator == '*') {\r\n result = multiply(a, b);\r\n } else if (operator == '/') {\r\n result = divide(a, b);\r\n } else {\r\n return\r\n }\r\n // update display\r\n return newDisplay.textContent = result\r\n}", "title": "" }, { "docid": "c3d1144bb117acc53589ab7e8d767eb3", "score": "0.66618145", "text": "function calc(num1, opera, num2){\n if (opera === '+'){\n return num1 + num2\n }\n else if (opera === '='){\n return num1 - num2\n }\n else if (opera === '*'){\n return num1 * num2\n }\n else if (opera === '/'){\n return num1 / num2\n }\nelse{\n return \"incorrect\"\n}\n}", "title": "" }, { "docid": "4962ea124ce5a53c8bc457c5e5dfab20", "score": "0.6659167", "text": "function doOperation (operation) {\r\n\t if (operation == 'plus') {\r\n\t\t return previousNum+currentNum;\r\n\t }\r\n\t else if (operation == 'minus') {\r\n\t\t return previousNum-currentNum;\r\n\t }\r\n\t else if (operation == 'multiply') {\r\n\t\t return previousNum*currentNum;\r\n\t }\r\n\t else if (operation == 'divide') {\r\n\t\t return previousNum/currentNum;\r\n\t }\t\t\t\r\n\t}", "title": "" }, { "docid": "50664a768f2cd71a89774828dd07cf5d", "score": "0.6657925", "text": "function calculator(num1,operator,num2) {\n\treturn {\n\t\t'+': num1 + num2,\n\t\t'-': num1 - num2,\n\t\t'*': num1 * num2,\n\t\t'/': num2 ? num1 / num2 : 'Cannot divide by 0!'\n\t}[operator]\n}", "title": "" }, { "docid": "2d16a2afe15cd91db3a3af1c31a13c91", "score": "0.66465974", "text": "function operate(a, b, action) {\n switch (action) {\n case 'add':\n return add(a, b);\n case 'subtract':\n return subtract(a, b);\n case 'multiply':\n return multiply(a, b);\n case 'divide':\n return divide(a, b);\n default:\n return 'Invalid'\n }\n}", "title": "" }, { "docid": "afc7afeb723664dbde091f67373b4de2", "score": "0.66409546", "text": "function operateAndFormat(number1, number2, operator) {\n var result = 0.0; \n\n switch(operator) {\n case \"*\":\n result = number1 * number2;\n break;\n case \"/\":\n if (number1 > 0) {\n result = number1 / number2;\n }\n break;\n }\n\n return result.toFixed(2);\n }", "title": "" }, { "docid": "32570f4aec2e3c4b5312b563624dd56b", "score": "0.66378546", "text": "function calc(num1,num2,operator){\n var result;\n if(operator===\"+\"){\n result=num1+num2;\n }\n else if(operator===\"-\"){\n result=num1-num2;\n }\n else if(operator===\"*\"){\n result=num1*num2;\n }\n else if(operator===\"/\"){\n result=num1/num2;\n }\n else {\n result='Unknown Operator'\n }\n console.log(result);\n}", "title": "" }, { "docid": "bfad4722a94c0ecf568d4e86c4bc358f", "score": "0.663346", "text": "function doCalc(){\r\n switch (operator) {\r\n case \"+\":\r\n return (number1 + number2).toFixed(2);\r\n break;\r\n case \"-\":\r\n return (number1 - number2).toFixed(2);\r\n break;\r\n case \"/\":\r\n return (number1 / number2).toFixed(2);\r\n break;\r\n case \"*\":\r\n return (number1 * number2).toFixed(2);\r\n break;\r\n default:\r\n return (\"Error\");\r\n }\r\n}", "title": "" }, { "docid": "7b3d6342dc05cabd1d67139fa1c84fc1", "score": "0.6625948", "text": "function calculate() {\n let valOne = numOne.join('')\n let valTwo = numTwo.join('')\n\n if(mathOperator[0] == '+') {\n let answer = parseFloat(valOne) + parseFloat(valTwo)\n setOutput(answer)\n } else if (mathOperator[0] == '-') {\n let answer = parseFloat(valOne) - parseFloat(valTwo)\n setOutput(answer)\n } else if(mathOperator[0] == 'X') {\n let answer = parseFloat(valOne) * parseFloat(valTwo)\n setOutput(answer)\n } else if(mathOperator[0] == '/') {\n let answer = parseFloat(valOne) / parseFloat(valTwo)\n setOutput(answer)\n }\n }", "title": "" }, { "docid": "ae99f3f17fd310e94039f61de847dfb5", "score": "0.6625761", "text": "function applyOperator(operator, vals) {\n var valA = vals[0];\n var result;\n \n if(vals.length === 1) {\n result = operator.calc(parseFloat(valA));\n } else {\n var valB = vals[1];\n result = operator.calc(parseFloat(valB), parseFloat(valA));\n }\n\n return result;\n }", "title": "" }, { "docid": "47d3f231c85827094722808b79a476ec", "score": "0.6620508", "text": "function test(id) {\n let first = parseFloat(document.getElementById(\"op-one\").value);\n let second = parseFloat(document.getElementById(\"op-two\").value);\n switch(id){\n\n \n case \"addition\":\n \n return (first + second);\n \n case \"substraction\":\n \n return (first - second);\n\n case \"multiplication\":\n \n return (first * second);\n \n case \"division\":\n \n return (first / second);\n }\n}", "title": "" }, { "docid": "e36fec06c645a2a397c30fed05b0174b", "score": "0.6617004", "text": "function mathoperation(op) {\n debugger;\n var fvalue = parseInt(document.getElementById(\"no1\").value)\n var svalue = parseInt(document.getElementById(\"no2\").value)\n\n if (op == \"addition\") {\n alert(\"The result of the given input is \" + addition(fvalue, svalue))\n }\n if (op == \"subtraction\") {\n alert(\"The result of the given input is \" + subtraction(fvalue, svalue))\n }\n if (op == \"multiplication\") {\n alert(\"The result of the given input is \" + multiplication(fvalue, svalue))\n }\n if (op == \"division\") {\n alert(\"The result of the given input is \" + division(fvalue,svalue))\n }\n if (op == \"getmod\") {\n alert(\"The result of the given input is \" + getmod(fvalue, svalue))\n }\n\n\n\n function addition(fvalue, svalue) {\n return fvalue + svalue;\n }\nfunction subtraction(fvalue, svalue) {\n return fvalue - svalue;\n }\n function multiplication(fvalue, svalue) {\n return fvalue * svalue;\n }\nfunction division(fvalue, svalue) {\n return fvalue / svalue;\n }\nfunction getmod(fvalue, svalue) {\n return fvalue % svalue;\n }\n}", "title": "" }, { "docid": "b5190fc74d16538b611abe2901cbace3", "score": "0.6613629", "text": "function calculate(operand1, operand2, operator) {\n operand1 = +operand1;\n operand2 = +operand2;\n switch (operator) {\n case '+':\n return operand1 + operand2;\n case '-':\n return operand1 - operand2;\n case 'X':\n return operand1 * operand2;\n case '/':\n return operand1 / operand2;\n default:\n return 0;\n }\n }", "title": "" }, { "docid": "182526bb5d74764b6c2fc1093ea7d469", "score": "0.6605956", "text": "function operate2(operation, operand1, operand2){\n if(typeof operators[operation] === \"function\") {\n return operators[operation](operand1, operand2);\n }\n else throw \"unknown operator\";\n}", "title": "" }, { "docid": "301eb589dbcb8bd63440a54d3343fae4", "score": "0.6604936", "text": "function arithmetic(a, b, operator){\n\tswitch(operator){\n\t\tcase \"add\" :\n\t\t\treturn a + b;\n\t\tcase \"subtract\" : \n\t\t\treturn a - b;\n\t\tcase \"multiply\" : \n\t\t\treturn a * b;\n\t\tcase \"divide\" : \n\t\t\treturn a / b;\n\t}\n\t//your code here!\n}", "title": "" }, { "docid": "6256187ace7eb66ba6f02a23fa000d32", "score": "0.6600496", "text": "operatorLogic(_inputNum1, _operator, _inputNum2) {\n var output;\n var num1 = parseFloat(_inputNum1);\n var num2 = parseFloat(_inputNum2);\n switch (_operator) {\n case '+':\n output = num1 + num2;\n break;\n case '-':\n output = num1 - num2;\n break;\n case 'x':\n output = num1 * num2;\n break;\n case '÷':\n output = num1 / num2;\n break;\n }\n return output;\n }", "title": "" }, { "docid": "6d75208d7946edba287a60dba96caa07", "score": "0.659748", "text": "function arithmetic(operation, op1, op2)\n{\n // \"operation\" is a callback\n return operation(op1, op2);\n}", "title": "" }, { "docid": "42d5e3ea274b994e1dd1240ea7fd87f4", "score": "0.6589127", "text": "function caclculate(firstValue, secondValue, operator) {\n\tlet result = '';\n\tlet firstValueAsNumber = parseFloat(firstValue);\n\tlet secondValueAsNumber = parseFloat(secondValue);\n\tif (operator === 'plus') {\n\t\tresult = firstValueAsNumber + secondValueAsNumber;\n\t} else if (operator === 'minus') {\n\t\tresult = firstValueAsNumber - secondValueAsNumber;\n\t} else if (operator === 'divide') {\n\t\tresult = firstValueAsNumber / secondValueAsNumber;\n\t} else if (operator === 'multiply') {\n\t\tresult = firstValueAsNumber * secondValueAsNumber;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "e15121753207ec8bac52b1951c348667", "score": "0.65799415", "text": "function afficherOperation(nomOperation, operation,nb1,nb2 ){\n return nomOperation + '(' + nb1 + ',' + nb2 + ')'+ '='+operation(nb1,nb2);\n}", "title": "" }, { "docid": "dbd284e9d590810677d89d35f418b2b9", "score": "0.65754557", "text": "function evaluate(first, second, funct) {\r\n if (second === 0 && funct === 'divide') {\r\n return (display.textContent = 'You broke it..');\r\n }\r\n switch (funct) {\r\n case 'add':\r\n return operate(first, second, add);\r\n case 'subtract':\r\n return operate(first, second, subtract);\r\n case 'multiply':\r\n return operate(first, second, multiply);\r\n case 'divide':\r\n return operate(first, second, divide);\r\n\r\n default:\r\n return (display.textContent = 'Uh..oh...');\r\n }\r\n}", "title": "" }, { "docid": "2bc63e879bc724a0f71632fc65318970", "score": "0.6558564", "text": "function myCalculatior(oerator) {\n\n var firstNumber = Number(document.getElementById('firstNumber').value);\n var lastNumber = Number(document.getElementById('lastNumber').value);\n switch (oerator) {\n\n case '+':\n var result = firstNumber+lastNumber;\n document.getElementById('result').value = result;\n break;\n case '-':\n var result = firstNumber-lastNumber;\n\n break;\n case '*':\n var result = firstNumber*lastNumber;\n\n break;\n case '/':\n var result = firstNumber/lastNumber;\n\n break;\n case '%':\n var result = firstNumber%lastNumber;\n\n break;\n\n }\n return result;\n\n}", "title": "" }, { "docid": "9d66508c11fe7e90651512c86f1e906b", "score": "0.65546876", "text": "function calculateSetOperation() {\n\n const operation = operations.find((e) => e.operator === operator);\n\n if (operation) {\n result = operation.fn(operand1, operand2);\n }\n\n if (result === null) {\n console.error('Not implemented or is not a mathematical operator:', operator);\n console.log('Supported operators are: + , - , / , * , p (power) and % (modulo).');\n } else {\n console.log('Result:', result);\n }\n}", "title": "" }, { "docid": "0052ba3a5bed580f8bf06209c0f8b7be", "score": "0.65539813", "text": "function operations(arg1, arg2, arg3) {\n let n1 = Number(arg1);\n let n2 = Number(arg2);\n let operator = arg3;\n let result = 0\n let num = '';\n if (operator == \"+\") {\n result = n1 + n2;\n if (result % 2 == 0) {\n num = \"even\"\n } else {\n num = \"odd\"\n }\n console.log(`${n1} + ${n2} = ${result} - ${num}`);\n }\n else if (operator == \"-\") {\n result = n1 - n2;\n if (result % 2 == 0) {\n num = \"even\"\n } else {\n num = \"odd\"\n }\n console.log(`${n1} - ${n2} = ${result} - ${num}`);\n } else if (operator == \"*\") {\n result = n1 * n2;\n if (result % 2 == 0) {\n num = \"even\"\n } else {\n num = \"odd\"\n }\n console.log(`${n1} * ${n2} = ${result} - ${num}`);\n } else if (operator == \"/\") {\n if (n2 == 0) {\n console.log(`Cannot divide ${n1} by zero`);\n } else {\n result = (n1 / n2).toFixed(2);\n console.log(`${n1} / ${n2} = ${result}`);\n }\n } else if (operator == \"%\") {\n if (n2 == 0) {\n console.log(`Cannot divide ${n1} by zero`);\n } else {\n result = n1 % n2;\n console.log(`${n1} % ${n2} = ${result}`);\n }\n }\n}", "title": "" }, { "docid": "25f58c139e75323b97622dacf31421cb", "score": "0.65421087", "text": "function calculate() {\n const num1 = parseInput(document.querySelector('#num1').value);\n const num2 = parseInput(document.querySelector('#num2').value);\n const operator = document.querySelector('#operator').value;\n\n let result;\n\n if (operator === '+') result = num1 + num2;\n else if (operator === '-') result = num1 - num2;\n else if (operator === '*') result = num1 * num2;\n else if (operator === '/') result = num1 / num2;\n\n document.querySelector('#result').value = result;\n}", "title": "" }, { "docid": "3c8937daf03f7b51fa4977a70a83bc56", "score": "0.6539578", "text": "function maths(one, two, func) {\r\n var answer\r\n one = parseInt(one)\r\n two = parseInt(two)\r\n if (func === \"+\") {\r\n answer = one + two\r\n } else if (func === \"-\") {\r\n answer = one - two\r\n } else if (func === \"/\") {\r\n answer = one / two\r\n } else if (func === \"*\") {\r\n answer = one * two\r\n } \r\n return answer\r\n }", "title": "" }, { "docid": "4c1e06ddc716b90cd68a56b1d0a9359c", "score": "0.65360117", "text": "function bigCalculator (num1, num2, operator){ // this operator can be changed on fly. when it get called.\r\n return operator(num1, num2);\r\n}", "title": "" }, { "docid": "ac7920076fd44887cd4598ff33dbbb06", "score": "0.653335", "text": "function execute(value, operator){\n return operator(value);\n}", "title": "" }, { "docid": "3dbee819d373a8c2034913605640cc54", "score": "0.6531697", "text": "function operate(operator, a, b){\n dict = {\n \"+\": add(a,b),\n \"-\": subtract(a,b),\n \"*\": multiply(a,b),\n \"/\": divide(a,b)\n };\n\n return dict[operator];\n}", "title": "" }, { "docid": "c1f9d978bad71068999d45adbb31c656", "score": "0.6521004", "text": "function arithmetic(a, b, operator){\n //your code here!\n var operators = {\n \"add\" : \"+\",\n \"subtract\": \"-\",\n \"divide\": \"/\",\n \"multiply\":\"*\"\n }\n return eval (a+ operators[operator] + b)\n}", "title": "" }, { "docid": "549d7493e6eb670154b556dff22a4d8e", "score": "0.65209264", "text": "function operate(){\n let result = 0;\n switch(calculator.operator){\n case 'add':\n result = add();\n break;\n case 'divide':\n result = divide();\n break;\n case 'subtract':\n result = subtract();\n break;\n case 'multiply':\n result = multiply();\n break;\n default:\n result = NaN;\n break;\n }\n\n return result;\n}", "title": "" }, { "docid": "fdb769394ae55ba4abc376fac42050fa", "score": "0.65133", "text": "function mathOperation(operator, oneNum, twoNum) {\n\tif (operator === \"+\") {\n\t\toneN = parseInt(oneNum);\n\t\ttwoN = parseInt(twoNum);\n\t\treturn answer = oneN + twoN;\n\t}\n\telse if (operator === \"-\") {\n\t\treturn answer = oneNum - twoNum;\n\t}\n\telse if (operator === \"x\") {\n\t\treturn answer = oneNum * twoNum;\n\t}\n\telse if (operator === \"/\") {\n\t\treturn answer = oneNum / twoNum;\n\t}\n\telse {\n\t\talert(\"Something went wrong. I'm going to reset.\");\n\t\tmathReset();\n\t}\t\n}", "title": "" }, { "docid": "9dde9990ba7d4fa786640621b3b6b114", "score": "0.6508902", "text": "function operate(a,b,operator){\n switch(true){\n case (operator == \"+\"): return a+b;\n case (operator == \"-\"): return a-b;\n case (operator == \"*\"): return a*b;\n case (operator == \"/\"): {\n if(b == 0){\n return document.getElementById(\"display\").value = \"Math Error\";\n }\n return a/b;\n }\n }\n}", "title": "" }, { "docid": "7380d787909d8537032162628c5576af", "score": "0.650059", "text": "function handleNumber(number) { \n\n\n\t\tif (oper === '') { \n\t\t\tfirstNum = Number(String(firstNum) + String(number));\n\t\t} \n\n\t\telse { \n\t\t\tsecondNum = Number(String(secondNum) + String(number)); \n\t\t}\n\t\tshowResult(number);\n\t}", "title": "" }, { "docid": "69acbc70c5edb49eb00acc0b7cc5126e", "score": "0.64994574", "text": "function calculator(num1, num2, callback) {\n return callback(num1, num2)\n}", "title": "" }, { "docid": "167db946194dfe871855767632109e25", "score": "0.6495723", "text": "function calculator(operation,num1,num2)\n{\n switch (operation)\n {\n case 1:\n result=num1+num2;\n console.log(\"the addition is:\"+result);\n break;\n case 2:\n result=num1-num2;\n console.log(\"the subtraction is:\"+result);\n break;\n case 3:\n result=num1*num2;\n console.log(\"the multiplication is:\"+result);\n break;\n case 4:\n result=num1/num2;\n console.log(\"the dividation is:\"+result);\n break;\n default:\n console.log(\"please enter correct option\");\n break;\n }\n}", "title": "" }, { "docid": "013f4fad126cd637021340544a838ab9", "score": "0.6486258", "text": "function operation(theOp)\n{\n\tassert( stateInvariant() );\n\n\t// for each state, do something.\n\tif(STATE_INPUT_NUM1 == state)\n\t{\n\t\tvar inputAIsZero = inputA.indexOf('.') == -1 && (0 == \"\" + eval(inputA));\n\t\tif(\"-\" == theOp && (0 == inputA.length || inputAIsZero))\n\t\t{\n\t\t\tinputA = \"-\";\n\t\t\tstate = STATE_INPUT_NUM1;\n\t\t\tupdateDisplay();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if the first number was being inputted,\n\t\t\t// remember the operator and start inputting the second number.\n\t\t\toperator = theOp;\n\t\t\tstate = STATE_INPUT_NUM2;\n\t\t}\n\t}\n\telse if(STATE_INPUT_NUM2 == state || STATE_SHOWRES == state)\n\t{\n\t\t// if the second number was being inputted,\n\t\t// calculate the result of the the previous sequence,\n\t\t// and assign it to the first number. Then, start \n\t\t// inputting the second number.\n\n\t\tstate = STATE_INPUT_NUM2;\n\n\t\tvar theTempRes = getResult();\n\t\tinputA = theTempRes;\n\t\tinputB = \"\";\n\t\toperator = theOp;\n\n\t\tupdateDisplay();\n\t}\n\telse\n\t{\n\t\terror();\n\t}\n\n\tassert( stateInvariant() );\n}", "title": "" }, { "docid": "8e20eba61163c3e39098095f9b8f64ac", "score": "0.6483236", "text": "function calc(firstnumber, lastnumber, opration) {\n var result1;\n firstnumber = parseInt(firstnumber);\n lastnumber = parseInt(lastnumber);\n\n switch (opration) {\n\n case \"-\":\n result1 = firstnumber - lastnumber;\n break;\n case \"+\":\n result1 = firstnumber + lastnumber;\n break;\n case \"*\":\n result1 = firstnumber * lastnumber;\n break;\n case \"/\":\n result1 = firstnumber / lastnumber;\n break;\n default:\n result1 = \"No opration is entered\";\n break;\n }\n\n return (result1);\n }", "title": "" }, { "docid": "4820e0219a71fb7aad5b533df04e598f", "score": "0.648078", "text": "function operates(operator, a, b) {\n switch(operator){\n case '+':\n return add(a, b);\n case '-':\n return subtract(a, b);\n case '*':\n return multiply(a, b);\n case '/':\n return divide(a, b);\n default:\n return null;\n }\n}", "title": "" }, { "docid": "fff373e73a32909ac78dde432d1d5f98", "score": "0.6476978", "text": "function calculator(){\n\tvar result = arguments[1];\n\t\n\tswitch (arguments[0]){\n\t\tcase 'suma':\n\t\t\tfor (var i = 2; i < arguments.length;i++){\t\t\t\t\n\t\t\t\tresult += arguments[i];\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 'resta':\n\t\t\tfor (var i = 2; i < arguments.length;i++){\n\t\t\t\tresult -= arguments[i];\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 'multiplicacion':\n\t\t\tfor (var i = 2; i < arguments.length;i++){\n\t\t\t\tresult *= arguments[i];\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 'division':\n\t\t\tfor (var i = 2; i < arguments.length;i++){\n\t\t\t\tresult /= arguments[i];\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult = \"La operación no es correcta\"\n\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "d2e89f1c54e99ddc44517c33a0978d5e", "score": "0.6472378", "text": "function Calculator(number1,number2,operation){\r\n if (operation == \"+\"){\r\n document.write(number1+\" \"+operation+\" \"+number2+\" = \"+(number1+number2));\r\n }\r\n else if (operation == \"-\"){\r\n document.write(number1+\" \"+operation+\" \"+number2+\" = \"+(number1-number2));\r\n }\r\n else if (operation == \"*\"){\r\n document.write(number1+\" \"+operation+\" \"+number2+\" = \"+(number1*number2));\r\n }\r\n else if (operation == \"/\"){\r\n document.write(number1+\" \"+operation+\" \"+number2+\" = \"+(number1/number2));\r\n }\r\n else if (operation == \"%\"){\r\n document.write(number1+\" \"+operation+\" \"+number2+\" = \"+(number1%number2));\r\n }\r\n}", "title": "" }, { "docid": "3a5480bbe7930b2db8915eb23759302e", "score": "0.64545196", "text": "function calculate () {\n 'use strict';\n //if (!nOperator2) nOperator2 = nDispValue; //use nOperator2 if it is set\n nOperator2 = nDispValue;\n\n switch(sOperation) {\n case \"+\" : return nOperator1 + nOperator2;\n case \"-\" : return nOperator1 - nOperator2;\n case \"×\" : return nOperator1 * nOperator2;\n case \"÷\" : return nOperator1 / nOperator2;\n default : return null;\n }\n}", "title": "" }, { "docid": "2a1450af2154bf41dc12b336065eeecb", "score": "0.6454426", "text": "function calculator(a,b,sign){\n if ((typeof a === \"number\") && (typeof b === \"number\")) {\n switch (sign) {\n case \"+\":\n return a + b;\n case \"-\":\n return a - b;\n case \"*\":\n return a * b;\n case \"/\":\n return a / b;\n }\n }\n return \"unknown value\";\n}", "title": "" } ]
360ec83e69a6652bc0e45c1840b0d3a7
Regresa un arreglo con la serie completa, al cuadrado, de la serie Fibonacci dado un N
[ { "docid": "b2d285ebc7bae5dcfcdbaa618f241ac8", "score": "0.58859926", "text": "function fibonacciNthArray(n){\n //Init array as in FIBO_INIT\n fiboArray= [0,1]\n fibonacciNth(n)\n return fiboArray\n}", "title": "" } ]
[ { "docid": "59e770c799cb4cad830b1a734962a060", "score": "0.6632184", "text": "function acrescentar_ponto() {\n\n var n = lista_focos.length - 1\n B = lista_focos\n C = Array(n+2)\n \n C[0] = B[0]\n C[n+1] = B[n]\n for (var i = 1; i <= n; i++) {\n var a = i / (n+1)\n C[i] = add(mult(1-a, B[i]), mult(a, B[i-1]))\n }\n\n lista_focos = C;\n atualiza_tela = true;\n\n}", "title": "" }, { "docid": "09de1dbc610ff32e981805a7873f632b", "score": "0.6559379", "text": "function fibTeller(n){\n fiboArray = [0,1]\n for (let i = 2; i<n;i++){\n let latestAddition = fiboArray[i-1]+fiboArray[i-2]\n fiboArray.push(latestAddition)\n }\n return fiboArray\n}", "title": "" }, { "docid": "d3891f9f560d3639be9c8ea7ae2db7b5", "score": "0.6481357", "text": "function fibonacciSeries(num){\n const fibo = [0,1];\n for(let i = 2; i < num; i++){\n fibo[i] = fibo[i-1] + fibo[i-2];\n }\n return fibo;\n}", "title": "" }, { "docid": "b385cfbbe642899d39bbd06d685249c2", "score": "0.6475122", "text": "function fibo(n){\r\n let array=[0,1];\r\n\r\n for(i=2; i<=n; i++){\r\n array[i]=array[i-1]+array[i-2];\r\n \r\n }\r\n return array;\r\n\r\n}", "title": "" }, { "docid": "ec20186870d0ada73c93e5d817e27d17", "score": "0.642126", "text": "function fibonnaci(n) {\n //let newNum - n-1;\n let newArr = [];\n\n for (let i = 0; i < n; i++) {\n\n console.log(newArr, newArr[i - 1], newArr[i - 2]);\n\n newArr.push((newArr[i - 1] || 1) + (newArr[i - 2] || 0))\n }\n\n console.log(newArr);\n\n return newArr.reverse();\n}", "title": "" }, { "docid": "af3298f23602f1258d980209fc2cf237", "score": "0.6418128", "text": "function fibonnaci(n) {\n //let newNum - n-1;\n let newArr = [];\n\n for (let i = 0; i < n; i++) {\n console.log(newArr, newArr[i - 1], newArr[i - 2]);\n\n newArr.push((newArr[i - 1] || 1) + (newArr[i - 2] || 0));\n }\n\n console.log(newArr);\n\n return newArr.reverse();\n}", "title": "" }, { "docid": "34aef8533ead317e3f46a50ca576e227", "score": "0.63918334", "text": "function fibonacci (n){\n const initialNum = [0,1];\n for (let i = 2; i<= n; i++){//iterate through the nth length\n const a = initialNum[i -1];\n const b = initialNum [i-2];\n initialNum.push(a+b);\n }\n return initialNum[n];\n}", "title": "" }, { "docid": "7e3797f41108f6e76da868d09e60bfc2", "score": "0.63439476", "text": "function Fibonacci(){\n let Elemento = Number(prompt(\"¿Hasta que numero quieres llegar en la serie de fibonacci?\"));\n\n let f0 = 0;\n let f1 = 1;\n let f;\n\n for (var n = 0; n <= Elemento; n++) {\n if (n == 0) {\n console.log(\"El elemto 1 de la serie es: 0\");\n }\n if (n == 1) {\n console.log(\"El elemto 2 de la serie es: 1\");\n }\n if (n > 1) {\n f = f0 + f1;\n console.log(\"El elemto \" + n + \" de la serie es: \" + f);\n f0 = f1;\n f1 = f;\n }\n }\n}", "title": "" }, { "docid": "394cb84d61ad8aad024f0d4da1d35475", "score": "0.6333953", "text": "function fibonacci(toto = 0) {\n let results = [];\n\n for (let count = 0; count < toto; count += 1) {\n if (results.length < 2) {\n results.push(count);\n } else {\n results.push(results[results.length - 1] + results[results.length - 2]);\n }\n }\n\n return results;\n}", "title": "" }, { "docid": "a0e547e12c03325b9312e29cddb9988b", "score": "0.6330124", "text": "function nthFibonacci (n) {\n\n let sequence = [0, 1]\n for (let currentIndex = 2; sequence.length < n; currentIndex++) {\n let oneBack = sequence[currentIndex-1]\n let twoBack = sequence[currentIndex-2]\n sequence[currentIndex] = add(oneBack, twoBack)\n }\n console.log(sequence)\n return sequence[n-1]\n \n}", "title": "" }, { "docid": "7846b5e2aa7556dac5dad3920c1a1763", "score": "0.6248661", "text": "function fibonacci(n){\n var fibo = [0, 1];\nfor(var i = 2; i <= n; i++){\n fibo[i] = fibo[i-1] + fibo[i-2];\n // console.log(fibo[i], fibo[i-1], fibo[i-2])\n}\nreturn fibo;\n// console.log(fibo)\n}", "title": "" }, { "docid": "54f93331d9edda25aaa3afe671812676", "score": "0.62480116", "text": "function fiboFindr (number, fibo = [1, 1]) {\n // since the first two values of fibonacci sequence are always the same, we can decrement until 2 instead of 1 or 0\n if (number === 2) return fibo;\n // add precedingNumber1 to precedingNumber2 to fibo\n fibo.push(fibo[fibo.length - 1] + fibo[fibo.length - 2]);\n // call fiboFindr\n return fiboFindr(number - 1, fibo);\n}", "title": "" }, { "docid": "7d7c5b0c8aba1b42da429b91a11e1b4c", "score": "0.6242214", "text": "function fibonacciSeries(num){\n if(typeof num != 'number'){\n return 'ERROR!!!!!! Please give a proper number';\n }\n if(num < 2){\n return 'YOUR NUMBER IS NEGATIVE. Please put positive number';\n }\n const fibo = [0,1];\n for(let i = 2; i < num; i++){\n fibo[i] = fibo[i-1] + fibo[i-2];\n }\n return fibo;\n}", "title": "" }, { "docid": "9709143d4ff447d5baba0349ba251435", "score": "0.62396705", "text": "function fibonacciLinear(limit) {\n let a = 1,\n b = 0,\n sum = 0;\n\n while (a < limit) {\n // with es6 destructor no need to create temporary variable\n [a, b] = [b + a, a];\n\n // check if its even\n if (a % 2 === 0) {\n sum += a;\n }\n }\n\n return sum;\n}", "title": "" }, { "docid": "d4fd7190cdee5064daa3496943c86afa", "score": "0.62228006", "text": "function dynFib(n) {\n const val = [];\n\n for (var i = 0; i <= n; ++i) {\n val[i] = 0;\n }\n\n if (n == 1 || n == 2) {\n return 1;\n } else {\n val[1] = 1;\n val[2] = 2;\n\n for (var i = 3; i <= n; ++i) {\n val[i] = val[i - 1] + val[i - 2];\n }\n\n return val[n - 1];\n }\n }", "title": "" }, { "docid": "af0b6bfc2816b7b64111c08facfd8c90", "score": "0.62145233", "text": "function fibonacci(number) {\n let res = [1, 1];\n for (let i = 2; i < number; i++) {\n res[i] = res[i - 1] + res[i - 2];\n // res.push(res[i - 1] + res[i - 2]);\n }\n\n console.log(res);\n return res[number - 1];\n}", "title": "" }, { "docid": "e253d0a46dfb6c0f317124f7e8d54ebf", "score": "0.6210453", "text": "function fiboSeries(n) {\n let n3;\n let n1 = 0;\n let n2 = 1;\n let fib = [n1, n2];\n\n for (let i = 2; i < n; i++) {\n n3 = n1 + n2;\n fib.push(n3);\n n1 = n2;\n n2 = n3;\n }\n return fib;\n}", "title": "" }, { "docid": "eab44f3d5faba792c94c443d5e3abca6", "score": "0.61897254", "text": "function fib(seq){\n\tvar num = 0;\n\tvar i = 1;\n\tvar arr = [];\n\tvar sum;\n\twhile(num < seq){\n\t\t\n\t\tvar total = num + i;\n\t\tsum = arr.reduce(function(a,b) {return a + b}, 0);\n\t\tif(total > seq){\n\t\t\tbreak;\n\t\t}\n\t\tif(total %2 === 0){\n\t\t\tarr.push(total);\n\t\t}\n\t\tconsole.log(total);\n\t\tnum = i;\n\t\ti = total;\n\t\t\n\t}\n\n\treturn sum;\n}", "title": "" }, { "docid": "84119d350b3ce1315dcff22304efcb15", "score": "0.61840165", "text": "function fibonacci(n) {\n let total = 1\n for (let index = 1; index <= n - 1 + n - 2; index++) {\n total = add(n - 1 + n - 2, total)\n }\n return total\n}", "title": "" }, { "docid": "c2b34e25e84632fc2ccd52c3ca86201d", "score": "0.6182818", "text": "function fibonacci(n){\n if(n == 0){\n return[0];\n }\n else if(n == 1){\n return [0,1];\n }\n else{\n //calulate arry nth element \n var fibo = fibonacci(n-1);\n var nextElement = fibo[n-1] + fibo[n-2];\n fibo.push(nextElement);\n return fibo;\n }\n}", "title": "" }, { "docid": "16d170b2c5b3d4ca9061b9971b2993dd", "score": "0.6154794", "text": "function fiboN (n) {\n // Basis fot fibonacci numbers array\n if (n === 1) {\n return [0, 1];\n } else {\n // Variable that stores given number minus 1, since we already have the first element of the array\n let s = fiboN (n - 1);\n // Pushes the result of the sum of the previous and the second previous element of the array\n s.push(s[s.length - 1] + s[s.length - 2]);\n // Returns the array\n return s;\n }\n}", "title": "" }, { "docid": "d997d6a37eef5b63cd7517512512138a", "score": "0.61473614", "text": "function fibo(n){\n // if (n === 0){\n // return [];\n // }else if (n===1) {\n // return [0];\n // }else if (n===2){\n // return [0,1];\n // }\n\n if (n < 3){\n return [0,1].slice(0, n);\n }\n\n let fibs = fibo(n-1);\n fibs.push(fibs[fibs.length-1] + fibs[fibs.length-2])\n return fibs;\n}", "title": "" }, { "docid": "33437745fde03066d2ca641c50dfad76", "score": "0.61473185", "text": "function nthFibo(n) {\n let fibonacci = [0, 1];\n for (let i = 2; i < n; i++) {\n let sum = fibonacci[i - 1] + fibonacci[i - 2];\n fibonacci.push(sum);\n }\n console.log(fibonacci);\n return fibonacci[n-1];\n}", "title": "" }, { "docid": "766ac17203fb24b68b83cfbd030d5e42", "score": "0.61326015", "text": "function fibonacci(n){\n let x = 0;\n let y = 1;\n let arr = [x,y];\n if (n > 0){\n do {\n y += x;\n x = y - x;\n arr.push(y);\n } while (y < n);\n }\n return arr;\n}", "title": "" }, { "docid": "6e6cf588c3b08e0744fdb86477ecd61d", "score": "0.6132053", "text": "function getFibonacci(num) {\n\tlet fibo = [0, 1];\n\n\tfor (let i = 2; i <= num; i++) {\n\t\t// fibo[i] = fibo[i - 1] + fibo[i - 2];\n\t\tlet currentFibNum = fibo[i - 1] + fibo[i - 2];\n\t\tfibo.push(currentFibNum);\n\t}\n\treturn fibo[num];\n}", "title": "" }, { "docid": "a82aa1d622107c10c5472035448c45bb", "score": "0.6131585", "text": "function fibonacci (n){\n var fibo=[0,1];\n for(var i=2;i<=n; i++){\n fibo[i]= fibo[i-1]+fibo[i-2];\n }\n return fibo;\n}", "title": "" }, { "docid": "d4a0d947362823b3341fcd3988831026", "score": "0.6127461", "text": "function fabonacciNumberEnd(index)\n{\n \n}", "title": "" }, { "docid": "fe9953b65c792d8f5a3252bf2232d3ee", "score": "0.61226046", "text": "function makeFibonacciSeries() {\n\treturn {\n\t\tfibonacci : function fibonacci(n) {\n\t\t\tvar fs = [ 0, 1 ], termN;\n\n\t\t\ttermN = fs[n - 1];\n\n\t\t\tif (typeof termN === 'number') {\n\t\t\t\treturn termN;\n\t\t\t}\n\n\t\t\tfor (var i = 2; i < n; i++) {\n\t\t\t\tfs[i] = fs[i - 1] + fs[i - 2];\n\t\t\t}\n\t\t\t//console.log('fs: ' + fs)\n\t\t\ttermN = fs[n - 1];\n\n\t\t\treturn termN;\n\t\t},\n\n\t\tfibonacciWithRecursion : function fibonacciWithRecursion(n) {\n\n\t\t\tvar fs = [ 0, 1 ], termN;\n\t\t\ttermN = fs[n - 1];\n\n\t\t\tif (typeof termN === 'number') {\n\t\t\t\treturn termN;\n\t\t\t} else if (n > 2) {\n\t\t\t\treturn fibonacciWithRecursion(n - 1)\n\t\t\t\t\t\t+ fibonacciWithRecursion(n - 2)\n\t\t\t} else {\n\t\t\t\treturn 'Input is invalid: ' + n;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "746a8f06da5d37028c462fc133ac3f35", "score": "0.6119755", "text": "function fib(n) {\n let result = [0, 1];\n for (let i = 2; i <= n; i++) {\n calculations3++;\n result.push(result[i - 1] + result[i - 2]);\n }\n return result.pop();\n}", "title": "" }, { "docid": "052dbcae64a4ef59774f14c5c1f93200", "score": "0.61084974", "text": "function fibonacci(n) {\n if (n == 0) {\n return [0]\n } else if (n == 1) {\n return [0, 1];\n } else {\n // calculate array nth element \n var fibo = fibonacci(n - 1);\n var nextElement = fibo[n - 1] + fibo[n - 2];\n fibo.push(nextElement);\n return fibo;\n }\n}", "title": "" }, { "docid": "2a2ae0c7495b3d47b25237df1643adc6", "score": "0.6107136", "text": "function dynamicFib(n) {\n let last = 1,\n prevLast = 1,\n result = 1;\n\n for (let i = 2; i <= n; ++i) {\n result = prevLast + last;\n prevLast = last;\n last = result;\n }\n \n return result;\n }", "title": "" }, { "docid": "9a2fbdf5b79c7e640c636b3bf8bbbfb7", "score": "0.60986376", "text": "function iterativeFibo(n){\n let lastLast=0;\n let last=1;\n for(let i=1; i<n; i++){\n \n \n last += lastLast;\n lastLast = last - lastLast;\n\n }\n return last;\n}", "title": "" }, { "docid": "c41af405e7c4e1d02a1955238956ea5d", "score": "0.60912824", "text": "function getAnyFiboNums(startingNumb) {\n let startingNum = parseFloat(startingNumb); let temp = 0;\n let nextNum = startingNum;\n let fiboNumbers = startingNum;\n for (let i = 0; i < 9; i++) {\n temp = startingNum;\n startingNum = startingNum + nextNum;\n nextNum = temp;\n fiboNumbers += \" \" + nextNum;\n }\n document.getElementById(\"probSevenB\").innerHTML = fiboNumbers;\n}", "title": "" }, { "docid": "bc8d2572094035de9b733a90d940aa41", "score": "0.60903156", "text": "function getFibonacciNumberUpto(num) {\n\n let a = 0, b = 1;\n let FibArray = [];\n FibArray.push(a);\n FibArray.push(b);\n\n while (a + b < num) {\n let sum = a + b;\n FibArray.push(sum);\n a = b;\n b = sum;\n\n }\n return FibArray;\n}", "title": "" }, { "docid": "ebcd8e5ea83b95b74055f6d7dd472336", "score": "0.60898614", "text": "function fibonacci(num) {\n let array = [1, 2]\n let even = [2]\n while (num >= array[array.length-1] + array[array.length-2]){\n array.push(array[array.length-1] + array[array.length-2])\n if(array[array.length - 1] % 2 === 0 && array[array.length - 1] < 4000000) {\n even.push(array[array.length - 1] )\n }\n } \n return even.reduce((a, b) => a + b, 0)\n }", "title": "" }, { "docid": "e1ef5bdb547364068ee534c10f1e4c3d", "score": "0.60861343", "text": "function fibonacciSequence(){\n var sequence = [1,2];\n while(sequence[sequence.length-1]+sequence[sequence.length-2] < 4000000){\n sequence.push(sequence[sequence.length-1]+sequence[sequence.length-2]);\n }\n return sequence;\n}", "title": "" }, { "docid": "ba3dbbcd7e30dd0ec28844cd24f66503", "score": "0.60823554", "text": "function fibo(i){\n if(i ==0){\n\n return 0;\n } //stoping condtion\n if(i ==1 ){\n \n return 1;\n }\n return fibo(i - 1) + fibo(i - 2);\n}", "title": "" }, { "docid": "2d0522522fceb939e9d9487fc110c550", "score": "0.6081594", "text": "function fibonacciSum(num) {}", "title": "" }, { "docid": "b43637e63f342da68ec6751a34f705a0", "score": "0.60815537", "text": "function fibu(n) {\n let sequence = [0,1]\n for (let i = 2; i <= n; i++) {\n sequence.push(sequence[i - 2] + sequence[i - 1]); \n } \n return sequence; \n}", "title": "" }, { "docid": "5b0739d33627f1f87aeaa0c9e0b02779", "score": "0.6075452", "text": "function fibonacci (n) {\n \n let a = 0;\n let b = 1;\n let result = 0;\n \n for (i = 1; i < n-1; i++) {\n result = add(a, b)\n a = b;\n b = result;\n \n } \n return result\n\n}", "title": "" }, { "docid": "68464a7789ada3407050c83d7ecb0f80", "score": "0.60588926", "text": "function fibonacci(e) {\n let result = 0;\n let numA = 0;\n let numB = 1;\n for (let i = 2; i < e; i = add(i, 1)) {\n result= add(numA, numB);\n numA = numB;\n numB = result;\n }\n return result;\n}", "title": "" }, { "docid": "eae328cce02d5468be3a40e4856cd968", "score": "0.60525346", "text": "function fibonacci(n){\n // create an array starting with the values of 0 and 1;\n var sequence = [0,1];\n for(var i = 2; i <= n; i++){\n // every number after the first two is the sum of the two before it\n sequence.push(sequence[i - 2] + sequence[i - 1]);\n }\n return sequence[n];\n}", "title": "" }, { "docid": "7c7af569f255770f2549ef0d39e2275f", "score": "0.60435516", "text": "function fibonacci(length) {\n var arr = [1, 1];\n while (arr.length < length) {\n var first = arr[arr.length-1];\n var second = arr[arr.length-2];\n arr.push(first + second);\n }\n var newArr = [];\n for (var i = 0; i < length; i++) {\n newArr.push(arr[i]);\n }\n return newArr;\n}", "title": "" }, { "docid": "d0eb72dc61a76b3e242cafa84adf35f7", "score": "0.6029102", "text": "function getFiboNums() {\n let startingNum = 1; let temp = 0;\n let nextNum = startingNum;\n let fiboNumbers = startingNum;\n for (let i = 0; i < 9; i++) {\n temp = startingNum;\n startingNum = startingNum + nextNum;\n nextNum = temp;\n fiboNumbers += \" \" + nextNum;\n }\n document.getElementById(\"probSevenA\").innerHTML = fiboNumbers;\n}", "title": "" }, { "docid": "22aa44779e64a843f0c8cd56ae4ed180", "score": "0.6022625", "text": "function fiboM(n) {\n if (n <2) return n;\n\n let curr = 0;\n let next = 1;\n for (const a of range(0,n-1)) {\n [ curr, next ] = [ next, curr + next ];\n };\n return next;\n}", "title": "" }, { "docid": "ef65de8a4e30ce833db4929fc212baf8", "score": "0.60221636", "text": "function fib(n){\n let table=new Arrray(n+1).fill(0)\n getfib(n,table)\n}", "title": "" }, { "docid": "98eaaa2d1eb16f22003e2d93a57c15c4", "score": "0.6018288", "text": "function fibonacciGenerator(n) {\n let current = 0;\n const arr = [];\n for (let i = 0; i < n; i++) {\n arr.push(current);\n current = (arr[arr.length - 1] || 1) + (arr[arr.length - 2] || 0);\n }\n return arr;\n}", "title": "" }, { "docid": "949b514bf725f9463933e908cb018dae", "score": "0.6009961", "text": "function fibonacci(n) {\n\n}", "title": "" }, { "docid": "8d63ee2811ca3903e02e5f6a8d63a122", "score": "0.6007667", "text": "function fibonacci(num){\n let evenNum = [];\n let seqStart = [0,1];\n if (num === 0){\n return seqStart[0]\n }else if(num === 1){\n return seqStart[1]\n }else{\n let i = 2;\n while(i < num){\n let calcNum= seqStart[i-2] + seqStart[i-1]\n seqStart.push(calcNum);\n i++;\n if (calcNum %2===0 && calcNum < 4000000) {\n evenNum.push(calcNum)\n }\n }\n }\n // console.log(evenNum) // produces even number array fibonacci\n // console.log(seqStart) // just produces fibonacci \n return evenNum.reduce(function (a,b) {\n return a + b\n }, 0); // sum of even number array\n }", "title": "" }, { "docid": "572bf11c8f9b26816881ab9741edd282", "score": "0.600608", "text": "function sumFibs(num) {\r\n let sequence = 1;\r\n let sequenceArr = [1,1];\r\n for (let i = 1; i < num; i++){\r\n sequence = sequence + sequenceArr[i - 1];\r\n sequenceArr.push(sequence)\r\n }\r\n //console.log(sequenceArr)\r\n let answer = sequenceArr.filter(current => current % 2 !== 0 && current <= num).reduce(function(total,current){\r\n return current + total\r\n });\r\n \r\n return answer\r\n}", "title": "" }, { "docid": "de8afc37ab043471077d6c2c3943ece1", "score": "0.6003845", "text": "function rFib(num, array=[0,1],index=2) {\n if (num<=array.length-1) {\n array[index]=array[array.length-1]+array[array.length-2];\n return array;\n }\n return rFib(num,array, index+1);\n \n}", "title": "" }, { "docid": "d52f4a7016da70435c2daa142672ba24", "score": "0.60005146", "text": "function fibonacciDynamic(n) {\n const array = [0, 1];\n\n if (n < array.length) return array[n];\n\n for (let i = 2; i <= n; i++) {\n array.push(array[0] + array[1]);\n array.shift();\n }\n\n return array[1];\n}", "title": "" }, { "docid": "1fcd8cec35323a39270a07ed4e049390", "score": "0.59954184", "text": "function fibo(n){\n if(n<2){\n return n;\n }\n return fibo(n-1) + fibo(n-2);\n}", "title": "" }, { "docid": "87b58d84abfe0b40b4c3391ba57f0071", "score": "0.59953475", "text": "function fibonacciSequence(param) {\n var a = 1\n var b = 0\n var summation = 0 \n for (var i = 1; i <= param; i++) { \n summation = summation + a\n var temp = a\n var a = a + b\n var b = temp\n }\n return summation\n}", "title": "" }, { "docid": "c1be0d0df73182bf1b6f056e4505dc75", "score": "0.5993718", "text": "function fibber(num) {\n if (num === 0) return [0];\n if (num === 1) return [0, 1];\n let seq = fibber(num - 1);\n const num1 = seq[seq.length - 1];\n const num2 = seq[seq.length - 2];\n seq.push(num1 + num2);\n return seq;\n}", "title": "" }, { "docid": "4990006488acd3a2b923deaf871a4ce8", "score": "0.5991773", "text": "function fibonacci(n) {\n var fibo = [0, 1];\n for (var i = 2; i <= n; i++) {\n fibo[i] = fibo[i - 1] + fibo[i - 2];\n }\n return fibo;\n}", "title": "" }, { "docid": "4990006488acd3a2b923deaf871a4ce8", "score": "0.5991773", "text": "function fibonacci(n) {\n var fibo = [0, 1];\n for (var i = 2; i <= n; i++) {\n fibo[i] = fibo[i - 1] + fibo[i - 2];\n }\n return fibo;\n}", "title": "" }, { "docid": "4990006488acd3a2b923deaf871a4ce8", "score": "0.5991773", "text": "function fibonacci(n) {\n var fibo = [0, 1];\n for (var i = 2; i <= n; i++) {\n fibo[i] = fibo[i - 1] + fibo[i - 2];\n }\n return fibo;\n}", "title": "" }, { "docid": "9ea693c60d8904d39fc8374c204e4717", "score": "0.5987058", "text": "function fiboDpItr(n, memory=[]){\n memory[0] = 0;\n memory[1] = 1;\n\n for(let i = 2; i<=n; i++){\n memory[i] = memory[i-1] + memory[i-2];\n }\n return memory[n];\n}", "title": "" }, { "docid": "d6681a70b4439c4d58344c4d835b372e", "score": "0.59827447", "text": "function fibonnaci (n) {\n var fib = [1,1]\n for (var i = 2; fib[i-1]+fib[i-2] <= n; i++ ){\n fib[i] = fib[i-1]+fib[i-2];\n }\n return fib.reverse();\n}", "title": "" }, { "docid": "ed0ce9e5afcd01d0e73ce51ae69d8219", "score": "0.5977926", "text": "function fibonacci(num) {\n let result = [];\n for (let i = 1; i <= num; i++) {\n if (i === 1) {\n result.push(0);\n }\n else if (i === 2) {\n result.push(1);\n }\n else {\n result.push(result[i - 2] + result[i - 3]);\n }\n }\n return result;\n}", "title": "" }, { "docid": "5835a358349f39bb673538f02eddfc21", "score": "0.5977854", "text": "function fibonacciGo(num, results) {\n if (num === 0) {\n return;\n }\n\n if (num === 1) {\n return [0, 1];\n }\n\n //let start = [ 1, 1, 2];\n else {\n results = fibonacciGo(num - 1);\n let newNum = results[results.length - 1] + results[results.length - 2];\n results.push(newNum);\n return results;\n }\n}", "title": "" }, { "docid": "ec1ff0b54b4a568cee7024760e4b0696", "score": "0.59757304", "text": "function factorialFibonacci(n){\n return factorialArray(squaredFibonacciNthArray(n))\n}", "title": "" }, { "docid": "21ec59132cc728a5e1d76a988ad048c9", "score": "0.59729433", "text": "function fib(n){\n let arr = [0, 1];\n for (let i = 2; i < n + 1; i++){\n arr.push(arr[i - 2] + arr[i -1])\n }\n return arr[n]\n}", "title": "" }, { "docid": "cfc66fcfc975baa39fe7902de732e5fc", "score": "0.5957392", "text": "function fibonacciIterative(num){\n var fibo = [1, 1];\n for(var i = 2; i<= num; i++){\n var nextfibo = fibo[i-1] + fibo[i-2];\n fibo.push(nextfibo);\n }\n return fibo;\n}", "title": "" }, { "docid": "ecb3587b0c23ce6729066ee57a02a2d8", "score": "0.5957059", "text": "function fiboRecursive(n) {\n\tif (n < 2) {\n\t\treturn n;\n\t}\n\tlet rec = fiboRecursive(n - 2) + fiboRecursive(n - 1);\n\tif (!list1.includes(rec)) list1.push(rec);\n\treturn rec;\n}", "title": "" }, { "docid": "a726e8e4d0781ca653b6957d11f26da2", "score": "0.59553474", "text": "function fibo(n) {\r\n if( n < 2 ) {\r\n return 1;\r\n } else {\r\n return fibo(n-2) + fibo(n-1);\r\n }\r\n}", "title": "" }, { "docid": "40a6d8807d6693f3377d741408848799", "score": "0.59489423", "text": "function dynFib(n) {\n //The val array is where we store intermediate results\n var val = [];\n for (var i = 0; i <= n; ++i) {\n val[i] = 0;\n }\n if (n == 1 || n == 2) {\n return 1;\n }\n else {\n val[1] = 1;\n val[2] = 2;\n for (var i = 3; i <= n; ++i) {\n val[i] = val[i-1] + val[i-2];\n }\n return val[n-1];\n }\n}", "title": "" }, { "docid": "3a11dccc4292fc876d655defeba2c07c", "score": "0.59474826", "text": "function iFibonacci(n) {\n if (n === 0) return 0\n\n let [prev, curr] = [0, 1]\n\n for (let i = 1; i < n; i++) {\n ;[prev, curr] = [curr, prev + curr]\n }\n\n return curr\n}", "title": "" }, { "docid": "0c681f4cbc1b83e5bbba6e69a3d07e63", "score": "0.59449255", "text": "function fibonacci(n) {\n\t\tvar i, sequence = [1, 1]; // We start our sequence at [1, 1]\n\t\tfor (i = 1; i < n - 1; i++)\n\t\t\tsequence.push(sequence[i] + sequence[i - 1]);\n\t\treturn sequence;\n\t}", "title": "" }, { "docid": "ee1b8cc692423bae3014bf7d252ad09c", "score": "0.59425944", "text": "function thousandDigitFibonacci() {\n var index = 2; //2 is the third fibonacci number which is where we are starting\n var arr1 = [1];\n var arr2 = [1];\n var arr3 = [];\n while (arr2.length < 1000) {\n //assign new fibonacci number to arr3\n for (var i = 0; i < arr2.length; i++) {\n if (arr1[i] === undefined) {\n arr1[i] = 0;\n }\n if (arr3[i] === undefined) {\n arr3[i] = 0;\n }\n arr3[i] = arr3[i] + arr1[i] + arr2[i];\n if (arr3[i] >= 10) {\n arr3[i + 1] = (arr3[i] - (arr3[i] % 10)) / 10;\n arr3[i] = arr3[i] % 10;\n }\n }\n index++;\n arr1 = arr2;\n arr2 = arr3;\n arr3 = [];\n }\n return index;\n}", "title": "" }, { "docid": "3fe87d03d89715c71985046892cb6bc5", "score": "0.59402895", "text": "function fibRegular(n){\n\n if (n < 2 ){\n \n return n ; \n \n } \n return fib(n-1) + fib(n - 2);\n}", "title": "" }, { "docid": "41b3a01e10cb73f98cb5de6544294397", "score": "0.59366184", "text": "function fibonacci(n) {\n var fibo = [0, 1];\n\n if (n <= 2) return 1;\n for (var i = 2; i <= n; i++) {\n fibo[i] = fibo[i - 1] + fibo[i - 2];\n }\n\n return fibo[n];\n\n}", "title": "" }, { "docid": "98691c864fd68d085f39428dd248fe40", "score": "0.5933841", "text": "function fibo(n) {\n if (n < 2) return 1;\n else return fibo(n - 2) + fibo(n - 1);\n}", "title": "" }, { "docid": "38fe374e6d9b8fa0ce64279c0adc8501", "score": "0.5933627", "text": "function fibonacci(n){\n var f1=0,f2=1;\n\t\twhile(n>0)\n\t\t{\n\t\t\tconsole.log('fibonacci series = ',f1)\n\t\t\tvar f3=f1+f2;\n\t\t\tf1=f2;\n\t\t\tf2=f3;\n\t\t\tn--;\n\t\t}\n }", "title": "" }, { "docid": "0e7b45109ea4456267453dce65398612", "score": "0.59326106", "text": "function fibonnaci(n) {\n if (n === 0) { return [0]; }\n if (n === 1) { return [0, 1]; }\n\n const previous = fibonnaci(n - 1);\n const currentNumber = previous[previous.length - 2] + previous[previous.length - 1];\n previous.push(currentNumber);\n\n return previous;\n}", "title": "" }, { "docid": "a2f37cddd723628bdf23c771a8bf0dd7", "score": "0.5927281", "text": "function fibonacciRecursive(num){\n //Stopping condition\n if (num == 0) {\n return [1];\n }\n if (num == 1) {\n return [1, 1];\n }\n //Recursive call\n var fibo = fibonacciRecursive(num -1);\n var nextfibo = fibo[num-1] + fibo[num-2];\n fibo.push(nextfibo);\n return fibo;\n}", "title": "" }, { "docid": "34a62111dd570d96605a8232a66f4bee", "score": "0.59231323", "text": "function fib (n){\n const result = [0,1];\n for (let i = 2; i <= n; i++){\n const a = result[i - 1];\n const b = result [i - 2];\n result.push(a + b) //adds an element at the end of the array.\n \n }\n\n var data = result.map((data)=>{\n return data;\n })\n\n console.log(data);\n}", "title": "" }, { "docid": "b9f30e5993a6db1eaecf2f6f0772322c", "score": "0.5921987", "text": "function fibonacci(index){\n var fibValues = [0,1];\n for ( var i = 2; i <=index ; i++){\n fibValues[i] = fibValues[i-1] +fibValues[i-2];\n }\n return fibValues[index];\n}", "title": "" }, { "docid": "e9e25f52bd9483d2fc1a5e9f2b0ee231", "score": "0.59135234", "text": "function fib(n) {\n\tif (n===1) \n {\n return [0, 1];\n } \n else \n {\n var resultsArray = fib(n - 1);\n resultsArray.push(resultsArray[resultsArray.length - 1] + resultsArray[resultsArray.length - 2]);\n return resultsArray;\n }\n}", "title": "" }, { "docid": "fc55a5504be39bf4366b38d8a3416cfc", "score": "0.5913515", "text": "function fib(n) {\n let arr = [];\n for(var i = 0; i < n; i++){\n if(i === 0){\n arr.push(i);\n } else if(i === 1){\n arr.push(i);\n } else {\n arr.push(arr[i - 2] + arr[i - 1]);\n }\n }\n return arr[n-1];\n}", "title": "" }, { "docid": "ccbabb8fb1479394d23052311b089264", "score": "0.59111357", "text": "function fiboRecursive2(n) {\n if (n == 0) {\n return 0;\n } else if (n == 1) {\n return [0, 1];\n } else {\n // calculate array nth element\n var fibo = fiboRecursive2(n - 1);\n var fibo2 = fibo[n - 1] + fibo[n - 2];\n fibo.push(fibo2);\n return fibo;\n }\n}", "title": "" }, { "docid": "5b26b9f7f193c0f47e9d85c62a17a843", "score": "0.5906327", "text": "function fiboncacciUpTo (x) {\n let sequence = [1,1]\n\n do {\n sum = sequence.slice(-2).reduce((total, num) => {\n return total + num\n })\n if (sum > x)\n break\n sequence.push(sum)\n } while (sum < x)\n\n return '\"' + sequence.toString() + '\".'\n}", "title": "" }, { "docid": "556015a64b6a6883c857383f197ffc89", "score": "0.59012717", "text": "function fib(n) {\n const result = [0, 1];\n\n for (let i = 2; i <= n; i++) {\n const a = result[i - 1];\n const b = result[i - 2];\n\n result.push(a + b);\n }\n console.log(result[n]);\n console.log(result.join(', '));\n return result[n];\n}", "title": "" }, { "docid": "29a4438a3599e29f628b16445fe94bca", "score": "0.5886082", "text": "function getFibonacci(numSeq) {\n\t\n\tif ( numSeq === 0) {return 0;}\n\n\tif (numSeq === 1) {return 1;}\n\n\treturn getFibonacci(numSeq-1) + getFibonacci (numSeq-2)\n}", "title": "" }, { "docid": "c87e7a4e1567c24747791ce93083bf40", "score": "0.58763343", "text": "function fibon(n){\n if(n<=1){\n return 1;\n }\nreturn(fibon(n-1)+fibon(n-2))\n}", "title": "" }, { "docid": "6b160111959d6d4dc9cdb185cc3549ac", "score": "0.58744067", "text": "function fibonacci(n) {\n let numMinus1 = 1;\n let numMinus2 = 0;\n let currentNum = 0;\n let outputArray = [];\n\n if (n === 1) {\n outputArray.push(0);\n }\n else {\n outputArray.push(0);\n outputArray.push(1);\n }\n\n for (let i = 0; i <= n-3; i++) {\n currentNum = numMinus1 + numMinus2;\n numMinus2 = numMinus1;\n numMinus1 = currentNum;\n outputArray.push(currentNum);\n }\n\n return outputArray;\n}", "title": "" }, { "docid": "180ba13230d1d25dbcde2ae566191817", "score": "0.586814", "text": "function ex_2_F(n)\n{\n var array=[];\n j=1;\n for(i=0;i<n;i++)\n {\n array[i]=j;\n j+=2;\n }\n\n return array.reduce(function(a,x){return a+x;},0);\n\n}", "title": "" }, { "docid": "1e1d4a11f4b186dc2c76a79102ad2a5f", "score": "0.5864968", "text": "function fibonacci(num) {\n if (num === 0){\n return [0]\n } else if (num === 1) {\n return [0, 1];\n }else {\n fibArr = [0, 1];\n for (let i=2; i< num; i++){\n fibArr.push(fibArr[i-2] + fibArr[i-1]);\n }\n }\n return fibArr;\n\n}", "title": "" }, { "docid": "bb5d020dbbcf2880027b248db0709738", "score": "0.586441", "text": "function fibonnacci(n)\n{\n let arr = [0, 1];\n var a = 0, b = 1, c = 1;\n for(var i = 2; i <= n; i++)\n {\n c = a + b;\n a = b;\n b = c;\n arr.push(c);\n }\n return arr;\n}", "title": "" }, { "docid": "6ed9b43598d4228e31adeccb335b9b9c", "score": "0.58606595", "text": "function Fibonacci(n){\n fibarray=[1];\n for(var i=1;i<n;i++){\n var fib = fibarray.length > 1 ? fibarray[i-1]+fibarray[i-2] : fibarray[i-1];\n fibarray.push(fib);\n }\n return fibarray;\n }", "title": "" }, { "docid": "685ab5375af90cbbdd7e687573113c2e", "score": "0.58576643", "text": "function getFibonacciNumber(index){\n if((!index || index < 0) && index!==0)\n return null\n if(index === 1)\n return 1\n if(index === 0)\n return 0\n return getFibonacciNumber(index-1)+getFibonacciNumber(index-2)\n}", "title": "" }, { "docid": "80caa903943e17c27bb4cf23649d48f2", "score": "0.5857459", "text": "function tribonacci(sig, n) {\n var arr = [];\n arr.unshift(sig[0], sig[1], sig[2]);\n for (var i = 0; i < n; i++) {\n arr[i + 3] = arr[i + 2] + arr[i + 1] + arr[i];\n }\n\n return arr.slice(0, n);\n}", "title": "" }, { "docid": "aefb6c9e94fe37b979362e7c02d701df", "score": "0.58566713", "text": "function ProgressiveFutureValue(a, i, r, n)\n{\n return Sum(a * Math.pow(1.0 + r, n - 1), (1.0 + i) / (1.0 + r), n);\n}", "title": "" }, { "docid": "9cee1d78fa0f8a376f0384ebe5976d12", "score": "0.5853645", "text": "function tribonacci(signature,n) {\n const result = signature.slice(0, n);\n while (result.length < n) {\n result[result.length] = result.slice(-3).reduce((p,c) => p + c, 0);\n }\n return result;\n}", "title": "" }, { "docid": "1a9dd922a8c499802b6de158a891b193", "score": "0.5848568", "text": "function fibSeq(limit) {\r\n var arr = [0, 1];\r\n for (var i = 1; arr[i] <= limit; i++) {\r\n if (arr[i] + arr[i-1] > limit) {\r\n return arr;\r\n }\r\n arr.push(arr[i] + arr[i-1]);\r\n }\r\n}", "title": "" }, { "docid": "d101513666ef0b510daa3c3df778716e", "score": "0.58477825", "text": "function typenum6find() {\n let n = parseInt(document.getElementById(\"typenum7\").value)\n let fibo = Array(2 * n + 1);\n fibo[0] = 0;\n fibo[1] = 1;\n let sum = 0;\n for (i = 2; i <= 2 * n; i++) {\n fibo[i] = fibo[i - 1] + fibo[i - 2];\n if (i % 2 == 0)\n sum += fibo[i];\n }\n document.getElementById(\"typenum6ans\").innerHTML = sum;\n}", "title": "" }, { "docid": "244e3a9d3b1fac2f6d9f159fbc6a068a", "score": "0.5843307", "text": "function fibonaccif() {\n let prev2 = -1;\n let prev1 = 1;\n\n return function() {\n let cur = prev1 + prev2;\n prev2 = prev1;\n prev1 = cur;\n return cur;\n }\n }", "title": "" }, { "docid": "2680537b1b46c1fca6f6eaa71be35e5d", "score": "0.58432835", "text": "function fibonacci(nb) {\n if (nb < 2) {\n return nb;\n }\n return (nb + nb - 1) + fibonacci(nb - 2);\n}", "title": "" }, { "docid": "af910172e911c1eb15693136c254facf", "score": "0.5839905", "text": "function fibonacci(nb) {\n if(nb<2)\n {\n return nb ;\n }\n console.log('fib : ', nb) ;\n return fibonacci(nb-1) + fibonacci(nb-2) ;\n}", "title": "" } ]
883e2aeacc4be8ccff276d723b569de0
SUBMIT FORM TO SERVER
[ { "docid": "cf6f18b5684f86d5540ae3c37235c326", "score": "0.0", "text": "function submitForm() {\n // Initiate Variables With Form Content\n var message = $(\"#message\").val();\n var name = $(\"#name\").val();\n var email = $(\"#email\").val();\n var phone = $(\"#phone\").val();\n console.log(message + \" \" + name + \" \" + email + \" \" + phone);\n\n $.ajax({\n type: \"POST\",\n url: \"php/form-process.php\",\n data: \"message=\" + message + \"&name=\" + name + \"&email=\" + email + \"&phone=\" + phone\n });\n\n $.ajax({\n type: \"POST\",\n url: \"php/contact-conf-email.php\",\n data: \"message=\" + message + \"&name=\" + name + \"&email=\" + email + \"&phone=\" + phone\n });\n}", "title": "" } ]
[ { "docid": "059fded896c30badbd6a0fbd791a6ed0", "score": "0.78521407", "text": "function submitForm () {\n\n node.submit();\n\n }", "title": "" }, { "docid": "6c315de9b2941baccdc6599815d5047f", "score": "0.7709929", "text": "function submitForm() { }", "title": "" }, { "docid": "1f7504861706cac271fb17aeb3c4f992", "score": "0.7227925", "text": "function submitForm() {\n var url = SELECTOR.attr('action');\n formValid = true;\n SELECTOR.submit();\n }", "title": "" }, { "docid": "7dffb16c6197db4ead73cc6b1c82dc94", "score": "0.716248", "text": "function submitForm() {\r\n document.submit_form.submit();\r\n }", "title": "" }, { "docid": "eefdc6485955fd9b45a0d22841e24fc0", "score": "0.71351933", "text": "function submitForm() {\n //var submit_form = document.getElementById(form);\n //submit_form.submit();\n document.inputform.submit();\n}", "title": "" }, { "docid": "971667d3583bae9c69e463d50b099520", "score": "0.7071418", "text": "submit() {\n const form = this.root.querySelector('form');\n Simulate.submit(form);\n }", "title": "" }, { "docid": "9b454e4c4577e4acb68bfe829dd5f1ec", "score": "0.7030024", "text": "function submitForm() {\n let parameters = [];\n for (let i = 0; i < NUM_CONTACT_FIELDS; i++) {\n parameters.push(getByName(FIELDS[i])[0].value);\n }\n for (let i = NUM_CONTACT_FIELDS; i < FIELDS.length; i++) {\n parameters.push(getValuesFromNodeList(getByName(FIELDS[i])));\n }\n $(\"apply\").reset();\n let application = new FormData();\n application.append(\"data\", JSON.stringify(parameters));\n fetch(URL, { method: \"POST\", body: application })\n .then(checkStatus)\n .then(successMessage)\n .catch(showMessage);\n }", "title": "" }, { "docid": "ff9cc24c31b75c9a482ff2831064b518", "score": "0.6948524", "text": "function submitForm() {\n // Get the values from the form and create an object with them\n var name = el(\"form-name\").value;\n var email = el(\"form-email\").value;\n var comments = el(\"form-comments\").value;\n json = {\n \"name\": name,\n \"email\": email,\n \"comments\": comments\n };\n\n // New Request object\n var xhr = new XMLHttpRequest();\n // Get the webpage location\n var loc = window.location;\n // Create an async POST Request\n xhr.open('POST', `${loc.protocol}//${loc.hostname}:${loc.port}/email`, true);\n // Specify the handling of the response\n xhr.onload = function (e) {\n if (this.readyState == 4) {\n setInvisible(\"feedback-form\");\n setVisible(\"feedback-thanks\");\n }\n }\n //handle server errors\n xhr.onerror = function () { displayErrorMessage() }\n // send the request\n xhr.send(asJson(json));\n}", "title": "" }, { "docid": "a4ad2253f5fa7ce23fd4d0f779275190", "score": "0.6946388", "text": "function submitRequestWithForm(frm_action,frm_method,input_fields_value,input_fields_name){\n\t\n}", "title": "" }, { "docid": "936be271571347160690967f227470a9", "score": "0.6914961", "text": "submitForm() {\n this._model.submit();\n }", "title": "" }, { "docid": "8916257cf2abab96372efe9c5397389d", "score": "0.68589205", "text": "function submitForm () {\n\twrapper.find('#submit').trigger('click')\n}", "title": "" }, { "docid": "45b69330b05d1d0037a52636a3eb95f9", "score": "0.68317026", "text": "function submitForm() {\n\n if (okToSend()) { send(); }\n\n else if (!$($form + ' .nos-help').is(':visible') && $($form + ' .nos-untouched[required]').is(':visible')) {\n $($form + ' [data-nos]').each(function () {\n $(this).trigger('change');\n $(this).alterClass('nos-untouched', 'nos-touched');\n });\n if (okToSend()) { send(); }\n }\n\n else {\n $($form + ' .nos-required').is(':visible') && $($form + ' .nos-form-required').nosSlideDown();\n $($form + ' .nos-invalid').is(':visible') && $($form + ' .nos-form-invalid').nosSlideDown();\n $($form + ' [data-nos]').on('change input keyup blur focus paste', function () {\n $($form + ' .nos-invalid').is(':visible') ? $($form + ' .nos-form-invalid').nosSlideDown() : $($form + ' .nos-form-invalid').nosSlideUp();\n $($form + ' .nos-required').is(':visible') ? $($form + ' .nos-form-required').nosSlideDown() : $($form + ' .nos-form-required').nosSlideUp();\n });\n }\n }", "title": "" }, { "docid": "307ae467443a6c8c4053f83ebe759dc4", "score": "0.6824149", "text": "function doSubmit() {\r\n // make sure form attrs are set\r\n var t = $form.attr('target'), a = $form.attr('action');\r\n\r\n // update form attrs in IE friendly way\r\n form.setAttribute('target',id);\r\n if (!method) {\r\n form.setAttribute('method', 'POST');\r\n }\r\n if (a != s.url) {\r\n form.setAttribute('action', s.url);\r\n }\r\n\r\n // ie borks in some cases when setting encoding\r\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\r\n $form.attr({\r\n encoding: 'multipart/form-data',\r\n enctype: 'multipart/form-data'\r\n });\r\n }\r\n\r\n // support timout\r\n if (s.timeout) {\r\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\r\n }\r\n \r\n // look for server aborts\r\n function checkState() {\r\n try {\r\n var state = getDoc(io).readyState;\r\n $.Cafe24_SDK_Log('state = ' + state);\r\n if (state && state.toLowerCase() == 'uninitialized')\r\n setTimeout(checkState,50);\r\n }\r\n catch(e) {\r\n $.Cafe24_SDK_Log('Server abort: ' , e, ' (', e.name, ')');\r\n cb(SERVER_ABORT);\r\n timeoutHandle && clearTimeout(timeoutHandle);\r\n timeoutHandle = undefined;\r\n }\r\n }\r\n\r\n // add \"extra\" data to form if provided in options\r\n var extraInputs = [];\r\n try {\r\n if (s.extraData) {\r\n for (var n in s.extraData) {\r\n extraInputs.push(\r\n $('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\r\n .appendTo(form)[0]);\r\n }\r\n }\r\n\r\n if (!s.iframeTarget) {\r\n // add iframe to doc and submit the form\r\n $io.appendTo('body');\r\n io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\r\n }\r\n \r\n setTimeout(checkState,15);\r\n form.submit();\r\n }\r\n finally {\r\n // reset attrs and remove \"extra\" input elements\r\n form.setAttribute('action',a);\r\n if(t) {\r\n form.setAttribute('target', t);\r\n } else {\r\n $form.removeAttr('target');\r\n }\r\n $(extraInputs).remove();\r\n }\r\n }", "title": "" }, { "docid": "1620eadc2e3930c0ea0cf048d6ab8b57", "score": "0.6813399", "text": "function submitForm() {\n masquerConfiguration();\n afficherMenu();\n afficherChrono();\n afficherScore();\n afficherGrille();\n afficherTrouve();\n initTaille();\n nouvellePartie();\n cliqueCaree();\n premierClique = true;\n memoryGame.doDivFind();\n}", "title": "" }, { "docid": "33b425b0063b05bb112d75a536e14af7", "score": "0.6811703", "text": "submitForm() {\n\t\t// Get the message content:\n\t\tvar msg = \"\" + $(\"#\" + window.aztecs.help.NAME + \"-message\").val();\n\t\tif (msg === \"\") {\n\t\t\talert(\"Please enter a message\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Seng the request:\n\t\twindow.aztecs.requests.handler(\"POST\", \"/slack\", { text: msg }, function() { window.aztecs.location.refresh(); });\n\t}", "title": "" }, { "docid": "893504cfa77e28f7681f7a16804829f5", "score": "0.6796713", "text": "function submit() {\n\t\t\tvar request = new XMLHttpRequest();\n\t\t\trequest.open('POST', '../../spatialsurvey/save.php', true);\n\t\t\trequest.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\t\t\trequest.send(environment.appName + '-data=' + toString());\n\t\t}", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ff2162ff5ca5410f19c6eaa57739b657", "score": "0.6768215", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), \n a = $form.attr2('action'), \n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n form.setAttribute('enctype', et); // #380\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "2f848f94333ea0addf1b0232e47f06d9", "score": "0.67651224", "text": "function submitform(url) {\n req = createXHRobj()\n\n // DO NOT EVER use the same names for javascript variables and\n // HTML element ids, they share the same namespace under IE and\n // may also cause problems in other browsers.\n namevar = encodeURIComponent(document.getElementById('Sender_Name').value)\n emailvar = encodeURIComponent(document.getElementById('Sender_Email').value)\n\n req.open(\"POST\", url, false)\n // req.setRequestHeader() must come AFTER req.open()\n req.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n req.send(\"name=\" + namevar + \"&email=\" + emailvar)\n alert(req.responseText)\n}", "title": "" }, { "docid": "1252d70bd9ca67508d6fec750dd4d130", "score": "0.67607474", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), a = $form.attr2('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "1252d70bd9ca67508d6fec750dd4d130", "score": "0.67607474", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), a = $form.attr2('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "1252d70bd9ca67508d6fec750dd4d130", "score": "0.67607474", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), a = $form.attr2('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method || /post/i.test(method) ) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "17f23d762a147b69c9f13bb2a59ab871", "score": "0.67543113", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'),\n a = $form.attr2('action'),\n mp = 'multipart/form-data',\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n // update form attrs in IE friendly way\n form.setAttribute('target', id);\n if (!method || /post/i.test(method)) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (!s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function () {\n timedOut = true;\n cb(CLIENT_TIMEOUT_ABORT);\n }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState, 50);\n }\n }\n catch (e) {\n log('Server abort: ', e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"' + s.extraData[n].name + '\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"' + n + '\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n }\n if (io.attachEvent) {\n io.attachEvent('onload', cb);\n }\n else {\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState, 15);\n\n try {\n form.submit();\n } catch (err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action', a);\n form.setAttribute('enctype', et); // #380\n if (t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "ad2b071cd1f323757a172f5a91de5fe4", "score": "0.6750303", "text": "function submitProj() {\n //$('btnSubmit').on('click', function () {\n $('form').each(function () {\n post_form_data($(this).serialize());\n });\n window.location.href = '../pages/research.jsp';\n\n}", "title": "" }, { "docid": "5400b7e45f58058924c2e21936a51ce6", "score": "0.6749353", "text": "function formSubmit() {\n}", "title": "" }, { "docid": "7f57f1965e5561d603abe8b4873eae4f", "score": "0.67298865", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n \n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').attr('value',s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "0f925fff4299bff13e21ac4fbf1143b0", "score": "0.67252725", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), a = $form.attr2('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target', id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (!s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function () { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState, 50);\n }\n catch (e) {\n log('Server abort: ', e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"' + s.extraData[n].name + '\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"' + n + '\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState, 15);\n\n try {\n form.submit();\n } catch (err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action', a);\n if (t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "853a0e5e3a3f9f1a6181683d7de0e98a", "score": "0.6721605", "text": "function doSubmit() {\n\t\t\t\t// make sure form attrs are set\n\t\t\t\tvar t = $form.attr2('target'),\n\t\t\t\t\ta = $form.attr2('action'),\n\t\t\t\t\tmp = 'multipart/form-data',\n\t\t\t\t\tet = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n\t\t\t\t// update form attrs in IE friendly way\n\t\t\t\tform.setAttribute('target', id);\n\t\t\t\tif (!method || /post/i.test(method)) {\n\t\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t\t}\n\t\t\t\tif (a !== s.url) {\n\t\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t\t}\n\n\t\t\t\t// ie borks in some cases when setting encoding\n\t\t\t\tif (!s.skipEncodingOverride && (!method || /post/i.test(method))) {\n\t\t\t\t\t$form.attr({\n\t\t\t\t\t\tencoding : 'multipart/form-data',\n\t\t\t\t\t\tenctype : 'multipart/form-data'\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// support timout\n\t\t\t\tif (s.timeout) {\n\t\t\t\t\ttimeoutHandle = setTimeout(function() {\n\t\t\t\t\t\ttimedOut = true; cb(CLIENT_TIMEOUT_ABORT);\n\t\t\t\t\t}, s.timeout);\n\t\t\t\t}\n\n\t\t\t\t// look for server aborts\n\t\t\t\tfunction checkState() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar state = getDoc(io).readyState;\n\n\t\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\t\tif (state && state.toLowerCase() === 'uninitialized') {\n\t\t\t\t\t\t\tsetTimeout(checkState, 50);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlog('Server abort: ', e, ' (', e.name, ')');\n\t\t\t\t\t\tcb(SERVER_ABORT);\t\t\t\t// eslint-disable-line callback-return\n\t\t\t\t\t\tif (timeoutHandle) {\n\t\t\t\t\t\t\tclearTimeout(timeoutHandle);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add \"extra\" data to form if provided in options\n\t\t\t\tvar extraInputs = [];\n\n\t\t\t\ttry {\n\t\t\t\t\tif (s.extraData) {\n\t\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\t\tif (s.extraData.hasOwnProperty(n)) {\n\t\t\t\t\t\t\t\t// if using the $.param format that allows for multiple values with the same name\n\t\t\t\t\t\t\t\tif ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n\t\t\t\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"' + s.extraData[n].name + '\">', ownerDocument).val(s.extraData[n].value)\n\t\t\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"' + n + '\">', ownerDocument).val(s.extraData[n])\n\t\t\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!s.iframeTarget) {\n\t\t\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t\t\t$io.appendTo($body);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (io.attachEvent) {\n\t\t\t\t\t\tio.attachEvent('onload', cb);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tio.addEventListener('load', cb, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tsetTimeout(checkState, 15);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tform.submit();\n\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t// just in case form has element with name/id of 'submit'\n\t\t\t\t\t\tvar submitFn = document.createElement('form').submit;\n\n\t\t\t\t\t\tsubmitFn.apply(form);\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\t\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\t\tform.setAttribute('action', a);\n\t\t\t\t\tform.setAttribute('enctype', et); // #380\n\t\t\t\t\tif (t) {\n\t\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t\t}\n\t\t\t\t\t$(extraInputs).remove();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "a9c70dc748187ac891ea00aaac58af5e", "score": "0.67205524", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').attr('value',s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "a9c70dc748187ac891ea00aaac58af5e", "score": "0.67205524", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').attr('value',s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "4c9100e8228a23b9c8257d14aebd7a14", "score": "0.67150325", "text": "function doSubmit() {\r\n // make sure form attrs are set\r\n var t = $form.attr2('target'), \r\n a = $form.attr2('action'), \r\n mp = 'multipart/form-data',\r\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\r\n\r\n // update form attrs in IE friendly way\r\n form.setAttribute('target',id);\r\n if (!method || /post/i.test(method) ) {\r\n form.setAttribute('method', 'POST');\r\n }\r\n if (a != s.url) {\r\n form.setAttribute('action', s.url);\r\n }\r\n\r\n // ie borks in some cases when setting encoding\r\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\r\n $form.attr({\r\n encoding: 'multipart/form-data',\r\n enctype: 'multipart/form-data'\r\n });\r\n }\r\n\r\n // support timout\r\n if (s.timeout) {\r\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\r\n }\r\n\r\n // look for server aborts\r\n function checkState() {\r\n try {\r\n var state = getDoc(io).readyState;\r\n log('state = ' + state);\r\n if (state && state.toLowerCase() == 'uninitialized') {\r\n setTimeout(checkState,50);\r\n }\r\n }\r\n catch(e) {\r\n log('Server abort: ' , e, ' (', e.name, ')');\r\n cb(SERVER_ABORT);\r\n if (timeoutHandle) {\r\n clearTimeout(timeoutHandle);\r\n }\r\n timeoutHandle = undefined;\r\n }\r\n }\r\n\r\n // add \"extra\" data to form if provided in options\r\n var extraInputs = [];\r\n try {\r\n if (s.extraData) {\r\n for (var n in s.extraData) {\r\n if (s.extraData.hasOwnProperty(n)) {\r\n // if using the $.param format that allows for multiple values with the same name\r\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\r\n extraInputs.push(\r\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\r\n .appendTo(form)[0]);\r\n } else {\r\n extraInputs.push(\r\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\r\n .appendTo(form)[0]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!s.iframeTarget) {\r\n // add iframe to doc and submit the form\r\n $io.appendTo('body');\r\n }\r\n if (io.attachEvent) {\r\n io.attachEvent('onload', cb);\r\n }\r\n else {\r\n io.addEventListener('load', cb, false);\r\n }\r\n setTimeout(checkState,15);\r\n\r\n try {\r\n form.submit();\r\n } catch(err) {\r\n // just in case form has element with name/id of 'submit'\r\n var submitFn = document.createElement('form').submit;\r\n submitFn.apply(form);\r\n }\r\n }\r\n finally {\r\n // reset attrs and remove \"extra\" input elements\r\n form.setAttribute('action',a);\r\n form.setAttribute('enctype', et); // #380\r\n if(t) {\r\n form.setAttribute('target', t);\r\n } else {\r\n $form.removeAttr('target');\r\n }\r\n $(extraInputs).remove();\r\n }\r\n }", "title": "" }, { "docid": "4c9100e8228a23b9c8257d14aebd7a14", "score": "0.67150325", "text": "function doSubmit() {\r\n // make sure form attrs are set\r\n var t = $form.attr2('target'), \r\n a = $form.attr2('action'), \r\n mp = 'multipart/form-data',\r\n et = $form.attr('enctype') || $form.attr('encoding') || mp;\r\n\r\n // update form attrs in IE friendly way\r\n form.setAttribute('target',id);\r\n if (!method || /post/i.test(method) ) {\r\n form.setAttribute('method', 'POST');\r\n }\r\n if (a != s.url) {\r\n form.setAttribute('action', s.url);\r\n }\r\n\r\n // ie borks in some cases when setting encoding\r\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\r\n $form.attr({\r\n encoding: 'multipart/form-data',\r\n enctype: 'multipart/form-data'\r\n });\r\n }\r\n\r\n // support timout\r\n if (s.timeout) {\r\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\r\n }\r\n\r\n // look for server aborts\r\n function checkState() {\r\n try {\r\n var state = getDoc(io).readyState;\r\n log('state = ' + state);\r\n if (state && state.toLowerCase() == 'uninitialized') {\r\n setTimeout(checkState,50);\r\n }\r\n }\r\n catch(e) {\r\n log('Server abort: ' , e, ' (', e.name, ')');\r\n cb(SERVER_ABORT);\r\n if (timeoutHandle) {\r\n clearTimeout(timeoutHandle);\r\n }\r\n timeoutHandle = undefined;\r\n }\r\n }\r\n\r\n // add \"extra\" data to form if provided in options\r\n var extraInputs = [];\r\n try {\r\n if (s.extraData) {\r\n for (var n in s.extraData) {\r\n if (s.extraData.hasOwnProperty(n)) {\r\n // if using the $.param format that allows for multiple values with the same name\r\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\r\n extraInputs.push(\r\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\r\n .appendTo(form)[0]);\r\n } else {\r\n extraInputs.push(\r\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\r\n .appendTo(form)[0]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!s.iframeTarget) {\r\n // add iframe to doc and submit the form\r\n $io.appendTo('body');\r\n }\r\n if (io.attachEvent) {\r\n io.attachEvent('onload', cb);\r\n }\r\n else {\r\n io.addEventListener('load', cb, false);\r\n }\r\n setTimeout(checkState,15);\r\n\r\n try {\r\n form.submit();\r\n } catch(err) {\r\n // just in case form has element with name/id of 'submit'\r\n var submitFn = document.createElement('form').submit;\r\n submitFn.apply(form);\r\n }\r\n }\r\n finally {\r\n // reset attrs and remove \"extra\" input elements\r\n form.setAttribute('action',a);\r\n form.setAttribute('enctype', et); // #380\r\n if(t) {\r\n form.setAttribute('target', t);\r\n } else {\r\n $form.removeAttr('target');\r\n }\r\n $(extraInputs).remove();\r\n }\r\n }", "title": "" }, { "docid": "a35b6bcb41f7ff9b8381e0cdbf76138e", "score": "0.6710957", "text": "function submitForm() {\n const form = id(formId);\n const formData = new FormData(form);\n const xhr = new XMLHttpRequest();\n xhr.open(formMethod, formAction);\n //xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n xhr.onreadystatechange = function () {\n if (xhr.readyState == (4 || XMLHttpRequest.DONE)) {\n if (xhr.status >= 200 && xhr.status < 400) {\n //loading finished //200-299 = success 300-399 = redirect\n var response = parseJSON(this.responseText);\n // console.log(this.responseText);\n if (response === undefined || response.success === undefined) {\n // php/json parse error - fall back message\n msg();\n } else if (response.success === true) {\n // php returns success === true\n msg(true, response.message); // success message\n } else if (response.success === false) {\n // php returns error\n msg(false, response.message); // error message\n }\n } else {\n // http error - display fallback error message\n msg();\n }\n }\n };\n xhr.send(formData);\n }", "title": "" }, { "docid": "3ebcd007e6fca42cdcf74af0e021cf67", "score": "0.67107344", "text": "function formSubmit(){\n\t\tvar url = \"../?event=student.testValidate\";\n\t\tvar data = {};\n\t\tgobalAjaxHandler(url, data, testValidateStatus);\n\t}", "title": "" }, { "docid": "7b0c94300ccb400ce6637afdc6af9550", "score": "0.66852874", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "0d9a26b40018eb0a79a51c404c6e2640", "score": "0.66547817", "text": "function Q_submit(form) {\n return Q.nbind(form.submit, form)();\n}", "title": "" }, { "docid": "1e030eeeb0b3d1f3f202e746ac470c67", "score": "0.66465837", "text": "function doSubmit() {\r\n // make sure form attrs are set\r\n var t = $form.attr('target'), a = $form.attr('action');\r\n\r\n // update form attrs in IE friendly way\r\n form.setAttribute('target',id);\r\n if (!method) {\r\n form.setAttribute('method', 'POST');\r\n }\r\n if (a != s.url) {\r\n form.setAttribute('action', s.url);\r\n }\r\n\r\n // ie borks in some cases when setting encoding\r\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\r\n $form.attr({\r\n encoding: 'multipart/form-data',\r\n enctype: 'multipart/form-data'\r\n });\r\n }\r\n\r\n // support timout\r\n if (s.timeout) {\r\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\r\n }\r\n\r\n // look for server aborts\r\n function checkState() {\r\n try {\r\n var state = getDoc(io).readyState;\r\n log('state = ' + state);\r\n if (state && state.toLowerCase() == 'uninitialized')\r\n setTimeout(checkState,50);\r\n }\r\n catch(e) {\r\n log('Server abort: ' , e, ' (', e.name, ')');\r\n cb(SERVER_ABORT);\r\n if (timeoutHandle)\r\n clearTimeout(timeoutHandle);\r\n timeoutHandle = undefined;\r\n }\r\n }\r\n\r\n // add \"extra\" data to form if provided in options\r\n var extraInputs = [];\r\n try {\r\n if (s.extraData) {\r\n for (var n in s.extraData) {\r\n if (s.extraData.hasOwnProperty(n)) {\r\n // if using the $.param format that allows for multiple values with the same name\r\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\r\n extraInputs.push(\r\n $('<input type=\"hidden\" name=\"'+s.extraData[n].name+'\">').val(s.extraData[n].value)\r\n .appendTo(form)[0]);\r\n } else {\r\n extraInputs.push(\r\n $('<input type=\"hidden\" name=\"'+n+'\">').val(s.extraData[n])\r\n .appendTo(form)[0]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!s.iframeTarget) {\r\n // add iframe to doc and submit the form\r\n $io.appendTo('body');\r\n if (io.attachEvent)\r\n io.attachEvent('onload', cb);\r\n else\r\n io.addEventListener('load', cb, false);\r\n }\r\n setTimeout(checkState,15);\r\n // just in case form has element with name/id of 'submit'\r\n var submitFn = document.createElement('form').submit;\r\n submitFn.apply(form);\r\n }\r\n finally {\r\n // reset attrs and remove \"extra\" input elements\r\n form.setAttribute('action',a);\r\n if(t) {\r\n form.setAttribute('target', t);\r\n } else {\r\n $form.removeAttr('target');\r\n }\r\n $(extraInputs).remove();\r\n }\r\n }", "title": "" }, { "docid": "0a5da75515a37cb1a52b28344245249b", "score": "0.6645146", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\t$io.appendTo('body');\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "221a1bccfb3b645b29fffeea483ed2ab", "score": "0.66416526", "text": "function submitForm() {\n document.getElementById('selectlocation').submit();\n }", "title": "" }, { "docid": "96f94a3d38bdac9e0ad5b1ebc72f6061", "score": "0.6640704", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (!method) {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (a != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\ttimeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n\t\t\t}\n\t\t\t\n\t\t\t// look for server aborts\n\t\t\tfunction checkState() {\n\t\t\t\ttry {\n\t\t\t\t\tvar state = getDoc(io).readyState;\n\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\tif (state.toLowerCase() == 'uninitialized')\n\t\t\t\t\t\tsetTimeout(checkState,50);\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\tlog('Server abort: ' , e, ' (', e.name, ')');\n\t\t\t\t\tcb(SERVER_ABORT);\n\t\t\t\t\ttimeoutHandle && clearTimeout(timeoutHandle);\n\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!s.iframeTarget) {\n\t\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t\t$io.appendTo('body');\n\t\t\t\t\tio.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n\t\t\t\t}\n\t\t\t\tsetTimeout(checkState,15);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a0633f20538af86d4808f79325e91409", "score": "0.66361046", "text": "function submitForm(form) {\r\n var URL = getBaseURL() + \"?\";\r\n for (var key in form) {\r\n URL += key + \"=\" + form[key] + \"&\";\r\n }\r\n URL = encodeURIComponent(URL.substring(0, URL.length - 1));\r\n window.open(URL, \"_self\");\r\n}", "title": "" }, { "docid": "e8aa12db965c5093ce52f5472b1ba752", "score": "0.6629256", "text": "function submit() {\r\n let url = TRAVEL_URL;\r\n let fields = qsa(\"#add input\");\r\n let place = fields[0].value;\r\n let country = fields[1].value;\r\n let interests = qs(\"textarea\").value;\r\n if (place && country && interests) {\r\n let params = new FormData();\r\n params.append(\"place\", place);\r\n params.append(\"country\", country);\r\n params.append(\"interests\", interests);\r\n fetch(url, {method: \"POST\", body: params})\r\n .then(checkStatus)\r\n .catch(console.error);\r\n }\r\n getTable(\"all\");\r\n }", "title": "" }, { "docid": "732b4bcea843e72368c9625ab192909c", "score": "0.66230726", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "732b4bcea843e72368c9625ab192909c", "score": "0.66230726", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "732b4bcea843e72368c9625ab192909c", "score": "0.66230726", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "732b4bcea843e72368c9625ab192909c", "score": "0.66230726", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "732b4bcea843e72368c9625ab192909c", "score": "0.66230726", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "732b4bcea843e72368c9625ab192909c", "score": "0.66230726", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "732b4bcea843e72368c9625ab192909c", "score": "0.66230726", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f3493dddde30fd11b3e10451353296fb", "score": "0.6608622", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target', id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (!s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function () { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state.toLowerCase() == 'uninitialized')\n setTimeout(checkState, 50);\n }\n catch (e) {\n log('Server abort: ', e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n timeoutHandle && clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n extraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"' + n + '\">').attr('value', s.extraData[n])\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n }\n setTimeout(checkState, 15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action', a);\n if (t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "6727fbc39cecf008293b28837ec83275", "score": "0.6601924", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n \n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "6727fbc39cecf008293b28837ec83275", "score": "0.6601924", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n \n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "6727fbc39cecf008293b28837ec83275", "score": "0.6601924", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n \n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "c6e5aefe15938a35a025b648bb70f618", "score": "0.6596368", "text": "function submitForm(e) {\n e.preventDefault();\n\n // Global DB variables.\n var authDev = getInputVal('authDev');\n var macLink = getInputVal('macLink');\n var macName = getInputVal('macName');\n var uploadBy = getInputVal('uploadBy');\n var dateModified = getInputVal('dateModified');\n var accessDM = getInputVal('accessDM');\n var fileSize = getInputVal('fileSize');\n var mailTo = getInputVal('mailTo');\n\n // Push file data into a save.\n saveFile(authDev, macLink, macName, uploadBy, dateModified, accessDM, fileSize, mailTo);\n}", "title": "" }, { "docid": "ae71b19bb2ad8ec0d299e45ff71d8f97", "score": "0.6590467", "text": "submit() {\n }", "title": "" }, { "docid": "78c537fca5245f13c4c5bac5f3180dd1", "score": "0.65903944", "text": "function submitInput(){\n var form = document.getElementById(FORM_TAG_ID);\n form.submit();\n}", "title": "" }, { "docid": "9f8016169d1541378b09814487c4fff1", "score": "0.6582196", "text": "function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr('target'), a = $form.attr('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n timeoutHandle && clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n extraInputs.push(\n $('<input type=\"hidden\" name=\"'+n+'\" />').attr('value',s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n form.submit();\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }", "title": "" }, { "docid": "e84342c7e1cc351a60f49a41eaea0251", "score": "0.6573344", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\tio.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "82ccca5c76e56e15a85922e031aef0e4", "score": "0.6558368", "text": "function submitToHubSpot(data) {\n var $form = $('#hubspot-form form'),\n k;\n\n // Loop through each value and find a matching input.\n // NOTE: Doesn't support checkbox/radio.\n for (k in data) {\n $form.find(\"input[name='\" + k + \"']\").val(data[k]);\n }\n\n $form.submit();\n }", "title": "" }, { "docid": "6a605036cfb7d12dbb21c229d1839b34", "score": "0.6527872", "text": "function submitForm() {\n $(`${config.selectors.scope} form`).submit();\n}", "title": "" }, { "docid": "3acb98a9c164a4f60caba5c105421514", "score": "0.64850557", "text": "function submit() {\n var json = {\n \"Op\" : \"prediction\",\n \"Products\" : products != \"\" ? products : undefined,\n \"Services\" : services != \"\" ? services : undefined,\n\t\t\"type\" : document.getElementById('radio_lifecycle').checked ? \"lifecycle\" : undefined,\n 'Key' : getCookie(\"JSESSIONID\")\n }\n snap = false;\n $('#page_title').html('Create Prediction');\n ws.send(JSON.stringify(json));\n $('#error').html('<i class=\"fa fa-spinner fa-3x fa-spin\" aria-hidden=\"true\"></i><br>Loading, please wait...');\n $('#overlay').show();\n $('#overlay-back').show();\n}", "title": "" }, { "docid": "19798e08f5151afe33c8704a60692a5a", "score": "0.6470252", "text": "static _submitFormToExpressCheckout(response) {\n let form = Form.createForm('mula-express-checkout-submission-form', 'http://localhost/checkout/', 'POST');\n\n form = Form.addFormElement(form, 'countryCode', response.COUNTRY_CODE, 'text');\n form = Form.addFormElement(form, 'accessKey', response.ACCESS_KEY, 'text');\n form = Form.addFormElement(form, 'params', response.PARAMS, 'text');\n\n Form.dynamicallySubmitForm(form);\n }", "title": "" }, { "docid": "71baf5266ced1fd074fad04f86457285", "score": "0.6467458", "text": "function submitForm() {\n if (modePage == 'modif') {\n var tabCli = recup_formulaire(document.clientForm, 'cli');\n x_action_updateClient(tabToString(tabCli), display_fin_modif);\n }\n return false;\n}", "title": "" }, { "docid": "3f1915cfb9ba504f5b85234f30a552fd", "score": "0.64664227", "text": "async function sendSubmitForm(e) {\n e.preventDefault();\n if (submitBtn.classList.length === 1) {\n submitBtn.classList.remove('edit')\n submitBtn.textContent = 'Submit'\n formTemplate.textContent = `Form` \n let title = titleField.value;\n let author = authorField.value;\n //console.log(title);\n // console.log(author);\n titleField.value = '';\n authorField.value = '';\n await fetch(`${url}/${submitBtn.name}`, {\n method: 'PUT',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({ author: author, title: title })\n });\n\n } else {\n let data = new FormData(e.currentTarget);\n await fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n author: data.get('author'),\n title: data.get('title')\n })\n }).catch(e => { console.log(`${e} ->this went wrong`) })\n titleField.value = '';\n authorField.value = '';\n }\n }", "title": "" }, { "docid": "8789a0edc60493d7ca21a4a10a595036", "score": "0.64562696", "text": "function formSubmitted_(form) {\n // Default action is to re-submit to same page.\n const action = form.getAttribute('action') || document.location.href;\n __gCrWeb.common.sendWebKitMessage('FormHandlersMessage', {\n 'command': 'form.submit',\n 'frameID': __gCrWeb.message.getFrameId(),\n 'formName': __gCrWeb.form.getFormIdentifier(form),\n 'href': getFullyQualifiedUrl_(action),\n 'formData': __gCrWeb.fill.autofillSubmissionData(form),\n });\n}", "title": "" }, { "docid": "a49700735b9873ab11758efb62c590f1", "score": "0.64271134", "text": "function doPost(form) {\n buildStringFromResponses();\n sendEmail();\n} // end doPost", "title": "" }, { "docid": "2077b236360823e89dda67788c9f083b", "score": "0.64201164", "text": "onSubmit(e) {\n\t\te.preventDefault();\n\t\tlet inputs = this.form.querySelectorAll('input');\n\t\tlet requestString = '';\n\n\t\tfor( const input of inputs ) {\n\t\t\t// Ignore if empty.\n\t\t\tif (input.value !== '') {\n\t\t\t\t// Create the part of the request URL that will have the form data.\n\t\t\t\trequestString += `&${input.name}=${input.value}`;\n\t\t\t}\n\t\t}\n\n\t\t// Save the request String in the current model.\n\t\tthis.model.set(\"requestString\", requestString);\n\n\t\t// Let the controller know, that we want new data.\n\t\twindow.dispatchEvent(new Event(\"reload data\"));\n\t}", "title": "" }, { "docid": "6a3876f8eef6acddbb4fa92472d28912", "score": "0.64091206", "text": "function submitForm(event) {\n //event.preventDefault();\n var data = grabFormElements(event);\n //console.log(data.company_id);\n if (localStorage.getItem(\"slackToken\") && localStorage.getItem(\"slackChannel\")) {\n $.post(\"https://slack.com/api/chat.postMessage\",\n {\n 'token': localStorage.getItem(\"slackToken\"),\n 'channel': localStorage.getItem(\"slackChannel\"),\n 'text': \"Name: \" + data['first_name'] + \" \" + data['last_name'] + \" Phone Number: \" + data['phone_number']\n },\n function(data, status) {\n });\n }\n socket.emit(ADD_VISITOR, data);\n }", "title": "" }, { "docid": "e2cba4fbd85fc186e651784c1658ce23", "score": "0.6407581", "text": "submit() {\n return module.exports.click(\"button[type='submit']\")\n }", "title": "" }, { "docid": "50c5b5c8878fc30757d72f8b7240eede", "score": "0.64068455", "text": "function submit() {\n setHeading(\"Submitted\");\n }", "title": "" }, { "docid": "fbb03ab9a5d46e78df57029115cbf026", "score": "0.64002186", "text": "function submitForm(e) {\n saveInfo(this.state.curName, this.state.curCompany, this.state.curDetails);\n}", "title": "" }, { "docid": "7998f376610e040e0fe05ccc81382d9e", "score": "0.6394483", "text": "function gui_lai_mail_kich_hoat(){\n\tdocument.forms['form_kich_hoat'].target = \"fr_submit_kich_hoat\";\n\tvar url = \"/ajax/kich_hoat_tai_khoan/gui_lai_mail_kich_hoat/\";\n\tdocument.forms['form_kich_hoat'].action = url;\t\n\tdocument.forms['form_kich_hoat'].submit();\n}", "title": "" }, { "docid": "d317f6f0486e314de2f857adfba3b278", "score": "0.6390712", "text": "function onClickSave() {\n ProjectFormView.getScope().find('.ui.form').submit();\n }", "title": "" }, { "docid": "72d23bf8cd4feb6e6cf113d8b8c7aac5", "score": "0.63905275", "text": "function doSubmit() {\r\n\t\t\t// make sure form attrs are set\r\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\r\n\r\n\t\t\t// update form attrs in IE friendly way\r\n\t\t\tform.setAttribute('target',id);\r\n\t\t\tif (form.getAttribute('method') != 'POST')\r\n\t\t\t\tform.setAttribute('method', 'POST');\r\n\t\t\tif (form.getAttribute('action') != opts.url)\r\n\t\t\t\tform.setAttribute('action', opts.url);\r\n\r\n\t\t\t// ie borks in some cases when setting encoding\r\n\t\t\tif (! opts.skipEncodingOverride) {\r\n\t\t\t\t$form.attr({\r\n\t\t\t\t\tencoding: 'multipart/form-data',\r\n\t\t\t\t\tenctype: 'multipart/form-data'\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// support timout\r\n\t\t\tif (opts.timeout)\r\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, opts.timeout);\r\n\r\n\t\t\t// add \"extra\" data to form if provided in options\r\n\t\t\tvar extraInputs = [];\r\n\t\t\ttry {\r\n\t\t\t\tif (opts.extraData)\r\n\t\t\t\t\tfor (var n in opts.extraData)\r\n\t\t\t\t\t\textraInputs.push(\r\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+opts.extraData[n]+'\" />')\r\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\r\n\r\n\t\t\t\t// add iframe to doc and submit the form\r\n\t\t\t\t$io.appendTo('body');\r\n\t\t\t\t$io.data('form-plugin-onload', cb);\r\n\t\t\t\tform.submit();\r\n\t\t\t}\r\n\t\t\tfinally {\r\n\t\t\t\t// reset attrs and remove \"extra\" input elements\r\n\t\t\t\tform.setAttribute('action',a);\r\n\t\t\t\tt ? form.setAttribute('target', t) : $form.removeAttr('target');\r\n\t\t\t\t$(extraInputs).remove();\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "f2cbfbddb5940774eaa3e96674084989", "score": "0.6386612", "text": "function gui_mail_lay_lai_mat_khau(){\n\tdocument.forms['form_lay_lai_mat_khau'].target = \"fr_submit_lay_lai_mat_khau\";\n\tvar url = \"/ajax/lay_lai_mat_khau/gui_mail_lay_lai_mat_khau/\";\n\tdocument.forms['form_lay_lai_mat_khau'].action = url;\t\n\tdocument.forms['form_lay_lai_mat_khau'].submit();\n}", "title": "" }, { "docid": "cc8fda0a1f531859c42c391898839b34", "score": "0.6383362", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST')\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\tif (form.getAttribute('action') != opts.url)\n\t\t\t\tform.setAttribute('action', opts.url);\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! opts.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (opts.timeout)\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, opts.timeout);\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (opts.extraData)\n\t\t\t\t\tfor (var n in opts.extraData)\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+opts.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tt ? form.setAttribute('target', t) : $form.removeAttr('target');\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cc8fda0a1f531859c42c391898839b34", "score": "0.6383362", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST')\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\tif (form.getAttribute('action') != opts.url)\n\t\t\t\tform.setAttribute('action', opts.url);\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! opts.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (opts.timeout)\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, opts.timeout);\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (opts.extraData)\n\t\t\t\t\tfor (var n in opts.extraData)\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+opts.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tt ? form.setAttribute('target', t) : $form.removeAttr('target');\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "14d97c73b9cc87945d8ffac7b725c475", "score": "0.63826674", "text": "function eliSubmit(formid){\n eli(formid).submit();\n}", "title": "" }, { "docid": "959321840b66ae5d1ea875ca00af442c", "score": "0.6379869", "text": "function do_submit()\n {\n document.frmMain.submit();\n }", "title": "" }, { "docid": "949c62fd045e66cf6cc511b79f7385e8", "score": "0.63707566", "text": "function submitForm() {\n\t\tevent.preventDefault();// Stop form from continueing\n\t\t\n\t\t//Load form values into variables\n var formName = document.getElementById('name').value;\n var formEmail = document.getElementById('email').value;\n var formDate = document.getElementById('datepicker').value;\n\t\tvar formMessage = document.getElementById('message').value;\n\t\n\t\t//Hide the form, show the invoices\n\t\tdocument.getElementById(\"form\").style.display = \"none\";\n document.getElementById('hidebooking').style.display = \"block\";\n\t\t\n\t\t//Load variable values into the invoice\n\t\tdocument.getElementById('displayname').innerHTML = formName;\n\t\tdocument.getElementById('displayemail').innerHTML = formEmail;\n\t\tdocument.getElementById('displaydate').innerHTML = formDate;\n\t\tdocument.getElementById('displaymessage').innerHTML = formMessage;\n return false; // Stop form submission.\n\n }", "title": "" }, { "docid": "f52dbd3519cb8cdcd2f69c4c90d29983", "score": "0.6362877", "text": "function ntv_quan_tri_gia_han_ds_ttv(){\n\tdocument.forms['form_ds_ttv'].target = \"fr_submit_ds_ttv\";\n\tvar url = \"/ajax/ntv_quan_tri_tin_tim_viec/thao_tac_ds_ttv/gia_han\";\n\tdocument.forms['form_ds_ttv'].action = url;\t\n\tdocument.forms['form_ds_ttv'].submit();\n}", "title": "" }, { "docid": "530a6cc9d8b574032383146365772b37", "score": "0.63607365", "text": "function doSubmit() \r\n{\r\n\t$('divMsg').hide();\r\n $('frmDeal').action = UrlConfig.BaseUrl + '/ajaxaschool/dealwatchclassnote';\r\n $('frmDeal').request({\r\n onCreate : function() {\r\n \t$('btnSubmit').disable();\r\n },\r\n timeout: 30000,\r\n onSuccess : function(response) {\r\n\t\t\ttry { \r\n\t\t\t\tif (response.responseText != '' && !isNaN(response.responseText)) { \r\n\t\t\t\t\t$('divMsg').update('選択した' + response.responseText + '件の処理が完了しました。');\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$('divMsg').update('Error:エラーが出ました。');\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$('divMsg').show();\r\n\t\t\t\tnew Effect.Fade('divMsg', { duration: 3.0 });\t\t\t\t\t\t\r\n\t\t\t\t$('divMsg').scrollTo();\r\n\t\t\t \r\n\t\t\t new PeriodicalExecuter(function(pe) {\r\n pe.stop();\r\n changePageAction($F('pageIndex'));\r\n $('btnSubmit').enable();\r\n \t}, 3);\r\n\t\t\t \r\n\t\t\t} catch (e) {\r\n\t\t\t //alert(e);\r\n\t\t\t}\r\n }\r\n });\r\n}", "title": "" }, { "docid": "7b783e70cfaf814f3213c8a7c6a1175a", "score": "0.63525414", "text": "function doi_mat_khau(){\n\tdocument.forms['form_doi_mat_khau'].target = \"fr_submit_doi_mat_khau\";\n\tvar url = \"/ajax/doi_mat_khau/doi_mat_khau/\";\n\tdocument.forms['form_doi_mat_khau'].action = url;\t\n\tdocument.forms['form_doi_mat_khau'].submit();\n}", "title": "" }, { "docid": "7fe36b6e0990fade97c3d6a79688182c", "score": "0.6342182", "text": "function submitForm(field)\n{\n\tdoWithForm(field, {isSubmitForm : true});\n}", "title": "" }, { "docid": "2ea0cf3807be2e5cf8bd8001cc949f43", "score": "0.6338354", "text": "function submit() {\n\n}", "title": "" }, { "docid": "2ea0cf3807be2e5cf8bd8001cc949f43", "score": "0.6338354", "text": "function submit() {\n\n}", "title": "" }, { "docid": "d7d0e2ff263087bb7acaa6e7bd01b6c7", "score": "0.6330516", "text": "function formSubmit() {\n // Find blanks\n findBlankInputs();\n // Check dates\n validateDates();\n // Check warranty based on valid dates\n validateWarranty();\n // Validate each field using relevant args which were set in the top of the code\n validateField(postcode.DOM_id, postcode.regex, postcode.error_id, postcode.error_message);\n validateField(firstname.DOM_id, firstname.regex, firstname.error_id, firstname.error_message);\n validateField(lastname.DOM_id, firstname.regex, lastname.error_id, firstname.error_message);\n validateField(IMEInumber.DOM_id, IMEInumber.regex, IMEInumber.error_id, IMEInumber.error_message);\n validateField(email.DOM_id, email.regex, email.error_id, email.error_message);\n validateField(phnum.DOM_id, phnum.regex, phnum.error_id, phnum.error_message);\n // If user hasn't already added phone, add it before form submission\n addCourtesyphone();\n // Final function call which eventuates with loading invoice on success=true\n getAllData();\n }", "title": "" }, { "docid": "b00e535b71a502ede82e51b2ecb9d1d7", "score": "0.63293535", "text": "function submitForm() {\n $('#logonForm').submit();\n}", "title": "" }, { "docid": "a06ba6a104cad7dfa73d1f4eb6877611", "score": "0.6323631", "text": "function submitForm(action)\n{\n\tfrm = document.getElementById(\"installForm\");\n\tfrm.task.value = action;\n\tfrm.submit();\n}", "title": "" }, { "docid": "d2265cb37ea99364e072b02b9276084e", "score": "0.63220066", "text": "function submit(){\n $('#planner-options-submit').button('loading'); //load button\n hideForm(); //hide the form... \n $('#planner-options-desc').html(''); //initialize options\n var plannerreq = makePlanRequest(); //get the request info from the form\n var summary = $('<h4></h4>'); //Set iterinary request summary to display to user while waiting for API to execute\n summary.append('<b>'+Locale.from+'</b> '+plannerreq.fromPlace+'</br>');\n summary.append('<b>'+Locale.to+'</b> '+plannerreq.toPlace);\n $('#planner-options-desc').append(summary); \n $('#planner-options-desc').append('<h5>'+getPrettyDate() +', '+getTime()+'</h5>'); //Add datetime info to load screen\n if (parent && Modernizr.history){ // Need parent node and ability to remember inputs\n parent.location.hash = jQuery.param(plannerreq);\n history.pushState(plannerreq, document.title, window.location.href);//Remember the user input in case he goes back to the form.\n planItinerary(plannerreq);//Go to the itinerary planner to make API call.\n }\n}", "title": "" }, { "docid": "21c8ff79f4cb28927f21d97fda365153", "score": "0.63181204", "text": "function submit() {\n var contactUsForm = app.getForm('contactus');\n\n var contactUsResult = contactUsForm.handleAction({\n send: function (formgroup) {\n // Change the MailTo in order to send to the store's customer service email address. It defaults to the\n // user's email.\n var Email = app.getModel('Email');\n return Email.get('mail/contactus', formgroup.email.value)\n .setFrom(formgroup.email.value)\n .setSubject(formgroup.myquestion.value)\n .send({});\n },\n error: function () {\n // No special error handling if the form is invalid.\n return null;\n }\n });\n\n if (contactUsResult && (contactUsResult.getStatus() === Status.OK)) {\n app.getView('CustomerService', {\n ConfirmationMessage: 'edit'\n }).render('content/contactus');\n } else {\n app.getView('CustomerService').render('content/contactus');\n }\n}", "title": "" }, { "docid": "05400153a3ccc0fdf373f69a1f3e7241", "score": "0.6302866", "text": "function submitFn() {\r\n\t\t\t\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\t\t\t\tvar contentWrap = form.find('.contentWrap');\r\n\t\t\t\t\t\t\t\tvar jsonCombine = $(document.createElement('textarea')).attr('name', 'Contents').html(jsonConvert(contentWrap)).hide();\r\n\t\t\t\t\t\t\t\tcontentWrap.find('input, textarea, select, radio').attr('name', \"\");\r\n\t\t\t\t\t\t\t\tjsonCombine.appendTo(form);\r\n\r\n\t\t\t\t\t\t\t\tseajs.use('upload', function (u) {\r\n\t\t\t\t\t\t\t\t\tnew u.Upload({\r\n\t\t\t\t\t\t\t\t\t\tform: form,\r\n\t\t\t\t\t\t\t\t\t\taction: A.main.config.action.add,\r\n\t\t\t\t\t\t\t\t\t\tcallback: function (data, node) {\r\n\t\t\t\t\t\t\t\t\t\t\tif (data.success === true) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tlocation.reload();\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\talert(data.message);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "f7faa331b637846bc875a0fb059c5602", "score": "0.62907684", "text": "function Contactform() {\n \n // configuring the submit button\n let SendButton = document.getElementById(\"sendButton\");\n SendButton.onclick = OutputFormDataToConsole();\n }", "title": "" }, { "docid": "387520385d29f38f370165f6a9e0a9e6", "score": "0.6290062", "text": "function submitFn() {\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t//id field only exists for modify, let server supply information\r\n\t\t\t\t\t\t\tvar idField = $('<input type=\"text\" name=\"data-id\" value=' + id + \"/>\");\r\n\r\n\t\t\t\t\t\t\tidField.appendTo(form);\r\n\r\n\t\t\t\t\t\t\tseajs.use('upload', function (u) {\r\n\t\t\t\t\t\t\t\tnew u.Upload({\r\n\t\t\t\t\t\t\t\t\tform: form,\r\n\t\t\t\t\t\t\t\t\taction: A.main.config.action.add,\r\n\t\t\t\t\t\t\t\t\tcallback: function (data, node) {\r\n\t\t\t\t\t\t\t\t\t\tif (data.success === true) {\r\n\t\t\t\t\t\t\t\t\t\t\tlocation.reload();\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\talert(data.message);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}", "title": "" } ]
8021d949f95171b39d5f3375308ac098
const weights = nj.random([MOVIE_FEATURE_SIZE 3, 2]);
[ { "docid": "3f22b85bf8dd0684d391911ca6473331", "score": "0.0", "text": "function getRecommendations(likes) {\n const userFeatures = nj.concatenate(mergeMovieFeatures(likes), nj.zeros([MOVIE_FEATURE_SIZE]));\n const results = movies.map((movie) => {\n const movieFeature = nj.array(movie.feature);\n const userMovieFeatures = nj.concatenate(userFeatures, movieFeature);\n const x = nj.array([userMovieFeatures.valueOf()]);\n const y = nj.dot(x, weights);\n const like = y.get(0, 0);\n const dislike = y.get(0, 1);\n const result = {\n id: movie.id,\n title: movie.title,\n img: movie.images.large,\n rate: {\n like,\n dislike,\n value: like - dislike\n }\n };\n return result;\n });\n results.sort((a, b) => b.rate.value - a.rate.value);\n return results;\n}", "title": "" } ]
[ { "docid": "d9c4f9968bdb3cd645a62ce2bdc67f3d", "score": "0.69225603", "text": "getRandomWeight(weights){\n let weightSum = 0;\n weights.forEach(weight => weightSum += weight)\n\n return parseInt(random(weightSum)) + 1;\n }", "title": "" }, { "docid": "77236828c56ce4f97bbd29ffee2c312e", "score": "0.6805594", "text": "function weightedRandom(arrayOfWeightedData) {\n \n}", "title": "" }, { "docid": "e5a138f82931acc0473b8fab9d5ff99e", "score": "0.67498857", "text": "randomWeights(){\n for(let i = 0; i < this.rows; i++){\n for(let j = 0; j < this.columns;j++){\n this.data[i][j] = Math.random() * 2 - 1;\n }\n }\n }", "title": "" }, { "docid": "d8ef4afe7b79becc2ce233be839eb793", "score": "0.6746142", "text": "randomWeights() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n this.data[i][j] = Math.random() * 2 - 1;\n }\n }\n }", "title": "" }, { "docid": "1e078844423ea023ceb1aa3ffeaf5959", "score": "0.67144793", "text": "randWeights() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n this.data[i][j] = Math.random() * 2 - 1;\n }\n }\n }", "title": "" }, { "docid": "1a9e1f238523ab5a7dacda398b2ca41e", "score": "0.6669295", "text": "static randomWeight() {\r\n return (Math.random() * 2.0) - 1.0;\r\n }", "title": "" }, { "docid": "823b06b85d223519fcdc78c0cc0b9f5b", "score": "0.65156955", "text": "constructor(size) {\n this.weights = new Array(size).fill(0);\n this.lr = 0.1;\n\n /*/ Define de forma aleatória os pesos para cada entrada/*/\n for (let i in this.weights) {\n this.weights[i] = Math.round(Math.random()) ? 1 : -1;\n }\n }", "title": "" }, { "docid": "e113d9cb70c38d4c3741ec5cd554598b", "score": "0.6449133", "text": "function randomizeWeights(url) {\n fetch(url)\n .then((response) => response.json())\n .then((json) => {\n // Rename attention_weights to global_attention\n json[\"global_weights\"] = json[\"attention_weights\"];\n delete json[\"attention_weights\"];\n\n // Copy the global weights over.\n json[\"local_weights\"] = JSON.parse(JSON.stringify(json[\"global_weights\"]));\n\n // Randomize them.\n for (let layer = 0; layer < json[\"local_weights\"].length; layer++) {\n const heads = json[\"local_weight_\"][layer][0];\n for (let head = 0; head < heads.length; head++) {\n const weights = heads[head];\n for (let step = 0; step < weights.length; step++) {\n const values = weights[step];\n for (let i = 0; i < values.length; i++) {\n // Change this value slightly.\n values[i] += mm.tf.randomNormal([1], 0, 0.2).get(0);\n }\n }\n\n }\n }\n console.log(JSON.stringify(json));\n });\n}", "title": "" }, { "docid": "fbd3cc416921e5305a401d72c45758c1", "score": "0.6392444", "text": "function randomFeatures() {\n var features = [];\n for(var i = 0; i < numFeatures; i++){\n features[i] = Math.floor(Math.random() * numTraits);\n }\n return features;\n}", "title": "" }, { "docid": "56d3506d9b57cfafb7cb102073170abb", "score": "0.6343308", "text": "function weightBuilder(leftLayer, rightLayer) {\n var i = 0;\n var weightsNeeded = leftLayer * rightLayer;\n var weights = []\n while (i < weightsNeeded) {\n weights.push(Math.random() - 0.5);\n i++;\n }\n return weights;\n}", "title": "" }, { "docid": "f6734ba28398ad7b92a6c5a750cdc889", "score": "0.63300365", "text": "_createWeights() {\n assert (this._layers.length >= 2, \"You must have at least 2 layers\");\n\n let toRet = [null];\n let prevNodes = this._layers[0].numNodes;\n let currNodes, totalNodes, currArray, currVector, currMatrix, currLayer;\n\n for (let i = 1; i < this._layers.length; i++) {\n currLayer = this._layers[i];\n currNodes = currLayer.numNodes;\n\n if (currLayer.hasBias) {\n prevNodes++;\n }\n\n totalNodes = prevNodes * currNodes;\n\n currArray = [];\n\n for (let i = 0; i < totalNodes; i++) {\n currArray[i] = this._weightInitializer.createRandomWeight(prevNodes, currNodes);\n }\n\n currVector = new Vector(currArray);\n currMatrix = new Matrix(currVector, {shape: [prevNodes, currNodes]});\n toRet[i] = currMatrix;\n prevNodes = currNodes;\n }\n\n return toRet;\n }", "title": "" }, { "docid": "e16951fd5e4da91921baf074debbdc7f", "score": "0.61895293", "text": "getWeights() {\n const weightsCount = this.getWeightsCount()\n\n const result = prefilledVector(weightsCount, 0.0)\n\n let k = 0;\n\n for (var i = 0; i < this.inputHiddenWeights.length; ++i) {\n for (var j = 0; j < this.inputHiddenWeights[0].length; ++j) {\n result[k++] = this.inputHiddenWeights[i][j]\n }\n }\n\n for (var i = 0; i < this.hiddenBiases.length; ++i) {\n result[k++] = this.hiddenBiases[i]\n }\n\n for (var i = 0; i < this.hiddenOutputWeights.length; ++i) {\n for (var j = 0; j < this.hiddenOutputWeights[0].length; ++j) {\n result[k++] = this.hiddenOutputWeights[i][j]\n }\n }\n\n for (var i = 0; i < this.outputBiases.length; ++i) {\n result[k++] = this.outputBiases[i]\n }\n\n return result\n }", "title": "" }, { "docid": "4c014fb27c11e7d334a6853cc0a133a2", "score": "0.6182828", "text": "constructor(weightsNumber,activation) {\r\n this.output = 0;\r\n this.weights = [];\r\n this.inputs = [];\r\n\r\n //Enumerator\r\n this.activation = activation;\r\n\r\n var i1 = weightsNumber;\r\n while(i1--) {\r\n this.weights.push(Math.random());\r\n }\r\n\r\n }", "title": "" }, { "docid": "e8d2f54b2b95befeb28649bfb1072363", "score": "0.616868", "text": "function getRandomWeight() {\n // We add the number 180 to a random number between 0 and 3.\n // In other words, we get a randNum between 180 and 183.\n return Math.floor(Math.random() * (4)) + 180;\n}", "title": "" }, { "docid": "676e83ae2ae761f87643cc52e2b93e77", "score": "0.61573756", "text": "function randWeight() {\n var weight;\n var num = Math.seededRandom();\n if (num < .2) {\n weight = 1;\n } else if (num < .3) {\n weight = 2;\n } else if (num < .4) {\n weight = 3;\n } else {\n weight = 0;\n }\n return (weight);\n }", "title": "" }, { "docid": "b8486b2bf8ff62bd756de08fdddf67e7", "score": "0.61551934", "text": "function genWeights(nodes){\n // for all layers except for last layer\n for (var l = 0; l < nodes.length-1; l++){\n // for all nodes in current layer\n for (var n = 0; n < nodes[l].length; n++){\n // for all nodes in next layer\n for (var nl = 0; nl < nodes[l+1].length; nl++){\n // push weight between n and nl;\n nodes[l][n].weights.push(getRand(-1,1,0));\n }\n }\n }\n}", "title": "" }, { "docid": "b054ea4ddd06979cbc7a181bef97fd98", "score": "0.5974846", "text": "function WeightedRandomizer(setup) {\n this.normalize(setup);\n }", "title": "" }, { "docid": "cb9395e65534e88998de737684de2fe2", "score": "0.5934684", "text": "getWeightsCount() {\n // weights[] is ordered: input-to-hidden wts, hidden biases, hidden-to-output wts, output biases\n return ( this.inputCount * this.hiddenCount ) +\n ( this.hiddenCount * this.outputCount ) +\n this.hiddenCount +\n this.outputCount;\n }", "title": "" }, { "docid": "c16201b22dc9033b4f37b85eb6521450", "score": "0.58303887", "text": "function randWeight(arr, weight) {\n // Get total weight\n let total = weight.reduce(function(prev, cur) {\n return prev + cur;\n });\n\n let r = random(total);\n let weightSum = 0;\n for (let i = 0; i < arr.length; i++) {\n weightSum += weight[i];\n if (r <= weightSum) return arr[i];\n }\n}", "title": "" }, { "docid": "2b47b2cf1e97561ee8e54f816a201086", "score": "0.5786535", "text": "function weighted(weights) {\n const x = Math.random() * total(weights);\n let cum = 0;\n return weights.findIndex((w) => (cum += w) >= x);\n }", "title": "" }, { "docid": "be37ee5ea00628a309e8585290c56c96", "score": "0.57500416", "text": "pickRandom() {\n const limit = this.props.vocab.length;\n const randomWordIndex = Math.floor(Math.random() * limit);\n return this.props.vocab[randomWordIndex];\n }", "title": "" }, { "docid": "7d1f935f85a9dedf160c50cf5e68c1af", "score": "0.5743994", "text": "function generateAnimalData() {\n var n = Math.floor(Math.random()*5)+1;\n var weights = [];\n for (var i = 0; i < n; i++){\n weights.push({weight: faker.finance.amount(100,400,1), weigh_date: faker.date.recent()});\n }\n return {\n weights: weights\n };\n}", "title": "" }, { "docid": "d6f66f581142bdbb9fd99036f72ad9ed", "score": "0.55622816", "text": "function generateMultiRandomGenreNum(genreObject) {\n let num = Math.floor((Math.random() * 21), 0);\n return num;\n}", "title": "" }, { "docid": "fe7b67be873885d49e55a7085c21445f", "score": "0.5549845", "text": "function makeExample(num){\r\n\t//dynamic features\r\n\tvar inTimeRatio = rNode.features.inTime/cNode.features.inTime;\r\n\trNode.features.parentTaught = mostRecent(rNode.parents);\r\n\tvar ax=mostRecent(rNode.unlinkedParents);\r\n\tif(rNode.features.parentTaught < ax)\r\n\t\trNode.features.parentTaught = ax;\r\n\tif(cNode.depth!=0)\r\n\t\tvar parentTaughtRatio = rNode.features.parentTaught/cNode.features.parentTaught;\r\n\telse \r\n\t\tvar parentTaughtRatio = 0;\r\n\tif(rNode.depth==0)\r\n\t\tvar parentTaughtRatio = 0;\r\n\t//static features\r\n\tvar avgSizeRatio = rNode.features.avgSize/cNode.features.avgSize;\r\n\tvar depthHeightRatio = ((rNode.depth+0.5)*(cNode.height + 0.5))/((cNode.depth + 0.5)*(rNode.height + 0.5));\r\n\tvar numParent = rNode.features.numP;\r\n\tvar numChildRatio = rNode.features.numC/(cNode.features.numC+1);\r\n\tvar d=0,b=0,f=0,g=0;\r\n\tfor(var i=0;i<rList.length;i++){\r\n\t\tif(rList[i].depth == (cNode.depth+1))\r\n\t\t\td++;\r\n\t\telse if(rList[i].depth == cNode.depth)\r\n\t\t\tb++;\r\n\t\telse if(rList[i].depth > cNode.depth)\r\n\t\t\tf++;\r\n\t\telse \r\n\t\t\tg++;\r\n\t}\r\n\tvar ub1=0;var ub2=0;\r\n\tif(dbfg.length>0)\r\n\t\tvar str = dbfg[dbfg.length-1]; \r\n\tif(rNode.depth == (cNode.depth+1)){\r\n\t\tub1 = d/(d+b+f+g)||0;\r\n\t\tif(dbfg.length>0){\r\n\t\tvar str1=str+\"d\";var str2=str+\"b\";var str3=str+\"f\";var str4=str+\"g\";\r\n\t\tvar re1 = new RegExp(str1,\"g\");var re2 = new RegExp(str2,\"g\");var re3 = new RegExp(str3,\"g\");var re4 = new RegExp(str4,\"g\");\r\n\t\tub2 = (dbfg.match(re1) || []).length/(0.0001+(dbfg.match(re1) || []).length+(dbfg.match(re2) || []).length+(dbfg.match(re3) || []).length+(dbfg.match(re4) || []).length);\r\n\t\t}\r\n\t\t//dbfg+=\"d\";\r\n\t}\r\n\telse if(rNode.depth == cNode.depth){\r\n\t\tub1 = b/(d+b+f+g)||0;\r\n\t\tif(dbfg.length>0){\r\n\t\tvar str1=str+\"b\";var str2=str+\"d\";var str3=str+\"f\";var str4=str+\"g\";\r\n\t\tvar re1 = new RegExp(str1,\"g\");var re2 = new RegExp(str2,\"g\");var re3 = new RegExp(str3,\"g\");var re4 = new RegExp(str4,\"g\");\r\n\t\tub2 = (dbfg.match(re1) || []).length/(0.0001+(dbfg.match(re1) || []).length+(dbfg.match(re2) || []).length+(dbfg.match(re3) || []).length+(dbfg.match(re4) || []).length);\r\n\t\t}\r\n\t\t//dbfg+=\"b\";\r\n\t}\r\n\telse if(rNode.depth > cNode.depth){\r\n\t\tub1 = f/(d+b+f+g)||0;\r\n\t\tif(dbfg.length>0){\r\n\t\tvar str1=str+\"f\";var str2=str+\"d\";var str3=str+\"b\";var str4=str+\"g\";\r\n\t\tvar re1 = new RegExp(str1,\"g\");var re2 = new RegExp(str2,\"g\");var re3 = new RegExp(str3,\"g\");var re4 = new RegExp(str4,\"g\");\r\n\t\tub2 = (dbfg.match(re1) || []).length/(0.0001+(dbfg.match(re1) || []).length+(dbfg.match(re2) || []).length+(dbfg.match(re3) || []).length+(dbfg.match(re4) || []).length);\r\n\t\t}\r\n\t\t//dbfg+=\"f\";\r\n\t}\r\n\telse{\r\n\t\tub1 = g/(d+b+f+g)||0;\r\n\t\tif(dbfg.length>0){\r\n\t\tvar str1=str+\"g\";var str2=str+\"d\";var str3=str+\"f\";var str4=str+\"b\";\r\n\t\tvar re1 = new RegExp(str1,\"g\");var re2 = new RegExp(str2,\"g\");var re3 = new RegExp(str3,\"g\");var re4 = new RegExp(str4,\"g\");\r\n\t\tub2 = (dbfg.match(re1) || []).length/(0.0001+(dbfg.match(re1) || []).length+(dbfg.match(re2) || []).length+(dbfg.match(re3) || []).length+(dbfg.match(re4) || []).length);\r\n\t\t}\r\n\t\t//dbfg+=\"g\";\r\n\t}\r\n\texamples.push([1,inTimeRatio,parentTaughtRatio,avgSizeRatio,depthHeightRatio,numParent,numChildRatio,ub1,ub2]);\r\n\ttargets.push(num);\r\n}", "title": "" }, { "docid": "08e2cca64e2161fd38a7ee3f836f1955", "score": "0.55410975", "text": "function selectRandByWeight(distribution) {\n\t\tconst totalWeights = distribution.reduce((acc, curr)=>acc+curr.weight, 0)\n\t\tlet rand = Math.round(Math.random() * (totalWeights - 1)) + 1\n\t\tconst selectedOutcome = distribution.find(outcome=>{\n\t\t\trand -= outcome.weight\n\t\t\treturn rand <= 0\n\t\t})\n\t\treturn selectedOutcome\n\t}", "title": "" }, { "docid": "bd035cc55001f0b040f5f986934a607b", "score": "0.5485831", "text": "function revealWeights() {\n var images = $('#sorting-algorithms-interactive').find('.box-img');\n var content;\n var image;\n var weight;\n for (var i=0; i < images.length; i++) {\n image = images.eq(i);\n content = image.parent();\n weight = image.attr('data-weight');\n content.prepend($('#number-' + (parseInt(weight) + 1)));\n }\n $('.box-img').css('opacity', '0.2');\n}", "title": "" }, { "docid": "ecedd0cf51ddc1b0f56004d4a1c0b7ea", "score": "0.548377", "text": "function findLinearModelWeights(ZeroWeightModel, OrderedBestChoices, iteration) {\n console.log('here findLinearModelWeights');\n let genetic = Genetic.create();\n genetic.optimize = Genetic.Optimize.Minimize;\n genetic.select1 = Genetic.Select1.Tournament2;\n genetic.select2 = Genetic.Select2.FittestRandom;\n genetic.seed = function () {\n\n let a = [];\n // create coefficients for model with values between (0.0, 1.0)\n\n let ZWM = this.userData[\"ZeroWeightModel\"];\n\n let degree = ZWM.length; // length of an individual\n let i;\n for (i = 0; i < degree; ++i) {\n a.push(Math.random() + 0.000001); //for non zero weight\n }\n\n // console.log('seed : ' + a);\n\n return a;\n };\n\n genetic.mutate = function (entity) {\n\n // allow chromosomal drift with this range (-0.05, 0.05)\n let drift = ((Math.random() - 0.5) * 2) * 0.05;\n\n let i = Math.floor(Math.random() * entity.length);\n entity[i] += drift;\n\n return entity;\n };\n genetic.crossover = function (mother, father) {\n // crossover via interpolation\n function lerp(a, b, p) {\n return a + (b - a) * p;\n }\n\n let len = mother.length;\n let i = Math.floor(Math.random() * len);\n let r = Math.random();\n let son = [].concat(father);\n let daughter = [].concat(mother);\n\n son[i] = lerp(father[i], mother[i], r);\n daughter[i] = lerp(mother[i], father[i], r);\n\n return [son, daughter];\n };\n\n genetic.normalizeChoices = normalizeChoices;\n genetic.scoreChoices = scoreChoices;\n genetic.findBest = findBest;\n genetic.fitness = function (entity) {\n\n let ZWM = this.userData[\"ZeroWeightModel\"];\n let OBC = this.userData[\"OrderedBestChoices\"];\n\n\n let NewModel = Object.assign([], ZWM);\n // console.log(\"ZWM : \" + JSON.stringify(ZWM));\n // console.log(\"NewModel : \" + JSON.stringify(NewModel));\n\n NewModel.forEach(function (m, j) {\n m.weight = entity[j];\n });\n\n // console.log('NewModel : ' + JSON.stringify(NewModel));\n\n let errors = 0;\n let bests = [];\n let normchoices = this.normalizeChoices(NewModel, OBC);\n for (let i = 0; i < OBC.length; i++) {\n let nOBCS = normchoices.slice(i, OBC.length);\n let scores = this.scoreChoices(nOBCS, NewModel);\n let best = this.findBest(scores);\n\n // console.log('scores : ' + scores);\n\n bests.push(i + best);\n errors += (best == 0) ? 0.0 : 1.0;\n }\n\n return (errors / OBC.length);\n\n };\n genetic.generation = function (pop, generation, stats) {\n };\n\n genetic.finalresult = [];\n genetic.notification = function (pop, generation, stats, isFinished) {\n\n // console.log('generation+1 : ' + generation+1);\n // console.log('pop[0].entity : ' + pop[0].entity);\n // console.log('pop[0].fitness : ' + pop[0].fitness);\n // console.log('stats.mean.toPrecision(4) : ' + stats.mean.toPrecision(4));\n // console.log('stats.stdev.toPrecision(4) : ' + stats.stdev.toPrecision(4));\n\n // console.log('pop[0] : ' + JSON.stringify(pop[0]));\n // console.log('isFinished : ' + isFinished);\n if (isFinished) {\n\n let ZWM = this.userData[\"ZeroWeightModel\"];\n let NewModel = Object.assign([], ZWM);\n NewModel.forEach(function (m, j) {\n m.weight = pop[0].entity[j];\n }.bind(pop[0]));\n\n genetic.finalresult = {Model: NewModel, fitness: pop[0].fitness};\n console.log('stats : ' + JSON.stringify(stats));\n console.log('generation : ' + JSON.stringify(generation));\n\n }\n };\n\n let config = {\n \"size\": 100,\n \"crossover\": 0.01,\n \"mutation\": 0.2,\n \"iterations\": iteration,\n \"fittestAlwaysSurvives\": true,\n \"maxResults\": 100,\n \"webWorkers\": true,\n \"skip\": 10\n };\n let userData = {\n \"ZeroWeightModel\": ZeroWeightModel,\n \"OrderedBestChoices\": OrderedBestChoices\n };\n genetic.evolve(config, userData);\n\n genetic.finalresult.best = chooseLinear(genetic.finalresult.Model, OrderedBestChoices);\n\n return genetic.finalresult;\n}", "title": "" }, { "docid": "62d3f04b598b34238ff4bc85c26db078", "score": "0.54485065", "text": "function Neuron(inputsize) {\n\tthis.weights = Array(inputsize)\n\tfor (var i = 0; i < inputsize; i++) {\n\t\tthis.weights[i] = random() - 0.5\n\t}\n\tthis._out = null\n\tthis.bias = random() - 0.5\n}", "title": "" }, { "docid": "91c568920e438e510360635003d799fc", "score": "0.5441044", "text": "function stream_layers(n, m, o) {\nif (arguments.length < 3) o = 0;\nfunction bump(a) {\nvar x = 1 / (.1 + Math.random()),\n y = 2 * Math.random() - .5,\n z = 10 / (.1 + Math.random());\nfor (var i = 0; i < m; i++) {\n var w = (i / m - y) * z;\n a[i] += x * Math.exp(-w * w);\n}\n}\nreturn d3.range(n).map(function() {\n var a = [], i;\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\n for (i = 0; i < 5; i++) bump(a);\n return a.map(stream_index);\n});\n}", "title": "" }, { "docid": "a4b720ebe888d453b3c666ec815191d0", "score": "0.5423428", "text": "function trainMultiple() {\n const newWeights = currentWeights.slice();\n\n for (let i = 0; i < currentWeights.length; i++) {\n const offset = Math.sin(Math.random() * TWO_PI) * LEARNING_RATE;\n newWeights[i] += offset;\n }\n\n const newError = evaluateError(currentWeights);\n\n if (newError < error) {\n currentWeights = newWeights;\n error = newError;\n drawPrediction();\n console.log({ error });\n }\n}", "title": "" }, { "docid": "944a6f0088727d8d1655626a89c7c748", "score": "0.54105824", "text": "function wordGen() {\n\n\tvar rn1 = Math.floor(Math.random() * 1481);\n\tvar rv1 = Math.floor(Math.random() * 632);\n\tvar ra1 = Math.floor(Math.random() * 1903);\n\tvar rn2 = Math.floor(Math.random() * 1481);\n\tvar rv2 = Math.floor(Math.random() * 632);\n\tvar ra2 = Math.floor(Math.random() * 1903);\n\tvar rn3 = Math.floor(Math.random() * 1481);\n\tvar rv3 = Math.floor(Math.random() * 632);\n\tvar ra3 = Math.floor(Math.random() * 1903);\n\tvar rn4 = Math.floor(Math.random() * 1481);\n\tvar rv4 = Math.floor(Math.random() * 632);\n\tvar rv5 = Math.floor(Math.random() * 632);\n\tvar rv6 = Math.floor(Math.random() * 632);\n\tvar rv7 = Math.floor(Math.random() * 632);\n\tvar ra4 = Math.floor(Math.random() * 1903);\n\tvar ra5 = Math.floor(Math.random() * 1903);\n\tvar ra6 = Math.floor(Math.random() * 1903);\n\tvar ra7 = Math.floor(Math.random() * 1903);\n\tvar rn5 = Math.floor(Math.random() * 1481);\n\tvar rn6 = Math.floor(Math.random() * 1481);\n\tvar rn7 = Math.floor(Math.random() * 1481);\n\tvar rn8 = Math.floor(Math.random() * 1481);\n\tvar rn9 = Math.floor(Math.random() * 1481);\n\tvar rn10 = Math.floor(Math.random() * 1481);\n\tvar rn11 = Math.floor(Math.random() * 1481);\n\tvar rn12 = Math.floor(Math.random() * 1481);\n\n\trnum1 = Math.floor(Math.random() * 5);\n\n\tdo {\n\t\trnum2 = Math.floor(Math.random() * 6);\n\t} while (rnum2 == rnum1);\n\n\t//\n\trs[0] = \"the \" + radjectives[ra1] + \" \" + rnouns[rn1] + \" can't \"\n\t\t\t+ rverbs[rv1] + \" the \" + rnouns[rn2] + \".\";\n\n\trs[1] = \"did the \" + radjectives[ra2] + \" \" + rnouns[rn3] + \" really \"\n\t\t\t+ rverbs[rv2] + \" the \" + rnouns[rn4] + \"?\";\n\n\trs[2] = \"the \" + radjectives[ra7] + \" \" + rnouns[rn5] + \" \" + rverbs[rv7]\n\t\t\t+ \"s into the \" + radjectives[ra3] + \" \" + rnouns[rn6]\n\t\t\t+ \".\";\n\t//\n\trs[3] = \"what if the \" + radjectives[rv4] + \" \" + rnouns[rn7] + \" ate the \"\n\t\t\t+ rnouns[rn8] + \"?\";\n\t//\n\trs[4] = \"is the \" + rverbs[rv5] + \" \" + rnouns[rn9] + \" better than the \"\n\t\t\t+ rnouns[rn10] + \"?\";\n\t//\n\trs[5] = \"it was then the \" + radjectives[ra5] + \" \" + rnouns[rn11]\n\t\t\t+ \" met the \" + radjectives[ra6] + \" \" + rnouns[rn12] + \".\";\n\n\tarrStr = arrStr + rs[rnum1];\n\n}", "title": "" }, { "docid": "f8f28cfe2d0e2a2305f38d8fbe020f32", "score": "0.54071176", "text": "constructor(sizes){\r\n this.layers = new Array(); //We wnt this lib to be as dinamic as possible, so we need to store all the layers in an array.\r\n this.biases = new Array(sizes.length-1);\r\n this.biases.fill(1); //We start of with every bias being 1.\r\n this.weights = new Array();\r\n this.temp = new Array();\r\n this.output = new Array(sizes[sizes.length -1]);\r\n this.netconfig = sizes; //Just so we can later see what the network looks like in the console.\r\n for(let i = 0; i < sizes.length; i++){ //Loop through every layer.\r\n //Create layers.\r\n this.layers.push(new Array(sizes[i])); //Put an array with the size of the layer inside the bigger array containing all the layers\r\n //Create Weights\r\n for(let j = 0; j < sizes[i + 1]; j++){\r\n this.temp.push(new Array(sizes[i]));\r\n this.temp[j].fill(Math.random() * 2 -1);\r\n }\r\n this.weights.push(this.temp);\r\n this.temp = new Array();\r\n }\r\n delete this.temp;\r\n this.weights.pop();\r\n }", "title": "" }, { "docid": "233b8d5fabf8f88766a57da91f3119a9", "score": "0.5405473", "text": "function populate_predator(){\n r = random(20,60)\n predators.push(new Predator(random(0,width),random(0,height),r,random(7,15),255,0,0,random(200,250)+r))\n}", "title": "" }, { "docid": "457e9349d7e7c252ef7224979fddbbca", "score": "0.53520465", "text": "function WeightedChoose(arr, weightChoose) {\n\tif ( weightChoose <= 0 || weightChoose == undefined) weightChoose = 1;\n\treturn arr[Math.floor(Math.pow(Math.random(),weightChoose) * arr.length)];\n}", "title": "" }, { "docid": "dbecb3c4c6f4eaf02f18e3a11bf0a176", "score": "0.5332265", "text": "function randomInArrayByWeight (array, weight) {\r\n var ar = [];\r\n var i;\r\n var sum = 0;\r\n var r = Math.random();\r\n\r\n for (i = 0; i < weight.length - 1; i++) {\r\n sum += (weight[i] / 100.0);\r\n ar[i] = sum;\r\n }\r\n\r\n for (i = 0; i < ar.length && r >= ar[i]; i++) {\r\n if (r < ar[i]) {\r\n return array[i];\r\n }\r\n }\r\n\r\n return array[i];\r\n }", "title": "" }, { "docid": "c35756aad34ce693622a2488adc42953", "score": "0.5324712", "text": "function standardizeWeights(y, sampleWeight, classWeight, sampleWeightMode) {\n return __awaiter(this, void 0, void 0, function () {\n var yClasses, yClassIndices, _a, _b, classSampleWeight_1;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n if (!(classWeight != null)) return [3, /*break*/\n 2];\n yClasses = tfc.tidy(function () {\n if (y.shape.length === 1) {\n // Assume class indices.\n return tfc.clone(y);\n } else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n var axis = 1;\n return tfc.argMax(y, axis);\n } else if (y.shape[1] === 1) {\n // Class index.\n return tfc.reshape(y, [y.shape[0]]);\n } else {\n throw new Error(\"Encountered unexpected last-dimension size (\" + y.shape[1] + \") \" + \"during handling of class weights. The size is expected to be \" + \">= 1.\");\n }\n } else {\n throw new Error(\"Unexpected rank of target (y) tensor (\" + y.rank + \") during \" + \"handling of class weights. The rank is expected to be 1 or 2.\");\n }\n });\n _b = (_a = Array).from;\n return [4, /*yield*/\n yClasses.data()];\n case 1:\n yClassIndices = _b.apply(_a, [_c.sent()]);\n tfc.dispose(yClasses);\n classSampleWeight_1 = [];\n yClassIndices.forEach(function (classIndex) {\n if (classWeight[classIndex] == null) {\n throw new Error(\"classWeight must contain all classes in the training data. \" + (\"The class \" + classIndex + \" exists in the data but not in \") + \"classWeight\");\n } else {\n classSampleWeight_1.push(classWeight[classIndex]);\n }\n });\n return [2, /*return*/\n tfc.tensor1d(classSampleWeight_1, 'float32')];\n case 2:\n return [2, /*return*/\n null];\n }\n });\n });\n}", "title": "" }, { "docid": "2fc0330194f6afd51d062b70f383bed0", "score": "0.53229946", "text": "function standardizeWeights(y, sampleWeight, classWeight, sampleWeightMode) {\n return __awaiter(this, void 0, void 0, function () {\n var yClasses, yClassIndices, _a, _b, classSampleWeight_1;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (sampleWeight != null || sampleWeightMode != null) {\n // TODO(cais): Once 'temporal' mode is implemented, document it in the doc\n // string.\n throw new Error('Support sampleWeight is not implemented yet');\n }\n if (!(classWeight != null)) return [3 /*break*/, 2];\n yClasses = tfjs_core_1.tidy(function () {\n if (y.shape.length === 1) {\n // Assume class indices.\n return y.clone();\n }\n else if (y.shape.length === 2) {\n if (y.shape[1] > 1) {\n // Assume one-hot encoding of classes.\n var axis = 1;\n return y.argMax(axis);\n }\n else if (y.shape[1] === 1) {\n // Class index.\n return y.reshape([y.shape[0]]);\n }\n else {\n throw new Error(\"Encountered unexpected last-dimension size (\" + y.shape[1] + \") \" +\n \"during handling of class weights. The size is expected to be \" +\n \">= 1.\");\n }\n }\n else {\n throw new Error(\"Unexpected rank of target (y) tensor (\" + y.rank + \") during \" +\n \"handling of class weights. The rank is expected to be 1 or 2.\");\n }\n });\n _b = (_a = Array).from;\n return [4 /*yield*/, yClasses.data()];\n case 1:\n yClassIndices = _b.apply(_a, [_c.sent()]);\n tfjs_core_1.dispose(yClasses);\n classSampleWeight_1 = [];\n yClassIndices.forEach(function (classIndex) {\n if (classWeight[classIndex] == null) {\n throw new Error(\"classWeight must contain all classes in the training data. \" +\n (\"The class \" + classIndex + \" exists in the data but not in \") +\n \"classWeight\");\n }\n else {\n classSampleWeight_1.push(classWeight[classIndex]);\n }\n });\n return [2 /*return*/, tfjs_core_1.tensor1d(classSampleWeight_1, 'float32')];\n case 2: return [2 /*return*/, null];\n }\n });\n });\n}", "title": "" }, { "docid": "dbf203bb262d3d62c7f1a28d70ada530", "score": "0.5307275", "text": "get weights() {\r\n var brainWeights = [];\r\n\r\n //Input layer\r\n for(let weight of this.inputLayer.weights) {\r\n brainWeights.push(weight);\r\n }\r\n\r\n //Hidden layers \r\n for(let layer of this.layers) {\r\n for(let weight of layer.weights) {\r\n brainWeights.push(weight);\r\n }\r\n }\r\n\r\n //Output layer\r\n for(let weight of this.outputLayer.weights) {\r\n brainWeights.push(weight);\r\n }\r\n\r\n return brainWeights;\r\n }", "title": "" }, { "docid": "6dcaef0dec31e12b2c16c371661df6a1", "score": "0.528365", "text": "getRandomExample() {\n return this.examples[Math.floor(Math.random() * this.examples.length)];\n }", "title": "" }, { "docid": "0a4c717dd12afdfaf0d95dfe3ee34eb7", "score": "0.52632314", "text": "function createWeights(w,geometry)\n{\nvar temp = ee.Image().clip(geometry)\nvar L1weights;\nL1weights = ee.Image().clip(geometry).expression((w[0]).toString()).rename(['B1'])\nfor(var i=1;i<bands.length;i++){\nL1weights = L1weights.addBands(temp.expression((w[i]).toString()).rename([bands[i]]))\n}\nreturn L1weights\n}", "title": "" }, { "docid": "e960621f4565dd8f7b8c292c7d1a9a86", "score": "0.52596366", "text": "function findLinearModelWeightsWithLargDist(ZeroWeightModel, OrderedBestChoices, iteration) {\n console.log('here findLinearModelWeights');\n let genetic = Genetic.create();\n genetic.optimize = Genetic.Optimize.Minimize;\n genetic.select1 = Genetic.Select1.Tournament2;\n genetic.select2 = Genetic.Select2.FittestRandom;\n genetic.seed = function () {\n\n let a = [];\n // create coefficients for model with values between (0.0, 1.0)\n\n let ZWM = this.userData[\"ZeroWeightModel\"];\n\n let degree = ZWM.length; // length of an individual\n let i;\n for (i = 0; i < degree; ++i) {\n a.push(Math.random() + 0.000001); //for non zero weight\n }\n\n // console.log('seed : ' + a);\n\n return a;\n };\n\n genetic.mutate = function (entity) {\n\n // allow chromosomal drift with this range (-0.05, 0.05)\n let drift = ((Math.random() - 0.5) * 2) * 0.05;\n\n let i = Math.floor(Math.random() * entity.length);\n entity[i] += drift;\n\n return entity;\n };\n genetic.crossover = function (mother, father) {\n // crossover via interpolation\n function lerp(a, b, p) {\n return a + (b - a) * p;\n }\n\n let len = mother.length;\n let i = Math.floor(Math.random() * len);\n let r = Math.random();\n let son = [].concat(father);\n let daughter = [].concat(mother);\n\n son[i] = lerp(father[i], mother[i], r);\n daughter[i] = lerp(mother[i], father[i], r);\n\n return [son, daughter];\n };\n\n genetic.normalizeChoices = normalizeChoices;\n genetic.scoreChoices = scoreChoices;\n genetic.findBest = findBest;\n genetic.fitness = function (entity) {\n\n let ZWM = this.userData[\"ZeroWeightModel\"];\n let OBC = this.userData[\"OrderedBestChoices\"];\n\n let NewModel = Object.assign([], ZWM);\n NewModel.forEach(function (m, j) {\n m.weight = entity[j];\n });\n // console.log(\"NewModel : \" + JSON.stringify(NewModel));\n\n // add minimization of wrong order of choices\n let errors = 0;\n let bests = [];\n let normchoices = this.normalizeChoices(NewModel, OBC);\n for (let i = 0; i < OBC.length; i++) {\n let nOBCS = normchoices.slice(i, OBC.length);\n let scores = this.scoreChoices(nOBCS, NewModel);\n let best = this.findBest(scores);\n bests.push(i + best);\n errors += (best == 0) ? 0.0 : 1.0;\n }\n\n // add maximization of distance\n let scores = this.scoreChoices(normchoices, NewModel);\n let dist = 0.0;\n for (let i = 0; i < scores.length - 1; i++) {\n let d = (scores[i + 1] - scores[i]);\n dist += Math.exp(-(d * d));\n }\n let sdist = (dist / scores.length);\n\n // add minimization of wieghts\n // constraint : sum of weights is 1\n let ws = 0.0;\n for (let i = 0; i < entity.length; i++) {\n ws += (entity[i]);\n }\n let d = (ws - 1);\n let sws = 1 - Math.exp(-(d * d));\n\n // console.log('bests : ' + bests);\n // console.log('errors : ' + errors);\n // console.log('sdist : ' + sdist);\n // console.log('err: ' + (errors / OBC.length) + ' sdist: ' + sdist + ' sws: ' + sws);\n\n // return (.5*(errors / OBC.length) + .4*sdist + .1*sws);\n return (.5 * (errors / OBC.length) + .5 * sdist + .0 * sws);\n\n };\n genetic.generation = function (pop, generation, stats) {\n };\n\n genetic.finalresult = [];\n genetic.notification = function (pop, generation, stats, isFinished) {\n\n // console.log('generation+1 : ' + generation+1);\n // console.log('pop[0].entity : ' + pop[0].entity);\n console.log(((generation / iteration) * 100).toPrecision(2) + '% -> fitness : ' + pop[0].fitness);\n // console.log('stats.mean.toPrecision(4) : ' + stats.mean.toPrecision(4));\n // console.log('stats.stdev.toPrecision(4) : ' + stats.stdev.toPrecision(4));\n\n // console.log('pop[0] : ' + JSON.stringify(pop[0]));\n // console.log('isFinished : ' + isFinished);\n // console.log('stats : ' + JSON.stringify(stats));\n // console.log('generation : ' + JSON.stringify(generation));\n if (isFinished) {\n let ZWM = this.userData[\"ZeroWeightModel\"];\n let NewModel = Object.assign([], ZWM);\n NewModel.forEach(function (m, j) {\n m.weight = pop[0].entity[j];\n }.bind(pop[0]));\n\n genetic.finalresult = {Model: NewModel, fitness: pop[0].fitness};\n }\n };\n\n let config = {\n \"size\": 200,\n \"crossover\": 0.01,\n \"mutation\": 0.2,\n \"iterations\": iteration,\n \"fittestAlwaysSurvives\": true,\n \"maxResults\": 100,\n \"webWorkers\": true,\n \"skip\": 10\n };\n let userData = {\n \"ZeroWeightModel\": ZeroWeightModel,\n \"OrderedBestChoices\": OrderedBestChoices\n };\n genetic.evolve(config, userData);\n\n genetic.finalresult.best = chooseLinear(genetic.finalresult.Model, OrderedBestChoices);\n\n return genetic.finalresult;\n}", "title": "" }, { "docid": "1c6a0f5ae21aff2a921fa2094f3f7e9b", "score": "0.5256294", "text": "getWeights(list_of_words){\n\t\tconst frequencies_and_max = this.getFrequencyAndMax(list_of_words);\n\t\tconst frequencies_map = frequencies_and_max[0];\n\t\tconst max = frequencies_and_max[1];\n\t\tfrequencies_map.forEach((value,key,map)=>{\n\t\t\tmap.set(key, value/max);\n\t\t});\n\t\treturn frequencies_map;\n\t}", "title": "" }, { "docid": "e2505ad6ab6aebd03ddc5fc7787ce399", "score": "0.5239309", "text": "constructor(numNeuronsNL, randomNum) {\n\t\tthis.weights = []; // array of weights which connects this layer's neurons to the previous layer's neurons\n\t\tthis.output = 0; // this is the activated output value that a neuron holds\t\t\n\t\tthis.deltaError = 0; // contains the delta error value\n\t\tthis.assignWeights(numNeuronsNL, randomNum);\n\t}", "title": "" }, { "docid": "9c342a6fb38dbc3d6f376fad0f27bc3d", "score": "0.52372897", "text": "sample(n){\n if(n === 0) {\n return 0;\n }\n\n let nums = random(0,1,n=n).map(x => x - 0.5);\n let value = this.b/Math.sqrt(2);\n let second = nums.map(x => value * sign(x) * Math.log(1 - 2 * Math.abs(x)));\n return second.map(x => this.mu - x); \n }", "title": "" }, { "docid": "da9a1cacf772be18a11dfaa4174f411a", "score": "0.5224044", "text": "function randAdj(N)\n\t\t\t\t{\n\t\t\t\t\tvar result = [];\n\t\t\t\t\tfor( var i=0; i < N; i++) {\n\t\t\t\t\t\tresult[i] = [];\n\t\t\t\t\t\tvar count = 0;\n\t\t\t\t\t\tfor(var j = 0; j < N; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t //if(count < 18)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t count++;\n\t\t\t\t\t\t\tvar index = Math.floor(Math.random() * self.N);\t\t\t\t// random index between 1 and N\n\t\t\t\t\t\t\tresult[i][index] = Math.floor((Math.random() * 2)) ;\t // the selected index is randomly assigned a 0 or 1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i =0; i < N; i++) {\n\t\t\t\t\t\tresult[i][i] = 0;\n\t\t\t\t\t\tfor(var j =0; j < N; j++) {\n\t\t\t\t\t\t\tif (result[i][j] > 0) result[j][i] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t\t}", "title": "" }, { "docid": "75efe138621bb816ab7d75148acbcd4b", "score": "0.52218497", "text": "function stream_layers(n, m, o) {\r\n if (arguments.length < 3) o = 0;\r\n function bump(a) {\r\n var x = 1 / (.1 + Math.random()),\r\n y = 2 * Math.random() - .5,\r\n z = 10 / (.1 + Math.random());\r\n for (var i = 0; i < m; i++) {\r\n var w = (i / m - y) * z;\r\n a[i] += x * Math.exp(-w * w);\r\n }\r\n }\r\n return d3.range(n).map(function() {\r\n var a = [], i;\r\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\r\n for (i = 0; i < 5; i++) bump(a);\r\n return a.map(stream_index);\r\n });\r\n}", "title": "" }, { "docid": "3a20cb52d18083a761d8f6c197c1f2a9", "score": "0.5221096", "text": "function randomNote() {\n return choose(scale) + choose([0,12]);\n }", "title": "" }, { "docid": "8750395600d1c41585b54e8ea39175d8", "score": "0.5216225", "text": "function generateRandomGenreNum(genreObject) {\n let num = Math.floor((Math.random() * 21), 0);\n return num;\n}", "title": "" }, { "docid": "2b68659bd4b7c86e3a15628a20909705", "score": "0.52140653", "text": "generateLearningVector() {\n return this.data[_.random(0, this.data.length - 1)];\n }", "title": "" }, { "docid": "4f2508737c19b51d4ddd0c2309593ca5", "score": "0.52033794", "text": "function randWeightedIndv(indvs) {\n // sum of fitness\n var indvsFitness = indvs.map(x => x.fitness);\n var weightSums = indvsFitness.reduce((acc, crnt) => acc + crnt);\n var randNum = random(0, weightSums, 1, 0); // random value from 0 to weightSums\n\n for (j = 0; j < indvs.length; j++) {\n if (randNum < indvs[j].fitness) {\n return indvs[j];\n }\n randNum -= indvs[j].fitness;\n }\n // if loop ends with no return, return last element\n return indvs[indvs.length - 1];\n}", "title": "" }, { "docid": "b8e817d4eba06f4ee5ac04e5663deacd", "score": "0.51958996", "text": "constructor(args = {}) {\n\t\tsuper(args)\n\t\tconst { size } = args\n\n\t\tif (!size || size < 3) {\n\t\t\tthrow new Error('size has to be at least 3')\n\t\t}\n\n\t\tthis.size = size\n\t\tthis.weights = []\n\n\t\tthis.randomWeights()\n\t}", "title": "" }, { "docid": "cd45e401c8597e7334413b21c4c3a848", "score": "0.5195841", "text": "random3D() {}", "title": "" }, { "docid": "7867fd6f0b3df617ed70f42511e51730", "score": "0.51813644", "text": "function stream_layers(n, m, o) {\n if (arguments.length < 3) o = 0;\n function bump(a) {\n var x = 1 / (.1 + Math.random()),\n y = 2 * Math.random() - .5,\n z = 10 / (.1 + Math.random());\n for (var i = 0; i < m; i++) {\n var w = (i / m - y) * z;\n a[i] += x * Math.exp(-w * w);\n }\n }\n return d3.range(n).map(function() {\n var a = [], i;\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\n for (i = 0; i < 5; i++) bump(a);\n return a.map(stream_index);\n });\n}", "title": "" }, { "docid": "d472e87ef5356a1bb08251ec1655d0cc", "score": "0.51748574", "text": "function selectCandidate(count, catAssets) {\n const selectedNftSet = [];\n for(let i = 0; i < count; i++) {\n\n const optionCandidate = [];\n catAssets.forEach( attribute => {\n let randomOption = rndInt(1, attribute.totalWeight);\n\n for(let j = attribute.assets.length - 1; j >= 0; j-- ) {\n randomOption -= attribute.assets[j].rarity;\n if(randomOption < 0) {\n optionCandidate.push(`${attribute.index}-${attribute.assets[j].index}`);\n break;\n }\n }\n\n });\n\n selectedNftSet.push(optionCandidate);\n }\n\n return selectedNftSet;\n}", "title": "" }, { "docid": "5625028d0a41a0de87c5d7fe4b980547", "score": "0.5167315", "text": "function scramble(weight) {\n traverse(function(x, y) {\n board[x][y] = Math.random() < weight;\n });\n}", "title": "" }, { "docid": "d55816b05208d6b7dd0a4455aa1be86b", "score": "0.51641476", "text": "function randn_bm() {\n const i = 0.004;\n var u = 0, v = 0;\n while(u === 0) u = Math.random(); //Converting [0,1) to (0,1)\n while(v === 0) v = Math.random();\n return Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v ) * i;\n}", "title": "" }, { "docid": "3f65e8a06a03d1d00e81621b7fc0c377", "score": "0.5159475", "text": "function stream_layers(n, m, o) {\n if (arguments.length < 3) o = 0;\n function bump(a) {\n var x = 1 / (.1 + Math.random()),\n y = 2 * Math.random() - .5,\n z = 10 / (.1 + Math.random());\n for (var i = 0; i < m; i++) {\n var w = (i / m - y) * z;\n a[i] += x * Math.exp(-w * w);\n }\n }\n return d3.range(n).map(function() {\n var a = [], i;\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\n for (i = 0; i < 5; i++) bump(a);\n return a.map(stream_index);\n });\n}", "title": "" }, { "docid": "3f65e8a06a03d1d00e81621b7fc0c377", "score": "0.5159475", "text": "function stream_layers(n, m, o) {\n if (arguments.length < 3) o = 0;\n function bump(a) {\n var x = 1 / (.1 + Math.random()),\n y = 2 * Math.random() - .5,\n z = 10 / (.1 + Math.random());\n for (var i = 0; i < m; i++) {\n var w = (i / m - y) * z;\n a[i] += x * Math.exp(-w * w);\n }\n }\n return d3.range(n).map(function() {\n var a = [], i;\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\n for (i = 0; i < 5; i++) bump(a);\n return a.map(stream_index);\n });\n}", "title": "" }, { "docid": "7a67200a684e1dffbcdeeb761d77287a", "score": "0.5159293", "text": "constructor(weights, trainingData, expectedResults, bias) {\n this.weights = weights;\n console.log('Perceptron weights: ');\n let i = 0;\n for(let weight of weights){\n console.log('W' + i + ': ' + weight + ' ');\n i++;\n }\n this.expectedResults = expectedResults;\n this.trainingData = trainingData;\n // position in training data set\n this.dataPos = 0;\n this.learningRate = 0.1;\n this.bias = bias;\n }", "title": "" }, { "docid": "2201169bea86ee60aaad135c607acf8a", "score": "0.5156096", "text": "function stream_layers(n, m, o) {\n if (arguments.length < 3) o = 0;\n\n function bump(a) {\n var x = 1 / (1 + Math.random()),\n y = 2 * Math.random() - 1,\n z = 10 / (1 + Math.random());\n\n for (var i = 0; i < m; i++) {\n var w = (i / m - y) * z;\n a[i] += x * Math.exp(-w * w);\n }\n }\n\n return d3.range(n).map(function() {\n var a = [], i;\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\n for (i = 0; i < 100; i++) bump(a);\n return a.map(stream_index);\n });\n }", "title": "" }, { "docid": "61ee233dfe8b3319f904f24609a079eb", "score": "0.5155237", "text": "getRandomNetworks(){\n\t\tvar networks = []\n\t\tfor (var i = 0; i < this.populationSize; i++){\n\t\t\tvar n = new Neat(this, this.numberOfInputs, this.numberOfOutputs)\n\t\t\tn.addRandomConnection()\n\t\t\tnetworks.push(n)\n\t\t}\n\t\treturn networks\n\t}", "title": "" }, { "docid": "7b519d2e29fbbe027d67ee703e51164f", "score": "0.51547307", "text": "function reshuffle() {\n // No point showing the new values, so make sure they're hidden\n $('#eye-open').trigger('click');\n\n reset();\n\n var imagesToSort = document.getElementsByClassName('box-img');\n var shuffledWeights = shuffle(DATA_WEIGHTS);\n for (var i = 0; i < imagesToSort.length; i++) {\n var image = imagesToSort[i];\n image.dataset.weight = shuffledWeights[i];\n }\n}", "title": "" }, { "docid": "303f8148a9357ca79c95341d65766850", "score": "0.51365304", "text": "function countParamsInWeights(weights) {\n var count = 0;\n for (var _i = 0, weights_1 = weights; _i < weights_1.length; _i++) {\n var weight = weights_1[_i];\n if (weight.shape.length === 0) {\n count += 1;\n }\n else {\n count += weight.shape.reduce(function (a, b) { return a * b; });\n }\n }\n return count;\n}", "title": "" }, { "docid": "75c88a3683e8fd47ab73ed37d9750308", "score": "0.5134302", "text": "setWeights(\n weights // assumes weights[] has order of: input-to-hidden wts, hidden biases, hidden-to-output wts, output biases\n ) {\n if (!this.checkWeightsCount(weights)) {\n throw new InvalidModelException(`The weights array length: ${weights.length}\n does not match the total number of weights and biases`)\n }\n\n let k = 0; // pointer into weights param\n\n for (var i = 0; i < this.inputCount; ++i)\n for (var j = 0; j < this.hiddenCount; ++j)\n this.inputHiddenWeights[i][j] = weights[k++]\n\n for (var i = 0; i < this.hiddenCount; ++i)\n this.hiddenBiases[i] = weights[k++]\n\n for (var i = 0; i < this.hiddenCount; ++i)\n for (var j = 0; j < this.outputCount; ++j)\n this.hiddenOutputWeights[i][j] = weights[k++]\n\n for (var i = 0; i < this.outputCount; ++i)\n this.outputBiases[i] = weights[k++]\n }", "title": "" }, { "docid": "49dbc0cda3dc0e51c73e69557195964b", "score": "0.51303184", "text": "function randomNumber(){\n return Math.floor(Math.random() * reviews.length);\n}", "title": "" }, { "docid": "eb1a3e682c8033cd110980bd628c2f09", "score": "0.5130056", "text": "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.size = 3;\n this.baseX = this.x;\n this.baseY = this.y;\n this.weight = (Math.random() * 6) + 1;\n }", "title": "" }, { "docid": "20a35742fe4b4b6e7218a8595538a74f", "score": "0.51114917", "text": "function generateQuizMasterRandomGenreNum() {\n let num = Math.floor((Math.random() * 21), 0);\n return num;\n}", "title": "" }, { "docid": "4ce6cf177ce7d4ac9242ca9201b660de", "score": "0.510319", "text": "function stream_layers(n, m, o) {\n if (arguments.length < 3) o = 0;\n function bump(a) {\n var x = 1 / (.1 + Math.random()),\n y = 2 * Math.random() - .5,\n z = 10 / (.1 + Math.random());\n for (var i = 0; i < m; i++) {\n var w = (i / m - y) * z;\n a[i] += x * Math.exp(-w * w);\n }\n }\n return d3.range(n).map(function() {\n var a = [], i;\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\n for (i = 0; i < 5; i++) bump(a);\n return a.map(stream_index);\n });\n }", "title": "" }, { "docid": "4ce6cf177ce7d4ac9242ca9201b660de", "score": "0.510319", "text": "function stream_layers(n, m, o) {\n if (arguments.length < 3) o = 0;\n function bump(a) {\n var x = 1 / (.1 + Math.random()),\n y = 2 * Math.random() - .5,\n z = 10 / (.1 + Math.random());\n for (var i = 0; i < m; i++) {\n var w = (i / m - y) * z;\n a[i] += x * Math.exp(-w * w);\n }\n }\n return d3.range(n).map(function() {\n var a = [], i;\n for (i = 0; i < m; i++) a[i] = o + o * Math.random();\n for (i = 0; i < 5; i++) bump(a);\n return a.map(stream_index);\n });\n }", "title": "" }, { "docid": "63a7f92d5666f853f072be8d35a83b2e", "score": "0.51022077", "text": "function weightCalc(array){\n\t\t\t\t\tvar weight = 0;\n\t\t\t\t\tfor(var j = 0; j < array.length; j++){\n\t\t\t\t\t\tvar ob = array[j]\n\t\t\t\t\t\tfor(var i = 0; i < ob.values.length; i++){\n\t\t\t\t\t\t\t//console.log()\n\t\t\t\t\t\t\tif(obj.dataset[ob.values[i].dataset]) weight += 5 - evidenceIndex[ob.values[i].evidence];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(ob.values)\n\t\t\t\t\t//console.log(weight)\n\t\t\t\t\treturn weight;\n\t\t\t\t}//the larger the better", "title": "" }, { "docid": "d0a7743315bfe07d36b46dcbadbbb750", "score": "0.5098344", "text": "for (neuron in this.outputLayer.GetNeurons()) {\n\t\t\tfor (weight in neuron.GetWeights()) {\n\t\t\t\ttotWeights.Push(weight);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7c1fa7f48058d7e25d36b763ef609138", "score": "0.50878227", "text": "function weightedChoice(histogram) {\n // let histogram = hashMap[property];\n let choice = '';\n let weightSum = Object.values(histogram).reduce((sum, element) => {\n return sum + element;\n })\n // console.log(weightSum);\n let randomWeight = Math.floor(Math.random() * weightSum)\n // console.log(randomWeight);\n\n let keys = Object.keys(histogram)\n // console.log(keys);\n let chosen = false\n keys.forEach(key => {\n if ((randomWeight - histogram[key] <= 0) && (chosen == false)) {\n choice = key;\n chosen = true;\n } else if (chosen == false) {\n randomWeight -= histogram[key];\n }\n });\n\n return choice;\n}", "title": "" }, { "docid": "ec750e412f479e312910bd0ac1961be5", "score": "0.50790155", "text": "function generateWords() \n{\n return wordsArray[Math.floor(Math.random() * wordsArray.length)];\n}", "title": "" }, { "docid": "f8bf4a77606d9dfc60760d6ca55e28db", "score": "0.5072385", "text": "selectRandom(photos, numToShow) {\n shuffleArray(photos);\n var result = [];\n // Pick out numToShow photos, based on weighting\n // Calculate total weight\n let total = 0;\n for (let i = photos.length - 1; i > 0; i--) {\n total += photos[i].weight;\n photos[i].cumulative = total;\n }\n // Calculate weight change between photos\n let inc = total / numToShow;\n for (let i = photos.length - 1; i > 0; i--) {\n if (photos[i].cumulative >= result.length * inc) {\n result.push(photos[i]);\n }\n }\n return result;\n }", "title": "" }, { "docid": "3343c8fd3f03df496c5b7a94de110f58", "score": "0.5069016", "text": "getSample() {\n\t\treturn [\n\t\t\tMath.floor(Math.random() * this.controller.environment.width),\n\t\t\tMath.floor(Math.random() * this.controller.environment.height),\n\t\t];\n\t}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" }, { "docid": "41aecdb926ed82a7e497325623af00c7", "score": "0.5059371", "text": "function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMentions);\n });\n}", "title": "" } ]
f993f2ddd768883ebd81e394c1fdbe9b
Register routes using same registrar settings for the whole group
[ { "docid": "3fc7c964c486b4faddef30d489f5ae6b", "score": "0.6898057", "text": "group(config, callback) {\r\n const registrar = new RouteGroupRegistrar(this, config);\r\n callback(registrar);\r\n }", "title": "" } ]
[ { "docid": "9c8d48581fe40b0685695ed5751e392b", "score": "0.7375497", "text": "registerRoutes() {\n this.registerRoute(\"\", routes.homeRouter);\n this.registerRoute(\"user\", routes.usersRouter);\n this.registerRoute(\"authenticate\", routes.authRouter)\n }", "title": "" }, { "docid": "b9904cc0c6c567100e3e3a4d66f6d01c", "score": "0.7363751", "text": "registerRoute(routes) {\n RouteRegistry.register(routes);\n }", "title": "" }, { "docid": "741c232039889e96d74f8852faa16a0c", "score": "0.67344975", "text": "registerRoute() {\n\t\tconst sef = this;\n\t\treturn {\n\t\t\tpath: this.config.defaultPathEndpoint,\n\t\t\twhitelist: [\n\t\t\t\t\"**\"\n\t\t\t],\n\t\t\tuse: [],\n\t\t\tmergeParams: true,\n\t\t\tauthentication: false,\n\t\t\tauthorization: false,\n\t\t\tautoAliases: true,\n\t\t\taliases: this.registerAlias(),\n\t\t\tbodyParsers: {\n\t\t\t\tjson: {\n\t\t\t\t\tstrict: false,\n\t\t\t\t\tlimit: \"1MB\"\n\t\t\t\t},\n\t\t\t\turlencoded: {\n\t\t\t\t\textended: true,\n\t\t\t\t\tlimit: \"1MB\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tmappingPolicy: \"all\", // Available values: \"all\", \"restrict\"\n\t\t\tlogging: true,\n\t\t\t/** BASE FUNCTIONS PRE-PROCESS REQUEST\n\t\t\t * THIS IS CAN OVERWRITE FROM CHILD SERVICES\n\t\t\t */\n\t\t\tonBeforeCall(ctx, route, req, res) {\n\t\t\t\tsef.onBeforeCallBase(ctx, route, req, res);\n\t\t\t},\n\n\t\t\t/** BASE FUNCTIONS PRE-PROCESS RESPONSE\n\t\t\t * THIS IS CAN OVERWRITE FROM CHILD SERVICES\n\t\t\t */\n\t\t\tonAfterCall(ctx, route, req, res, data) {\n\t\t\t\treturn sef.onAfterCallBase(ctx, route, req, res, data);\n\t\t\t},\n\n\t\t\tonError(req, res, err) {\n\t\t\t\treturn sef.onErrorBase(req, res, err);\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "b994be94d2276d22e16e12f91cc03d72", "score": "0.66914415", "text": "registerRoutes() {\n this.post(/^\\/api\\/auth\\/register$/i, (req, res) =>\n this.registerUser(req, res)\n );\n\n this.post(/^\\/api\\/auth\\/login$/i, (req, res) => this.logInUser(req, res));\n }", "title": "" }, { "docid": "815e11be205fbf7b5472afb66cadc126", "score": "0.6432742", "text": "_addAllRoutes() {\n this._addMiddleware();\n this._addCommandRoutes();\n this._addInfoRoutes();\n }", "title": "" }, { "docid": "140644ca137258b41fb5881b2a2086fc", "score": "0.6413865", "text": "extendRoutes(routes, resolve) {\n routes.forEach((route) => {\n if (route.name === \"video\") {\n route.path = \"/:video(\\\\d+)\";\n } else if (route.name === \"picture\") {\n route.path = \"/:picture(togopic\\\\.\\\\d+\\\\.\\\\d+)\";\n } else if (route.name === \"ajacs\") {\n route.path = \"/:ajacs(ajacs\\\\d+)\";\n }\n });\n const aliases = routes.map(route => ({\n path : /\\/$/.test(route.path) ? `${route.path}index.html` : `${route.path}.html`,\n alias : route.path,\n component: route.component\n }))\n routes.push(...aliases)\n }", "title": "" }, { "docid": "2ec55b2bdebbf519bf8c91c07879324b", "score": "0.6390047", "text": "applyRegistrationMiddleware(route) {\r\n this.configuration.registrationMiddleware.forEach(middleware => {\r\n route = middleware.applyMiddleware(route);\r\n });\r\n return route;\r\n }", "title": "" }, { "docid": "2ebcb389d65f38eb12342b350995ce21", "score": "0.6384258", "text": "_registerRoutes() {\n for (const middleware of this._config.middlewares) {\n this._app.use(middleware); // register middleware in app\n }\n for (const route of this._config.routes) {\n this._app.use(route.path, require(route.routerPath)(this, this._io)); // register router to route path\n }\n // catch-all 404 route (I will improve this later)\n this._app.all(\"*\", (req, res) =>\n res.status(404).send({\n status: \"error\",\n message: \"Not Found\",\n requestInfo: {\n method: req.method,\n url: req.url,\n originalUrl: req.originalUrl,\n },\n })\n );\n }", "title": "" }, { "docid": "a490dd3b6df86017e9858716f92c3228", "score": "0.63764226", "text": "registerRoutesCallback() {\n hydraExpress.registerRoutes({\n '/updates': UpdatesController,\n '/indicators': indicatorsController,\n });\n }", "title": "" }, { "docid": "3af78f906b573b9e53014413a2e531c3", "score": "0.63481116", "text": "function registerRoutes(router) {\n router.get('/:user_id', AuthService.authenticate(), getAll);\n router.post('/', AuthService.authenticate(), createPlace);\n router.get('/:_id', AuthService.authenticate(), getById);\n router.delete('/:_id', AuthService.authenticate(), removePlace);\n}", "title": "" }, { "docid": "483681c760aa3b280c0333710bd4f40f", "score": "0.62935185", "text": "_registerRoutes(){\n const options = {realpath: true};\n\n glob('./features/**/route.js', options, (er,fileNames) => {\n for(let fileName of fileNames) {\n let route = require(fileName);\n this.router.use(new route());\n }\n });\n }", "title": "" }, { "docid": "1a484d366fc6abfd9e8dc6c62de9907f", "score": "0.62655693", "text": "registerRoutes() {\n this.router.get('/testplan', this.getTestPlan.bind(this));\n }", "title": "" }, { "docid": "12d3eff286eead662bbace94dcf539e3", "score": "0.6264106", "text": "registerRoute(route) {\n // Validate before wiring up\n validate.route(route)\n\n this.router.route(route.path)\n .all(this.validateRequest.bind(this))\n\n // Wire the route up to Express\n route.methods.forEach(method => {\n if (method === 'GET') {\n this.router.route(route.path)\n .get((req, res, next) => {\n // Add custom response methods that routes will use\n res.reply = this._send.bind(this)\n res.error = this._error.bind(this)\n return route.handler(req, res, next, this.plugins)\n })\n } else if (method === 'POST') {\n this.router.route(route.path)\n .post((req, res, next) => {\n // Add custom response methods that routes will use\n res.reply = this._send.bind(this)\n res.error = this._error.bind(this)\n return route.handler(req, res, next, this.plugins)\n })\n } else if (method === 'PUT') {\n this.router.route(route.path)\n .put((req, res, next) => {\n // Add custom response methods that routes will use\n res.reply = this._send.bind(this)\n res.error = this._error.bind(this)\n return route.handler(req, res, next, this.plugins)\n })\n } else if (method === 'DELETE') {\n this.router.route(route.path)\n .delete((req, res, next) => {\n // Add custom response methods that routes will use\n res.reply = this._send.bind(this)\n res.error = this._error.bind(this)\n return route.handler(req, res, next, this.plugins)\n })\n } else {\n throw new Error(`Method ${method} is not valid HTTP method`)\n }\n })\n\n // Keep track of it internally for validation\n this.routes[route.path] = route\n }", "title": "" }, { "docid": "d77f672d5a12ce3c05b525e7c0ebc5db", "score": "0.61735356", "text": "routes() {\n this.app.use(indexRoutes_1.default);\n this.app.use('/api/users', usersRoutes_1.default);\n this.app.use('/api/specials', specialsRoutes_1.default);\n }", "title": "" }, { "docid": "a7c4b1c82606154be99ea26ebaeae1ca", "score": "0.6153734", "text": "routing(router) {\n router\n .group({middleware: 'api', prefix: '/api/v1'}, router => this.apiRouting(router))\n .group({middleware: 'web'}, router => this.webRouting(router))\n\n ;\n }", "title": "" }, { "docid": "76dc5a01b2a6940bbcca4ef62030f003", "score": "0.61214685", "text": "async _setRoutes() {\n\t\tthis._log('Setting routes');\n\t\tconst {\n\t\t\tappDir, createMissingComponents,\n\t\t} = this._config;\n\t\tthis._registerServiceRoutes();\n\t\tconst componentsMap = {};\n\t\tthis._routes.forEach((route) => {\n\t\t\tif (!route.contentComponent) {\n\t\t\t\tif (typeof route.callback === 'function') {\n\t\t\t\t\tthis._setRoute(route);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst callback = this._routeCallbacks[`${route.method} ${route.spec}`]?.callback;\n\t\t\t\tif (typeof callback === 'function') {\n\t\t\t\t\tthis._setRoute({ ...route, callback });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._warn(`Content component for ${route.spec} no set.`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = `__${md5(`${route.type}${route.spec}`)}__`;\n\t\t\tconst modulePath = !path.isAbsolute(route.contentComponent)\n\t\t\t\t? path.resolve(`${appDir}/${route.contentComponent}`)\n\t\t\t\t: route.contentComponent;\n\t\t\tcomponentsMap[key] = {\n\t\t\t\ttitle: route.title,\n\t\t\t\tspec: route.spec,\n\t\t\t\tpath: modulePath,\n\t\t\t\tlayout: route.layout || null,\n\t\t\t};\n\t\t\t// If the page component doesn't exist and the server shouldn't generate page components don't register the route.\n\t\t\tif (!this._componentExists(modulePath) && !createMissingComponents) {\n\t\t\t\tthis._warn(`Content component for ${route.spec} doesn't exist.`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._setRoute(route);\n\t\t});\n\t\tawait this._createRoutingFile(componentsMap);\n\t}", "title": "" }, { "docid": "d49e0b56c9584e0b8b7b07d4262bf129", "score": "0.6070998", "text": "buildRoutes() {\n this.app.use(\"/api\", new router_1.ApiRouter().getRouter());\n }", "title": "" }, { "docid": "d0d6e57fd16291bf53d286b3fa7cfd1f", "score": "0.60663664", "text": "routes() {\n }", "title": "" }, { "docid": "d52854b69d448e68606013fe1ebfbbd1", "score": "0.604719", "text": "function setupRoutes(app) {\nconst base = app.locals.base;\n app.get(`${base}/${IMAGES}/:group/:name/meta`, getMeta(app));\n app.get(`${base}/${IMAGES}/:group`, listImages(app));\n app.post(`${base}/${IMAGES}/:group`,upload.single('img'), createImage(app))\n app.get(`${base}/${IMAGES}/:group/:name`, getImage(app));\n app.post(`${base}/${STEG}/:group/:name`, jsonParser, stegHide(app));\n app.get(`${base}/${STEG}/:group/:name`, jsonParser, stegUnhide(app));\n\n}", "title": "" }, { "docid": "41c22e14001834b215c360dbfa47a64d", "score": "0.60438836", "text": "loadRoutes() {\n var routes = require(configuration_1.Configuration.path + '/app/http/routes'); //App routes\n var routes2 = require('../app/http/routes'); //Default app routes\n var routes = _.merge(routes, routes2);\n return new Promise((resolve, reject) => {\n /**\n * Load all routers in one place from different files\n * @param {[any]} var route in routes Express.js router object\n */\n console.log(routes);\n for (var route in routes) {\n this.app.use(`/${configuration_1.Configuration.customPath}${route}`, routes[route]);\n }\n resolve(true);\n });\n }", "title": "" }, { "docid": "5a37229cf174554cd4829c4b5770c94c", "score": "0.6029236", "text": "createRoutes() {\n const config = this.utils.getConfig()\n const routes = config.routes\n\n for (let route in routes) {\n const { methods, middlewarePath, tasks } = routes[route]\n new Route(route, methods, middlewarePath, tasks).createRoute(this.router)\n }\n\n this.app.use(this.router.routes()).use(this.router.allowedMethods())\n }", "title": "" }, { "docid": "9bb0e271b865dd038033cf8810adfd83", "score": "0.60280794", "text": "routes() {\n this.server.use(routes);\n this.server.use(Sentry.Handlers.errorHandler());\n }", "title": "" }, { "docid": "f9e1f519c1ea26a78060c3ee0ba45d8e", "score": "0.6013314", "text": "registerRouter(ospreyRouter) {\n let descriptor = this.descriptor;\n if (!ospreyRouter)\n ospreyRouter = theRouter;\n for (let verb in descriptor.methods) {\n let method = descriptor.methods[verb];\n var uriParameters = {};\n descriptor.uriParameters.forEach(x => uriParameters[x.__propertyName] = x);\n ospreyRouter[verb](descriptor.baseUri, uriParameters, this.getRequestHandler(verb, method));\n }\n }", "title": "" }, { "docid": "4f8c709651b1869298dd7fee0560e532", "score": "0.6003955", "text": "routes() {\n this.server.use(routes);\n }", "title": "" }, { "docid": "1779bfb4fd8c32a3bd046de91d78ae22", "score": "0.600394", "text": "configRoutesServer() {\n // Usuarios\n this.app.use(`/${constants_1.default.OPENBIS}/users`, this.usuariosRoute.route);\n // Autenticacion\n this.app.use(`/${constants_1.default.OPENBIS}/authentication`, this.authRoute.route);\n // Perfiles\n this.app.use(`/${constants_1.default.OPENBIS}/perfiles`, this.perfilesRoute.route);\n // Categorias\n this.app.use(`/${constants_1.default.OPENBIS}/categorias`, this.categoriasRoute.router);\n // Establecimientos\n this.app.use(`/${constants_1.default.OPENBIS}/establecimientos`, this.establecimientosRoute.router);\n // Proveedores\n this.app.use(`/${constants_1.default.OPENBIS}/proveedores`, this.proveedoresRoute.router);\n // Almacenes\n this.app.use(`/${constants_1.default.OPENBIS}/almacenes`, this.almacenesRoute.router);\n // Productos\n this.app.use(`/${constants_1.default.OPENBIS}/productos`, this.productosRoute.router);\n // Utilerias\n this.app.use(`/${constants_1.default.OPENBIS}/util`, this.utilRoute.route);\n }", "title": "" }, { "docid": "b30e88186cd3f8a78e52f07e7762e8d6", "score": "0.59853065", "text": "function registerRoutes() {\n app.use('/', WeatherRoute);\n}", "title": "" }, { "docid": "7b3196957715d82deb37fa938f4987b7", "score": "0.5976621", "text": "configureRoutes() {\n this.configureRestart();\n //this.configureCrash();\n this.configureGetTime();\n this.configureGetSystemInformations();\n }", "title": "" }, { "docid": "bd973e37740ec37b8f344352593111b7", "score": "0.59443027", "text": "addRoutes(routes) {\n Object.keys(routes).forEach((path) => {\n let name = path.replace(/\\//g, '.').replace(/(^\\.|:|\\.$)/g, '');\n this.addRoute(name, path, routes[path]);\n });\n }", "title": "" }, { "docid": "00ee59f9d0b8379eb04a17250730cdfe", "score": "0.59276646", "text": "extendRoutes(routes, resolve) {\n routes.push({\n path: '*',\n component: resolve(__dirname, 'pages/index.vue')\n })\n }", "title": "" }, { "docid": "783ba200e81b1ca26361916e847c06f5", "score": "0.5909996", "text": "static ROUTE_LIST() {\n const routes = super.ROUTE_LIST()\n delete routes.create\n return { login: { endpoint: '/login', type: 'post' }, ...routes }\n }", "title": "" }, { "docid": "721134d14f34796810b7a9fa0ebdcd81", "score": "0.58962464", "text": "_configRoutes() {\r\n \r\n }", "title": "" }, { "docid": "1ca8e3ec068382249625c32a1106a1f9", "score": "0.5874635", "text": "_registerRsConfig() {\n\t\tif (this._rsConfig) {\n\t\t\tconst {\n\t\t\t\troutes, components, socketClassDir, errorPage, componentProvider, error, componentErrorHandler,\n\t\t\t} = this._rsConfig;\n\t\t\tif (routes) {\n\t\t\t\tUtils.registerRoutes(this, routes.map((route) => {\n\t\t\t\t\tconst key = `${(route.route || 'GET').toLowerCase()} ${route.route}`;\n\t\t\t\t\tconst callback = this._tryRequireModule(route.callback)\n\t\t\t\t\t\t|| this._routeCallbacks[key]?.callback;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...route,\n\t\t\t\t\t\tcallback,\n\t\t\t\t\t};\n\t\t\t\t}));\n\t\t\t}\n\t\t\tif (components) {\n\t\t\t\tUtils.registerComponents(this, components);\n\t\t\t}\n\t\t\tif (socketClassDir) {\n\t\t\t\tUtils.registerSocketClassDir(this, path.resolve(process.cwd(), socketClassDir));\n\t\t\t}\n\t\t\tif (errorPage) {\n\t\t\t\tthis.registerErrorPage(errorPage);\n\t\t\t}\n\t\t\tif (error && error.page) {\n\t\t\t\tthis.registerErrorPage(error.page);\n\t\t\t}\n\t\t\tif (componentProvider) {\n\t\t\t\tthis.registerComponentProvider(componentProvider);\n\t\t\t}\n\t\t\tif (componentErrorHandler) {\n\t\t\t\tthis.registerComponentErrorHandler(componentErrorHandler);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "8a1c968183a9a0730e313905fcc0706b", "score": "0.58660674", "text": "loadAdminRoutes() {\n /**Admin */\n this.router.post('/login-admin', this.call['backend']['AdminController'].login);\n this.router.post('/forgot-password', this.call['backend']['AdminController'].forgotPassword);\n this.router.post('/reset-password', this.call['backend']['AdminController'].resetPassword);\n //this.router.get('/check-existing-admin', this.call['backend']['AdminController'].checkExistingAdmin);\n this.router.get('/async-check', this.call['backend']['AdminController'].asyncCheck);\n \n this.router.post('/add-edit-admin', this.call['backend']['AdminController'].addAdmin);\n this.router.get('/get-admins', this.call['backend']['AdminController'].getAdmins);\n this.router.get('/get-a-admin', this.call['backend']['AdminController'].getAAdmin);\n \n\n /**ROLE */\n this.router.post('/add-edit-role', this.call['backend']['RoleController'].addEditRole);\n this.router.get('/get-roles', this.call['backend']['RoleController'].getRoles);\n this.router.get('/get-a-role', this.call['backend']['RoleController'].getARole);\n /**user */\n this.router.post('/add-user', this.call['backend']['userController'].adduser);\n this.router.get('/view-user', this.call['backend']['userController'].viewuser);\n // this.router.post('/my-profile', this.call['backend']['AdminController'].profile);\n \n // this.router.post('/reset-password', this.call['backend']['AdminController'].resetPassword);\n\n \n }", "title": "" }, { "docid": "d6008710a34f97c11d43470737cb2110", "score": "0.5857774", "text": "routes() {\n //Usamos un middlware condicional \n //entra a nuestra api\n this.app.use(this.apiPath, require('./routes/api.routes'))\n //entra a nuestro public donde hacemos el render del html (a futuro)\n this.app.use(this.publicPath, require('./routes/tienda.routes'))\n /* Rutas Del CRUD administrador */\n this.app.use(this.publicPath, require('./routes/admin.routes'))\n /* Rutas para las categorias */\n this.app.use(this.publicPath, require('./routes/categorias.routes'))\n /* Rutas para el usuario */\n this.app.use(this.publicPath, require('./routes/user.routes'))\n }", "title": "" }, { "docid": "a7546deb56003cef6866a7cd3bc17ba9", "score": "0.5855572", "text": "routes(){\n //PERSONAL\n this.app.use(this.personalPath,require('../routes/personal.rout'))\n \n //CATEGORIA\n this.app.use(this.categoriaPath,require('../routes/categoria.rout'))\n\n //TIPO USUARIO\n this.app.use(this.tipoPath,require('../routes/tipousuario.rout'))\n\n //USUARIO\n this.app.use(this.usuarioPath,require('../routes/usuario.rout'))\n\n //ARTICULO\n this.app.use(this.articuloPath,require('../routes/articulo.rout'))\n\n //COMENTARIO\n this.app.use(this.comentarioPath,require('../routes/comentario.rout'))\n\n //RECURSO\n this.app.use(this.recursoPath,require('../routes/recurso.rout'))\n \n }", "title": "" }, { "docid": "10b18e547c59e77f1c91abd24560d508", "score": "0.58486056", "text": "setup_instance_routes() {\n\n this._router\n .route(this.instance_route)\n .get(this.get_instance_request.bind(this))\n .patch(this.patch_instance_request.bind(this));\n }", "title": "" }, { "docid": "89fbb138034f3089009aaa5097323624", "score": "0.5838979", "text": "routes() {\n this.express.use(routes);\n }", "title": "" }, { "docid": "96b47c6b86fed9725aede32e41f93f80", "score": "0.5838276", "text": "register(router, controller, { name, prefix }) {\n\n for (const key in REST_MAP) {\n\n let formatedName;\n\n const opts = REST_MAP[key];\n\n\n if (!controller.prototype[key]) continue;\n\n const action = FileLoader.methodToMiddleware(controller, key);\n\n if (opts.member) {\n formatedName = inflection.singularize(name);\n } else {\n formatedName = inflection.pluralize(name);\n }\n\n if (opts.namePrefix) {\n formatedName = opts.namePrefix + formatedName;\n }\n\n const path = opts.suffix ? `${prefix}${opts.suffix}` : prefix;\n const method = Array.isArray(opts.method) ? opts.method : [opts.method];\n router.register(path, method, action, { name: formatedName });\n }\n\n }", "title": "" }, { "docid": "6bb6057f32ecd738d8f9f5625df37c51", "score": "0.58201385", "text": "add(pattern, handler) {\n router.routes.push(createRoute(pattern, handler))\n }", "title": "" }, { "docid": "8c0336a8b2af5a9478d806d655e8713b", "score": "0.58011985", "text": "_addRoutes() {\n const router = this._router;\n\n this._bindParam('authorId');\n this._bindParam('documentId');\n this._bindParam('revNum');\n\n this._bindHandler('change', ':documentId/:revNum');\n this._bindHandler('client-test');\n this._bindHandler('edit', ':documentId');\n this._bindHandler('edit', ':documentId/:authorId');\n this._bindHandler('key', ':documentId');\n this._bindHandler('key', ':documentId/:authorId');\n this._bindHandler('log');\n this._bindHandler('snapshot', ':documentId');\n this._bindHandler('snapshot', ':documentId/:revNum');\n\n router.use(this._error.bind(this));\n }", "title": "" }, { "docid": "0930a6c4f019ca095979ef898b1710cb", "score": "0.5792978", "text": "setExpressRoutes(routes) {\n routes.forEach((route) => {\n route.setPolicies(this.expressRouter);\n route.setRoute(this.expressRouter);\n });\n }", "title": "" }, { "docid": "49519eb624628722c5a2bc277420e353", "score": "0.5758771", "text": "extendRoutes (routes, resolve) {\n routes.push({\n name: 'page',\n path: '*',\n component: resolve(__dirname, '~/pages/error.vue')\n })\n }", "title": "" }, { "docid": "91223244d573e1d9f3059cbfbf2d072d", "score": "0.57579553", "text": "includeRoutes() {\n new routes(this.app).routesConfig();\n new socketEvents(this.socket).socketConfig();\n }", "title": "" }, { "docid": "7e304711adae0244acfe74e9906ef458", "score": "0.574674", "text": "routes() {\n this.app.use(this.apiPaths.customers, customer_1.default);\n this.app.use(this.apiPaths.ecommerce, ecommerce_1.default);\n this.app.use(this.apiPaths.channel, channel_1.default);\n this.app.use(this.apiPaths.orders, order_1.default);\n this.app.use(this.apiPaths.metrics, metrics_1.default);\n //Error handling\n this.app.use((err, req, res, next) => {\n res.status(500).json({\n message: err.message\n });\n });\n }", "title": "" }, { "docid": "1fcd3218862f667686bd16235d810d4e", "score": "0.5730942", "text": "getRoutes () {\n\t\tlet standardRoutes = super.getRoutes(COMPANY_STANDARD_ROUTES);\n\t\treturn [...standardRoutes, ...COMPANY_ADDITIONAL_ROUTES];\n\t}", "title": "" }, { "docid": "700d252b5762b70f0dfffe8b6d97b7e3", "score": "0.5693191", "text": "routes() {\n this.router.get('/:_id', this.getOneEvent);\n this.router.get('/', this.getEvents);\n this.router.post('/', this.createEvent);\n this.router.put('/:_id', this.updateEvent);\n this.router.delete('/:_id', this.deleteEvent);\n }", "title": "" }, { "docid": "2c18b6d9f4c3c11d65fcf19766c9e818", "score": "0.56626636", "text": "routes() {\n // le damos uso al enrutador index\n this.app.use(index_route_1.default);\n this.app.use(movimiento_route_1.default);\n this.app.use(articulo_route_1.default);\n this.app.use(categoria_route_1.default);\n this.app.use(seccion_route_1.default);\n this.app.use(autenticacion_route_1.default);\n this.app.use('/upload', express_1.default.static(path_1.default.resolve('uploads')));\n }", "title": "" }, { "docid": "3250c1c904c0186aed539d5732c28d46", "score": "0.5628553", "text": "_setRouteAliases() {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n if (this.APP_GLOBAL.isEntities() && this.APP_GLOBAL.isAliases()) {\n this.router.config = ParseModuleRoutesForAliases(this.router.config);\n this.router.config.reduce((acc, route) => {\n if (route.loadChildren && route.data && route.data.routeAliases) {\n this.router.configLoader.load(this.injector, route).subscribe({\n next: (moduleConf) => {\n route._loadedConfig = moduleConf;\n ParseModuleRoutesForAliases(moduleConf.routes);\n return route.path;\n }\n });\n }\n return acc;\n }, []);\n yield Sleep(5);\n return resolve(true);\n }\n else {\n yield Sleep(5);\n return resolve(true);\n }\n }));\n }", "title": "" }, { "docid": "0c843cb8892800fb9ff984b496381970", "score": "0.5609225", "text": "buildCustomRoutes (app, footprintRoutes) {\n return lib.RouteBuilder.mergeCustomRoutes(app.config.routes, footprintRoutes)\n }", "title": "" }, { "docid": "e3fe82e4cdcd6eb7cf16d1424176dbf5", "score": "0.5605522", "text": "routes() {\n this.router.get(\"/\", this.all);\n this.router.get(\"/bygoalid/:id\", this.oneById);\n // this.router.get(\"/bybuyerpassword/:base64\", this.byPassword);\n this.router.post(\"/\", this.create);\n this.router.put(\"/:id\", this.update);\n this.router.delete(\"/:id\", this.delete);\n }", "title": "" }, { "docid": "d7ca94eeb2ddcc45b63a79305eb58be0", "score": "0.56018317", "text": "routes() {\n this.app.use(index_route_1.default);\n this.app.use(imagenobra_route_1.default);\n this.app.use(obra_route_1.default);\n this.app.use(donaciones_route_1.default);\n this.app.use(contacto_route_1.default);\n this.app.use(quienessomos_route_1.default);\n this.app.use(categoriagaleria_route_1.default);\n this.app.use(categoriadonacion_route_1.default);\n this.app.use(tipoobra_route_1.default);\n this.app.use(categoriaobra_route_1.default);\n this.app.use(clasecontacto_route_1.default);\n this.app.use(autenticacion_route_1.default);\n this.app.use(imagengaleria_route_1.default);\n this.app.use(galeria_route_1.default);\n //la app usara la ruta upload para que el navegador pueda leer la carpeta y las imagenes\n this.app.use('/uploads', express_1.default.static(path_1.default.resolve('uploads')));\n }", "title": "" }, { "docid": "e4633c7e52d58393493f1f814e8e08fa", "score": "0.5601717", "text": "getRoutes () {\n\t\tlet standardRoutes = super.getRoutes(STANDARD_ROUTES);\n\t\treturn standardRoutes;\n\t}", "title": "" }, { "docid": "9d32ff291e32c989883ca92b3bdb8570", "score": "0.5584508", "text": "function initRouters() {\n var r = new DefaultRouter({ App: _shim });\n _shim.reg('Routers', 'DefaultRouter', r);\n }", "title": "" }, { "docid": "958d6404b3e0fa98b0eadb7732eb97bc", "score": "0.5582629", "text": "routes() {\n this.router.get(\"/bycompanyid/:companyId\", this.all);\n this.router.get(\"/bycustomerid/:customerId\", this.oneById);\n this.router.get(\"/bycustomerpassword/:base64\", this.byPassword);\n this.router.post(\"/\", this.create);\n this.router.put(\"/:customerId\", this.update);\n this.router.delete(\"/:customerId\", this.delete);\n this.router.post(\"/uploadImg\", this.uploadFile);\n }", "title": "" }, { "docid": "ad95554f2e33c17e07767d31942a57e5", "score": "0.5561364", "text": "function loadRoutes() {\n try {\n var list = Crux.util.readDirectory(Component.appPath(this.config.path.routes), 'js'),\n self = this;\n if(list.length === 0) {\n return log.warn('Crux.server: component has no routes.');\n }\n } catch(e) {\n return;\n }\n\n list.forEach(function(routePath) {\n var routeObj = require(routePath);\n if(routeObj.skip === true) return;\n var httpRouteObj = self.createHttpRoute(routePath);\n if(!_.isFunction(routeObj)) {\n log.warn('Crux.server: Route %s does not export a function.', httpRouteObj.__rootPath);\n return;\n }\n routeObj(httpRouteObj);\n if(typeof self.routes[httpRouteObj.__namespace] !== 'undefined') {\n throw new Error(\"Route namespace \" + httpRouteObj.__namespace + \" previously registered.\");\n }\n self.routes[httpRouteObj.__namespace] = httpRouteObj;\n routeCount++;\n });\n if(self.config.debug) {\n log.trace('Crux.server: %s route(s) loaded.', routeCount);\n }\n}", "title": "" }, { "docid": "26c8b5b9fbfc2e522d535c71e82bf505", "score": "0.5559753", "text": "function Registry(/* host */) {\n // Herein we keep track of RouteRecognizer instances\n // keyed by HTTP method. Feel free to add more as needed.\n this.verbs = {\n GET: new RouteRecognizer$$1(),\n PUT: new RouteRecognizer$$1(),\n POST: new RouteRecognizer$$1(),\n DELETE: new RouteRecognizer$$1(),\n PATCH: new RouteRecognizer$$1(),\n HEAD: new RouteRecognizer$$1(),\n OPTIONS: new RouteRecognizer$$1()\n };\n }", "title": "" }, { "docid": "e7f677926ac373f0e69d8c5051865ef6", "score": "0.55520475", "text": "appRoutes(){\n\t\tthis.app.get('/searchProduct/:searchterm', routeHandler.searchProductHandler);\n\n\t\tthis.app.post('/products/:pageNo', routeHandler.productsHandler);\n\n\t\tthis.app.get('/filterData', routeHandler.filterDataHandler);\n\n\t\tthis.app.get('/productDetails/:id', routeHandler.productDetailsHandler);\n\n\t\tthis.app.get('*', routeHandler.routeNotFoundHandler);\t\t\n\t}", "title": "" }, { "docid": "0bb3d8b43dcd263211cfc5ff2ec25b80", "score": "0.55347097", "text": "addRoute(method, route, ...handlers) {\n this.routes.add({\n method,\n route,\n handlers\n });\n }", "title": "" }, { "docid": "f091de1a88b16b84059e4c44d57f5ccf", "score": "0.55312216", "text": "register() {\n this.registerHttpExceptionHandler();\n this.registerHealthCheck();\n }", "title": "" }, { "docid": "29cddf5cb7d4f5677387cba0433a8856", "score": "0.5523109", "text": "registerServices() {\n\n\t\tvar router_services = this.services;\n\t\tObject.keys(router_services).forEach( full_path => {\n\t\t\t// Nombre de la función logica\n\t\t\tvar service_function = router_services[full_path];\n\t\t\tvar path_items = full_path.split(' ');\n\t\t\t// Por defecto es GET.\n\t\t\tvar verb = (path_items.length > 1 ? path_items[0] : 'get').toLowerCase();\n\t\t\tvar path = this.routePath + (path_items.length > 1 ? path_items[1] : full_path);\n\t\t\t// bindeo el servicio a la lógica de express.\t\t\t\n\t\t\tthis.app[verb](path, this[service_function].bind(this));\n\t\t});\n\t}", "title": "" }, { "docid": "0c76fa8249b76cc8330831de233f7556", "score": "0.55021894", "text": "applyRouters() {\n // Rotas públicas\n this.express.post('/api/party/create', this.authenticate, (request, response) => this.create(request, response));\n }", "title": "" }, { "docid": "a6c2c7efd54bca5206df2ee2d74fe6ba", "score": "0.5500812", "text": "appRoutes() {\n this.app.post('/user', routeHandler.createNewUserRouteHandler); \n\n this.app.get('/user/:username', routeHandler.findUserByUsernameRouteHandler); \n\n this.app.delete('/user/:username', routeHandler.deleteUserByUsernameRouteHandler); \n\n this.app.put('/user/:username', routeHandler.updateUserRouteHandler);\n\n this.app.get('*', routeHandler.routeNotFoundHandler);\n }", "title": "" }, { "docid": "56d218d95f752d67e95716ee4d0db589", "score": "0.54935086", "text": "register() {\n this\n .useLogin()\n .useRegister()\n .useGoogleOAuth()\n .useTokenValidate();\n if (environment_1.environment.isDebug)\n this.useTokenDecode();\n this.app.use(`/auth`, this.router);\n return this;\n }", "title": "" }, { "docid": "5e050251618baa06fcaec19cc72c4e2e", "score": "0.5491629", "text": "registerRoute(route) {\n this.routeSlot.register(route);\n return this;\n }", "title": "" }, { "docid": "bc120fc037f4bd7e437d4efda18e0680", "score": "0.54840624", "text": "register() {\n\t\tthis.loadAndPublishConfig(this.app.formatPath(__dirname, 'config'));\n\t\tthis.bindLogger();\n\t\tthis.bindLogLevelEnum();\n\t}", "title": "" }, { "docid": "1d6ecc853c28ce17ebe6c76147b83d1f", "score": "0.5448802", "text": "function getRoutes() {\n return [\n {\n url: '/',\n config: {\n templateUrl: 'app/dashboard/dashboard.html',\n title: 'dashboard',\n settings: {\n nav: 1,\n content: '<i class=\"fa fa-dashboard\"></i> Dashboard',\n }\n }\n }, {\n url: '/admin-spec',\n config: {\n title: 'admin',\n templateUrl: 'app/admin/admin.html',\n settings: {\n nav: 2,\n content: '<i class=\"fa fa-lock\"></i> Speciality',\n roles: ['ROLE_ADMIN'],\n isChild: true\n }\n }\n }, {\n url: '/admin-users',\n config: {\n title: 'admin',\n templateUrl: 'app/admin/adminusers.html',\n settings: {\n nav: 3,\n content: '<i class=\"fa fa-lock\"></i> Users',\n roles: ['ROLE_ADMIN'],\n isChild: true\n }\n }\n }, {\n url: '/admin-reviews',\n config: {\n title: 'admin',\n templateUrl: 'app/admin/adminrev.html',\n settings: {\n nav: 4,\n content: '<i class=\"fa fa-lock\"></i> Reviews',\n roles: ['ROLE_ADMIN'],\n isChild: true\n }\n }\n }, {\n url: '/mester',\n config: {\n title: 'mester',\n templateUrl: 'app/mester/mester.html',\n settings: {\n nav: 5,\n content: '<i class=\"fa fa-arrows\"></i> Profile',\n roles: ['ROLE_MESTER'],\n isChild: true\n }\n }\n }, {\n url: '/mester-reviews',\n config: {\n title: 'mester',\n templateUrl: 'app/mester/mesterrev.html',\n settings: {\n nav: 6,\n content: '<i class=\"fa fa-arrows\"></i> Reviews',\n roles: ['ROLE_MESTER'],\n isChild: true\n }\n }\n }, {\n url: '/details/:mesterId/:clientId',\n config: {\n title: 'details',\n templateUrl: 'app/details/details.html'\n }\n }, {\n url: '/details/:mesterId',\n config: {\n title: 'details',\n templateUrl: 'app/details/details.html'\n }\n }, {\n url: '/clientdetails/:clientId',\n config: {\n title: 'details',\n templateUrl: 'app/details/clientdetails.html'\n }\n }, {\n url: '/admin/:id',\n config: {\n title: 'details',\n templateUrl: 'app/admin/adminprofile.html',\n roles: ['ROLE_ADMIN'],\n }\n }, {\n url: '/client',\n config: {\n title: 'client',\n templateUrl: 'app/client/client.html',\n settings: {\n nav: 7,\n content: '<i class=\"fa fa-arrows\"></i> Profile',\n roles: ['ROLE_CLIENT'],\n isChild: true\n }\n }\n }, {\n url: '/client-reviews',\n config: {\n title: 'client',\n templateUrl: 'app/client/clientrev.html',\n settings: {\n nav: 8,\n content: '<i class=\"fa fa-arrows\"></i> Reviews',\n roles: ['ROLE_CLIENT'],\n isChild: true\n }\n }\n }, {\n url: '/signUp',\n config: {\n title: 'signUp',\n templateUrl: 'app/signUp/signUp.html'\n }\n }, {\n url: '/activateUser/:tokenId',\n config: {\n title: 'activate',\n templateUrl: 'app/activate/activate.html'\n }\n }, {\n url: '/resetPassword',\n config: {\n title: 'activate',\n templateUrl: 'app/activate/resetpassword.html'\n }\n }, {\n url: '/resetPassword/:tokenId',\n config: {\n title: 'activate',\n templateUrl: 'app/activate/resetform.html'\n }\n }\n ];\n }", "title": "" }, { "docid": "e026e77a0b6f84e42f2c9ef756b61824", "score": "0.5447453", "text": "routes () {\n this.express.use(require('./routes'))\n }", "title": "" }, { "docid": "4e4a5e3de874fff9665ccde644249fc3", "score": "0.54440176", "text": "function getRoutes() {\n return [\n {\n url: '/',\n config: {\n templateUrl: 'app/test/testMain.html',\n //controller: 'testMain',\n title: 'Test Main',\n settings: {\n nav: 1\n }\n }\n },\n {\n url: '/authError',\n config: {\n templateUrl: 'app/test/testAuthError.html',\n //controller: 'testAuthError',\n title: 'Auth Error',\n settings: {\n nav: 2\n }\n }\n }\n ];\n }", "title": "" }, { "docid": "c53d4636ee22ac4b882bb4a07aba9bf9", "score": "0.54317087", "text": "get routes(){\n\t\treturn {\n\t\t\t'get /': [actionFilter, 'index'],\n\t\t\t'get /home/about': 'about'\n\t\t}\n\t}", "title": "" }, { "docid": "125bef36566e38a5274e57e99768eadf", "score": "0.5410217", "text": "loadAppRoutes() {\n // this.router.get('/send-otp', this.call['User']['UserController'].sendOTP);\n }", "title": "" }, { "docid": "27e5dca4b6a9e516ebe159fbc649bd5a", "score": "0.54079515", "text": "_initialize(){\n _each(this.routes, (route) => {\n route.regx = Router.routeToRegExp(route.path);\n });\n\n /** Adds prefix to regular expressions **/\n if(process.env.NODE_ENV !== 'production'){\n this.routes = this.routes.map((route) => {\n let path = route.path;\n if(path.indexOf('/') > 1){\n console.warn('Route should start with \"/\" char. Or should be index page \"(/)\". It can cause unexpected behaviour!', route);\n }\n route.regx = __modifyRouteRegx(route.regx);\n return route;\n });\n }\n }", "title": "" }, { "docid": "dbdbb9a637dae7f1cc4eb71f66725098", "score": "0.5394825", "text": "function setRoutes(app) {\n log('EVENTS setRoutes')\n // list all simulations for the user\n app.get('/events',\n csgrant.authenticate,\n csgrant.ownsResource('simulations', false),\n function(req, res) {\n const r = {\n success: true,\n operation: \"get pending events\",\n result: eventsQueue,\n requester: req.user\n }\n res.jsonp(r)\n }\n )\n // post a new event to be sent to portal\n app.post('/events',\n csgrant.authenticate,\n csgrant.ownsResource('simulations', false),\n function(req, res) {\n emit(req.body)\n const r = {\n success: true,\n operation: \"posted event\",\n requester: req.user\n }\n res.jsonp(r)\n }\n )\n}", "title": "" }, { "docid": "c290bd8c5748f3457b8cacf9c9fa50cb", "score": "0.5390096", "text": "async _setRegistar() {\n const web3 = this.web3;\n const registryAddress = this.network.type.ens.registry;\n this.registryContract = new web3.eth.Contract(RegistryAbi, registryAddress);\n this.registrarAddress = await this.ens.owner(this.tld);\n this._setRegistrarContracts();\n }", "title": "" }, { "docid": "36da875b563ec49601a5d7ee2bd8e7e9", "score": "0.53839266", "text": "compileRouter() {\n this.addons.forEach((addon) => {\n addon._middleware(this.router, this);\n });\n this._middleware(this.router, this);\n\n this._routes(this.router, this);\n this.addons.reverse().forEach((addon) => {\n addon._routes(this.router, this);\n });\n }", "title": "" }, { "docid": "f81f636ba81ffbbb5379ba261cf28fe2", "score": "0.53811795", "text": "function setupRoutes(app) {\n const base = app.locals.base;\n app.get(`/`, getDefault(app));\n app.get(`${base}/${USERS}/list`, listUsers(app));\n app.post(`${base}/${USERS}/register`, bodyParser.urlencoded({ extended: false }), registerUser(app));\n app.delete(`${base}/${USERS}/removeusers`, bodyParser.urlencoded({extended: false}), deleteUser(app));\n}", "title": "" }, { "docid": "43a47c343e070f8804c3cd0b89542c5b", "score": "0.5377389", "text": "function addRoutes(api) {\n api.post('/birds', createBird);\n api.get('/birds', getBirds);\n}", "title": "" }, { "docid": "332151fd882242240b0cc027a82050f2", "score": "0.53679043", "text": "publishRoute(BaseRoute) {\n if (!BaseRoute) {\n throw new Error('The base router must be provided')\n } else {\n this.routes.push(BaseRoute)\n }\n }", "title": "" }, { "docid": "82d1e667bb6005f967e867fd7b4eb42d", "score": "0.53383553", "text": "function getRouters() {\n return {\n // 'POST /res/getCameraVideo': Video.getCameraVideo,\n // 'POST /res/delCameraVideo': Video.delCameraVideo,\n }\n}", "title": "" }, { "docid": "caf4b4d1036890fc45d8cf7e910c1985", "score": "0.5336102", "text": "function RouteWithSubRoutes({ component: C, path, routes, restrictToGroups, ...rest }) {\n return (\n <Route path={path}>\n <Suspense fallback={<Spin/>}>\n <C routes={routes}/>\n </Suspense>\n </Route>\n );\n}", "title": "" }, { "docid": "c19494f106227363a800c5b8e5ed3180", "score": "0.532134", "text": "addRouteGlobal(View, Route) {\n /**\n * Adding `route` global\n */\n View.global('route', (routeIdentifier, params, options) => {\n return Route.makeUrl(routeIdentifier, params, options);\n });\n /**\n * Adding `signedRoute` global\n */\n View.global('signedRoute', (routeIdentifier, params, options) => {\n return Route.makeSignedUrl(routeIdentifier, params, options);\n });\n }", "title": "" }, { "docid": "b8e476e5616b9e970768f04216e4394f", "score": "0.5320893", "text": "routes() {\n throw new Error('keystone.routes(fn) has been removed, use keystone.set(\\'routes\\', fn)');\n }", "title": "" }, { "docid": "f2a0924f44eb4320784e40939f164adb", "score": "0.53164506", "text": "initAppRoutes() {\n // We will setup our graphql route here\n }", "title": "" }, { "docid": "b57eaf924dd8df6a11a6029300388df2", "score": "0.53122914", "text": "routes() { return this.router; }", "title": "" }, { "docid": "7c2a3562445fd280e6eddc4ca9585cc1", "score": "0.5300006", "text": "function configureRoutes() {\n app.get('/palindrome', require('./service/algoritms').getPalindrome);\n app.get('/kcomplementary', require('./service/algoritms').getKComplementary);\n }", "title": "" }, { "docid": "b1bec204854b06eaeaf62cad02760587", "score": "0.5281011", "text": "async changePermissions({ dispatch }) {\n const { permissions } = await dispatch('getInfo');\n // generate permitted routes map based on permissions\n const permittedRoutes = await dispatch('permission/generatePermittedRoutes', permissions, { root: true });\n resetRouter();\n // dynamically add permitted routes\n permittedRoutes.forEach(route => router.addRoute(route));\n fixedRoutes.forEach(route => router.addRoute(route));\n }", "title": "" }, { "docid": "fd1e6e4cb08af56bca8dd0140c611511", "score": "0.5258228", "text": "_init() {\n for( let method in this.routes ) {\n this.routes[method].forEach( route => {\n this.router[method](route.path, this[route.method]);\n });\n }\n }", "title": "" }, { "docid": "9fbb3abf6bf7a5f99367a859420b11cd", "score": "0.5249918", "text": "function setupRoutes(){\r\n app.use('/users', users);\r\n}", "title": "" }, { "docid": "c4033228edacd820fd999190cc9927fa", "score": "0.52211946", "text": "load(app) {\n app.use('/users', userRouter);\n app.use('/auth', authRouter);\n }", "title": "" }, { "docid": "0ba14629cb817c118da2fe5e2c6f069b", "score": "0.5216345", "text": "function configRoute() {\n routes.forEach(function (r) {\n $stateProvider.state(r.state, r.config);\n });\n\n $urlRouterProvider.otherwise('/login');\n }", "title": "" }, { "docid": "61e500f8170368810fe46347ccab860b", "score": "0.52082044", "text": "function useRoute() {\r\n return inject(routeLocationKey);\r\n}", "title": "" }, { "docid": "57f06527e3bd075b79c6f6af03cb34f3", "score": "0.52060306", "text": "addPostRoute(route, ...handlers) {\n this.addRoute('post', route, ...handlers);\n }", "title": "" }, { "docid": "803668b7ac6724e48e71dd55cb89e3de", "score": "0.5191899", "text": "function loadRoutes() {\n const context = require.context('@/resources', true, /routes.js$/i)\n return context.keys()\n .map(context) // import module\n .map(m => m.default) // get `default` export from each resolved module\n}", "title": "" }, { "docid": "fadc3b23c2dcce1569563c38e6cd698a", "score": "0.5165663", "text": "setting(server) {\n const routes = bind(server);\n Promise.all(routes);\n }", "title": "" }, { "docid": "8a2d911d616b031a2b52c6f839eecaa5", "score": "0.5163826", "text": "config() {\n this.router.get('/', pacientesController_1.pacientesController.list);\n this.router.get('/:id', pacientesController_1.pacientesController.getOne);\n this.router.post('/', pacientesController_1.pacientesController.create);\n this.router.delete('/:id', pacientesController_1.pacientesController.delete);\n this.router.put('/:id', pacientesController_1.pacientesController.update);\n }", "title": "" }, { "docid": "14511b37e5182e905f6db1068fa2af22", "score": "0.51627123", "text": "createMethodsProxy() {\n\n const globalFeatures = ConfigValidator.validate(this.config);\n\n const routerParamFactory = new RouterParamFactory();\n const contextCreator = new ContextCreator(globalFeatures);\n const routerProxy = new RouterProxy(contextCreator, ExceptionHandler, routerParamFactory);\n\n const controllerModules = listModule(CONTROLLER_MODULE_METADATA);\n\n for (const controller of controllerModules) {\n const controllerMetadata = getClassMetadata(PATH_METADATA, controller);\n const priorityMetadata = getClassMetadata(PRIORITY_METADATA, controller);\n const routerMetadatas = getClassMetadata(ROUTE_OPTIONS_METADATA, controller) || [];\n if (Array.isArray(routerMetadatas) && routerMetadatas.length !== 0) {\n for (const routerMetadata of routerMetadatas) {\n routerProxy.createCallbackProxy({ method: routerMetadata.method, targetCallback: routerMetadata.targetCallback }, controller);\n }\n }\n if (controllerMetadata.isRestful) {\n for (const key in REST_MAP) {\n const targetCallback = controller.prototype[key];\n if (targetCallback) {\n routerProxy.createCallbackProxy({ method: key, targetCallback }, controller);\n }\n }\n }\n this.resolveRouters(controller, controllerMetadata, priorityMetadata, routerMetadatas);\n }\n\n\n // implement @Piority\n this.app.beforeStart(() => {\n this.prioritySortRouters\n .sort((routerA, routerB) => routerB.priority - routerA.priority)\n .forEach(prioritySortRouter => {\n this.app.router.use(prioritySortRouter.router.routes());\n });\n });\n\n\n }", "title": "" }, { "docid": "05e37cc3dc55ffa51c90ab1af29b43b5", "score": "0.5155038", "text": "function configureRoutes(app,type,handlers) {\n\t// CONFIGURING GET ROUTES\n\tif (type == \"get\") {\n\t\tfor ( var route in handlers ) {\n\t\t\tif ( typeof handlers[route] === 'function' ) {\n\t\t\t\tapp.get(route,handlers[route]);\n\t\t\t}\n\t\t}\n\t}\n\t// CONFIGURING POST ROUTES\n\telse if ( type == \"post\" ) {\n\t\tfor ( var route in handlers ) {\n\t\t\tif ( typeof handlers[route] === 'function' ) {\n\t\t\t\tapp.post(route,handlers[route]);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "94a0f31873df8a298591af1d601f7b0f", "score": "0.5147586", "text": "addRoute(route) {\n this.options.routes.push(route);\n this.handleRoute(route);\n }", "title": "" }, { "docid": "a89c87ec46a2f7974f485039d17e821b", "score": "0.51451415", "text": "function mapRoutes(app) {\n classRoutes.mapRoutes(app);\n studentRoutes.mapRoutes(app);\n schoolRoutes.mapRoutes(app);\n testRoutes.mapRoutes(app);\n professorRoutes.mapRoutes(app);\n\n // Send a 404 to any unhandled request.\n app.all('/BackOffice/*', function (req, res) {\n res.status(404).render('Erros/404');\n });\n}", "title": "" }, { "docid": "ab7f8e05cabb9d8ef5716a5b13737d4b", "score": "0.51249415", "text": "function setupRoutes(app){\n const APP_DIR = `${__dirname}/app`\n const features = fs.readdirSync(APP_DIR).filter(\n file => fs.statSync(`${APP_DIR}/${file}`).isDirectory()\n )\n\n features.forEach(feature => {\n const router = express.Router()\n const routes = require(`${APP_DIR}/${feature}/routes.js`)\n\n routes.setup(router)\n app.use(`/${feature}`, router)\n })\n}", "title": "" }, { "docid": "17baadcccc104fc7325654a00b677ac5", "score": "0.51235175", "text": "config() {\n this.router.get('/', consultoriosController_1.consultoriosController.list);\n this.router.get('/:id', consultoriosController_1.consultoriosController.getOne);\n this.router.post('/', consultoriosController_1.consultoriosController.create);\n this.router.delete('/:id', consultoriosController_1.consultoriosController.delete);\n this.router.put('/:id', consultoriosController_1.consultoriosController.update);\n }", "title": "" } ]
177c006ab27aced9217d1ddba31cadfa
make and display the control field
[ { "docid": "b8f9d3773e8e65692195ef4bf9deb7e6", "score": "0.5708568", "text": "function makeControls() {\n var fieldset = $(String.prototype.concat(\n '<fieldset>',\n '<legend>' + i18n.msg('legendTop').escape() + '</legend>',\n '<table><tbody>',\n '<tr>',\n '<td class=\"mw-label\" style=\"vertical-align: middle;\">',\n '<label for=\"' + PREFIX + '-user\">',\n i18n.msg('labelUser').escape() + ':',\n '</label>',\n '</td>',\n '<td class=\"mw-input\">',\n '<input id=\"' + PREFIX,\n '-user\" type=\"text\" size=\"20\" maxlength=\"85\"/>',\n ' ',\n '<input id=\"' + PREFIX,\n '-go\" type=\"button\" value=\"' + i18n.msg('inputGo').escape() + '\"/>',\n '</td>',\n '</tr>',\n '<tr>',\n '<td colspan=\"2\">',\n '<fieldset>',\n '<legend>' + i18n.msg('legendSub').escape() + '</legend>',\n '<small><table><tbody id=\"' + PREFIX + '-nspaces\">',\n '<tr>',\n '<td colspan=\"4\" class=\"mw-label\">',\n '<input id=\"' + PREFIX,\n '-nsall\" type=\"button\" value=\"' + i18n.msg('inputAll').escape(),\n '\"/>',\n ' ',\n '<input id=\"' + PREFIX,\n '-nsnone\" type=\"button\" value=\"' + i18n.msg('inputNone').escape(),\n '\"/>',\n ' ',\n '<input id=\"' + PREFIX,\n '-nsflip\" type=\"button\" value=\"' + i18n.msg('inputFlip').escape(),\n '\"/>',\n '</td>',\n '</tr>',\n '</tbody></table></small>',\n '</fieldset>',\n '</td>',\n '</tr>',\n '</tbody></table>',\n '</fieldset>',\n '<div id=\"' + PREFIX + '-list\"></div>'\n )), i, j, s;\n\n // make a 4-column table of namespaces\n j = 4 * Math.ceil(ns.length / 4);\n s = '';\n for (i = 0; i < j; ++i) {\n if (4 * Math.floor(i / 4) === i) {\n s += '<tr>';\n }\n if (i < ns.length) {\n s += String.prototype.concat(\n '<td class=\"mw-submit\">',\n '<input type=\"checkbox\" id=\"' + PREFIX + '-ns-' + ns[i].id,\n '\" checked=\"\" style=\"vertical-align: middle;\"/>',\n '<label for=\"' + PREFIX + '-ns-' + ns[i].id + '\">',\n mw.html.escape(ns[i].name),\n '</label>',\n '</td>'\n );\n } else {\n s += '<td></td>';\n }\n if (4 * Math.floor(i / 4) === i - 3) {\n s += '</tr>';\n }\n }\n fieldset.find('#' + PREFIX + '-nspaces').prepend(s);\n // define the button actions\n fieldset.find('#' + PREFIX + '-go').click(function() {\n var any = false,\n i;\n\n this.disabled = true; // no double-clicking\n user = $('#' + PREFIX + '-user').val()\n .replace(/^\\s+/, '').replace(/\\s+$/, '');\n if (user === '') {\n $('#' + PREFIX + '-list').empty()\n .append(i18n.msg('errUser').escape());\n // re-enable for error exit\n this.disabled = false;\n return;\n }\n for (i = 0; i < ns.length; ++i) {\n ns[i].checked = $('#' + PREFIX + '-ns-' + ns[i].id).prop('checked');\n any = any || ns[i].checked;\n }\n if (!any) {\n $('#' + PREFIX + '-list').empty()\n .append(i18n.msg('errNamespace').escape());\n // re-enable for error exit\n this.disabled = false;\n return;\n }\n getPages();\n });\n fieldset.find('#' + PREFIX + '-nsall').click(function() {\n $('[id^=' + PREFIX + '-ns-]').prop('checked', true);\n });\n fieldset.find('#' + PREFIX + '-nsnone').click(function() {\n $('[id^=' + PREFIX + '-ns-]').prop('checked', false);\n });\n fieldset.find('#' + PREFIX + '-nsflip').click(function() {\n $('[id^=' + PREFIX + '-ns-]').each(function() {\n this.checked = !this.checked;\n });\n });\n $('#' + PREFIX).empty().append(fieldset);\n }", "title": "" } ]
[ { "docid": "dbaeb8041ecb7f1f4592ebe3ace9ac10", "score": "0.66189176", "text": "function AddDisplay(fieldName, fieldValue) {\r\n\r\n if (fieldName == \"Address Verification\") {\r\n var string = \"<div class=\\\"form-group\\\">\";\r\n string += \"<label class=\\\"col-md-4 control-label\\\">\";\r\n string += fieldName;\r\n string += \"</label>\";\r\n string += \"<div class=\\\"col-md-7\\\">\";\r\n string += \"<p class=\\\"form-control text-center\\\">\";\r\n string += fieldValue;\r\n string += \"</p>\";\r\n string += \"</div>\";\r\n string += \"</div>\";\r\n return string;\r\n }\r\n else if (fieldValue) {\r\n var string = \"<div class=\\\"form-group\\\">\";\r\n string += \"<label class=\\\"col-md-4 control-label\\\">\";\r\n string += fieldName;\r\n string += \"</label>\";\r\n string += \"<div class=\\\"col-md-7\\\">\";\r\n string += \"<p class=\\\"form-control text-center\\\">\";\r\n string += fieldValue;\r\n string += \"</p>\";\r\n string += \"</div>\";\r\n string += \"</div>\";\r\n return string;\r\n }\r\n else\r\n return \"\";\r\n }", "title": "" }, { "docid": "d8340a85a587e8ea290846f6cb52252a", "score": "0.63769704", "text": "function addLableControl(ev){\r\n html=\"<div id=\"+idGen('col')+\" class='col-md-6' data-Controlset='{\"+'\"controlType\"'+\":\"+'\"label\"'+\"}' data-select='col' data-edit='regenerate'><div class='dcol' ><label> Text Field </label> </div></div> <div class='col-md-6 dcol' data-draggable='true' data-edit='remove'>Drop Here</div>\";\r\n placeHtml(ev,html);\r\n}", "title": "" }, { "docid": "8a1fdea3b75171ca62e1bbcac7701dce", "score": "0.6255604", "text": "renderField() {\n let textInput = document.createElement(\"input\")\n textInput.setAttribute(\"name\", this.name)\n textInput.setAttribute(\"type\", \"hidden\")\n textInput.setAttribute(\"value\", this.value ? this.value : \"\")\n textInput.setAttribute(\"class\", this.getFieldClass())\n\n for (const attrib in this.attribs) {\n textInput.setAttribute(attrib, this.attribs[attrib])\n }\n\n return textInput\n }", "title": "" }, { "docid": "da167e5021f454a127080a67ba4da765", "score": "0.619237", "text": "function get_field(id, value, type) {\n var name = id.replace('_id', '');\n\n const template_string =\n \" <div class='control shared-controls-textareacontrol control-default' data-name='\" + name + \"'>\" +\n \" <span class='uneditable-input uneditable-input-multiline' style='display:none'></span>\" +\n \" <input type='\" + type + \"' id='\" + id + \"' name='\" + name + \"' value='\" + value + \"'>\" +\n \" </div>\";\n\n return template_string;\n}", "title": "" }, { "docid": "5d5d1af14c54b23b7faa05ed0df1b4ca", "score": "0.6190617", "text": "function addFieldHTML(fieldType) {\n\n var uniqueID = Math.floor(Math.random()*999999)+1;\n\n switch (fieldType) {\n\n case 'text':\n return '' +\n '<p>' +\n '<input type=\"text\" name=\"text-' + uniqueID + '\" placeholder=\"\" pattern=\"[a-zA-Z0-9 ]+\">' +\n '</p>';\n \n case 'email':\n return '' +\n '<p>' +\n '<input type=\"email\" name=\"email-' + uniqueID + '\" placeholder=\"\">' +\n '</p>';\n \n case 'date':\n return '' +\n '<p>' +\n '<input type=\"text\" class=\"calendar\" id=\"datepicker1\" placeholder=\"\" name=\"date-' + uniqueID + '\" size=\"20\">' +\n '</p>';\n\n case 'textarea':\n return '' +\n '<p>' +\n '<textarea name=\"textarea-' + uniqueID + '\" placeholder=\"\"></textarea>' +\n '</p>';\n\n case 'select':\n return '' +\n '<p class=\"clearfix\">' +\n '<select name=\"select-' + uniqueID + '\" class=\"dropdownselect\"></select>' +\n '</p>';\n\n case 'radio':\n return '' +\n '<p>' +\n '<label></label>' +\n //'<div class=\"choices choices-radio\"></div>' +\n '<span class=\"choices\"></span>' +\n '</p>';\n\n case 'checkbox':\n return '' +\n '<p>' +\n '<label></label><br />' +\n //'<p class=\"choices choices-checkbox\"></p>' +\n '<span class=\"choices\"></span>' +\n '</p>';\n\n case 'agree':\n return '' +\n '<p id=\"sjfb-agree-' + uniqueID + '\" class=\"sjfb-field sjfb-agree required-field\">' +\n '<input type=\"checkbox\" required>' +\n '<label></label>' +\n '</p>'\n }\n }", "title": "" }, { "docid": "3ec50b6d39a7100d5b34f96377031aa4", "score": "0.6181749", "text": "function addInputControl(ev){\r\n html=\"<div id=\"+idGen('col')+\" class='col-md-6' data-Controlset='{\"+'\"controlType\"'+\":\"+'\"input\"'+\"}' data-select='col' data-edit='regenerate'><div class='dcol' ><label for='InputText'> Input Text </label> <input name='InputText' ></div></div> <div class='col-md-6 dcol' data-draggable='true' data-edit='remove'>Drop Here</div>\";\r\n placeHtml(ev,html);\r\n}", "title": "" }, { "docid": "e4cdf70e4428a5f7aadfb2be098763e4", "score": "0.6159937", "text": "function UseControlPrn(Col,strContent,ShowChange,Position)\n{\n\t//this.htmlControl = strContent\n\tif (Col<this.Widths.length)\n {\n \tthis.seedControl[Col] = strContent\n \tif (ShowChange == false)\n \t\tthis.ControlValue[Col] = \" style='display:none'\"\n \telse\n \t\tthis.ControlValue[Col] = \" style='display:block'\"\n }\n\n}", "title": "" }, { "docid": "526c85ed8a518a0cedfa3ede5d134fb4", "score": "0.61516196", "text": "function field(label, image, control) {\n return elem(\"div\", {\"class\": \"field\"}, [\n elem(\"a\", {href: \"#\", title: label}, [\n img(image),\n elem(\"label\", null, text(label))\n ]),\n elem(\"div\", {\"class\": \"control\"}, control)\n ]);\n}", "title": "" }, { "docid": "5a67e71f3334c3b7d643857cdeca996b", "score": "0.6096406", "text": "renderField() {\n return displayReadonlyValue(this.value)\n }", "title": "" }, { "docid": "13f106abaa3da7d3845d99ab28c7bfc9", "score": "0.6089774", "text": "function setFieldLabel(fNumber, data, fieldNamebox) {\n if (fNumber == 1) {\n $(fieldNamebox).html('<b>' + data.channel.field1 + '</b>');\n }\n if (fNumber == 2) {\n $(fieldNamebox).html('<b>' + data.channel.field2 + '</b>');\n }\n if (fNumber == 3) {\n $(fieldNamebox).html('<b>' + data.channel.field3 + '</b>');\n }\n if (fNumber == 4) {\n $(fieldNamebox).html('<b>' + data.channel.field4 + '</b>');\n }\n if (fNumber == 5) {\n $(fieldNamebox).html('<b>' + data.channel.field5 + '</b>');\n }\n if (fNumber == 6) {\n $(fieldNamebox).html('<b>' + data.channel.field6 + '</b>');\n }\n if (fNumber == 7) {\n $(fieldNamebox).html('<b>' + data.channel.field7 + '</b>');\n }\n if (fNumber == 8) {\n $(fieldNamebox).html('<b>' + data.channel.field8 + '</b>');\n }\n}", "title": "" }, { "docid": "61ee5def4451f5994ea6f2c0641878e3", "score": "0.60391694", "text": "function makeInput(value,what)\n{\t\n\t\tif(what==\"text\")\n\t\t{\n\t\t\tvar n = getId(value + \"_input\");\n\t\t\tn.style.display = \"none\";\n\t\t\t\n\t\t\tvar ei = getId(value + \"_input_field\");\n\t\n\t\t\tvar e = getId(value + \"_text\");\n\t\t\tif(value!=\"\")\n\t\t\t{\n\t\t\t\te.innerHTML = ei.value;\n\t\t\t\te.style.display = \"block\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse if(what==\"input\")\n\t\t{\n\t\t\tvar e = getId(value + \"_input\");\n\t\t\te.style.display = \"block\";\n\t\t\tvar ei = getId(value + \"_input_field\");\n\t\t\ttextSelect(ei,ei.value.length);\n\t\n\t\t\tvar n = getId(value + \"_text\");\n\t\t\tif(value!=\"\")\n\t\t\t{\t\n\t\t\t\tn.style.display = \"none\";\n\t\t\t\tn.innerHTML = ei.value;\n\t\t\t}\n\t\t}\n\t\n}", "title": "" }, { "docid": "89448f91b7175cba5323f596e2beeaa6", "score": "0.60214746", "text": "field_header(field){\n var field_nice_name = field.type.replace(/_/g, ' ');\n var label = (typeof field['values']['default'] !== 'undefined' && typeof field['values']['default']['label'] !== 'undefined' && field['values']['default']['label'] != '') ? field['values']['default']['label'] : '<span><span>' + field_nice_name + '</span> Field</span>';\n \n\n\n this.output += '<div class=\"form-field-header\">';\n this.output += '<div class=\"form-field-header-buttons\">';\n this.output += '<span class=\"form-field-id\">ID:'+field.id+'</span>';\n this.output += '<a href=\"#\" class=\"form-field-remove\"><i class=\"wpbs-icon-close\"></i></a>';\n this.output += '<a href=\"#\" class=\"form-field-sort\"><i class=\"wpbs-icon-sort\"></i></a>';\n this.output += '<a href=\"#\" class=\"form-field-toggle\"><i class=\"wpbs-icon-down-arrow\"></i></a>';\n this.output += '</div>';\n\n this.output += '<p><i class=\"wpbs-icon-'+field.type+'\"></i> <span data-field-type=\"<span><span>' + field_nice_name + '</span> Field</span>\" class=\"form-field-header-label\">'+label+'</span></p>';\n this.output += '</div>';\n }", "title": "" }, { "docid": "7ef90360855ce8d6a87a357dad2d81fb", "score": "0.6012986", "text": "createInput() {\n this.$input = document.createElement(this.type);\n this.$input.setAttribute(\"aria-label\", this.label);\n this.$input.className = \"field-input\";\n }", "title": "" }, { "docid": "e78eb09caeac80011d6bf2150fcefa07", "score": "0.59849155", "text": "function addField(fieldType) {\n\n var hasRequired, hasChoices;\n var includeRequiredHTML = '';\n var includeChoicesHTML = '';\n\n switch (fieldType) {\n case 'text':\n hasRequired = true;\n hasChoices = false;\n break;\n\t\tcase 'tel':\n hasRequired = true;\n hasChoices = false;\n break;\n\t\tcase 'email':\n hasRequired = true;\n hasChoices = false;\n break;\n\t\tcase 'file':\n hasRequired = true;\n hasChoices = false;\n break;\n\t\tcase 'date':\n hasRequired = true;\n hasChoices = false;\n break;\n case 'textarea':\n hasRequired = true;\n hasChoices = false;\n break;\n case 'select':\n hasRequired = true;\n hasChoices = true;\n break;\n case 'radio':\n hasRequired = true;\n hasChoices = true;\n break;\n case 'checkbox':\n hasRequired = false;\n hasChoices = true;\n break;\n case 'agree':\n //required \"agree to terms\" checkbox\n hasRequired = false;\n hasChoices = false;\n break;\n }\n\n if (hasRequired) {\n includeRequiredHTML = '' +\n '<label>Required? ' +\n '<input class=\"toggle-required\" type=\"checkbox\">' +\n '</label>'\n }\n\n if (hasChoices) {\n includeChoicesHTML = '' +\n '<div class=\"choices\">' +\n '<ul></ul>' +\n '<button type=\"button\" class=\"add-choice\"><i class=\"fa fa-plus\" aria-hidden=\"true\"></i> Add Choice</button>' +\n '</div>'\n }\n\n return '' +\n '<div class=\"field\" data-type=\"' + fieldType + '\">' +\n '<button type=\"button\" class=\"delete\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></button>' +\n '<h3>' + fieldType + '</h3>' +\n '<label>Label:' +\n '<input type=\"text\" class=\"field-label\">' +\n '</label>' +\n includeRequiredHTML +\n includeChoicesHTML +\n '</div>'\n}", "title": "" }, { "docid": "0e69ed982caa2426deb4b2aab6315816", "score": "0.598442", "text": "createControl() {\n return this.fb.control(undefined, {\n validators: this._validators\n });\n }", "title": "" }, { "docid": "144f1b14e8c502278b48006b16b6f521", "score": "0.596707", "text": "function showFormfield(oField,index) {\n\tvar divDesc = document.getElementById('tabCellDesc_'+index);\n\tvar divForm = document.getElementById('tabCellForm_'+index);\n\t// divDesc setzen\n\tswitch (oField.Type.value) {\n\t\tcase 'text':\n\t\tcase 'textarea':\n\t\tcase 'dropdown':\n\t\t\tif (oField.Required == 1) {\n\t\t\t\tdivDesc.innerHTML = oField.Desc.value + ' <span style=\"color:#d00\">*</span>';\n\t\t\t} else {\n\t\t\t\tdivDesc.innerHTML = oField.Desc.value;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'radio':\n\t\tcase 'checkbox':\n\t\tcase 'hidden':\n\t\tcase 'submit':\n\t\t\tdivDesc.innerHTML = '&nbsp;';\n\t\t\tbreak;\n\t\tcase 'captcha':\n\t\t\tdivDesc.innerHTML = oField.Desc.value + ' <span style=\"color:#d00\">*</span>';\n\t\t\tbreak;\n\t}\n\t// Formularfeld erstellen\n\tswitch (oField.Type.value) {\n\t\tcase 'text':\n\t\t\tdivForm.innerHTML = '<input '+\n\t\t\t'type=\"text\" name=\"'+oField.Name.value+'\" value=\"'+oField.Value.value+'\"'+\n\t\t\t''+getCssClass(oField)+getStyle(oField)+'>';\n\t\t\tbreak;\n\t\tcase 'textarea':\n\t\t\tdivForm.innerHTML = '<textarea '+\n\t\t\t'name=\"'+oField.Name.value+'\"'+getCssClass(oField)+getStyle(oField)+'>'+\n\t\t\t''+oField.Value.value+'</textarea>';\n\t\t\tbreak;\n\t\tcase 'checkbox':\n\t\tcase 'radio':\n\t\t\tdivForm.innerHTML = '<input '+\n\t\t\t'type=\"'+oField.Type.value+'\" name=\"'+oField.Name.value+'\" value=\"'+oField.Value.value+'\"'+\n\t\t\t''+getCssClass(oField)+'> '+oField.Desc.value;\n\t\t\tbreak;\n\t\tcase 'submit':\n\t\t\tdivForm.innerHTML = '<input '+\n\t\t\t'type=\"button\" name=\"'+oField.Name.value+'\" value=\"'+oField.Desc.value+'\"'+\n\t\t\t''+getCssClass(oField)+getStyle(oField)+'>';\n\t\t\tbreak;\n\t\tcase 'captcha':\n\t\t\tdivForm.innerHTML = '<img src=\"/scripts/captcha/code.php\"/>' +\n\t\t\t'<p><input type=\"text\" name=\"captchaCode\"'+getCssClass(oField)+getStyle(oField)+'/> ' +\n\t\t\t'<img onclick=\"captchaReload()\" src=\"/images/icons/arrow_refresh_small.png\"/></p>';\n\t\t\tbreak;\n\t\tcase 'hidden':\n\t\t\tdivForm.innerHTML = '<span style=\"color:#999;\">Unsichtbares Feld / Invisible Field:'+oField.Desc.value+'</span>';\n\t\t\tbreak;\n\t\tcase 'dropdown':\n\t\t\tvar HTML = '<select name=\"'+oField.Name.value+'\"'+getCssClass(oField)+getStyle(oField)+'>';\n\t\t\tvar Options = oField.Options.value.split(DROPDOWN_FIELD_DELIMITER);\n\t\t\tfor (var optIdx = 0;optIdx < Options.length;optIdx++) {\n\t\t\t\tNameValuePair = Options[optIdx].split(DROPDOWN_VALUE_DELIMITER);\n\t\t\t\tHTML+= '<option value=\"'+NameValuePair[0]+'\">'+NameValuePair[1]+'</option>';\n\t\t\t}\n\t\t\tHTML+= '</select>';\t\n\t\t\tdivForm.innerHTML = HTML;\n\t}\n}", "title": "" }, { "docid": "4fc122d21538d59eb9ceb5b272edcd26", "score": "0.59458065", "text": "function renderControls() {\n\n $(\"#placeHolderTypeCode\").width(\"75%\")\n\t\t.kendoMaskedTextBox();\n\n $(\"#entityTypeCode\").width(\"75%\")\n\t\t.kendoMaskedTextBox();\n}", "title": "" }, { "docid": "0255762026954084fcba06adcab1ba96", "score": "0.5935257", "text": "function showControls() {\n\n setButtonStyles();\n\n var d = data[currentIdx];\n var format = d3.format(',');\n var noun = 'people';\n\n if (d.size == 1) {\n noun = 'person';\n };\n\n d3.select('.js-label')\n .style('border-color', d.color)\n .html(d.name + ': ' + format(d.size) + '&nbsp;' + noun);\n\n d3.selectAll('.js-control')\n .transition()\n .duration(200)\n .style('opacity', 1);\n }", "title": "" }, { "docid": "76f4cfe283fd6b562e5957ef6cb51b9e", "score": "0.5919919", "text": "function SFInputField(){}", "title": "" }, { "docid": "84f096de508e7105f5bd96ec46bac55b", "score": "0.58967435", "text": "function mostrarFormulario() {\n\t\tget(\"formulario\").style.display = 'inline';\n\n\t}", "title": "" }, { "docid": "e7d81fc2f33ecffcaa2df14ab032123b", "score": "0.58784", "text": "render() {\n return html`\n \n <div class=\"inputs\">\n <label> ${this.label}</label> <p></p>\n <input type=\"${this.tipado}\" placeholder=\"Prueba de Input\">\n </div>\n `;\n }", "title": "" }, { "docid": "7138e02ce17fc7ce1b06fab3768c4dd8", "score": "0.5871788", "text": "function displayField(name) {\n return DIV({ class: name }, patch[name]);\n }", "title": "" }, { "docid": "40630cbe8b953f0b409d587239685fe7", "score": "0.5861715", "text": "function addField(fieldType) {\n\n var hasRequired, hasChoices;\n var includeRequiredHTML = '';\n var includeChoicesHTML = '';\n\n switch (fieldType) {\n case 'text':\n case 'email':\n case 'date':\n hasRequired = true;\n hasChoices = false;\n break;\n case 'textarea':\n hasRequired = true;\n hasChoices = false;\n break;\n case 'select':\n hasRequired = true;\n hasChoices = true;\n break;\n case 'radio':\n hasRequired = true;\n hasChoices = true;\n break;\n case 'checkbox':\n hasRequired = false;\n hasChoices = true;\n break;\n case 'agree':\n //required \"agree to terms\" checkbox\n hasRequired = false;\n hasChoices = false;\n break;\n }\n\n if (hasRequired) {\n includeRequiredHTML = '' +\n ' <label>Required? ' +\n '<input class=\"toggle-required\" type=\"checkbox\">' +\n '</label>'\n }\n\n if (hasChoices) {\n includeChoicesHTML = '' +\n '<div class=\"choices\">' +\n '<ul></ul>' +\n '<button type=\"button\" class=\"add-choice\">Add Choice</button>' +\n '</div>'\n }\n\n return '' +\n '<div class=\"field ui-sortable-handle\" data-type=\"' + fieldType + '\">' +\n '<button type=\"button\" class=\"delete\"> x </button>' +\n '<h4>' + fieldType + ' field</h4>' +\n '<label>Display Text: ' +\n '<input type=\"text\" class=\"field-label\">' +\n '</label>' +\n includeRequiredHTML +\n includeChoicesHTML +\n '</div>'\n}", "title": "" }, { "docid": "c0c819f115717aae8ccc9459d86e5973", "score": "0.5825774", "text": "_buildDisplayView() {\n this.__customCrudField.buildDisplayView();\n }", "title": "" }, { "docid": "320159c8c0051e862eac780eecc7af81", "score": "0.58233076", "text": "function generatefieldtag(f)\n{\n\tlisttag = generatetag(\"li\",\"\",\"field5\",\"\");\n\treturn listtag + generatetag(\"input\",f,\"\",\"required\") + closetab(listtag); \n}", "title": "" }, { "docid": "719d96a41d7afd64cc2d8ae798e1e3ca", "score": "0.58180404", "text": "renderField() {\n let textInput = document.createElement(\"input\")\n textInput.setAttribute(\"name\", this.name)\n textInput.setAttribute(\"type\", \"email\")\n textInput.setAttribute(\"value\", this.value ? this.value : \"\")\n textInput.setAttribute(\"class\", this.getFieldClass())\n\n for (const attrib in this.attribs) {\n textInput.setAttribute(attrib, this.attribs[attrib])\n }\n\n return textInput\n }", "title": "" }, { "docid": "b7921db72a1d4d6c682eada3b3452795", "score": "0.5807455", "text": "renderField() {\n return this.renderValue();\n }", "title": "" }, { "docid": "f5fa6457fa1c76f85d8dff25847e9ef9", "score": "0.5779133", "text": "make_control_panel() {\r\n this.key_triggered_button(\"Speed up time\", [\"Shift\", \"T\"], function () {\r\n this.time_scale *= 5\r\n });\r\n this.key_triggered_button(\"Slow down time\", [\"t\"], function () {\r\n this.time_scale /= 5\r\n });\r\n this.new_line();\r\n this.live_string(box => {\r\n box.textContent = \"Time scale: \" + this.time_scale\r\n });\r\n this.new_line();\r\n this.live_string(box => {\r\n box.textContent = \"Fixed simulation time step size: \" + this.dt\r\n });\r\n this.new_line();\r\n this.live_string(box => {\r\n box.textContent = this.steps_taken + \" timesteps were taken so far.\"\r\n });\r\n }", "title": "" }, { "docid": "9b4ad18042fa9d6496d13bd80073e9c7", "score": "0.57757425", "text": "function info_show_field_options(){\n\tsz = \"\";\n\tcurrentScreen = 0;\n\tDirectoryFormAddEntry(currentScreen);\n}", "title": "" }, { "docid": "889136b2a032e38c59d4f3d6c6cf5f9b", "score": "0.5770847", "text": "function generate_code() {\n\tvar html = '',\n\t\telements = templates.types[$('#selectType')[0].selectedIndex].content.elements,\n\t\tinputs = $('#form_content :input');\n\n\thtml = templates.types[$('#selectType')[0].selectedIndex].content.header;\n\thtml += '\\n\\n';\n\thtml += '---';\n\n\tfor (ele in elements) {\n\t\tif (elements[ele].prefix) html += elements[ele].prefix;\n\t\thtml += inputs[ele].value;\n\t\tif (elements[ele].suffix) html += elements[ele].suffix;\n\t}\n\n\thtml += '\\n\\n---\\n\\n';\n\thtml += templates.footer;\n\n\t$('#output').val(html);\n}", "title": "" }, { "docid": "95324d70e1a8ff750eba1ee62392a618", "score": "0.5764791", "text": "renderField() {\n let textInput = document.createElement(\"input\")\n textInput.setAttribute(\"name\", this.name)\n textInput.setAttribute(\"type\", \"password\")\n textInput.setAttribute(\"value\", this.value ? this.value : \"\")\n textInput.setAttribute(\"class\", this.getFieldClass())\n\n for (const attrib in this.attribs) {\n textInput.setAttribute(attrib, this.attribs[attrib])\n }\n\n return textInput\n }", "title": "" }, { "docid": "ba91961148cc3fe75f3be26ff0e1a0ee", "score": "0.57567865", "text": "function inputCompleteHtml(code, value) {\n\t\tvar divHtml = '<div id=\"vtitleDiv_'+ code + '\">';\n\t\tvar fullname = $('#langchk_'+code)[0].getAttribute('data-fullname');\n\t\tdivHtml+='<label class=\"control-label\">' + fullname + '</label>';\n\t\tdivHtml+='<input type=\"text\" class=\"input-small\" data-required=\"true\" id=\"pkgVtitle_' + code + '\" name=\"pkgVtitle_' + code \n\t\t+ '\" value=\"' + value + '\"/></div>'\n\t\treturn divHtml;\n\t}", "title": "" }, { "docid": "742f40970ba233ca7e447baff1407e4e", "score": "0.5756728", "text": "showControls() {}", "title": "" }, { "docid": "d505400762a15e8f56bba6d7667f7932", "score": "0.57558763", "text": "generate () {\n var elementDiv = $(ELEMENT_TEMPLATE).clone ();\n var model = $(MODEL_DISPLAY);\n var span = this.span ();\n\n // set the text ...\n span.text (this.value).data (\"id\", this.id);\n\n // parent it to the main div, add the stuff, return\n elementDiv.insertAfter (model).data (\"id\", this.id);\n\n this.addControls (elementDiv);\n\n return elementDiv;\n }", "title": "" }, { "docid": "95546c498be355dbc1ce5985f52f854b", "score": "0.5738167", "text": "renderField() {\n let textareaInput = document.createElement(\"textarea\")\n textareaInput.setAttribute(\"name\", this.name)\n textareaInput.setAttribute(\"class\", this.getFieldClass())\n textareaInput.textContent = this.value ? this.value : \"\"\n\n for (const attrib in this.attribs) {\n textareaInput.setAttribute(attrib, this.attribs[attrib])\n }\n\n return textareaInput\n }", "title": "" }, { "docid": "3d7848912ae264cf72ad5fb84976c795", "score": "0.5735559", "text": "function create_fieldset_row( type, name, user_friendly_label, id, required, class_name )\n{\n\tvar label = '<label for =\"' + name + '\">' + user_friendly_label + '</label>';\n\tvar textbox = '<input type=\"' + type + '\" name=\"' + name + '\" id=\"' + id + '\" required=\"' + required + '\" class=\"' + class_name + '\" />';\n\t\n\treturn label + textbox;\n}", "title": "" }, { "docid": "2059ba4a114d9c884a96d32afe5efa13", "score": "0.57128376", "text": "function inputCompleteHtml(code, value) {\n\t\tvar divHtml = '<div id=\"vtitleDiv_'+ code + '\">';\n\t\tvar fullname = $('#langchk_'+code)[0].getAttribute('data-fullname');\n\t\tdivHtml+='<label class=\"control-label\">' + fullname + '</label>';\n\t\tdivHtml+='<input type=\"text\" class=\"input-small form-control\" data-required=\"true\" id=\"albumVtitle_' + code + '\" name=\"albumVtitle_' + code \n\t\t+ '\" value=\"' + value + '\"/></div>'\n\t\treturn divHtml;\n\t}", "title": "" }, { "docid": "4c6aa98011e8cad550cefa5fc6fa772b", "score": "0.5690082", "text": "function addInd(inum, field, val, counter) {\r\n var id = 'f' + field + '_' + counter + '_' + inum;\r\n //var cl = 'g' + field + '_' + inum;\r\n var cl = 'generic' + '_' + inum;\r\n var i = \"<label for='\" + id + \"'>\" + inum + \"</label>\\n<input type='text' class='\" + cl + \"' id='\" + id + \"' placeholder='\" + inum + \"' value='\" + val + \"' maxlength='1' pattern='[0-9 ]{1}'>\\n\";\r\n if (val == null) {\r\n i = \"<label for='\" + id + \"'>\" + inum + \"</label>\\n<input type='text' class='\" + cl + \"' id='\" + id + \"' disabled='disabled' maxlength='1' pattern='[0-9 ]{1}'></label>\\n\";\r\n }\r\n return i;\r\n}", "title": "" }, { "docid": "2f071424fcb25152d3b78eb1aeb6bb24", "score": "0.56855494", "text": "function ocultarFormulario() {\n\t\tget('nombresC').value = '';\n\t\tget('apellidosC').value = '';\n\t\tget('numeroCasaC').value = '';\n\t\tget('numeroTrabajoC').value = '';\n\t\tget('correoC').value = '';\n\t\tget(\"formulario\").style.display = 'none';\n\n\t}", "title": "" }, { "docid": "09f09c9b8ef44caa15e046ba395bc735", "score": "0.5683105", "text": "get _control() {\n return this._explicitFormFieldControl || this._formFieldControl;\n }", "title": "" }, { "docid": "75d24f5c2841b290f55d61a35f596ec7", "score": "0.567626", "text": "function addInputField()\n{\n\tinputFields.push(document.createElement('div'));\n\n\tvar currentIndex = inputFields.length - 1;\n\n\tinputFields[currentIndex].appendChild(document.createTextNode(\"Label: \"));\n\n\tinputFields[currentIndex].inputLabel = document.createElement('input');\n\tinputFields[currentIndex].inputLabel.id\t= \"label\" + currentIndex;\n\n\tif(currentGraph[currentIndex] != undefined)\n\t{\n\t\tinputFields[currentIndex].inputLabel.value\t= currentGraph[currentIndex].label;\n\t}else\n\t{\n\t\tinputFields[currentIndex].inputLabel.value\t= \"insert label!\";\n\t}\n\n\tinputFields[currentIndex].appendChild(inputFields[currentIndex].inputLabel);\n\tinputFields[currentIndex].appendChild(document.createTextNode(\"Value: \"));\n\n\tinputFields[currentIndex].inputValue = document.createElement('input');\n\tinputFields[currentIndex].inputValue.id\t= \"value\" + currentIndex;\n\tinputFields[currentIndex].inputValue.type\t= \"Number\";\n\n\tif(currentGraph[currentIndex] != undefined)\n\t{\n\t\tinputFields[currentIndex].inputValue.value\t= currentGraph[currentIndex].data;\n\t}else\n\t{\n\t\tinputFields[currentIndex].inputValue.value\t= 0;\n\t}\n\n\tinputFields[inputFields.length - 1].appendChild(inputFields[inputFields.length - 1].inputValue);\n\n\tinputParent.appendChild(inputFields[inputFields.length - 1]);\n}", "title": "" }, { "docid": "d11506082428375dd7353109bb5c174c", "score": "0.56724536", "text": "function buildUI(tags) {\r\n tags.wrapper.append(tags.input);\r\n tags.wrapper.classList.add(tags.options.wrapperClass);\r\n // document.getElementById(tags.orignal_input).style.display = 'none';\r\n tags.orignal_input.style.display = 'none';\r\n tags.orignal_input.parentNode.insertBefore(tags.wrapper, tags.orignal_input);\r\n }", "title": "" }, { "docid": "7a40b7d82e386ee2b7da8bd14cf1a093", "score": "0.5669892", "text": "function show_add_init_helper(data)\n\t{\n\t\tdata['level'] = 1;\n\t\tdata['prefix'] = '';\n\t\tdefnet.init_form_wizard(data);\n\t}", "title": "" }, { "docid": "071855b7877068fc29b08a5197856909", "score": "0.5663561", "text": "function setCustomOnInput(control, display) {\n control.oninput = function () {\n difficultyControl.value = \"Custom\";\n if (display != null) {\n display.innerHTML = control.value;\n }\n };\n}", "title": "" }, { "docid": "37cddc4aa006695c73ec3585d27d2808", "score": "0.5648799", "text": "function renderFieldText() {\n\t\tif (!inEditMode) {\n\t\t\treturn <span className={manufacturer === 'Ford' ? 'bold' : ''}>{id || manufacturer || model.toUpperCase()}</span>;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "title": "" }, { "docid": "0c105f32e43fe87f9409ac1cc8aee759", "score": "0.56379193", "text": "function __construct() {\n\t\t\tvar i;\n\n\t\t\tfor (i = 0; i < options.controls; ++i)\n\t\t\t\telement.appendChild(elements.controls[i] = UI.create('span'));\n\n\t\t\taddEventListeners();\n\t\t}", "title": "" }, { "docid": "a999635fbec6355f569f78de7a7d3a58", "score": "0.5629221", "text": "function afFormular(){\r\n\t\t\t adauga(\"formular\").style.display='inline';\r\n\t\t\t}", "title": "" }, { "docid": "05fead452a3b509b88d32d143e75a64c", "score": "0.56288874", "text": "function show() {\n var p = document.getElementById('accessCode1');\n p.setAttribute('type', 'text');\n }", "title": "" }, { "docid": "0ab9c94220f5a07f3657e6c1193912ce", "score": "0.5622474", "text": "function showAid(field) {\n switch(field) {\n\tcase 'firstName': document.getElementById(\"firstName\").style.display = \"initial\"; break;\n\tcase 'lastName': document.getElementById(\"lastName\").style.display = \"initial\";\n\t}\n}", "title": "" }, { "docid": "373a8b185e600a78b908d0f583fb03d0", "score": "0.56217057", "text": "field(field, i){\n\n if(typeof this.available_field_types[field.type] === \"undefined\"){\n return false\n }\n\n this.output += '<div class=\"form-field form-field-type-' + field.type + '\" data-order=\"' + i + '\">';\n this.output += '<div class=\"form-field-inner\">';\n this.field_header(field);\n this.output += '<div class=\"form-field-content\"><div class=\"form-field-content-inner\">';\n this.output += '<input type=\"hidden\" name=\"form_fields[' + i + '][type]\" value=\"' + field.type + '\" />';\n this.output += '<input type=\"hidden\" name=\"form_fields[' + i + '][id]\" value=\"' + field.id + '\" />';\n this.field_options(field, i);\n this.field_translation_options(field, i);\n this.output += '</div></div>';\n this.output += '</div>';\n this.output += '</div>';\n }", "title": "" }, { "docid": "860dfc265bc6e25b6d98c0ec216429ef", "score": "0.56133914", "text": "function draw_fieldlistdiv(){\n\t// print the bloody thing\n\tsetCategories();\n//\tLIBERTAS_GENERAL_printToId(\"fieldlistdiv\", sz);\n\tRankScreen(); \n\tEditScreen(0);\n}", "title": "" }, { "docid": "df99f61e6b385d6f7f3db5812af14dfc", "score": "0.56031585", "text": "function txtField(parent, id, lblText, placeholder, def, pattern, ob, prop, oldob, required,validtext,invlidtext,updatetext) {\n\n var parent = document.getElementById(parent);\n var message = createElement('p',id+\"message\");\n message.style.fontSize = \"12px\"\n message.style.marginBottom = \"-10px\"\n var formGroup = createElement('div', id + 'FormGroup');\n formGroup.classList.add('wrapinput');\n\n var field = createElement('input', id);\n field.type = 'text';\n field.value = def;\n field.setAttribute('data-pattern', pattern);\n field.setAttribute('data-object', ob);\n field.setAttribute('data-oldobject', oldob);\n field.style.height = '38px';\n\n if (lblText != false) {\n var label = createElement('label', id + 'Label');\n label.for = id;\n label.classList.add('txtinput-label');\n if (required == true) {\n field.setAttribute('required', true);\n label.innerHTML = lblText + \" <i class=\\\"fas fa-asterisk\\\" style='color: #ff6666;font-size: 10px'></i>\";\n } else {\n label.innerHTML = lblText;\n }\n }\n field.placeholder = placeholder;\n field.classList.add('txtinput');\n field.classList.add('form-control');\n if (lblText != false) {\n formGroup.appendChild(label);\n }\n formGroup.appendChild(field);\n formGroup.appendChild(message);\n parent.appendChild(formGroup);\n\n field.onkeyup = function () {\n var ob = window[this.getAttribute('data-object')];\n var oldob = window[this.getAttribute('data-oldobject')];\n var pattern = new RegExp(this.getAttribute('data-pattern'));\n var formGroup = this.parentNode.parentNode;\n\n //formGroup.appendChild(message);\n var val = this.value.trim();\n if (pattern.test(val)) {\n ob[prop] = val;\n if (oldob != null && oldob[prop] != ob[prop]) {\n if (updatetext != null){\n // message.innerHTML = updatetext;\n message.style.color = '#ffc107';\n }\n field.style.border = '1px solid #ffc107'; //update\n field.style.color = '#ffc107';\n field.style.boxShadow = 'none';\n } else {\n if (validtext != null){\n // message.innerHTML = validtext;\n message.style.color = \"#28a745\"\n }\n field.style.border = '1px solid #28a745'; //valid\n field.style.color = '#282c2f';\n field.style.boxShadow = 'none';\n }\n } else {\n\n if (invlidtext != null){\n /// message.innerHTML = invlidtext;\n message.style.color = \"#dc3545\"\n }\n field.style.border = '1px solid #dc3545'; //invalid\n field.style.color = '#dc3545';\n field.style.boxShadow = 'none';\n ob[prop] = null;\n }\n };\n\n}", "title": "" }, { "docid": "83789cc71bf1ea325da8935c55dad871", "score": "0.5602145", "text": "function display()\r\n\t\t{\t\r\n\t\t\tif(min<10 && min>=0)\r\n\t\t\t\tdocument.getElementById(\"minutes\").value=\"0\"+min;\r\n\t\t\telse\r\n\t\t\t\tdocument.getElementById(\"minutes\").value=min;\r\n\t\t\tif(sec<10 && sec>=0)\r\n\t\t\t\tdocument.getElementById(\"seconds\").value=\"0\"+sec;\r\n\t\t\telse\r\n\t\t\t\tdocument.getElementById(\"seconds\").value=sec;\r\n\t\t\tif(ms<10 && ms>=0)\r\n\t\t\t\tdocument.getElementById(\"millisec\").value=\"0\"+ms;\r\n\t\t\telse\r\n\t\t\t\tdocument.getElementById(\"millisec\").value=ms;\r\n\t\t}", "title": "" }, { "docid": "bed9da5dea19f55a78f8e6bed70ac951", "score": "0.5601285", "text": "function makeInput(class_name, field, value, primary_key_name, json_labels)\n{\n\tif(value == \"null\") //Banish the nulls\n\t{\n\t\tvalue = \"\";\n\t}\n\tif(\"timestamp\" == field.type)\n\t{\n\t\treturn \"\";\n\t}\n\tvar html = \"\";\n\tif(primary_key_name !== field.name) //Don't make a label for primary key\n\t{\n\t\tif(g_isDevMode)\n\t\t{\n\t\t\thtml += '<label><strong>' + field.name + '</strong> type: ' + field.type +\n\t\t\t\t ' optional: ' + field.optional + '</label>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\thtml += '<label><strong>' + getLabelFor(class_name, field.name, json_labels) + ':</strong></label>';\n\t\t}\n\t}\n\tvar widthHtml = \"\";\n\tvar required = \"\";\n\tvar val = \"\";\n\t//TODO\n\tvar isPrimary = -1 !== field.type.indexOf(\"[PRIMARY_KEY]\") ? true : false;\n\tif(isPrimary)\n\t{\n\t\tif(value === \"\") value=\"NULL\";\n\t}\n\tif(field.optional == \"NO\")\n\t{\n\t\trequired = \" required \";\n\t}\n\tvar type = field.type; //data type\n\tvar typ; //input type\n\tswitch(type)\n\t{\n\t\tcase \"date\":\n\t\t\ttype = \"date\";\n\t\t\tbreak;\n\t\tcase \"time\":\n\t\t\ttype = \"time\";\n\t\t\tbreak;\n\t\tcase \"datetime\":\n\t\t\t//type = \"datetime\";\n\t\t\ttype = \"datetime-local\";\n\t\t\t//Fix the format\n\t\t\tvar res = value.split(\" \");\n\t\t\tvalue = res[0] + \"T\" + res[1];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tvar tempHtml = \"\";\n\t\t\tvar arr = type.split(\"(\");\n\t\t\ttyp = arr[0].trim();\n\t\t\tif(arr.length > 1)\n\t\t\t{\n\t\t\t\tvar temp = arr[1].split(\")\");\n\t\t\t\tvar len = temp[0].trim();\n\t\t\t\t//tempHtml = ' maxlength=\"' + len + '\" style=\"width:' + len + 'px\" ';\n\t\t\t\tvar max_len = len;\n\t\t\t\tif(len > 45 && len <= 255)\n\t\t\t\t{\n\t\t\t\t\tlen = 45;\n\t\t\t\t}\n\t\t\t\telse if(len > 255)\n\t\t\t\t{\n\t\t\t\t\t//TODO Special avatar_url should go away until image upload is supplied \n\t\t\t\t\tif(\"avatar_url\" != field.name)\n\t\t\t\t\t{\n\t\t\t\t\t\ttyp = \"textarea\"; \t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlen = 45;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttempHtml = ' maxlength=\"' + max_len + '\" size=\"' + len + '\" ';\n\n\t\t\t}\n\t\t\tswitch(typ)\n\t\t\t{\n\t\t\t\tcase \"tinyint\":\n\t\t\t\t\ttype = \"checkbox\";\n\t\t\t\tcase \"int\":\n\t\t\t\t\ttype = \"int\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"varchar\":\n\t\t\t\t\ttype = \"text\";\n\t\t\t\t\twidthHtml = tempHtml;\n\t\t\t\t\tif(\"password\" == field.name || \"password_hint_answer\" == field.name)\n\t\t\t\t\t{\n\t\t\t\t\t\ttype = \"password\";\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ttype = \"text\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\tvar cls = \"\";\n\tif(primary_key_name == field.name)\n\t{\n\t\ttype = \"hidden\";\n\t}\n\tvar lookUp = \"\";\n\tif(field.class != \"\")\n\t{\n\t\tlookUp = '<button id=\"' + field.class + '\" data-target=\"' + field.name + '\" class=\"lookUpBtn\" type=\"button\">Look Up</button>';\n\t}\n\tif(\"textarea\" == typ)\n\t{\n\t\treturn html + '<br><textarea id=\"' + field.name + '\" ' + required + ' >' + value + '</textarea><br>';\n\t}\n\telse\n\t{\n\t\treturn html + '<input ' + val + ' id=\"' + field.name + '\" type=\"' + type + '\" ' + widthHtml + ' ' + required + \n\t\t\t\t\t' value=\"' + value + '\" autocomplete=\"on\">' + lookUp + '<br>';\n\t}\n\n}", "title": "" }, { "docid": "7a80a841b804138792d75b9154cdd851", "score": "0.560041", "text": "function addSub(sub, field, val, counter) {\r\n var id = 'f' + field + '_' + counter + '_' + sub;\r\n var cl = 'g' + field + '_' + sub;\r\n if (val == undefined) {\r\n var i = \"<label for='\" + id + \"'>\" + sub + \"</label>\\n<input type='text' class='\" + cl + \"' id='\" + id + \"'>\\n\";\r\n }\r\n else {\r\n var i = \"<label for='\" + id + \"'>\" + sub + \"</label>\\n<input type='text' class='\" + cl + \"' id='\" + id + \"' value='\" + val + \"'>\\n\";\r\n }\r\n return i;\r\n}", "title": "" }, { "docid": "9208380e9884dbfdd83e72c0d1c91a70", "score": "0.5590644", "text": "fieldDisplay() {\n //styling stuff\n //way to generte empty space after dynamic variables \n let blankSpaceGen = (str = \"\", offset = 0) => `${str}${` `.repeat(offset - str.length)}`\n\n let display = [\n blankSpaceGen(this.activeOpp.name, 11),\n blankSpaceGen(this.activeMon.name, 11),\n blankSpaceGen(this.user.active.name, 12),\n blankSpaceGen(this.user.roster[0].name, 12),\n blankSpaceGen(this.user.roster[1].name, 12),\n blankSpaceGen(JSON.stringify(this.activeOpp.health), 8),\n blankSpaceGen(JSON.stringify(this.activeMon.health), 8),\n blankSpaceGen(\"\", 32)\n ]\n\n\n console.log(\n ` \n ____________________________________________________________\n | Roster | | ${display[0]}|\n | _________ | | HP:${display[5]}|\n | ${display[2]}| |____________|\n | ${display[3]}| |\n | ${display[4]}|____________ |\n | | ${display[1]}|${display[7]}|\n | | HP:${display[6]}|${display[7]}|\n |_____________|____________|________________________________|\n `\n )\n }", "title": "" }, { "docid": "457cd1c13db2c18fb7b0c108148f01b4", "score": "0.5575207", "text": "function TextField(value){\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\tvar th = {\t\t\t\n\t'up': null,\t\n\t'r': new javax.swing.JTextField(value, 15),\t\t\t\t\t\t\n\t'value': function(){\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn th.r.getText();\t\t\t\t\t\t\t\t\t\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t};\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\treturn th;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n}", "title": "" }, { "docid": "93889a25f0fd3fba57d6b9b9cbf5fd0c", "score": "0.5573812", "text": "function addComboFormField() {\r\n\r\n TXTextControl.formFields.getCanAdd(canAdd => {\r\n if (canAdd) {\r\n\r\n // Add form field\r\n TXTextControl.formFields.addSelectionFormField(emptyWidth, ff => {\r\n\r\n\r\n var cars = [\"Porsche\", \"Ford\", \"Daimler\", \"Mercedes\", \"Hyundai\"];\r\n\r\n // Allow setting custom text.\r\n ff.setEditable(true);\r\n\r\n // Set drop down items.\r\n ff.setItems(cars);\r\n\r\n // Select\r\n ff.setSelectedIndex(4);\r\n });\r\n } else {\r\n $('.alert').show().delay(3000).fadeOut(300);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "18f4048ab9078e4df6320d90d8a76826", "score": "0.5569801", "text": "function setXrefLevel() {\n $(\"#xrefShowName\").html(xrefData.picked); \n $(\"#xrefShowDesc\").html(xrefData.names[xrefData.picked].desc); \n $(\"#xrefDesc\").val(xrefData.names[xrefData.picked].desc); // edit field\n}", "title": "" }, { "docid": "f2c26a5a80a92c435c340b2ca66f68d6", "score": "0.5565189", "text": "function addField(){\n\t $.fn.tipOpen({\n\t\t\ttitle : \"自定义属性\",\n\t\t\twidth : '400',\n\t\t\tbtn : [],\n\t\t\tcancel:false,\n\t\t\tconcent : html\n\t\t})\n}", "title": "" }, { "docid": "5979f947fd86184c265f865b4ddc4915", "score": "0.5554939", "text": "function add_field($group, field_def, field_html, level, add_delete_button) {\n\n // get the field_type from the schema\n var field_type = field_def['type'];\n\n // add this field to group\n $group.append(field_html);\n\n var $field = $group.find('.cfti_field:last()');\n var $field_control = null;\n\n // if field_type is enum type, create a select dropdown\n if (is_enum_field_type(field_type)) {\n var field_control_type = $field.attr('cfti_control_type');\n if (field_control_type == 'dropdown') {\n var field_values = $field.attr('cfti_field_values');\n var $select = $field.find('select');\n var dd_type = option_types[field_type];\n var options = dd_type.options;\n var multiselect = dd_type.multiselect;\n $field_control = $select;\n populate_select($select, field_values, options, multiselect);\n } else if (field_control_type == 'autocomplete') {\n var field_value = $field.attr('cfti_field_value');\n var $input = $field.find('input');\n var dd_type = option_types[field_type];\n var options = dd_type.options;\n\t\t $field_control = $input;\n populate_autocomplete($input, field_value, options);\n\n var option_lookup = option_lookups[field_type];\n $input.devbridgeAutocomplete({\n lookup: option_lookup,\n showNoSuggestionNotice: true,\n noSuggestionNotice: 'Sorry, no matching results',\n groupBy: 'categpry'\n });\n }\n } else if (field_type === 'date') {\n // if field_type is date, create a datepicker\n try {\n $field.find('input').datepicker({format: 'yyyy-mm-dd'});\n $field_control = $field.find('input');\n } catch (err) {\n // ignore -- if datepicker not available (dont make this a fatal)\n }\n } else if (field_type === 'cron') {\n // if field_type is cron, create a cron editor\n try {\n var field_value = $field.attr('cfti_field_value');\n if (field_value === '') {\n field_value = '0 * * * *';\n $field.attr('cfti_field_value', field_value);\n }\n $field_control = $field.find('.cfti_cron');\n $field.data('cron_object', $field.find('.cfti_cron').cron({initial: field_value}));\n } catch (err) {\n console.log(err);\n\t\t $field_control.text(field_value);\n // ignore -- if croneditor not available (dont make this a fatal)\n }\n } else if (field_type === 'boolean') {\n var field_value = $field.attr('cfti_field_value');\n var $select = $field.find('select');\n $select.val(field_value);\n $field_control = $select;\n } else {\n // Fallthrough case is vanilla input field\n $field_control = $field.find('input');\n }\n\n // If this field is readonly, disable it\n if (field_def['readonly'] || settings.readonly) {\n $field_control.prop('disabled', true);\n }\n\n // add delete button if necessary\n // add_delete_button flag is set true only if this is the first field in the group and\n // this group is not the first group\n if (add_delete_button) {\n $group.find('.cfti_fieldinput:last()').after(delete_button_html);\n $group.find('.cfti_delgroupbutton:last()').click(function () {\n $group.remove();\n });\n }\n\n // indent this field\n for (var i = 0; i < level; i++) {\n $group.find('.control-label:last()').before(indent_html);\n }\n }", "title": "" }, { "docid": "d5e150ebe164e237a613829df857be2f", "score": "0.55492246", "text": "function showTextField(element,hilight) {\n\tvar objValue = 'obj_'+ element; \n\tdata = getElementByIdOrByName(objValue) == null ? \"\" : getElementByIdOrByName(objValue).value;\n\t//alert(element + 'data: ' + data);\n\n\tif(data!=null && data.length>0)\n\t\tgetElementByIdOrByName(element).value = data;\n\t\n\tif(gXSLType == 'view') {\n\t\tvar newspan = document.createElement(\"span\");\n\t\tif(hilight == 'true') {\n\t\t\tnewspan.style.background='#e4ebf8';\n\t\t}\t\n\t\t\tdata = \" \" + data;\n\n\t\ttxtN = document.createTextNode(data);\n\t\t\n\t\tnewspan.appendChild(txtN);\n\t\t//getElementByIdOrByName(element).replaceNode(newspan); //gst Feb2017 not supported in FF\n\t\n\t\tvar replaceEle = getElementByIdOrByName(element);\n\t\tvar parentEle = replaceEle.parentNode;\n\t\tparentEle.replaceChild(newspan,replaceEle);\n\t\t\n\t}\n\t\t\n}", "title": "" }, { "docid": "d8498aec3732581e1a8a02d9b2ab4208", "score": "0.55350494", "text": "function new_Input(string) {\n\tvar x = document.getElementById(string);\n\tx.style.display = 'inline';\n}", "title": "" }, { "docid": "5cccb4230463f2ecff0510d3fc85009f", "score": "0.55346304", "text": "function GridControl (e, display, wrap, type, val, name) {\r\n\r\n this.e = e;\r\n this.display = display;\r\n this.wrap = wrap;\r\n this.type = \"\" + type;\r\n this.val = \"\" + val;\r\n this.name = \"\" + name;\r\n\r\n }", "title": "" }, { "docid": "8021279ac00787548aa41a8255a0f375", "score": "0.5529734", "text": "registerControls() {\n }", "title": "" }, { "docid": "8021279ac00787548aa41a8255a0f375", "score": "0.5529734", "text": "registerControls() {\n }", "title": "" }, { "docid": "6d9f4bbbfd2f98d4eab3fea0dca4e103", "score": "0.55262923", "text": "function buildField(html, field, fieldname, suffix, templ) {\r\n // Creates visual field values based on prefs\r\n var i, inptype, hint, inpelement, id, label;\r\n\r\n id = PREFIX + fieldname + suffix;\r\n if (field.events) {\r\n eventQueue.push({id: id, events: field.events});\r\n }\r\n\r\n firstfieldid = firstfieldid || id;\r\n\r\n if (templ) {\r\n templ.field[id] = buildFieldTag(field, id, fieldname, suffix);\r\n\r\n } else {\r\n label = _getFieldLabel(i18n, field, fieldname, suffix);\r\n if (label && !groupmode) {\r\n html += '<td style=\"padding-right:5px\"><label for=\"' + id + '\">' + i18n(label) + ':</label></td>';\r\n }\r\n html += '<td align=' + (field.align || 'left') + '>';\r\n html += buildFieldTag(field, id, fieldname, suffix);\r\n }\r\n\r\n if (field.buttons) {\r\n field.buttons.forEach(function(button, index) {\r\n html += '<button data-info=\"' + id + ',' + fieldname + ',' + index + '\">' +\r\n _htmlencode(_getFieldLabel(i18n, button, fieldname, suffix + button.id)) + '</button>';\r\n });\r\n }\r\n\r\n if (label && groupmode) {\r\n html += '<label for=\"' + id + '\" style=\"display:inline-block; padding-right:10px; padding-left: 5px\">' +\r\n i18n(label) + '</label>';\r\n }\r\n\r\n html += '</td>';\r\n // Subfields\r\n if (field.fields) {\r\n Object.keys(field.fields).forEach(function(key) {\r\n html = buildField(html, field.fields[key], fieldname, key, templ);\r\n });\r\n }\r\n return html;\r\n }", "title": "" }, { "docid": "b3ba1d79182fb97395ceddc30277552f", "score": "0.55216634", "text": "function efb_input_text() { //Text\r\n\tefb_form_object.apply(this);\r\n\tthis.fields.push(['value','text']);\r\n\tthis.fields.push(['placeholder','text']);\r\n\tthis.mask = '<input type=\"text\" name=\"[name]\" id=\"[id]\" class=\"[class]\" style=\"[style]\" value=\"[value]\" placeholder=\"[placeholder]\" />';\r\n}", "title": "" }, { "docid": "01d5f986564f5511bd6bd496fe781eb2", "score": "0.5520557", "text": "function MostrarInput(){\n\tvar valImpulso = $(\"#otroImpulso\").val();\n\t\n\tif(valImpulso == 8){\n\t $(\"#otroImpulso\").css(\"display\",\"block\");\n\t}\n\telse{\n\t $(\"#otroImpulso\").css(\"display\",\"none\");\n\t}\n }", "title": "" }, { "docid": "5d0f90977f25cabbc49154ff2efe6a62", "score": "0.551809", "text": "render () {\n return <div className='side-bar-option'>\n <div className='row side-bar-labels'>\n { this.props.name }\n </div>\n <div className='row'>\n <FormControl\n type='text'\n ref={ this.state.inputValue }\n onChange={ this.handleText }\n onBlur={ this.inputChange }\n defaultValue={ this.props.defaultOption }\n onKeyPress={ this._handleKeyPress }\n />\n </div>\n </div>\n }", "title": "" }, { "docid": "8396ce4f21b27c4056bef0950817e911", "score": "0.5517428", "text": "function nonEditor(container, options) {\n\t\t container.text(options.model[options.field]);\n\t\t }", "title": "" }, { "docid": "d6eeccd063eed7d98c508e0714722d49", "score": "0.5510787", "text": "function to_text(self) {\n\tif (self == null) self = this;\n\t\n\tvalue = $(self).children(\"input\").val()\n\t\n\tif(value==\"\") value =\"-----\";\n\t$(self).html(value);\t\n\t\n\t$(group).click(to_input);\t\t\n\t\n\t$(self).next().hide(\"puff\", {}, 500);\n}", "title": "" }, { "docid": "e5759eb39f29eb7947c8ac8babf5751d", "score": "0.5509377", "text": "function jFormsControl(name, label, datatype) {\n this.name = name;\n this.label = label;\n this.datatype = datatype;\n this.required = false;\n this.readonly = false;\n this.errInvalid = '';\n this.errRequired = '';\n this.help='';\n this.isConfirmField = false;\n this.confirmFieldOf = '';\n this.minLength = -1;\n this.maxLength = -1;\n}", "title": "" }, { "docid": "1c081530447f6d23350c93818a178415", "score": "0.5509176", "text": "renderFormField(field){\n let obj = {\n input: html`\n <input \n type=\"${field.type}\"\n name=\"${field.name}\"\n .value=\"${this.form_obj[field.name ]}\"\n @input=\"${(e) => this.handleSetCustomInputValues(e)}\"\n />\n `,\n select: html`\n <select>\n \n <select/>\n `,\n textarea: html`\n <textarea\n type=\"${field.type}\"\n name=\"${field.name}\"\n />\n `\n }\n console.log('FIELDhhh', field.tag)\n console.log('OBJJJ', obj[field.tag] )\n return obj[`${field.tag}`]\n\n }", "title": "" }, { "docid": "89f0a3575e74b6b499c59b1e54bf101e", "score": "0.5507719", "text": "function __createInputTxtBox(){\n\t\tgame.initXVelTxtBox = document.createElement('input');\n\t\tgame.initXVelTxtBox.type = 'text';\n\t\tgame.initXVelTxtBox.id = 'hAccInput';\n\t\tgame.initXVelTxtBox.style.position = 'absolute';\n\t\tgame.initXVelTxtBox.style.width = '56px';\n\t\tgame.initXVelTxtBox.style.left = '510px';\n\t\tgame.initXVelTxtBox.style.top = '480px';\n\t\tgame.initXVelTxtBox.value = '0.0';\t\n\t\tvar container = document.getElementById('act_controls');\n\t\tif (container)\n\t\t\tcontainer.appendChild(game.initXVelTxtBox);\n\t}", "title": "" }, { "docid": "d3a2e42d2b0a874e7c53c57c77c693e8", "score": "0.55009466", "text": "function Control() {}", "title": "" }, { "docid": "d3a2e42d2b0a874e7c53c57c77c693e8", "score": "0.55009466", "text": "function Control() {}", "title": "" }, { "docid": "d3a2e42d2b0a874e7c53c57c77c693e8", "score": "0.55009466", "text": "function Control() {}", "title": "" }, { "docid": "41a82c975f7e9d6631a5b5e7c2b26f87", "score": "0.54890287", "text": "function createControlBasics(formID){\n while(document.getElementById(formID)!==null)\n formID+=(Math.random()*10).toString().slice(-1);\n var form = document.createElement('form');\n form.id = formID;\n var div = document.createElement('div');\n div.classList.add('form-group', 'form-check', 'text-center');\n form.appendChild(div);\n form.groupDiv = div;\n form.createNewLine = function(){this.groupDiv.appendChild(document.createElement('br'));};\n return form;\n}", "title": "" }, { "docid": "c2e10f73c459c6cf3935d5efd4ceae4e", "score": "0.5488063", "text": "function roomtypegen(){\r\n var no = document.getElementById(\"rooms\").value;\r\n var divroom = document.getElementById(\"roomfield\");\r\n divroom.innerHTML= \"\";\r\n for(var i=0; i<no;i++){\r\n divroom.innerHTML += '<div class=\"rfield\">' +\r\n '<label for=\"room'+(i+1)+'type\">Room '+(i+1)+' type:</label>'+\r\n '<select name=\"room'+ (i+1) + 'type\">'+\r\n '<option selected>Guest Room</option>'+\r\n '<option>Terrace Suite</option>'+\r\n '<option>Executive Suite</option>'+\r\n '<option>Regal Suite</option>'+\r\n '<option>Grand Suite</option>'+\r\n '</select>'+\r\n '</div>';\r\n }\r\n\r\n}", "title": "" }, { "docid": "aec3b893469733ca55327044f581cf52", "score": "0.5484236", "text": "function createRegistrationField() {\n\n if(!changedToRegistration) {\n document.getElementById('registerready').removeAttribute(\"hidden\");\n var date = new Date();\n date.setTime(anonymousvotingAddr.finishSignupPhase() * 1000);\n document.getElementById('registerby').innerHTML = \"<hr><br>Register your ballot before \" + clockformat(date);\n date.setTime(anonymousvotingAddr.endSignupPhase() * 1000);\n changedToRegistration = true;\n }\n\n // Have we submited the key yet?\n if(anonymousvotingAddr.registered(addr)) {\n document.getElementById('registerbutton').setAttribute(\"hidden\",true);\n document.getElementById(\"registrationprogress\").removeAttribute(\"hidden\");\n document.getElementById(\"submitvotingkey\").removeAttribute(\"hidden\");\n }\n\n document.getElementById('balance').innerHTML = web3.fromWei(web3.eth.getBalance(web3.eth.accounts[accounts_index]));\n\n }", "title": "" }, { "docid": "575e311aeb3d81f63a5c23e27196a03b", "score": "0.5478668", "text": "function display() {\n message = \"<ul><li><b>NAME: </b>\" + document.form1.yourname.value;\n message += \"<li><b>ADDRESS: </b>\" + document.form1.address.value;\n message += \"<li><b>PHONE: </b>\" + document.form1.phone.value + \"</ul>\";\n document.getElementById(\"formData\").innerHTML=message;\n\n }", "title": "" }, { "docid": "2dd79005ea06a409fa51de683bffc68d", "score": "0.54768187", "text": "renderForm() {\n const markup = this._createFormMarkup();\n this._clear();\n this._display(markup);\n }", "title": "" }, { "docid": "3fe585b205d4a4529ab2bddf3ae450ce", "score": "0.54766357", "text": "function showHideFields(field, label, show, button) {\n\t// Append the field id to tag\n\tvar labelField = \"p#\" + field;\n\tvar inputField = \"input#\" + field;\n\tvar fieldButton = \"button#\" + button;\n\tif (show == \"show\") {\n\t$(labelField).attr('style', 'display:block');\n\t$(inputField).attr('style', 'display:block');\t\n\t$(fieldButton).attr('style', 'display:none');\t\n\t}\n}", "title": "" }, { "docid": "0bb2fca64e365f3316dbf0be9479840b", "score": "0.5476601", "text": "_renderType() {\n if (this._type === 'input') {\n if (!this._readonly) {\n switch (this.propertyType) {\n case \"money\":\n // this._input.setAttribute(\"type\", \"number\");\n this._input.setAttribute(\"type\", \"text\");\n this._input.setAttribute(\"min\", \"0.00\");\n this._input.setAttribute(\"max\", \"1000000000.00\");\n this._input.setAttribute(\"step\", \"0.01\");\n break;\n case \"number\":\n // this._input.setAttribute(\"type\", \"number\");\n this._input.setAttribute(\"type\", \"text\");\n break;\n default:\n this._input.setAttribute(\"type\", \"text\");\n break;\n }\n } else {\n this._input.setAttribute(\"type\", \"text\");\n }\n }\n }", "title": "" }, { "docid": "d6ed41acfe13a8586b8247ac1a5936d0", "score": "0.54742545", "text": "function displayFields(){\n fieldsCode = \"\";\n for (var i = 0; i < count; i++){\n fieldsCode += fields[i].code;\n console.log(i);\n }\n $('#inputfields').html(fieldsCode)\n}", "title": "" }, { "docid": "4b14e10c1bab5c1600d0acff9c688a81", "score": "0.54673946", "text": "renderTextField() {\n return(\n <Field\n label=\"Answer\"\n name=\"Ans\"\n component={this.renderField}\n />\n )\n }", "title": "" }, { "docid": "4e38827184eddce13f8acb3af25d3123", "score": "0.54639906", "text": "function showCreation () {\n cleanElement(divCreation);\n\n let label = document.createElement('label');\n label.htmlFor = idInputCreation;\n label.innerText = 'Ajouter un allergène : ';\n\n let input = createInput(idInputCreation, '', 'text', false);\n input.placeholder = 'Nom d\\'un nouvel allergène';\n input.onkeyup = function (event) {\n if (input.value.length !== 0 && event.key === 'Enter') {\n ajaxSave(input.value);\n }\n }\n\n let buttonSubmit = createButton(idButtonCreation, 'Valider', 'submit');\n buttonSubmit.onclick = function () {\n if (input.value.length !== 0) {\n ajaxSave(input.value);\n }\n }\n\n divCreation.appendChild(label);\n divCreation.appendChild(input);\n divCreation.appendChild(buttonSubmit);\n}", "title": "" }, { "docid": "d67ec08fe0ea9a13f27695bd0b1e9f0e", "score": "0.5459452", "text": "addControl(name, control) {\n return super.addControl(name, control);\n }", "title": "" }, { "docid": "4c57521e7e415e9bd02a07d1789697f4", "score": "0.545792", "text": "render() {\n return (\n <div>\n // change code below this line\n <input\n type=\"text\"\n value={this.state.input}\n onChange={this.handleChange}\n />\n // change code above this line\n <h4>Controlled Input:</h4>\n <p>{this.state.input}</p>\n </div>\n ); th\n }", "title": "" }, { "docid": "1da7a882dd98af7962ab14d746a40a47", "score": "0.5454673", "text": "_updateValueText() {\n\n //On met un \"_\" pour chaque chiffre de value. Pour éviter qu'on puisse accéder au mot de passe en enlevant le type password par exemple\n this.mainDiv.textDisplay.value = \"_\".repeat(this.value.length);\n\n //On enlève la couleur d'erreur si elle est active\n this.mainDiv.textDisplay.classList.remove(\"pin-login__text--error\")\n }", "title": "" }, { "docid": "949409239c6b8bf209a7cf067c922e6f", "score": "0.5447787", "text": "function ControlType(){\n\t//\n}", "title": "" }, { "docid": "9e24a0f403e7a788f4f728b06ac9b420", "score": "0.5445501", "text": "function interactive_field(array_check) {\n if (!isNaN(array_check[2])) { // if the value is a number, create an input number field\n return $('<td>', {\n append: $('<input>', {\n class: 'inputField',\n width: 55,\n min: 0,\n max: 9999,\n id: 'in_' + array_check[1],\n type: 'number',\n value: array_check[2],\n on: {\n input: update_table\n }\n })\n });\n } else { // otherwise create a option with values of array as options\n var a;\n var cont = [];\n for (a = 0; a < array_check[2].length; a++) {\n cont[a] = $('<option>', {\n value: array_check[2][a].toLowerCase(),\n text: array_check[2][a]\n });\n }\n return $('<select>', {\n id: 'in_' + array_check[1],\n width: 55,\n on: {\n input: update_table\n }\n }).append(cont);\n }\n }", "title": "" }, { "docid": "65be491c7248f9f4ad14f1bf4a308d5b", "score": "0.54424196", "text": "function _addField(parent, name, value, label, state) {\n var node;\n if (\"hidden\" == state) {\n } else {\n node = document.createElement('label');\n if (label) {\n node.appendChild(document.createTextNode(label + \" \"));\n }\n parent.appendChild(node);\n parent = node;\n }\n node = document.createElement('input');\n if (\"hidden\" == state) {\n node.setAttribute(\"type\", \"hidden\");\n } else if (\"disabled\" == state) {\n node.setAttribute(\"disabled\", \"true\");\n } else if (\"readonly\" == state) {\n node.setAttribute(\"readonly\", \"true\");\n } else if (\"password\" == state) {\n node.setAttribute(\"type\",\"password\");\n }\n node.setAttribute(\"name\", name);\n if (value) {\n node.setAttribute(\"value\", value);\n }\n parent.appendChild(node);\n }", "title": "" }, { "docid": "3a3f4cda46b7171d3a55d79a0c9dc4ce", "score": "0.544005", "text": "function generateStructure() {\n $inputNumber.wrap('<div class=\"number_wrap\"></div>');\n $inputNumber.parent().append('<button class=\"number_minus\" type=\"button\">-</button><button class=\"number_plus\" type=\"button\">+</button>');\n }", "title": "" }, { "docid": "471e3626856aeba8b5012c64fc8e17d4", "score": "0.54370433", "text": "createErrorField() {\n this.$error = document.createElement(\"div\");\n this.$error.className = \"field-error\";\n this.$errorValue = document.createTextNode(\"\");\n this.$error.appendChild(this.$errorValue);\n }", "title": "" }, { "docid": "3ad3717c85df77ea9cac57472f5fbb48", "score": "0.54361236", "text": "formPlayfield() {\n this.gameView.formPlayfield(this);\n }", "title": "" }, { "docid": "4e2d0cb61fa547be571341fc9fb21b1e", "score": "0.54351753", "text": "function showInputField(idEnding, type) {\n //inputMode = true;\n if(type == 0){\n const targetInputElem = document.getElementById(\"name-input-\" + idEnding); \n //changes input type from hidden to text \n targetInputElem.type = \"text\";\n // show every owner input field\n\n //To do: future dev: part of consolidating all rename owner buttons into one button\n // for(let i=idEnding; i<=ownersArray.length; i++){\n // const targetInputElem = document.getElementById(\"name-input-\"+i);\n // targetInputElem.type = \"text\";\n // }\n }else if(type == 1){\n targetInputElem = document.getElementById(\"item-name-input-\" + idEnding);\n //changes input type from hidden to text \n targetInputElem.type = \"text\";\n }\n\n}", "title": "" }, { "docid": "053e555e9054cf8ffc6294cb203067a6", "score": "0.5433953", "text": "function createLabelInputString(name,id){\n\treturn '<label style=\"display: inline-block;width: 80pt;text-align: right;\" for=\"' + id + '\">' + name + '</label> ' + '<input type=\"text\" id=\"' + id + '\" name=\"' + id + '\"><br>';\n\t\t\n}", "title": "" }, { "docid": "0825f4414d7e82ec2f7ae81cab99a505", "score": "0.5431757", "text": "function render() {\n return Promise.try(() => {\n const events = Events.make(),\n inputControl = makeInputControl(events, bus),\n content = div({ class: 'input-group', style: { width: '100%' } }, inputControl);\n\n ui.setContent('input-container', content);\n events.attachEvents(container);\n });\n }", "title": "" } ]
e76d79838be8b424a65759d7dddf772f
Another premise of this utility is that none of the event listeners are part of the server side rendering workflow. i.e. you will never need to callback from this function to complete the rendering process on the server This saves us having to guard in each ko function above. we know they will only ever be called on the client.
[ { "docid": "4bbb17a3452c8780eb698c3e457cc06d", "score": "0.0", "text": "function devNull() {}", "title": "" } ]
[ { "docid": "9a97a56530aa3e127f63125bc911534e", "score": "0.59012574", "text": "_addClientEventHandlers() {}", "title": "" }, { "docid": "c664b748b5ff500e37495de0a70164b3", "score": "0.58025", "text": "function ko() {\n\n function nullObjectObjectFunction( someObject, someOtherObject ) {\n console.log('I should never be run: ' + JSON.stringify( someObject ) + ' ' + JSON.stringify( someOtherObject ));\n }\n\n function nullMixedFunction( someValue ) {\n console.log('I should never be run: ' + JSON.stringify( someValue ));\n }\n\n function nullArrayFunction( someArray ) {\n console.log('I should never be run: ' + JSON.stringify( someArray ));\n }\n\n function nullArrayFunctionWithCb( someArray, someFunction ) {\n console.log('I should never be run: ' + JSON.stringify( someArray ));\n someFunction();\n }\n\n dcYUIExtensions();\n reqParams();\n\n return {\n 'applyBindings': nullObjectObjectFunction,\n 'observable': nullMixedFunction,\n 'observableArray': nullArrayFunction,\n 'cleanNode': nullMixedFunction,\n 'utils': {\n 'arrayForEach': nullArrayFunctionWithCb,\n 'arrayFirst': nullArrayFunctionWithCb\n }\n };\n}", "title": "" }, { "docid": "ab94d5fcb7f9d634a65cc0763f41958a", "score": "0.57924306", "text": "bindEvents() {\n }", "title": "" }, { "docid": "e2acab96359a26585fcad88918f5f80a", "score": "0.5749003", "text": "bindEvents() {\n }", "title": "" }, { "docid": "f7e1ad0c50b071bfa39d59325689a112", "score": "0.56989026", "text": "function EventHandler() {\n var handlers = {};\n // {\"update\": [...View.update...]}\n function on(eventString, callback) {\n var cblist = handlers[eventString];\n \n if (cblist === undefined) {\n cblist = [];\n handlers[eventString] = cblist;\n }\n \n cblist.push(callback);\n }\n \n function trigger(eventString, data) {\n var cblist = handlers[eventString];\n \n if (cblist !== undefined) {\n for (var i = 0; i < cblist.length; i++) {\n cblist[i](data); \n }\n }\n }\n \n return { \n on: on,\n trigger: trigger\n }\n }", "title": "" }, { "docid": "7a4ae17bb7ca725bbca6967aca6b02a2", "score": "0.551164", "text": "function subscribeToEvents(){_RenderWindowInteractor2.default.handledEvents.forEach(function(eventName){if(publicAPI['handle'+eventName]){model.subscribedEvents.push(model.interactor['on'+eventName](publicAPI['handle'+eventName],model.priority));}});}//----------------------------------------------------------------------------", "title": "" }, { "docid": "414cb62fe9b14b7dacd89f723e2d97e1", "score": "0.54653186", "text": "_bindEvents () {\n this.listenTo(this.model, 'change', this._toggleLoginButton)\n }", "title": "" }, { "docid": "28d5a89d632262b9d0a33c80b3591277", "score": "0.5450356", "text": "bindEvents() {\n this.listener = new Delegate(this.form);\n\n this.listener.on('submit', event => {\n event.preventDefault();\n\n if (!this.requestInProgress) {\n this.submitForm();\n }\n });\n }", "title": "" }, { "docid": "7d42cb41edd3d58ea07acdc1f2ba8408", "score": "0.5446769", "text": "_bindControlEvents() {\n this.controllerComponentChannel.on('initialized', data => this.controllerServerChannel.broadcast('init', data));\n this.controllerServerChannel.on('gotoSlide', data => this.controllerComponentChannel.broadcast('gotoSlide', data));\n this.controllerComponentChannel.on('sendNotesToController', data => this.controllerComponentChannel.broadcast('sendNotesToComponent', data));\n }", "title": "" }, { "docid": "4e17f851368f77bd8c0aa3032517d472", "score": "0.54466385", "text": "_bindEventListenerCallbacks() {\n this._onTypeaheadBlurBound = this._onTypeaheadBlur.bind(this);\n this._onTypeaheadInputBound = this._onTypeaheadInput.bind(this);\n this._onTypeaheadFocusBound = this._onTypeaheadFocus.bind(this);\n this._onPieceChangeBound = this._onPieceChange.bind(this);\n this._onTypeaheadBackspaceBound = this._onTypeaheadBackspace.bind(this);\n this._onTypeaheadEndBound = this._onTypeaheadEnd.bind(this);\n this._onInputChangeBound = this._onInputChange.bind(this);\n this._onVisibleChildrenBound = this._onVisibleChildren.bind(this);\n }", "title": "" }, { "docid": "854cfaf10d8275bbd672df6e20ebbaea", "score": "0.54278636", "text": "renderedCallback() {\n // Set up this evelent listener only when Personal Information page is rendered\n if (this.personalInfoPageActive) {\n /* Set up keypress event listener for the zip code and phone numbeer input fields.\n Need the keypress event instead of the onchange attribute like the rest of the input fields\n due to the logic used in isNumeric() to check if the user is entering something other than a number in the inputs */\n const zipCodeInput = this.template.querySelector(\".zip_code_input\");\n zipCodeInput.addEventListener(\"keypress\", this.isNumeric);\n\n const phoneNumberInput = this.template.querySelector(\".phone_number_input\");\n phoneNumberInput.addEventListener(\"keypress\", this.isNumeric);\n }\n\n if(this.personalInfoPageActive === false && this.loanInfoPageActive === false) {\n let sucessMessageContainer = this.template.querySelector(\".success_message\");\n\n sucessMessageContainer.addEventListener(\"click\", () => {\n this.restartForm();\n })\n }\n }", "title": "" }, { "docid": "e7339734c843b3ed75dae7db18c3d199", "score": "0.5419898", "text": "function bindEvents () {\n var that = this;\n \n that.$el.on('submit', function (event) {\n event.preventDefault();\n submit.call(that);\n });\n \n that.$el.on('change', 'input', updateAddButton.bind(that));\n }", "title": "" }, { "docid": "a4f448a9fcb6f94be242ffffb113804b", "score": "0.54079336", "text": "_bindEventListenerCallbacks() {\n this._onClickBound = this._onClick.bind(this);\n this._onContentClickBound = this._onContentClick.bind(this);\n this._onWindowClickBound = this._onWindowClick.bind(this);\n this._onKeyupBound = this._onKeyup.bind(this);\n this._onKeydownBound = this._onKeydown.bind(this);\n }", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.5349989", "text": "_onRender() {}", "title": "" }, { "docid": "127f911a8fd109c20014447447ee4b2b", "score": "0.53275555", "text": "_addEvent() {\n\t\t$(document).on('click', this._startOrStopObserversWatching.bind(this));\n\t}", "title": "" }, { "docid": "bc700b25c7a94db212694c503aa033a7", "score": "0.5324903", "text": "function bindEvents() {\n filterEl.bind('focus', fetchDataIfNeeded);\n angular.element(document).bind('keydown', keyNavigate);\n }", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5297021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "0fd22173819bd2998679074ab819289f", "score": "0.5295341", "text": "function subscribeToEvents() {\n vtk_js_Sources_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_1__[\"default\"].handledEvents.forEach(function (eventName) {\n if (publicAPI[\"handle\".concat(eventName)]) {\n model.subscribedEvents.push(model.interactor[\"on\".concat(eventName)](function (callData) {\n if (model.processEvents) {\n return publicAPI[\"handle\".concat(eventName)](callData);\n }\n\n return VOID;\n }, model.priority));\n }\n });\n } //----------------------------------------------------------------------------", "title": "" }, { "docid": "b0e2e0e983ce638da4f82148d25e2786", "score": "0.5287207", "text": "listenToEvents() {\n this.listenTo(this.view, 'destroy', this.destroy);\n this.listenTo(this.view, 'submit', this.onSubmit);\n }", "title": "" }, { "docid": "dbba91b619a87b2867d081c9098dae0b", "score": "0.52855164", "text": "function bindEventListeners() {\r\n handleNewItemSubmit();\r\n addBookmark();\r\n expandedBookmark();\r\n // handleItemCheckClicked();\r\n handleDeleteItemClicked();\r\n // handleEditShoppingItemSubmit();\r\n // handleToggleFilterClick();\r\n // handleShoppingListSearch();\r\n // handleItemStartEditing();\r\n // handleCloseError();\r\n }", "title": "" }, { "docid": "771903dccf895266a16c00d22adc51ba", "score": "0.5282326", "text": "preView() {\n\t\tvar self = this,\n\t\t\tlistener;\n\n\t\t_.each(self._cfgEvts, (cbOrSel, eventType) => {\n\t\t\tswitch (typeof cbOrSel) {\n\t\t\tcase 'function':\n\t\t\tcase 'string':\n\t\t\t\tlistener = simpleEventListener.bind(self, cbOrSel);\n\t\t\t\tthis._eventsToDetach[eventType] = listener;\n\t\t\t\tself._pNode.node.addEventListener(eventType, listener);\n\t\t\t\tbreak;\n\t\t\tcase 'object':\n\t\t\t\tlistener = pickyEventListener.bind(self, cbOrSel);\n\t\t\t\tthis._eventsToDetach[eventType] = listener;\n\t\t\t\tself._pNode.node.addEventListener(eventType, listener);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t});\n\t\tsuper.preView.apply(self, arguments);\n\t}", "title": "" }, { "docid": "c8672cdb3ef26aa32f7592dc6e47bed5", "score": "0.5277674", "text": "function bindEvents(){\n\t\t// window.App.removeFromCallStack(scroll, 'scroll' );\n\t\t// window.App.removeFromCallStack(resize, 'resize' );\n\n\t}", "title": "" }, { "docid": "30ed5981625246b80ba82a7d8be134a0", "score": "0.52733225", "text": "_passThroughEvents (win, renderPrefix) {\n win.webContents.on('did-fail-load', (r) => {\n // http://electron.atom.io/docs/api/web-contents/#event-did-fail-load\n this.emit(`${renderPrefix}did-fail-load`, { results: r })\n })\n win.webContents.on('did-start-loading', (r) => {\n this.emit(`${renderPrefix}did-start-loading`, { results: r })\n })\n win.webContents.on('did-finish-load', (r) => {\n this.emit(`${renderPrefix}did-finish-load`, { results: r })\n })\n win.webContents.on('dom-ready', (r) => {\n this.emit(`${renderPrefix}dom-ready`, { results: r })\n })\n win.webContents.on('did-get-response-details',\n function (event,\n status,\n newURL,\n originalURL,\n httpResponseCode,\n requestMethod,\n referrer,\n headers,\n resourceType) {\n this.emit(`${renderPrefix}did-get-response-details`, {\n event: event,\n status: status,\n newURL: newURL,\n originalURL: originalURL,\n httpResponseCode: httpResponseCode,\n requestMethod: requestMethod,\n referrer: referrer,\n headers: headers,\n resourceType: resourceType\n })\n })\n }", "title": "" }, { "docid": "6958cc4fb156f5e609b19a615c457cc2", "score": "0.5264666", "text": "_addServerEventHandlers () {}", "title": "" }, { "docid": "bd2c7b141d62f5b2c3ce62e1917eb88d", "score": "0.5227693", "text": "function bindEvents(){\n\n dasModel = new eventViewModel();\n ko.applyBindings(dasModel);\n\n $('button').click(function (){\n createEvent();\n });\n}", "title": "" }, { "docid": "79890e90e7bd202e8a176269f0df7d09", "score": "0.5220229", "text": "function decide() {\n if (support.DOMNodeInserted) {\n window.addEventListener(\"DOMContentLoaded\", function () {\n if (support.DOMSubtreeModified) { // for FF 3+, Chrome\n el.addEventListener('DOMSubtreeModified', callback, false);\n } else { // for FF 2, Safari, Opera 9.6+\n el.addEventListener('DOMNodeInserted', callback, false);\n el.addEventListener('DOMNodeRemoved', callback, false);\n }\n }, false);\n } else if (document.onpropertychange) { // for IE 5.5+\n document.onpropertychange = callback;\n } else { // fallback\n naive();\n }\n }", "title": "" }, { "docid": "6f62e82c468359586ddcd70d00c7286d", "score": "0.52062696", "text": "bindEvents() {\n\n this.trigger('binding');\n\n this.$add\n .on('click', (e) => {\n this.add();\n return false;\n });\n\n this.$target\n .on('click', '.js-admin-repeater__remove', (e) => {\n this.remove($(e.currentTarget));\n return false;\n });\n\n this.$element\n .on('js-admin-repeater:load', (e, data) => {\n this.load(data);\n })\n .on('js-admin-repeater:clear', (e) => {\n this.reset();\n });\n\n this.trigger('bound');\n }", "title": "" }, { "docid": "404f30ee38118d0172bd4f4366aa1ea8", "score": "0.5201914", "text": "function _BindListeners(){\n // _Subscribe('someEventName', function() {\n // alert('My handeler was invoked:');\n // });\n }", "title": "" }, { "docid": "e3b720371ff2411314f28863807bcb60", "score": "0.51975906", "text": "_events() {\n \tthis._addInitHandler();\n }", "title": "" }, { "docid": "a813c62756d4bc8432cfd89642cb8af9", "score": "0.51932144", "text": "function _bindEvents() {\n $mobileBtn.addEventListener(huge.click, _toggleMenu);\n $container.addEventListener(huge.click, _toggleDropDown);\n document.addEventListener(huge.click, _detectClickOutside);\n }", "title": "" }, { "docid": "b64cfa23f053398cca3a3bc3a8eed065", "score": "0.519071", "text": "function readyHandler(){if(!eventUtils.domLoaded){eventUtils.domLoaded=true;callback(event);}}", "title": "" }, { "docid": "ff70db5aee999380353dc4c1370d5ae6", "score": "0.5162165", "text": "_bindEventListeners() {\n const validationHandler = e => {\n const el = e.target\n this._cascadingValidate(el, (isValid, element) => {\n this._updateElement(element, isValid)\n })\n }\n\n // add event listeners for all configured validation behaviors\n this.properties.validationBehavior.forEach(behavior => {\n Object.keys(this.formElements.validates).forEach(k =>\n this.formElements.validates[k].addEventListener(behavior, validationHandler)\n )\n })\n\n // add event listeners for special validation behaviors\n Object.keys(this.formElements.specialBehavior).forEach(k => {\n const el = this.formElements.specialBehavior[k]\n el.addEventListener(el.getAttribute('data-validate-behavior'), validationHandler)\n })\n\n // add event listeners for submission event sources\n Object.keys(this.formElements.submits).forEach(k =>\n this.formElements.submits[k].addEventListener('click', e => {\n this.submit()\n e.preventDefault()\n })\n )\n }", "title": "" }, { "docid": "d0ac4ef7432e660eee94922cdedefbde", "score": "0.51513374", "text": "bindUI() {\n this.on('focus', this.onFocus);\n this.on('click', this.onClick);\n\n this.onEvent('show', this.onShow);\n this.onEvent('repaint', this.onRepaint);\n this.onEvent('invalid', this.onInvalid);\n }", "title": "" }, { "docid": "e2d9b836e186f9dc505d7cc740e20f6c", "score": "0.51508415", "text": "function subscribeToEvents() {\n _RenderWindowInteractor2.default.handledEvents.forEach(function (eventName) {\n if (publicAPI['handle' + eventName]) {\n model.subscribedEvents.push(model.interactor['on' + eventName](publicAPI['handle' + eventName], model.priority));\n }\n });\n }", "title": "" }, { "docid": "cb1abfdd8bc4f0e733331a4c00fbea96", "score": "0.51503354", "text": "initBindingsAndEventListeners(){\n return null\n }", "title": "" }, { "docid": "1fc6bcc85a28c266b48419d7280e6d9a", "score": "0.5149818", "text": "bindEvents() {\n this.eventManager.addEventListener(this.TEXTAREA, 'cut', event => event.stopPropagation());\n this.eventManager.addEventListener(this.TEXTAREA, 'paste', event => event.stopPropagation());\n\n if (isIOS()) {\n // on iOS after click \"Done\" the edit isn't hidden by default, so we need to handle it manually.\n this.eventManager.addEventListener(this.TEXTAREA, 'focusout', () => this.finishEditing(false));\n }\n\n this.addHook('afterScrollHorizontally', () => this.refreshDimensions());\n this.addHook('afterScrollVertically', () => this.refreshDimensions());\n\n this.addHook('afterColumnResize', () => {\n this.refreshDimensions();\n this.focus();\n });\n\n this.addHook('afterRowResize', () => {\n this.refreshDimensions();\n this.focus();\n });\n }", "title": "" }, { "docid": "845648f008f7ee7c1287a367009ca43d", "score": "0.5142692", "text": "attachButtonHandlers() {\n this.View.container.onclick \n = this.Controller.viewClickHandler.bind(this);\n }", "title": "" }, { "docid": "64695610d908cbc033912add756fd242", "score": "0.51387924", "text": "knockout() {\n this._knockout = true;\n this._dead = true;\n }", "title": "" }, { "docid": "ca2b23c4af56a45d735695eb2e45cd68", "score": "0.51238084", "text": "applyExposeEvents() {\n this.domElm.on('beforeItemAdd', (e) => {\n if (typeof this.onBeforeItemAdd === 'function') {\n this.onBeforeItemAdd(e);\n }\n if (typeof this.events.onBeforeItemAdd === 'function') {\n this.events.onBeforeItemAdd(e);\n }\n });\n\n this.domElm.on('beforeItemRemove', (e) => {\n if (typeof this.onBeforeItemRemove === 'function') {\n this.onBeforeItemRemove(e);\n }\n if (typeof this.events.onBeforeItemRemove === 'function') {\n this.events.onBeforeItemRemove(e);\n }\n });\n\n this.domElm.on('itemAdded', (e) => {\n // refresh the value attribute (except when we explicitly don't want it)\n if (!e.options || !e.options.preventRefresh) {\n this.suppressValueChanged = true;\n this.value = this.domElm.tagsinput('items');\n }\n if (typeof this.onItemAdded === 'function') {\n this.onItemAdded(e);\n }\n if (typeof this.events.onItemAdded === 'function') {\n this.events.onItemAdded(e);\n }\n });\n\n this.domElm.on('itemAddedOnInit', (e) => {\n if (typeof this.onItemAddedOnInit === 'function') {\n this.onItemAddedOnInit(e);\n }\n if (typeof this.events.onItemAddedOnInit === 'function') {\n this.events.onItemAddedOnInit(e);\n }\n });\n\n this.domElm.on('itemRemoved', (e) => {\n // refresh the value attribute (except when we explicitly don't want it)\n if (!e.options || !e.options.preventRefresh) {\n this.suppressValueChanged = true;\n this.value = this.domElm.tagsinput('items');\n }\n if (typeof this.onItemRemoved === 'function') {\n this.onItemRemoved(e);\n }\n if (typeof this.events.onItemRemoved === 'function') {\n this.events.onItemRemoved(e);\n }\n });\n }", "title": "" }, { "docid": "52c51995b080fa8c6da82300a0dc854d", "score": "0.5104178", "text": "attachedCallback() {\n // Subclasses may override.\n }", "title": "" }, { "docid": "96b3922e83b551003fd1ea14bb86c1f2", "score": "0.5097963", "text": "rebuild() {\n this.div?.addEventListener(\"focusin\", this.#boundFocusin);\n this.div?.addEventListener(\"focusout\", this.#boundFocusout);\n }", "title": "" }, { "docid": "4c0271a3691b7486b94ee1c1723da891", "score": "0.5095105", "text": "addEventHandlers() {\n\n\n }", "title": "" }, { "docid": "e13f78fc97c806055f8888fb9768bd99", "score": "0.50923955", "text": "function getStarted() {\n ko.applyBindings(new viewModel());\n}", "title": "" }, { "docid": "604e28b782f65b3c20c2842d1188dfbe", "score": "0.50891596", "text": "_changeEventListener() {}", "title": "" }, { "docid": "9b2e992b83f1f879b25f1cb8f7c69933", "score": "0.5089047", "text": "bindMainEvents() {\n\n\t\tthis.a$.html = $('html');\n\t\tthis.a$.container = $('#content');\n\t\tthis.a$.body = $('body');\n\n\t\twindow.addEventListener('resize', _.throttle(() => this._onResize(), 300), false);\n\t\twindow.addEventListener('scroll', () => this._onScroll, false);\n\n\t\t// document.addEventListener('keydown',() => this._onKeyDown(e), false);\n\t\t// document.addEventListener(\"mouseout\",\t() => this._onMouseOut(e), false);\n\t\t// this.$.body[0].addEventListener(\"mousemove\",\t() => this._onMouseMove(e), false);\n\t\t// this.$.body[0].addEventListener(\"mousedown\",\t() => this._onMouseDown(e), false);\n\t\t// this.$.body[0].addEventListener(\"mouseup\",\t() => this._onMouseUp(e), false);\n\n\t\t// this.$.body[0].addEventListener(\"touchstart\",\t() => this._onTouchStart(e), false);\n\t\t// this.$.body[0].addEventListener(\"touchmove\",\t () => this._onTouchMove(e), false);\n\t\t// this.$.body[0].addEventListener(\"touchend\",\t\t() => this._onTouchEnd(e), false);\n\t}", "title": "" }, { "docid": "ca46dc06029d91f818bd5bf51d87d03a", "score": "0.5084147", "text": "bindHandlers() {\n this.editSlot.addEventListener('click', this.editHandler.bind(this));\n this.concludeSlot.addEventListener('click', this.concludeHandler.bind(this));\n this.cancelSlot.addEventListener('click', this.cancelHandler.bind(this));\n this.editorSlot.addEventListener('keyup', this.changeHandler.bind(this), true);\n this.editorSlot.addEventListener('change', this.changeHandler.bind(this), true);\n this.editorSlot.addEventListener('keypress', this.submitHandler.bind(this));\n this.skeleton.addEventListener('renderviewer', this.renderViewerHandler.bind(this));\n this.skeleton.addEventListener('rendereditor', this.renderEditorHandler.bind(this));\n }", "title": "" }, { "docid": "f5fffdeca90903287f28710a8762d16f", "score": "0.5076488", "text": "function bindEvents() {\n _btnResult.on(\"click\", function () {\n $selfObject.frame.dispose();\n });\n }", "title": "" }, { "docid": "f083d1e396e4d5b9c4677c435c314785", "score": "0.50751215", "text": "function bindEvents () {\n this.stripeForm.on('submit', $.proxy(this.sendToken, this));\n }", "title": "" }, { "docid": "b7ff0c4a03e4b6589121157f1b384b0a", "score": "0.5073233", "text": "function allBindings() {lacuna_lazy_load(\"node_modules/knockout/build/output/knockout-latest.debug.js[138457:138586]\", functionData => eval(functionData))}", "title": "" }, { "docid": "cddc94275eb6d068a3f0f6d70da65a11", "score": "0.50720674", "text": "function ready(){\n ko.applyBindings(new ViewModel());\n}", "title": "" }, { "docid": "4bc4f33b86ac28a3b0c181088b9f8794", "score": "0.50703424", "text": "onRendered() {\n /* For convenience. */\n }", "title": "" }, { "docid": "684b31c94103d69fea9fb416aad82440", "score": "0.5069487", "text": "function _events() {\n $labels.on('click', _labelClick);\n // $checkboxes.on('click', _toggleCheckbox); \n // $radios.on('click', _toggleRadio);\n }", "title": "" }, { "docid": "e2e4fc9be72535cc06e14530d38be331", "score": "0.5058969", "text": "bindEvents() {\n const form = this.root.querySelector(\"div form\");\n\n // Handling the form submit event\n if(form){\n form.onsubmit = evt => {\n const formData = new FormData(form);\n evt.preventDefault();\n this.onSave(formData);\n };\n }\n\n // Handling the click on the showForm button\n const showFormButton = this.root.getElementById(\"show-form\");\n if(showFormButton){\n showFormButton.onclick = evt => {\n evt.preventDefault();\n this.toggleForm();\n };\n }\n\n //handling the cancel button click\n const cancelButton = this.root.querySelector(\"form div button\");\n if(cancelButton){\n cancelButton.onclick = evt => {\n evt.preventDefault();\n this.title = \"Add Column\";\n this.activeColumn = {\n title: \"\",\n };\n this.toggleForm();\n this.render();\n };\n }\n }", "title": "" }, { "docid": "6436ef9ba97159c1624b0c36c9798a4b", "score": "0.5052083", "text": "attachedCallback() {}", "title": "" }, { "docid": "6436ef9ba97159c1624b0c36c9798a4b", "score": "0.5052083", "text": "attachedCallback() {}", "title": "" }, { "docid": "23b31d703ddcd3c1895cf1f479d47760", "score": "0.50400424", "text": "onRender(){}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.5040032", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e594d7cbccdd2575bd5a82f39bcf251f", "score": "0.5034886", "text": "rendered() {\n this.#updateCallbacks();\n }", "title": "" }, { "docid": "4a0f5972385dd9fbbd45632a7301c52f", "score": "0.50327015", "text": "function bind(){\n listen();\n observe();\n }", "title": "" }, { "docid": "9c9ac9706ac3158e7323288180acfd1e", "score": "0.5031511", "text": "ensureBoundOnDisposer() {\n this.boundOnDisposer = this.boundOnDisposer || this.onDisposer.bind(this);\n }", "title": "" }, { "docid": "5b72259c5149e13a5948f8b5de854c97", "score": "0.5024712", "text": "connectedCallback() {\n super.connectedCallback();\n afterNextRender(this, function() {\n this.addEventListener(\"mousedown\", this.tapEventOn);\n this.addEventListener(\"mouseover\", this.tapEventOn);\n this.addEventListener(\"mouseout\", this.tapEventOff);\n this.$.button.addEventListener(\"focused-changed\", this.focusToggle);\n });\n }", "title": "" }, { "docid": "772957e35432bf04e7a950541e89b50a", "score": "0.5019053", "text": "bindEventHandlers() {\n this.handleClick = this.handleClick.bind(this);\n this.handleMouseMove = this.handleMouseMove.bind(this);\n this.handleResize = this.handleResize.bind(this);\n this.showTooltip = this.showTooltip.bind(this);\n this.hideTooltip = this.hideTooltip.bind(this);\n this.handlePostMessage = this.handlePostMessage.bind(this);\n window.addEventListener(\"message\", this.handlePostMessage);\n window.addEventListener(\"resize\", this.handleResize);\n }", "title": "" }, { "docid": "7161a9d683319bc8b91ec34f877fce3e", "score": "0.5007551", "text": "function handleEvents() {\n el.addEventListener('blur', function() {\n\n saveModel(vModel, el.value, vnode);\n\n if (el.value === '') {\n deleteModel(vModel);\n }\n\n });\n }", "title": "" }, { "docid": "794e83b643cf94b702138595d34fe4aa", "score": "0.5002969", "text": "connectedCallback() {\n this.$start.addEventListener('focus', this.focusLastElement);\n this.$end.addEventListener('focus', this.focusFirstElement);\n // Focus out is called every time the user tabs around inside the element\n this.addEventListener('focusin', this.onFocusIn);\n this.addEventListener('focusout', this.onFocusOut);\n this.render();\n }", "title": "" }, { "docid": "f50eeaa0098fcfa0fba497de7830394e", "score": "0.50000745", "text": "bindEventHandlers() {\n if (!this.renderer) throw \"renderer didn't init\";\n window.addEventListener('resize', this.handleResize.bind(this));\n this.renderer.domElement.addEventListener('click', this.handleClick.bind(this));\n this.renderer.domElement.addEventListener('mousemove', this.handleMouseMove.bind(this));\n }", "title": "" }, { "docid": "8b45697f297245b78a04ae93549dd09c", "score": "0.49975747", "text": "function handleEvent(callback) {\n var params = eventParamsForInstance(eventName, self, callback, context || self);\n\n if (params.event.type === 'DOM') {\n // Avoid overhead of handling DOM events on the server\n if ($serverSide) {\n return;\n }\n\n //will call _addEvent during delegateEvents()\n if (!self._eventsToDelegate) {\n self._eventsToDelegate = [];\n }\n self._eventsToDelegate.push(params);\n }\n\n if (params.event.type !== 'DOM' || self._eventsDelegated) {\n self._addEvent(params);\n }\n }", "title": "" }, { "docid": "0ae6d6777bd166680e0e9f9ddd608140", "score": "0.49949783", "text": "bindUI() {\n super.bindUI();\n\n this.on('focus', this.onFocus);\n this.on('blur', this.onBlur);\n this.on('mousedown', this.onMouseDown);\n this.on('keyup', this.onKeyUp);\n this.on('keydown', this.onKeyDown);\n this.on(['mouseup', 'mouseout'], this.deactivate); \n\n this.onAttributeChange('label', this.setLabel);\n this.onAttributeChange('required', this.setRequired);\n this.onAttributeChange('nullable', this.setNullable);\n this.onAttributeChange('maxlines', this.setMaxLines);\n }", "title": "" }, { "docid": "09fd1b0d5b636a4e569ceafa18c34e85", "score": "0.49772766", "text": "function eventBindings() {\n\n\t\t//////////////////////////\n\t\t// Closing the lightbox //\n\t\t//////////////////////////\n\n\t\tlbOverlay.addEventListener('click', function(){\n\t\t\tclose();\n\t\t});\n\n\t\tlbClose.addEventListener('click', function(){\n\t\t\tclose();\n\t\t});\n\n\n\t\t////////////////////////////////////\n\t\t// Changing content from previews //\n\t\t////////////////////////////////////\n\n\t\tlbPrevious.addEventListener('click', function(){\n\t\t\tchangeContent(-1);\n\t\t});\n\n\t\tlbNext.addEventListener('click', function(){\n\t\t\tchangeContent(1);\n\t\t});\n\n\n\t\t////////////////////////\n\t\t// Keyboard Functions //\n\t\t////////////////////////\n\n\t\tdocument.addEventListener('keyup', function(e){\n\t\t\tif (e.key === \"Escape\" && state.isOpen) {\n\t\t\t\tclose();\n\t\t\t} else if (e.key === \"ArrowRight\" && state.isOpen){\n\t\t\t\tchangeContent(1);\n\t\t\t} else if (e.key === \"ArrowLeft\" && state.isOpen){\n\t\t\t\tchangeContent(-1);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "578eb3d8e01c51e0a57f4dc5dc443146", "score": "0.49635485", "text": "function treeSyncEventHandler() {\n //re-add a handler to the tree's nodeClicked event\n $tree.UmbracoTreeAPI().addEventHandler(\"nodeClicked\", nodeClickHandler);\n }", "title": "" }, { "docid": "d4b8b698208ad8999cdd9ccf0c6ec6f8", "score": "0.4951545", "text": "addHandlerRender( handlerLoad, handlerHashChange ) {\n window.addEventListener( 'load', handlerLoad );\n window.addEventListener( 'hashchange', handlerHashChange );\n }", "title": "" }, { "docid": "258f16216474183a1e0ea03663e2729b", "score": "0.49447647", "text": "function readyHandler() {\r\n\t\t\tif (!event_utils.domLoaded) {\r\n\t\t\t\tevent_utils.domLoaded = true;\r\n\t\t\t\tcallback(event);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "715bdf957743bdfebd30deab76f3e17a", "score": "0.49432588", "text": "connectedCallback() {\n // Nothing to do when the component is removed, appended, or edited\n }", "title": "" }, { "docid": "becd9137afdf20aa83675d7012441567", "score": "0.49400035", "text": "function _bindEvents()\n\t{\n\t\t$galUiCheck.on('change', function(e) \n\t\t{\n\t\t\tvar $this = $(this);\n\n\t\t\tif(this.checked)\n\t\t\t\t$this.parent('span').addClass('checked');\n\t\t\telse\n\t\t\t\t$this.parent('span').removeClass('checked');\n\t\t});\n\n\t\t$galUiSelect.change( function(e) \n\t\t{\n\t\t\tvar $this = $(this);\n\t\t\t$this.parent('.selector').children('span').text($this.val());\n\t\t});\n\t}", "title": "" }, { "docid": "213445e9f60ee0caa358c7878c15184b", "score": "0.4938433", "text": "function scripts_addEventListener() {\n\tif (window.__eventManager == null) {\n\t\tvar hash = {};\n\t\twindow.__eventManager = {\n\t\t\tadd(el, type) {\n\t\t\t\tvar id = Math.random() * 100000000 | 0;\n\t\t\t\tvar obj = hash[id] = {\n\t\t\t\t\tqueue: [],\n\t\t\t\t\tel: el,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tcb: function (event) {\n\t\t\t\t\t\tobj.queue.push(event);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tobj.el.addEventListener(obj.type, obj.cb, false);\n\t\t\t\treturn id;\n\t\t\t},\n\t\t\tremove(id) {\n\t\t\t\tvar obj = hash[id];\n\t\t\t\tif (obj == null) {\n\t\t\t\t\tthrow new Error('Event ID not found: ' + id);\n\t\t\t\t}\n\t\t\t\tdelete hash[id];\n\t\t\t\tobj.el.removeEventListener(obj.type, obj.cb, false);\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\ttryGet(id) {\n\t\t\t\tvar obj = hash[id];\n\t\t\t\tif (obj == null) {\n\t\t\t\t\tthrow new Error('Event ID not found: ' + id);\n\t\t\t\t}\n\t\t\t\tif (obj.queue.length === 0) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tvar event = serialize(obj.queue.shift());\n\t\t\t\treturn event;\n\t\t\t}\n\t\t};\n\t\tfunction serialize(model, refs) {\n\t\t\tif (refs == null) {\n\t\t\t\trefs = [];\n\t\t\t}\n\t\t\tif (model == null || typeof model !== 'object') {\n\t\t\t\treturn model;\n\t\t\t}\n\t\t\tif (model === document || model === window) {\n\t\t\t\t// do not pass window/document objects, as causing circular refs\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (model instanceof HTMLElement) {\n\t\t\t\t// check if element is not staled\n\t\t\t\tif (document.body.contains(model) === false) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn model;\n\t\t\t}\n\t\t\tif (Array.isArray(model)) {\n\t\t\t\treturn model.map(function (x) {\n\t\t\t\t\treturn serialize(x, refs);\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (refs.indexOf(model) > -1) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\trefs.push(model);\n\t\t\tvar obj = {};\n\t\t\tfor (var key in model) {\n\t\t\t\tobj[key] = serialize(model[key], refs);\n\t\t\t}\n\t\t\treturn obj;\n\t\t}\n\t}\n\n\tvar el = arguments[0],\n\t type = arguments[1];\n\treturn window.__eventManager.add(el, type);\n}", "title": "" }, { "docid": "4ddaaaf48140663f1c079812f9e9a0b1", "score": "0.49364802", "text": "_bindPreControlEvents() {\n const slideCount = { loading: 0, loaded: 0 };\n this.controllerComponentChannel.on('presentationLoading', () => slideCount.loading++);\n this.controllerComponentChannel.on('presentationLoaded', () => {\n if (++slideCount.loaded !== slideCount.loading) return;\n\n this._checkTCClientPresence(100).then(status => {\n if (status === 'ok') this.controllerComponentChannel.broadcast('init');\n else this.controllerComponentChannel.broadcast('error', { type: ERROR_TYPE_SCRIPT_NOT_PRESENT });\n });\n });\n }", "title": "" }, { "docid": "2d0cb15a2a9859c42328196fe8f3430e", "score": "0.493351", "text": "function addSubscribers () {\n\t\tcontrolsView\n\t\t\t.on( 'update', controlsModel.setValue )\n\t\t\t.on( 'random', controlsModel.randomizeValues );\n\n\t\tcontrolsModel\n\t\t\t.on( 'update', controlsView.setValue )\n\t\t\t.on( 'update', glitchModel.setValue )\n\t\t\t.on( 'update', shareView.hideShareLinks );\n\n\t\tcanvasControlsView\n\t\t\t.on( 'center', canvasView.animateToCenter )\n\t\t\t.on( 'scale', canvasView.setScale );\n\n\t\tcanvasView\n\t\t\t.on( 'scale', canvasControlsView.setScale )\n\t\t\t.on( 'dblclick', canvasView.animateToCenter );\n\n\t\topenFileView\n\t\t\t.on( 'openfile', imageModel.loadFromFile )\n\t\t\t.on( 'openfromlocalstorage', storageModel.loadItem )\n\t\t\t.on( 'deletefromlocalstorage', storageModel.removeLocalData )\n\t\t\t.on( 'deletefromimgur', shareModel.remove );\n\n\t\tsaveView\n\t\t\t.on( 'savetolocalstorage', glitchModel.getImageGenerationFn( saveNewEntry ) )\n\t\t\t.on( 'savetolocalstorage', updateDownloadLink )\n\t\t\t.on( 'show', updateDownloadLink );\n\n\t\tnavView.on( 'toggleend', canvasView.resized );\n\n\t\timageModel\n\t\t\t.on( 'load', glitchModel.setImageData )\n\t\t\t.on( 'load', openFileView.dialog.hide )\n\t\t\t.on( 'load', canvasView.animateToCenter )\n\t\t\t.on( 'load', canvasView.show )\n\t\t\t.on( 'update', canvasView.hide )\n\t\t\t.on( 'error', indicatorView.showError )\n\t\t\t.on( 'error', indicatorView.hideLoading )\n\t\t\t.on( 'statusmessage', indicatorView.showMessage );\n\n\t\tglitchModel\n\t\t\t.on( 'glitch', canvasView.putImageData )\n\t\t\t.on( 'glitch', canvasView.createImageUrl( shareModel.updateUrl ) )\n\t\t\t.on( 'glitch', updateDownloadLink );\n\n\t\tshareView\n\t\t\t.on( 'share', shareModel.upload )\n\t\t\t.on( 'deletefromimgur', shareModel.remove );\n\n\t\tshareModel\n\t\t\t.on( 'uploadstart', shareView.showUpload )\n\t\t\t.on( 'uploadend', shareView.hideUpload )\n\t\t\t.on( 'uploadcomplete', shareView.uploadComplete )\n\t\t\t.on( 'uploadcomplete', glitchModel.getImageGenerationFn( saveNewEntry ) )\n\t\t\t.on( 'removecomplete', storageModel.removeImgurData )\n\t\t\t.on( 'removecomplete', shareView.hideShareLinks )\n\t\t\t.on( 'error', indicatorView.showError )\n\t\t\t.on( 'error', shareView.handleError )\n\t\t\t.on( 'statusmessage', indicatorView.showMessage );\n\n\t\twebcamView\n\t\t\t.on( 'video', imageModel.loadFromVideo )\n\t\t\t.on( 'error', indicatorView.showError );\n\n\t\tdragAndDropView\n\t\t\t.on( 'drop', imageModel.loadFromFile )\n\t\t\t.on( 'drop', canvasView.hide );\n\n\t\twelcomeView\n\t\t\t.on( 'message', indicatorView.showWelcome );\n\n\t\tworkspaceView\n\t\t\t.on( 'click', navView.closeSmallScreenNav );\n\n\t\tsettingsView\n\t\t\t.on( 'settingchange', settingsModel.setValue );\n\n\t\tstorageModel\n\t\t\t.on( 'update', openFileView.updateList )\n\t\t\t.on( 'update', shareView.updateList )\n\t\t\t.on( 'update', loadInitialItem )\n\t\t\t.on( 'loaditem', loadEntry )\n\t\t\t.on( 'statusmessage', indicatorView.showMessage )\n\t\t\t.on( 'error', indicatorView.showError )\n\t\t\t.on( 'visits', welcomeView.updateVisits )\n\t\t\t.on( 'firstvisit', welcomeView.show );\n\n\t\tnetworkModel\n\t\t\t.on( 'connect', shareView.showOnlineOptions )\n\t\t\t.on( 'disconnect', shareView.hideOnlineOptions )\n\t\t\t.on( 'connect', appView.showOnlineOptions )\n\t\t\t.on( 'disconnect', appView.hideOnlineOptions );\n\n\t\tsettingsModel\n\t\t\t.on( 'update', canvasView.panZoom.settingUpdated )\n\t\t\t.on( 'update', imageModel.settingUpdated )\n\t\t\t.on( 'update', settingsView.settingUpdated )\n\t\t\t.on( 'update', localisationModel.settingUpdated )\n\t\t\t.on( 'error', indicatorView.showError );\n\n\t\tlocalisationModel\n\t\t\t.on( 'error', indicatorView.showError )\n\t\t\t.on( 'error', hideAppLoader )\n\t\t\t.on( 'newlanguage', welcomeView.showLanguageHint )\n\t\t\t.on( 'update', hideAppLoader );\n\t}", "title": "" }, { "docid": "5ba9d5ed990e4781a24c3ae357f1f60f", "score": "0.49286872", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(self._input, \"keydown\", onKeyDown);\n if (self.calendarContainer !== undefined) {\n bind(self.calendarContainer, \"keydown\", onKeyDown);\n }\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n });\n }\n }\n if (self.config.allowInput) {\n bind(self._input, \"blur\", onBlur);\n }\n }", "title": "" }, { "docid": "73b80cebf5bebe6c262c63d177b19096", "score": "0.49274275", "text": "_bindEvents() {\r\n this._handleFormData(this.passengerForm, this.passengerDetails)\r\n this._handleFormData(this.contactForm, this.contactDetails)\r\n this._handleFormSubmit(\r\n this.passengerForm,\r\n this.passengerDetails,\r\n 'passengerDetails'\r\n )\r\n this._handleFormSubmit(\r\n this.contactForm,\r\n this.contactDetails,\r\n 'contactDetails'\r\n )\r\n }", "title": "" }, { "docid": "be38da3e6f5263d36d7f52e385b50204", "score": "0.49233776", "text": "function bindCustomEvents(){\n // DOCUMENT on FULLSCREEN\n $d.on('webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', onFullscreenChange);\n // SEEK slider on MOUSE DOWN / UP / CHANGE\n s.$playerSeekSlider.on('mousedown', onSeekMouseDown)\n .on('mouseup', onSeekMouseUp)\n .on('mousemove', onSeekMouseMove);\n // STANDARD player control on CLICK\n s.$standardPlayerControls.on('click', onStandardPlayerControlsClick);\n // REPLAY video button on CLICK\n s.$replayVideoBtn.on('click', onReplayBtnClick);\n // VOLUME container on CLICK\n s.$volContainer.on('click', onVolumeContainerInteract);\n // VOLUME slider on INPUT CHANGE\n s.$volTrack.on('mousedown', onVolumeSliderMouseDown)\n .on('mousemove', onVolumeSliderMouseMove)\n .on('mouseup', onVolumeSliderMouseUp);\n // MUTE button on MOUSEOVER\n s.$muteToggleBtn.on('mouseover', onMuteToggleHover);\n // MUTE button on MOUSELEAVE\n s.$allControlsWrapper.on('mouseleave', onControlsBlur);\n // FACEBOOK share button on CLICK\n s.$facebookShareBtn.on('click', onFacebookShareClick);\n // TWITTER share button on CLICK\n s.$twitterShareBtn.on('click', onTwitterShareClick);\n }", "title": "" }, { "docid": "0288c5a3c196bb72587de64c25b9d8f1", "score": "0.4921562", "text": "bindUI() {\n super.bindUI();\n\n this.on('focus', this.onFocus);\n this.on('blur', this.onBlur);\n this.on('change', this.onChange);\n this.on('keydown', this.onKeyDown); \n this.on('keypress', this.onKeyPress); \n \n this.onAttributeChange('required', this.setRequired);\n }", "title": "" }, { "docid": "81cc865accb5d779f9e231178670437c", "score": "0.4918874", "text": "addEventListeners() {\n document.getElementById('username').addEventListener('focusout',\n () => {\n Rendering.renderInputError('username', Validation.validateUsername());\n }, false);\n\n document.getElementById('fullName').addEventListener('focusout',\n () => {\n Rendering.renderInputError('fullName', Validation.validateFullName());\n }, false);\n\n document.getElementById('email').addEventListener('focusout',\n () => {\n Rendering.renderInputError('email', Validation.validateEmail());\n }, false);\n\n\n document.getElementById('imageInput')\n .addEventListener('change', Rendering.updateProfileImg.bind(Rendering), false);\n\n document.getElementById('profileForm')\n .addEventListener('submit', () => {\n if (this.updateAllErrors()) {\n this.eventBus.emit('profileSettingsView:formSubmit', null);\n }\n }, false);\n\n this.eventBus.on('userSession:set', (input) => {\n this.setParams(input);\n });\n }", "title": "" }, { "docid": "16dd14341e2680fbb068bd3a36eb56f8", "score": "0.49154833", "text": "_addEventListeners() {\n this.el.addEventListener('click', this._onClickBound);\n this.contentEl.addEventListener('click', this._onContentClickBound);\n }", "title": "" }, { "docid": "def54307ad51b21da58496b7959ef2ac", "score": "0.49145162", "text": "function bindEvents() {\r\n var i = 0,\r\n length = 0,\r\n buttons = null;\r\n \r\n page.addEventListener('pagebeforeshow', onPageBeforeShow);\r\n page.addEventListener('pagehide', onPageHide);\r\n sectionChangerElement.addEventListener(\r\n 'sectionchange', onSectionChange, false);\r\n sectionChangerElement.addEventListener('scrollstart',\r\n onSectionScrollStart);\r\n sectionChangerElement.addEventListener('scrollend',\r\n onSectionScrollEnd);\r\n \r\n buttons = page.querySelectorAll('.volume-btn');\r\n length = buttons.length;\r\n \r\n for (i = 0; i < length; i += 1) {\r\n buttons[i].addEventListener('click', onVolumeBtnClick);\r\n }\r\n \r\n e.listeners({\r\n 'views.volume.change': onVolumeChange\r\n });\r\n }", "title": "" }, { "docid": "18871343ea1d2fdebefdf7de3b08532a", "score": "0.4908255", "text": "bindEvents() {\n this.dom.triggers.forEach(button => button.addEventListener('click', this.onModalTriggerClick));\n this.dom.close.addEventListener('click', this.onModalCloseClick);\n }", "title": "" }, { "docid": "5c9e41d912e3ee49766aa027c8da34a0", "score": "0.49080774", "text": "function bindEvents() {\r\n page.addEventListener('pagebeforeshow', onPageBeforeShow);\r\n page.querySelector('ul').addEventListener('click', onListClick);\r\n }", "title": "" } ]
ee9e5588d3324d17f33041275b01da91
player screeen fire button
[ { "docid": "0610b1786c606e157c3e87beb3b4028e", "score": "0.6649663", "text": "function screenButtonDown() {\n fireButton = true;\n}", "title": "" } ]
[ { "docid": "a7e61aff16ab0cdb29c85ca1ab8893b0", "score": "0.7312426", "text": "playerFire(){\n\t\t// check if there is any player\n\t\t// if not, the click doesn't fire\n\t\tif (this.player === null){\n\t\t\treturn;\n\t\t}\n\t\tthis.player.fire(this.mouseX, this.mouseY); // make the player fire in the game\n\t}", "title": "" }, { "docid": "fb06028071b7aa1767cfda8e1a383eec", "score": "0.67853665", "text": "function onePlayerGraphics() {\n $(\"#order\").slideDown(\"slow\");\n buttonPressed(\"#onePlayer\");\n }", "title": "" }, { "docid": "bf60c242e3604862a980d44ad9d8e5df", "score": "0.6703704", "text": "function r(){\n// add buttons\nvar e=o.add.sprite(n.playerSelect[0].x,n.playerSelect[0].y,\"pngSheet\",\"empty\");e.anchor.setTo(.5,.5),e.width=n.playerSelect[0].width,e.height=n.playerSelect[0].height,e.inputEnabled=!0,e.events.onInputDown.add(function(){this.changePlayer(0)},o),o.popUpGroup.add(e);\n// add buttons\nvar a=o.add.sprite(n.playerSelect[1].x,n.playerSelect[1].y,\"pngSheet\",\"empty\");a.anchor.setTo(.5,.5),a.width=n.playerSelect[1].width,a.height=n.playerSelect[1].height,a.inputEnabled=!0,a.events.onInputDown.add(function(){o.changePlayer(1)},o),o.popUpGroup.add(a);var t=o.add.image(n.playerSelect[0].x+80,n.playerSelect[0].y+100,\"pngSheet\",\"tick\");o.popUpGroup.add(t)}", "title": "" }, { "docid": "e5583524923cdafbf49ad65516a41a25", "score": "0.6663018", "text": "function clickFire(){\n\t\tSmog.Human.clicked();\n\t}", "title": "" }, { "docid": "afb0dc5148377380cc747df29f933319", "score": "0.664169", "text": "playerButtonActionOne() {MusicActions.playerAct(0)}", "title": "" }, { "docid": "0d74076cb42f4b9f6e213e0e11688a08", "score": "0.6638379", "text": "playerShot() {\n\n }", "title": "" }, { "docid": "83ba91afa336401d577cf64bbe0b7e87", "score": "0.6631069", "text": "function play(button) {\r\n\tconsole.log(\"play\");\r\n\tnextPlayer();\r\n}", "title": "" }, { "docid": "1c83ae4e44c4145e081a7cdb92e6d6e1", "score": "0.66047806", "text": "function playbutton(x){\n x.play();\n}", "title": "" }, { "docid": "82fa3e42c9d00bb7c78340480ac89b6f", "score": "0.65838283", "text": "function fPlay() {\n\t\tif (botonPlay.innerHTML == 'REPRODUCIR') {\n\t\t\tcancion.play();\n\t\t\tbotonPlay.style.backgroundImage = 'url(img/icon-pause.png)';\n\t\t\tbotonPlay.style.backgroundPosition = '8px';\n\t\t\tbotonPlay.innerHTML = 'PAUSAR';\n\t\t} else {\n\t\t\tcancion.pause();\n\t\t\tbotonPlay.style.backgroundImage = 'url(img/icon-play.png)';\n\t\t\tbotonPlay.style.backgroundPosition = '2px';\n\t\t\tbotonPlay.innerHTML = 'REPRODUCIR';\n\t\t}\n\t}", "title": "" }, { "docid": "bbda24b0b0699562a651ca4c585ed1d1", "score": "0.6547597", "text": "function clickDoodleFairytale() {\n var t = document.getElementById(\"fairytale\");\n t.paused ? (t.play(), jq(\"#fairytalePlayButton\").css({\n opacity: \"0\"\n })) : (t.pause(), jq(\"#fairytalePlayButton\").css({\n opacity: \"1\"\n }))\n}", "title": "" }, { "docid": "0aafb580cb5abb1f1cdef0233524b16a", "score": "0.6523571", "text": "function animerPlayer() {\n\n //gets the values of the player\n let player = players[0];\n\n //moves player on the other side if off screen\n if (player.x > 632) {\n player.x = -32;\n } else if (player.x < -32) {\n player.x = 632;\n }\n\n //runs flyttPlayer() and renderPlayer()\n player.flyttPlayer();\n player.renderPlayer();\n }", "title": "" }, { "docid": "f87f9d3953761fbd172cb1b43fe3272b", "score": "0.6512103", "text": "function fl_ClickToGoToAndPlayFromFrame()\n\t\t{\n\t\t\tthis.gotoAndPlay(2)\n\t\t\tthis.parent.SBCenterPanelStaticShovel.visible = true;\n\t\t\tthis.parent.SBCenterPanel1.visible = false;\n\t\t\tthis.parent.SB_T2.visible = false;\n\t\t\n\t\t}", "title": "" }, { "docid": "2982d3e22dcc468e48e521ed5915576a", "score": "0.648167", "text": "function rockClick() { playGame(\"rock\") }", "title": "" }, { "docid": "de93b03fc782a4b7fb6a88ac25a130c6", "score": "0.6479808", "text": "function buttonClick() {\n $('#btn-click').trigger('play')\n}", "title": "" }, { "docid": "976ff172eeec196e7b3e042b0d1a38b3", "score": "0.64540905", "text": "function fireRelease(){\n\t\tif(playerGroup.item.type==\"gun\"){\n\t\t\tplayerGroup.item.visible = false;\n\t\t\tplayer.walk();\n\t\t}\n\t\tif(playerGroup.item.type==\"mg\"){\n\t\t\tplayer.walk();\n\t\t}\n\t}", "title": "" }, { "docid": "3745f4dda35253f8421e428631ceda58", "score": "0.64530843", "text": "UpdatePlayerFire() {\n if (config.Game.keyboardManager.fire) {\n if (this.fire) {\n console.log(\"click1\");\n this._bulletNum--;\n createjs.Sound.play(\"./Assets/sounds/firstGun1.wav\");\n this._playerBullet = new objects.Bullet(this._bulletImg, this._player.x, this._player.y - 20, true);\n this._bullets.push(this._playerBullet);\n this.addChild(this._playerBullet);\n this.fire = false;\n }\n }\n if (!config.Game.keyboardManager.fire) {\n this.fire = true;\n }\n }", "title": "" }, { "docid": "29ac5127582930d2ee9a1e86e50b9497", "score": "0.64452016", "text": "function clickedPlayButton() {\n // Increase pet happiness\n // Decrease pet weight\n if(pet_info.weight && pet_info.happiness >0){\n pet_info.weight--;\n pet_info.happiness++;\n pet_info.hunger++; \n //plays audio when clicked \n var audio = document.getElementById(\"dog-bark\");\n audio.play();\n }\n checkAndUpdatePetInfoInHtml();\n \n }", "title": "" }, { "docid": "f31d3c73a59057454e24f2f02643c762", "score": "0.64270645", "text": "function gameOn() {\n $('.switch-pwr').css({ marginLeft: '53%' });\n powerOn = true;\n $count.html('--');\n soundArr[0].play();\n }", "title": "" }, { "docid": "08575df1d2fa631af8f9e4d1eef3dcf0", "score": "0.6425397", "text": "UpdatePlayerFire() {\n if (config.Game.keyboardManager.fire) {\n if (this.fire) {\n console.log(\"click1\");\n this._bulletNum--;\n createjs.Sound.play(\"./Assets/audio/playerbullet.wav\");\n this._playerBullet = new objects.Bullet(config.Game.ASSETS.getResult(\"pbullet\"), this._player.x, this._player.y - 20, true);\n this._playerbullets.push(this._playerBullet);\n this.addChild(this._playerBullet);\n this.fire = false;\n }\n }\n if (!config.Game.keyboardManager.fire) {\n this.fire = true;\n }\n }", "title": "" }, { "docid": "44070123dc5aa511eb9f322288dad1da", "score": "0.6420859", "text": "function onAppleClicked()\n{\n playEgg();\n}", "title": "" }, { "docid": "ad2b378ca9af02ce5f4c6acb41307ce8", "score": "0.6409548", "text": "blueDoorAction (player, doorAzul)\n{\n //this.physics.pause();\n\n if (this.stars.countActive(true) === 0)\n {\n\n this.blueWin = 1;\n\n if (this.blueWin == 1) {\n this.player2.setTint(0x0ff00);\n this.player.anims.play('turn');\n if (this.redWin == 1) {\n this.message = this.add.text(450, 350, 'YOU WIN!', { fontSize: '48px', fill: '#ffffff' });\n this.message.font = 'Arial Black';\n this.message.fontWeight = 'bold';\n\n this.physics.pause();\n }\n }\n\n //gameOver = true;\n }\n}", "title": "" }, { "docid": "e878e2dfd21d48a04f0a35033101ec75", "score": "0.63921183", "text": "function ButtonTianFu1(){\n\tTForFS = 0;\n\tSkillViewButton[0].spriteName = \"UIH_Skill_A\";\n\tSkillViewButton[1].spriteName = \"UIH_Talent_N\";\t\n\tShowSkillView(NowGrop);\n\tButtonXidian.localPosition.y = 1000;\n//\tParentQieHuanTianFu.localPosition.y = 0;\n}", "title": "" }, { "docid": "86ddcdc06de93174b47272ffeac715b9", "score": "0.63748896", "text": "function clickedExerciseButton() {\n // Decrease pet happiness\n // Decrease pet weight\n if(pet_info.weight && pet_info.happiness >0){\n pet_info.weight--;\n pet_info.happiness--;\n pet_info.hunger++; \n }\n var whistle = document.getElementById(\"whistle\");\n whistle.play();\n checkAndUpdatePetInfoInHtml();\n }", "title": "" }, { "docid": "17e0978c4450b2b5e6fbd82315269d8e", "score": "0.6373614", "text": "function clickMe(){\n t2.play();\n }", "title": "" }, { "docid": "fe5e4d93ce9b052bbdd1c9882146cdfa", "score": "0.6345545", "text": "function endShot() {\r\n player.fire = false;\r\n fireme.classList.add('hide');\r\n }", "title": "" }, { "docid": "2211a4da72654ca68e687c8ab83c6401", "score": "0.633441", "text": "function showRubbleDan() {\n\n Dan.removeClass('nice-dan disabled');\n Dan.addClass('rubble-dan active');\n\n document.getElementById('rubble-dan').play();\n document.getElementById('rubble-dan').volume=0.3;\n}", "title": "" }, { "docid": "7e5ba5c1f40a48dad4b189db181d969f", "score": "0.6316871", "text": "function fChangeVolumeMouseUp() {\n audioPlayer.play();\n}", "title": "" }, { "docid": "3b86a8d8d2d698def46d773dc4ab89f8", "score": "0.63118863", "text": "function clickPlay(){\n setPaused( false );\n}", "title": "" }, { "docid": "21e5ccb1902ef909f74bc990289ea13f", "score": "0.6308244", "text": "handleClick () {\n super.handleClick();\n this.player_.trigger('next');\n }", "title": "" }, { "docid": "f9c56c771cbdd6fbee9b156c1e5adcba", "score": "0.6277335", "text": "function drown() {\n y = player.y;\n if(y<60 | y>312){\n new Audio(\"audio/bubbling1.wav\").play();\n gameon = false;\n swal({\n title: \"You Just Drowned!\",\n text: \"Press Enter to Resume\",\n type: \"warning\",\n showCancelButton: false,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Resume!\",\n closeOnConfirm: true\n },function() {gameon = true;});\n reset();\n };\n }", "title": "" }, { "docid": "54f5c1dbd059bb9dca2018f484d93a3f", "score": "0.6262109", "text": "function shoot(e){\n\tif(e.button == 0){\n\t\tshootLaser();\n\t}\n\telse{\n\t\tshootRocket();\n\t}\n}", "title": "" }, { "docid": "da61d910107dd7d4b140f486f6216125", "score": "0.62590855", "text": "function playPratice(e){\n if(checkTimeSignature() ){\n\n if( !$(\"a[startPratice]\").hasClass(\"btn-disabled\") ){\n METRO.timerRemote({data: \"start\"});\n playBeat(e);\n }\n\n e.preventDefault();\n\n }else{\n emptyTimeSigError(e);\n }\n }", "title": "" }, { "docid": "2e0e582f281e137ab954186ab6c058ba", "score": "0.6237487", "text": "function playButton(e){\n if (window.play)\n {\n $( \"#panel-switch-play\" ).text(\"PLAY\");\n window.play = false;\n } \n else\n {\n $( \"#panel-switch-play\" ).text(\"PAUSE\");\n window.play = true;\n window.update();\n }\n}", "title": "" }, { "docid": "161100e5f7af092492d58252a87078a5", "score": "0.6236976", "text": "function playBtnSound() {\n machineGun.play();\n console.log(\"play audio\")\n}", "title": "" }, { "docid": "c42c4c6d98513f739b6cc7506035fba9", "score": "0.62355185", "text": "togglePlayerState () {\n WebPlayerActions.togglePlayerState();\n }", "title": "" }, { "docid": "ff2d51ba9b2246485715f52b7baf04dc", "score": "0.6234297", "text": "function pp(){\r\n \r\n if(play == 0)\r\n {\r\n icon.src = \"svg/021-pause.svg\";\r\n play = 1\r\n player.play();\r\n }\r\n else if(play == 1)\r\n {\r\n icon.src = \"svg/013-play.svg\"\r\n play = 0\r\n player.pause();\r\n }\r\n}", "title": "" }, { "docid": "ff2d51ba9b2246485715f52b7baf04dc", "score": "0.6234297", "text": "function pp(){\r\n \r\n if(play == 0)\r\n {\r\n icon.src = \"svg/021-pause.svg\";\r\n play = 1\r\n player.play();\r\n }\r\n else if(play == 1)\r\n {\r\n icon.src = \"svg/013-play.svg\"\r\n play = 0\r\n player.pause();\r\n }\r\n}", "title": "" }, { "docid": "55f3bb3048446ca9312d4400a4353f06", "score": "0.62179434", "text": "function btnStartE_Click() {\n starte.alpha = 0.7;\n gameState = \"play\";\n NewGameState();\n}", "title": "" }, { "docid": "6af6709a02a98321e9a045bb4c6f1aca", "score": "0.62136894", "text": "function pinkFlowerPressed() {\n if (on) {\n colour = \"pink\";\n flashFlower(colour);\n playerOrder.push(1);\n if (playerOrder.length == level) {\n check();\n }\n if (!win) {\n setTimeout(() => {\n clearInvertColour;\n }, 300)\n }\n }\n}", "title": "" }, { "docid": "1082af6f9e76474a674961abb9119efa", "score": "0.62115276", "text": "function playerOneGridOneWin() {\n gridOne.classList.add('player-one-win', 'closed')\n gridOne.classList.remove('open')\n audio.src = './sounds/zapsplat_magic_wand_whoosh_burst_002_12547.mp3'\n audio.play()\n}", "title": "" }, { "docid": "cc673bac79309627d639c407cb82fcaa", "score": "0.62105644", "text": "function play() {\r\n\r\n // Set button class\r\n wrapper.find(\".control-button\").removeClass(\"play\").addClass(\"pause\");\r\n\r\n // Start animating\r\n animateSnapshots(getSelectIndicies());\r\n }", "title": "" }, { "docid": "21256a8c31549cf467d3ad87b6049c3b", "score": "0.61993843", "text": "function jElectroPlay() {\n playSong2();\n }", "title": "" }, { "docid": "b961733364fc1ba4b4dcaf9c934bfbd1", "score": "0.6198978", "text": "function hipHopToggleActions(event){\n if (event.value == 1 ){\n hipHopPlayer.start();\n hipHopPlayer.loop = true;\n hipHopPlayer.volume.value = -12;\n }\n else {\n hipHopPlayer.stop();\n }\n}", "title": "" }, { "docid": "afd5f031d10ba107da904c88d3f54eca", "score": "0.61970633", "text": "play() {\n\t\tWeather.activateWeather(this);\n\t\tthis.trigger('play', this);\n\t}", "title": "" }, { "docid": "61de26a574e8b7420bb6298c7ee7f346", "score": "0.61968654", "text": "function play(player){\n if (player.lives > 0 ){\n var mole = showRandomMole();\n\n var timeout = setTimeout(function() {\n new Audio('http://www.pachd.com/a/button/button1.wav').play();\n player.lives --;\n updatePlayerInfo(player);\n mole.off();\n play(player);\n }, 1000);\n\n mole.on(\"click\", function(){\n \n new Audio(\"beep9.mp3\").play();\n clearTimeout(timeout);\n player.score += 100;\n updatePlayerInfo(player);\n mole.off();\n play(player);\n\n })\n } else {\n $('.cell').removeClass('up'); \n $(\".cell\").addClass(\"down\");\n currentPlayer = player2;\n showPlayerTurn(currentPlayer);\n\n if (player2.lives === 0) {\n $(\"#gameOver\").css({\"display\":\"block\"});\n gameOver();\n } \n }\n}", "title": "" }, { "docid": "df33878e378644bade9675cba910edcd", "score": "0.6193313", "text": "function useButton() {\n playPause();\n changeButton();\n }", "title": "" }, { "docid": "446b88b5e0a4ea34fea007e2e5d2dc60", "score": "0.6190832", "text": "function buttonClick() {\n move = moveList[playerPkmn.moves[this.attributes[\"value\"][\"value\"]]];\n buttonbox.classList.add(\"hide\");\n box.innerHTML = playerPkmn.name + \" used \" + move.name + \"!\";\n setTimeout(attack, 1000, move);\n }", "title": "" }, { "docid": "56a4c13bd233743cfeaf318819788180", "score": "0.618964", "text": "playerActions() {\n view.buttons.forEach(button => {\n button.addEventListener(\"click\", () => {\n this.animate(button);\n controller.playAudio(button.id);\n controller.addUserMove(button.id);\n controller.checkGame(button.id);\n this.displayMessage(controller.getRound());\n });\n });\n }", "title": "" }, { "docid": "9fe25614d7aa48b4b11e51c1b833c597", "score": "0.616537", "text": "redDoorAction (player, doorRojo)\n{\n //this.physics.pause();\n\n if (this.stars.countActive(true) === 0)\n {\n\n\n this.redWin = 1;\n\n if (this.redWin == 1) {\n this.player.setTint(0x0ff00);\n this.player.anims.play('turn');\n if (this.blueWin == 1) {\n this.message = this.add.text(450, 350, 'YOU WIN!', { fontSize: '48px', fill: '#ffffff' });\n this.message.font = 'Arial Black';\n this.message.fontWeight = 'bold';\n\n this.physics.pause();\n }\n }\n\n\n }\n\n //gameOver = true;\n}", "title": "" }, { "docid": "00336e8f9acd05bf6a36b2703ce5736e", "score": "0.61630726", "text": "playerFired(player, x, y) {\n \n }", "title": "" }, { "docid": "59842d774a9ae852519ffd0107f62542", "score": "0.6160824", "text": "function getMonkey() {\n if (player.monkeyClicks == 0) {\n if (confirm(\"This was added as a reference to a typo in the code. \\n If you click it again, it WILL make a chimpanzee noise. It's loud.\")) {\n player.monkeyClicks++;\n $('#monkeyTd').show();\n }\n } else if (player.monkeyClicks > 0) {\n chimp.play();\n player.monkeyClicks++;\n }\n}", "title": "" }, { "docid": "8436b0898f10d8d49d374e4439de3397", "score": "0.61587816", "text": "function play() {\n gameInit();\n foodFall();\n soundButtonDisplay();\n animateBackground();\n addScore();\n }", "title": "" }, { "docid": "9afa61a42626482ea3df4a0b55c62318", "score": "0.61584747", "text": "function enablePlayer() {\r\n window.addEventListener(\"keydown\", pushButton);\r\n greenButton.addEventListener(\"click\", pushButton);\r\n redButton.addEventListener(\"click\", pushButton);\r\n blueButton.addEventListener(\"click\", pushButton);\r\n yellowButton.addEventListener(\"click\", pushButton);\r\n greenButton.style.cursor = \"pointer\";\r\n redButton.style.cursor = \"pointer\";\r\n blueButton.style.cursor = \"pointer\";\r\n yellowButton.style.cursor = \"pointer\";\r\n resetTimer(); // start the player timer\r\n}", "title": "" }, { "docid": "a0fd5911b7fd3a68c89144840f294ef6", "score": "0.6153783", "text": "function playSingleClue(btn){\n if(gamePlaying){\n lightButton(btn);\n playTone(btn, clueHoldTime);\n setTimeout(clearButton, clueHoldTime, btn);\n }\n}", "title": "" }, { "docid": "6d469811f67b065bab8066ce4552f9d9", "score": "0.61531454", "text": "hitGumball(player) {\n this.physics.pause();\n\n player.setTint(0xff0000);\n\n this.gameOverText = this.add.text(-1, -1, 'Game Over', {\n fontSize: '32px',\n fill: '#000'\n });\n\n this.retryButton = new Button(\n this,\n 'backButton',\n 'backButtonHover',\n 'Retry',\n 'GameMapOne'\n );\n\n this.gameMapOneSceneGrid.placeAtIndex(36.8, this.gameOverText);\n this.gameMapOneSceneGrid.placeAtIndex(60, this.retryButton);\n\n this.score = 0;\n }", "title": "" }, { "docid": "0ce77754b0a649a3fa6ef5bd950bef26", "score": "0.61512077", "text": "function glowComputer()\n {\n canvas.addClass(\"more-glow\");\n board.addClass(\"more-glow\");\n\n var audio = new Audio(\"/hit.mp3\");\n audio.play();\n\n setTimeout(rem,100);\n function rem(){\n canvas.removeClass(\"more-glow\");\n board.removeClass(\"more-glow\");\n }\n }", "title": "" }, { "docid": "019dd1624a529f3042e84743ca7014aa", "score": "0.6150333", "text": "function playVictory() {\n victory.play();\n }", "title": "" }, { "docid": "0de51cac285547d2817a2e6941bc90c3", "score": "0.6150152", "text": "function targetPlayer(type){\n\n\tfunction clickOnPlayer(e){\n\t\tif(type == 'made'){\n\t\t\t$event(\"fi-check\", \"green\", \"made was clicked event FUNCTION\", \"made\")\n\t\t}else if(type=='miss'){\n\t\t\t$event(\"fi-x\", \"red\", \"X was clicked for a missed shot\", \"miss\")\n\t\t}else if(type=='travel'){\n\t\t\t$event(\"fi-alert\", \"yellow\", \"Travel was clicked for a traveling call\", \"travel\")\n\t\t}else if(type=='block'){\n\t\t\t$event(\"fi-pause\", \"yellow\", \"Block was clicked for a Blocked Shot\", \"block\")\n\t\t}else if(type=='assist'){\n\t\t\t$event(\"fi-torsos\", \"#088da5\", \"Nice pass for the Assist! \", \"assist\")\n\t\t}else if(type=='rebound'){\n\t\t\t$event(\"fi-arrow-down\", \"#ff3300\", \"Nice Rebound!!! \", \"rebound\")\n\t\t}else if(type=='foul'){\n\t\t\t$event(\"fi-skull\", \"#ff3300\", \"Foul called on this\", \"foul\")\n\t\t}else if(type=='freethrow'){\n\t\t\t$event(\"fi-marker\", \"#08a56f\", \"And one!! \", \"freethrow\")\n\t\t}else if(type=='steal'){\n\t\t\t$event(\"fi-shuffle\", \"#a52008\", \"Like taking candy from a baby! \", \"steal\")\n\t\t}else if(type=='three'){\n\t\t\t$event(\"fi-css3\", \"#a5088d\", \"Three pointer from DOWNTOWN!!! \", \"three\")\n\t\t}\n\t\t\n\t\te.preventDefault()\n\t\t// $eventCount++;\n\t\tcancle();\n\t\t// console.log('target playerId: '+e.target.getAttribute('id'));\n\t\t// console.log('target player: '+e.target.getAttribute('name'));\n\t\t//console.log(\"This is a: \"+shotList[$eventCount-1]);\n\t\tplayerId = e.target.getAttribute('id');\n\t\tplayer = e.target.getAttribute('name');\n\t\twindow.document.getElementById('homeTeamList').removeEventListener('click', clickOnPlayer, false);\n\t\t//window.document.getElementById('visitorTeamList').removeEventListener('click', clickOnPlayer, false);\n\t\twindow.document.getElementById('playerId').value = playerId;\n\t\twindow.document.getElementById('player').value = player;\n\t\t$submitEvent=window.document.getElementById('submitEvent');\n\t\t$submitEvent.click();\n\t}\n\twindow.document.getElementById('homeTeamList').addEventListener('click', clickOnPlayer, false);\n\t//window.document.getElementById('visitorTeamList').addEventListener('click', clickOnPlayer, false);\n\twindow.document.getElementById('visitorTeamList').removeEventListener('click', getStats, false);\n\twindow.document.getElementById('homeTeamList').removeEventListener('click', getStats, false);\n//console.log($eventCount +' event count from target player finction');\n}", "title": "" }, { "docid": "c125f19ac43a6e3abfb28a9dc0405bb8", "score": "0.61496097", "text": "function hitSoins2(player, vieup2){\n vieup2.destroy(true);\n vie2prise=1;\n nbrvie+=1;\n if (nbrvie == 1) {text_nbrvie.setText('X 1');}\n if (nbrvie == 2) {text_nbrvie.setText('X 2');}\n if (nbrvie == 3) {text_nbrvie.setText('X 3');}\n if (nbrvie == 4) {text_nbrvie.setText('X 4');}\n if (nbrvie == 5) {text_nbrvie.setText('X 5');}\n if (nbrvie == 6) {text_nbrvie.setText('X 6');}\n if (nbrvie == 7) {text_nbrvie.setText('X 7');}\n\n text_vie.setVisible(true);\n this.time.addEvent({\n delay: 3000,\n callback: ()=>{\n text_vie.setVisible(false);\n },\n loop: false\n });\n}", "title": "" }, { "docid": "2eb7507710cb13dc1e91a51cf631fc7f", "score": "0.61392844", "text": "function mouseDown(event) {\n if (event.button == 0) {\n player.mPressed = true;\n }\n}", "title": "" }, { "docid": "bac040dc2f24f29caf142bd19503921d", "score": "0.6137355", "text": "function manualaOn() {\r\n playSound('render');\r\n gGame.isOn = true;\r\n smileyFace(START);\r\n renderInnerText('.manually span', gManuallyCounter);\r\n displayBtn('none', 1);\r\n}", "title": "" }, { "docid": "f5b48a770d2611e3fe8d111b9941494b", "score": "0.6134028", "text": "function handlePlayerClick(pid) {\n\t\t\tsetSliderValue(slots.length);\n\t\t\tplayerClick(pid);\n\t\t}", "title": "" }, { "docid": "5b32ec7ec591c2f1c2920d0d5ff639ed", "score": "0.61322343", "text": "function btn_Game_Controller(event) {\r\n btnLeft.bgColor=btnLeft===true?\"blue\":\"white\";\r\n btnDown.bgColor=btnLeft===true?\"blue\":\"white\";\r\n btnUp.bgColor=btnLeft===true?\"blue\":\"white\";\r\n btnRight.bgColor=btnLeft===true?\"blue\":\"white\";\r\n btnFire.bgColor=btnLeft===true?\"red\":\"white\";\r\n\r\n if(btnDown.isInside(canv,event)){\r\n rocketMoveSpeed=btnDownPress?rocketMoveSpeed+5:5;\r\n btnDownPress=true;btnRightPress=btnUpPress=btnLeftPress=false;\r\n btnDown.bgColor=\"blue\";\r\n }\r\n if(btnUp.isInside(canv,event)){\r\n rocketMoveSpeed=btnUpPress?rocketMoveSpeed+5:5;\r\n btnUpPress=true;btnRightPress=btnLeftPress=btnDownPress=false;\r\n btnUp.bgColor=\"blue\";\r\n }\r\n if(btnLeft.isInside(canv,event)){\r\n rocketMoveSpeed=btnLeftPress?rocketMoveSpeed+5:5;\r\n btnLeftPress=true; btnRightPress=btnUpPress=btnDownPress=false;\r\n btnLeft.bgColor=\"blue\";\r\n }\r\n if(btnRight.isInside(canv,event)){\r\n rocketMoveSpeed=btnRightPress?rocketMoveSpeed+5:5;\r\n btnRightPress=true;btnLeftPress=btnUpPress=btnDownPress=false;\r\n btnRight.bgColor=\"blue\";\r\n }\r\n if(btnMiddle.isInside(canv,event)){\r\n btnRightPress=btnLeftPress=btnUpPress=btnDownPress=false;\r\n } \r\n if(btnFire.isInside(canv,event)){\r\n soundFiring();\r\n rocket1.addBullet(rocket1.x,rocket1.y+(rocket1.height/2));\r\n btnFire.bgColor=\"red\";\r\n }\r\n }", "title": "" }, { "docid": "22b46732a60bb9b49067d93e9361bcb7", "score": "0.61242753", "text": "OnPress() {\n\t\tlet index = this.GetClickedPlayer();\n\t\tif (index > -1) {\n\t\t\tSoundManager.playCursor();\n\t\t\tthis._lastClicked = 0;\n\t\t} else {\n\t\t\tindex = this.GetClickedEnemy();\n\t\t\tif (index > -1) {\n\t\t\t\tSoundManager.playCursor();\n\t\t\t\tthis._lastClicked = 1;\n\t\t\t} else {\n\t\t\t\tthis._lastClicked = -1;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "1869635e59c79d85d11a70d152cc89f5", "score": "0.61154824", "text": "function C999_Common_Player_Click() {\n\t\n\t// Can allow to click on inventory from the player screen\n\tInventoryClick(GetClickedInventory(), LeaveChapter, LeaveScreen);\n\n}", "title": "" }, { "docid": "f675ca877ed4d5acc6bddbe02835cea5", "score": "0.61120164", "text": "function btnPlay_click(btnPlay) {\n\tif (EngineInstance.running) {\n\t\tEngineInstance.engineStop();\n\t\tbtnPlay.src = Resources.configuration.IMG_PATH + \"playButton.png\";\n\t} else {\n\t\tEngineInstance.engineStart();\n\t\tbtnPlay.src = Resources.configuration.IMG_PATH + \"pauseButton.png\";\n\t} // if\n}", "title": "" }, { "docid": "34d8bfc64199ac1bc9b0aec376362a01", "score": "0.61062187", "text": "function actionPlayer() {\n\tif ( digging == true ) {\n\t\tplayer.body.velocity.x = 0;\n\t\tplayer.body.velocity.y = 0;\n\t} else if ( digging == false ) {\n\t\tif ( hideCounter == 5 ) {\n\t\t\thidden = true;\n\t\t\tplayerHiding = true;\n\t\t\thideCounter = 0;\n\t\t}\n\t\tif ( Ndown == true ) {\n\t\t\tplayer.body.velocity.y = -speed;\n\t\t\tplayer.body.velocity.x = -speed;\n\t\t} else if ( Sdown == true ) {\n\t\t\tplayer.body.velocity.y = speed;\n\t\t\tplayer.body.velocity.x = speed;\n\t\t} else if ( Edown == true ) {\n\t\t\tplayer.body.velocity.x = speed;\n\t\t\tplayer.body.velocity.y = -speed;\n\t\t} else if ( Wdown == true ) {\n\t\t\tplayer.body.velocity.x = -speed;\n\t\t\tplayer.body.velocity.y = speed;\n\t\t} else if ( SEdown == true ) {\n\t\t\tplayer.body.velocity.x = speed;\n\t\t\tplayer.body.velocity.y = 0;\n\t\t} else if ( SWdown == true ) {\n\t\t\tplayer.body.velocity.y = speed;\n\t\t\tplayer.body.velocity.x = 0;\n\t\t} else if ( NWdown == true ) {\n\t\t\tplayer.body.velocity.x = -speed;\n\t\t\tplayer.body.velocity.y = 0;\n\n\t\t} else if ( NEdown == true ) {\n\t\t\tplayer.body.velocity.y = -speed;\n\t\t\tplayer.body.velocity.x = 0;\n\n\t\t} else {\n\t\t\tplayer.body.velocity.x = 0;\n\t\t\tplayer.body.velocity.y = 0;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fbc09db62a1f35a8de2455b2e4e6f2e6", "score": "0.61056316", "text": "function lightFire(){\n if(itemPrereqSatisfied('lightFire')){\n if(fireLighting == false){//we don't want to light fire while it's already lighting \n fireLighting = true;\n activateButton(itemPrereqs['lightFire']['time'], \"lightFireProgress\", \"Stoke Fire\");\n }\n }\n}", "title": "" }, { "docid": "14e5d7fa7508ca468fd7b96c36a169cb", "score": "0.6104627", "text": "function eurobeat(){\r\n\tdocument.getElementById(\"eurobeat1\").play();\r\n}", "title": "" }, { "docid": "eb56fdee2f77dbd85590d4309d3f47af", "score": "0.6099186", "text": "function mousePressed() {\n playing = true;\n}", "title": "" }, { "docid": "f8b52188b908fcc31b606089ae90ee61", "score": "0.60980165", "text": "function clickFire(){\n\t\tSmog.Car.clicked();\n\t}", "title": "" }, { "docid": "bb37265bc9d6b3e9174f9966ea30fdae", "score": "0.609673", "text": "function onClick () {\n play =! play;\n if(play){\n\tbutton.setFrames(0,0,1);\n }else{\n\tbutton.setFrames(1,1,0);\n }\n\n}", "title": "" }, { "docid": "1985eb863f8e3ddfe535d7df5806ffc1", "score": "0.60896164", "text": "function userPlay(){\n rockbtn.addEventListener('click',()=>{\n playRound('rock');\n });\n\n paperbtn.addEventListener('click',()=>{\n playRound('paper');\n });\n\n scissorsbtn.addEventListener('click',()=>{\n playRound('scissors');\n });\n\n\n}", "title": "" }, { "docid": "a41008f784d8fa5de05778039dc6f979", "score": "0.60893625", "text": "function spinfoButtonTriggerTEST() {\n\t\t\tlet players = $('#newContent a[onclick*=\"LoadPlayerInDiv\"]');\n\n\t\t\tplayers.each(function(){\n\t\t\t\t$(this).trigger(\"onclick\");\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "29bbc8e432d1aa1245167a80ffc8db4c", "score": "0.6085475", "text": "mousePressed() {\n // This will be called by the main program when it detects a mouse press\n push();\n this.sound.play();\n pop();\n }", "title": "" }, { "docid": "d2f5c37c15198f827e720d8d9996d94c", "score": "0.608536", "text": "function pass(button) {\r\n\tconsole.log(\"pass\");\r\n\tnextPlayer();\r\n}", "title": "" }, { "docid": "9531e2343733142c0c8150cb19811f3e", "score": "0.60839105", "text": "function pinkButtonClicked(event) {\n createjs.Sound.play(\"clicked\");\n // clears canvas and reprints new values\n stage.removeChild(die1);\n stage.removeChild(die2);\n stage.removeChild(dieNumb1);\n stage.removeChild(dieNumb2);\n stage.removeChild(pinkButton);\n main();\n}", "title": "" }, { "docid": "bc6576e342c4c077143a915d5d894854", "score": "0.6083874", "text": "overTrap (player, trap)\n{\n this.physics.pause();\n\n this.player.setTint(0xff0000);\n\n this.player2.setTint(0xff0000);\n\n this.player.anims.play('turn');\n\n this.player2.anims.play('turn');\n\n this.gameOver = true;\n\n this.cameras.main.shake(500);\n\n this.message = this.add.text(450, 350, 'GAME OVER', { fontSize: '48px', fill: '#ffffff' });\n this.message.fontWeight = 'bold';\n this.message.font = 'Arial Black';\n this.sound.play(\"gameOverSound\");\n}", "title": "" }, { "docid": "7cf8de5a5a8d6b643dace32d25ab3d97", "score": "0.60837454", "text": "function runScene4Click() {\n scene4BTsound.stop()\n document.querySelector(\"audio\").volume = 1;\n scene4txt.classList.add(\"fadetxt\");\n scene4BT.classList.add(\"fadeBT\");\n dustbin.classList.add(\"glow\");\n stone.classList.add(\"glow\");\n cupboard.classList.add(\"glow\");\n cupboard.addEventListener(\"click\", clickCupboard);\n stone.addEventListener(\"click\", clickStone);\n dustbin.addEventListener(\"click\", clickDustbin);\n dustbin.classList.add(\"dustbinshake\");\n stone.classList.add(\"stoneshake\");\n cupboard.classList.add(\"cupboardshake\")\n}", "title": "" }, { "docid": "b85d049d143922b3aa329e501f990fe6", "score": "0.60837394", "text": "function Skin3(){\r\n let click = new Audio()\r\n click.src = \"./click.mp3\"\r\n click.play()\r\n\r\n if(price == \"OFF\"){\r\n if(skin == \"Skin3\") return;\r\n\r\n if(pen ==\"./StartPen.png\") {\r\n document.getElementById(\"penid\").src = \"./StartSkin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen2.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen2Skin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen3.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen3Skin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen4.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen4Skin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen5.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen5Skin3.gif\"\r\n }\r\n\r\n skin = \"Skin3\"\r\n document.getElementById(\"PenSkinShop\").style.right = \"200%\"\r\n openSShop = 0\r\n save()\r\n return;\r\n }\r\n\r\n if(spins < 25000) return console.log(\"Zu wenig\");\r\n\r\n if(skin == \"Skin3\") return;\r\n\r\n if(pen ==\"./StartPen.png\") {\r\n document.getElementById(\"penid\").src = \"./StartSkin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen2.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen2Skin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen3.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen3Skin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen4.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen4Skin3.gif\"\r\n }\r\n\r\n if(pen ==\"./Pen5.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen5Skin3.gif\"\r\n }\r\n\r\n skin = \"Skin3\"\r\n document.getElementById(\"PenSkinShop\").style.right = \"200%\"\r\n spins -= 25000\r\n document.getElementById(\"spintextid\").innerText = \"Spins: \" + Math.floor(spins)+\"/∞\"\r\n openSShop = 0\r\n save()\r\n }", "title": "" }, { "docid": "3261b1e606ec8029a4596967279435d8", "score": "0.60807323", "text": "function chestOpen(){\n \"use strict\";\n let chestOpening = document.getElementById(\"Chest\");\n chestOpening.play();\n}", "title": "" }, { "docid": "ec583b6d88ae6521ab9f76860471ca64", "score": "0.60794127", "text": "function clickFunction() {\n playing = false;\n background(instructionImage);\n backgroundSound.stop();\n //text for button\n textFont(font);\n fill(255);\n textAlign(CENTER, TOP);\n textSize(30);\n\n //button for play\n push();\n button1 = createButton(\"play\");\n button1.position(310, 440);\n button1.mouseClicked(playPressed);\n //to remove button of instructions\n button.remove();\n pop();\n}", "title": "" }, { "docid": "e2eb6fa17c241e5f20b95ebaefd5be19", "score": "0.60792285", "text": "handleGameButtons(button) {\n // add the color pressed to the player input string (to compare against the seed)\n this.playerInput += button;\n\n // // clone the original audio node for the passed color and play it (allows audio overlap)\n // const cloneAudio = this.audio[button].cloneNode(true);\n // cloneAudio.play();\n\n Simon.playAudio(button, false);\n\n this.playerTurn();\n }", "title": "" }, { "docid": "a20e66e027d70548694606524167ea5f", "score": "0.6078615", "text": "function drawPlayer(){\n\t\tif(!player.alive) return;\n\t\tplayer.counter++;\n\t\tif(player.counter % 20 == 0 && player.fireUp){\n\t\t\tplaySound.fire();\t\n\t\t\tplayer.fire();\n\t\t\tplayer.counter = 0;\n\t\t\tplayer.fireUp = false;\n\t\t}\n\t\tplayer.draw(context); \n\t}", "title": "" }, { "docid": "199b2c3717c8ffe2679f13018149e62b", "score": "0.60786074", "text": "function PopUp() {\r\n let click = new Audio()\r\n click.src = \"./click.mp3\"\r\n click.play()\r\n\r\n\r\n if(popuppress != 0) return;\r\n\r\n popuppress = 1\r\n\r\n let PopUp = document.getElementById(\"popup\")\r\n PopUp.style.left = \"200%\"; \r\n spins += 10000\r\n document.getElementById(\"spintextid\").innerText = \"Spins: \" + Math.floor(spins)\r\n }", "title": "" }, { "docid": "566f18106393326b77c14b8e50cf45da", "score": "0.6068821", "text": "function start_toggle(){\r\nif(power_state==1) {\r\nsoundManager.play(alm0_song);\r\nif (start_state == 0 )\r\n{\r\nstart_state=1;\r\ndocument.images.yellow_btn.src = start_on.src;\r\nselect_end();\r\nup_count();\r\n}\r\nelse\r\n{\r\nstart_state=0;\r\ndocument.images.yellow_btn.src = start_off.src;\r\n}\r\n}\r\n}", "title": "" }, { "docid": "7c64d115d738ecf9d3bf1b03d59e62e4", "score": "0.60674864", "text": "hitBomb (player)\n {\n //this.physics.pause();\n player.setTint(0xff0000);\n player.anims.play('turn');\n this.scene.restart();\n //gameOver = true;\n }", "title": "" }, { "docid": "e8495701360041b3577598d399f14487", "score": "0.6063358", "text": "function Ex_Level_Fire_Tux() {\n\t\t// if(fire_number<3) {\n\t\t\tfire_number++;\n\t\t\tfire_top = $(\"#imgtux\").position().top+10;\n\t\t\tfire_left = $(\"#imgtux\").position().left;\n\t\t\tfire_displacement = parseInt($(\"#imgtux\").css(\"width\"));\n\t\t\tif(this.dir==\"left\") {\n\t\t\t\tlx = fire_left-fire_displacement;\n\t\t\t\tvar obj=\"<sapn id='fire_\"+fire_number+\"' class='fire' style='background:url(images/imgs/fire.png);position:absolute;left:\"+lx+\";top:\"+fire_top+\";width:16;height:16'></span>\";\n\t\t\t\t$(obj).appendTo('div.tuxStage');\n\t\t\t\tfire_interval = setInterval(\"move_fire(0,\"+fire_number+\")\",1);\n\t\t\t} else if(this.dir==\"right\") {\n\t\t\t\tlx = fire_left+fire_displacement;\n\t\t\t\tvar obj=\"<sapn id='fire_\"+fire_number+\"' class='fire' style='background:url(images/imgs/fire.png);position:absolute;left:\"+lx+\";top:\"+fire_top+\";width:16;height:16'></span>\";\n\t\t\t\t$(obj).appendTo('div.tuxStage');\n\t\t\t\tfire_interval = setInterval(\"move_fire(1,\"+fire_number+\")\",1)\n\t\t\t}\n\t\t// }\n\t}", "title": "" }, { "docid": "7b37b57da0419852131f7990737dee51", "score": "0.60571927", "text": "function Skin2(){\r\n let click = new Audio()\r\n click.src = \"./click.mp3\"\r\n click.play()\r\n\r\n if(price == \"OFF\"){\r\n if(skin == \"Skin2\") return;\r\n\r\n if(pen ==\"./StartPen.png\") {\r\n document.getElementById(\"penid\").src = \"./StartSkin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen2.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen2Skin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen3.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen3Skin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen4.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen4Skin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen5.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen5Skin2.png\"\r\n }\r\n\r\n skin = \"Skin2\"\r\n document.getElementById(\"PenSkinShop\").style.right = \"200%\"\r\n openSShop = 0\r\n save()\r\n return;\r\n }\r\n\r\n if(spins < 2500) return console.log(\"Zu wenig\");\r\n\r\n if(skin == \"Skin2\") return;\r\n\r\n if(pen ==\"./StartPen.png\") {\r\n document.getElementById(\"penid\").src = \"./StartSkin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen2.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen2Skin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen3.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen3Skin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen4.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen4Skin2.png\"\r\n }\r\n\r\n if(pen ==\"./Pen5.png\") {\r\n document.getElementById(\"penid\").src = \"./Pen5Skin2.png\"\r\n }\r\n\r\n skin = \"Skin2\"\r\n document.getElementById(\"PenSkinShop\").style.right = \"200%\"\r\n spins -= 2500\r\n document.getElementById(\"spintextid\").innerText = \"Spins: \" + Math.floor(spins)+\"/∞\"\r\n openSShop = 0\r\n save()\r\n }", "title": "" }, { "docid": "83e9dc42729ae1e5dad1a60458ce9239", "score": "0.60558337", "text": "function playerClick({\n target\n }) {\n if (!target.classList.contains('circle')) return\n\n target.classList.add('noMove')\n target.removeEventListener('mouseover', mouseoverSound)\n const messageElm = elms\n\n if (target.bombed) {\n elms.message.classList.add('neutral-text')\n elms.message.textContent = 'You have already bombed that location…'\n return\n }\n\n target.bombed = true\n\n const {\n id\n } = target\n const ship = shipLocations[id]\n\n if (ship) { // hit!\n const remainingHits = damageShip(id, shipLocations, messageElm)\n const {\n hitShip\n } = sounds\n\n target.style.setProperty('--circle-color', ship.color)\n\n hitShip.currentTime = 0\n hitShip.play()\n\n if (!remainingHits) sinkShip(ship, messageElm)\n } else missShip(target, messageElm)\n\n setTimeout(triesLeft, 200)\n }", "title": "" }, { "docid": "545abed0e76cbed425467f8d1bf0b59d", "score": "0.60550815", "text": "function startGame() {\n /*myGamePiece = new component(30, 30, \"red\", 10, 120);*/\n myGamePiece = new component(50, 45, \"sail-boat.gif\", 30, 140, \"image\");\n myGameArea.start();\n\t//disable-vane na butoni i malko muzika..\n\tdocument.getElementById(\"start_button\").disabled = true;\n\tdocument.getElementById(\"up_button\").disabled = false;\n\tdocument.getElementById(\"down_button\").disabled = false;\n\tdocument.getElementById(\"reset_button\").disabled = false;\n\tdocument.getElementById(\"startup_logo\").style.visibility = \"hidden\";\n\tvar audio = new Audio('Pirates Of The Caribbean Theme Song (Music Video).mp3');\n\taudio.play();\n\n}", "title": "" }, { "docid": "9edce8c89092eaf9d2bdc8467fefb54b", "score": "0.6055073", "text": "function btnPlay(){\n\t//Hide the interaction div, run start to sett balls position and set timer\n\tinteraction.style.display = 'none';\n\tstart();\n\tgameStarted = true;\n\tclock = new THREE.Clock();\n\tclock.start();\n}", "title": "" }, { "docid": "0e699836a3453b736ee49183b907c38a", "score": "0.6054558", "text": "function playButtonHandler(e)\n{\n stage.removeChild(menuStage); // leave main menu\n stage.addChild(gameStage); // Go to game stage\n setKeys();\n PIXI.loader\n\t.add(\"Assets/Character/char_spritesheet.json\")\n\t.load(startGame);\n}", "title": "" }, { "docid": "2a34a1c97aa87ba7deb72ca57889a410", "score": "0.60538304", "text": "function click_play(x, y, data) {\r\n var dx = 0, dy = 0, dest;\r\n if (data === \"E\") {\r\n // Toggle edit mode: create a new level from this one and push at the end\r\n EDIT = true;\r\n if (EDIT_LEVEL !== LEVEL) {\r\n LEVELS.push(LEVELS[LEVEL].slice());\r\n EDIT_LEVEL = LEVEL = LEVELS.length - 1;\r\n }\r\n reset_level();\r\n } else if (data === \"R\") {\r\n // Retry\r\n // TODO ask for confirmation\r\n reset_level();\r\n } else if (data === \"S\") {\r\n // Skip to the next level\r\n reset_level(1);\r\n } else if (data === \"B\") {\r\n // Go back to the previous level\r\n reset_level(-1);\r\n } else if (PLAYER && BLOCKS.indexOf(PLAYER) < 0) {\r\n // Player died: reset\r\n reset_level();\r\n } else if (!BLOCKS.some(is_enemy)) {\r\n // No more enemy: move to the next level\r\n reset_level(1);\r\n } else if (!BLOCKS.some(is_moving)) {\r\n // No animation running, move the player when clicking its column/row\r\n if (x === PLAYER.x) {\r\n dy = y - PLAYER.y;\r\n } else if (y === PLAYER.y) {\r\n dx = x - PLAYER.x;\r\n }\r\n if (dx !== 0 || dy !== 0) {\r\n PLAYER.dx = dx < 0 ? -1 : dx > 0 ? 1 : 0;\r\n PLAYER.dy = dy < 0 ? -1 : dy > 0 ? 1 : 0;\r\n // Compute the destination of the player then for every skater find out\r\n // which direction will bring them closer\r\n dest = destination(PLAYER);\r\n BLOCKS.forEach(function (b) {\r\n if (b.data === SKATER) {\r\n var b_dest = [0, 1, 2, 3].map(function (dir) {\r\n b.dx = dir % 2 === 0 ? 1 - dir : 0;\r\n b.dy = dir % 2 === 1 ? 2 - dir : 0;\r\n var d = destination(b);\r\n d.dist = Math.abs(d.x - dest.x) + Math.abs(d.y - dest.y);\r\n return d;\r\n }).reduce(function (min, d) {\r\n return d.dist < min.dist ? d : min;\r\n }, { dist: Infinity });\r\n b.dx = b_dest.dx;\r\n b.dy = b_dest.dy;\r\n }\r\n });\r\n unhighlight();\r\n PS.Clock(RATE);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "84c8c2271c6cbdf9efb8d6bc8d7213fb", "score": "0.60529435", "text": "function player(button) {\n played.push(button);\n if (played[button_clicks] == memory[button_clicks]) {\n var button_sound = new Audio('simonSound'+field_no+'.mp3')\n button_sound.play();\n button_clicks++;\n if (button_clicks === n) {\n rounds++;\n n++;\n button_clicks = 0;\n setTimeout(function() {\n flash();\n },800)\n }\n }\n else {\n var fail = new Audio('fail-buzzer-04.mp3');\n fail.volume = 0.35;\n fail.play(); \n rounds_id.innerHTML = \"!!\";\n button_clicks = 0;\n if (strict === true) {\n memory = [];\n rounds = 0;\n n = 1;\n }\n setTimeout(function() {\n flash();\n },1600)\n }\n}", "title": "" }, { "docid": "6fb27896bbde646351c220a58ddbfda9", "score": "0.60429347", "text": "function test() { //roept functie aan.\n geluid.play(); //laat het geluidje afspelen.\n\n}", "title": "" }, { "docid": "36179264dc1f98433474f51ef9001f1c", "score": "0.6040565", "text": "function start() {\n// start a sound win player click . \n const buttonSound = new Audio(\"Button.mp3\");\n buttonSound.play();\n \n\n// Get Id of div was clicked , Abd save it in currentBox\n let boxID = $(this).attr('id');\n let currentBox = $('#'+boxID);\n\n\n if ( ($(\"#player1\").val() === \"\" ) && ( $(\"#player2\").val() === \"\") ) {\n alertDiv(\"\");\n\n// If's even number is X turn \n }else if (turn%2 === 0) {\n turn++;\n playerTurn.text(\" Turn to player O . \");\n\n// add imag(x) to the div was clicked \n currentBox.css( {'background-image':'url(\"imgs/X.png\")'} );\n currentBox.css( {'cursor':'no-drop'} );\n\n// Get div was clicked , Abd make it un-clickable . \n\n this.removeEventListener('click',start);\n\n// call function winner checking if player wien . \n winner(\"X.png\" , $(\"#player1\").val() , turn );\n \n\n// If's odd number so is O turn \n } else {\n turn++;\n playerTurn.text(\" Turn to player X . \");\n \n currentBox.css( {'background-image':'url(\"imgs/O.png\")'} );\n currentBox.css( {'cursor':'no-drop'} );\n \n\n this.removeEventListener('click',start );\n\n winner(\"O.png\" , $(\"#player2\").val() , turn ); \n\n \n }\n\n}", "title": "" }, { "docid": "cd6fb800d563a471bfae8fc108b9f514", "score": "0.60399795", "text": "function playGameSingle() {\n if (isGameOver) return\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = 'Your Go'\n computerSquares.forEach(square => square.addEventListener('click', function(e) {\n if(currentPlayer === 'user'){\n shotFired = square.dataset.id\n revealSquare(square.classList)\n }\n }))\n }\n if (currentPlayer === 'enemy') {\n turnDisplay.innerHTML = 'Computers Go'\n setTimeout(enemyGo, 1000)\n }\n }", "title": "" }, { "docid": "7996de0a0277d9a0015fec39558e72ed", "score": "0.60384053", "text": "function reactionButton () {\n setButtonState(1-bu.state); // Zustand des Schaltknopfs ändern\n on = (bu.state == 0); // Flag für Animation\n slow = cbSlow.checked; // Flag für Zeitlupe\n if (on) startAnimation(); // Animation entweder fortsetzen ...\n else stopAnimation(); // ... oder unterbrechen\n if (!on) paint(); // Falls nötig, neu zeichnen\n }", "title": "" }, { "docid": "489416c6f593d91c7b3612b10450d3a6", "score": "0.60357404", "text": "function click(event) {\n\n if(currentState == state.playing) {\n square.jump();\n } else if(currentState == state.play) {\n currentState = state.playing;\n } else if(currentState == state.loss && square.x <= (2 * square.height)) {\n currentState = state.play;\n square.y = 0;\n square.speed = 0;\n }\n}", "title": "" } ]
8b75298f88f910be92dce7698117954a
route for getting a patient's illnesses given their phone number
[ { "docid": "ec733143332a4bf84e3e242bd6753d7d", "score": "0.72613585", "text": "static async get_illness(phone_number) {\n const body = {\n phone: phone_number\n };\n\n return await Postman._post(body, \"/get/diagnosis\");\n }", "title": "" } ]
[ { "docid": "8be4fe4ed4c445c8a7b0d38b25ca9a3c", "score": "0.58645344", "text": "static async get_medicine(phone_number) {\n const body = {\n patient_phone: phone_number\n };\n\n return await Postman._post(body, \"/get/medicine\");\n }", "title": "" }, { "docid": "3dfeedf49c0c4fdeb169646663d46f1c", "score": "0.5716461", "text": "function getPassengerCoord(phoneNum){\n http.get('01_simpleapp:3000/api/passengers/'+phoneNum, (resp) => {\n return resp;\n }).on(\"error\", (err) => {\n console.log(\"Error: \" + err.message);\n });\n \n}", "title": "" }, { "docid": "8ce9120a700b43da319cb97125f5354c", "score": "0.56403154", "text": "static async add_illness(phone, title, content, date, diseases) {\n const body = {\n phone: phone,\n title: title,\n content: content,\n date: date,\n diseases: diseases\n };\n\n return await Postman._post(body, \"/add/diagnosis\");\n }", "title": "" }, { "docid": "36862f0fe8823ffc91288858fe7d1e19", "score": "0.51799905", "text": "async getIllnesses({ response }) {\n try {\n // get all illnesses from the system\n const data = await illnessService.getIllnesses();\n\n return util.sendSuccessResponse(response, {\n success: true,\n ...message.SUCCESS,\n data,\n });\n } catch (error) {\n return util.sendErrorResponse(response, { data: error });\n }\n }", "title": "" }, { "docid": "df518c044131a5814367001c9febb4b5", "score": "0.5090755", "text": "function getKCforpatientId(req, res) {\n Kupat.find({}).exec(function (err, result) {\n if (err) {\n res.json({\n code: 404,\n message: constantsObj.messages.errorRetreivingData\n });\n } else if (result && result.length) {\n res.json({\n code: 200,\n message: constantsObj.messages.dataRetrievedSuccess,\n data: result\n });\n } else {\n res.json({\n code: 200,\n message: constantsObj.messages.noDataFound\n });\n }\n }).catch(function (err) {\n return res.json({ code: 402, message: err, data: {} });\n });\n}", "title": "" }, { "docid": "a56ce36e37b4ff435b832d83a1fd4250", "score": "0.5052671", "text": "findEndpointByTelUrl(addressOfRecord) {\n const response = this.numbersAPI.getNumberByTelUrl(LocatorUtils.aorAsString(addressOfRecord))\n if (response.status === Status.OK) {\n const number = response.result\n const route = this.db.getIfPresent(LocatorUtils.aorAsString(number.spec.location.aorLink))\n if (route !== null) {\n return CoreUtils.buildResponse(Status.OK, route)\n }\n\n return CoreUtils.buildResponse(Status.NOT_FOUND, `No route for aorLink: ${number.spec.location.aorLink}`)\n }\n return CoreUtils.buildResponse(Status.NOT_FOUND)\n }", "title": "" }, { "docid": "3ecda0a52223e2915b399e20dd42a1f0", "score": "0.5046238", "text": "async function getEmergencyContact(phoneNum) {\n const pt = await Patient.findOne({ 'personalData.phone': phoneNum }) \n .catch(err => console.log(err)); \n return pt.medicalData.textData.emergencyContact; \n}", "title": "" }, { "docid": "9673b524b74ce6891a0f152a2c297a31", "score": "0.4943736", "text": "function getPhoneNumber(paramID) {\n Restangular.one('account/').customGET('phone-number', paramID).then(function(success) {\n\n if (success.personal) {\n $scope.personalnumber = true;\n $scope.phoneInfo.number = success.personal[0].number;\n // $scope.personal_number = success.personal[0].number;\n $scope.pid = success.personal[0].phone_number_type_id;\n $scope.pphone_number_id = success.personal[0].phone_number_id;\n $scope.Ptype = checktype(success.personal[0].phone_number_type_id);\n $('#ptype').text($scope.Ptype);\n }\n if (success.business) {\n $scope.BusinessNumbers = success.business;\n if ($scope.campaign.business_organizations) {\n checkNumber($scope.campaign.business_organizations[0].business_organization_id);\n } else {\n checkNumber(0);\n }\n }\n if ($scope.campaign.profile_type_id == 2) {\n $scope.phoneInfo.phone_number_type_id = $scope.bid;\n } else {\n $scope.phoneInfo.phone_number_type_id = $scope.pid;\n }\n });\n }", "title": "" }, { "docid": "9359af3079bc6c7259ce0d20c2b3d7dd", "score": "0.4935483", "text": "function singleGet(req, res) {\n if (req.user) {\n const id = req.params.patient;\n Patient.find({ user: req.user.uid, _id: id }, (error, patient) => {\n if (error) res.status(500).send(error);\n else if (patient.length === 0) res.sendStatus(404);\n else res.json(patient);\n });\n } else {\n sendUnauthorized(res);\n }\n}", "title": "" }, { "docid": "125a4ddabbad9df12fcbb501508f1cf0", "score": "0.49097985", "text": "function getInwardDetails() {\n var _filter = {\n \"GatepassNo\": StartUnloadCtrl.ePage.Entities.Header.Data.TMSGatepassHeader.GatepassNo\n };\n var _input = {\n \"searchInput\": helperService.createToArrayOfObject(_filter),\n \"FilterID\": distributionConfig.Entities.WmsInward.API.FindAll.FilterID\n };\n\n apiService.post(\"eAxisAPI\", distributionConfig.Entities.WmsInward.API.FindAll.Url, _input).then(function (response) {\n if (response.data.Response) {\n StartUnloadCtrl.ePage.Masters.InwardDetails = response.data.Response;\n }\n });\n }", "title": "" }, { "docid": "19508283080f36db38af4f134d169786", "score": "0.48847976", "text": "clinicManagement(data) {\n var doctor = data.Doctor;\n var patient = data.Patient;\n console.log(\n \"\\n\" +\n \"====================* Welcome to Nirmal Multi Speciality Hospital Clinic Managment *================\" +\n \"\\n\"\n );\n var answer = Number(\n read.question(\"1. Search Doctor \\n2. Search Patient\" + \"\\n\")\n );\n {\n if (answer == 1) {\n console.log(\"================= Search Doctors ==================== \");\n let inf = read.question(\n \"1. Search Doctors by Name \\n2. Search Doctors by ID \\n3. Search Doctors by Specialization \\n\"\n );\n if (inf == 1) {\n var nam = read.question(\"Enter Name of Doctor \");\n for (var key in doctor) {\n if (doctor[key].name == nam) {\n console.log(\"==== your Doctor information ====\");\n console.log(doctor[key]);\n }\n }\n this.appointment();\n } else if (inf == 2) {\n var idn = read.question(\"Enter Doctor ID \\n\");\n for (var key in doctor) {\n if (doctor[key].Id == idn) {\n console.log(\"==== your doctor information ====\");\n console.log(doctor[key]);\n }\n }\n this.appointment();\n } else if (inf == 3) {\n var spc = read.question(\"Enter the Specialization of Doctor \\n\");\n for (var key in doctor) {\n if (doctor[key].Specialization == spc) {\n console.log(\"==== your doctor information ====\");\n console.log(doctor[key]);\n }\n }\n this.appointment();\n } else {\n console.log(\"Please enter valid input \\n\");\n this.clinicManagement(data);\n }\n } else if (answer == 2) {\n let inf = read.question(\n \"\\nPlease select \\n1. Search Patient by Name \\n2. Search Patient by ID ,\\n3. Search Patient Mobile number \"\n );\n if (inf == 1) {\n var nam = read.question(\"Enter the name of Patient \\n\");\n for (var key in patient) {\n if (patient[key].name == nam) {\n console.log(\"----your Patient information----\");\n console.log(patient[key]);\n }\n }\n // this.appointment();\n } else if (inf == 2) {\n var idn = read.question(\"Enter the Id of Patient \\n\");\n for (var key in patient) {\n if (patient[key].Id == idn) {\n console.log(\"----your Patient information----\");\n console.log(patient[key]);\n }\n }\n //this.appointment();\n } else if (inf == 3) {\n var mob = read.question(\"Enter the mobile number of Patient \\n\");\n deck2D;\n for (var key in patient) {\n if (patient[key].Contact_number == mob) {\n console.log(\"----your Patient information----\");\n console.log(patient[key]);\n }\n }\n //this.appointment();\n } else if (inf == 4) {\n return;\n } else {\n console.log(\"Enter the valid input \\n\");\n }\n } else {\n console.log(\"Enter valid input \\n\");\n }\n }\n }", "title": "" }, { "docid": "8cdb5c5d8e3c471154549c9fb43cb7f8", "score": "0.48613203", "text": "static async get_personal_data(phone_number) {\n const body = {\n phone: phone_number\n };\n\n return await Postman._post(body, '/get/data');\n }", "title": "" }, { "docid": "f3d8dc5c03d7180046fdaa4760f2c344", "score": "0.48512524", "text": "function lookup(phoneNumber) {\n var lookupUrl = \"https://lookups.twilio.com/v1/PhoneNumbers/\" + phoneNumber + \"?Type=carrier\"; \n\n var options = {\n \"method\" : \"get\"\n };\n\n options.headers = { \n \"Authorization\" : \"Basic \" + getBase64Auth(true) \n };\n\n var response = UrlFetchApp.fetch(lookupUrl, options);\n var data = JSON.parse(response); \n Logger.log(data); \n return data; \n}", "title": "" }, { "docid": "0eb99e86017ef240930fae1eab091f03", "score": "0.48471656", "text": "function getPatientIntId(req,res,next){\n var params = req.body;\n\n if ( !params.patientUserId )\n return res.status(500).json( \"patientUserId field is required\");\n\n request.input('patientUserId', conn.mssql.NVarChar(250), params.patientUserId);\n \n var sqlQuery = 'SELECT patients.id AS patientId';\n sqlQuery += ' FROM patients ';\n sqlQuery += 'WHERE patients.userId = @patientUserId';\n\n request.query(sqlQuery, function(err, recordset){\n if (err) {\n console.log(err,'%s', 'MsSql Error');\n return res.status(500).json(err);\n } else if (recordset.length <= 0){\n return res.json(400, \"no patient with id \" + params.patientUserId + \" found\");\n } else {\n return res.json({ status: \"200\", message: recordset[0].patientId }); \n }\n }, function(err){\n console.error('error', err);\n return res.status(500).json(err);\n });\n }", "title": "" }, { "docid": "9cd64e8cd399a75f58bfdbb8013209a1", "score": "0.48198915", "text": "async function apiHandlerRetrievPatientAddressDetails(req, res) {\n\tconsole.log(\"Entering apiHandlerRetrievPatientAddressDetails========>\");\n\tlet response = await mysqlFunctions.retrievePatientAndAddressDetails(req);\n\tconsole.log(\"inside apiHandlerRetrievPatientAddressDetails: \", response);\n\tif (response === false) {\n\t\tvar returnJsonObj = {\n\t\t\t\"msgtype\" : \"error\",\n\t\t\t\"message\": \"There was an error is searching the patient and address details\"\n\t\t}\n\t\treturn res.send(returnJsonObj);\n\t}\n\tconsole.log(\"Exiting apiHandlerRetrievPatientAddressDetails========>\");\n\treturn res.send(JSON.parse(response));\n}", "title": "" }, { "docid": "033d5f7eb898194cfaf3484e0a4a8cf9", "score": "0.4811172", "text": "function getPatientById(req, res) {\n co(function*() {\n let userInfo = yield utility.getUserInfoByToken(req.headers);\n let constantmsg= yield utility.language(userInfo);\n var id = req.swagger.params.id.value;\n let patientProfileInfo = yield Patient.findById(id).lean().exec();\n console.log('patientProfileInfo',patientProfileInfo);\n var fieldNotToDecrypt = ['_id', 'familyDoctorId', 'kupatCholim', 'comment','fatherName', 'motherName', 'age','status','DOB','email','fileName','allergies','medicalHistory', 'isPersonnel' ];\n utility.decryptedRecord(patientProfileInfo, fieldNotToDecrypt,function(patientRecord){\n console.log(\"Decrypted\", patientRecord);\n return res.json({ 'code': 200, status: 'success', \"message\": constantmsg.dataRetrievedSuccess, \"data\": patientRecord});\n })\n }).catch(function(err) {\n return res.json(Response(402, \"failed\", utility.validationErrorHandler(err), {}));\n });\n}", "title": "" }, { "docid": "ef9ae3b4aeb968d06ee94dd5362f95e8", "score": "0.48076287", "text": "function getPatientId(){\n\treturn \"p1\";\n}", "title": "" }, { "docid": "1486e3a7d4a24a7718c1014b6096e527", "score": "0.47929546", "text": "function askPhoneInformation(event, senderId) {\n timer.stopActivityTimer(senderId);\n generalQuestion.telephoneValidation(event, senderId, allSenders[senderId]);\n timer.startActivityTimer(senderId, allSenders[senderId].states);\n}", "title": "" }, { "docid": "9315ed8bd5e4af8346de7c1839f855e9", "score": "0.47759226", "text": "function getTriagebyId(req, res) {\n co(function*() {\n let userInfo = yield utility.getUserInfoByToken(req.headers);\n let constantmsg = yield utility.language(userInfo);\n var triageid = req.swagger.params.id.value;\n Triage.findById({_id:triageid}).exec(function(err, disease) {\n if (err) { res.json({code: 404, message: constantmsg.errorRetreivingData });\n } else if(disease){\n res.json({ code: 200, message: constantmsg.dataRetrievedSuccess, data: disease})\n }else{\n res.json({code:200,message:constantmsg.noDataFound }) \n }\n })\n }).catch(function(err) {\n return res.json({ code: 402, message: err, data: {} });\n })\n}", "title": "" }, { "docid": "e948db10ef5e4bbb0164b72442cbddec", "score": "0.4751025", "text": "function runGetExaminationForDoctor(patient, callback) {\n patient.sex === 'male' ? patient.sex = 0 : patient.sex = 1;\n doctorStub.getExaminationForDoctor(patient, (err, examination) => {\n if (err) {\n console.log(err);\n } else {\n callback(examination);\n console.log(examination);\n }\n });\n}", "title": "" }, { "docid": "4df20d4df07c20342a693df43392f217", "score": "0.4746567", "text": "async getWorkingHoursDoctor(req, res) {\n try{\n Doctor_Detail.find({Doctor_email : req.params.Email},\n 'Availabilty', function (err, data) {\n if (err){\n res.json(err)\n } else{\n res.json(data)\n } \n });\n } catch (err) {\n return err;\n }\n }", "title": "" }, { "docid": "3c96e6bb237b25a135e64505c7d0d2bc", "score": "0.4699115", "text": "async function phone(req,res,next) {\n console.log(req.body.phone)\n console.log(req.body.phone)\n let noun = 'our'\n if(req.body.consent){\n noun = `${req.body.spirit}'s`\n }\n try { \n client.messages\n .create({\n body: `Please accept ${noun} invite to https://reed.live/?peerId=${req.body.peerId}`,\n to: `${req.body.phone}`, // Text this number\n from: '+16068871570', // From a valid Twilio number\n })\n .then((message) => console.log(message.sid))\n .catch((err) => console.log(err))\n res.send({msg: \"🜒\"});\n return next();\n }catch(e) {\n res.status(500).send({error: \"Error\"});\n return next(e);\n }\n}", "title": "" }, { "docid": "2f6b1f69da5853bb82683dd2a17125e5", "score": "0.46973607", "text": "function queryHospitalByRAC(req, res) {\n Hospital.find({\n rac: new RegExp(req.query.rac)\n })\n .then(doc => {\n res.json(doc);\n })\n .catch(err => {\n res.status(500).json(err);\n });\n}", "title": "" }, { "docid": "7821676f6fc29ca6bc5f6882d0992b8b", "score": "0.46906146", "text": "function validateNumber(number) {\n invalidNumberErr = `Received invalid number '${number}'`;\n return new Promise((resolve, reject) => {\n if (!number) {\n reject(invalidNumberErr);\n } else {\n twilioClient.lookups.phoneNumbers(number)\n .fetch({ countryCode: 'US', type: ['carrier'] })\n .then(numberInfo => {\n resolve(numberInfo.phoneNumber);\n })\n .catch(err => {\n console.error(err);\n reject(invalidNumberErr);\n });\n }\n });\n}", "title": "" }, { "docid": "2fbf1b496ac7548ac79bb38764d308c8", "score": "0.4659005", "text": "getPlanInfoByExternalId(req, res) {\n planService\n .infoByExternalId(req.params.id)\n .then(result => hideDidsAndAddLinksToNetwork(res.locals.tokenIssuer, result))\n .then(r => {\n if (r) res.json(r);\n else res.status(404).end();\n })\n .catch(err => { console.log(err); res.status(500).json(\"\"+err).end(); })\n }", "title": "" }, { "docid": "f2c791842b0f3d45e34687caf8a8e161", "score": "0.46530727", "text": "function authorDetail(req, res) {\n res.send('Not Implemented: Author list');\n \n}", "title": "" }, { "docid": "995104d20cf1464a205c389117b185b5", "score": "0.4641523", "text": "getOne(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const { id } = req.params;\n yield database_1.default.query('SELECT patients.ID_USR, SEX, AGE, HEIGHT, WEIGHT, PRESSURE, BREATHING, PULSE, TEMPERATURE, GROUP_CONCAT(medical_history.ILLNESS) AS ILLNESS FROM patients LEFT JOIN medical_history ON patients.ID_USR=medical_history.ID_USR WHERE patients.ID_USR = ? GROUP BY patients.ID_USR', [id], function (err, result, fields) {\n if (err)\n throw err;\n if (result.length > 0) {\n return res.json(result[0]);\n }\n res.status(404).json({ message: 'Pacinte no encontado' });\n });\n });\n }", "title": "" }, { "docid": "75a8ee72c9b9cc369af70f1e576bae60", "score": "0.4635509", "text": "getEmployeeAvailabilities( email ) {\n return this.request({\n method: 'get',\n url: `/employee/${email}/availabilities`,\n });\n }", "title": "" }, { "docid": "d5d2fbe1f354a2b5c68fc9955d10aa78", "score": "0.4634915", "text": "function getRequestDetailsRoute(req, res, next) {\n\tdb.query('SELECT * FROM session_request WHERE requestId=?', [ req.params.id ], (error, results, fields) => {\n\t\tres.json(results);\n\t});\n}", "title": "" }, { "docid": "c28c254e91219577bc2e1a41946f92eb", "score": "0.46291438", "text": "list(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n yield database_1.default.query('SELECT patients.ID_USR, SEX, AGE, HEIGHT, WEIGHT, PRESSURE, BREATHING, PULSE, TEMPERATURE, GROUP_CONCAT(medical_history.ILLNESS) AS ILLNESS FROM patients LEFT JOIN medical_history ON patients.ID_USR=medical_history.ID_USR GROUP BY patients.ID_USR', function (err, result, fields) {\n if (err)\n throw err;\n res.json(result);\n });\n });\n }", "title": "" }, { "docid": "96bab6c1aa10223c958df16e85b5bd35", "score": "0.46262476", "text": "getSpecific(req, res){\n return footpath\n .findAll({\n where: {\n fid: req.params.fid,\n lap_id:req.params.lap_id\n }\n })\n .then((plotData) => res.status(200).send(plotData))\n .catch((error) => res.status(400).send(error))\n }", "title": "" }, { "docid": "3b34f2df6efafd2be5da7c9473818487", "score": "0.4622232", "text": "patientsByTherapist(id) {\n const ans = db.query('SELECT idPatient, fullname, age, email, docNum FROM (SELECT idPatient, idTherapist, docNum, age FROM THERAPIST_USER INNER JOIN PATIENT ON THERAPIST_USER.idPatient = PATIENT.id) t1 INNER JOIN USER_TABLE ON USER_TABLE.id = t1.idPatient WHERE idTherapist = ?;', [id])\n return ans;\n }", "title": "" }, { "docid": "4bb4bfa4da48a052bd8e1a5077dc42f9", "score": "0.46189904", "text": "function makeUrl(disease) {\n // Grab title and trial name of diseases\n url = \"https://clinicaltrials.gov/api/query/study_fields?expr=\"\n query = \"AREA[Condition]\" + disease;\n\n // Check for Start Date - Done\n dateFilter = document.getElementById(\"FilterbyDate\");\n if (dateFilter.checked) {\n query = query.concat(\" AND AREA[StartDate]RANGE[\");\n //year, month, day\n rangeStart = document.getElementById(\"rangeDateStart\").value.split('-');\n rangeEnd = document.getElementById(\"rangeDateEnd\").value.split('-');\n if (rangeStart == [\"\"]) {\n query = query.concat(\"MIN, \");\n } else {\n query = query.concat(rangeStart[2] + \"/\" + rangeStart[1] + \"/\" + rangeStart[0] + \", \");\n };\n if (rangeEnd[0] == \"\") {\n query = query.concat(\"MAX]\");\n\n } else {\n query = query.concat(rangeEnd[2] + \"/\" + rangeEnd[1] + \"/\" + rangeEnd[0] + \"]\");\n };\n }\n\n // Check for Enrollment Count - Done\n enrollmentFilter = document.getElementById(\"FilterbyEnrollment\");\n if (enrollmentFilter.checked) {\n query = query.concat(\" AND AREA[EnrollmentCount]RANGE[\");\n\n minEnrollment = document.getElementById(\"minEnrollment\").value;\n maxEnrollment = document.getElementById(\"maxEnrollment\").value;\n if (minEnrollment == \"\") {\n query = query.concat(\"MIN, \");\n } else {\n query = query.concat(minEnrollment + \", \");\n };\n if (maxEnrollment == \"\") {\n query = query.concat(\"MAX]\");\n\n } else {\n query = query.concat(maxEnrollment + \"]\");\n };\n }\n\n // Check for Age Group - Done\n ageValue = document.getElementById(\"age\").value\n if (ageValue != \"\") {\n query = query.concat(\" AND AREA[StdAge]\");\n if (ageValue == \"child\") { query = query.concat(\"Child\"); }\n if (ageValue == \"childadult\") { query = query.concat(\"(Child OR Adult)\"); }\n if (ageValue == \"adult\") { query = query.concat(\"Adult\"); }\n if (ageValue == \"adultold\") { query = query.concat(\"(Adult OR Older Adult)\"); }\n if (ageValue == \"old\") { query = query.concat(\"Older Adult\"); }\n }\n\n // Check for Gender - Done\n genderValue = document.getElementById(\"gender\").value\n if (genderValue != \"\") {\n query = query.concat(\" AND AREA[Gender]\");\n if (genderValue == \"female\") { query = query.concat(\"(Female OR All)\"); }\n if (genderValue == \"male\") { query = query.concat(\"(Male OR All)\"); }\n if (genderValue == \"onlyfemale\") { query = query.concat(\"Female\"); }\n if (genderValue == \"onlymale\") { query = query.concat(\"Male\"); }\n }\n // Swap out special characters\n for (i = 0; i < query.length; i++) {\n char = query[i];\n if (char == ' ') { url = url.concat(\"+\"); }\n else if (char == ',') { url = url.concat(\"%2C\"); }\n else if (char == '[') { url = url.concat(\"%5B\"); }\n else if (char == ']') { url = url.concat(\"%5D\"); }\n else if (char == '(') { url = url.concat(\"%28\"); }\n else if (char == ')') { url = url.concat(\"%29\"); }\n else if (char == '/') { url = url.concat(\"%2F\"); }\n else { url = url.concat(char); }\n }\n // Check for number of trials\n url = url.concat(\"&fields=BriefTitle%2C+Condition%2C+Phase%2C+OverallStatus%2C+EnrollmentCount%2C+StartDate%2C+CompletionDate%2C+LastUpdatePostDate%2C+OutcomeMeasureAnticipatedPostingDate%2C+ResultsFirstPostDate%2C+ResultsFirstSubmitDate&min_rnk=1&max_rnk=50&fmt=csv\");\n //console.log(url);\n return url;\n }", "title": "" }, { "docid": "4bb4bfa4da48a052bd8e1a5077dc42f9", "score": "0.46189904", "text": "function makeUrl(disease) {\n // Grab title and trial name of diseases\n url = \"https://clinicaltrials.gov/api/query/study_fields?expr=\"\n query = \"AREA[Condition]\" + disease;\n\n // Check for Start Date - Done\n dateFilter = document.getElementById(\"FilterbyDate\");\n if (dateFilter.checked) {\n query = query.concat(\" AND AREA[StartDate]RANGE[\");\n //year, month, day\n rangeStart = document.getElementById(\"rangeDateStart\").value.split('-');\n rangeEnd = document.getElementById(\"rangeDateEnd\").value.split('-');\n if (rangeStart == [\"\"]) {\n query = query.concat(\"MIN, \");\n } else {\n query = query.concat(rangeStart[2] + \"/\" + rangeStart[1] + \"/\" + rangeStart[0] + \", \");\n };\n if (rangeEnd[0] == \"\") {\n query = query.concat(\"MAX]\");\n\n } else {\n query = query.concat(rangeEnd[2] + \"/\" + rangeEnd[1] + \"/\" + rangeEnd[0] + \"]\");\n };\n }\n\n // Check for Enrollment Count - Done\n enrollmentFilter = document.getElementById(\"FilterbyEnrollment\");\n if (enrollmentFilter.checked) {\n query = query.concat(\" AND AREA[EnrollmentCount]RANGE[\");\n\n minEnrollment = document.getElementById(\"minEnrollment\").value;\n maxEnrollment = document.getElementById(\"maxEnrollment\").value;\n if (minEnrollment == \"\") {\n query = query.concat(\"MIN, \");\n } else {\n query = query.concat(minEnrollment + \", \");\n };\n if (maxEnrollment == \"\") {\n query = query.concat(\"MAX]\");\n\n } else {\n query = query.concat(maxEnrollment + \"]\");\n };\n }\n\n // Check for Age Group - Done\n ageValue = document.getElementById(\"age\").value\n if (ageValue != \"\") {\n query = query.concat(\" AND AREA[StdAge]\");\n if (ageValue == \"child\") { query = query.concat(\"Child\"); }\n if (ageValue == \"childadult\") { query = query.concat(\"(Child OR Adult)\"); }\n if (ageValue == \"adult\") { query = query.concat(\"Adult\"); }\n if (ageValue == \"adultold\") { query = query.concat(\"(Adult OR Older Adult)\"); }\n if (ageValue == \"old\") { query = query.concat(\"Older Adult\"); }\n }\n\n // Check for Gender - Done\n genderValue = document.getElementById(\"gender\").value\n if (genderValue != \"\") {\n query = query.concat(\" AND AREA[Gender]\");\n if (genderValue == \"female\") { query = query.concat(\"(Female OR All)\"); }\n if (genderValue == \"male\") { query = query.concat(\"(Male OR All)\"); }\n if (genderValue == \"onlyfemale\") { query = query.concat(\"Female\"); }\n if (genderValue == \"onlymale\") { query = query.concat(\"Male\"); }\n }\n // Swap out special characters\n for (i = 0; i < query.length; i++) {\n char = query[i];\n if (char == ' ') { url = url.concat(\"+\"); }\n else if (char == ',') { url = url.concat(\"%2C\"); }\n else if (char == '[') { url = url.concat(\"%5B\"); }\n else if (char == ']') { url = url.concat(\"%5D\"); }\n else if (char == '(') { url = url.concat(\"%28\"); }\n else if (char == ')') { url = url.concat(\"%29\"); }\n else if (char == '/') { url = url.concat(\"%2F\"); }\n else { url = url.concat(char); }\n }\n // Check for number of trials\n url = url.concat(\"&fields=BriefTitle%2C+Condition%2C+Phase%2C+OverallStatus%2C+EnrollmentCount%2C+StartDate%2C+CompletionDate%2C+LastUpdatePostDate%2C+OutcomeMeasureAnticipatedPostingDate%2C+ResultsFirstPostDate%2C+ResultsFirstSubmitDate&min_rnk=1&max_rnk=50&fmt=csv\");\n //console.log(url);\n return url;\n }", "title": "" }, { "docid": "b3596772d1c60015e4871cd9e8533ba3", "score": "0.45880398", "text": "static async getAllPlants(req, res) {\n const email = parseInt(req.query.email)\n if (email.length < 1) {\n return res.status(400).json({\n success: false,\n error: 'Request Error',\n detail: 'Email address provided is invalid',\n })\n }\n\n // TODO: service for getAllPlants\n const plants = await PlantService.getAllPlants(email)\n if (plants.error) {\n return res.status(500).json({\n success: false,\n error: plants.error,\n detail: plants.detail,\n })\n }\n\n return res.status(200).json({ success: true, plants: plants })\n }", "title": "" }, { "docid": "3bcfdfff9521056db58a259145b16564", "score": "0.45792452", "text": "function getInfo(req, res, next) {\n var ipAllowedYN = ip_limiter.makeIpEntry(req.ip);\n if (!ipAllowedYN) {\n res.send(\n \"Sorry you have crossed the maximum limit of requests in 10secs. Please try again in a short while.\"\n );\n } else {\n if (req.query.carNumber) {\n if (libs.intCheck(parseInt(req.query.carNumber))) {\n libs.sendCarSlotData(req, res, \"car\");\n } else {\n res.send(\"Please enter a valid car number i.e: 1234.\");\n }\n } else if (req.query.slotNumber) {\n if (libs.intCheck(parseInt(req.query.slotNumber))) {\n libs.sendCarSlotData(req, res, \"slot\");\n } else {\n res.send(\"Please enter a valid car number i.e: 1 or 2 or 4 etc.\");\n }\n } else {\n res.send(\"Please provide either carNumber or slotNumber as parameter.\");\n }\n }\n}", "title": "" }, { "docid": "0c9ce67c775c2331c808cd5de9d2dfe0", "score": "0.45746502", "text": "function adRoute(){\n\tvar result = getADRoute();\n\treturn result;\n}", "title": "" }, { "docid": "0d5dba4c9cea6b6fbf3829fbd7c3bf7f", "score": "0.45539162", "text": "function attach() {\n this.app.get('/arduino/:pin/:val', this.route.bind(this));\n}", "title": "" }, { "docid": "6cf1a70604597e96ae7ae0d9457b5b12", "score": "0.45514348", "text": "get(data, cb) {\n // Check that phone number provided is valid\n const phone =\n typeof data.queryStringObject.phone == \"string\" &&\n data.queryStringObject.phone.trim().length == 10\n ? data.queryStringObject.phone.trim()\n : false;\n\n if (phone) {\n // Get the token from the headers\n const token =\n typeof data.headers.token == \"string\" ? data.headers.token : false;\n // Verify that the given token is valid for the phone number\n handlers._tokens.verifyToken(token, phone, tokenIsValid => {\n if (tokenIsValid) {\n // Lookup the user\n _data.read(\"users\", phone, (err, data) => {\n if (!err && data) {\n // Remove the hashed password from the user object before returning it to requestor\n delete data.hashedPassword;\n cb(200, data);\n } else {\n cb(404);\n }\n });\n } else {\n cb(403, {\n Error: \"Missing required token in header or token is invalid\"\n });\n }\n });\n } else {\n cb(400, { Error: \"Missing required field\" });\n }\n }", "title": "" }, { "docid": "72b8a26186417578ca7f418df705f56b", "score": "0.45472836", "text": "function checkin_checking_routing (){\n\t\n\t\n\tvar keystone = require('keystone');\n\t\n\tvar router_with_issues = [];//router with issuses details to add to email body\n\t\n\tvar date = new Date();\n\tvar router_last_contact_hour = date.getHours();//get current hour\n\t\n\t\n\t//exist funtion btween 11pm and 2am\n\t\n\tif(router_last_contact_hour == 23 || router_last_contact_hour == 24 || router_last_contact_hour == 1 || router_last_contact_hour == 2 ){return;}\n\t\n\t\n\tkeystone.list('Router Monitoring').model.find()\n\t.where({routermute:false})\n\t.exec(function(err, response){\n\t\t\n\t\tif(err){\n\t\t \n\t\t \tconsole.log('Error finding data for routing monitoring function');\n\t\t\treturn;\n\t\t }\n\t\tif(response == null || response == undefined || response == ''){//no router data found\n\t\t\n\t\t\tconsole.log('Err no router data forund on db for router monitoring function');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tresponse.forEach(function(data, index){\n\t\t//\tconsole.log(data.routername, data.routerlocation, data.routerdetails, data.router_last_contact_hour );\n\t\t\t\n\t\t\tif(data.router_last_contact_hour != null || data.router_last_contact_hour != undefined || data.router_last_contact_hour != ''){\n\t\t\t\t\n\t\t\t\tvar router_lasrouter_last_contact_hour_in_checkin = router_last_contact_hour - Number(data.router_last_contact_hour);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tif(router_lasrouter_last_contact_hour_in_checkin > -2 && router_lasrouter_last_contact_hour_in_checkin < 2){\n\t\t\t\t \t\t//console.log('Router name : '+data.routername+' is live.');\n\t\t\t\t }\n\t\t\t\telse{\n\t\t\t\t\t//console.log('Router name : '+data.routername+' is offline.');\n\t\t\t\t\t\n\t\t\t\t\trouter_with_issues.push('Router name: <b>'+data.routername+'</b><br />Installed on Location : <b>'+data.routerlocation+'</b><br />with Details : <b>'+ data.routerdetails+'</b>, is Currently OFFLINE, PLEASE investigate, DO Mute it on super admin menu to prevent futher email sending. Last contact hour : <b>'+ data.router_last_contact_hour+'</b>. <br/><br/>\\n\\n<hr>');\n\t\t\t\t\t\n\t\t\t\t\t//console.log(router_with_issues);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\t//email sending \n\t\t\n\t\t\n\t\tif(router_with_issues.length > 0){//if theres content send mail\n\t\t \n\t\t \t\t//get email for people with super-admin details\n\t\n\t\t\t\tvar super_admin_emails = [];\n\t\t\t\t\n\t\t\t\tkeystone.list('seller distributor').model.find()\n\t\t\t\t.where({usertype :'Server Admin'})\n\t\t\t\t.exec(function(err, response){\n\t\t\t\t\t\n\n\t\t\t\t\tif(err){\n\n\t\t\t\t\t\tconsole.log('Error finding super-admins data for routing monitoring function email sending');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t }\n\t\t\t\t\tif(response == null || response == undefined || response == ''){//no router data found\n\n\t\t\t\t\t\tconsole.log('Err no super-admin data forund on db for router monitoring function email sending');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse.forEach(function(data, index){\n\t\t\t\t\t\t//console.log(data.email);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(data.email){//if email value exists\n\t\t\t\t\t\tsuper_admin_emails.push(data.email.trim());//add to email to send to array\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\tx();//send mail part function\n\t\t\t\t\t})\n\n\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t});\n\t\t\t\n\t\t\t\tfunction x(){\t//send mail\t\n\n\n\t\t\t\t\t\t\tif(super_admin_emails.length < 1){\n\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}//if array empty end\n\n\t\t\t\t\t\t\t//send mail \n\t\t\t\t\t\t\t//console.log('email part');\n\t\t\t\t\t\t\tvar nodemailer = require('nodemailer');\n\n\t\t\t\t\t\t\tvar transporter = nodemailer.createTransport({\n\t\t\t\t\t\t\t service: 'gmail',\n\t\t\t\t\t\t\t auth: {\n\t\t\t\t\t\t\t\tuser: process.env.GMAIL_EMAIL,\n\t\t\t\t\t\t\t\tpass: process.env.GMAIL_PASSWORD,\n\t\t\t\t\t\t\t }, tls: {\n\t\t\t\t\t\t\t\t\t\trejectUnauthorized: false\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t//console.log(recipients,message_body);\n\n\t\t\t\t\t\t\tvar mailOptions = {\n\t\t\t\t\t\t\t from: '[email protected]',\n\t\t\t\t\t\t\t to: super_admin_emails.toString(),\n\t\t\t\t\t\t\t subject: 'StreetWify Router Down',\n\t\t\t\t\t\t\t text: router_with_issues.toString(),\n\t\t\t\t\t\t\t html:router_with_issues.toString(),\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\ttransporter.sendMail(mailOptions, function(error, info){\n\t\t\t\t\t\t\t if (error) {\n\t\t\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\tconsole.log('Email sent: ' + info.response);\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t \n\t\t\t\n\n\t\t \n\t\t }\n\t\t\n\t\t\n\t\t\n\t});\n\t\n}", "title": "" }, { "docid": "ac852d8aacd713f26bd34307518382e8", "score": "0.45407626", "text": "getEmployee( email ) {\n return this.request({\n method: 'get',\n url: `/employee/${email}`,\n });\n }", "title": "" }, { "docid": "f808f7325341bca57a1db11c65cb3bef", "score": "0.45406607", "text": "function onPatientReturned(patient) {\n $scope.respiratory = patient.Respiratories;\n }", "title": "" }, { "docid": "63fefc334f37c97fd7c2341986dd0ddb", "score": "0.45366305", "text": "getSanityDetails () {\n return this\n .getJson({\n q: 'sanity'\n })\n }", "title": "" }, { "docid": "aed3a925e97dd6d60ca9d3280b21355e", "score": "0.45304865", "text": "function phoneNumber(err, data) {\n console.log(\"Data: \", data); //Seeing the output\n}", "title": "" }, { "docid": "8971575c8387855a2a14dfcdac02d422", "score": "0.45268488", "text": "function readBySpecialties (req, res){\n let specialtieId = req.params.specialtieId\n Specialtie.findById(specialtieId, (err, specialtie)=>{\n if(err) return res.status(500).send({ message: `Error making the request: ${err}`})\n if(!specialtie) return res.status(404).send({ menssage: `This specialty does not exist`})\n res.status(200).send({ specialtie })\n })\n}", "title": "" }, { "docid": "d475104def1b0d2abb3587c81a8415b4", "score": "0.4523992", "text": "async function getInquiry(req, res) {\n const { id } = req.params;\n const inquiry = await Inquiry.findById(id).exec();\n if (!inquiry) {\n return res.status(404).json(\"This inquiry is not found!\");\n }\n\n return res.json(inquiry);\n}", "title": "" }, { "docid": "e2eac1e35536d5a4d6e448202d639e1f", "score": "0.45188034", "text": "async function getFlightDetail(req, res) {\n logger.info('METHOD ENTRY - server.api.flight.getAllAircrafts');\n let token = await utils.getHeaderToken(req.headers);\n if (token) {\n Flight.find({\n flight_no: req.params.flight_no\n }, async (err, flight) => {\n if (err) return await next(err);\n if (!flight) {\n return await res.status(403).send({ success: false, msg: 'Search failed. Flight not found.' });\n } else {\n return await res.json(flight);\n }\n });\n } else {\n return await res.status(403).send({ success: false, msg: 'Unauthorized.' });\n }\n}", "title": "" }, { "docid": "55afeceda5b7022a7b1ccdc3f39f620a", "score": "0.4518373", "text": "function linkAppToEndpoint(req, res, next) {\n var params = {};\n params.number = '';\n params.app_id = '';\n p.link_application_number(params, function (status, response) {\n res.send({ status: status, response: response });\n });\n}", "title": "" }, { "docid": "33a99c1aa859acab82b619990e24aa71", "score": "0.45113778", "text": "async function list(req, res, next) {\n if (req.query?.date || req.query?.mobile_number) next();\n else {\n const data = await service.list();\n res.status(200).json({ data });\n }\n return;\n}", "title": "" }, { "docid": "426a604a0f89c329b69aae1ac9e4acf0", "score": "0.45054093", "text": "function readOperationalID(req, res) {\n const idOperational = req.param('id');\n const post = { id_operational: idOperational };\n const query = connect.con.query('SELECT id_operational, name, birth_date, adress, entry_date, cc, phone_number, pay_per_hour, operational_type, speciality, id FROM operational where ? ', post, function(err, rows, fields) {\n console.log(query.sql);\n if (err) {\n console.log(err);\n res.status(jsonMessages.db.noRecords.status).send(jsonMessages.db.dbError);\n }\n else {\n if (rows.length == 0) {\n res.status(jsonMessages.db.noRecords.status).send(jsonMessages.db.noRecords);\n }\n else {\n res.send(rows);\n }\n }\n });\n\n}", "title": "" }, { "docid": "2748bc2599fd89ecaa9639f1311f76d3", "score": "0.45011273", "text": "static async get_logs(phone_number) {\n const body = {\n phone: phone_number\n };\n\n return await Postman._post(body, \"/get/log\");\n }", "title": "" }, { "docid": "a171b9beb9d703e4f794154f6b18c859", "score": "0.44797927", "text": "function checkFieldsPhonebook(req, res, next) {\n const { name, type, number } = req.body\n if (name && type && number) {\n next()\n } else {\n res.status(400).json({ message: 'fields are not good' })\n }\n}", "title": "" }, { "docid": "e7b58263122d93e395eee461e849904c", "score": "0.44727352", "text": "function getPatientAppointmentData(physioID, date) {\n return db.execute(\n `SELECT a.appointmentID, a.patientID, a.physioID, p.firstName, p.lastName, p.phoneNumber, \n TIME_FORMAT(a.appointmentTime, \"%H:%i\") AS appointmentTime, \n TIME_FORMAT(a.appointmentEndTime, \"%H:%i\") AS appointmentEndTime\n FROM appointment a\n INNER JOIN patient p \n ON a.patientID = p.patientID\n WHERE a.physioID = \"${physioID}\"\n AND a.appointmentDate = \"${date}\"\n ORDER BY appointmentTime ASC;`,\n );\n}", "title": "" }, { "docid": "13a5dba467ffa574f504972a4640fbdf", "score": "0.44681323", "text": "function readRequestVerification(req, res) {\n const statusF = req.param('verification');\n const post = { verification: statusF };\n const query = connect.con.query('SELECT id_request, description, adress, date, phone_number, content, mail, name, verification, verification_date, hour FROM request where verification is null ', post, function(err, rows, fields) {\n console.log(query.sql);\n if (err) {\n console.log(err);\n res.status(jsonMessages.db.dbError.status).send(jsonMessages.db.dbError);\n }\n else {\n if (rows.length == 0) {\n res.status(jsonMessages.db.noRecords.status).send(jsonMessages.db.noRecords);\n }\n else {\n res.send(rows);\n }\n }\n });\n}", "title": "" }, { "docid": "945e82a2c1064143daeb9caa69f15af8", "score": "0.44621626", "text": "function getPhoneNumber(number){\n if (typeof number.phone === \"undefined\") {\n document.getElementById(\"phone_number\").innerHTML = \"N/A\";\n }else{\n var PhoneNumber = `<i class=\"fa fa-phone\"></i> <a href=\"tel:${number.phone}\">${number.formattedPhone}</a>`;\n document.getElementById(\"phone_number\").innerHTML = PhoneNumber;\n }\n}", "title": "" }, { "docid": "1f1cb0a818ea4ffa66c4b73a2479a15a", "score": "0.445953", "text": "function readSpecialties (req, res){\n Specialtie.find({}, (err, specialtie) => {\n if(err) return res.status(500).send({ message: `Error making the request: ${err}`})\n if(!specialtie) return res.status(404).send({message: 'There are no specialties'})\n res.send(200, { specialtie })\n })\n}", "title": "" }, { "docid": "0d176728411fdea868a28b67c36478ec", "score": "0.44527987", "text": "function lookupNoteItems(req, res, next) {\n const itemsID = req.params.ItemsID\n\n client.get(itemsID, function(err, results){\n if (err) {\n console.error(err);\n return res.status(500).json({ errors: ['Could not retrieve item']});\n }\n if (results === null) {\n return res.status(404).json({ errors: ['Note item not found']});\n } \n req.noteItem = results\n next()\n })\n}", "title": "" }, { "docid": "1e5c9173fae518f4cabd3c0fa64ac681", "score": "0.4444134", "text": "function getdiseasebyId(req, res) {\n co(function* () {\n let userInfo = yield utility.getUserInfoByToken(req.headers);\n let constantmsg= yield utility.language(userInfo);\n var diseaseid = req.swagger.params.id.value;\n Disease.findById({_id:diseaseid}).exec(function(err, disease) {\n if (err) {\n res.json({code: 404,message: constantmsg.errorRetreivingData });\n } else if(disease){\n res.json({ code: 200, message: constantmsg.dataRetrievedSuccess, data: disease})\n }else{\n res.json({ code:400, message:constantmsg.noDataFound}) \n }\n })\n})\n.catch(function(err) {\n return res.json({ code: 402, message: err, data: {} });\n })\n}", "title": "" }, { "docid": "95feaec23369a7c7f4c28666bf8aa0c1", "score": "0.4443058", "text": "function populateReferalPatientDetail(hinNo,name,visitId) {\n\t\t\n\t\taction=\"/hms/hms/registration?method=populatePatientVisitDetail&patientHinNo=\"+hinNo+\"&lastVisitId=\"+visitId;\n\t\tobj = eval('document.search')\n\t\t obj.action = action;\n\t \t \t var url=action;\n\t\t \t \turl = url+'&'+csrfTokenName+'='+csrfTokenValue; // added by amit das on 07-07-2016\n \nvar xmlHttp;\ntry {\n // Firefox, Opera 8.0+, Safari\n xmlHttp=new XMLHttpRequest();\n}catch (e){\n // Internet Explorer\n try{\n xmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\n }catch (e){\n \talert(e)\n try{\n xmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }catch (e){\n alert(\"Your browser does not support AJAX!\");\n return false;\n }\n }\n}\n xmlHttp.onreadystatechange=function()\n {\n if(xmlHttp.readyState==4){\n \tvar items =xmlHttp.responseXML.getElementsByTagName('items')[0];\n \tfor (loop = 0; loop < items.childNodes.length; loop++) {\n\t \t var item = items.childNodes[loop];\n\t \t \n\t var uhid = item.getElementsByTagName(\"Uhid\")[0];\n\t var name = item.getElementsByTagName(\"name\")[0];\n\t var mobileNo = item.getElementsByTagName(\"mobileNo\")[0];\n\t var age = item.getElementsByTagName(\"page\")[0];\n\t var NameOf = item.getElementsByTagName(\"NameOf\")[0];\n\t var RelativeName = item.getElementsByTagName(\"RelativeName\")[0];\n\t \n\t var Occupation = item.getElementsByTagName(\"Occupation\")[0];\n\t \n\t var Category = item.getElementsByTagName(\"Category\")[0];\n\t var Gender = item.getElementsByTagName(\"Gender\")[0];\n\t var LastVisitDate = item.getElementsByTagName(\"LastVisitDate\")[0];\n\t var dutyDoct = item.getElementsByTagName(\"dutyDoct\")[0];\n\t \n\t var VisitNo = item.getElementsByTagName(\"VisitNo\")[0]; \n\t \n\t var CategoryId=item.getElementsByTagName(\"CategoryId\")[0];\n\t var hinId=item.getElementsByTagName(\"hinId\")[0];\n\t var lastVisitId=item.getElementsByTagName(\"lastVisitId\")[0];\n\t \n\t \n\t \n\t if(hinId !=undefined && hinId.childNodes[0] !=undefined)\n\t document.getElementById(\"hinId\").value = hinId.childNodes[0].nodeValue\n\t \n\t if(uhid !=undefined && uhid.childNodes[0] !=undefined)\n\t\t document.getElementById(\"pUhidId\").value = uhid.childNodes[0].nodeValue\n\t\t \n\t\t if(VisitNo !=undefined && VisitNo.childNodes[0] !=undefined)\n\t\tdocument.getElementById(\"visitNoId\").value = VisitNo.childNodes[0].nodeValue\n\t\t\n\t\t \tif(age !=undefined && age.childNodes[0] !=undefined)\n\t\t document.getElementById(\"ageId\").value = age.childNodes[0].nodeValue\n\t\t \n\t\t if(name !=undefined && name.childNodes[0] !=undefined)\n\t\t document.getElementById(\"pnameId\").value = name.childNodes[0].nodeValue\n\t\t \n\t\t if(NameOf.childNodes[0] !=undefined)\n\t\t document.getElementById(\"relationId\").value =NameOf.childNodes[0].nodeValue\n\t\t \n\t\t if(mobileNo.childNodes[0] !=undefined)\n\t\t document.getElementById(\"mobileNoId\").value = mobileNo.childNodes[0].nodeValue\n\t\t \n\t\t if(RelativeName !=undefined && RelativeName.childNodes[0] !=undefined)\n\t\t document.getElementById(\"relationNameId\").value = RelativeName.childNodes[0].nodeValue\n\t\t \n\t\t if(Occupation !=undefined && Occupation.childNodes[0] !=undefined)\n\t\t document.getElementById(\"occupationId\").value = Occupation.childNodes[0].nodeValue\n\t\t \n\t\t if(Category !=undefined && Category.childNodes[0] !=undefined)\n\t\t document.getElementById(\"categoryId\").value = Category.childNodes[0].nodeValue\n\t\t \n\t\t if(Gender !=undefined && Gender.childNodes[0] !=undefined)\n\t\t document.getElementById(\"genderId\").value = Gender.childNodes[0].nodeValue\n\t\t \n\t\t /*var onlineRegStatus=item.getElementsByTagName(\"onlineRegStatus\")[0];*/\n\t /*document.getElementById(\"onlineRegStatusID\").value = 'y'*/\n\t\t \n\t\t if(LastVisitDate !=undefined && LastVisitDate.childNodes[0] !=undefined)\n\t\t document.getElementById(\"lastVisitDateId\").value = LastVisitDate.childNodes[0].nodeValue\n\t\t \n\t\t if(dutyDoct !=undefined && dutyDoct.childNodes[0] !=undefined)\n\t\t document.getElementById(\"lastVisitDoctorsIncharge\").value = dutyDoct.childNodes[0].nodeValue\n\t\t \n\t\t\t if(lastVisitId !=undefined && lastVisitId.childNodes[0] !=undefined)\n\t\t\t\t document.getElementById(\"lastVisitId\").value = lastVisitId.childNodes[0].nodeValue\n\t \n\t\t \n\t\t \n\t\t if(LastVisitDate!=undefined && LastVisitDate.childNodes[0]!=undefined)\n\t\t\t document.getElementById(\"lastVisitDateId\").value = LastVisitDate.childNodes[0].nodeValue\n\t\t if(dutyDoct!=undefined && dutyDoct.childNodes[0]!=undefined)\n\t\t\t document.getElementById(\"lastVisitDoctorsIncharge\").value = dutyDoct.childNodes[0].nodeValue\n\t\t if(VisitNo!=undefined && VisitNo.childNodes[0]!=undefined){\n\t\t\t document.getElementById(\"visitNoId\").value = VisitNo.childNodes[0].nodeValue\n\t\t\t \n\t\t }\n\t if(CategoryId!=undefined && CategoryId.childNodes[0]!=undefined)\n\t\t document.getElementById(\"patientTypeNameId\").value = CategoryId.childNodes[0].nodeValue \n\t\t document.getElementById(\"referalStatusId\").value = \"y\" \n \t}\n }\n }\n var url=action;\n\turl = url+'&'+csrfTokenName+'='+csrfTokenValue; // added by amit das on 07-07-2016\nif(null==hinNo|| hinNo ==\"\" || hinNo ==\"null\"){\n\t\n\t\n\tvar r = confirm(\"Please Register the Patient ! \\n Do you want to register ?\");\n\tif (r == true) {\n\t\tsubmitForm('search','/hms/hms/registration?method=searchPatientFromCitizen&fn='+name)\n\t\t\n\t} else {\n\t \n\t}\n}else{\n xmlHttp.open(\"GET\",url,false);\n \n xmlHttp.setRequestHeader(\"Content-Type\", \"text/xml\");\n}\n xmlHttp.send(null);\n \n\n}", "title": "" }, { "docid": "d7700b7307a631733bcc2a11ff641bdc", "score": "0.4442068", "text": "function _getItineraryByTripId(req, res, next) {\n var tripId = req.params.tripId;\n var array = [];\n var flage = 0;\n\n if (!COMMON_ROUTE.isValidId(tripId)) {\n json.status = '0';\n json.result = { 'message': 'Invalid Itinerary Id!' };\n res.send(json);\n } else {\n ITINERARIES_COLLECTION.findOne({ 'tripId': tripId },\n function (itineraryerror, getItinerary) {\n if (itineraryerror || !getItinerary) {\n json.status = '0';\n json.result = { 'message': 'Itinerary not exists!' };\n res.send(json);\n } else {\n\n if (getItinerary.cruises.length <= 0) {\n json.status = '1';\n json.result = { 'message': 'Cruise Itineraries found successfully.', 'itinerary': getItinerary };\n res.send(json);\n } else {\n FilterCruiseItinerary(getItinerary, function (error, itineraryRes) {\n if (error) {\n json.status = '0';\n json.result = { 'message': 'cruise itineraries data not exists!' + error };\n res.send(json);\n } else {\n json.status = '1';\n json.result = { 'message': 'Cruise Itineraries found successfully.', 'itinerary': itineraryRes };\n res.send(json);\n }\n });\n }\n }\n });\n }\n}", "title": "" }, { "docid": "8196d0156c369b427a71d6e2db1b983d", "score": "0.4435044", "text": "handleTopicOfInquiryError() {}", "title": "" }, { "docid": "36dbe69c65e3423d4f03a3c215d2b4cc", "score": "0.4431893", "text": "function getGoalsXChallenge(req, res, next) {\n if (validate(req, res)) {\n const GoalID = parseInt(req.params.id);\n db.any('select * from goals where challenge_id = $1', GoalID)\n .then(function(data) {\n res.status(200)\n .json({\n status: 'success',\n data: data\n });\n })\n .catch(function(err) {\n res.status(500)\n .json({\n status: 'error',\n err: err\n });\n });\n }\n}", "title": "" }, { "docid": "06896f1906ae9a4d558f7c0e9e5bef9f", "score": "0.44301444", "text": "async function list(req, res) {\n const date = req.query.date;\n if (!date) {\n const phoneNumber = req.query.mobile_number;\n const response = await service.search(phoneNumber);\n if (!response) {\n res.json({\n data: [],\n });\n }\n res.json({ data: response });\n }\n const response = await service.list(date);\n if (!response) {\n res.json({\n data: [],\n });\n } else {\n res.json({ data: response });\n }\n}", "title": "" }, { "docid": "8d7cb949e61f8c84af5cf1b8af3bab93", "score": "0.4429045", "text": "async function discharge(appointment, encounter) {\n await globals.broker\n .post(\n \"/discharge\",\n {},\n { params: { appointment: appointment, encounter: encounter } }\n )\n .then((response) => {\n globals.config(response);\n console.log(JSON.stringify(response.data));\n console.log(\"\\n\");\n })\n .catch((error) => globals.info(error));\n}", "title": "" }, { "docid": "663d048ea0d0adeaa7a16faaf81e9ca1", "score": "0.44272828", "text": "function callAssistant(params) {\n console.log('Assistant params: ', params);\n assistant.message(params, function (err, data) {\n if (err) {\n console.log('assistant.message error: ', err);\n return res.json({ output: { generic: [{ response_type: 'text', text: err.message }] } });\n } else {\n console.log('assistant.message result: ', JSON.stringify(data.result, null, 2));\n checkForLookupRequests(params, data, function (err, data) {\n if (err) {\n console.log(err);\n return res.status(err.code || 500).json(err);\n } else {\n return res.json(data);\n }\n });\n }\n });\n }", "title": "" }, { "docid": "57c57f783b113ee22321fa0f0916f310", "score": "0.44260252", "text": "async function list(req, res, next) {\n const { mobile_number, date} = req.query;\n\n let data;\n if (mobile_number) {\n data = await service.search(mobile_number);\n } else {\n data = await service.list(date);\n }\n\n \n res.json({ data });\n}", "title": "" }, { "docid": "5888b20c89260a3b0445022667aad348", "score": "0.44235057", "text": "static async getEmployeeDetails(req, res) {\n let { user: { id } } = req;\n\n if (req.query.empId) {\n id = req.query.empId;\n }\n\n try {\n const theEmployee = await EmployeeService.getAEmployee('id', id);\n\n if (!theEmployee) {\n util.setError(404, `Cannot find Employee with the id ${id}`);\n } else {\n util.setSuccess(200, 'Found Employee', theEmployee);\n }\n return util.send(res);\n } catch (error) {\n console.log('error in getEmployeeDetails in EmployeeController.js', error);\n util.setError(404, error);\n return util.send(res);\n }\n }", "title": "" }, { "docid": "ee63bf49af51f97a83b767bd3553a6f5", "score": "0.44167745", "text": "validatePatient(req, res) {\n if (!req.headers.authorization) { // if there is no auth header\n return res.status(401).send({ Error: noTokenProvided }); // give error response\n }\n let token = req.headers.authorization.split(' ')[1] // split Bearer from token\n if (token === 'null' || token === null) { // if there is no token\n return res.status(401).send({ Error: noTokenProvided }); // give error response\n }\n jwt.verify(token, config.patientsecret, function (err, decoded) { // verify the token with the secret\n if (err) { // if it goes wrong \n return res.status(401).send({ Error: invalidToken }); // give error response\n }\n if (decoded) res.status(200).send({patientlogin : true}) // else go on\n })\n }", "title": "" }, { "docid": "66825355aa4861d16107ce4340c48e1f", "score": "0.44064474", "text": "getPatient(index) {\r\n var indexerStr = \"\";\r\n if (index) {\r\n indexerStr = \"/\" + index;\r\n }\r\n doFetch(\"GET\", \"/patient\" + indexerStr, getAuth()).then((responseJson) => {\r\n if (responseJson) {\r\n this.setState({ data: responseJson });\r\n this.setState({ formattedData: formatPatients(responseJson) });\r\n }\r\n });\r\n }", "title": "" }, { "docid": "9123d6c779a1462a70fb1ea4ba8141de", "score": "0.4406134", "text": "function readRequestID(req, res) {\n const idRequest = req.param('id');\n const post = { id_request: idRequest };\n const query = connect.con.query('SELECT id_request, content, description, adress, mail, name, date, phone_number, verification_date, hour FROM request where ? ', post, function(err, rows, fields) {\n console.log(query.sql);\n if (err) {\n console.log(err);\n res.status(jsonMessages.db.noRecords.status).send(jsonMessages.db.dbError);\n }\n else {\n if (rows.length == 0) {\n res.status(jsonMessages.db.noRecords.status).send(jsonMessages.db.noRecords);\n }\n else {\n\n res.send(rows);\n }\n }\n });\n}", "title": "" }, { "docid": "ae5d2c7f973f446c5eb64016698f40be", "score": "0.44059289", "text": "function mobileRead(model){\n var body={\n \"mod\" : \"guard\",\n \"operation\" : \"read\",\n \"data\" : {\t\n \"key\" : guardKey,\n \"schema\": \"Primary\",\n \"pageNo\": \"1\",\n \"data\" : {\n \"mobile\" :model.req.body.data.mobile\n } \n }\n\n }\n \n var options = {\n url : commonAccessUrl,\n method : 'POST',\n headers : headers,\n body : JSON.stringify(body)\n }\n \n request(options, function (error, response, body){\n \n if (body){\n try{ \n body=JSON.parse(body)\n if(body.data.length>0&&(!!body.data) && (body.data.constructor === Array)){\n model.accounts.push(body.data[0]);\n }\n serviceCallDecision(model);\n }\n catch(err){\n model.info={error:err,\n place:\"User Account Module : Read by Mobile Function : Error while parsing\"}\n model.emit(callbackRouter,model)\n }\n }\n else if(response){\n model.info={error:response,\n place:\"User Account Module : Read by Mobile Function : Error in response\"}\n model.emit(callbackRouter,model)\n }\n else if(error){\n model.info={error:error,\n place:\"User Account Module : Read by Mobile Function : Request error\"}\n model.emit(callbackRouter,model)\n } \n else{\n model.info={error:\"Error in User Account Module : Read by Mobile Function\"};\n model.emit(callbackRouter,model)\n }\n \n }) \n}", "title": "" }, { "docid": "4f3c6b682c231c482d2570bd45fc9fbf", "score": "0.44054946", "text": "function dis_referral(){\nvar empid = $('#empId').val();\nvar gethis = $('#chdate').val();\n$.ajax({\n'dataType': 'json',\n'type' : 'GET',\n'url' : 'http://greenocean.in/rest-tst/index.php/api/example/referral',\n'data' : {data: empid,check: gethis},\n'success' : function(data){\nif (data.response =='true')\n{\n$(\"#Specialities\").val(data.specialities);\n$(\"#Name_Doc\").val(data.doctor_name);\n$(\"#Address\").val(data.hosp_address);\n}\n}\n});\n}", "title": "" }, { "docid": "2f146c17f8887671bdfcc26ca53c435d", "score": "0.440471", "text": "function getMedicalInfoAndGetOtherParties() {\n var fn1 = getOtherParties();\n var fn2 = getMedicalInfo();\n $q.all([fn1, fn2]).then(function (values) {\n var obj = vm.associateMedicalContactsForNotEmptyPhysician.concat(vm.otherPartyPhysicians);\n _.forEach(obj, function (currentItem) {\n if (currentItem.medicaltreatmentid != \"\" || currentItem.medicaltreatmentid != null) {\n if (currentItem.physicianid == null || currentItem.physicianid == \"\") {\n return;\n } else {\n currentItem.contactid = currentItem.physicianid.contactid;\n currentItem.contact_name = currentItem.physicianid.contact_name;\n vm.physiciansFromMedicalInfoAndOtherParties.push(currentItem);\n }\n }\n });\n _.forEach(obj, function (currentItem) {\n if (currentItem.contactroleid == \"null\" || currentItem.contactroleid == \"\") {\n return;\n } else if (currentItem.contactroleid == \"2\") {\n vm.physiciansFromMedicalInfoAndOtherParties.push(currentItem);\n }\n });\n\n\n });\n }", "title": "" }, { "docid": "6c93668be516d160415047022a073d5b", "score": "0.44045177", "text": "function returnDetailsofID(datum){\n return methods.RouteDetails.returnInfoOfRouteIDs(datum)\n .then(function(final_model){\n return {\"success\":true,\"data\":final_model.data};\n \n })\n .catch(err => {\n return {\"success\":false,\"data\":[]}\n });\n \n }", "title": "" }, { "docid": "cfecb21d4ce403954ba2507a293249e7", "score": "0.4401902", "text": "function getNoteByID(req, res, next) {\n notes\n .find(getItemID(req))\n .then(item => {\n buildResponse(item, res, next);\n })\n .catch(err => next(err));\n}", "title": "" }, { "docid": "c23848a27cddae587fbdebd149cd55d4", "score": "0.43974978", "text": "static getSingleParty(req, res) {\n const findParty = party.find(\n partyobj => partyobj.id === parseInt(req.params.id, 10)\n );\n\n if (findParty) {\n return res.status(200).json({\n status: res.statusCode,\n data: findParty\n });\n }\n return res.status(404).json({\n message: 'Not Found',\n })\n }", "title": "" }, { "docid": "2a64330dff69f7ac72ac5739a4e939df", "score": "0.43974444", "text": "function getPatients(dId) {\r\n return contractInstance.getPatientArray(dId,{ from: doctorAddress, gas: 3000000 });\r\n}", "title": "" }, { "docid": "8a6466dec936241019d3dea8ce418361", "score": "0.4396276", "text": "function getPatientVisitHistory(req, res) {\n co(function*() {\n let userInfo = yield utility.getUserInfoByToken(req.headers);\n let constantmsg= yield utility.language(userInfo);\n let patientVisitHistoryList = yield Visit.find({ patientId: utility.getEncryptText(req.body.patientId), visitIsClosed: 1 }, { visitStart: 1, visitDuration: 1, treatmentResultType: 1, visitReason: 1 } ).exec();\n return res.json({ 'code': 200, status: 'success', \"message\": constantmsg.dataRetrievedSuccess, \"data\": patientVisitHistoryList});\n }).catch(function(err) {\n return res.json(Response(402, \"failed\", utility.validationErrorHandler(err), {}));\n });\n}", "title": "" }, { "docid": "10041ef9233779e6be5d8108a6bebb81", "score": "0.43949583", "text": "function getHealthData(userLocation, radius, specialty){\n// scenario for just required input\n if (specialty === \"\"){\n let source = srcDoctors+'user_key='+ apiKey_BD;\n useDoctors(source, userLocation,radius)\n }\n// scenario for required + specialty\n else if (specialty !== \"\"){\n let source = srcDoctors+'specialty_uid='+specialty+'&user_key='+ apiKey_BD;\n useDoctors(source,userLocation,radius)\n }\n}", "title": "" }, { "docid": "52699e6f8641a55c53586d9e75e137a6", "score": "0.43937474", "text": "function getRouteInfo() {\n\n\tvar url = 'https://cors-anywhere.herokuapp.com/http://primat.se/services/data/[email protected]_specific.json';\n\n\tfetch( url )\n\t.then( ( resp ) => resp.json() )\n\t.then( function ( data ) {\n\n\t\t// Starts page load after data is received\n\t\tpageLoad( data['data'][0] );\n\n\t}).catch( function ( error ) {\n\n\t\tconsole.log( error );\n\t});\n}", "title": "" }, { "docid": "e94a947e973a09c8fa91f206ec5a9867", "score": "0.43911028", "text": "function PhoneDetailCtrl($scope, $routeParams) {\n $scope.phoneId = $routeParams.phoneId;\n}", "title": "" }, { "docid": "4d77ea17f154dc7d0a7d3affaafc45d5", "score": "0.43824133", "text": "function aebcRoute(){\n\tvar result = getAERoute() + getEBRoute() + getBCRoute() + getCDRoute(); \n\treturn result;\n}", "title": "" }, { "docid": "a231a6be76ad4e8dc0b7a29a0b75081d", "score": "0.43819252", "text": "function getMedicalInfo() {\n var defer = $q.defer();\n matterDetailsService.getMedicalInfo_BEFORE_OFF_DRUPAL(vm.TemplateModelInfo.matterId, 'all')\n .then(function (resp) {\n vm.associateMedicalContacts = resp.data.medicalinfo;\n vm.allMedicalProviders = [];\n vm.associateMedicalContactsForNotEmptyPhysician = [];\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (currentItem.providerid == null || currentItem.providerid == \"\") {\n return;\n } else {\n currentItem.providerid.servicestartdate = currentItem.servicestartdate;\n currentItem.providerid.serviceenddate = currentItem.serviceenddate;\n currentItem.providerid.medicaltreatmentid = currentItem.medicaltreatmentid;\n vm.allMedicalProviders.push(currentItem.providerid);\n vm.allMedicalProvidersList.push(currentItem);\n }\n });\n vm.uniqueAllMedicalProviders = _.uniq(vm.allMedicalProviders, function (item, contactid) {\n return item.contactid;\n });\n\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (currentItem.party_role == \"1\" && currentItem.providerid != \"\") {\n vm.allMedicalProvidersPlantiffOnly.push(currentItem.providerid);\n }\n });\n templateHelper.setContactName(vm.allMedicalProvidersPlantiffOnly);\n\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (currentItem.party_role == \"1\" && currentItem.plaintiffid != \"\") {\n if (!(currentItem.physicianid == null || currentItem.physicianid == \"\")) {\n vm.physicianOnlyPlaintiff.push(currentItem);\n }\n }\n });\n templateHelper.setContactName(vm.physicianOnlyPlaintiff);\n\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (utils.isNotEmptyVal(currentItem.physicianid)) {\n currentItem.physicianid.medicaltreatmentid = currentItem.medicaltreatmentid;\n vm.physician_provider_medicalInfo.push(currentItem.physicianid);\n }\n\n });\n templateHelper.setContactName(vm.physician_provider_medicalInfo);\n\n /**\n * Unique Physician\n */\n vm.physician_provider_medicalInfo1 = _.uniq(vm.physician_provider_medicalInfo, function (item, contactid) {\n return item.contactid;\n });\n\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (utils.isNotEmptyVal(currentItem.physicianid)) {\n currentItem.physicianid.medicaltreatmentid = currentItem.medicaltreatmentid;\n currentItem.physicianName = currentItem.physicianid.contact_name;\n vm.associateMedicalContactsForNotEmptyPhysician.push(currentItem);\n }\n\n });\n\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (utils.isNotEmptyVal(currentItem.servicestartdate) && utils.isNotEmptyVal(currentItem.serviceenddate)) {\n currentItem.startEndDate = 'Start: ' + moment.unix(currentItem.servicestartdate).utc().format('MM/DD/YYYY') + ' | End: ' + moment.unix(currentItem.serviceenddate).utc().format('MM/DD/YYYY');\n vm.medicalInfoDates.push(currentItem);\n } else if (utils.isNotEmptyVal(currentItem.servicestartdate)) {\n currentItem.startEndDate = 'Start: ' + moment.unix(currentItem.servicestartdate).utc().format('MM/DD/YYYY') + ' | End: ' + \" \";\n vm.medicalInfoDates.push(currentItem);\n } else if (utils.isNotEmptyVal(currentItem.serviceenddate)) {\n currentItem.startEndDate = 'Start: ' + \" \" + ' | End: ' + moment.unix(currentItem.serviceenddate).utc().format('MM/DD/YYYY');\n vm.medicalInfoDates.push(currentItem);\n }\n })\n\n vm.medicalInfoDates = _.uniq(vm.medicalInfoDates, function (item) {\n return item.medicaltreatmentid;\n });\n\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (currentItem.servicestartdate != \"\" || currentItem.serviceenddate != \"\") {\n vm.medicalproviderdate.push(currentItem);\n }\n });\n\n //Date requested from medical info\n _.forEach(vm.associateMedicalContacts, function (currentItem) {\n if (utils.isNotEmptyVal(currentItem.date_requested)) {\n currentItem.dateRequested1 = moment.unix(currentItem.date_requested).utc().format('MM/DD/YYYY');\n currentItem.dateRequested2 = moment.unix(currentItem.date_requested).utc().format('MMMM D, YYYY');\n vm.medicalInfoRequestedDates.push(currentItem);\n }\n });\n\n vm.medicalInfoRequestedDates = _.uniq(vm.medicalInfoRequestedDates, function (item) {\n return item.date_requested;\n });\n templateHelper.setContactName(vm.allMedicalProviders);\n defer.resolve();\n }, function (error) {\n notificationService.error(\"Service providers not loaded.\");\n });\n return defer.promise;\n }", "title": "" }, { "docid": "fa9163eb45dc715be74fef10ce987bbf", "score": "0.43787622", "text": "function GetStudentOfferAdmissionDetail(data,result) {\n\t \n\tvar sql=\"call GetStudentOfferAdmissionDetail('\"+data.studentId+\"')\";\n\t\n db.query(sql, function (err, res) {\n\t if(err) {\n\t console.log(\"error: \", err);\n\t result(null, err);\n\t }\n\t else{ \n\t result(null, res);\n\t \n\t }\n }); \n}", "title": "" }, { "docid": "43f49ce3c63e0bc95cf59129801a3f1a", "score": "0.43781474", "text": "async function getSingleInterventionRecord(req, res) {\n const queryId = parseInt(req.params.id, 10);\n const text = `SELECT * FROM incidents WHERE type = 'intervention' AND id = $1 AND owner_id = $2 `;\n try {\n const { rows } = await db.query(text, [queryId, req.user.id]);\n return res.status(200)\n .send({\n status: 200,\n data: rows,\n });\n } catch (error) {\n return res.status(400).send(error);\n }\n}", "title": "" }, { "docid": "e633987ece196b15c7cf762ae1fc519c", "score": "0.43775925", "text": "function accessmobilewebsiteSolutiontrue(resourceId){\n\t \n\t console.log(\"inside access mobile website of solutiom (true).... \");\t \n\t var privateid = resourceId.toLowerCase();\n\t console.log(\"privateid client====> \"+privateid); \n\t window.location.href = pmwPath+\"/MW/\"+resourceId+\"/\"+privateid+\"personalise/index.html\";\n}", "title": "" }, { "docid": "78cc4c6defd10af952b4e8d4766dcc0a", "score": "0.43768486", "text": "function getDosageInformation(sessionAttributes, fulfillmentState, intentRequest, callback, herokuEnv, apiKey, patientId, bearerToken, medicineName, dosageTime) {\n\n if (medicineName === null && (\"medicineName\" in sessionAttributes)) {\n medicineName = sessionAttributes.medicineName;\n }\n\n var responseObject = null;\n let uri = `https://gateway-np.lillyapi.com:8443/${herokuEnv}/virtualClaudia/v3/patient/product/dosage?pcpPatientId=${patientId}&vcProductId=${medicineName}`\n console.log(\"About to call request method: \" + uri);\n\n var options = {\n method: \"GET\",\n uri: uri,\n headers: {\n 'Accept': 'application/json',\n 'Accept-Charset': 'utf-8',\n 'X-API-Key': apiKey,\n 'Requestor': 'VCClient',\n 'Authorization': 'Bearer ' + bearerToken\n },\n json: true\n };\n\n rp(options)\n .then(function(parsedBody) {\n var message = null;\n\n // Fetch the dosage profiles and find the currently active profiles\n if (parsedBody.payload.dosageProfiles !== null) {\n var activeProfile = null;\n for (let profile of parsedBody.payload.dosageProfiles) {\n if (profile.isActive) {\n var nextDosageIndex = profile.nextDosageNumber;\n\n // if the dosageTime passed in is \"last\", then fetch the last recorded dose, otherwise fetch the next dose due\n if (dosageTime === \"last\" && nextDosageIndex == 0) {\n message = { contentType: 'PlainText', content: `You have not recorded taking ${medicineName} yet.` };\n }\n else {\n var dosageIndex = nextDosageIndex;\n var isWas = \"next dose is due \";\n if (dosageTime === \"last\") {\n dosageIndex = nextDosageIndex - 1;\n isWas = \"last dose was taken \";\n }\n var dosageDate = profile.dosages[dosageIndex].dosageDate;\n var date = new Date(0);\n date.setUTCSeconds(dosageDate);\n // Convert the date to a human-readable format\n let formattedDate = dateFormat(date, \"dddd, mmmm dS\");\n message = { contentType: 'PlainText', content: `Your ${isWas} ${formattedDate}.` };\n }\n }\n break;\n }\n }\n if (message == null) {\n message = { contentType: 'PlainText', content: `No dosage information could be found for ${medicineName} in your profile.` };\n }\n callback({\n sessionAttributes,\n dialogAction: {\n type: 'Close',\n fulfillmentState,\n message\n }\n });\n })\n .catch(function(err) {\n var message = { contentType: 'PlainText', content: `There was a problem accessing LillyPlus services to get your dosage information.` };\n console.log(\"in error block - setting response object.\");\n console.log(err);\n callback({\n sessionAttributes,\n dialogAction: {\n type: 'Close',\n fulfillmentState,\n message\n }\n });\n });\n}", "title": "" }, { "docid": "932b2b4133121a3d220f022c76d65bd5", "score": "0.43739173", "text": "function getCurrentConsultantPhone()\r\n{\r\n return consultantPhone;\r\n}", "title": "" }, { "docid": "bc089b1d322d79702433b2ea75cecebf", "score": "0.43725997", "text": "function _getItineraryById(req, res, next) {\n var itineraryId = req.params.id;\n\n if (!COMMON_ROUTE.isValidId(itineraryId)) {\n json.status = '0';\n json.result = { 'message': 'Invalid Itinerary Id!' };\n res.send(json);\n } else {\n ITINERARIES_COLLECTION.findOne({ _id: new ObjectID(itineraryId) }, function (itineraryerror, getItinerary) {\n if (itineraryerror || (!getItinerary)) {\n json.status = '0';\n json.result = { 'message': 'Itinerary not exists!' };\n res.send(json);\n } else {\n json.status = '1';\n json.result = { 'message': 'Itinerary found successfully', 'itinerary': getItinerary };\n res.send(json);\n }\n });\n }\n}", "title": "" }, { "docid": "997fd45b2b76c0cfb71f5d3974ff417d", "score": "0.4371615", "text": "static get (data, callback) {\n // Check that the phone number is valid\n let {phone} = data.queryStringObject\n phone = typeof phone === 'string' && phone.trim().length === 10 ? phone.trim() : false\n\n if (phone) {\n // Get the token from the headers\n const token = typeof (data.headers.token) === 'string' ? data.headers.token : false\n // Verify the given token is valid for the phone number.\n _Tokens.verfiyToken(token, phone, (tokenIsValid) => {\n if (tokenIsValid) {\n // Lookup the user.\n Data.read('users', phone, (err, data) => {\n if (!err && data) {\n // Remove the has password from the user object before returning it to the request object\n const _data = {...data}\n const {password, ...rest} = _data\n callback(200, rest)\n } else {\n callback(404)\n }\n })\n } else {\n callback(403, {Error: 'Missing token in header or token is invalid.'})\n }\n })\n } else {\n callback(400, {Error: 'Missing required fields'})\n }\n }", "title": "" }, { "docid": "cc4b857f6b02104f1c4da74a338f4614", "score": "0.43704656", "text": "async function getDetails(req, res) {\n const id = parseInt(req.params.id);\n if (!Number.isInteger(id)) {\n response.sendBadRequest(res, 'Id must be of type number');\n return;\n }\n\n if (id < 0) {\n response.sendBadRequest(res, 'A correct id must be included in the request URI');\n return;\n }\n\n try {\n const result = await detailService.getDetails(id);\n response.sendOk(res, result);\n } catch (e) {\n response.sendInternalError(res, e.message);\n }\n}", "title": "" }, { "docid": "495844e2ccaaa82ec5e053d1931ace2c", "score": "0.43637162", "text": "function getObs(patient_id, obs_code,parsingFunction) {\n var a = 'patientA1C'\n SMART.api.fetchAll({\n type: 'Observation',\n query: {\n code: obs_code,\n subject: \"Patient/\"+patient_id\n }\n }).then(function (obs) {\n window[parsingFunction](patient_id,obs);\n })\n}", "title": "" }, { "docid": "947594ab4162447a743cd1f60832938a", "score": "0.43616626", "text": "fiberEligibilityByAddress() {\n return this.OvhApiConnectivityEligibilitySearch.v6()\n .searchBuildings(this.$scope, {\n streetCode: this.address.street.streetCode,\n streetNumber: this.address.streetNumber,\n })\n .then((data) => {\n if (data.result.length > 0) {\n // Do an eligibility test on a building (fiber only)\n const buildings = data.result;\n const buildingsEligible = [];\n buildings.forEach((building, index) => {\n this.OvhApiConnectivityEligibility.v6()\n .testBuilding(this.$scope, {\n building: building.reference,\n index,\n })\n .then((elig) => {\n return buildingsEligible.push(elig);\n });\n });\n return buildingsEligible;\n }\n return null;\n })\n .catch((error) => {\n this.loading = false;\n this.TucToast.error(error);\n });\n }", "title": "" }, { "docid": "edd6fdde09d8d0f6d507b374171d2ac3", "score": "0.43564847", "text": "async function GetClinicalInfoOptimized(patientId){ \n var urlFHIREndpoint='http://fhir.hl7fundamentals.org/r4/';\n var ResourceClass ='Patient';\n var ResourceId = patientId;\n var Operation = '$everything';\n var fullUrl = urlFHIREndpoint+ResourceClass+\"/\"+ResourceId+\"/\"+Operation; \n \n var patientData = { \n AllergyIntolerance : [],\n Condition : [],\n Immunization : [],\n MedicationRequest : []\n }\n \n\n try {\n // handling paging\n while(fullUrl){ \n var response = await axios.get(fullUrl);\n var responseData = response.data;\n fullUrl = null; \n var link = responseData.link;\n if (link){ \n var nextUrl = link.find(page => { \n return page.relation === 'next'\n })\n if (nextUrl){\n fullUrl = nextUrl.url;\n }\n }\n\n if (responseData.total > 0) { \n entries = responseData.entry;\n entries.forEach(entry => {\n var resourceType = entry.resource.resourceType;\n if (patientData.hasOwnProperty(resourceType)) {\n //deduping\n if (!patientData[resourceType].includes(entry.resource)){\n patientData[resourceType].push(entry.resource);\n } \n }\n })\n }\n }\n //console.log(patientData);\n return patientData;\n }\n catch (error){ \n return error;\n }\n\n}", "title": "" }, { "docid": "2007243989129892c33296e4664748f7", "score": "0.4351232", "text": "static async getPlantByID(req, res) {\n const garden_id = parseInt(req.params.garden_id)\n if (garden_id < 1 || isNaN(garden_id)) {\n return res.status(400).json({\n success: false,\n error: 'Request Error',\n detail: 'Plant id provided is invalid',\n })\n }\n const type = parseInt(req.query.type)\n if (type < 1 || isNaN(type)) {\n return res.status(400).json({\n success: false,\n error: 'Request Error',\n detail: 'Plant id provided is invalid',\n })\n }\n\n // TODO: service for getPlantByID\n const plant = await PlantService.getPlantByID(garden_id, type)\n if (plant.error) {\n return res.status(500).json({\n success: false,\n error: plant.error,\n detail: plant.detail,\n })\n }\n\n return res.status(200).json({ success: true, count: plant.plant_count })\n }", "title": "" }, { "docid": "51849940651776f042e613ead221695d", "score": "0.4351098", "text": "function getPatient(id) {\n return db\n .get(\"patients\")\n .find({ id: id })\n .value();\n}", "title": "" }, { "docid": "1bafbd374c080cbcc9659926ea35722c", "score": "0.4340037", "text": "function showNumber(contact) {\n console.log(contact.phoneNumber);\n}", "title": "" }, { "docid": "83f83b8ff5b786b0c7a8b985972ab927", "score": "0.43379563", "text": "function accessmobilewebsitetrue(solutionId, resourceId){\n\t \n\t console.log(\"inside access mobile website of site (true).... \");\n\t var privateid = resourceId.toLowerCase();\n\t console.log(\"privateid client====> \"+privateid); \n\t window.location.href = pmwPath+\"/MW/\"+solutionId+\"/\"+privateid+\"personalise/index.html\";\n}", "title": "" }, { "docid": "bc73f2618837a0f5b38eb34f6bb02939", "score": "0.4328613", "text": "function getAddNewBillingRoute(req, res, next) {\n console.log('Request Id:', req.params.id);\n\tres.render('patient/patientBillingAdd', {\n\t\tusername : req.session.username,\n isAdmin : req.session.isAdmin,\n getPatient_hcard : req.session.hcard,\n\t\tpageId : 'addNewPatient',\n\t\ttitle : 'Chancey | Add New Patient'\n\t});\n}", "title": "" }, { "docid": "975e10fab13ade00392b40e83df15956", "score": "0.43282622", "text": "async index(req, res) {\n try {\n const patient = await Patient.findAll();\n if (patient == '') {\n return res.status(404).json({\n mensagem: 'A lista esta vazia'\n })\n }\n return res.status(200)\n .json(patient);\n\n } catch (error) {\n res.status(500).json({\n status: \"error\",\n data: error\n })\n }\n\n }", "title": "" } ]
0eb918b5ceb845df5bdef72e9cb30414
Rename variables in a parsed formula tree so that variables are all integers and go 1,2,3,... without gaps. The formula is destructively changed. Allows the input clause set to contain both positive integer variables and string variables (no negative ones: all negative vars should be represented as terms ["","x"]). Assigns the renamed variables to original variable keys in renamedvars and the original variables to renamed in origvars. Takes a tree like ["&",["&",[">","a",20],"a"],["",20]] Returns a list of three elements [count,tree,orivars]: count : number of variables in the new tree, like 2 tree : the modified tree containing renamed (integer) vars, like ["&",["&",[">",1,20],1],["",20]] origvars : array containing for all vars in the new tree the original var like [null,"a",20]
[ { "docid": "1f43e18857050dc29ec488dd35c941dc", "score": "0.71713996", "text": "function rename_vars_in_formula(tree) {\r\n var renamedvars={}, origvars=[];\r\n var res,tmp;\r\n maxvarnr=0;\r\n if (typeof tree===\"number\" || typeof tree===\"string\") {\r\n // the tree is just a single variable\r\n return [1,1,[0,tree]];\r\n } else {\r\n // any normal case: not just a single variable\r\n rename_vars_in_formula_aux(tree,origvars,renamedvars);\r\n return [maxvarnr,tree,origvars];\r\n }\r\n}", "title": "" } ]
[ { "docid": "6002de6f15dd816af37aefcc27503312", "score": "0.7350547", "text": "function rename_vars_in_formula_aux(tree,origvars,renamedvars) {\r\n var i,el,tmp;\r\n for(i=1;i<tree.length;i++) {\r\n // loop over all term arguments\r\n el=tree[i];\r\n tmp=typeof el;\r\n if (tmp===\"number\" || tmp===\"string\") {\r\n // el is a variable\r\n if (! renamedvars[el]) {\r\n maxvarnr++;\r\n renamedvars[el]=maxvarnr;\r\n origvars[maxvarnr]=el;\r\n tree[i]=maxvarnr;\r\n } else {\r\n tree[i]=renamedvars[el];\r\n }\r\n } else {\r\n // el is a term\r\n rename_vars_in_formula_aux(el,origvars,renamedvars);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "11bba46787da7a9ef6c596b60583b6cd", "score": "0.65984184", "text": "function rename_vars_in_clauses(clauses) {\r\n var renamedvars={}, origvars=[];\r\n var i,j,clause,lit,nr,neg,count=0;\r\n for (i=0; i<clauses.length; i++) {\r\n clause=clauses[i];\r\n for (j=0; j<clause.length; j++) {\r\n lit=clause[j];\r\n neg=false;\r\n if (typeof lit === \"string\") {\r\n if (lit.lastIndexOf(\"-\",0)===0) { nr=lit.substring(1); neg=true}\r\n else nr=lit;\r\n } else if (typeof lit === \"number\") {\r\n if (lit<0) { nr=0-lit; neg=true}\r\n else nr=lit;\r\n } else if (lit.length===2 && lit[0]===\"-\") {\r\n nr=lit[1];\r\n neg=true;\r\n } else {\r\n return [0,\"error: not a clause list\",[]];\r\n }\r\n if (! renamedvars[nr]) {\r\n count++;\r\n renamedvars[nr]=count;\r\n origvars[count]=nr;\r\n nr=count;\r\n } else {\r\n nr=renamedvars[nr];\r\n }\r\n if (neg) clause[j]=0-nr;\r\n else clause[j]=nr;\r\n }\r\n }\r\n return [count,clauses,origvars];\r\n}", "title": "" }, { "docid": "0bdebb08f2607da7ec701a2dff8fe553", "score": "0.5622132", "text": "function varify(ast, stats, allIdentifiers, changes) {\n function unique(name) {\n assert(allIdentifiers.has(name));\n for (var cnt = 0; ; cnt++) {\n var genName = name + \"$\" + String(cnt);\n if (!allIdentifiers.has(genName)) {\n return genName;\n }\n }\n }\n\n function renameDeclarations(node) {\n if (node.type === \"VariableDeclaration\" && isConstLet(node.kind)) {\n var hoistScope = node.$scope.closestHoistScope();\n var origScope = node.$scope;\n\n // text change const|let => var\n changes.push({\n start: node.range[0],\n end: node.range[0] + node.kind.length,\n str: \"var\",\n });\n\n node.declarations.forEach(function(declarator) {\n assert(declarator.type === \"VariableDeclarator\");\n var name = declarator.id.name;\n\n stats.declarator(node.kind);\n\n // rename if\n // 1) name already exists in hoistScope, or\n // 2) name is already propagated (passed) through hoistScope or manually tainted\n var rename = (origScope !== hoistScope &&\n (hoistScope.hasOwn(name) || hoistScope.doesPropagate(name)));\n\n var newName = (rename ? unique(name) : name);\n\n origScope.remove(name);\n hoistScope.add(newName, \"var\", declarator.id, declarator.range[1]);\n\n origScope.moves = origScope.moves || stringmap();\n origScope.moves.set(name, {\n name: newName,\n scope: hoistScope,\n });\n\n allIdentifiers.add(newName);\n\n if (newName !== name) {\n stats.rename(name, newName, getline(declarator));\n\n declarator.id.originalName = name;\n declarator.id.name = newName;\n\n // textchange var x => var x$1\n changes.push({\n start: declarator.id.range[0],\n end: declarator.id.range[1],\n str: newName,\n });\n }\n });\n\n // ast change const|let => var\n node.kind = \"var\";\n }\n }\n\n function renameReferences(node) {\n if (!node.$refToScope) {\n return;\n }\n var move = node.$refToScope.moves && node.$refToScope.moves.get(node.name);\n if (!move) {\n return;\n }\n node.$refToScope = move.scope;\n\n if (node.name !== move.name) {\n node.originalName = node.name;\n node.name = move.name;\n\n if (node.alterop) {\n // node has no range because it is the result of another alter operation\n var existingOp = null;\n for (var i = 0; i < changes.length; i++) {\n var op = changes[i];\n if (op.node === node) {\n existingOp = op;\n break;\n }\n }\n assert(existingOp);\n\n // modify op\n existingOp.str = move.name;\n } else {\n changes.push({\n start: node.range[0],\n end: node.range[1],\n str: move.name,\n });\n }\n }\n }\n\n traverse(ast, {pre: renameDeclarations});\n traverse(ast, {pre: renameReferences});\n ast.$scope.traverse({pre: function(scope) {\n delete scope.moves;\n }});\n}", "title": "" }, { "docid": "5bdb777902152250e05344c2e56649e5", "score": "0.5328008", "text": "function renameOne(parentAst, parentAlphaMap, ast, letScopedNames) {\n var astAlphaMap = alphaMap(parentAlphaMap, ast);\n var astProps = ast.length > 1 ? copyProps(ast[1]) : void 0;\n var n = ast.length;\n switch (ast[0]) {\n case 'FunctionDecl': case 'FunctionExpr': letScopedNames = EMPTY_SET; break;\n case 'IdExpr': case 'IdPatt':\n substIdent('name', '', astProps, astAlphaMap);\n return [ast[0], astProps];\n case 'EvalExpr': throw new Error('alpha renaming breaks eval operator');\n case 'LabelledStmt': case 'BreakStmt': case 'ContinueStmt':\n substIdent('label', 'label ', astProps, astAlphaMap);\n break;\n case 'InitPatt':\n // Fail fast on split initializations such as (var e) in:\n // try { ... } catch (e) { var e = 1; } return e;\n // In this case, we can't rename the \"e\" in \"var e\" to any\n // single name, because the \"var\" declaration needs to get\n // the name in the scope outside the \"catch\", and the\n // initializer needs to assign to the exception variable.\n // This problem may arise with other let/var conflicts as in:\n // { let x; ... { var x = 3; ... } }\n if (parentAst && parentAst[0] === 'VarDecl'\n && letScopedNames.indexOf(ast[2][1].name) >= 0) {\n throw new Error('Split initialization of \"' + ast[2][1].name + '\"');\n }\n break;\n case 'CatchClause':\n letScopedNames = set_union(letScopedNames, set_singleton(ast[2][1].name));\n return [\n ast[0], astProps,\n renameOne(ast, astAlphaMap, ast[2], letScopedNames),\n renameOne(ast, astAlphaMap, ast[3], letScopedNames)];\n }\n var renamedCopy = [ast[0]];\n if (astProps) {\n renamedCopy[1] = astProps;\n letScopedNames = set_union(letScopedNames, let_scoped_decls(ast));\n for (var i = 2; i < n; ++i) {\n renamedCopy[i] = renameOne(ast, astAlphaMap, ast[i], letScopedNames);\n }\n }\n return renamedCopy;\n}", "title": "" }, { "docid": "1340dc0c0db59121ec516d2aa4829759", "score": "0.52429277", "text": "anonymizeVariables(ast, mapped = {}) {\n\t\tif(!ast) return mapped;\n\t\tswitch(ast.getClass()) {\n\t\t\tcase \"Variable\": {\n\t\t\t\tif(mapped[ast.getValue()]) {\n\t\t\t\t\tast.setValue(mapped[ast.getValue()]);\n\t\t\t\t} else {\n\t\t\t\t\tlet nextVal = DefaultIndexer.getNextVariableName();\n\t\t\t\t\tmapped[ast.getValue()] = nextVal;\n\t\t\t\t\tast.setValue(nextVal);\n\t\t\t\t}\n\t\t\t\tbreak ;\n\t\t\t}\n\t\t\tcase \"Fact\": {\n\t\t\t\tlet body = ast.getBody();\n\t\t\t\tfor(let i in body) {\n\t\t\t\t\tmapped = this.anonymizeVariables(body[i], mapped);\n\t\t\t\t}\n\t\t\t\tbreak ;\n\t\t\t}\n\t\t\tcase \"Rule\": {\n\t\t\t\tmapped = this.anonymizeVariables(ast.getHead());\n\t\t\t\tlet body = ast.getBody();\n\t\t\t\tfor(let i in body) {\n\t\t\t\t\tmapped = this.anonymizeVariables(body[i], mapped);\n\t\t\t\t}\n\t\t\t\tbreak ;\n\t\t\t}\n\t\t\tcase \"MathAssignment\":\n\t\t\t\tmapped = this.anonymizeVariables(ast.getLeftHand(), mapped);\n\t\t\t\tmapped = this.anonymizeVariables(ast.getRightHand(), mapped);\n\t\t\t\tbreak ;\n\t\t\tcase \"MathExpr\":\n\t\t\t\tmapped = this.anonymizeVariables(ast.getLeftHand(), mapped);\n\t\t\t\tmapped = this.anonymizeVariables(ast.getRightHand(), mapped);\n\t\t\t\tbreak ;\n\t\t\tcase \"MathMult\":\n\t\t\t\tmapped = this.anonymizeVariables(ast.getLeftHand(), mapped);\n\t\t\t\tmapped = this.anonymizeVariables(ast.getRightHand(), mapped);\n\t\t\t\tbreak ;\n\t\t\tcase \"MathFactor\":\n\t\t\t\tmapped = this.anonymizeVariables(ast.getValue(), mapped);\n\t\t\t\tbreak ;\n\t\t}\n\n\t\treturn mapped;\n\t}", "title": "" }, { "docid": "a55ed28f4f1d29141d769e4de2835031", "score": "0.48987505", "text": "function fixUp(ast) {\n if (ast.type === 'term') {\n return ast;\n }\n switch (ast.name) {\n case 'exprList': // recover left-recursive structures\n case 'conj':\n case 'disj':\n case 'exp':\n return fixUpRightRecurse(ast, 1);\n case 'sum':\n case 'prod':\n return fixUpRightRecurse(ast, 2);\n case 'cmpEq':\n return fixUpRightRecurse(ast, 3);\n case 'cmpRel':\n return fixUpRightRecurse(ast, 4);\n case 'prim': // recover left-factored identifier things\n switch (ast.prod) {\n case 3:\n switch (ast.children[1].prod) {\n case 0: // function call\n return {\n type: 'nonterm', name: 'prim', prod: 3,\n children: [fixUp(ast.children[0]), ...mapFixUp(ast.children[1].children)]\n };\n case 1: // just an identifier\n return { type: 'nonterm', name: 'prim', prod: 4, children: [fixUp(ast.children[0])] };\n }\n break;\n case 4:\n return { ...ast, prod: 5, children: mapFixUp(ast.children) };\n }\n break;\n }\n return { ...ast, children: mapFixUp(ast.children) };\n }", "title": "" }, { "docid": "513f5f8b9378c8f248bdf8a44ef4ed4a", "score": "0.48389974", "text": "function renameVariableGetters(root) {\n if (root.type == 'variableGetter' && root.getField('identifier').getText() == oldIdentifier) {\n root.getField('identifier').setText(newIdentifier);\n root.deltaphone.identifier = newIdentifier;\n } else if (root.type == 'setIdentifier' && root.getField('identifier').getText() == oldIdentifier) {\n root.deltaphone.identifier = newIdentifier;\n root.getField('identifier').setText(newIdentifier);\n }\n\n for (let child of root.getChildren()) {\n renameVariableGetters(child, oldIdentifier, newIdentifier);\n }\n }", "title": "" }, { "docid": "a07f6af1f713ed16b8c681c421071bce", "score": "0.46479663", "text": "function changeCrossTreeConstraintsVariableName(featureId, newVariableName) {\n\t\tvar constraints = findAllCrossTreeConstraintsReferencingFeature(featureId, false);\n\t\tfor( i = 0 ; i < constraints.length ;i++ ) {\n\t\t\tdojo.byId(constraints[i] + \"_literals\" + featureId + \"_variable\").innerHTML = newVariableName;\n\t\t}\n\t\treturn constraints;\n\t}", "title": "" }, { "docid": "56199a81d2eaec08073f0b9c522f12b6", "score": "0.45821014", "text": "function replace_var_expr(var_from, var_to, expr){\n // Constants to ignore\n var constants=['e','E','i','Infinity','LN2','LN10','LOG2E','LOG10E','phi',\n 'pi','PI','SQRT1_2','SQRT2','tau','version'];\n // Uses Math.js to replace variables\n var node=math.parse(expr);\n var dep_var=[];\n node.filter(function(n){\n if(n.isSymbolNode && $.inArray(n.name,constants)==-1){\n if(n.name==var_from){\n n.name=var_to;\n }\n }\n })\n return node.toString().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "863b0c5ee4474f27dddcc97adb7b3412", "score": "0.4567804", "text": "function simplify_clause_list(clauses,varvals,occvars,posbuckets,negbuckets,derived) {\r\n var clauses2,i,j,k,clause,lit,nlit,nr,sign,remove,cuts,dups,nlen,nc,unsat,s;\r\n clauses=clauses.sort(function(a,b){return a.length-b.length});\r\n // loop over clauses to remove tautologies and duplicate literals\r\n // and to perform unit subsumption and cutoff\r\n unsat=false;\r\n clauses2=[];\r\n for(i=0;i<clauses.length;i++) {\r\n //console.log(\"clause i \"+i+\" \"+clause_to_str(clauses[i]));\r\n clause=clauses[i];\r\n remove=false;\r\n cuts=0;\r\n dups=0;\r\n for(j=2;j<clause.length;j++) {\r\n lit=clause[j];\r\n nlit=0-lit;\r\n if (lit<0) {nr=0-lit; sign=-1; }\r\n else {nr=lit; sign=1; }\r\n if (varvals[nr]===sign) { remove=true; break; } // subsumed\r\n if (varvals[nr]===0-sign) { clause[j]=0; cuts++; continue; } // cut off\r\n for(k=2;k<j;k++) { // check for tautology and duplicate literals\r\n if(clause[k]===nlit) { remove=true; break; }\r\n if(clause[k]===lit) { clause[j]=0; dups++; }\r\n }\r\n if (remove) break; // do not keep tautologies\r\n }\r\n //console.log(\"cuts \"+cuts+\" dups \"+dups+\" remove \"+remove);\r\n if (remove) {\r\n clauses_removed_count++;\r\n continue;\r\n }\r\n nlen=clause.length-(cuts+dups);\r\n if (nlen===2) {\r\n unsat=true;\r\n return false;\r\n }\r\n if (nlen===3) {\r\n // unit\r\n units_derived_count++;\r\n for(k=2;k<clause.length;k++) {\r\n if (clause[k]!==0) {lit=clause[k]; break; }\r\n }\r\n //console.log(\"derived unit \"+lit);\r\n if (lit<0) {nr=0-lit; sign=-1; }\r\n else {nr=lit; sign=1; }\r\n varvals[nr]=sign;\r\n continue;\r\n }\r\n if (nlen!==clause.length) {\r\n // some literals were removed\r\n nc=new Int32Array(nlen);\r\n nc[0]=clause[0];\r\n nc[1]=clause[1];\r\n k=0;\r\n for(j=2;j<clause.length;j++) {\r\n if (clause[j]===0) continue;\r\n nc[k]=clause[j];\r\n k++;\r\n }\r\n clause=nc;\r\n }\r\n clauses2.push(clause);\r\n }\r\n if (trace_flag) {\r\n s=\"units detected or derived during preprocessing: \";\r\n for(i=1;i<varvals.length;i++) {\r\n if (varvals[i]!==0) s+=\" \"+i; //showvar(i*varvals[i])+\" \";\r\n }\r\n print_trace(0,s);\r\n //console.log(s);\r\n }\r\n return clauses2;\r\n}", "title": "" }, { "docid": "8f991bbc5e2b527c30c0f4ee34af51d4", "score": "0.45423904", "text": "function ModifyTree (tree){\n\ntree = require('./privatefunctions').flatCondition(tree) // many arrays in one array to one entire array \ntree = [... new Set(tree)] // array to set : to remove my code's logical errors\ntree = require('./privatefunctions').ConvertToInt(tree) // convert '' to int\n\nreturn tree\n}", "title": "" }, { "docid": "6e24845bd4d3978b6883d2971ff236a6", "score": "0.44823056", "text": "function renameFormalVariableGetters(root) {\n if (root.type == 'variableGetter' && root.deltaphone.hasOwnProperty('formalBlockId') && root.deltaphone.formalBlockId == formalBlock.id) {\n mutateUndoably(root, () => {\n root.deltaphone.identifier = newIdentifier;\n }, () => {\n root.getField('identifier').setText(newIdentifier);\n });\n }\n\n for (let child of root.getChildren()) {\n renameFormalVariableGetters(child);\n }\n }", "title": "" }, { "docid": "6f7402f3bdbc3473f840c3f59317845e", "score": "0.43111733", "text": "function doEliminate(name, node) {\n //if (eliminationLimit === 0) return;\n //eliminationLimit--;\n //printErr('elim!!!!! ' + name);\n // yes, eliminate!\n varsToRemove[name] = 2; // both assign and var definitions can have other vars we must clean up\n var info = tracked[name];\n delete tracked[name];\n var defNode = info.defNode;\n var value;\n if (!sideEffectFree[name]) {\n if (defNode[0] === 'var') {\n defNode[1].forEach(function(pair) {\n if (pair[0] === name) {\n value = pair[1];\n }\n });\n assert(value);\n } else { // assign\n value = defNode[3];\n // wipe out the assign\n defNode[0] = 'toplevel';\n defNode[1] = [];\n defNode.length = 2;\n }\n // replace this node in-place\n node.length = 0;\n for (var i = 0; i < value.length; i++) {\n node[i] = value[i];\n }\n } else {\n // This has no side effects and no uses, empty it out in-place\n node.length = 0;\n node[0] = 'toplevel';\n node[1] = [];\n }\n }", "title": "" }, { "docid": "68bb07965cccb9d1db3559cb15e60fb5", "score": "0.42955512", "text": "function simplify(rpn){\n\treturn rpn; \n\tvar valStack=[];\n\tvar outStack=[];\n\tfor(var i=0;i<rpn.length;i++){\n\t\tvar token=rpn[i];\n\t\tswitch(token.type){\n\t\t\tcase \"numero\":case \"string\":\n\t\t\t\tvalStack.push(token);\n\t\t\tbreak;case \"variable\":case \"index\":\n\t\t\t\tArray.prototype.push.apply(outStack,valStack);\n\t\t\t\toutStack.push(token);\n\t\t\t\tvalStack=[];\n\t\t\tbreak;case \"function\":case \"operator\":case \"unary\":\n\t\t\t\tif(builtins[token.name] && !builtins[token.name].noSimplify && builtins[token.name][token.args] && valStack.length>=token.args){\n\t\t\t\t\toutStack.push(builtins[token.name][token.args].apply(null,arrayRight(valStack,token.args)));\n\t\t\t\t\tfor(var j=0;j<token.args;j++)\n\t\t\t\t\t\tvalStack.pop();\n\t\t\t\t}else{\n\t\t\t\t\tArray.prototype.push.apply(outStack,valStack);\n\t\t\t\t\toutStack.push(token);\n\t\t\t\t\tvalStack=[];\n\t\t\t\t}\n\t\t\tbreak;case \"arrayLiteral\":\n\t\t\t\tif(valStack.length>=token.args){\n\t\t\t\t\toutStack.push(new Value(\"array\",arrayRight(valStack,token.args)));\n\t\t\t\t\tfor(var j=0;j<token.args;j++)\n\t\t\t\t\t\tvalStack.pop();\n\t\t\t\t}else{\n\t\t\t\t\tArray.prototype.push.apply(outStack,valStack);\n\t\t\t\t\toutStack.push(token);\n\t\t\t\t\tvalStack=[];\n\t\t\t\t}\n\t\t\tbreak;default:\n\t\t\t\tassert(false,\"bad \"+token.type);\n\t\t}\n\t}\n\tassert(valStack.length<=1,\"Error interno: error de simplificacion, pila constante no vacia\")\n\treturn outStack.concat(valStack);\n}", "title": "" }, { "docid": "e4966699b3c5fcf003259a73195d6e73", "score": "0.41410893", "text": "function optimize(code){\n let result = [];\n const result2 = [];\n const replaceTable = {};\n let waste = 0;\n let onLabel = null;\n let jname = null;\n for(let i = 0; i < code.length; i++){\n if(/^\\s*$/.test(code[i])){result.push(code[i]);continue;}\n if(/add\\s/.test(code[i])){\n const tuple = \n /add\\s*([a-zA-Z0-9$_]*)\\s*,\\s*([a-zA-Z0-9$_]*)\\s*,\\s*([a-zA-Z0-9$_]*)/.exec(code[i]);\n //console.log(tuple);\n if(tuple[2] == '$zero'){\n if(tuple[3] == tuple[1])continue;\n }\n if(tuple[3] == '$zero'){\n if(tuple[2] == tuple[1])continue;\n continue;\n }\n }\n if(/^\\s*j\\s+/.test(code[i])){\n jname = /j\\s*([a-zA-Z_$0-9]*)\\s*/.exec(code[i])[1];\n result.push(code[i]);\n waste = 1;\n continue;\n }\n if(code[i].indexOf(':') != -1){\n waste = 0;\n const name = /\\s*([a-zA-Z_$0-9]+)\\s*:/.exec(code[i]);\n if(name[1] == jname)result.pop();\n }\n jname = null;\n if(waste != 1){\n result.push(code[i]);\n }\n }\n for(let i = 0; i < result.length; i++){\n if(result[i].indexOf(':') != -1){\n if(onLabel){\n const name = /\\s*([a-zA-Z_$0-9]+)\\s*:/.exec(result[i]);\n replaceTable[name] = onLabel;\n continue;\n }else{\n const name = /\\s*([a-zA-Z_$0-9]+)\\s*:/.exec(result[i]);\n onLabel = name[1];\n result2.push(result[i]);\n } \n }else{\n onLabel = null;\n result2.push(result[i]);\n }\n }\n result = [];\n for(let i = 0; i < result2.length; i++){\n for(let key of Object.keys(replaceTable)){\n result2[i] = result2[i].replace(key, replaceTable[key]);\n }\n result.push(result2[i]);\n }\n return result;\n}", "title": "" }, { "docid": "830d99b9352bdb9f8da02700cd2bc8fe", "score": "0.41172472", "text": "function substVar(rootNode) {\n rootNode.walkDecls(rule => {\n if (isVar(rule.value)) {\n rule.value = colors[rule.value.slice(1)];\n }\n });\n}", "title": "" }, { "docid": "8420b908b7c85b40fa7809b70ad76b9e", "score": "0.41110778", "text": "function transformAST(node, opts) {\n\tnode.nodes.slice(0).forEach(function (child) {\n\t\tif (isColorModFunction(child)) {\n\t\t\t// transform any color-mod() functions\n\t\t\tvar color = transformColorModFunction(child, opts);\n\n\t\t\tif (color) {\n\t\t\t\t// update the color-mod() function with the transformed value\n\t\t\t\tchild.replaceWith(parser.word({\n\t\t\t\t\tvalue: opts.stringifier(color)\n\t\t\t\t}));\n\t\t\t}\n\t\t} else if (child.nodes && Object(child.nodes).length) {\n\t\t\ttransformAST(child, opts);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9588fc0dfd74688c1857f3b1a4b223d5", "score": "0.4091129", "text": "function getVariableTransformedString(node, string) {\n\t\treturn string.replace(variablesInString, function (match, before, name1, name2) {\n\t\t\tvar value = getVariable(node, name1 || name2);\n\n\t\t\treturn value === undefined ? match : before + value;\n\t\t});\n\t}", "title": "" }, { "docid": "97b0e52c6098380970d7a4cba34ebd8c", "score": "0.40531975", "text": "function deMorganRewrite(e, bindings)\n{\n var rwEx = bindings['#matchingExpr'];\n var cArgs, newArgs, i, child, cOp, dualOp;\n if (e === rwEx) {\n\tchild = e.getArg(0);\n\tcOp = child.getOp();\n\tdualOp = propDual(cOp);\n\tcArgs = child.getArgs();\n\tnewArgs = [];\n\tfor (i = 0; i < cArgs.length; i++) {\n\t // negate deals with double nagation.\n\t newArgs.push(negate(cArgs[i]));\n\t}\n\t// normalization needed for flattening, robustness.\n\treturn propObviousNormalize(makeExpr(dualOp, newArgs));\n }\n return e;\n}", "title": "" }, { "docid": "954a59ba4442fedc0187ae58ee54ffc1", "score": "0.40523252", "text": "function scan(node) {\n //printErr('scan: ' + JSON.stringify(node).substr(0, 50) + ' : ' + keys(tracked));\n var abort = false;\n var allowTracking = true; // false inside an if; also prevents recursing in an if\n //var nesting = 1; // printErr-related\n function traverseInOrder(node, ignoreSub, ignoreName) {\n if (abort) return;\n //nesting++; // printErr-related\n //printErr(JSON.stringify(node).substr(0, 50) + ' : ' + keys(tracked) + ' : ' + [allowTracking, ignoreSub, ignoreName]);\n var type = node[0];\n if (type === 'assign') {\n var target = node[2];\n var value = node[3];\n var nameTarget = target[0] === 'name';\n traverseInOrder(target, true, nameTarget); // evaluate left\n traverseInOrder(value); // evaluate right\n // do the actual assignment\n if (nameTarget) {\n var name = target[1];\n if (!(name in potentials)) {\n if (!(name in varsToTryToRemove)) {\n // expensive check for invalidating specific tracked vars. This list is generally quite short though, because of\n // how we just eliminate in short spans and abort when control flow happens TODO: history numbers instead\n invalidateByDep(name); // can happen more than once per dep..\n if (!(name in locals) && !globalsInvalidated) {\n invalidateGlobals();\n globalsInvalidated = true;\n }\n // if we can track this name (that we assign into), and it has 0 uses and we want to remove its 'var'\n // definition - then remove it right now, there is no later chance\n if (allowTracking && (name in varsToRemove) && uses[name] === 0) {\n track(name, node[3], node);\n doEliminate(name, node);\n }\n } else {\n // replace it in-place\n node.length = value.length;\n for (var i = 0; i < value.length; i++) {\n node[i] = value[i];\n }\n varsToRemove[name] = 2;\n }\n } else {\n if (allowTracking) track(name, node[3], node);\n }\n } else if (target[0] === 'sub') {\n if (isTempDoublePtrAccess(target)) {\n if (!globalsInvalidated) {\n invalidateGlobals();\n globalsInvalidated = true;\n }\n } else if (!memoryInvalidated) {\n invalidateMemory();\n memoryInvalidated = true;\n }\n }\n } else if (type === 'sub') {\n traverseInOrder(node[1], false, !memSafe); // evaluate inner\n traverseInOrder(node[2]); // evaluate outer\n // ignoreSub means we are a write (happening later), not a read\n if (!ignoreSub && !isTempDoublePtrAccess(node)) {\n // do the memory access\n if (!callsInvalidated) {\n invalidateCalls();\n callsInvalidated = true;\n }\n }\n } else if (type === 'var') {\n var vars = node[1];\n for (var i = 0; i < vars.length; i++) {\n var name = vars[i][0];\n var value = vars[i][1];\n if (value) {\n traverseInOrder(value);\n if (name in potentials && allowTracking) {\n track(name, value, node);\n } else {\n invalidateByDep(name);\n }\n if (vars.length === 1 && name in varsToTryToRemove && value) {\n // replace it in-place\n value = ['stat', value];\n node.length = value.length;\n for (var i = 0; i < value.length; i++) {\n node[i] = value[i];\n }\n varsToRemove[name] = 2;\n }\n }\n }\n } else if (type === 'binary') {\n var flipped = false;\n if (node[1] in ASSOCIATIVE_BINARIES && !(node[2][0] in NAME_OR_NUM) && node[3][0] in NAME_OR_NUM) { // TODO recurse here?\n // associatives like + and * can be reordered in the simple case of one of the sides being a name, since we assume they are all just numbers\n var temp = node[2];\n node[2] = node[3];\n node[3] = temp;\n flipped = true;\n }\n traverseInOrder(node[2]);\n traverseInOrder(node[3]);\n if (flipped && node[2][0] in NAME_OR_NUM) { // dunno if we optimized, but safe to flip back - and keeps the code closer to the original and more readable\n var temp = node[2];\n node[2] = node[3];\n node[3] = temp;\n }\n } else if (type === 'name') {\n if (!ignoreName) { // ignoreName means we are the name of something like a call or a sub - irrelevant for us\n var name = node[1];\n if (name in tracked) {\n doEliminate(name, node);\n } else if (!(name in locals) && !callsInvalidated && (memSafe || !(name in HEAP_NAMES))) { // ignore HEAP8 etc when not memory safe, these are ok to\n // access, e.g. SIMD_Int32x4_load(HEAP8, ...)\n invalidateCalls();\n callsInvalidated = true;\n }\n }\n } else if (type === 'unary-prefix' || type === 'unary-postfix') {\n traverseInOrder(node[2]);\n } else if (type in IGNORABLE_ELIMINATOR_SCAN_NODES) {\n } else if (type === 'call') {\n traverseInOrder(node[1], false, true);\n var args = node[2];\n for (var i = 0; i < args.length; i++) {\n traverseInOrder(args[i]);\n }\n if (callHasSideEffects(node)) {\n // these two invalidations will also invalidate calls\n if (!globalsInvalidated) {\n invalidateGlobals();\n globalsInvalidated = true;\n }\n if (!memoryInvalidated) {\n invalidateMemory();\n memoryInvalidated = true;\n }\n }\n } else if (type === 'if') {\n if (allowTracking) {\n traverseInOrder(node[1]); // can eliminate into condition, but nowhere else\n if (!callsInvalidated) { // invalidate calls, since we cannot eliminate them into an if that may not execute!\n invalidateCalls();\n callsInvalidated = true;\n }\n\n allowTracking = false;\n traverseInOrder(node[2]); // 2 and 3 could be 'parallel', really..\n if (node[3]) traverseInOrder(node[3]);\n allowTracking = true;\n\n } else {\n tracked = {};\n }\n } else if (type === 'block') {\n var stats = node[1];\n if (stats) {\n for (var i = 0; i < stats.length; i++) {\n traverseInOrder(stats[i]);\n }\n }\n } else if (type === 'stat') {\n traverseInOrder(node[1]);\n } else if (type === 'label') {\n traverseInOrder(node[2]);\n } else if (type === 'seq') {\n traverseInOrder(node[1]);\n traverseInOrder(node[2]);\n } else if (type === 'do') {\n if (node[1][0] === 'num' && node[1][1] === 0) { // one-time loop\n traverseInOrder(node[2]);\n } else {\n tracked = {};\n }\n } else if (type === 'return') {\n if (node[1]) traverseInOrder(node[1]);\n } else if (type === 'conditional') {\n if (!callsInvalidated) { // invalidate calls, since we cannot eliminate them into a branch of an LLVM select/JS conditional that does not execute\n invalidateCalls();\n callsInvalidated = true;\n }\n traverseInOrder(node[1]);\n traverseInOrder(node[2]);\n traverseInOrder(node[3]);\n } else if (type === 'switch') {\n traverseInOrder(node[1]);\n var originalTracked = {};\n for (var o in tracked) originalTracked[o] = 1;\n var cases = node[2];\n for (var i = 0; i < cases.length; i++) {\n var c = cases[i];\n assert(c[0] === null || c[0][0] === 'num' || (c[0][0] === 'unary-prefix' && c[0][2][0] === 'num'));\n var stats = c[1];\n for (var j = 0; j < stats.length; j++) {\n traverseInOrder(stats[j]);\n }\n // We cannot track from one switch case into another if there are external dependencies, undo all new trackings\n // Otherwise we can track, e.g. a var used in a case before assignment in another case is UB in asm.js, so no need for the assignment\n // TODO: general framework here, use in if-else as well\n for (var t in tracked) {\n if (!(t in originalTracked)) {\n var info = tracked[t];\n if (info.usesGlobals || info.usesMemory || info.hasDeps) {\n delete tracked[t];\n }\n }\n }\n }\n tracked = {}; // do not track from inside the switch to outside\n } else {\n if (!(type in ABORTING_ELIMINATOR_SCAN_NODES)) {\n printErr('unfamiliar eliminator scan node: ' + JSON.stringify(node));\n }\n tracked = {};\n abort = true;\n }\n //nesting--; // printErr-related\n }\n traverseInOrder(node);\n }", "title": "" }, { "docid": "f5b916afdd3e3b65b16532195e61066d", "score": "0.40467176", "text": "function walkAST(node, parent) {\n\t\t\tif (!node)\n\t\t\t\treturn;\n\t\t\tfor (var key in node) {\n\t\t\t\tif (key === 'range')\n\t\t\t\t\tcontinue;\n\t\t\t\tvar value = node[key];\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tfor (var i = 0, l = value.length; i < l; i++)\n\t\t\t\t\t\twalkAST(value[i], node);\n\t\t\t\t} else if (value && typeof value === 'object') {\n\t\t\t\t\t// We cannot use Base.isPlainObject() for these since\n\t\t\t\t\t// Acorn.js uses its own internal prototypes now.\n\t\t\t\t\twalkAST(value, node);\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch (node && node.type) {\n\t\t\tcase 'BinaryExpression':\n\t\t\t\tif (node.operator in binaryOperators\n\t\t\t\t\t\t&& node.left.type !== 'Literal') {\n\t\t\t\t\tvar left = getCode(node.left),\n\t\t\t\t\t\tright = getCode(node.right);\n\t\t\t\t\treplaceCode(node, '_$_(' + left + ', \"' + node.operator\n\t\t\t\t\t\t\t+ '\", ' + right + ')');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'AssignmentExpression':\n\t\t\t\tif (/^.=$/.test(node.operator)\n\t\t\t\t\t\t&& node.left.type !== 'Literal') {\n\t\t\t\t\tvar left = getCode(node.left),\n\t\t\t\t\t\tright = getCode(node.right);\n\t\t\t\t\treplaceCode(node, left + ' = _$_(' + left + ', \"'\n\t\t\t\t\t\t\t+ node.operator[0] + '\", ' + right + ')');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UpdateExpression':\n\t\t\t\tif (!node.prefix && !(parent && (\n\t\t\t\t\t\t// We need to filter out parents that are comparison\n\t\t\t\t\t\t// operators, e.g. for situations like if (++i < 1),\n\t\t\t\t\t\t// as we can't replace that with if (_$_(i, \"+\", 1) < 1)\n\t\t\t\t\t\t// Match any operator beginning with =, !, < and >.\n\t\t\t\t\t\tparent.type === 'BinaryExpression'\n\t\t\t\t\t\t\t&& /^[=!<>]/.test(parent.operator)\n\t\t\t\t\t\t// array[i++] is a MemberExpression with computed = true\n\t\t\t\t\t\t// We can't replace that with array[_$_(i, \"+\", 1)].\n\t\t\t\t\t\t|| parent.type === 'MemberExpression'\n\t\t\t\t\t\t\t&& parent.computed))) {\n\t\t\t\t\tvar arg = getCode(node.argument);\n\t\t\t\t\treplaceCode(node, arg + ' = _$_(' + arg + ', \"'\n\t\t\t\t\t\t\t+ node.operator[0] + '\", 1)');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UnaryExpression':\n\t\t\t\tif (node.operator in unaryOperators\n\t\t\t\t\t\t&& node.argument.type !== 'Literal') {\n\t\t\t\t\tvar arg = getCode(node.argument);\n\t\t\t\t\treplaceCode(node, '$_(\"' + node.operator + '\", '\n\t\t\t\t\t\t\t+ arg + ')');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5bb8e938e1600c5ca64dc722d5899a0b", "score": "0.40444088", "text": "function dpll(clauses,maxvarnr,trace,varnames) {\r\n var varvals,occvars,posbuckets,negbuckets,derived,tmp;\r\n var i,res,txt;\r\n // store trace and origvars to globals\r\n if (trace) { trace_flag=true; trace_method=trace; }\r\n else { trace_flag=false; }\r\n if (varnames) origvars=varnames;\r\n else origvars=false;\r\n // zero statistics and trace globals\r\n unit_propagations_count=0;\r\n var_selections_count=0;\r\n units_derived_count=0;\r\n pure_derived_count=0;\r\n clauses_removed_count=0;\r\n max_depth_count=0;\r\n trace_list=[];\r\n result_model=[];\r\n // First add two meta-info els to the beginning of each clause:\r\n // the two meta-elements are later used for clause signature during optional\r\n // simplification and as watched literal pointers in the proper dpll search.\r\n // Also, get the nr of the largest variable in the clause set\r\n tmp=maxvar_and_meta(clauses);\r\n maxvarnr=tmp[0];\r\n clauses=tmp[1];\r\n // create the arrays used during search\r\n derived=new Int32Array(maxvarnr+1); // used for units derived during propagation\r\n // variable values are 0 if not set, 1 if positive, -1 if negative\r\n varvals=new Int32Array(maxvarnr+1);\r\n for(i=0;i<=maxvarnr;i++) varvals[i]=0;\r\n // array used while preprocessing to count occurrences\r\n occvars=new Int32Array(maxvarnr+1);\r\n // buckets where a var occurs positively\r\n posbuckets=new Array(maxvarnr+1);\r\n for(i=0;i<=maxvarnr;i++) posbuckets[i]=[];\r\n // buckets where a var occurs negatively\r\n negbuckets=new Array(maxvarnr+1);\r\n for(i=0;i<=maxvarnr;i++) negbuckets[i]=[];\r\n // var activities indicate which var to pick next: larger is better\r\n varactivities=new Array(maxvarnr+1);\r\n for(i=0;i<=maxvarnr;i++) varactivities[i]=1;\r\n\r\n // optional simplification: may be omitted\r\n\r\n clauses=simplify_clause_list(clauses,varvals,occvars,posbuckets,negbuckets,derived);\r\n if (clauses===false) { // contradiction found\r\n if (trace_flag) trace_list.push(\"contradiction found during simplification\");\r\n return [false,trace_list.join(\"\\r\\n\")];\r\n } else if (clauses.length===0) { // no clauses remaining: a model found\r\n store_model(varvals);\r\n if (trace_flag) trace_list.push(\"assignment found during simplification\");\r\n return [result_model,trace_list.join(\"\\r\\n\")];\r\n }\r\n\r\n // remove pure variables and build initial activities for vars\r\n clauses=count_occurrences(clauses,varvals,occvars,posbuckets,negbuckets,derived);\r\n if (clauses.length===0) { // no clauses remaining: a model found\r\n store_model(varvals);\r\n if (trace_flag) trace_list.push(\"assignment found during pure literal elimination\");\r\n return [result_model,trace_list.join(\"\\r\\n\")];\r\n }\r\n // assign clauses to buckets according to literal occurrences\r\n makebuckets(clauses,varvals,occvars,posbuckets,negbuckets,derived);\r\n\r\n /*\r\n txt=\"preprocessing finished: \"\r\n txt+=\", pure derived count is \"+pure_derived_count;\r\n txt+=\", clauses removed count is \"+clauses_removed_count+\".\";\r\n trace_list.push(txt);\r\n */\r\n\r\n // full search\r\n res=satisfiable_at(0,0,clauses,varvals,occvars,posbuckets,negbuckets,derived);\r\n\r\n txt=\"search finished: unit propagations count is \"+unit_propagations_count;\r\n txt+=\", units derived count is \"+units_derived_count;\r\n txt+=\", max depth is \"+max_depth_count;\r\n trace_list.push(txt);\r\n\r\n if (res) return [result_model,trace_list.join(\"\\r\\n\")];\r\n else return [false,trace_list.join(\"\\r\\n\")];\r\n}", "title": "" }, { "docid": "64cfa93a6153e635ecd63b47792f6d88", "score": "0.4040349", "text": "function updateTables(tree,newTables) {\n let newTree = JSON.parse(JSON.stringify(tree))\n let queryStr = \"SELECT * FROM\"\n\n var i\n //add all talbes to query string\n for(i = 0; i < newTables.length; i++) {\n if(i == 0) {\n queryStr += \" \" + newTables[i]\n }\n else {\n queryStr += \" NATURAL JOIN \" + newTables[i]\n }\n\n }\n let tempTree = parser.parse(queryStr)\n //deep copy of tempTree's FROM to newTree's FROM\n newTree.value.from = JSON.parse(JSON.stringify(tempTree.value.from))\n return newTree\n}", "title": "" }, { "docid": "ac1508dd3156756256dd7f4f239b874c", "score": "0.40098122", "text": "function undo(puzzle, undoStack, heuristicMatrix){\n\tvar action = undoStack.pop();\n\n\twhile(action){\n\t\t//circular shift right the domain of variable that was set\n\t\tpuzzle[action.i][action.j] = action.domain.slice(1);\n\t\tpuzzle[action.i][action.j].push(action.domain[0]);\n\n\t\t//restore the pruned domains of the vairables related to variable that was set\n\t\taction.constrained.forEach(function(elem){\n\t\t\tpuzzle[elem.loc[0]][elem.loc[1]].splice(elem.pos, 0, action.domain[0]);\n\t\t});\n\n\t\t//restore huerisitc data structure\n\t\tgetConstrained(action.i, action.j, function(elem){\n\t\t\theuristicMatrix[elem[0]][elem[1]]++;\n\t\t});\n\n\t\tif(action.isLast){//if domain is exhausted\n\t\t\taction = undoStack.pop();//undo again\n\t\t\tif(!action){//a variable could ne be set\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\taction = undefined;//stop undo operations\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "c2b673b63ca76d3fd586468df5f470cc", "score": "0.3996875", "text": "parseVarList() {\n const left = new SequenceExpression();\n const right = new SequenceExpression();\n while (true) {\n const exp = this.parseVar();\n if (exp === null) this.raiseUnexpectedTokErr(\"var-expr\");\n left.expressions.push(exp);\n let tok = this.lexer.peek();\n if (tok.isSign(Sign.Comma)) this.lexer.next();\n else break;\n }\n\n // if the ahead token is Assign and the subsequent expression is a expression-list\n // they together constructs a assignment-expression otherwise if there is only one child\n // of left.expressions and it's a CallExpression that also means succeeded\n let tok = this.lexer.peek();\n if (!tok.isSign(Sign.Assign) && left.expressions.length === 1) {\n const expr = left.expressions[0];\n if (expr instanceof CallExpression) {\n const node = new CallStatement();\n node.expr = expr;\n return node;\n }\n }\n this.nextMustBeSign(Sign.Assign);\n\n while (true) {\n const exp = this.parseExp();\n if (exp === null) this.raiseUnexpectedTokErr(\"expr\");\n right.expressions.push(exp);\n tok = this.lexer.peek();\n if (tok.isSign(Sign.Comma)) this.lexer.next();\n else break;\n }\n const node = new AssignStatement();\n const expr = new AssignExpression();\n expr.left = left;\n expr.right = right;\n node.expr = expr;\n return node;\n }", "title": "" }, { "docid": "9461ce134694d2ae732f62aaa9da34bb", "score": "0.39932105", "text": "function normalizeVarName(text){\n//Normalization for vars means: 1st char untouched, rest to to lower case.\n\n//By keeping 1st char untouched, we allow \"token\" and \"Token\" to co-exists in the same scope.\n//'token', by name affinity, will default to type:'Token'\n\n return fixSpecialNames(text.slice(0, 1) + text.slice(1).toLowerCase());\n }", "title": "" }, { "docid": "827c04c0066b27cf8de7e80765befe3a", "score": "0.39908564", "text": "function traverseInOrder(node, ignoreSub, ignoreName) {\n if (abort) return;\n //nesting++; // printErr-related\n //printErr(JSON.stringify(node).substr(0, 50) + ' : ' + keys(tracked) + ' : ' + [allowTracking, ignoreSub, ignoreName]);\n var type = node[0];\n if (type === 'assign') {\n var target = node[2];\n var value = node[3];\n var nameTarget = target[0] === 'name';\n traverseInOrder(target, true, nameTarget); // evaluate left\n traverseInOrder(value); // evaluate right\n // do the actual assignment\n if (nameTarget) {\n var name = target[1];\n if (!(name in potentials)) {\n if (!(name in varsToTryToRemove)) {\n // expensive check for invalidating specific tracked vars. This list is generally quite short though, because of\n // how we just eliminate in short spans and abort when control flow happens TODO: history numbers instead\n invalidateByDep(name); // can happen more than once per dep..\n if (!(name in locals) && !globalsInvalidated) {\n invalidateGlobals();\n globalsInvalidated = true;\n }\n // if we can track this name (that we assign into), and it has 0 uses and we want to remove its 'var'\n // definition - then remove it right now, there is no later chance\n if (allowTracking && (name in varsToRemove) && uses[name] === 0) {\n track(name, node[3], node);\n doEliminate(name, node);\n }\n } else {\n // replace it in-place\n node.length = value.length;\n for (var i = 0; i < value.length; i++) {\n node[i] = value[i];\n }\n varsToRemove[name] = 2;\n }\n } else {\n if (allowTracking) track(name, node[3], node);\n }\n } else if (target[0] === 'sub') {\n if (isTempDoublePtrAccess(target)) {\n if (!globalsInvalidated) {\n invalidateGlobals();\n globalsInvalidated = true;\n }\n } else if (!memoryInvalidated) {\n invalidateMemory();\n memoryInvalidated = true;\n }\n }\n } else if (type === 'sub') {\n traverseInOrder(node[1], false, !memSafe); // evaluate inner\n traverseInOrder(node[2]); // evaluate outer\n // ignoreSub means we are a write (happening later), not a read\n if (!ignoreSub && !isTempDoublePtrAccess(node)) {\n // do the memory access\n if (!callsInvalidated) {\n invalidateCalls();\n callsInvalidated = true;\n }\n }\n } else if (type === 'var') {\n var vars = node[1];\n for (var i = 0; i < vars.length; i++) {\n var name = vars[i][0];\n var value = vars[i][1];\n if (value) {\n traverseInOrder(value);\n if (name in potentials && allowTracking) {\n track(name, value, node);\n } else {\n invalidateByDep(name);\n }\n if (vars.length === 1 && name in varsToTryToRemove && value) {\n // replace it in-place\n value = ['stat', value];\n node.length = value.length;\n for (var i = 0; i < value.length; i++) {\n node[i] = value[i];\n }\n varsToRemove[name] = 2;\n }\n }\n }\n } else if (type === 'binary') {\n var flipped = false;\n if (node[1] in ASSOCIATIVE_BINARIES && !(node[2][0] in NAME_OR_NUM) && node[3][0] in NAME_OR_NUM) { // TODO recurse here?\n // associatives like + and * can be reordered in the simple case of one of the sides being a name, since we assume they are all just numbers\n var temp = node[2];\n node[2] = node[3];\n node[3] = temp;\n flipped = true;\n }\n traverseInOrder(node[2]);\n traverseInOrder(node[3]);\n if (flipped && node[2][0] in NAME_OR_NUM) { // dunno if we optimized, but safe to flip back - and keeps the code closer to the original and more readable\n var temp = node[2];\n node[2] = node[3];\n node[3] = temp;\n }\n } else if (type === 'name') {\n if (!ignoreName) { // ignoreName means we are the name of something like a call or a sub - irrelevant for us\n var name = node[1];\n if (name in tracked) {\n doEliminate(name, node);\n } else if (!(name in locals) && !callsInvalidated && (memSafe || !(name in HEAP_NAMES))) { // ignore HEAP8 etc when not memory safe, these are ok to\n // access, e.g. SIMD_Int32x4_load(HEAP8, ...)\n invalidateCalls();\n callsInvalidated = true;\n }\n }\n } else if (type === 'unary-prefix' || type === 'unary-postfix') {\n traverseInOrder(node[2]);\n } else if (type in IGNORABLE_ELIMINATOR_SCAN_NODES) {\n } else if (type === 'call') {\n traverseInOrder(node[1], false, true);\n var args = node[2];\n for (var i = 0; i < args.length; i++) {\n traverseInOrder(args[i]);\n }\n if (callHasSideEffects(node)) {\n // these two invalidations will also invalidate calls\n if (!globalsInvalidated) {\n invalidateGlobals();\n globalsInvalidated = true;\n }\n if (!memoryInvalidated) {\n invalidateMemory();\n memoryInvalidated = true;\n }\n }\n } else if (type === 'if') {\n if (allowTracking) {\n traverseInOrder(node[1]); // can eliminate into condition, but nowhere else\n if (!callsInvalidated) { // invalidate calls, since we cannot eliminate them into an if that may not execute!\n invalidateCalls();\n callsInvalidated = true;\n }\n\n allowTracking = false;\n traverseInOrder(node[2]); // 2 and 3 could be 'parallel', really..\n if (node[3]) traverseInOrder(node[3]);\n allowTracking = true;\n\n } else {\n tracked = {};\n }\n } else if (type === 'block') {\n var stats = node[1];\n if (stats) {\n for (var i = 0; i < stats.length; i++) {\n traverseInOrder(stats[i]);\n }\n }\n } else if (type === 'stat') {\n traverseInOrder(node[1]);\n } else if (type === 'label') {\n traverseInOrder(node[2]);\n } else if (type === 'seq') {\n traverseInOrder(node[1]);\n traverseInOrder(node[2]);\n } else if (type === 'do') {\n if (node[1][0] === 'num' && node[1][1] === 0) { // one-time loop\n traverseInOrder(node[2]);\n } else {\n tracked = {};\n }\n } else if (type === 'return') {\n if (node[1]) traverseInOrder(node[1]);\n } else if (type === 'conditional') {\n if (!callsInvalidated) { // invalidate calls, since we cannot eliminate them into a branch of an LLVM select/JS conditional that does not execute\n invalidateCalls();\n callsInvalidated = true;\n }\n traverseInOrder(node[1]);\n traverseInOrder(node[2]);\n traverseInOrder(node[3]);\n } else if (type === 'switch') {\n traverseInOrder(node[1]);\n var originalTracked = {};\n for (var o in tracked) originalTracked[o] = 1;\n var cases = node[2];\n for (var i = 0; i < cases.length; i++) {\n var c = cases[i];\n assert(c[0] === null || c[0][0] === 'num' || (c[0][0] === 'unary-prefix' && c[0][2][0] === 'num'));\n var stats = c[1];\n for (var j = 0; j < stats.length; j++) {\n traverseInOrder(stats[j]);\n }\n // We cannot track from one switch case into another if there are external dependencies, undo all new trackings\n // Otherwise we can track, e.g. a var used in a case before assignment in another case is UB in asm.js, so no need for the assignment\n // TODO: general framework here, use in if-else as well\n for (var t in tracked) {\n if (!(t in originalTracked)) {\n var info = tracked[t];\n if (info.usesGlobals || info.usesMemory || info.hasDeps) {\n delete tracked[t];\n }\n }\n }\n }\n tracked = {}; // do not track from inside the switch to outside\n } else {\n if (!(type in ABORTING_ELIMINATOR_SCAN_NODES)) {\n printErr('unfamiliar eliminator scan node: ' + JSON.stringify(node));\n }\n tracked = {};\n abort = true;\n }\n //nesting--; // printErr-related\n }", "title": "" }, { "docid": "e771062e765d5b9b4532febfb758fc75", "score": "0.39658612", "text": "function rebuildTree(node, visit) {\n if (!node) return;\n\n node = Object.assign({}, node);\n visit(node);\n\n function visitKey(key) {\n if (!node[key]) return;\n\n if (Array.isArray(node[key])) {\n node[key] = node[key].map(function (item) {\n return rebuildTree(item, visit);\n });\n } else\n node[key] = rebuildTree(node[key], visit);\n }\n\n switch (node.type) {\n case 'LocalStatement':\n case 'AssignmentStatement':\n visitKey('variables');\n visitKey('init');\n break;\n case 'UnaryExpression':\n visitKey('argument');\n break;\n case 'BinaryExpression':\n case 'LogicalExpression':\n visitKey('left');\n visitKey('right');\n break;\n case 'FunctionDeclaration':\n visitKey('identifier');\n visitKey('parameters');\n visitKey('body');\n break;\n case 'ForGenericStatement':\n visitKey('variables');\n visitKey('iterators');\n visitKey('body');\n break;\n case 'IfClause':\n case 'ElseifClause':\n case 'WhileStatement':\n case 'RepeatStatement':\n visitKey('condition');\n /* fall through */\n case 'Chunk':\n case 'ElseClause':\n case 'DoStatement':\n visitKey('body');\n visitKey('globals');\n visitKey('comments');\n break;\n case 'ForNumericStatement':\n visitKey('variable');\n visitKey('start');\n visitKey('end');\n visitKey('step');\n visitKey('body');\n break;\n case 'ReturnStatement':\n visitKey('arguments');\n break;\n case 'IfStatement':\n visitKey('clauses');\n break;\n case 'MemberExpression':\n visitKey('base');\n visitKey('identifier');\n break;\n case 'IndexExpression':\n visitKey('base');\n visitKey('index');\n break;\n case 'LabelStatement':\n visitKey('label');\n break;\n case 'CallStatement':\n visitKey('expression');\n break;\n case 'GotoStatement':\n visitKey('label');\n break;\n case 'TableConstructorExpression':\n visitKey('fields');\n break;\n case 'TableKey':\n case 'TableKeyString':\n visitKey('key');\n /* fall through */\n case 'TableValue':\n visitKey('value');\n break;\n case 'CallExpression':\n visitKey('base');\n visitKey('arguments');\n break;\n case 'TableCallExpression':\n visitKey('base');\n visitKey('arguments');\n break;\n case 'StringCallExpression':\n visitKey('base');\n visitKey('argument');\n break;\n case 'Identifier':\n case 'NumericLiteral':\n case 'BooleanLiteral':\n case 'StringLiteral':\n case 'NilLiteral':\n case 'VarargLiteral':\n case 'BreakStatement':\n case 'Comment':\n break;\n default:\n throw new Error('Unhandled ' + node.type);\n }\n\n return node;\n }", "title": "" }, { "docid": "d23914ba815a0d19a4e25b0e874620ca", "score": "0.39657357", "text": "function rewriteTree (tree, trunc, newpath) {\n tree.path = tree.path.substring(trunc);\n tree.path = newpath + tree.path;\n if (tree.children) {\n tree.children.map( child => {\n return rewriteTree(child, trunc, newpath);\n });\n }\n return tree;\n}", "title": "" }, { "docid": "7259cedf11fc15e00ac3b64870ae4082", "score": "0.39497352", "text": "function getVariables(node) {\n\n var vars = []\n function visit(node) {\n if(Array.isArray(node)) {\n for(var i=0; i<node.length; ++i) {\n visit(node[i])\n }\n } else {\n switch(node.type) {\n case \"EmptyStatement\":\n case \"ExpressionStatement\":\n case \"BreakStatement\":\n case \"ContinueStatement\":\n case \"ReturnStatement\":\n case \"ThrowStatement\":\n break\n\n case \"LabeledStatement\":\n case \"WithStatement\":\n case \"BlockStatement\":\n case \"WhileStatement\":\n case \"DoWhileStatement\":\n visit(node.body)\n break\n\n case \"TryStatement\":\n visit(node.block)\n if(node.handler) {\n visit(node.handler.body)\n }\n if(node.handlers && node.handlers.length > 0) {\n visit(node.handlers[0].body)\n }\n if(node.finalizer) {\n visit(node.finalizer)\n }\n break\n\n case \"IfStatement\":\n visit(node.consequent)\n if(node.alternate) {\n visit(node.alternate)\n }\n break\n\n case \"SwitchStatement\":\n for(var i=0; i<node.cases.length; ++i) {\n visit(node.cases[i].consequent)\n }\n break\n\n case \"ForStatement\":\n if(node.init && node.init.type === \"VariableDeclaration\") {\n visit(node.init)\n }\n visit(node.body)\n break\n\n case \"ForInStatement\":\n if(node.left.type === \"VariableDeclaration\") {\n visit(node.left)\n }\n visit(node.body)\n break\n\n case \"VariableDeclaration\":\n for(var i=0; i<node.declarations.length; ++i) {\n vars.push(node.declarations[i].id.name)\n }\n break\n\n case \"FunctionDeclaration\":\n vars.push(node.id.name)\n break\n\n default:\n throw new Error(\"control-flow: Unrecognized statement type \" + node.type)\n }\n }\n }\n visit(node)\n return uniq(vars)\n}", "title": "" }, { "docid": "521fe76e7095d77568907c9819824bf0", "score": "0.39469877", "text": "function replace_temp(start, old, index, nw) {\n\t\tvar i, j, ir, f;\n\n\t\tfor (i = start; i < irs.code.length; i++) {\n\t\t\tir = irs.code[i];\n\n\t\t\tfor (j = 0; j < glsl.IR.operands.length; j++) {\n\t\t\t\tf = glsl.IR.operands[j];\n\t\n\t\t\t\tif (ir[f] && ir[f].name == old && ir[f].offset == index) {\n\t\t\t\t\tir[f].name = nw;\n\t\t\t\t\tir[f].offset = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a5aae7d3c43d5f8aff9caeb39b6620fa", "score": "0.39357808", "text": "function processTree(ast) {\r\n var returnValue;\r\n if (ast.type == 'literal') {\r\n returnValue = isNaN(ast.value) ? ast.value : Number(ast.value);\r\n global.finalResult += ' ' + returnValue + ' ';\r\n } else if (ast.type == 'identifier') {\r\n //split in table and column\r\n var idParts = ast.name.split('.');\r\n returnValue = global[idParts[0]][idParts[1]];\r\n global.finalResult += ' ' + returnValue + ' ';\r\n } else {\r\n //recursive call\r\n global.finalResult += '(';\r\n var leftVal = processTree(ast.left);\r\n global.finalResult += ' ' + ast.operation + ' ';\r\n var rightVal = processTree(ast.right);\r\n global.finalResult += ')';\r\n returnValue = evaluate(ast.operation, leftVal, rightVal);\r\n }\r\n return returnValue;\r\n}", "title": "" }, { "docid": "64ffe4f46871ff89564ce194d57f7075", "score": "0.39355332", "text": "function removeUnusedVariableDeclarators (ast) {\n var unused = findUnusedVariableDeclarators(ast);\n traverse.traverse(ast, {\n enter: function (node, parent) {\n if (node.type !== 'VariableDeclaration') {\n return;\n }\n node.declarations = fast.filter(node.declarations, function (item) {\n return !~fast.indexOf(unused, item);\n });\n }\n });\n return ast;\n}", "title": "" }, { "docid": "090652b5a1b2fac32df09ddd551406be", "score": "0.39353716", "text": "function removeAssignsToUndefined(ast) {\n traverse(ast, function(node, type) {\n if (type === 'assign' && jsonCompare(node[3], ['unary-prefix', 'void', ['num', 0]])) {\n return emptyNode();\n } else if (type === 'var') {\n node[1] = node[1].map(function(varItem, j) {\n var ident = varItem[0];\n var value = varItem[1];\n if (jsonCompare(value, UNDEFINED_NODE)) return [ident];\n return [ident, value];\n });\n }\n });\n // cleanup (|x = y = void 0| leaves |x = ;| right now)\n var modified = true;\n while (modified) {\n modified = false;\n traverse(ast, function(node, type) {\n if (type === 'assign' && jsonCompare(node[3], emptyNode())) {\n modified = true;\n return emptyNode();\n } else if (type === 'var') {\n node[1] = node[1].map(function(varItem, j) {\n var ident = varItem[0];\n var value = varItem[1];\n if (value && jsonCompare(value, emptyNode())) return [ident];\n return [ident, value];\n });\n }\n });\n }\n}", "title": "" }, { "docid": "59791058fad203d03a8172f38936cff7", "score": "0.39329633", "text": "function substituteState(m) {\n\tfor (var name in m) {\n\t\tif(m.hasOwnProperty(name)) {\n\t\t\tvar prop = m[name];\n\t\t\tif ((typeof prop === 'string' || prop instanceof String) && prop.indexOf('$') !== -1) {\n\t\t\t\tvar chunks = prop.split(\"$\");\n\t\t\t\tfor (var i = 1; i < chunks.length; i++) {\n\t\t\t\t\tvar value = chunks[i];\n\t\t\t\t\tvar keys = chunks[i].split('.');\n\t\t\t\t\tvar first = true;\n\t\t\t\t\tvar obj;\n\t\t\t\t\tvar mod;\n\t\t\t\t\tfor(var j = 0; j < keys.length; j++) {\n\t\t\t\t\t\tvar varseg = keys[j];\n\t\t\t\t\t\tif (first) {\n\t\t\t\t\t\t\tvalue = History[substituteName(varseg)];\n\t\t\t\t\t\t\tif (undefined === value) {\t// No matching object, so substitute the key's value\n\t\t\t\t\t\t\t\tvalue = Names[varseg] || chunks[i];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (undefined !== value.obj) {\n\t\t\t\t\t\t\t\tobj = value.obj;\n\t\t\t\t\t\t\t\tif (undefined !== obj.mods & obj.mods.length === 1) {\n\t\t\t\t\t\t\t\t\tmod = obj.mods[0];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalue = (undefined !== mod && undefined !== mod[varseg]) ? mod[varseg] :\n\t\t\t\t\t\t\t\t(undefined !== obj && undefined !== obj[varseg]) ? obj[varseg] :\n\t\t\t\t\t\t\t\t\tvalue[varseg];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tchunks[i] = value;\n\t\t\t\t}\n\t\t\t\tif (chunks.length === 2 && chunks[0] === \"\") {\n\t\t\t\t\tm[name] = chunks[1];\t\t// This preserves integer types, which have no leading chars\n\t\t\t\t} else {\n\t\t\t\t\tm[name] = chunks.join(\"\");\t// For in-string substitutions. \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "319c97721f496eebc12bdf4d46809efc", "score": "0.3930987", "text": "function updateExpr() {\n const INPUT = { SET: [], REMOVE: [], ADD: [], DELETE: [] };\n const { valueRefs, nameRefs } = refsForUpdateExpr();\n let finishedExpr;\n\n function errorIfFinished() {\n if (finishedExpr) {\n throw new Error(\n 'expr() already called: cannot use clauses (set,remove,add,delete)'\n );\n }\n }\n\n return Object.create({\n set(obj) {\n errorIfFinished();\n INPUT.SET.push(...Object.entries(obj));\n return this;\n },\n remove(...names) {\n errorIfFinished();\n INPUT.REMOVE.push(...names);\n return this;\n },\n add(obj) {\n errorIfFinished();\n INPUT.ADD.push(...Object.entries(obj));\n return this;\n },\n delete(obj) {\n errorIfFinished();\n INPUT.DELETE.push(...Object.entries(obj));\n return this;\n },\n expr() {\n if (finishedExpr) {\n return finishedExpr;\n }\n const exprs = [];\n const refs = [];\n const out = [\n mkClause('SET', (name, ref) => `${name} = ${ref}`),\n mkClause0('REMOVE'),\n mkClause('ADD', (name, ref) => `${name} ${ref}`),\n mkClause('DELETE', (name, ref) => `${name} ${ref}`),\n ];\n for (const [e, r] of out) {\n if (e) { exprs.push(e); }\n refs.push(...r);\n }\n const result = { UpdateExpression: exprs.join(' ') };\n if (valueRefs.length) {\n result.ExpressionAttributeValues = Object.fromEntries(valueRefs.items);\n }\n if (nameRefs.length) {\n result.ExpressionAttributeNames = Object.fromEntries(nameRefs.items);\n }\n finishedExpr = result;\n return result;\n },\n });\n\n function mkClause0(clauseName) {\n const actions = INPUT[clauseName]\n .reduce((xs, str) => {\n str.indexOf(',') > -1 ? xs.push.apply(xs, str.split(',')) : xs.push(str);\n return xs;\n }, [])\n .map(key => isReservedKeyword(key) ? nameRefs.makeRef(key) : key);\n const clause = actions.length && `${clauseName} ${actions.join(', ')}`;\n return [clause, []];\n }\n\n function mkClause(clauseName, fnAction) {\n const keyVals = INPUT[clauseName];\n const [actions, refs] = mkActions(keyVals, fnAction);\n const clause = actions.length && `${clauseName} ${actions.join(', ')}`;\n return [clause, refs];\n }\n\n function mkActions(keyVals, fnAction) {\n const refs = [];\n const actions = keyVals\n .filter(([, val]) => typeof val !== 'undefined')\n .map(([key, val]) => {\n if (isReservedKeyword(key)) {\n const ref = nameRefs.makeRef(key);\n return [ref, val];\n }\n return [key, val];\n })\n .map(([key, val]) => {\n const ref = valueRefs.makeRef(val);\n return fnAction(key, ref);\n });\n return [actions, refs];\n }\n}", "title": "" }, { "docid": "9c5d234d17d3077819dcf00d48ce9785", "score": "0.39281172", "text": "renameParam(node, newNode) {\n var isNode, replacement;\n isNode = function(candidate) {\n return candidate === node;\n };\n replacement = (node, parent) => {\n var key;\n if (parent instanceof Obj) {\n key = node;\n if (node.this) {\n key = node.properties[0].name;\n }\n // No need to assign a new variable for the destructured variable if the variable isn't reserved.\n // Examples:\n // `({@foo}) ->` should compile to `({foo}) { this.foo = foo}`\n // `foo = 1; ({@foo}) ->` should compile to `foo = 1; ({foo:foo1}) { this.foo = foo1 }`\n if (node.this && key.value === newNode.value) {\n return new Value(newNode);\n } else {\n return new Assign(new Value(key), newNode, 'object');\n }\n } else {\n return newNode;\n }\n };\n return this.replaceInContext(isNode, replacement);\n }", "title": "" }, { "docid": "a62f7b3f2e3db6ecdca128da3bafc932", "score": "0.39131576", "text": "function mutate( parseTreeNode ) {\n\t\tvar id = parseTreeNode.parseTreeNodeId;\n\t\tswitch ( parseTreeNode[ 0 ] ) {\n\t\t\tcase \"noAutoescape\":\n\t\t\t\tshouldSanitize = FALSEY;\n\t\t\t\treturn \"\";\n\t\t\tcase \"=\": // Add escaping directives.\n\t\t\t\tif ( shouldSanitize ) {\n\t\t\t\t\tvar escapingModes = inferences.escapingModes[ id ];\n\t\t\t\t\tif ( escapingModes ) {\n\t\t\t\t\t\tvar expr = parseTreeNode[ 1 ];\n\t\t\t\t\t\tfor ( var i = 0; i < escapingModes.length; ++i ) {\n\t\t\t\t\t\t\texpr += \"=>$.encode\" + (\n\t\t\t\t\t\t\t\t\tDEBUG\n\t\t\t\t\t\t\t\t\t? \".\" + SANITIZER_FOR_ESC_MODE[ escapingModes[ i ] ].name\n\t\t\t\t\t\t\t\t\t: \"[\" + escapingModes[ i ] + \"]\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparseTreeNode[ 1 ] = expr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"tmpl\": case \"wrap\": // Rewrite calls in context.\n\t\t\t\tvar calleeName = inferences.calleeName[ id ];\n\t\t\t\tif ( calleeName ) {\n\t\t\t\t\t// The form of a {{tmpl}}'s content is\n\t\t\t\t\t// ['(' [<data>[, <options>]] ')'] '\"#'<name>'\"'\n\t\t\t\t\tparseTreeNode[ 1 ] = parseTreeNode[ 1 ].replace(\n\t\t\t\t\t\t\t/\"[^)\\s]*\"\\s*$/, JSON.stringify( calleeName ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tfor ( var i = 2, n = parseTreeNode.length; i < n; ++i ) {\n\t\t\tvar child = parseTreeNode[ i ];\n\t\t\tif ( typeof child !== \"string\" ) {\n\t\t\t\tparseTreeNode[ i ] = mutate( child );\n\t\t\t}\n\t\t}\n\t\treturn parseTreeNode;\n\t}", "title": "" }, { "docid": "a62f7b3f2e3db6ecdca128da3bafc932", "score": "0.39131576", "text": "function mutate( parseTreeNode ) {\n\t\tvar id = parseTreeNode.parseTreeNodeId;\n\t\tswitch ( parseTreeNode[ 0 ] ) {\n\t\t\tcase \"noAutoescape\":\n\t\t\t\tshouldSanitize = FALSEY;\n\t\t\t\treturn \"\";\n\t\t\tcase \"=\": // Add escaping directives.\n\t\t\t\tif ( shouldSanitize ) {\n\t\t\t\t\tvar escapingModes = inferences.escapingModes[ id ];\n\t\t\t\t\tif ( escapingModes ) {\n\t\t\t\t\t\tvar expr = parseTreeNode[ 1 ];\n\t\t\t\t\t\tfor ( var i = 0; i < escapingModes.length; ++i ) {\n\t\t\t\t\t\t\texpr += \"=>$.encode\" + (\n\t\t\t\t\t\t\t\t\tDEBUG\n\t\t\t\t\t\t\t\t\t? \".\" + SANITIZER_FOR_ESC_MODE[ escapingModes[ i ] ].name\n\t\t\t\t\t\t\t\t\t: \"[\" + escapingModes[ i ] + \"]\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparseTreeNode[ 1 ] = expr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"tmpl\": case \"wrap\": // Rewrite calls in context.\n\t\t\t\tvar calleeName = inferences.calleeName[ id ];\n\t\t\t\tif ( calleeName ) {\n\t\t\t\t\t// The form of a {{tmpl}}'s content is\n\t\t\t\t\t// ['(' [<data>[, <options>]] ')'] '\"#'<name>'\"'\n\t\t\t\t\tparseTreeNode[ 1 ] = parseTreeNode[ 1 ].replace(\n\t\t\t\t\t\t\t/\"[^)\\s]*\"\\s*$/, JSON.stringify( calleeName ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tfor ( var i = 2, n = parseTreeNode.length; i < n; ++i ) {\n\t\t\tvar child = parseTreeNode[ i ];\n\t\t\tif ( typeof child !== \"string\" ) {\n\t\t\t\tparseTreeNode[ i ] = mutate( child );\n\t\t\t}\n\t\t}\n\t\treturn parseTreeNode;\n\t}", "title": "" }, { "docid": "3ac09c7566b330e10c1baad7b6def19d", "score": "0.39043388", "text": "function change_effect_name() {\n var new_name = document.getElementById(\"neweffect\").value; //this is the new name\n var old_name = $(\"#select-result\").text();\n var name_cnt = 0; //count of draggables\n\n for (var j in count) {\n if (count[j].name == old_name) {\n name_cnt = count[j].cnt;\n }\n\n }\n\n if (new_name != old_name && new_name != '') //if new name is different from old name and new name is not empty\n {\n //update every draggable object\n if ($('#' + old_name + 'timeline').length) {\n for (var i = 0; i < name_cnt; ++i) {\n var id = $('#' + old_name + 'timeline').children().eq(i).attr('id').match(/\\d+/)[0];\n $('#' + old_name + 'timeline').children().eq(i).attr('id', new_name + id.toString());\n\n $('#' + old_name + 'timeline').children().eq(i).children().eq(0).html(new_name + id.toString());\n }\n $('#' + old_name + 'timeline').attr('id', new_name + 'timeline');\n }\n\n //update selectable list\n if ($('#e' + old_name).length) {\n $('#e' + old_name).html(new_name);\n $('#e' + old_name).attr('id', 'e' + new_name);\n }\n\n //update heap\n while (heap.size() != 0) {\n heap.pop();\n }\n\n\n //update count array\n for (var i in count) {\n if (count[i].name == old_name) {\n count[i].name = new_name;\n break;\n }\n }\n\n //update namestack\n arrayRemove(namestack, old_name);\n namestack.push(new_name);\n\n //update abstracteventstack\n for (var i in abstracteventstack) {\n if (abstracteventstack[i].name == old_name) {\n abstracteventstack[i].name = new_name;\n var cnt = abstracteventstack[i].id.match(/\\d+/)[0];\n abstracteventstack[i].id = new_name + cnt.toString();\n }\n }\n\n //update dictionary stack\n for (var i in dictstack) {\n if (dictstack[i].name == old_name) {\n dictstack[i].name = new_name;\n break;\n }\n\n }\n\n console.log(namestack);\n console.log(count);\n console.log(abstracteventstack);\n console.log(dictstack);\n }\n\n}", "title": "" }, { "docid": "fa3ac2d59f27f9e84dbaea42825344a8", "score": "0.38963038", "text": "function rewriteNumberRanges(path) {\n var node = path.node;\n\n\n node.expressions.forEach(function (expression, i) {\n if (isFullNumberRange(expression)) {\n path.getChild(i).replace({\n type: 'Char',\n value: '\\\\d',\n kind: 'meta'\n });\n }\n });\n}", "title": "" }, { "docid": "fa3ac2d59f27f9e84dbaea42825344a8", "score": "0.38963038", "text": "function rewriteNumberRanges(path) {\n var node = path.node;\n\n\n node.expressions.forEach(function (expression, i) {\n if (isFullNumberRange(expression)) {\n path.getChild(i).replace({\n type: 'Char',\n value: '\\\\d',\n kind: 'meta'\n });\n }\n });\n}", "title": "" }, { "docid": "9b73129d26096cd79c76b791a534a2ac", "score": "0.38717213", "text": "function fix_sortable_input_names(){\n $('#questions').find('li:not(.template, .trash)').find('input, select').each(function(idx, input){ \n //get the old name\n var old_name = $(input).attr('name');\n\n //fix top level order number...\n var farthest_li = $(input).parents('.sortable li').last();\n var top_order = farthest_li.siblings().andSelf().not('.trash, .template').index( farthest_li ); \n top_fixed = old_name;\n if(top_order > -1){\n var top_fixed = old_name.split('[').slice(0,1) + \"[\" + top_order + \"]\" + old_name.split(']').slice(1).join(']');\n }\n\n //fix sub-sortable specific order number. \n var nearest_li = $(input).parents('.sortable li').first();\n var bottom_order = nearest_li.siblings().andSelf().not('.trash, .template').index( nearest_li ); \n new_name = top_fixed;\n if(bottom_order > -1){\n var nesting = 2 * ($(input).parents('.sortable').length) - 1; \n var new_name = top_fixed.split('[').slice(0,nesting).join('[') + \"[\" + bottom_order + \"]\" + top_fixed.split(']').slice(nesting).join(']');\n }\n $(input).attr('name',new_name);\n });\n }", "title": "" }, { "docid": "979bf714c88be05c8d8be674663d3661", "score": "0.38714495", "text": "rewrite(iterations, start, rep) {\n var res = start;\n var temp = \"\";\n\n var replaceflag = false;\n\n // iterative expanding the string\n for (var i = 0; i < iterations; i++) {\n // go through the string\n for (var j = 0; j < res.length; j++) {\n replaceflag = false;\n // check every rules\n for (var k = 0; k < this.rules.length; k++) {\n if (res[j] == this.rules[k].lhs) {\n replaceflag = true;\n var replace = this.getRhs(res[j]);\n temp = temp + replace;\n }\n }\n if (!replaceflag) {\n temp = temp + res[j];\n }\n }\n res = temp;\n temp = \"\";\n }\n\n // replace certain string if needed\n if (rep.length > 0) {\n var repres = res;\n temp = \"\";\n replaceflag = false;\n\n for(var i = 0; i < repres.length; i++){\n \n replaceflag = false;\n for (var j = 0; j < rep.length; j++) {\n if (repres[i] == rep[j][0]) {\n replaceflag = true;\n temp = temp + rep[j][1];\n }\n }\n if (!replaceflag) {\n temp = temp + repres[i];\n }\n }\n return temp;\n }\n else {\n return res;\n }\n\n }", "title": "" }, { "docid": "82e1090d4a42fd21255cc6d466e9c0da", "score": "0.38707706", "text": "function explore(data) {\n\n\t// get a list of the variable names\n\tvar varNames = Object.keys(data[0]);\n\n\t// convert all categorical variables to numeric\n\t// if a column contains no numbers, find all unique values (other than \"NA\", \"\", or \".\") and assign a number\n\tvar n = data.length;\n\tvar p = varNames.length;\n\tvar categoricalVars = [];\n\t// loop over each column\n\tfor (j=0; j<p; j++) {\n\t\t// classify each observation in the column as missing, non-numeric, or numeric\n\t\tvar nMissing = 0;\n\t\tvar nNaN = 0;\n\t\tvar nNumeric = 0;\n\t\tvar varClass = data.map(function(d) {\n\t\t\tvar out;\n\t\t\tvar valueTmp = d[varNames[j]];\n\t\t\tif (valueTmp==\"\" | valueTmp==\".\" | valueTmp==\"NA\" | valueTmp==\"NaN\") {\n\t\t\t\tout = \"missing\";\n\t\t\t\tnMissing++;\n\t\t\t} else if (isNaN(valueTmp)) {\n\t\t\t\tout = \"non-numeric\";\n\t\t\t\tnNaN++;\n\t\t\t} else {\n\t\t\t\tout = \"numeric\";\n\t\t\t\tnNumeric++;\n\t\t\t}\n\t\t\treturn(out);\n\t\t});\n\t\t// if nNaN/n > 0.5, classify as a categorical variable. assign a number to each unique value\n\t\tif (nNaN/n > 0.5) {\n\t\t\tcategoricalVars.push(varNames[j]);\n\t\t\t// create an array for the jth variable\n\t\t\tvar tmpVar = data.map(function(d) {return(d[varNames[j]]);});\n\t\t\t// find the unique values\n\t\t\tvar unique = tmpVar.filter(function(item, i, ar){ return ar.indexOf(item) === i; }).sort();\n\t\t\t// assign each value of the variable to its index in the unique set of items\n\t\t\tvar numVar = tmpVar.map(function(d) {return(unique.indexOf(d));})\n\t\t\t// recode the variable\n\t\t\tfor (i=0; i<n; i++){\n\t\t\t\tdata[i][varNames[j]] = numVar[i];\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// display a message if any variables were identified as categorical\n\tif (categoricalVars.length > 0 & categoricalVars.length < 4) {\n\t\tcategoricalWarning.text('The following variables have been identified as categorical variables: ' + categoricalVars);\t\n\t} else if (categoricalVars.length > 3) {\n\t\tcategoricalWarning.text('Warning: ' + categoricalVars.length + ' columns were identified as categorical variables.');\n\t}\n\t\n\n\t// remove all rows with missing values\n\tvar missingRows = [];\n\tfor (i=0; i<n; i++) {\n\t\tfor (j=0; j<p; j++) {\n\t\t\tvar valueTmp = data[i][varNames[j]];\n\t\t\tif (valueTmp===\"\" | valueTmp==\".\" | valueTmp==\"NA\" | valueTmp==\"NaN\") {\n\t\t\t\tmissingRows.push(i+1);\n\t\t\t}\n\t\t}\n\t}\n\tvar uniqueRows = missingRows.filter(function(item, i, ar){ return ar.indexOf(item) === i; }).sort();\n\tvar newData = [];\n\tfor (i=0; i<n; i++) {\n\t\tif (uniqueRows.indexOf(i+1)===-1) {\n\t\t\tnewData.push(data[i]);\n\t\t}\n\t}\n\tdata = newData;\n\n\t// display a message if any rows were removed\n\tif (categoricalVars.length > 0 & categoricalVars.length < 4) {\n\t\tmissingnessWarning.text('The following observations have been removed due to missing data: ' + uniqueRows);\n\t} else if (categoricalVars.length > 3) {\n\t\tmissingnessWarning.text('Warning: ' + uniqueRows.length + ' observations were removed due to missing data.');\n\t}\n\t\n\n\n\t// remove all histogram bars and scatterplot points\n\td3.select('#histogram').selectAll('.bar').remove();\n\td3.select('#scatterplot').selectAll('.point').remove();\n\n\n // create a toolbar for switching the histogram variable (and y variable of scatterplot)\n var selector1 = makeSelector('selector1', data, varNames, 'histogram', 'translate(105,350)');\n\n // create a toolbar for switching the x variable of scatterplot\n var selector2 = makeSelector('selector2', data, varNames, 'scatterplot', 'translate(405,350)');\n\n\t// create crossfilter\n\t// var cf = crossfilter(data);\n\n\t// add bars with height 0 to the histogram\n\tvar bins = 10;\n\tvar barWidth = histWidth / bins;\n\td3.select('#histogram').selectAll('.bar')\n\t .data(Array(bins))\n\t .enter()\n\t .append('rect')\n\t .attr('class', 'bar')\n\t .attr('width', barWidth)\n\t .attr('height', 0)\n\t .attr('x', function (d, i) {return i * barWidth})\n\t .attr('y', histHeight)\n\t .attr('fill', 'steelblue')\n\t .attr('stroke', d3.rgb('steelblue').darker());\n\n\t// default to selecting the first column of the csv for the histogram and y axis of scatterplot\n\t// later the user will be able to try all the different variables\n\td3.select('#selector1').select('text').text(varNames[0]);\n\td3.select('#yAxisLabel').text(varNames[0]);\n\tvar y = data.map(function(d) {return +d[varNames[0]]});\n\tvar yMin = d3.min(y);\n\tvar yMax = d3.max(y);\n\tscatterScaleY = d3.scaleLinear().domain([Math.floor(yMin), Math.ceil(yMax)]).range([histHeight, 0]);\n\n\t// default to selecting the second column of the csv for the x axis of scatterplot\n\td3.select('#selector2').select('text').text(varNames[1]);\n\tvar x = data.map(function(d) {return +d[varNames[1]]});\n\tvar xMin = d3.min(x);\n\tvar xMax = d3.max(x);\n\tscatterScaleX = d3.scaleLinear().domain([Math.floor(xMin), Math.ceil(xMax)]).range([0, histWidth]);\n\n\t// add points to the scatterplot\n\tvar blankArray = Array(data.length);\n\td3.select('#scatterplot').selectAll(\".point\")\n\t\t.data(blankArray)\n\t\t.enter().append(\"circle\")\n\t\t.attr(\"class\", \"point\")\n\t\t.attr(\"r\", 3.5)\n\t\t.attr(\"cx\", function(d,i) {return(scatterScaleX(x[i]))})\n\t\t.attr(\"cy\", 0)\n\t\t.style(\"fill\", \"none\");\n\n\tupdateHist(y);\n\t\n\n} // end of explore", "title": "" }, { "docid": "6af2f42375669c7cb4cc4a1f1b3b98b3", "score": "0.38704684", "text": "function parseAST(str) {\n\tif (str == '') {\n\t\treturn undefined;\n\t}\n\n\t// removing everything to the left of the equal sign if present\n\tvar match = str.match(/(- : Ex\\.expr =)(.*)/);\n\tif (match) {\n\t\tstr = match[2].trim();\n\t}\n\n\t// removing \"Expr.\" from everything\n\tstr = str.replace(/Expr\\./g, '').trim();\n\n\tconsole.log(str);\n\t// pattern matching!\n\n\t// LetIn (\"x\", Int 2, Var \"x\")\n\tfunction parse(str) {\n\t\tstr = str.trim();\n\t\tif (!str) {\n\t\t\treturn null;\n\t\t}\n\t\tfor (var i = 0; i < patterns.length; i++) {\n\t\t\tif (patterns[i].test(str)) {\n\t\t\t\tvar match = str.match(patterns[i]);\n\t\t\t\tconsole.log(str + \" : \" + match[1]);\n\t\t\t\tvar newObj = {\n\t\t\t\t\tname: match[1],\n\t\t\t\t\tchildren: []\n\t\t\t\t};\n\t\t\t\tfor (var j = 2; j < match.length; j++) {\n\t\t\t\t\tvar child = parse(match[j]);\n\t\t\t\t\tif (child) {\n\t\t\t\t\t\tnewObj.children.push(child);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn newObj;\n\t\t\t}\n\t\t}\n\t\treturn {\"name\": \"ERROR. Unable to parse input\", children: []};\n\t}\n\n\treturn parse(str);\n}", "title": "" }, { "docid": "82af332d8598c8fbb0477b74f6aad76d", "score": "0.38646716", "text": "function build_constant_or_variable(orig){\n var tokens = orig.slice(0);\n var expression = null;\n var name = tokens.shift();\n if (name.classname === \"DottedName\"){\n expression = new ExpressionText(name, null);\n }\n else if (name.classname === \"ConstantText\"){\n expression = new ExpressionText(name, null);\n }\n else if (name.classname === 'Expressions'){\n // parenthesis inside parenthesis ((left + right))\n assert(name.values.length, 1);\n expression = name.values[0];\n }\n else{\n return [null, orig];\n }\n return [expression, tokens];\n}", "title": "" }, { "docid": "0fd203153120b702266f696b79badc7c", "score": "0.3863903", "text": "function rewrite(node, nstr) {\n var lo = node.range[0], hi = node.range[1]\n for(var i=lo+1; i<hi; ++i) {\n exploded[i] = \"\"\n }\n exploded[lo] = nstr\n }", "title": "" }, { "docid": "2296a9061e97f15cdf70b1c8f4de5768", "score": "0.3863386", "text": "function adjust(tree) {\n tree.body[0] = tree.body[0].expression.right;\n tree.end = tree.end - 2;\n tree.body = adjustPos(tree.body);\n }", "title": "" }, { "docid": "57699d3b2f71a2c6506f644dafb60732", "score": "0.38607013", "text": "function trans(ast){\n return match(ast[0],\n \t\t\t\"null\", function(){return \"null\";},\n\t\t\t\"true\", function(){return \"true\";},\n\t\t\t\"false\", function(){return \"false\";},\n\t\t\t\"number\", function(){return ast[1];},\n\t\t\t\"getVar\", function(){return ast[1];},\n\t\t\t\"getInstVar\", function(){return \"OO.getInstVar(this,\"+\"\\\"\"+ast[1]+\"\\\"\"+\")\";},\n\t\t\t\"exprStmt\", function(){return trans(ast[1])},\n\t\t\t\"send\", function(){var rest= ast.slice(1); return trans_send(rest);\n\t\t\t\t},\n\t\t\t\"setVar\", function(){ return ast[1] + \" = \" + trans(ast[2])},\n\t\t\t\"setInstVar\", function(){ return \"OO.setInstVar(this,\"+ \"\\\"\"+ast[1]+\"\\\"\"+\",\"+ trans(ast[2]) + \")\";\t\t\t\n\t\t\t },\n\t\t\t\"return\", function(){\n\t\t\t\tif(isInBlock === true){\n\t\t\t\t return \"OO.returnByError(\"+trans(ast[1])+\")\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t return \"return \"+ trans(ast[1]);\n\t\t\t\t},\n\t\t\t\"new\", function(){var rest= ast.slice(1); return trans_new(rest);},\n\t\t\t\"super\", function(){var rest= ast.slice(1); return trans_superSend(rest);},\n\t\t\t\"this\", function(){return \"_this\";},\n\t\t\t\"classDecl\", function(){var rest= ast.slice(1); return trans_classDecl(rest);\n\t\t\t },\n\t\t\t\"methodDecl\", function(){var rest= ast.slice(1); return trans_methodDecl(rest);\n\t\t\t },\n\t\t\t \"block\", function(){\n\t\t\t\t var trans_stmts = [];\n\t\t\t\t var ast_args = ast[1];\n\t\t\t\t var ast_stmts = ast[2];\n\t\t\t\t var ast_typeArr = [];\n\t\t\t\t isInBlock = true;\n\t\t\t\t for(var i=0;i<ast_stmts.length;i++){ //translate the stmts to String of javascript codes\n\t\t\t\t\ttrans_stmts = trans_stmts.concat([trans(ast_stmts[i])]);\n\t\t\t\t }\n\t\t\t\t isInBlock = false;\n\t\t\t\t //translate arg array to String format\n\t\t\t\t var ast_args_string = \"[\";\n\t\t\t\t for(var i=0; i<ast_args.length;i++){\n\t\t\t\t\t if(i!==0)\n\t\t\t\t\t ast_args_string += \",\";\n\t\t\t\t\t ast_args_string += \"\\\"\" + ast_args[i] + \"\\\"\";\n\t\t\t\t }\n\t\t\t\t ast_args_string += \"]\";\n\t\t\t\t //translate stmts to String format\n\t\t\t\t var ast_stmts_string = \"[\";\n\t\t\t\t var ast_stmts_string_inString = \"[\";\n\t\t\t\t for(var i=0; i<trans_stmts.length;i++){\n\t\t\t\t\t if(i!==0){\n\t\t\t\t\t ast_stmts_string += \",\";\n\t\t\t\t\t ast_stmts_string_inString += \",\";\n\t\t\t\t\t }\n\t\t\t\t\t ast_stmts_string_inString += \"\\\"\" + trans_stmts[i] + \"\\\"\";\n\t\t\t\t\t ast_stmts_string += trans_stmts[i];\n\t\t\t\t }\n\t\t\t\t ast_stmts_string += \"]\";\n\t\t\t\t ast_stmts_string_inString += \"]\";\n\t\t\t\t return \"OO.instantiate(\\\"Block\\\",\" + ast_args_string + \",\" /*+ ast_stmts_string+ \",\"*/ + ast_stmts_string_inString+\")\";\n\t\t\t\t },\n \t\t\t\"program\", function (){ var rest= ast.slice(1); \n\t\t\treturn trans_program(rest); },\n \t\t\t\"varDecls\", function(){ var rest= ast.slice(1); \n\t\t\treturn trans_varDecls(rest); }\n\t\t );\n}", "title": "" }, { "docid": "62b949b38186b42b4c4288b597707293", "score": "0.38567603", "text": "function apply (expr,operand,replacement) {\n\n // 如果lam != operand apply recursively replace $var to replacement\n if( expr[0] == \"lam\" && expr[1] == operand){\n return expr;\n }\n if( expr[0] == \"var\" && expr[1] == operand ){\n return replacement;\n }\n\n if( expr[0] == \"var\" ){\n return expr;\n }else if( expr[0] == \"app\" ){\n return [\"app\",apply(expr[1],operand,replacement),apply(expr[2],operand,replacement)];\n }else if( expr[0] == \"lam\" ){\n return [\"lam\",expr[1],apply(expr[2],operand,replacement)];\n }\n\n }", "title": "" }, { "docid": "511631b1f373c8b86bcd70c612ab4394", "score": "0.38565758", "text": "function renameMethod(node,num,ast){\n\t\n\tvar pastMethodName, newMethodName;\n\tif(node.id.type == 'Identifier'){\n\t\tconsole.log(node.id.name + ' method name is too short.');\n\t\tnewMethodName = \"renameMethod\"+ num;\n\t\tpastMethodName = node.id.name;\t\n\t\tnode.id.name = newMethodName;\n\t\tconsole.log(pastMethodName +' rename as ' + node.id.name);\n\t\trenameCallee(pastMethodName,newMethodName,ast);\n\t\n\t\tmethodNames[newMethodName] = pastMethodName;\n\t}\n}", "title": "" }, { "docid": "5c1f8bcf063c89d97068a8c99e7835c3", "score": "0.3847232", "text": "function simplifyIntegerConversions(ast) {\n traverse(ast, function(node, type) {\n if (type === 'binary' && node[1] === '>>' && node[3][0] === 'num' &&\n node[2][0] === 'binary' && node[2][1] === '<<' && node[2][3][0] === 'num' && node[3][1] === node[2][3][1]) {\n // Transform (x&A)<<B>>B to X&A.\n var innerNode = node[2][2];\n var shifts = node[3][1];\n if (innerNode[0] === 'binary' && innerNode[1] === '&' && innerNode[3][0] === 'num') {\n var mask = innerNode[3][1];\n if (mask << shifts >> shifts === mask) {\n return innerNode;\n }\n }\n } else if (type === 'binary' && (node[1] in BITWISE)) {\n for (var i = 2; i <= 3; i++) {\n var subNode = node[i];\n if (subNode[0] === 'binary' && subNode[1] === '&' && subNode[3][0] === 'num' && subNode[3][1] == 1) {\n // Rewrite (X < Y) & 1 to X < Y , when it is going into a bitwise operator. We could\n // remove even more (just replace &1 with |0, then subsequent passes could remove the |0)\n // but v8 issue #2513 means the code would then run very slowly in chrome.\n var input = subNode[2];\n if (input[0] === 'binary' && (input[1] in COMPARE_OPS)) {\n node[i] = input;\n }\n }\n }\n }\n });\n }", "title": "" }, { "docid": "527faefa3bdd50d239275a29cf19dfa6", "score": "0.3839504", "text": "function ProcessGroupLevel(groups, level, rhs){\n\t\tvar resGroups = []; // changed groups\n\t\tvar resNT = []; // new nonterminals\n\t\tfor (var i = 0; i < groups.length; i++){ // for each group of equal rules (until level)\n\t\t\tvar itemDic = {}; // build new sub-groups\n\t\t\tvar newNT = undefined; // maybe a new NT is created\n\t\t\tfor (var j = 0; j < groups[i].Idx.length; j++){ // check each rule in group\n\t\t\t\tvar item = rhs[groups[i].Idx[j]][0][level]; // get item at process-level\n\t\t\t\tif (item === undefined){ // no item at this level (=epsilon)\n\t\t\t\t\tif (level == 0) // at first level\n\t\t\t\t\t\tgroups[i].NT.rhs.push(rhs[groups[i].Idx[j]]); // keep the rule\n\t\t\t\t\telse{ // otherwise (occures only once per group)\n\t\t\t\t\t\tcnt++; // a new nt is required for all others in this group\n\t\t\t\t\t\tvar newname = \"F\"+cnt;\n\t\t\t\t\t\twhile(Names.indexOf(newname) != -1){\n\t\t\t\t\t\t\tcnt++;\n\t\t\t\t\t\t\tnewname = \"F\"+cnt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tNames.push(newname);\n\t\t\t\t\t\tnewNT = {name:newname, rhs:[[[],\"\"]]}; // with epsilon rule only\n\t\t\t\t\t\tvar newrhs = [rhs[groups[i].Idx[j]][0].slice(groups[i].Start),\"\"]; // take relevant part of the rule\n\t\t\t\t\t\tnewrhs[0].push({name:newNT.name, type:\"nt\"}); // append newNT\n\t\t\t\t\t\tgroups[i].NT.rhs.push(newrhs); // add new rule using new NT\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse { // valid expression item at this level\n\t\t\t\t\tif (itemDic[item.name] == undefined) // not occured until here\n\t\t\t\t\t\titemDic[item.name] = {Seq:groups[i].Seq+item.name, NT:groups[i].NT, Start:groups[i].Start, Idx:[]}; // new sub-group\n\t\t\t\t\titemDic[item.name].Idx.push(groups[i].Idx[j]); // append rule-index\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newGroups = []; // result groups (input for next level process)\n\t\t\tObject.keys(itemDic).forEach((name)=>{ // for each sub-group\n\t\t\t\tif (itemDic[name].Idx.length > 1) // real group with more than 1 element\n\t\t\t\t\tnewGroups.push(itemDic[name]); // processed in next level\n\t\t\t\telse{ // 1 element >> unique appearance \n\t\t\t\t\tif (level == 0) // at first level\n\t\t\t\t\t\tgroups[i].NT.rhs.push(rhs[itemDic[name].Idx[0]]); // keep the rule\n\t\t\t\t\telse{ // otherwise\n\t\t\t\t\t\tif (newNT === undefined){ // if there is no newNT already\n\t\t\t\t\t\t\tcnt++; // create a new one\n\t\t\t\t\t\t\tvar newname = \"F\"+cnt;\n\t\t\t\t\t\t\twhile(Names.indexOf(newname) != -1){\n\t\t\t\t\t\t\t\tcnt++;\n\t\t\t\t\t\t\t\tnewname = \"F\"+cnt;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tNames.push(newname);\n\t\t\t\t\t\t\tnewNT = {name:newname, rhs:[]}; // without epsilon rule\n\t\t\t\t\t\t\tvar newrhs = [rhs[itemDic[name].Idx[0]][0].slice(groups[i].Start, level),\"\"]; // take relevant part of the rule\n\t\t\t\t\t\t\tnewrhs[0].push({name:newNT.name, type:\"nt\"}); // append newNT\n\t\t\t\t\t\t\tgroups[i].NT.rhs.push(newrhs); // add new rule using new NT\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// append rest of current item to newNT\n\t\t\t\t\t\tvar newrhs = [rhs[itemDic[name].Idx[0]][0].slice(level),\"\"];\n\t\t\t\t\t\tnewNT.rhs.push(newrhs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (newNT != undefined) // if a new NT was created (never in level 0)\n\t\t\t\tresNT.push(newNT); // deliver it\n\t\t\tfor (var j = 0; j < newGroups.length; j++){ // iterate resulting groups\n\t\t\t\tif (newNT != undefined){ // if a new NT was created\n\t\t\t\t\tnewGroups[j].NT = newNT; // set it as base for remaining sub-groups\n\t\t\t\t\tnewGroups[j].Start = level; // remember level for relevant expression parts\n\t\t\t\t}\n\t\t\t\tresGroups.push(newGroups[j]); // add to result (input for next level)\n\t\t\t}\n\t\t}\n\t\t// adapt input array: hold next-level-groups now\n\t\tgroups.splice(0,groups.length);\n\t\tfor (var i = 0; i < resGroups.length; i++)\n\t\t\tgroups.push(resGroups[i]);\n\t\treturn resNT;\n\t}", "title": "" }, { "docid": "31c7543fc12753c12633547c2c4b72a6", "score": "0.38379535", "text": "findAssignedVariables(lineText, row, assignedVars) {\n const text = lineText.split('#')[0];\n const assignSplit = text.split('<<');\n const assignSplitLength = assignSplit.length;\n if (assignSplitLength < 2) return;\n\n let annoClasses = [];\n let annoSplit = lineText.split('# @class');\n if (annoSplit.length < 2) {\n annoSplit = lineText.split('#@class');\n }\n if (annoSplit.length > 1) {\n annoClasses = annoSplit[1].split(',').map((type) => type.trim());\n }\n const annoLength = annoClasses.length;\n\n let varCount = 0;\n let match;\n\n for (let i = 0; i < assignSplitLength - 1; i++) {\n let testString = assignSplit[i].split('(').slice(-1)[0];\n let startIndex = text.indexOf(testString);\n testString = magikUtils.removeStrings(testString);\n\n if (!/]\\s*$/.test(testString)) {\n while (match = magikUtils.VAR_TEST.exec(testString)) { // eslint-disable-line\n const varName = match[0];\n const varIndex = match.index;\n\n if (\n Number.isNaN(Number(varName)) &&\n testString[varIndex] !== '_' &&\n !magikUtils.VAR_IGNORE_PREV_CHARS.includes(\n testString[varIndex - 1]\n ) &&\n !magikUtils.ASSIGN_IGNORE_NEXT.test(\n testString.slice(varIndex + varName.length)\n )\n ) {\n const varData = assignedVars[varName];\n const index = text.indexOf(varName, startIndex);\n startIndex = index + 1;\n\n if (varData) {\n varData.row = row;\n varData.index = index;\n } else {\n const dynamic = /_dynamic\\s+$/.test(text.substr(0, index));\n let className;\n\n if (varCount < annoLength) {\n className = annoClasses[varCount];\n } else if (\n /^\\s*<<\\s*[a-zA-Z0-9_?!]+.new\\s*\\(/.test(\n text.slice(index + varName.length)\n )\n ) {\n className = magikUtils.nextWordInString(text, index);\n }\n\n assignedVars[varName] = {\n row,\n index,\n count: 1,\n dynamic,\n className,\n };\n\n varCount++;\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "329302169df8ddfea3712a3aff23c62e", "score": "0.38369942", "text": "function adjustRanks(graph, tree) {\n function dfs(p) {\n var children = tree.successors(p);\n children.forEach(function(c) {\n var minLen = minimumLength(graph, p, c);\n graph.node(c).rank = graph.node(p).rank + minLen;\n dfs(c);\n });\n }\n\n dfs(tree.graph().root);\n}", "title": "" }, { "docid": "86dc77c54f0c63513ce9cf175e4fb1c7", "score": "0.38335901", "text": "function rewriteQuery(intentionString) {\n const cachedContext = contextStore.get();\n const symbolTable = new Map();\n const localSymbolTable = new Map();\n // console.log('In rewrite query');\n // console.log(cachedContext);\n if (typeof cachedContext.variables !== 'undefined') {\n for (const variable of cachedContext.variables) {\n symbolTable.set(variable.name, eraseGenericType(variable.type));\n }\n }\n // Tokenize the intention string (may be URL encoded).\n const tokens = decodeURIComponent(intentionString.replace(/\\+/g, '%20')).split(/[\\s,]+/);\n const newTokens = [];\n for (const token of tokens) {\n if (symbolTable.has(token)) {\n let tokenType = symbolTable.get(token);\n localSymbolTable.set(token, tokenType);\n // !!Hack!! will eventually be handled by backend for type shortcuts.\n if (tokenType.startsWith('java.lang.')) {\n tokenType = tokenType.substr(10);\n }\n\n if (tokenType.startsWith('java.util.')) {\n tokenType = tokenType.substr(10);\n }\n\n newTokens.push(tokenType);\n } else {\n newTokens.push(token);\n }\n }\n\n return {\n intention: encodeURIComponent(newTokens.join(' ')),\n symbols: localSymbolTable,\n };\n }", "title": "" }, { "docid": "54fd58949b00ca974925fd7e5070b577", "score": "0.3831889", "text": "function apply(assignment, variables, clauses) {\n let clauseResults = [];\n for(const clause of clauses){\n // each clause is an array of strings\n let processed = [];\n\n for(const variable of clause){\n let varInt = parseInt(variable);\n let abs = Math.abs(varInt);\n let inAssignment = assignment[abs - 1];\n\n if(varInt < 0){\n // NOT it\n processed.push(!inAssignment);\n } else {\n // keep it as is\n processed.push(inAssignment);\n }\n }\n \n // OR between variables\n let done = false;\n\n for(const vResult of processed){\n if(vResult) {\n clauseResults.push(true);\n done = true;\n break;\n }\n }\n\n if (!done) clauseResults.push(false);\n }\n\n // do the ANDs between clauses\n for(const cResult of clauseResults){\n if(!cResult) return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "56faf7d8c784464f75571707de151a3a", "score": "0.38243976", "text": "function varargsRenamed( handler, funcName, self ) {\n var func = varargs();\n var src = String(func).replace(/^(function[\\s]*[^\\( ]*\\s*\\()/, 'function ' + funcName + '(');\n return eval('1 && ' + src);\n}", "title": "" }, { "docid": "5d3ff44915b0cd7df96affd3991b54a1", "score": "0.3812706", "text": "fixUpVariableReferences() {\n if (!this.runtime) return; // There's no runtime context to conflict with\n\n if (this.isStage) return; // Stage can't have variable conflicts with itself (and also can't be uploaded)\n\n const stage = this.runtime.getTargetForStage();\n if (!stage || !stage.variables) return;\n\n const renameConflictingLocalVar = (id, name, type) => {\n const conflict = stage.lookupVariableByNameAndType(name, type);\n\n if (conflict) {\n const newName = StringUtil.unusedName(\"\".concat(this.getName(), \": \").concat(name), this.getAllVariableNamesInScopeByType(type));\n this.renameVariable(id, newName);\n return newName;\n }\n\n return null;\n };\n\n const allReferences = this.blocks.getAllVariableAndListReferences();\n const unreferencedLocalVarIds = [];\n\n if (Object.keys(this.variables).length > 0) {\n for (const localVarId in this.variables) {\n if (!this.variables.hasOwnProperty(localVarId)) continue;\n if (!allReferences[localVarId]) unreferencedLocalVarIds.push(localVarId);\n }\n }\n\n const conflictIdsToReplace = Object.create(null);\n const conflictNamesToReplace = Object.create(null); // Cache the list of all variable names by type so that we don't need to\n // re-calculate this in every iteration of the following loop.\n\n const varNamesByType = {};\n\n const allVarNames = type => {\n const namesOfType = varNamesByType[type];\n if (namesOfType) return namesOfType;\n varNamesByType[type] = this.runtime.getAllVarNamesOfType(type);\n return varNamesByType[type];\n };\n\n for (const varId in allReferences) {\n // We don't care about which var ref we get, they should all have the same var info\n const varRef = allReferences[varId][0];\n const varName = varRef.referencingField.value;\n const varType = varRef.type;\n\n if (this.lookupVariableById(varId)) {\n // Found a variable with the id in either the target or the stage,\n // figure out which one.\n if (this.variables.hasOwnProperty(varId)) {\n // If the target has the variable, then check whether the stage\n // has one with the same name and type. If it does, then rename\n // this target specific variable so that there is a distinction.\n const newVarName = renameConflictingLocalVar(varId, varName, varType);\n\n if (newVarName) {\n // We are not calling this.blocks.updateBlocksAfterVarRename\n // here because it will search through all the blocks. We already\n // have access to all the references for this var id.\n allReferences[varId].map(ref => {\n ref.referencingField.value = newVarName;\n return ref;\n });\n }\n }\n } else {\n // We didn't find the referenced variable id anywhere,\n // Treat it as a reference to a global variable (from the original\n // project this sprite was exported from).\n // Check for whether a global variable of the same name and type exists,\n // and if so, track it to merge with the existing global in a second pass of the blocks.\n const existingVar = stage.lookupVariableByNameAndType(varName, varType);\n\n if (existingVar) {\n if (!conflictIdsToReplace[varId]) {\n conflictIdsToReplace[varId] = existingVar.id;\n }\n } else {\n // A global variable with the same name did not already exist,\n // create a new one such that it does not conflict with any\n // names of local variables of the same type.\n const allNames = allVarNames(varType);\n const freshName = StringUtil.unusedName(varName, allNames);\n stage.createVariable(varId, freshName, varType);\n\n if (!conflictNamesToReplace[varId]) {\n conflictNamesToReplace[varId] = freshName;\n }\n }\n }\n } // Rename any local variables that were missed above because they aren't\n // referenced by any blocks\n\n\n for (const id in unreferencedLocalVarIds) {\n const varId = unreferencedLocalVarIds[id];\n const name = this.variables[varId].name;\n const type = this.variables[varId].type;\n renameConflictingLocalVar(varId, name, type);\n } // Handle global var conflicts with existing global vars (e.g. a sprite is uploaded, and has\n // blocks referencing some variable that the sprite does not own, and this\n // variable conflicts with a global var)\n // In this case, we want to merge the new variable referenes with the\n // existing global variable\n\n\n for (const conflictId in conflictIdsToReplace) {\n const existingId = conflictIdsToReplace[conflictId];\n const referencesToUpdate = allReferences[conflictId];\n this.mergeVariables(conflictId, existingId, referencesToUpdate);\n } // Handle global var conflicts existing local vars (e.g a sprite is uploaded,\n // and has blocks referencing some variable that the sprite does not own, and this\n // variable conflcits with another sprite's local var).\n // In this case, we want to go through the variable references and update\n // the name of the variable in that reference.\n\n\n for (const conflictId in conflictNamesToReplace) {\n const newName = conflictNamesToReplace[conflictId];\n const referencesToUpdate = allReferences[conflictId];\n referencesToUpdate.map(ref => {\n ref.referencingField.value = newName;\n return ref;\n });\n }\n }", "title": "" }, { "docid": "871979d8d94c9ca8a97c35f85443b93f", "score": "0.3807563", "text": "function swapNodes(indexes, queries) {\n /*\n * Write your code here.\n */\n console.log(indexes)\n console.log(queries)\n const root = create_tree(new Node(1), indexes);\n // let path = traverse(root).join(' ');\n // console.log(path);\n queries.forEach((swap_level) => {\n foo(root, swap_level);\n let path = traverse_2(root).join(' ');\n console.log(path);\n })\n // console.log(JSON.stringify(root, null, 2));\n}", "title": "" }, { "docid": "0dc5863565930d240d05a0d13c8078a3", "score": "0.38005129", "text": "function simplifyOps(ast) {\n var SAFE_BINARY_OPS;\n if (asm) {\n SAFE_BINARY_OPS = set('+', '-'); // division is unsafe as it creates non-ints in JS; mod is unsafe as signs matter so we can't remove |0's; mul does not nest with +,- in asm\n } else {\n SAFE_BINARY_OPS = set('+', '-', '*');\n }\n var COERCION_REQUIRING_OPS = set('sub', 'unary-prefix'); // ops that in asm must be coerced right away\n var COERCION_REQUIRING_BINARIES = set('*', '/', '%'); // binary ops that in asm must be coerced\n var ZERO = ['num', 0];\n\n function removeMultipleOrZero() {\n var rerun = true;\n while (rerun) {\n rerun = false;\n var stack = [];\n traverse(ast, function process(node, type) {\n if (type === 'binary' && node[1] === '|') {\n if (node[2][0] === 'num' && node[3][0] === 'num') {\n node[2][1] |= node[3][1];\n stack.push(0);\n return node[2];\n }\n var go = false;\n if (jsonCompare(node[2], ZERO)) {\n // canonicalize order\n var temp = node[3];\n node[3] = node[2];\n node[2] = temp;\n go = true;\n } else if (jsonCompare(node[3], ZERO)) {\n go = true;\n }\n if (!go) {\n stack.push(1);\n return;\n }\n // We might be able to remove this correction\n for (var i = stack.length-1; i >= 0; i--) {\n if (stack[i] >= 1) {\n if (asm) {\n if (stack[stack.length-1] < 2 && node[2][0] === 'call') break; // we can only remove multiple |0s on these\n if (stack[stack.length-1] < 1 && (node[2][0] in COERCION_REQUIRING_OPS ||\n (node[2][0] === 'binary' && node[2][1] in COERCION_REQUIRING_BINARIES))) break; // we can remove |0 or >>2\n }\n // we will replace ourselves with the non-zero side. Recursively process that node.\n var result = jsonCompare(node[2], ZERO) ? node[3] : node[2], other;\n // replace node in-place\n node.length = result.length;\n for (var j = 0; j < result.length; j++) {\n node[j] = result[j];\n }\n rerun = true;\n return process(result, result[0]);\n } else if (stack[i] === -1) {\n break; // Too bad, we can't\n }\n }\n stack.push(2); // From here on up, no need for this kind of correction, it's done at the top\n // (Add this at the end, so it is only added if we did not remove it)\n } else if (type === 'binary' && node[1] in USEFUL_BINARY_OPS) {\n stack.push(1);\n } else if ((type === 'binary' && node[1] in SAFE_BINARY_OPS) || type === 'num' || type === 'name') {\n stack.push(0); // This node is safe in that it does not interfere with this optimization\n } else if (type === 'unary-prefix' && node[1] === '~') {\n stack.push(1);\n } else {\n stack.push(-1); // This node is dangerous! Give up if you see this before you see '1'\n }\n }, function() {\n stack.pop();\n });\n }\n }\n\n removeMultipleOrZero();\n\n // & and heap-related optimizations\n\n var hasTempDoublePtr = false, rerunOrZeroPass = false;\n\n traverse(ast, function(node, type) {\n // The \"pre\" visitor. Useful for detecting trees which should not\n // be simplified.\n if (type == 'sub' && node[1][0] == 'name' && isFunctionTable(node[1][1])) {\n return null; // do not traverse subchildren here, we should not collapse 55 & 126.\n }\n }, function(node, type) {\n // The \"post\" visitor. The simplifications are done in this visitor so\n // that we simplify a node's operands before the node itself. This allows\n // optimizations to cascade.\n if (type === 'name') {\n if (node[1] === 'tempDoublePtr') hasTempDoublePtr = true;\n } else if (type === 'binary' && node[1] === '&' && node[3][0] === 'num') {\n if (node[2][0] === 'num') return ['num', node[2][1] & node[3][1]];\n var input = node[2];\n var amount = node[3][1];\n if (input[0] === 'binary' && input[1] === '&' && input[3][0] === 'num') {\n // Collapse X & 255 & 1\n node[3][1] = amount & input[3][1];\n node[2] = input[2];\n } else if (input[0] === 'sub' && input[1][0] === 'name') {\n // HEAP8[..] & 255 => HEAPU8[..]\n var name = input[1][1];\n if (parseHeap(name)) {\n if (amount === Math.pow(2, parseHeapTemp.bits)-1) {\n if (!parseHeapTemp.unsigned) {\n input[1][1] = 'HEAPU' + parseHeapTemp.bits; // make unsigned\n }\n if (asm) {\n // we cannot return HEAPU8 without a coercion, but at least we do HEAP8 & 255 => HEAPU8 | 0\n node[1] = '|';\n node[3][1] = 0;\n return node;\n }\n return input;\n }\n }\n } else if (input[0] === 'binary' && input[1] === '>>' &&\n input[2][0] === 'binary' && input[2][1] === '<<' &&\n input[2][3][0] === 'num' && input[3][0] === 'num' &&\n input[2][3][1] === input[3][1] &&\n (~(-1 >>> input[3][1]) & amount) == 0) {\n // x << 24 >> 24 & 255 => x & 255\n return ['binary', '&', input[2][2], node[3]];\n }\n } else if (type === 'binary' && node[1] === '^') {\n // LLVM represents bitwise not as xor with -1. Translate it back to an actual bitwise not.\n if (node[3][0] === 'unary-prefix' && node[3][1] === '-' && node[3][2][0] === 'num' &&\n node[3][2][1] === 1 &&\n !(node[2][0] == 'unary-prefix' && node[2][1] == '~')) { // avoid creating ~~~ which is confusing for asm given the role of ~~\n return ['unary-prefix', '~', node[2]];\n }\n } else if (type === 'binary' && node[1] === '>>' && node[3][0] === 'num' &&\n node[2][0] === 'binary' && node[2][1] === '<<' && node[2][3][0] === 'num' &&\n node[2][2][0] === 'sub' && node[2][2][1][0] === 'name') {\n // collapse HEAPU?8[..] << 24 >> 24 etc. into HEAP8[..] | 0\n var amount = node[3][1];\n var name = node[2][2][1][1];\n if (amount === node[2][3][1] && parseHeap(name)) {\n if (parseHeapTemp.bits === 32 - amount) {\n node[2][2][1][1] = 'HEAP' + parseHeapTemp.bits;\n node[1] = '|';\n node[2] = node[2][2];\n node[3][1] = 0;\n rerunOrZeroPass = true;\n return node;\n }\n }\n } else if (type === 'assign') {\n // optimizations for assigning into HEAP32 specifically\n if (node[1] === true && node[2][0] === 'sub' && node[2][1][0] === 'name') {\n if (node[2][1][1] === 'HEAP32') {\n // HEAP32[..] = x | 0 does not need the | 0 (unless it is a mandatory |0 of a call)\n if (node[3][0] === 'binary' && node[3][1] === '|') {\n if (node[3][2][0] === 'num' && node[3][2][1] === 0 && node[3][3][0] != 'call') {\n node[3] = node[3][3];\n } else if (node[3][3][0] === 'num' && node[3][3][1] === 0 && node[3][2][0] != 'call') {\n node[3] = node[3][2];\n }\n }\n } else if (node[2][1][1] === 'HEAP8') {\n // HEAP8[..] = x & 0xff does not need the & 0xff\n if (node[3][0] === 'binary' && node[3][1] === '&' && node[3][3][0] == 'num' && node[3][3][1] == 0xff) {\n node[3] = node[3][2];\n }\n } else if (node[2][1][1] === 'HEAP16') {\n // HEAP16[..] = x & 0xffff does not need the & 0xffff\n if (node[3][0] === 'binary' && node[3][1] === '&' && node[3][3][0] == 'num' && node[3][3][1] == 0xffff) {\n node[3] = node[3][2];\n }\n }\n }\n var value = node[3];\n if (value[0] === 'binary' && value[1] === '|') {\n // canonicalize order of |0 to end\n if (value[2][0] === 'num' && value[2][1] === 0) {\n var temp = value[2];\n value[2] = value[3];\n value[3] = temp;\n }\n // if a seq ends in an |0, remove an external |0\n // note that it is only safe to do this in assigns, like we are doing here (return (x, y|0); is not valid)\n if (value[2][0] === 'seq' && value[2][2][0] === 'binary' && value[2][2][1] in USEFUL_BINARY_OPS) {\n node[3] = value[2];\n }\n }\n } else if (type === 'binary' && node[1] === '>>' && node[2][0] === 'num' && node[3][0] === 'num') {\n // optimize num >> num, in asm we need this since we do not optimize shifts in asm.js\n node[0] = 'num';\n node[1] = node[2][1] >> node[3][1];\n node.length = 2;\n return node;\n } else if (type === 'binary' && node[1] === '+') {\n // The most common mathop is addition, e.g. in getelementptr done repeatedly. We can join all of those,\n // by doing (num+num) ==> newnum.\n if (node[2][0] === 'num' && node[3][0] === 'num') {\n node[2][1] += node[3][1];\n return node[2];\n }\n }\n });\n\n if (rerunOrZeroPass) removeMultipleOrZero();\n\n if (asm) {\n if (hasTempDoublePtr) {\n var asmData = normalizeAsm(ast);\n traverse(ast, function(node, type) {\n if (type === 'assign') {\n if (node[1] === true && node[2][0] === 'sub' && node[2][1][0] === 'name' && node[2][1][1] === 'HEAP32') {\n // remove bitcasts that are now obviously pointless, e.g.\n // HEAP32[$45 >> 2] = HEAPF32[tempDoublePtr >> 2] = ($14 < $28 ? $14 : $28) - $42, HEAP32[tempDoublePtr >> 2] | 0;\n var value = node[3];\n if (value[0] === 'seq' && value[1][0] === 'assign' && value[1][2][0] === 'sub' && value[1][2][1][0] === 'name' && value[1][2][1][1] === 'HEAPF32' &&\n value[1][2][2][0] === 'binary' && value[1][2][2][2][0] === 'name' && value[1][2][2][2][1] === 'tempDoublePtr') {\n // transform to HEAPF32[$45 >> 2] = ($14 < $28 ? $14 : $28) - $42;\n node[2][1][1] = 'HEAPF32';\n node[3] = value[1][3];\n }\n }\n } else if (type === 'seq') {\n // (HEAP32[tempDoublePtr >> 2] = HEAP32[$37 >> 2], +HEAPF32[tempDoublePtr >> 2])\n // ==>\n // +HEAPF32[$37 >> 2]\n if (node[0] === 'seq' && node[1][0] === 'assign' && node[1][2][0] === 'sub' && node[1][2][1][0] === 'name' &&\n (node[1][2][1][1] === 'HEAP32' || node[1][2][1][1] === 'HEAPF32') &&\n node[1][2][2][0] === 'binary' && node[1][2][2][2][0] === 'name' && node[1][2][2][2][1] === 'tempDoublePtr' &&\n node[1][3][0] === 'sub' && node[1][3][1][0] === 'name' && (node[1][3][1][1] === 'HEAP32' || node[1][3][1][1] === 'HEAPF32') &&\n node[2][0] !== 'seq') { // avoid (x, y, z) which can be used for tempDoublePtr on doubles for alignment fixes\n if (node[1][2][1][1] === 'HEAP32') {\n node[1][3][1][1] = 'HEAPF32';\n return makeAsmCoercion(node[1][3], detectType(node[2]));\n } else {\n node[1][3][1][1] = 'HEAP32';\n return ['binary', '|', node[1][3], ['num', 0]];\n }\n }\n }\n });\n\n // finally, wipe out remaining ones by finding cases where all assignments to X are bitcasts, and all uses are writes to\n // the other heap type, then eliminate the bitcast\n var bitcastVars = {};\n traverse(ast, function(node, type) {\n if (type === 'assign' && node[1] === true && node[2][0] === 'name') {\n var value = node[3];\n if (value[0] === 'seq' && value[1][0] === 'assign' && value[1][2][0] === 'sub' && value[1][2][1][0] === 'name' &&\n (value[1][2][1][1] === 'HEAP32' || value[1][2][1][1] === 'HEAPF32') &&\n value[1][2][2][0] === 'binary' && value[1][2][2][2][0] === 'name' && value[1][2][2][2][1] === 'tempDoublePtr') {\n var name = node[2][1];\n if (!bitcastVars[name]) bitcastVars[name] = {\n define_HEAP32: 0, define_HEAPF32: 0, use_HEAP32: 0, use_HEAPF32: 0, bad: false, namings: 0, defines: [], uses: []\n };\n bitcastVars[name]['define_' + value[1][2][1][1]]++;\n bitcastVars[name].defines.push(node);\n }\n }\n });\n traverse(ast, function(node, type) {\n if (type === 'name' && bitcastVars[node[1]]) {\n bitcastVars[node[1]].namings++;\n } else if (type === 'assign' && node[1] === true) {\n var value = node[3];\n if (value[0] === 'name') {\n var name = value[1];\n if (bitcastVars[name]) {\n var target = node[2];\n if (target[0] === 'sub' && target[1][0] === 'name' && (target[1][1] === 'HEAP32' || target[1][1] === 'HEAPF32')) {\n bitcastVars[name]['use_' + target[1][1]]++;\n bitcastVars[name].uses.push(node);\n }\n }\n }\n }\n });\n for (var v in bitcastVars) {\n var info = bitcastVars[v];\n // good variables define only one type, use only one type, have definitions and uses, and define as a different type than they use\n if (info.define_HEAP32*info.define_HEAPF32 === 0 && info.use_HEAP32*info.use_HEAPF32 === 0 &&\n info.define_HEAP32+info.define_HEAPF32 > 0 && info.use_HEAP32+info.use_HEAPF32 > 0 &&\n info.define_HEAP32*info.use_HEAP32 === 0 && info.define_HEAPF32*info.use_HEAPF32 === 0 &&\n v in asmData.vars && info.namings === info.define_HEAP32+info.define_HEAPF32+info.use_HEAP32+info.use_HEAPF32) {\n var correct = info.use_HEAP32 ? 'HEAPF32' : 'HEAP32';\n info.defines.forEach(function(define) {\n define[3] = define[3][1][3];\n if (correct === 'HEAP32') {\n define[3] = ['binary', '|', define[3], ['num', 0]];\n } else {\n define[3] = makeAsmCoercion(define[3], asmPreciseF32 ? ASM_FLOAT : ASM_DOUBLE);\n }\n // do we want a simplifybitops on the new values here?\n });\n info.uses.forEach(function(use) {\n use[2][1][1] = correct;\n });\n var correctType;\n switch(asmData.vars[v]) {\n case ASM_INT: correctType = asmPreciseF32 ? ASM_FLOAT : ASM_DOUBLE; break;\n case ASM_FLOAT: case ASM_DOUBLE: correctType = ASM_INT; break;\n }\n asmData.vars[v] = correctType;\n }\n }\n denormalizeAsm(ast, asmData);\n }\n }\n }", "title": "" }, { "docid": "23f417a63f424d53d3ad53057d3fe287", "score": "0.37831908", "text": "_remapModifiers (data) {\n let set = {};\n // Step through the rooot\n for (const key in data) {\n // Check for keys that aren't modifiers\n if (key.charAt(0) !== '$') {\n // Move them to set, and remove their record\n set[key] = data[key];\n delete data[key];\n }\n // If the '$set' modifier is used, add that to the temp variable\n if (key === '$set') {\n set = Object.assign(set, data[key]);\n delete data[key];\n }\n }\n // If we have a $set, then attach to the data object\n if (Object.keys(set).length > 0) {\n data.$set = set;\n }\n return data;\n }", "title": "" }, { "docid": "ddc390852bbccb878d96c6af22ea1840", "score": "0.37810385", "text": "function reconstructTree() {\n\n}", "title": "" }, { "docid": "77183fb9a5822fc5ab0eb8aacf6a868e", "score": "0.37768653", "text": "function replaceWildcards(wildcards, replacement) {\n var i;\n switch (replacement.type) {\n case 'Identifier':\n if (wildcards !== null && isWildcard(replacement)) {\n if (replacement.name in wildcards) {\n replacement = wildcards[replacement.name];\n }\n }\n break;\n case 'Program':\n case 'BlockStatement':\n for (i = 0; i < replacement.body.length; i++) {\n replacement.body[i] = replaceWildcards(wildcards, replacement.body[i]);\n }\n break;\n case 'ArrayExpression':\n for (i = 0; i < replacement.elements.length; i++) {\n replacement.elements[i] = replaceWildcards(wildcards, replacement.elements[i]);\n }\n break;\n case 'MemberExpression':\n replacement.object = replaceWildcards(wildcards, replacement.object);\n replacement.property = replaceWildcards(wildcards, replacement.property);\n break;\n case 'CallExpression':\n replacement.callee = replaceWildcards(wildcards, replacement.callee);\n for (i = 0; i < replacement.arguments.length; i++) {\n replacement.arguments[i] = replaceWildcards(wildcards, replacement.arguments[i]);\n }\n break;\n case 'FunctionExpression':\n replacement.body = replaceWildcards(wildcards, replacement.body);\n for (i = 0; i < replacement.params.length; i++) {\n replacement.params[i] = replaceWildcards(wildcards, replacement.params[i]);\n }\n for (i = 0; i < replacement.defaults.length; i++) {\n replacement.defaults[i] = replaceWildcards(wildcards, replacement.defaults[i]);\n }\n break;\n case 'FunctionDeclaration':\n replacement.id = replaceWildcards(wildcards, replacement.id);\n replacement.body = replaceWildcards(wildcards, replacement.body);\n for (i = 0; i < replacement.params.length; i++) {\n replacement.params[i] = replaceWildcards(wildcards, replacement.params[i]);\n }\n for (i = 0; i < replacement.defaults.length; i++) {\n replacement.defaults[i] = replaceWildcards(wildcards, replacement.defaults[i]);\n }\n break;\n case 'Property':\n replacement.key = replaceWildcards(wildcards, replacement.key);\n replacement.value = replaceWildcards(wildcards, replacement.value);\n replacement.kind = replaceWildcards(wildcards, replacement.kind);\n break;\n case 'BinaryExpression':\n replacement.left = replaceWildcards(wildcards, replacement.left);\n replacement.right = replaceWildcards(wildcards, replacement.right);\n break;\n case 'UnaryExpression':\n replacement.argument = replaceWildcards(wildcards, replacement.argument);\n break;\n case 'VariableDeclaration':\n for (i = 0; i < replacement.declarations.length; i++) {\n replacement.declarations[i] = replaceWildcards(wildcards, replacement.declarations[i]);\n }\n break;\n case 'VariableDeclarator':\n replacement.id = replaceWildcards(wildcards, replacement.id);\n replacement.init = replaceWildcards(wildcards, replacement.init);\n break;\n case 'ReturnStatement':\n replacement.argument = replaceWildcards(wildcards, replacement.argument);\n break;\n case 'ExpressionStatement':\n replacement.expression = replaceWildcards(wildcards, replacement.expression);\n break;\n case 'UpdateExpression':\n replacement.argument = replaceWildcards(wildcards, replacement.argument);\n break;\n case 'ForStatement':\n replacement.init = replaceWildcards(wildcards, replacement.init);\n replacement.test = replaceWildcards(wildcards, replacement.test);\n replacement.update = replaceWildcards(wildcards, replacement.update);\n replacement.body = replaceWildcards(wildcards, replacement.body);\n break;\n case 'ObjectExpression':\n for (i = 0; i < replacement.properties.length; i++) {\n replacement.properties[i] = replaceWildcards(wildcards, replacement.properties[i]);\n }\n break;\n case 'Literal':\n break; // no-op\n default:\n console.error(replacement.type, \"not yet supported in replace\", replacement);\n break;\n }\n\n return replacement;\n}", "title": "" }, { "docid": "500b931aca3d093faebfa2d95222f1db", "score": "0.3774725", "text": "function StatementReplace(node){\n var statement = Statement(3, 0, node[\"scopeVaribles\"]);\n return statement;\n }", "title": "" }, { "docid": "57d9bdda99e2d1f408da9de2e4d7fdb4", "score": "0.37651375", "text": "function rewrite(node, nstr) {\r\n var lo = node.range[0], hi = node.range[1]\r\n for(var i=lo+1; i<hi; ++i) {\r\n exploded[i] = \"\"\r\n }\r\n exploded[lo] = nstr\r\n }", "title": "" }, { "docid": "79fafe511f310d38306b06adce7fbe86", "score": "0.3759731", "text": "function getConstraintVarName(lemmas){\n\n // Stack for the var names we find for each lemma\n let varNames = []\n\n // Map of var names for known lemmas\n let lemmasToVarNameMap = userIMLEdits.lemmasToVarNameMap\n\n // For each lemma lookup the given var name\n for (let lemmaStr of lemmas){\n let varName = lemmasToVarNameMap[lemmaStr]\n \n // If a variable name has not been given yet, then deermine a new one by finding the highest var num (e.g. var_X) \n if(typeof varName == 'undefined'){\n \n let varNum = getNextVarNum(lemmasToVarNameMap)\n\n varName = createVarName(lemmaStr, varNum)\n \n // save the var name to the map\n lemmasToVarNameMap[lemmaStr] = varName\n userIMLEdits.lemmasToVarNameMap = lemmasToVarNameMap\n }\n\n varNames.push(varName)\n }\n\n // Join the list together and cut off the >< \n let fullVarName = varNames.join(\"+\")\n\n return fullVarName\n}", "title": "" }, { "docid": "d57be990601d033592dd4c0ed7cb5377", "score": "0.37562734", "text": "function renameNodeProperty(nodes, oldName, newName) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var node = _step.value;\n\n // Save the children first in case we rename this.\n var children = node.children;\n\n // Rename and delete the old one.\n node[newName] = node[oldName];\n delete node[oldName];\n\n // Recurse.\n if (children && angular.isArray(children) && children.length > 0) {\n renameNodeProperty(children, oldName, newName);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator['return']) {\n _iterator['return']();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }", "title": "" }, { "docid": "5260b96f98455b3d564964bef030fa43", "score": "0.3751449", "text": "function relocate(ast) {\n assert(asm); // we also assume we are normalized\n\n var replacements = extraInfo.replacements;\n var fBases = extraInfo.fBases;\n var hBase = extraInfo.hBase;\n var m;\n\n traverse(ast, function(node, type) {\n switch(type) {\n case 'name': case 'defun': {\n var rep = replacements[node[1]];\n if (rep) node[1] = rep;\n break;\n }\n case 'binary': {\n if (node[1] == '+' && node[2][0] == 'name') {\n var base = null;\n if (node[2][1] == 'H_BASE') {\n base = hBase;\n } else if (m = /^F_BASE_(\\w+)$/.exec(node[2][1])) {\n base = fBases[m[1]] || 0; // 0 if the parent has no function table for this, but the child does. so no relocation needed\n }\n if (base !== null) {\n var other = node[3];\n if (base === 0) return other;\n if (other[0] == 'num') {\n other[1] = (other[1] + base)|0;\n return other;\n } else {\n node[2] = ['num', base];\n }\n }\n }\n break;\n }\n case 'var': {\n var vars = node[1];\n for (var i = 0; i < vars.length; i++) {\n var name = vars[i][0];\n assert(!(name in replacements)); // cannot shadow functions we are replacing TODO: fix that\n }\n break;\n }\n }\n });\n}", "title": "" }, { "docid": "0c032e562b61541f48b94b4f59dd7867", "score": "0.37495306", "text": "function formula_print_aux(data,origvars,depth) {\r\n var tmp,nr,s,op,i;\r\n tmp=typeof data;\r\n if (!data) return;\r\n // first check if data is a literal\r\n if (tmp===\"number\") {\r\n nr=data;\r\n if (data<0) {\r\n printlst.push(\"-\");\r\n printlen++;\r\n nr=0-data;\r\n }\r\n tmp=origvars[nr];\r\n if (tmp) { nr=tmp }\r\n s=String(nr);\r\n printlst.push(s);\r\n printlen+=s.length;\r\n return;\r\n } else if (tmp===\"string\") {\r\n printlst.push(data);\r\n printlen+=data.length;\r\n return;\r\n }\r\n // here data is a list\r\n if (data.length<2) return; // should not happen\r\n op=data[0];\r\n if (op===\"-\") {\r\n // negation op is printed as prefix and has only one argument\r\n printlst.push(\"-\");\r\n printlen++;\r\n tmp=typeof data[1];\r\n //if (!(tmp===\"string\" || tmp===\"number\")) { printlst.push(\"(\"); printlen+=1; }\r\n formula_print_aux(data[1],origvars,depth+1);\r\n //if (!(tmp===\"string\" || tmp===\"number\")) { printlst.push(\")\"); printlen+=1; }\r\n } else {\r\n // here ops are infix and may have many args\r\n // print surrounding ( ) only if not on top level\r\n if (depth>0) { printlst.push(\"(\"); printlen+=1; }\r\n for(i=1;i<data.length;i++) {\r\n formula_print_aux(data[i],origvars,depth+1);\r\n if (i<data.length-1) {\r\n printlst.push(\" \"+op+\" \");\r\n printlen+=op.length+2;\r\n }\r\n }\r\n if (depth>0) { printlst.push(\")\"); printlen+=1; }\r\n }\r\n}", "title": "" }, { "docid": "be7e87b9f5f090babcffc34bc9f17dca", "score": "0.37436086", "text": "function VariablesInAllowedPosition(context) {\n\t var varDefMap = Object.create(null);\n\t\n\t return {\n\t OperationDefinition: {\n\t enter: function enter() {\n\t varDefMap = Object.create(null);\n\t },\n\t leave: function leave(operation) {\n\t var usages = context.getRecursiveVariableUsages(operation);\n\t\n\t usages.forEach(function (_ref) {\n\t var node = _ref.node;\n\t var type = _ref.type;\n\t\n\t var varName = node.name.value;\n\t var varDef = varDefMap[varName];\n\t if (varDef && type) {\n\t // A var type is allowed if it is the same or more strict (e.g. is\n\t // a subtype of) than the expected type. It can be more strict if\n\t // the variable type is non-null when the expected type is nullable.\n\t // If both are list types, the variable item type can be more strict\n\t // than the expected item type (contravariant).\n\t var schema = context.getSchema();\n\t var varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type);\n\t if (varType && !(0, _typeComparators.isTypeSubTypeOf)(schema, effectiveType(varType, varDef), type)) {\n\t context.reportError(new _error.GraphQLError(badVarPosMessage(varName, varType, type), [varDef, node]));\n\t }\n\t }\n\t });\n\t }\n\t },\n\t VariableDefinition: function VariableDefinition(varDefAST) {\n\t varDefMap[varDefAST.variable.name.value] = varDefAST;\n\t }\n\t };\n\t}", "title": "" }, { "docid": "67aa231bb0a2c48f89ac21f1334a7ca6", "score": "0.37434617", "text": "function modifyHelper(children, name, modifier) {\n typeCheckString(name, 'name');\n //checkASTandFunction(, \"ast\", modifier, \"modifier\");\n\n return children.map(function (node) {\n if (['textnode', 'var', 'derived', 'data'].indexOf(node.type) === -1) {\n node = Object.assign({}, node, {\n children: modifyHelper(getChildren(node), name, modifier)\n });\n }\n node = handleNodeByName(node, name, modifier);\n return node;\n });\n}", "title": "" }, { "docid": "67aa231bb0a2c48f89ac21f1334a7ca6", "score": "0.37434617", "text": "function modifyHelper(children, name, modifier) {\n typeCheckString(name, 'name');\n //checkASTandFunction(, \"ast\", modifier, \"modifier\");\n\n return children.map(function (node) {\n if (['textnode', 'var', 'derived', 'data'].indexOf(node.type) === -1) {\n node = Object.assign({}, node, {\n children: modifyHelper(getChildren(node), name, modifier)\n });\n }\n node = handleNodeByName(node, name, modifier);\n return node;\n });\n}", "title": "" }, { "docid": "67aa231bb0a2c48f89ac21f1334a7ca6", "score": "0.37434617", "text": "function modifyHelper(children, name, modifier) {\n typeCheckString(name, 'name');\n //checkASTandFunction(, \"ast\", modifier, \"modifier\");\n\n return children.map(function (node) {\n if (['textnode', 'var', 'derived', 'data'].indexOf(node.type) === -1) {\n node = Object.assign({}, node, {\n children: modifyHelper(getChildren(node), name, modifier)\n });\n }\n node = handleNodeByName(node, name, modifier);\n return node;\n });\n}", "title": "" }, { "docid": "dac64da2a37dca18e57a76719614cbbd", "score": "0.37402415", "text": "function transformString(code, visitorsPost, visitorsPre) {\n// StatCollector.resumeTimer(\"parse\");\n// console.time(\"parse\")\n// var newAst = esprima.parse(code, {loc:true, range:true});\n var newAst = acorn.parse(code, {locations: true, ecmaVersion: 6 });\n// console.timeEnd(\"parse\")\n// StatCollector.suspendTimer(\"parse\");\n// StatCollector.resumeTimer(\"transform\");\n// console.time(\"transform\")\n addScopes(newAst);\n var len = visitorsPost.length;\n for (var i = 0; i < len; i++) {\n newAst = astUtil.transformAst(newAst, visitorsPost[i], visitorsPre[i], astUtil.CONTEXT.RHS);\n }\n// console.timeEnd(\"transform\")\n// StatCollector.suspendTimer(\"transform\");\n// console.log(JSON.stringify(newAst,null,\" \"));\n return newAst;\n }", "title": "" }, { "docid": "e58cace7256bc1a0e15df04e53112efe", "score": "0.37270844", "text": "static updateFromTreeSitter(rootNode, treeSitterNode) {\n \n let usedDomainObjects = new Set()\n let removedDomainObjects = new Set()\n let addedDomainObjects = new Set()\n \n let domainObjectsById = new Map()\n let replacementsForDomainObject = new Map()\n \n rootNode.visit(eaNode => {\n if (eaNode.treeSitter) {\n domainObjectsById.set(eaNode.treeSitter.id, eaNode)\n } else {\n domainObjectsById.set(eaNode.target.treeSitter.id, eaNode.target)\n replacementsForDomainObject.set(eaNode.target, eaNode )\n }\n })\n \n \n var newRootNode = TreeSitterDomainObject.fromTreeSitterAST(treeSitterNode, domainObjectsById, usedDomainObjects)\n \n for(let replacement of replacementsForDomainObject.values()) {\n \n if(usedDomainObjects.has(replacement.target)) {\n // reinstall it...\n let domainObject = replacement.target\n var idx = domainObject.parent.children.indexOf(domainObject)\n domainObject.parent.children[idx] = replacement\n replacement.parent = domainObject.parent\n replacement.target = domainObject \n usedDomainObjects.add(replacement)\n } else {\n removedDomainObjects.add(replacement)\n \n }\n }\n for(let removedDomainObject of removedDomainObjects) {\n removedDomainObject.removed()\n }\n \n \n // keep same rootNode, alternative would be have another outside object that keeps the reference\n rootNode.treeSitter = newRootNode.treeSitter\n rootNode.children = newRootNode.children\n }", "title": "" }, { "docid": "cbb7c37e032db7f4e3c6a614ba1fbfa8", "score": "0.37042373", "text": "function prefixModelVars (expr) {\n\t// Rewrite the expression to be keyed on the context 'c'\n\t// XXX: experiment with some local var definitions and selective\n\t// rewriting for perf\n\n\tvar res = '',\n\t\ti = -1,\n\t\tc = '';\n\tdo {\n\t\tif (/^$|[\\[:(,]/.test(c)) {\n\t\t\tres += c;\n\t\t\tif (/[a-zA-Z_]/.test(expr[i+1])) {\n\t\t\t\t// Prefix with model reference\n\t\t\t\tres += 'm.';\n\t\t\t}\n\t\t} else if (c === \"'\") {\n\t\t\t// skip over string literal\n\t\t\tvar literal = expr.slice(i).match(/'(?:[^\\\\']+|\\\\')*'/);\n\t\t\tif (literal) {\n\t\t\t\tres += literal[0];\n\t\t\t\ti += literal[0].length - 1;\n\t\t\t}\n\t\t} else {\n\t\t\tres += c;\n\t\t}\n\t\ti++;\n\t\tc = expr[i];\n\t} while (c);\n\treturn res;\n}", "title": "" }, { "docid": "1543a8537010fc63446a5852a75a0b7a", "score": "0.3703906", "text": "function findUnusedAssignmentExpressions (ast) {\n var unused = [];\n traverse.traverse(ast, {\n enter: function (node, parent) {\n var scope, refs;\n if (parent &&\n parent.type === 'ExpressionStatement' &&\n node.type === 'AssignmentExpression' &&\n node.operator === '=' &&\n node.left.type === 'Identifier' &&\n (scope = findScope(ast, parent))\n ) {\n refs = fast.filter(findVariableReferences(scope, node.left, parent), function (item) {\n return item !== node.left;\n });\n if (!refs.length) {\n unused.push(parent); // the whole ExpressionStatement should be removed, not just the assignment.\n }\n }\n }\n });\n return unused;\n}", "title": "" }, { "docid": "ebfe130e4b9f063b27109a1ae682d94b", "score": "0.37030917", "text": "function getReferencedVarsInFilters(elementFiltersArr) {\n var varExprList = new sparql.VarExprList();\n \n varExprList.addAll(\n _(elementFiltersArr)\n .map(function(e) { return e.getVarsMentioned(); })\n .flatten()\n .value()\n );\n \n return varExprList;\n }", "title": "" }, { "docid": "9c55c8b6e3c2c181434d4fa43ea1e6a8", "score": "0.37013954", "text": "function VariablesInAllowedPosition(context) {\n var varDefMap = Object.create(null);\n\n return {\n OperationDefinition: {\n enter: function enter() {\n varDefMap = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n\n usages.forEach(function (_ref) {\n var node = _ref.node;\n var type = _ref.type;\n\n var varName = node.name.value;\n var varDef = varDefMap[varName];\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n var schema = context.getSchema();\n var varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type);\n if (varType && !(0, _typeComparators.isTypeSubTypeOf)(schema, effectiveType(varType, varDef), type)) {\n context.reportError(new _error.GraphQLError(badVarPosMessage(varName, varType, type), [varDef, node]));\n }\n }\n });\n }\n },\n VariableDefinition: function VariableDefinition(varDefAST) {\n varDefMap[varDefAST.variable.name.value] = varDefAST;\n }\n };\n}", "title": "" }, { "docid": "2f2b62edee277a26b08d76dce027149f", "score": "0.36897913", "text": "function addReferences(expr) {\n if (referenceCount) {\n var refs = [];\n for (var i = 1; i <= referenceCount; i++) {\n refs.push('_ref' + i);\n }\n expr = 'var ' + refs.join(', ') + ';\\n' + expr;\n }\n return expr;\n}", "title": "" }, { "docid": "a9c60ef6ae81d56b57f03f47538906a9", "score": "0.36871427", "text": "function matrix_rank(crnt_val,crnt_var,grid_vars) {\r\n // Reset validation flag on page\r\n $('#field_validation_error_state').val('0');\r\n // array of all field_names within matrix group\r\n // gv[0]=>'w1',gv[1]=>'w2',gv[2]=>'w3',...\r\n var grid_vars = grid_vars.split(',');\r\n var id, i;\r\n var rank_remove_label = $('#matrix_rank_remove_label');\r\n var remove_label_time = 2500;\r\n // loop through other variables within this matrix group\r\n for (i = 0; i < grid_vars.length; i++) {\r\n if (crnt_var !== grid_vars[i]) {\r\n id = \"mtxopt-\"+grid_vars[i]+\"_\"+crnt_val;\r\n id = id.replace(/\\./g,'\\\\.');\r\n if ($(\"#\"+id).is(\":checked\")) {\r\n // Uncheck the input\r\n radioResetVal(grid_vars[i],'form');\r\n // Add temporary \"value removed\" label\r\n rank_remove_label.show().position({\r\n my: \"center top\",\r\n at: \"center top+10\",\r\n of: $(\"#\"+id)\r\n });\r\n setTimeout(function(){\r\n rank_remove_label.hide();\r\n },remove_label_time);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "e30ae1b0cd598d20b3e14116250270b7", "score": "0.3668065", "text": "function _replace(args, t) {\n var previous = stack$$1[index].graph;\n // assert(index == stack.length - 1)\n stack$$1[index] = _act(args, t);\n return change(previous);\n }", "title": "" }, { "docid": "a8e6f1a5be2e44f6e82ee0b597104ea8", "score": "0.3664792", "text": "simplified() {\n if (this.type === 'v') {\n // If this is just a variable group, expand the power and we're done.\n let newGroup = this.group;\n for (let i = 1; i < this.power; ++i) {\n newGroup = newGroup.times(this.group);\n }\n return new Expression(this.coefficient, 1, 'v', newGroup);\n }\n\n // Otherwise, recursivly simplify the subexpressions.\n const simplifiedExpressions = this.expressions.map(e => e.simplified());\n\n if (this.type === '*') {\n let expanded = simplifiedExpressions\n for (let i = 1; i < this.power; ++i) {\n expanded = expanded.concat(simplifiedExpressions);\n }\n\n const choices = [];\n for (const expression of expanded) {\n if (expression.type == 'v') {\n choices.push([expression]);\n } else if (expression.type == '+') {\n choices.push(expression.expressions);\n } else {\n throw new Error(\"Simplified expressions should be of type 'v' or '+'.\");\n }\n }\n\n const allTerms = [];\n iterate(choices, (selection) => {\n let group = VariableGroup.CONSTANT;\n let coefficient = 1;\n for (const expression of selection) {\n coefficient *= expression.coefficient;\n group = group.times(expression.group);\n }\n allTerms.push(new Expression(coefficient, 1, 'v', group));\n });\n return (new Expression(this.coefficient, 1, '+', allTerms)).simplified();\n }\n\n if (this.type == '+') {\n // Get rid of the power by expanding it as a product.\n if (this.power > 1) {\n let toMultiply = [];\n const copyWithoutPower = new Expression(1, 1, '+', simplifiedExpressions);\n for (let i = 0; i < this.power; ++i) {\n toMultiply.push(copyWithoutPower);\n }\n return (new Expression(this.coefficient, 1, '*', toMultiply)).simplified();\n }\n\n // Since all terms are simplified, they are either of type + or v.\n // If of type +, flatten them first.\n // Note even if they are of type +, since they are simplified, their coefficient is 1, their\n // power is 1, and all of their expressions are of type 'v', so only one level of flattening\n // is needed.\n for (let i = 0; i < simplifiedExpressions.length; ++i) {\n if (simplifiedExpressions[i].type == '+') {\n simplifiedExpressions.splice(i, 1, ...simplifiedExpressions[i].expressions);\n }\n }\n\n const terms = [];\n const coefficients = [];\n for (const expression of simplifiedExpressions) {\n let likeTermIndex = -1;\n for (let i = 0; i < terms.length; ++i) {\n if (expression.group.isLike(terms[i])) {\n likeTermIndex = i;\n break;\n } else {\n }\n }\n if (likeTermIndex == -1) {\n terms.push(expression.group);\n coefficients.push(expression.coefficient);\n } else {\n coefficients[likeTermIndex] += expression.coefficient;\n }\n }\n\n const allTerms = [];\n for (let i = 0; i < terms.length; ++i) {\n if (coefficients[i] != 0) {\n allTerms.push(new Expression(coefficients[i] * this.coefficient, 1, 'v', terms[i]));\n }\n }\n allTerms.sort((a, b) => VariableGroup.compare(a.group, b.group));\n\n\n if (allTerms.length == 0) {\n return new Expression(0, 1, 'v', VariableGroup.CONSTANT);\n } else if (allTerms.length == 1) {\n return allTerms[0];\n } else {\n return new Expression(1, 1, '+', allTerms);\n }\n }\n\n throw new Error(\"This should never be reached\");\n }", "title": "" }, { "docid": "ed6584d5d6c164a2dd0b6cae8a8070b5", "score": "0.36598969", "text": "function parse(tokens) {\n\tlet bound = [[\n\t\t...built_in_vars.map(name => ({kind: \"var\", name})),\n\t\t...built_in_funcs.map(name => ({kind: \"func\", name}))\n\t]];\n\t\n\tlet sets_qs_stack = [];\n\t\n\tlet find_bound_named = name =>\n\t\tbound.map_maybe((scope, i) => {\n\t\t\tlet found = scope.find(var_or_func => var_or_func.name == name);\n\t\t\tif(found) return {kind: found.kind, i: bound.length - 1 - i};\n\t\t\telse return null;\n\t\t})[0] ||\n\t\t(() => {throw `${name} ain't a name, bro`})();\n\t\n\tfunction done(in_semiparens, i = 0) {\n\t\tif(tokens.length <= i) return true;\n\t\t\n\t\tlet first = tokens[i];\n\t\treturn (\n\t\t\t[\")\", \"]\", \"}\", \",\"].includes(first.type) ||\n\t\t\tin_semiparens && first.type == \".\");\n\t}\n\t\n\tfunction parse_rec(in_semiparens, inherit_q = false, new_scope = []) {\n\t\tbound.unshift(new_scope);\n\t\t\n\t\tlet pipe_sections = [];\n\t\twhile(\n\t\t\t\t!done(in_semiparens) ||\n\t\t\t\ttokens.length > 0 && tokens[0].type == \",\") {\n\t\t\t\n\t\t\tpipe_sections.push(parse_pipe_section(in_semiparens, inherit_q));\n\t\t\tif(tokens.length > 0 && tokens[0].type == \",\") tokens.shift();\n\t\t\tinherit_q = false;\n\t\t}\n\t\t\n\t\tbound.shift();\n\t\t\n\t\treturn pipe_sections;\n\t}\n\t\n\tfunction parse_pipe_section(in_semiparens, inherit_q = false) {\n\t\tlet first = tokens.shift();\n\t\tswitch(first.type) {\n\t\t\tcase \"fn\": return parse_fn(in_semiparens);\n\t\t\t\n\t\t\tcase \"store\":\n\t\t\tcase \"args\":\n\t\t\t\treturn parse_store(in_semiparens);\n\t\t\t\n\t\t\tdefault:\n\t\t\t\ttokens.unshift(first);\n\t\t\t\treturn parse_normal(in_semiparens, inherit_q);\n\t\t}\n\t}\n\t\n\tfunction parse_normal(in_semiparens, inherit_q) {\n\t\tlet {vars, declared, i} = lookahead_vars(in_semiparens);\n\t\tlet var_op;\n\t\tif(\n\t\t\t\tvars &&\n\t\t\t\ti < tokens.length &&\n\t\t\t\t[\"=\", \"<-\"].includes(tokens[i].type)) {\n\t\t\tvar_op = tokens[i].type;\n\t\t\ttokens.splice(0, i + 1);\n\t\t\tif(var_op == \"=\") {\n\t\t\t\tfor(let new_vars of declared)\n\t\t\t\t\tif(bound[0].map(var_or_func => var_or_func.name).includes(new_vars.name))\n\t\t\t\t\t\tthrow \"already bound in this scope bruh\";\n\t\t\t\tbound[0] = declared.concat(bound[0]);\n\t\t\t} else if( var_op == \"<-\") {\n\t\t\t\tif(!declared.every(({name}) => find_bound_named(name).kind == \"var\"))\n\t\t\t\t\tthrow \"<-ing a func\";\n\t\t\t\tvars = vars.map(index_vars);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Consider making passing from pipe into tuples (func = \"id\") an error because that's weird functionality\n\t\tlet func = \"id\";\n\t\tlet scope_i = 0;\n\t\tif(\n\t\t\t\ttokens.length > 0 &&\n\t\t\t\ttokens[0].type == \"name\") {\n\t\t\tlet bound_name = find_bound_named(tokens[0].data);\n\t\t\tif(bound_name.kind == \"func\") {\n\t\t\t\tfunc = tokens.shift().data;\n\t\t\t\tscope_i = bound_name.i;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlet args, sets_qs;\n\t\tif(inherit_q) {\n\t\t\targs = parse_args(in_semiparens);\n\t\t\tsets_qs = false;\n\t\t} else {\n\t\t\tsets_qs_stack.push(false);\n\t\t\targs = parse_args(in_semiparens);\n\t\t\tsets_qs = sets_qs_stack.pop();\n\t\t}\n\t\t\n\t\tif(!var_op)\n\t\t\treturn {type: \"call\", func, i: scope_i, sets_qs, args};\n\t\telse\n\t\t\treturn {type: var_op, vars, func, i: scope_i, sets_qs, args};\n\t}\n\t\n\tfunction parse_vars(in_semiparens) {\n\t\tlet {vars, declared, i} = lookahead_vars(in_semiparens);\n\t\ttokens.splice(0, i);\n\t\treturn {vars, declared};\n\t}\n\t\n\tfunction lookahead_vars(in_semiparens) {\n\t\tlet i = 0;\n\t\tlet declared = [];\n\t\tlet vars;\n\t\t\n\t\t({vars, i} = lookahead_var_list());\n\t\t\n\t\treturn {vars, declared, i};\n\t\t\n\t\tfunction lookahead_var_list() {\n\t\t\tlet vars = [];\n\t\t\tfor(; !done(in_semiparens, i); i++) {\n\t\t\t\tlet token = tokens[i];\n\t\t\t\tif(token.type == \"name\") {\n\t\t\t\t\tif([\"ls\", \"list\"].includes(token.data)) {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tlet var_list;\n\t\t\t\t\t\t({vars: var_list, i} = lookahead_var_list());\n\t\t\t\t\t\tvars.push({type: \"list\", data: var_list});\n\t\t\t\t\t\ti--;\n\t\t\t\t\t} else if(token.data == \"dict\") {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tlet var_dict;\n\t\t\t\t\t\t({vars: var_dict, i} = lookahead_var_dict());\n\t\t\t\t\t\tvars.push({type: \"dict\", data: var_dict});\n\t\t\t\t\t\ti--;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvars.push({type: \"var\", data: token.data});\n\t\t\t\t\t\tdeclared.push({kind: \"var\", name: token.data});\n\t\t\t\t\t}\n\t\t\t\t} else if(token.type == \"[\") {\n\t\t\t\t\ti++;\n\t\t\t\t\tlet var_list;\n\t\t\t\t\t({vars: var_list, i} = lookahead_var_list());\n\t\t\t\t\tif(\n\t\t\t\t\t\t\t!var_list ||\n\t\t\t\t\t\t\ti >= tokens.length ||\n\t\t\t\t\t\t\ttokens[i].type != \"]\")\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tvars.push({type: \"list\", data: var_list});\n\t\t\t\t} else if(token.type == \"{\") {\n\t\t\t\t\ti++;\n\t\t\t\t\tlet var_dict;\n\t\t\t\t\t({vars: var_dict, i} = lookahead_var_dict());\n\t\t\t\t\tif(\n\t\t\t\t\t\t\t!var_dict ||\n\t\t\t\t\t\t\ti >= tokens.length ||\n\t\t\t\t\t\t\ttokens[i].type != \"}\")\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tvars.push({type: \"dict\", data: var_dict});\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn {vars, i};\n\t\t}\n\t\t\n\t\tfunction lookahead_var_dict() {\n\t\t\tlet vars = [];\n\t\t\tfor(; !done(in_semiparens, i); i++) {\n\t\t\t\tlet token = tokens[i];\n\t\t\t\tif(token.type == \"name\") {\n\t\t\t\t\tif([\"ls\", \"list\", \"dict\"].includes(token.data)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvars.push({type: \"var\", data: token.data});\n\t\t\t\t\t\tdeclared.push({kind: \"var\", name: token.data});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn {vars, i};\n\t\t}\n\t}\n\t\n\tfunction parse_args(in_semiparens) {\n\t\tlet args = [];\n\t\twhile(!done(in_semiparens))\n\t\t\targs.push(parse_arg(in_semiparens));\n\t\treturn args;\n\t}\n\t\n\tfunction parse_arg(in_semiparens) {\n\t\tlet first_chunk = parse_chunk(in_semiparens);\n\t\tlet arg = first_chunk ? [first_chunk] : [];\n\t\twhile(\n\t\t\t\t!done(in_semiparens) &&\n\t\t\t\tis_op(tokens[0])) {\n\t\t\targ.push(tokens.shift());\n\t\t\tif(\n\t\t\t\t\t!done(in_semiparens) &&\n\t\t\t\t\t!is_op(tokens[0]))\n\t\t\t\targ.push(parse_chunk(in_semiparens));\n\t\t\telse if(\n\t\t\t\t\tdone(in_semiparens) ||\n\t\t\t\t\t!un_ops.includes(tokens[0].type))\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn parse_ops(arg);\n\t}\n\t\n\tfunction index_vars(vars) {\n\t\tif(vars.type == \"var\") {\n\t\t\treturn {type: \"var\", data: vars.data, i: find_bound_named(vars.data).i}\n\t\t} else if([\"list\", \"dict\"].includes(vars.type)) {\n\t\t\treturn {type: vars.type, data: vars.data.map(index_vars)};\n\t\t} else {\n\t\t\tthrow \"how?\";\n\t\t}\n\t}\n\t\n\tfunction parse_chunk(in_semiparens) {\n\t\tlet first = tokens.shift();\n\t\t\n\t\tswitch(first.type) {\n\t\t\tcase \"num\":\n\t\t\tcase \"str\":\n\t\t\t\treturn first;\n\t\t\t\n\t\t\tcase \"?\":\n\t\t\t\tsets_qs_stack[sets_qs_stack.length - 1] = true;\n\t\t\t\treturn first;\n\t\t\t\n\t\t\tcase \"name\":\n\t\t\t\tlet bound_name = find_bound_named(first.data);\n\t\t\t\tif(bound_name.kind == \"var\") {\n\t\t\t\t\treturn {type: \"var\", name: first.data, i: bound_name.i};\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"call\",\n\t\t\t\t\t\tfunc: first.data,\n\t\t\t\t\t\ti: bound_name.i,\n\t\t\t\t\t\targ: parse_args(in_semiparens)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\n\t\t\tcase \"$\":\n\t\t\t\tif(tokens.length > 0) {\n\t\t\t\t\tlet token = tokens.shift();\n\t\t\t\t\tif(token.type != \"name\") throw \"$ in front of non-name\";\n\t\t\t\t\tlet bound_name = find_bound_named(token.data);\n\t\t\t\t\tif(bound_name.kind == \"var\")\n\t\t\t\t\t\treturn {type: \"ref\", name: token.data, i: bound_name.i};\n\t\t\t\t\telse\n\t\t\t\t\t\treturn {type: \"funcref\", name: token.data, i: bound_name.i};\n\t\t\t\t} else {\n\t\t\t\t\tthrow \"$ with no token after\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\tcase \"(\": {\n\t\t\t\tlet is_func = tokens.length > 0 && tokens[0].type == \",\";\n\t\t\t\tif(is_func)\n\t\t\t\t\ttokens.shift();\n\t\t\t\t\n\t\t\t\tlet parse = parse_rec(false, true);\n\t\t\t\t\n\t\t\t\tif(tokens.length > 0 && tokens[0].type == \")\")\n\t\t\t\t\ttokens.shift();\n\t\t\t\telse\n\t\t\t\t\tthrow \"terminated ( with wrong thing\";\n\t\t\t\t\n\t\t\t\treturn {type: !is_func ? \"expr\" : \"anonfunc\", data: parse};\n\t\t\t}\n\t\t\tcase \"[\": {\n\t\t\t\tlet parse = parse_rec(false, true);\n\t\t\t\t\n\t\t\t\tif(tokens.length > 0 && tokens[0].type == \"]\")\n\t\t\t\t\ttokens.shift();\n\t\t\t\telse\n\t\t\t\t\tthrow \"terminated [ with wrong thing\";\n\t\t\t\t\n\t\t\t\treturn {type: \"list\", data: parse};\n\t\t\t}\n\t\t\tcase \"{\": {\n\t\t\t\tlet parse = parse_rec(false, true);\n\t\t\t\t\n\t\t\t\tif(tokens.length > 0 && tokens[0].type == \"}\")\n\t\t\t\t\ttokens.shift();\n\t\t\t\telse\n\t\t\t\t\tthrow \"terminated { with wrong thing\";\n\t\t\t\t\n\t\t\t\treturn {type: \"dict\", data: parse};\n\t\t\t}\n\t\t\tcase \".\": {\n\t\t\t\tif(in_semiparens) throw \"how?\";\n\t\t\t\t\n\t\t\t\tlet is_func = tokens.length > 0 && tokens[0].type == \",\";\n\t\t\t\tif(is_func)\n\t\t\t\t\ttokens.shift();\n\t\t\t\t\n\t\t\t\tlet parse = parse_rec(true, true);\n\t\t\t\t\n\t\t\t\tif(tokens.length > 0 && tokens[0].type == \".\")\n\t\t\t\t\ttokens.shift();\n\t\t\t\telse\n\t\t\t\t\tthrow \"terminated . with wrong thing\";\n\t\t\t\t\n\t\t\t\treturn {type: !is_func ? \"expr\" : \"anonfunc\", data: parse};\n\t\t\t}\n\t\t\tcase \")\": throw \"unexpected )\";\n\t\t\tcase \"]\": throw \"unexpected ]\";\n\t\t\tcase \"}\": throw \"unexpected }\";\n\t\t\t\n\t\t\tcase \"if\": return parse_if(in_semiparens);\n\t\t\tcase \"for\": return parse_for(in_semiparens);\n\t\t\tcase \"while\": return parse_while(in_semiparens);\n\t\t\tcase \"repeat\": return parse_repeat(in_semiparens);\n\t\t\t\n\t\t\tcase \"else\": throw \"Else with no if? :flushed:\";\n\t\t\tcase \"elif\": throw \"Elif with no if? :flushed:\";\n\t\t\t\n\t\t\tdefault:\n\t\t\t\ttokens.unshift(first);\n\t\t\t\treturn;\n\t\t}\n\t}\n\t\n\tfunction parse_ops(arg) {\n\t\tif(arg.length == 1) {\n\t\t\tif(!is_op(arg[0]))\n\t\t\t\treturn arg[0];\n\t\t\telse if(un_ops.includes(arg[0].type))\n\t\t\t\treturn {type: arg[0].type, arg: \"implicit\"};\n\t\t\telse\n\t\t\t\treturn {type: arg[0].type, left: \"implicit\", right: \"implicit\"};\n\t\t}\n\t\t\n\t\tfor(let i = arg.length - 1; i >= 0; i--) {\n\t\t\tif(un_ops.includes(arg[i].type)) {\n\t\t\t\tif(i != arg.length - 1)\n\t\t\t\t\targ.splice(\n\t\t\t\t\t\ti, 2,\n\t\t\t\t\t\t{type: arg[i].type, arg: arg[i + 1]}\n\t\t\t\t\t);\n\t\t\t\telse\n\t\t\t\t\targ[i] = {type: arg[i].type, arg: \"implicit\"};\n\t\t\t}\n\t\t}\n\t\t\n\t\tlet i_of_highest = find_highest_prec_op(arg);\n\t\twhile(arg.length > 1) {\n\t\t\tif(i_of_highest > 0 && is_op(arg[i_of_highest - 1]))\n\t\t\t\tthrow \"implicit left argument in the middle of operators\";\n\t\t\tif(i_of_highest < arg.length - 1 && is_op(arg[i_of_highest + 1]))\n\t\t\t\tthrow \"implicit right argument in the middle of operators\";\n\t\t\t\n\t\t\tlet start_splice = i_of_highest;\n\t\t\tlet end_splice = 1;\n\t\t\t\n\t\t\tlet left_arg;\n\t\t\tif(i_of_highest == 0) {\n\t\t\t\tleft_arg = \"implicit\";\n\t\t\t} else {\n\t\t\t\tstart_splice--;\n\t\t\t\tend_splice++;\n\t\t\t\tleft_arg = arg[i_of_highest - 1];\n\t\t\t}\n\t\t\t\n\t\t\tlet right_arg;\n\t\t\tif(i_of_highest == arg.length - 1) {\n\t\t\t\tright_arg = \"implicit\";\n\t\t\t} else {\n\t\t\t\tend_splice++;\n\t\t\t\tright_arg = arg[i_of_highest + 1];\n\t\t\t}\n\t\t\t\n\t\t\targ.splice(\n\t\t\t\tstart_splice,\n\t\t\t\tend_splice,\n\t\t\t\t{type: arg[i_of_highest].type, left: left_arg, right: right_arg}\n\t\t\t);\n\t\t\t\n\t\t\ti_of_highest = find_highest_prec_op(arg);\n\t\t}\n\t\t\n\t\t\n\t\treturn arg[0];\n\t}\n\t\n\tfunction parse_fn(in_semiparens) {\n\t\tif(tokens.length < 0 || tokens[0].type != \"name\")\n\t\t\tthrow \"fn got no name\";\n\t\t\n\t\tlet name = tokens.shift().data;\n\t\tif(bound[0].map(var_or_func => var_or_func.name).includes(name))\n\t\t\tthrow \"already bound in this scope bruh\";\n\t\tbound[0].unshift({kind: \"func\", name: name});\n\t\t\n\t\tlet {vars, declared} = parse_vars(in_semiparens);\n\t\t\n\t\treturn {type: \"func\", name, args: vars, body: parse_block(in_semiparens, declared)};\n\t}\n\t\n\tfunction parse_store(in_semiparens) {\n\t\tlet {vars, declared} = parse_vars(in_semiparens);\n\t\tfor(let new_vars of declared)\n\t\t\tif(bound[0].map(var_or_func => var_or_func.name).includes(new_vars.name))\n\t\t\t\tthrow \"already bound in this scope bruh\";\n\t\tbound[0] = declared.concat(bound[0]);\n\t\tif(!done(in_semiparens))\n\t\t\tthrow \"more stuff after store/args?\";\n\t\t\n\t\treturn {type: \"=\", vars, func: \"id\", i: 0, args: []};\n\t}\n\t\n\tfunction parse_if(in_semiparens) {\n\t\tlet branches = [{\n\t\t\tcond: parse_block(in_semiparens, []),\n\t\t\tbody: parse_block(in_semiparens, [])\n\t\t}];\n\t\t\n\t\twhile(!done(in_semiparens) && tokens[0].type == \"elif\") {\n\t\t\ttokens.shift();\n\t\t\tbranches.push({\n\t\t\t\tcond: parse_block(in_semiparens, []),\n\t\t\t\tbody: parse_block(in_semiparens, [])\n\t\t\t});\n\t\t}\n\t\t\n\t\tif(!done(in_semiparens) && tokens[0].type == \"else\") {\n\t\t\ttokens.shift();\n\t\t\tbranches.push({\n\t\t\t\tcond: null,\n\t\t\t\tbody: parse_block(in_semiparens, [])\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn {type: \"if\", branches};\n\t}\n\t\n\tfunction parse_for(in_semiparens) {\n\t\tlet {iter_vars, declared} = parse_vars(in_semiparens);\n\t\tlet iterator = parse_block(in_semiparens, []);\n\t\tlet body = parse_block(in_semiparens, declared);\n\t\t\n\t\treturn {type: \"for\", iter_vars, iterator, body};\n\t}\n\t\n\tfunction parse_while(in_semiparens) {\n\t\tlet cond = parse_block(in_semiparens, []);\n\t\tlet body = parse_block(in_semiparens, []);\n\t\t\n\t\treturn {type: \"while\", cond, body};\n\t}\n\t\n\tfunction parse_repeat(in_semiparens) {\n\t\tlet times = parse_block(in_semiparens, []);\n\t\tlet body = parse_block(in_semiparens, []);\n\t\t\n\t\treturn {type: \"repeat\", times, body};\n\t}\n\t\n\tfunction parse_block(in_semiparens, declared) {\n\t\tif(\n\t\t\t\tdone(in_semiparens) ||\n\t\t\t\t![\"(\", \".\"].includes(tokens[0].type))\n\t\t\tthrow \"no block bro\";\n\t\t\n\t\tlet open = tokens.shift().type;\n\t\t\n\t\tif(tokens.length > 0 && tokens[0].type == \",\")\n\t\t\tthrow \"nuh uh block ain't use no lambda\";\n\t\t\n\t\tlet block;\n\t\tif(open == \"(\") {\n\t\t\tblock = parse_rec(false, false, declared);\n\t\t\t\n\t\t\tif(tokens.length > 0 && tokens[0].type == \")\")\n\t\t\t\ttokens.shift();\n\t\t\telse\n\t\t\t\tthrow \"terminated ( with wrong thing\";\n\t\t} else if(open == \".\") {\n\t\t\tif(in_semiparens) throw \"how?\";\n\t\t\t\n\t\t\tblock = parse_rec(true, false, declared);\n\t\t\t\n\t\t\tif(tokens.length > 0 && tokens[0].type == \".\")\n\t\t\t\ttokens.shift();\n\t\t\telse\n\t\t\t\tthrow \"terminated . with wrong thing\";\n\t\t} else {\n\t\t\tthrow \"how?\";\n\t\t}\n\t\t\n\t\treturn block;\n\t}\n\t\n\treturn parse_rec(false);\n}", "title": "" }, { "docid": "09e7d8f944ed4072f9ba2b860b605d97", "score": "0.36586565", "text": "function updateCounts(nodes) {\n var childNumber = 0;\n var len = nodes.length;\n for (var i = 0; i < len; i++) {\n var node = nodes[i];\n var children = $(\"li#\" + node.id + \">ul>li:not(.filtered-out)\");\n if (children.length > 0) {\n var cn = updateCounts(children);\n\n var name = $(\"li#\" + node.id + \">span.treeItemName\")[0];\n var str = name.textContent;\n var ndx = str.indexOf('[');\n if (ndx == -1) // does not count chidren\n {\n childNumber++;\n continue;\n }\n str = str.substring(0, ndx + 1); // trim the number from previous calculation\n\n childNumber += cn;\n str += cn.toString() + \"]\";\n name.textContent = str;\n }\n else\n childNumber++;\n }\n return (childNumber);\n}", "title": "" }, { "docid": "6d766f1d1d2670a82e9cb7c5adde22d0", "score": "0.36547065", "text": "function substituteArrayLiterals(script) {\n const allNamedArrays = script.query(`VariableDeclarator[init.type=\"ArrayExpression\"]`);\n\n const allNamedLiteralArrays = allNamedArrays.filter(\n ({init}) => init.elements.findIndex((element) => !element.type.startsWith(\"Literal\")) === -1\n );\n\n allNamedLiteralArrays.forEach((array) => {\n const query = `ComputedMemberExpression[object.type=IdentifierExpression][object.name=${JSON.stringify(\n array.binding.name\n )}][expression.type=\"LiteralNumericExpression\"]`;\n script.query(query).replace((node) => array.init.elements[node.expression.value]);\n });\n}", "title": "" }, { "docid": "46394b78173ffbb8baff86bccf23ddc5", "score": "0.36545867", "text": "function processVariables(str) {\n if (!str) return '';\n var variables = ['MONTH', 'QUARTER', 'YEAR'];\n for (var i = 0; i < variables.length; i++) {\n var variable = variables[i];\n var regexp = new RegExp(':' + variable + '[+-]?[\\\\d]*', 'g');\n var matches = str.match(regexp);\n if (!matches) {\n continue;\n }\n for (var j = 0; j < matches.length; j++) {\n var match = matches[j];\n var offset = 0;\n if (match.split('+').length > 1) {\n offset = match.split('+')[1];\n } else if (match.split('-').length > 1) {\n offset = parseInt(match.split('-')[1]) * -1;\n }\n str = str.replace(match, getDatePart(variable, offset));\n }\n }\n\n return str;\n}", "title": "" }, { "docid": "02dd3be12902f9a49457e29447648ec1", "score": "0.3651594", "text": "function unit_propagate(derivedlen,depth,clauses,varvals,posbuckets,negbuckets,derived) {\r\n var i,j,dlit,negdlit,lit,nr,vval,polarity,derivednext,allclausesfound;\r\n var bucket,bucketlen,tmpbucket,clause,useclause,unassigned_count,unassigned_lit;\r\n var assigned,derived_units_txt,activity;\r\n unit_propagations_count++;\r\n derived_units_txt=\"\"; // used only for the trace: all the derived literals (signed vars)\r\n derivednext=0; // next index of derived to use in the iteration\r\n // assign immediately all vars in the derived\r\n for(i=0; i<derivedlen ; i++) {\r\n lit=derived[i];\r\n if (lit<0) varvals[0-lit]=-1\r\n else varvals[lit]=1;\r\n }\r\n // the main loop is run, deriving new unit clauses, until either:\r\n // - the clause set is detected to be unsatisfiable\r\n // - there are no more derived unit clauses\r\n while(derivednext<derivedlen) {\r\n dlit=derived[derivednext++]; // take next el from derived\r\n negdlit=0-dlit;\r\n if (dlit<0) bucket=posbuckets[negdlit];\r\n else bucket=negbuckets[dlit];\r\n bucketlen=bucket[0]; // nr of used bucket elements: actual array is normally longer\r\n for (i=1; i<=bucketlen; i++) { // iterate over clauses in the bucket\r\n clause=bucket[i];\r\n useclause=true;\r\n unassigned_count=0; // count unassigned vars in clause\r\n unassigned_lit=0; // 0 means no unassigned vars found for this clause\r\n for (j=2; j<clause.length; j++) {\r\n // loop over a single clause in the bucket\r\n lit=clause[j];\r\n if (lit<0) {vval=varvals[0-lit]; polarity=-1}\r\n else {vval=varvals[lit]; polarity=1};\r\n if (vval===0) {\r\n if (unassigned_count>0) {\r\n //here we must change the watched literal\r\n if (clause[0]===negdlit) {\r\n //current watched is at meta position 0\r\n if (lit===clause[1]) lit=unassigned_lit; // cur lit is the other watched?\r\n clause[0]=lit; // change the watched literal\r\n } else {\r\n //current watched is at meta position 1\r\n if (lit===clause[0]) lit=unassigned_lit; // cur lit is the other watched?\r\n clause[1]=lit; // change the watched literal\r\n }\r\n // add clause to new bucket\r\n if (lit<0) tmpbucket=negbuckets[0-lit];\r\n else tmpbucket=posbuckets[lit];\r\n tmpbucket[0]++;\r\n tmpbucket[tmpbucket[0]]=clause;\r\n // remove clause from current bucket: push the last el of bucket to this pos\r\n bucket[i]=bucket[bucketlen]; // move the last used bucket el to current el\r\n bucket[0]--;\r\n bucketlen--;\r\n i--; // the clause moved here from the end must be iterated over\r\n // cannot derive anything from the clause\r\n useclause=false;\r\n break;\r\n }\r\n unassigned_count++;\r\n unassigned_lit=lit;\r\n } else if (vval===polarity) {\r\n useclause=false;\r\n break;\r\n }\r\n }\r\n if (useclause) {\r\n // clause is not subsumed by varvals and has zero or one unassigned lit\r\n if (unassigned_count===0) {\r\n // clause is false: all literals were cut\r\n if (trace_flag) print_trace(depth,\"value is false\");\r\n // restore varvals, bump activities and return false\r\n for(j=0;j<derivedlen;j++) {\r\n lit=derived[j];\r\n if (lit<0) varvals[0-lit]=0;\r\n else varvals[lit]=0;\r\n }\r\n // increase variable activities for this clause\r\n activity=2*(Math.pow(unit_propagations_count,1.5));\r\n for(j=2; j<clause.length; j++) {\r\n lit=clause[j];\r\n if (lit<0) varactivities[0-lit]+=activity;\r\n else varactivities[lit]+=activity;\r\n }\r\n return false;\r\n }\r\n // here unassigned_count==1, i.e. unassigned_lit is a derived literal\r\n units_derived_count++;\r\n derived[derivedlen]=unassigned_lit;\r\n derivedlen++;\r\n if (unassigned_lit<0) {nr=0-unassigned_lit; polarity=-1}\r\n else {nr=unassigned_lit; polarity=1};\r\n varvals[nr]=polarity;\r\n if (trace_flag) derived_units_txt+=unassigned_lit+\" \";\r\n }\r\n }\r\n // bucket loop ended\r\n }\r\n // main loop ended, not detected to be unsatisfiable\r\n if (trace_flag) {\r\n print_trace(depth,\"value is undetermined\");\r\n if (derived_units_txt.length>0) print_trace(depth,\"derived units \"+derived_units_txt);\r\n }\r\n // if just one assigned, return this literal\r\n if (derivedlen===1) return derived[0];\r\n // else copy all assigned and return the list of all assigned\r\n assigned=new Int32Array(derivedlen);\r\n for(i=0;i<derivedlen;i++) assigned[i]=derived[i];\r\n return assigned;\r\n}", "title": "" }, { "docid": "3e43abf5edc8c6843faa04420d701f52", "score": "0.3648498", "text": "_applyVariables(string, match)\n {\n // Replace total match\n string = string.replaceAll(/\\$0/gi, match[0]);\n\n // Replace match patterns\n string = string.replaceAll(/\\$([1-9][0-9]*)/gi, function(m, p1) {\n // Get the capture group with the specified index\n let index = parseInt(p1);\n if (isNaN(index) || match[index] === undefined)\n throw new Error(\"Variable $\" + p1 + \" is not a valid capture group\")\n\n // Return the corresponding capture group\n return match[index];\n }.bind(this));\n\n // Replace variables\n string = string.replaceAll(/\\$([a-z_][a-z0-9_]*)(?:\\(([^)]*)\\))?/gi, function(m, p1, p2) {\n // Get the variable with the given name\n let value = this.variables[p1];\n\n // If the value is a string\n if (typeof value === \"string\")\n {\n // Replace the variable with the value\n return value;\n }\n\n // If the value is a function\n else if (typeof value == \"function\")\n {\n // Split and parse the parameters\n let params = p2.split(\",\").map(s => JSON.parse(s.trim()));\n\n // Replace the variable with the called function result\n return value(...params);\n }\n\n // If the value is something else\n else\n throw new Error(\"Variable $\" + p1 + \" is not a string or function\");\n }.bind(this));\n\n // Replace literal dollar signs\n string = string.replaceAll(/\\$\\$/g, \"$$\");\n\n // Return the string\n return string;\n }", "title": "" }, { "docid": "da3c21a43d6be62081fe48487969103c", "score": "0.36462379", "text": "function traverse(tree, escaper)\n {\n var sql, i, kids, column, op, value;\n\n // Helper to return a <value>, which may be a parameter, column, or number.\n // The return is escaped properly.\n function getValue(token, escaper)\n {\n // The token could be a column, a parameter, or a number.\n if (token.type === 'column')\n return escaper.escapeFullyQualifiedColumn(token.value);\n else if (token.type === 'parameter')\n {\n // Find the value in the params list (the leading colon is removed).\n var value = params[token.value.substring(1)];\n assert(value !== undefined,\n 'Replacement value for parameter ' + token.value + ' not present.');\n return escaper.escapeLiteral(value);\n }\n else\n return token.value;\n }\n\n switch (tree.token.type)\n {\n case 'comparison-operator':\n // <column> <comparison-operator> <value> (ex. `users`.`name` = :name)\n // where value is a parameter, column, or number.\n column = escaper.escapeFullyQualifiedColumn(tree.children[0].token.value);\n op = compOps[tree.token.value];\n value = getValue(tree.children[1].token, escaper);\n\n return column + ' ' + op + ' ' + value;\n\n case 'null-comparison-operator':\n // <column> <null-operator> <nullable> (ex. `j`.`occupation` IS NULL).\n // Note that if a parameter is used (e.g. {occupation: null}) it's\n // ignored. NULL is blindly inserted since it's the only valid value.\n return escaper.escapeFullyQualifiedColumn(tree.children[0].token.value) + ' ' +\n nullOps[tree.token.value] + ' NULL';\n\n case 'in-comparison-operator':\n // <column> IN (<value> {, <value}) (ex. `shoeSize` IN (10, 10.5, 11)).\n kids = [];\n\n // <column> IN.\n sql = escaper.escapeFullyQualifiedColumn(tree.children[0].token.value) + ' IN ';\n\n // All the values.\n for (i = 1; i < tree.children.length; ++i)\n kids.push(getValue(tree.children[i].token, escaper));\n\n // Explode the values with a comma, and wrap them in parens.\n sql += '(' + kids.join(', ') + ')';\n return sql;\n\n case 'boolean-operator':\n // Each of the children is a <condition>. Put each <condition> in an array.\n kids = tree.children.map(function(child)\n {\n return traverse(child, escaper);\n });\n\n // Explode the conditions on the current boolean operator (AND or OR).\n // Boolean conditions must be wrapped in parens for precedence purposes.\n return '(' + kids.join(' ' + boolOps[tree.token.value] + ' ') + ')';\n\n default:\n // The only way this can fire is if the input parse tree did not come\n // from the ConditionParser. Trees from the ConditionParser are\n // guaranteed to be syntactically correct.\n throw new Error('Unknown type: ' + tree.token.type);\n }\n }", "title": "" }, { "docid": "7ef56441e14db052bcb7efa132fd928c", "score": "0.36450452", "text": "function addExtraNumberedBindings (bindings, variableMatches) {\n variableMatches.forEach(function(pair) {\n var variable = pair[0], matches = pair[1];\n var otherMatches = matches.filter(function(match) { return match != bindings[variable]; });\n shuffleArray(otherMatches);\n otherMatches.forEach(function(match, i) {\n bindings[variable + (i + 2)] = match;\n });\n });\n}", "title": "" }, { "docid": "a918f33abbefa72b763aeb4d0981bb0d", "score": "0.36450243", "text": "function deleteThenAddNode(tree, deletePosition, additional, replaceWithFormula, functions) {\n //wtf\n // functions = 'n/2,m/2,r/2,f/2,k/2,i/1,z/1,e/0,p/0';\n deleteAt = 'pos';\n // remove node at given position and get the data\n deletedPositionFromTree = removeNodeAndGetData(tree.root, deletePosition, deleteAt);\n\n tree3 = new Tree();\n additional.allowPrint = false;\n // parse the given fromula\n var n = parsing(tree3, functions, replaceWithFormula, additional);\n n.root.isfunction = false;\n n.root.isRoot = false;\n n.root.x = deletedPositionFromTree['x'][0];\n n.root.y = deletedPositionFromTree['y'][0];\n n.root.position = deletedPositionFromTree['node'][0];\n newPos = deletedPositionFromTree['parent'][0];\n // updating children potions for the new node\n updateChildren(n.root);\n // add the new node\n addNodeTOPosition(newPos, tree.root, n.root);\n\n console.log('new tree after replacement:', tree);\n printNewTree(tree.root, additional);\n\n\n}", "title": "" }, { "docid": "b7f01197593f07f02905d90dc4884956", "score": "0.36447918", "text": "function updateFieldNames(fields) {\n\n var $ = jQuery.noConflict();\n\n fields.val('');\n\n // update name attribute after cloning with new number using regex\n $.each(fields, function(index) {\n fields.eq(index).attr('name', fields.eq(index).attr('name').replace(/\\[(\\d+)\\]/, function(fullMatch, n) {\n return \"[\" + (Number(n) + 1) + \"]\";\n }));\n });\n\n}", "title": "" }, { "docid": "d5ac1737966d46e36c33a383037ce90f", "score": "0.36423585", "text": "function parseVar(node, noIn, kind) {\n node.declarations = [];\n node.kind = kind;\n for (;;) {\n var decl = startNode();\n decl.id = options.ecmaVersion >= 6 ? toAssignable(parseExprAtom()) : parseIdent();\n checkLVal(decl.id, true);\n decl.init = eat(_eq) ? parseExpression(true, noIn) : (kind === _const.keyword ? unexpected() : null);\n node.declarations.push(finishNode(decl, \"VariableDeclarator\"));\n if (!eat(_comma)) break;\n }\n return node;\n }", "title": "" }, { "docid": "d5ac1737966d46e36c33a383037ce90f", "score": "0.36423585", "text": "function parseVar(node, noIn, kind) {\n node.declarations = [];\n node.kind = kind;\n for (;;) {\n var decl = startNode();\n decl.id = options.ecmaVersion >= 6 ? toAssignable(parseExprAtom()) : parseIdent();\n checkLVal(decl.id, true);\n decl.init = eat(_eq) ? parseExpression(true, noIn) : (kind === _const.keyword ? unexpected() : null);\n node.declarations.push(finishNode(decl, \"VariableDeclarator\"));\n if (!eat(_comma)) break;\n }\n return node;\n }", "title": "" }, { "docid": "792b66269b73ed59a06ea847c57fe498", "score": "0.36375389", "text": "function parse_mtstr(root, node_arr, str_arr) {\n var poly_str = \"\";\n var i = 0, j = 0;\n //console.log(node_arr);\n while (i < root.children.length) {\n var term_text=\"\";\n var child = root.children[i];\n //console.log(\"child\")\n //console.log(child);\n node_selected = false;\n for (var k=0; k<node_arr.length; k++) {\n if (child.model.id === node_arr[k].model.id) {\n node_selected = true;\n term_text = str_arr[k];\n break;\n }\n }\n if (node_selected) {i++; poly_str+=term_text; continue;}\n //console.log(child.children);\n j = 0;\n while (j < child.children.length) {\n var factor_text=\"\";\n var frac_text = [], exp_text = [], binom_text = [], diff_text = \"\", int_text = [];\n var grandchild = child.children[j];\n //console.log(\"grandchild\");\n //console.log(grandchild);\n node_selected = false;\n for (var k=0; k<node_arr.length; k++) {\n if (grandchild.model.id === node_arr[k].model.id) {\n node_selected = true;\n factor_text = str_arr[k];\n break;\n }\n }\n if (node_selected) {j++; term_text+=factor_text; continue;}\n if (grandchild.type === \"rel\") {\n poly_str+=grandchild.text;\n } else if (grandchild.type2 === \"op\") {\n term_text+=grandchild.text;\n } else if (grandchild.type === \"text\") {\n term_text+=\"\\\\text{\" + grandchild.text.replace(/[^\\x00-\\x7F]/g, \" \") + \"}\"; //change strange whitespaces to standard whitespace\n } else {\n switch (grandchild.type2) {\n case \"normal\":\n factor_text+=grandchild.text;\n break;\n case \"group\":\n factor_text = \"(\" + parse_mtstr(grandchild, node_arr, str_arr) + \")\";\n break;\n case \"diff\":\n case \"frac\":\n frac_text[0] = parse_mtstr(grandchild.children[0], node_arr, str_arr);\n frac_text[1] = parse_mtstr(grandchild.children[1], node_arr, str_arr);\n for (var l=0; l<2; l++) {\n for (var k=0; k<node_arr.length; k++) {\n if (grandchild.children[l].model.id === node_arr[k].model.id) {\n frac_text[l] = str_arr[k];\n break;\n }\n }\n }\n factor_text = \"\\\\frac{\" + frac_text[0] + \"}{\" + frac_text[1] + \"}\";\n break;\n case \"diff\":\n diff_text = parse_mtstr(grandchild.children[0], node_arr, str_arr);\n for (var k=0; k<node_arr.length; k++) {\n if (grandchild.children[0].model.id === node_arr[k].model.id) {\n frac_text[0] = str_arr[k];\n break;\n }\n }\n factor_text = \"\\\\frac{d}{d\" + diff_text + \"}\"\n break;\n case \"binom\":\n binom_text[0] = parse_mtstr(grandchild.children[0], node_arr, str_arr);\n binom_text[1] = parse_mtstr(grandchild.children[1], node_arr, str_arr);\n for (var l=0; l<2; l++) {\n for (var k=0; k<node_arr.length; k++) {\n if (grandchild.children[l].model.id === node_arr[k].model.id) {\n binom_text[l] = str_arr[k];\n break;\n }\n }\n }\n factor_text = \"\\\\binom{\" + binom_text[0] + \"}{\" + binom_text[1] + \"}\"\n break;\n case \"int\":\n int_text[0] = parse_mtstr(grandchild.children[0], node_arr, str_arr);\n int_text[1] = parse_mtstr(grandchild.children[1], node_arr, str_arr);\n for (var l=0; l<2; l++) {\n for (var k=0; k<node_arr.length; k++) {\n if (grandchild.children[l].model.id === node_arr[k].model.id) {\n int_text[l] = str_arr[k];\n break;\n }\n }\n }\n factor_text = \"\\\\int_{\" + int_text[1] + \"}^{\" + int_text[0] + \"}\"\n break;\n case \"sqrt\":\n factor_text = \"\\\\sqrt{\" + parse_mtstr(grandchild, node_arr, str_arr) + \"}\";\n break;\n case \"exp\":\n exp_text[0] = grandchild.children[0].text;\n exp_text[1] = parse_mtstr(grandchild.children[1], node_arr, str_arr);\n for (var l=0; l<2; l++) {\n for (var k=0; k<node_arr.length; k++) {\n if (grandchild.children[l].model.id === node_arr[k].model.id) {\n exp_text[l] = str_arr[k];\n break;\n }\n }\n }\n factor_text = exp_text[0] + \"^{\" + exp_text[1] + \"}\";\n break;\n case \"group_exp\":\n exp_text[0] = parse_mtstr(grandchild.children[0], node_arr, str_arr);\n exp_text[1] = parse_mtstr(grandchild.children[1], node_arr, str_arr);\n //console.log(grandchild.children);\n for (var l=0; l<2; l++) {\n for (var k=0; k<node_arr.length; k++) {\n if (grandchild.children[l].model.id === node_arr[k].model.id) {\n exp_text[l] = str_arr[k];\n break;\n }\n }\n }\n factor_text = \"(\" + exp_text[0] + \")\" + \"^{\" + exp_text[1] + \"}\";\n break;\n }\n term_text+=factor_text;\n }\n j++;\n };\n i++;\n poly_str+=term_text;\n //console.log(poly_str);\n };\n\n return poly_str;\n}", "title": "" }, { "docid": "4219cfdf9bbeb784a6cb96988237c033", "score": "0.36342147", "text": "function VariablesInAllowedPosition(context) {\n var varDefMap = Object.create(null);\n\n return {\n OperationDefinition: {\n enter: function enter() {\n varDefMap = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n\n usages.forEach(function (_ref) {\n var node = _ref.node,\n type = _ref.type;\n\n var varName = node.name.value;\n var varDef = varDefMap[varName];\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n var schema = context.getSchema();\n var varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type);\n if (varType && !(0, _typeComparators.isTypeSubTypeOf)(schema, effectiveType(varType, varDef), type)) {\n context.reportError(new _error.GraphQLError(badVarPosMessage(varName, varType, type), [varDef, node]));\n }\n }\n });\n }\n },\n VariableDefinition: function VariableDefinition(node) {\n varDefMap[node.variable.name.value] = node;\n }\n };\n}", "title": "" }, { "docid": "4219cfdf9bbeb784a6cb96988237c033", "score": "0.36342147", "text": "function VariablesInAllowedPosition(context) {\n var varDefMap = Object.create(null);\n\n return {\n OperationDefinition: {\n enter: function enter() {\n varDefMap = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n\n usages.forEach(function (_ref) {\n var node = _ref.node,\n type = _ref.type;\n\n var varName = node.name.value;\n var varDef = varDefMap[varName];\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n var schema = context.getSchema();\n var varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type);\n if (varType && !(0, _typeComparators.isTypeSubTypeOf)(schema, effectiveType(varType, varDef), type)) {\n context.reportError(new _error.GraphQLError(badVarPosMessage(varName, varType, type), [varDef, node]));\n }\n }\n });\n }\n },\n VariableDefinition: function VariableDefinition(node) {\n varDefMap[node.variable.name.value] = node;\n }\n };\n}", "title": "" } ]
dc24b7c6f5de24585b5319578fb21756
Increase weight of tag.
[ { "docid": "7d0bd1ec89ed30af2d23d914ae59f52f", "score": "0.0", "text": "increaseValue() {\n this.value++;\n }", "title": "" } ]
[ { "docid": "106798c0a311b31d5610178706ce3295", "score": "0.7412746", "text": "set weight(newWeight) {\n this._weight = newWeight\n }", "title": "" }, { "docid": "f6187a3a195988927bba7ce9c292803e", "score": "0.66167736", "text": "function setWeight(weight){\r\n\t\tmyWeight = weight;\r\n\t\t$(\"div#weight\").text(weight);\r\n\t}", "title": "" }, { "docid": "e102dfcdac5b28e9192f26e40fab11bb", "score": "0.64915025", "text": "function updateWeight(growthInputFieldValue) {\n\t\t\tthis.weight = this.weight + growthInputFieldValue;\n\t\t}", "title": "" }, { "docid": "8abeff19bef8d8335bc30af00f76b6f3", "score": "0.6285622", "text": "function activate(weight) {\n return weight > 0 ? weight : 0.01 * weight;\n }", "title": "" }, { "docid": "29688665cff05c5fc5f4e5e51c77c167", "score": "0.62573594", "text": "set theWeight(value) {\n\t\treturn (this._weight = value);\n\t}", "title": "" }, { "docid": "985cf93554ef3f7f991479a0978f7662", "score": "0.61464065", "text": "function setWeight( action, weight ) {\n\t action.enabled = true;\n\t action.setEffectiveTimeScale( 1 );\n\t action.setEffectiveWeight( weight );\n }", "title": "" }, { "docid": "2a14bc5d1ef87c61723764b012a90c8b", "score": "0.61460644", "text": "function di_Scatter3dCustomLabelWeight(uid,weight)\n{\n\tvar scatter3dObject = di_getChartObject(uid);\n\tscatter3dObject.SetNoteLabelWeight(weight);\n\tvar scatter3dSettingsObject = di_getScatter3dSettings(uid);\n\tscatter3dSettingsObject.note.style.fontWeight= weight;\n\tdi_setScatter3dSettings(uid,scatter3dSettingsObject);\n}", "title": "" }, { "docid": "ffaaef576a646b5f171ae8456864d1e6", "score": "0.6025386", "text": "function setWeight(action, weight) {\r\n\r\n action.enabled = true;\r\n action.setEffectiveTimeScale(1);\r\n action.setEffectiveWeight(weight);\r\n\r\n}", "title": "" }, { "docid": "8644086fc00781c0f8cad9556cb03eac", "score": "0.6004532", "text": "function update_product_weight (product_div) {\n\treturn update_product_asset(product_div, 'weight');\n}", "title": "" }, { "docid": "58754346f414e856a4144f24a5b31f4b", "score": "0.59832335", "text": "setWeight(action, weight) {\n\t\taction.enabled = true;\n\t\taction.setEffectiveTimeScale(1);\n\t\taction.setEffectiveWeight(weight);\n\t}", "title": "" }, { "docid": "dc73d25a9af8b5500dfa577f59bb8a3c", "score": "0.5915649", "text": "insertWeightText() {\n this.ctx.font = '15px Arial';\n this.ctx.fillStyle = invertHex(this.color);\n const fontIncrement = this.weight?.toString().length > 1 ? 10 : 5\n this.ctx.fillText(this.weight?.toString(), this.points.center.x-fontIncrement, this.points.center.y+fontIncrement);\n }", "title": "" }, { "docid": "c0eda0beff74f601fd5c75fd031e1aba", "score": "0.58860475", "text": "function updateWeights() {\n if (!scoreAssetCreationParameters.damageAssetPath) return;\n const newPovertyWeight =\n Number(document.getElementById('poverty weight').value);\n setInnerHtml(povertyWeightValueId, newPovertyWeight.toFixed(2));\n setInnerHtml(damageWeightValueId, (1 - newPovertyWeight).toFixed(2));\n}", "title": "" }, { "docid": "46a7a01f9431e05eac2587328f7a6476", "score": "0.5847353", "text": "function updateWeight() {\n var metres = curHeight / 100;\n curWeight = Math.round(curBmi * (metres * metres))\n}", "title": "" }, { "docid": "01b7f538dbd00cdf9940d2d400de905d", "score": "0.58453697", "text": "get weight() {\n return this.getNumberAttribute('weight');\n }", "title": "" }, { "docid": "cc610480e7605a6bf823878f5bcae959", "score": "0.5818934", "text": "function reweight(v, changed) {\n var w = state.weights.split(\"/\");\n w[changed] = String(v / 10.0);\n state.weights = w.join(\"/\");\n doUpdate = true;\n}", "title": "" }, { "docid": "a7f718490e9a5b5448063f37e4bd3651", "score": "0.5789462", "text": "setEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}", "title": "" }, { "docid": "a7f718490e9a5b5448063f37e4bd3651", "score": "0.5789462", "text": "setEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}", "title": "" }, { "docid": "a7f718490e9a5b5448063f37e4bd3651", "score": "0.5789462", "text": "setEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}", "title": "" }, { "docid": "070c6b7a1a7c76160899ce229afc045a", "score": "0.570812", "text": "function di_Scatter3dSourceLabelWeight(uid,weight)\n{\n\tvar scatter3dObject = di_getChartObject(uid);\n\tscatter3dObject.SetSourceLabelWeight(weight);\n\tvar scatter3dSettingsObject = di_getScatter3dSettings(uid);\n\tscatter3dSettingsObject.source.style.fontWeight= weight;\n\tdi_setScatter3dSettings(uid,scatter3dSettingsObject);\n}", "title": "" }, { "docid": "26a099b0543c0afb91992f5e665518f1", "score": "0.5682803", "text": "setWeight(index, weight) {\n if (!this.weights) {\n throw new Error('Not a Rational BSpline');\n }\n if (index < 0 || index >= this.weights.shape[0]) {\n throw new Error('Index out of bounds');\n }\n this.weights.set(index, weight);\n }", "title": "" }, { "docid": "6263f8d63459d69903f556dc4a45140b", "score": "0.55871505", "text": "function SetShoppingListItemWeight(itemID, itemTypeID, quantity, weight) \n{\n // Keep track of the last updated.\n LastShoppingListIdUpdated = itemID;\n\n // Call the method to update the weight\n UpdateShoppingListItemWeight(document.URL, GSNContext.RequestArguments, itemID, itemTypeID, quantity, weight, HandleSetShoppingListItemWeight, null);\n}", "title": "" }, { "docid": "490608920b82a6b387183c1543804814", "score": "0.5583294", "text": "function editWeight(weight, unit) {\n if (unit == WEIGHT_STONE) {\n var sgn = (weight < 0) ? \"-\" : \"\";\n weight = Math.abs(weight);\n var stones = Math.floor(weight / 14);\n var lbs = weight - (stones * 14);\n//alert(\"Stoner \" + weight + \" \" + stones + \" \" + lbs);\n return (sgn + stones.toFixed(0)) + \" \" +\n ((lbs < 10) ? \" \" : \"\") + lbs.toFixed(1).replace(/\\./, decimalCharacter);\n } else {\n return weight.toFixed(1).replace(/\\./, decimalCharacter);\n }\n }", "title": "" }, { "docid": "9edb349a40136263bc87e6e72fbdfcff", "score": "0.5573089", "text": "setWeight(v) {\n this.distance = 1 / Math.abs(parseFloat(v) || 0);\n return this;\n }", "title": "" }, { "docid": "db38538638c82fb5455b1ba111fed0f0", "score": "0.5490272", "text": "get getTheWeight() {\n\t\treturn this._weight;\n\t}", "title": "" }, { "docid": "69104519a1754b2db9a2a559b828fba8", "score": "0.5463147", "text": "function updateWeightSliders() {\n\t settings[ 'modify idle weight' ] = idleWeight;\n\t settings[ 'modify walk weight' ] = walkWeight;\n\t settings[ 'modify run weight' ] = runWeight;\n }", "title": "" }, { "docid": "9bb54a0dabaadfa772dbfe8040fff786", "score": "0.54339385", "text": "accumulateAdditive( weight ) {\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = stride * this._addIndex;\n\n\t\tif ( this.cumulativeWeightAdditive === 0 ) {\n\n\t\t\t// add = identity\n\n\t\t\tthis._setIdentity();\n\n\t\t}\n\n\t\t// add := add + incoming * weight\n\n\t\tthis._mixBufferRegionAdditive( buffer, offset, 0, weight, stride );\n\t\tthis.cumulativeWeightAdditive += weight;\n\n\t}", "title": "" }, { "docid": "9bb54a0dabaadfa772dbfe8040fff786", "score": "0.54339385", "text": "accumulateAdditive( weight ) {\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = stride * this._addIndex;\n\n\t\tif ( this.cumulativeWeightAdditive === 0 ) {\n\n\t\t\t// add = identity\n\n\t\t\tthis._setIdentity();\n\n\t\t}\n\n\t\t// add := add + incoming * weight\n\n\t\tthis._mixBufferRegionAdditive( buffer, offset, 0, weight, stride );\n\t\tthis.cumulativeWeightAdditive += weight;\n\n\t}", "title": "" }, { "docid": "a58ea1fb9c6afdec45cea283712443c7", "score": "0.54282516", "text": "function make_font_weight_bold(){\r\n this.style.fontWeight = 'bold';\r\n}", "title": "" }, { "docid": "d8e37af0ee556872c6fa12dd454aa841", "score": "0.54112244", "text": "function make_font_weight_normal(){\r\n this.style.fontWeight = 'normal';\r\n}", "title": "" }, { "docid": "3240f401d9ba2377c5e64cafc257b0de", "score": "0.5393458", "text": "function textFontIncrease() {\n\t\tvar selectedObject = myPPTApp.getSelectedObject();\n\t\tif (selectedObject != null) {\n\t\t\tvar currentFontSize = selectedObject.getProperties(0)['font-size'];\n\t\t\tcurrentFontSize = parseFloat(currentFontSize) + 2;\n\t\t\tselectedObject.setProperties(0,{'font-size':currentFontSize});\n\t\t}\n\t}", "title": "" }, { "docid": "bac4ddf99427e247de94e9b0421256f4", "score": "0.538876", "text": "function updateW(id, option) {\n var transaction = db.transaction([\"note\"], \"readwrite\");\n var objectStore = transaction.objectStore(\"note\");\n\n request = objectStore.get(id);\n\n request.onsuccess = function(event){\n\n var xtraweight = 2.5;\n var oldweight = Number(request.result.weight);\n \n if(option == \"inc\") {\n var newweight = oldweight + xtraweight;\n } else {\n var newweight = oldweight - xtraweight;\n } \n request.result.weight = newweight;\n objectStore.put(request.result);\n\n displayNotes(day);\n event.preventDefault();\n };\n\n }", "title": "" }, { "docid": "433a98aeed29ce9771977334a4a21b00", "score": "0.53857464", "text": "function activate$3(weight) {\n return Math.max(0, weight);\n }", "title": "" }, { "docid": "7afcf048232cead3256b9c151eecf498", "score": "0.53722787", "text": "set_font_weight(val) {\n\t\tif (val === \"regular\") {\n\t\t\tthis._fontWeight = \"normal\";\n\t\t\tthis._fontStyle = \"normal\";\n\t\t}\n\t\tif (val === \"bold\") {\n\t\t\tthis._fontWeight = \"bold\";\n\t\t\tthis._fontStyle = \"normal\";\n\t\t}\n\t\tif (val === \"italic\") {\n\t\t\tthis._fontWeight = \"normal\";\n\t\t\tthis._fontStyle = \"italic\";\n\t\t}\n\t\tif (val === \"bold italic\") {\n\t\t\tthis._fontWeight = \"bold\";\n\t\t\tthis._fontStyle = \"italic\";\n\t\t}\n\t}", "title": "" }, { "docid": "9c5f1e9c08933332ed409a45da3feda5", "score": "0.5363031", "text": "mutateCgWeight() {\n var changeProb = Math.random(1);\n\n if (changeProb < 0.1) {\n this.weight = random(-1, 1);\n } else {\n var plusOrMinus = [-1, 1][(Math.random() * 2) | 0];\n var changeValue = (Math.random() * 0.1);\n\n this.weight = this.weight + (plusOrMinus * changeValue * this.weight);\n\n if (this.weight > 1) {\n this.weight = 1;\n }\n if (this.weight < -1) {\n this.weight = -1;\n }\n }\n }", "title": "" }, { "docid": "13653096851d19e36f5fc1bfe6860807", "score": "0.5345484", "text": "function weight_field(node) {\n return find_property(node, \"weight\");\n }", "title": "" }, { "docid": "5f97cc6f0b82e553b4c9a2da17563a99", "score": "0.53406304", "text": "increaseSpeed() {\n this.speed += 1;\n }", "title": "" }, { "docid": "73767ee681e4fbea4bdb083d5e0c30af", "score": "0.534041", "text": "weight()\n\t\t{\n\t\t\t\treturn this.world.gravity * this.material.mass;\n\t\t}", "title": "" }, { "docid": "8ad67353b03eb08630e1a4230d88cee6", "score": "0.5313884", "text": "function WeightedNode(value, weight) {\n this.value = value;\n this.weight = weight;\n\n this.balanced = true;\n this.left = null;\n this.right = null;\n }", "title": "" }, { "docid": "ccc5f0829e231cb161d311d5eb13a765", "score": "0.5306244", "text": "function setActiveWeights() {\n\tsetActiveElements();\n\tlet act = player.a.activeElements;\n\tlet weightArr = player.a.elementWeights;\n\tlet total = new Decimal(0);\n\tfor (let i = 0; i < act.length; i++) {\n\t\tlet elem = elementData[act[i]];\n\t\tlet weight = getElementWeight(elem.position);\n\t\tplayer.a.elementWeights[elem.position] = weight;\n\t\ttotal = total.add(weight);\n\t}\n\tplayer.a.totalElementalWeight = total;\n}", "title": "" }, { "docid": "eb64ae0e7ed654beba309e0d9645cbfe", "score": "0.53039324", "text": "constructor(vertex1, vertex2, weight) {\r\n\t\tsuper(vertex1, vertex2)\r\n\t\tthis.weight = weight\r\n\t}", "title": "" }, { "docid": "2203025be96205fbb78b5d52e4101510", "score": "0.5278655", "text": "function extraWeight() {\n if (extra.innerText === 'Extra gewicht op deze vraag?') {\n extra.innerText = 'Minder gewicht op deze vraag?';\n ExtraPunt = 1;\n } else {\n extra.innerText = 'Extra gewicht op deze vraag?';\n ExtraPunt = 0;\n }\n}", "title": "" }, { "docid": "7f31e7189773609290d5c89c57748e99", "score": "0.5278116", "text": "function Weight() {\n\tthis.value = Math.random() * .2 - .1;\n\tthis.gradient = 0;\n}", "title": "" }, { "docid": "fe15b3998e8efe938f64ff562588be2a", "score": "0.5276365", "text": "function setElementWeights() {\n\tif (!player) return\n\t//setActiveElements();\n\t//let act = player.a.activeElements;\n\tlet weightArr = player.a.elementWeights;\n\tlet scale = player.a.elementalRarityScaling;\n\tlet currentWeight = new Decimal(1);\n\tlet total = new Decimal(0);\n\tfor (let i = 0; i < weightArr.length; i++) {\n\t\tplayer.a.elementWeights[i] = currentWeight;\n\t\ttotal = total.add(currentWeight);\n\t\tcurrentWeight = currentWeight.div(scale);\n\t}\n\tplayer.a.totalElementalWeight = total;\n}", "title": "" }, { "docid": "ad63efde69fa49f405c609b6e068de11", "score": "0.52658504", "text": "function getElementWeight(id) {\n\tlet base = new Decimal(1);\n\tlet scale = player.a.elementalRarityScaling;\n\treturn base.div(new Decimal(scale).pow(id))\n}", "title": "" }, { "docid": "378cd5a72dc21e136f88f51774c9b575", "score": "0.5225997", "text": "default_weight(distance) {\n return 1;\n }", "title": "" }, { "docid": "2bfb8d3fbc60403a7f9254a2dac15381", "score": "0.52097607", "text": "handleIncreaseLikes(photoLikesElement) {\n this.likes++;\n this.totalLikes++;\n photoLikesElement.innerHTML = this.likes;\n document.getElementById(\"totalLikes\").innerHTML = this.totalLikes;\n }", "title": "" }, { "docid": "38cec868acdc432702bf15ce4bc27c50", "score": "0.5194234", "text": "function targetIncrement(worker, isWorker){\n // always increment target, so everyone's in sync\n worker.target++;\n worker.target = worker.target > worker.targets.length - 1 ? -1 : worker.target;\n if(!isWorker)\n {\n // don't wrap weight targets\n worker.weightTarget++;\n }\n }", "title": "" }, { "docid": "0f0f55789ddd8ee961055234ab62628b", "score": "0.5165528", "text": "function di_Scatter3dTitleWeight(uid,weight)\n{\n\tvar scatter3dObject = di_getChartObject(uid);\n\tscatter3dObject.SetTitleWeight(weight);\n\tvar scatter3dSettingsObject = di_getScatter3dSettings(uid);\n\tscatter3dSettingsObject.title.style.fontWeight= weight;\n\tdi_setScatter3dSettings(uid,scatter3dSettingsObject);\n}", "title": "" }, { "docid": "8b5f6304523025fad93e721228ec27bf", "score": "0.5099269", "text": "function UpdateAttributes(throttle_ : float, currentGear_ : int, currentEnginePower_ : float)\n{\n\tcurrentGear = currentGear_;\n\tcurrentEnginePower = currentEnginePower_;\n}", "title": "" }, { "docid": "613c959d9d57c022d4459b40c9cf7c76", "score": "0.5097973", "text": "function drawEdgeWeight(canvas, idEdge, x, y, w) {\n canvas.append(\"text\")\n .attr(\"id\", \"w_\" + idEdge)\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(w)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"14px\")\n .attr(\"fill\", \"red\")\n .attr(\"font-weight\", \"bold\");\n}", "title": "" }, { "docid": "523d75a8b54e0545dc6223dec3d8fdcc", "score": "0.50955826", "text": "function setTagName( newTagName ) {\n tagName = newTagName;\n }", "title": "" }, { "docid": "5d07963c9018e084f93d4dc60be9fc44", "score": "0.5088505", "text": "function addSkillPoint(skill) {\n if (attributePoints > 0){\n skill.rating++;\n attributePoints--;\n getNewSkillsRating(overallSkills);\n }\n}", "title": "" }, { "docid": "c268cc8c0b47345ad58692e17d62c32a", "score": "0.50861585", "text": "setWidth(name, value) {\r\n\t\tthis.setAttribute(name, \"stroke-width\", value);\r\n\t}", "title": "" }, { "docid": "2993afcdf4f9344f468692f02a6f099b", "score": "0.507507", "text": "update_score(gain) {\n this.score += gain;\n }", "title": "" }, { "docid": "17777ba17b7e8f7e9bfae91e73cfcd96", "score": "0.5063482", "text": "function add(img1, img2, weight) {\n return blend(img1, img2, function(a, b){return a.mul(weight).add(b.mul(1-weight));});\n}", "title": "" }, { "docid": "da18fde1c97ac8e51fb4f6b653e4c5f9", "score": "0.5045311", "text": "function format_weight(number, symbol) {\n\tvar symbol = (symbol == null) ? (asset_symbols['weight'] ? asset_symbols['weight'] : 'kg') : symbol;\n\n\tif(number.toFixed) {\n\t\treturn '(' + commafy(number.toFixed(3)) + symbol + ')';\n\t}\n\treturn '(' + commafy(number) + symbol + ')';\n}", "title": "" }, { "docid": "6cb19d9ebc0960b49394023b6fc0c234", "score": "0.50380594", "text": "set separation (weight) {\n this.boidsArray.forEach((boid) => boid.separationWeight = weight);\n }", "title": "" }, { "docid": "4f336ec66974e85194d329990ec17446", "score": "0.5027015", "text": "function increase() {\n setcount(count + 1);\n }", "title": "" }, { "docid": "7cd14fb9bfe56d6eaba519097a1bafe2", "score": "0.49849412", "text": "function nmoTextFontWeight(o, j, d) {\n if (d === o) { return \"bold\"; }\n return textFontWeight(o, j);\n }", "title": "" }, { "docid": "963d143d8fcfd35159f293166183db91", "score": "0.49667892", "text": "function add_knowledge(k, weight) {\n\tfor (key of Object.keys(k)) { //for each entry in the knowledge\n\t\tif (!Object.keys(knowledge).includes(key)) { //make sure entry key exists\n\t\t\tknowledge[key] = [];\n\t\t}\n\t\tlet rule = knowledge[key];\n\t\tfor (continuation of k[key]) {\n\t\t\t//continuation[0] is count, continuation[1] is new chord name. must find it in rule\n\t\t\tlet found = false;\n\t\t\tfor (possible_continuation of rule) {\n\t\t\t\tif (possible_continuation[1] == continuation[1]) {\n\t\t\t\t\tpossible_continuation[0] += continuation[0] * weight;\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\trule.push([continuation[0]*weight, continuation[1]]);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c52e23cc57df7221d8065206285bbf51", "score": "0.49623895", "text": "function changeIncrement(newIncrement) {\n increment = newIncrement;\n }", "title": "" }, { "docid": "50dc5699db3059a16243767bbe4fd3f0", "score": "0.4949875", "text": "function AbilityIncrease(name, description, shortdescription, ability, bonus) {\n var _this = _super.call(this, name, description, shortdescription) || this;\n _this.Ability = ability;\n _this.Bonus = bonus;\n return _this;\n }", "title": "" }, { "docid": "0ebee4a505045aab7abcc415eba836c2", "score": "0.4945705", "text": "function incrementwater() {\n setwater(prevCount => (parseFloat(prevCount) + parseFloat(waternum)).toFixed(2));\n setaddedwater(prevCount => (parseFloat(prevCount) + parseFloat(waternum)).toFixed(2));\n setwaterperc(wGoal?(100*(parseFloat(water) + parseFloat(waternum))/wGoal).toFixed(2):100);\n }", "title": "" }, { "docid": "afb083d70db0dc228bcfbb362834da7e", "score": "0.49401146", "text": "setWeights(w) {\r\n\t\tlet newWeights = [];\r\n\t\t// For every layer\r\n\t\tfor (let i = 0; i < w.length; i++) {\r\n\t\t\tlet newi = [];\r\n\t\t\t// For evrery node\r\n\t\t\tfor (let j = 0; j < w[i].length; j++) {\r\n\t\t\t\tlet newj = [];\r\n\t\t\t\t// Fore very weight connected to the node\r\n\t\t\t\tfor (let z = 0; z < w[i][j].length; z++) {\r\n\t\t\t\t\tnewj.push(w[i][j][z]);\r\n\t\t\t\t}\r\n\t\t\t\tnewi.push(newj);\r\n\t\t\t}\r\n\t\t\tnewWeights.push(newi);\r\n\t\t}\r\n\t\t\r\n\t\tthis.weights = newWeights;\r\n\t}", "title": "" }, { "docid": "bef54d9fc1d46c024cb4754263c06ed1", "score": "0.49312967", "text": "_setIncrease() {\n let x = this.value[0] + this.step;\n let y = this.value[1] + this.step;\n x = Math.min(this.max, Math.max(this.min, x));\n y = Math.min(this.max, Math.max(this.min, y));\n this._setValue(x, y);\n }", "title": "" }, { "docid": "5a28386f9d4cb1195b537b34066bb8a8", "score": "0.4930383", "text": "function getClassWeight(e) {\n var weight = 0;\n\n // Look for a special classname\n if (typeof(e.className) === \"string\" && e.className !== \"\") {\n if (REGEXPS.negative.test(e.className))\n weight -= 25;\n\n if (REGEXPS.positive.test(e.className))\n weight += 25;\n }\n\n // Look for a special ID\n if (typeof(e.id) === \"string\" && e.id !== \"\") {\n if (REGEXPS.negative.test(e.id))\n weight -= 25;\n\n if (REGEXPS.positive.test(e.id))\n weight += 25;\n }\n\n return weight;\n}", "title": "" }, { "docid": "bdb25469ab440e6344e139530955ecaf", "score": "0.49265313", "text": "function increaseCount(event) {\n let id = event.target.parentNode.dataset.id\n let upLikes = event.target.parentNode.children[2]\n upLikes.innerText = parseInt(upLikes.innerText) + 1\n\n //fetch PATCH to update database\n fetch(`http://localhost:3000/toys/${id}`, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({likes: upLikes.innerText})\n })\n }", "title": "" }, { "docid": "45d8558d50579321c82af1830eb7274b", "score": "0.49245965", "text": "drink() {\n this.thirst += 10;\n }", "title": "" }, { "docid": "6de37deed0818780b6e48b5eb8890fd8", "score": "0.49100757", "text": "function water10() {\n setwaternum(10);\n }", "title": "" }, { "docid": "e89ae28089170028e8186f1b50cc2ee5", "score": "0.4906167", "text": "function YWeighScale_setupSpan(currWeight,maxWeight)\n {\n return this.set_command(\"S\"+String(Math.round(Math.round(1000*currWeight)))+\":\"+String(Math.round(Math.round(1000*maxWeight))));\n }", "title": "" }, { "docid": "487ee8c4bfb54f998425865be1a2a861", "score": "0.4900469", "text": "function insertAdjacentImpl(v_i, weight)\r\n{\r\n this.adjacent.insert(new Edge(v_i, weight));\r\n}", "title": "" }, { "docid": "a6e8fa4f4768f9c1933d02906119c735", "score": "0.48963982", "text": "function convertWeight (num) {\n return num / 2.2;\n}", "title": "" }, { "docid": "16a15df69d984259a43261f77b1ecbb3", "score": "0.4894309", "text": "function weight(mass, gravity){\n let weight =mass *gravity;\n return weight;\n}", "title": "" }, { "docid": "38042c8436e46776a307ff5a3a979b1f", "score": "0.4891099", "text": "gainScore() {\n this.score += 100;\n }", "title": "" }, { "docid": "4d19660e518c6f39bfa55b728e7810e7", "score": "0.48873723", "text": "function Participant_getWeight(theNode) {\n \n //get the weight information\n var retVal = this.location;\n\n //if the insert weight is nodeAttribute, add the position of the matched string\n if (retVal == \"nodeAttribute\") {\n \n //get the node string\n var nodeStr = SB_convertNodeToString(theNode);\n\n var foundPos = SB_findPatternsInString(nodeStr, this.quickSearch, \n this.searchPatterns);\n\n if (foundPos) {\n retVal += \"+\" + foundPos[0] + \",\" + foundPos[1];\n }\n }\n\n return retVal;\n}", "title": "" }, { "docid": "2b76569911142170ee5f79b238498a86", "score": "0.4886041", "text": "function enterWeight(e){\n document.querySelector('#output').style.visibility = 'visible';\n let lbs = e.target.value;\n document.querySelector('#gramsOuput').innerHTML = lbs/0.0022046;\n document.querySelector('#kgOuput').innerHTML = lbs/2.2046;\n document.querySelector('#ozOuput').innerHTML = lbs*16;\n}", "title": "" }, { "docid": "b6ec18b510233e23d1e0632ca0e37171", "score": "0.4883101", "text": "function increaseOne(id){\n \n let targetedInput = document.querySelector(\".qte\" + id);\n let int = parseInt(targetedInput.value) +1 ;\n targetedInput.setAttribute(\"value\", int);\n\n }", "title": "" }, { "docid": "8791c2d4c02a26925f34c8c9351c7152", "score": "0.4879675", "text": "adjustWeights() {\n const { learningRate, momentum } = this.trainOpts;\n for (let layer = 1; layer <= this.outputLayer; layer++) {\n const incoming = this.outputs[layer - 1];\n const activeSize = this.sizes[layer];\n const activeDelta = this.deltas[layer];\n const activeChanges = this.changes[layer];\n const activeWeights = this.weights[layer];\n const activeBiases = this.biases[layer];\n for (let node = 0; node < activeSize; node++) {\n const delta = activeDelta[node];\n for (let k = 0; k < incoming.length; k++) {\n let change = activeChanges[node][k];\n change = learningRate * delta * incoming[k] + momentum * change;\n activeChanges[node][k] = change;\n activeWeights[node][k] += change;\n }\n activeBiases[node] += learningRate * delta;\n }\n }\n }", "title": "" }, { "docid": "c068aad49c0c56ba0ae484349ea452f1", "score": "0.4856066", "text": "UpdateWeights(learnRate, momentum) {\n let prevDelta = this.BiasDelta;\n this.BiasDelta = learnRate * this.Gradient;\n this.Bias += this.BiasDelta + momentum * prevDelta;\n\n this.InputSynapses.forEach(synapse => {\n prevDelta = synapse.WeightDelta;\n synapse.WeightDelta = learnRate * this.Gradient * synapse.InputNeuron.Value;\n synapse.Weight += synapse.WeightDelta + momentum * prevDelta;\n });\n }", "title": "" }, { "docid": "861e5dc60cc61182143c916ac45a1efc", "score": "0.48557195", "text": "constructor(start, end, weight = 1) {\n this.start = start;\n this.end = end;\n this.weight = weight;\n }", "title": "" }, { "docid": "b6124c2c46300b8eb56aade73b956341", "score": "0.48556563", "text": "setStrokeWeight(strokeWeight) {\n if (typeof strokeWeight === \"number\") {\n this.objects.forEach((obj) => {\n obj.setStyle(\"strokeWeight\", strokeWeight);\n });\n }\n else {\n console.error(\"setStrokeWeight(): please enter a number.\");\n }\n }", "title": "" }, { "docid": "4db627587e8b4fcd8d94d761b75a7071", "score": "0.48493567", "text": "increase() {\n this._increm(this.step || 1);\n }", "title": "" }, { "docid": "22ae5324ed17faf66afd06192f89c8b4", "score": "0.48474413", "text": "ageUp() {\n this.age += 1;\n this.height += 1;\n this.weight += 1;\n this.mood += 1;\n this.bankAccount += 10;\n }", "title": "" }, { "docid": "f7dc942988e2fa748ff3ec8723b3505f", "score": "0.48432323", "text": "function increase() {\n let num = parseInt(myH1.innerText) \n num = num + 1\n myH1.innerText = num\n}", "title": "" }, { "docid": "4c63aff80bf4c5037cb1e0981893378a", "score": "0.48397747", "text": "function cartWeightSliderFn(scope) {\n\t/**store the number of weight in the cart according to slider movement*/\n\tvar _weight = scope.weight1 / 10;\n\t/**check the number of weight is greater than initial weight, then displaying\n\tthe selected cart weights */\n\tif (weight_cart < _weight) {\n\t\tcartWeightArrangement(1,_weight,1);\n\t}\n\t/**otherwise, hiding the previously displayed cart weights */\n\telse {\n\t\tcartWeightArrangement( _weight + 1,weight_cart,0);\n\t}\n\t/**Assigning previous value as current weight value*/\n\tweight_cart = _weight;\n}", "title": "" }, { "docid": "bd66f436c6ac62ae6c1456a22921cb82", "score": "0.48359123", "text": "function newWeight(block, startBlock, endBlock, startWeight, endWeight) {\n let minBetweenEndBlockAndThisBlock; // This allows for pokes after endBlock that get weights to endWeights\n if (block.number > endBlock) {\n minBetweenEndBlockAndThisBlock = endBlock;\n } else {\n minBetweenEndBlockAndThisBlock = block.number;\n }\n\n const blockPeriod = endBlock - startBlock;\n\n if (startWeight >= endWeight) {\n const weightDelta = startWeight - endWeight;\n return startWeight - ((minBetweenEndBlockAndThisBlock - startBlock) * (weightDelta / blockPeriod));\n }\n const weightDelta = endWeight - startWeight;\n return startWeight + ((minBetweenEndBlockAndThisBlock - startBlock) * (weightDelta / blockPeriod));\n}", "title": "" }, { "docid": "3325150db40e4f7c70b5b378aec9d7eb", "score": "0.48320705", "text": "function updateHealth(healthElement, cardType, cardWeight) {\n\n if (cardType === 'heal') {\n healthElement.value += cardWeight;\n }\n if (cardType === 'attack') {\n healthElement.value -= cardWeight;\n }\n}", "title": "" }, { "docid": "27eefbb36b6263c5abf347584976892b", "score": "0.48299047", "text": "function increaseVolume() {\n this.sound.setVolume(Math.min(1, this.sound.volume + 0.1));\n}", "title": "" }, { "docid": "bd3fa53a1e24add590a3fadd0a4f0a65", "score": "0.4827868", "text": "setWeights(weights) {\n if (this.model == null) {\n this.build();\n }\n\n this.model.setWeights(weights);\n }", "title": "" }, { "docid": "bd3fa53a1e24add590a3fadd0a4f0a65", "score": "0.4827868", "text": "setWeights(weights) {\n if (this.model == null) {\n this.build();\n }\n\n this.model.setWeights(weights);\n }", "title": "" }, { "docid": "c96b4b200e8c7452a04ff7c09aeba779", "score": "0.48145285", "text": "function AddWeightedToShoppingList(itemID, itemTypeID, weight, quantity) \n{\n var requestArgs = GSNContext.RequestArguments;\n var availableVarietiesRequired = AvailableVarietiesRequired();\n\n //display available varieties for circular items\n if (itemTypeID == 8) \n {\n DisplayAvailableVarieties(itemID);\n \n if (AvailableVarietiesRequired()) \n {\n return;\n }\n }\n \n // Add the weighted item\n AddWeightedItemToShoppingList(document.URL, requestArgs, itemTypeID, itemID, weight, '', quantity, HandleShoppingListResponse, null);\n}", "title": "" }, { "docid": "aff2ed4d5279d7b436a2a5648efaa227", "score": "0.48138943", "text": "function di_Scatter3dSubTitleWeight(uid,weight)\n{\n\tvar scatter3dObject = di_getChartObject(uid);\n\tscatter3dObject.SetSubTitleWeight(weight);\n\tvar scatter3dSettingsObject = di_getScatter3dSettings(uid);\n\tscatter3dSettingsObject.subtitle.style.fontWeight= weight;\n\tdi_setScatter3dSettings(uid,scatter3dSettingsObject);\n}", "title": "" }, { "docid": "5e5bf6d09f704e877116098960967ee3", "score": "0.4807538", "text": "function updateIncrement () {\n\t\tsk.setTwist(IncrementCtrl.getValue());\n\t\tsk.build();\n\t}", "title": "" }, { "docid": "45f86bc6c962bb66663fed4d0048e657", "score": "0.47983295", "text": "_incrFontSize(key, add = true) {\n // get the numeric and unit parts of the current font size\n const parts = (this.getCSS(key) || '13px').split(/([a-zA-Z]+)/);\n // determine the increment\n const incr = (add ? 1 : -1) * (parts[1] === 'em' ? 0.1 : 1);\n // increment the font size and set it as an override\n return this.setCSSOverride(key, `${Number(parts[0]) + incr}${parts[1]}`);\n }", "title": "" }, { "docid": "d5d3f5008ce1db9531d3612cc3e819e8", "score": "0.47962877", "text": "addTag(){\n this.set('applied', true);\n }", "title": "" }, { "docid": "bfc749005c61186218a76586b262946f", "score": "0.4794688", "text": "changeWeight(song_part, song_part_name, newValue) {\n this.instrumentSongParts.map((sp) => {\n if (sp.name === song_part) {\n if (song_part_name) {\n let spk = sp.findKindByName(song_part_name)\n if (spk.name) {\n spk.changeWeight(newValue)\n }\n } else {\n sp.changeWeight(newValue)\n }\n }\n })\n }", "title": "" }, { "docid": "61a4e0883cc6f8496acd08a8ebb874f7", "score": "0.47746938", "text": "function increasewidth() {\n if (width >= 50) {\n clearInterval(wid);\n decrease();\n } else {\n width++; \n elem[0].style.width = width + '%';\n elem[1].style.width = width + '%';\n }\n }", "title": "" }, { "docid": "56edf0e2c80c7782a63a3a9511e091e7", "score": "0.4770659", "text": "function increment(target) {\n target.val++;\n target.node.innerHTML = target.val;\n updateTotal();\n\n }", "title": "" }, { "docid": "ddb5f157f718b105ec7d4e88c0f61e08", "score": "0.47689283", "text": "function incrementFontSize(inc, set=false) {\n if (set) {\n fontSize = inc;\n }\n else {\n fontSize += inc;\n }\n\n if (4 < fontSize) {\n fontSize = 4;\n return;\n }\n else if (fontSize < 0.4) {\n fontSize = 0.4;\n return;\n }\n\n document.getElementById(\"content\").style.fontSize = fontSize + \"em\";\n\n let message = {\n \"action\": \"setVar\",\n \"var\": [\"fontSize\", fontSize]\n };\n sendMessage(message);\n}", "title": "" }, { "docid": "8c010b1188ae227b049127cbb1a27843", "score": "0.47685453", "text": "function setRating ( newRating ) {\n \n}", "title": "" }, { "docid": "f3fb2feb58b99132440604ccc388ef6b", "score": "0.4765189", "text": "calculateWeights() {\n this.genome.calculateWeights();\n }", "title": "" } ]
2d29ceb00e1ae249a8a1eaa65b6b5fd2
=========== Player class Helper functions ===============
[ { "docid": "75121b252f9aed6d572cb5bc9601d020", "score": "0.0", "text": "function checkForFinish() {\n if (this.y < 0) {\n setTimeout(() => {\n this.x = 200;\n this.y = 400;\n }, 1100);\n };\n}", "title": "" } ]
[ { "docid": "d5cd02361646881404d9d79810e5c272", "score": "0.76705736", "text": "function Player(){}", "title": "" }, { "docid": "7d74c5461484aed0d081c09bd7f1700e", "score": "0.75115746", "text": "constructor (player) {\n this.player = player;\n }", "title": "" }, { "docid": "4c53a930dd1df8dbf6a08b1df73ca264", "score": "0.7488262", "text": "function Player() { }", "title": "" }, { "docid": "8ba34a3e5251c28c59868f4cc460a5cf", "score": "0.7286062", "text": "constructor(player)\n {\n this.player = player;\n }", "title": "" }, { "docid": "a5b72c4d8b4d6f4b39600ba074b568fc", "score": "0.7286013", "text": "player(player) {\n this.player = player;\n \n }", "title": "" }, { "docid": "f007f58500b9ba32f69e9d3fc19f956d", "score": "0.72403663", "text": "SinglePlayer() {}", "title": "" }, { "docid": "87479dc6403b1afbec046b217bbaf390", "score": "0.7185797", "text": "function Player() {\n\tthis.isAvailable = function() {\n\t\treturn \"Instance method says - he is hired\";\n\t};\n}", "title": "" }, { "docid": "1c118e81f458983d0e17e6774351cae7", "score": "0.71085435", "text": "get player() {\n return this._player;\n }", "title": "" }, { "docid": "e1301495dffaf74e27f2c784642d69df", "score": "0.70607674", "text": "preparePlayerInstance(){}", "title": "" }, { "docid": "f1d60c2792b3fabd95b24b909db3ed12", "score": "0.70551157", "text": "function initPlayer () {\n return new PlayerClass(g.ctx, 5 * g.tileWidth, 5 * g.tileHeight, g.tileWidth, g.tileHeight, {\n right: sprites.capybaraRight,\n left: sprites.capybaraLeft,\n rightDamaged: sprites.capybaraRightDamaged,\n leftDamaged: sprites.capybaraLeftDamaged,\n bootsWorn: {\n left: sprites.bootsWornLeft,\n right: sprites.bootsWornRight,\n },\n })\n}", "title": "" }, { "docid": "62c78f72981cfd15b398a616b11294ec", "score": "0.7052549", "text": "get player() {\n\t\treturn this._player;\n\t}", "title": "" }, { "docid": "2e809712b811848381e437838fb7da94", "score": "0.70334744", "text": "function Player() {\n\tthis._Init();\n}", "title": "" }, { "docid": "ff7943c66728e51cc38cdbe6c9e937a9", "score": "0.7015211", "text": "MultiPlayer() {}", "title": "" }, { "docid": "b4da273898dcf172e6d1449ca7640c79", "score": "0.6987715", "text": "function MMO_Core_Player() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "0bba9b80a5648427b3f829fb5bc90ccc", "score": "0.69267726", "text": "function Player()\n{\n}", "title": "" }, { "docid": "0bba9b80a5648427b3f829fb5bc90ccc", "score": "0.69267726", "text": "function Player()\n{\n}", "title": "" }, { "docid": "d4c107b5780dbf62d0868d6ab908aa47", "score": "0.68618256", "text": "function Player(team) {\n //this.name = ...\n //this.position = ...\n}", "title": "" }, { "docid": "8e5a1e3c6bcf76c317f67bbf4a08fa46", "score": "0.68548506", "text": "function setupPlayer() {\n player.X = 3 * width / 6;\n player.Y = height / 2;\n player.Health = player.MaxHealth;\n}", "title": "" }, { "docid": "8804083cce0d2f1efbfeb09f262cf966", "score": "0.6845931", "text": "function Player() {} //A function that returns nothing and creates nothing", "title": "" }, { "docid": "9f01a9dcc88f37abfe122d11dc51d85f", "score": "0.68365496", "text": "function Player() {\n _classCallCheck(this, Player);\n\n _defineProperty(this, \"data\", {});\n\n _defineProperty(this, \"socket\", void 0);\n\n _defineProperty(this, \"isLookingForPartner\", false);\n\n _defineProperty(this, \"isFirstToStart\", false);\n }", "title": "" }, { "docid": "2213ab3e6ca7ba2fbcaad043dca98d10", "score": "0.6834902", "text": "function Player() {\n /**\n * Position of the player on the map (x-coordinate)\n * @type {number}\n */\n this.x = 0;\n /**\n * Position of the player on the map (y-coordinate)\n * @type {number}\n */\n this.y = 0;\n /**\n * Player facing direction (x-value)\n * @type {number}\n */\n this.dx = 0;\n /**\n * Player facing direction (y-value)\n * @type {number}\n */\n this.dy = 0;\n /**\n * Walking speed\n * @type {number}\n */\n this.speed = 0.065;\n /**\n * Turning speed\n * @type {number}\n */\n this.speed_a = 0.05;\n /**\n * Player radius (for collision detection)\n * @type {number}\n */\n this.radius = 0.25;\n /**\n * Sprite index to display as player's weapon\n * @type {number}\n */\n this.weaponSprite = 421;\n /**\n * Whether the player has collected the silver key\n * @type {boolean}\n */\n this.silverKey = false;\n /**\n * Whether the player has collected the gold key\n * @type {boolean}\n */\n this.goldKey = false;\n /**\n * Whether the player should move forward on next frame\n * @type {boolean}\n */\n this.moveForward = false;\n /**\n * Whether the player should move backward on next frame\n * @type {boolean}\n */\n this.moveBackward = false;\n /**\n * Whether the player should strafe left on next frame\n * @type {boolean}\n */\n this.strafeLeft = false;\n /**\n * Whether the player should strafe right on next frame\n * @type {boolean}\n */\n this.strafeRight = false;\n /**\n * Whether the player should turn to the left on next frame\n * @type {boolean}\n */\n this.turnLeft = false;\n /**\n * Whether the player should turn to the right on next frame\n * @type {boolean}\n */\n this.turnRight = false;\n /**\n * Angle by which the player should turn on next frame (normalized, will be multiplied by `this.speed_a`)\n * @type {number}\n */\n this.turnAngle = 0;\n /**\n * Check whether the player can go to the given location\n * @param x {number} x-coordinate of the position\n * @param y {number} y-coordinate of the position\n * @returns {boolean} whether the location is valid for the player\n */\n this.canMoveTo = function (x, y) {\n let r = this.radius;\n let fx = x % 1;\n x = ~~x;\n let fy = y % 1;\n y = ~~y;\n\n if (plane2[x][y]) return false;\n if (fx < r) {\n if (plane2[x - 1][y]) return false;\n if (fy < r && plane2[x - 1][y - 1]) return false;\n if (fy > 1 - r && plane2[x - 1][y + 1]) return false;\n }\n if (fx > 1 - r) {\n if (plane2[x + 1][y]) return false;\n if (fy < r && plane2[x + 1][y - 1]) return false;\n if (fy > 1 - r && plane2[x + 1][y + 1]) return false;\n }\n if (fy < r && plane2[x][y - 1]) return false;\n if (fy > 1 - r && plane2[x][y + 1]) return false;\n return true;\n };\n\n /**\n * Move forward\n * @param length {number} distance to move (use negative value to move backwards)\n * @param sideways {number} distance to move towards the right (strafe)\n */\n this.move = function (length, sideways = 0) {\n let oldx = ~~this.x;\n let oldy = ~~this.y;\n let x = this.x + this.dx * length - this.dy * sideways;\n let y = this.y + this.dy * length + this.dx * sideways;\n if (this.canMoveTo(x, this.y)) {\n this.x = x;\n }\n if (this.canMoveTo(this.x, y)) {\n this.y = y;\n }\n let newx = ~~this.x;\n let newy = ~~this.y;\n if (newx !== oldx || newy !== oldy) {\n player.collect(newx, newy);\n shouldDrawMap = true;\n }\n };\n\n /**\n * Turn right\n * @param alpha {number} angle in radians to rotate (use negative value to turn left)\n */\n this.turn = function (alpha) {\n let dx = this.dx * Math.cos(alpha) - this.dy * Math.sin(alpha);\n this.dy = this.dx * Math.sin(alpha) + this.dy * Math.cos(alpha);\n this.dx = dx;\n };\n\n /**\n * Activate a cell in front of the player (open/close door, push secret wall)\n */\n this.activate = function () {\n let x = ~~player.x;\n let y = ~~player.y;\n let dx = 0;\n let dy = 0;\n if (Math.abs(player.dx) >= Math.abs(player.dy)) {\n dx = player.dx >= 0 ? 1 : -1;\n x += dx;\n } else {\n dy = player.dy >= 0 ? 1 : -1;\n y += dy;\n }\n let m0 = map0(x, y);\n let m1 = map1(x, y);\n if (m0 === 21 && dx !== 0) {\n // elevator\n loadNextLevel();\n }\n if (90 <= m0 && m0 <= 101) {\n // door\n if ((m0 === 92 || m0 === 93) && !player.goldKey) {\n // gold-locked door\n return;\n }\n if ((m0 === 94 || m0 === 95) && !player.silverKey) {\n // silver-locked door\n return;\n }\n let timer = doorTimers.find(function (obj) {\n return obj.x === x && obj.y === y;\n });\n if (!timer) {\n let opening = plane2[x][y];\n if (!opening) {\n if ((dx > 0 && x - player.x <= player.radius) ||\n (dx < 0 && player.x - x - 1 <= player.radius) ||\n (dy > 0 && y - player.y <= player.radius) ||\n (dy < 0 && player.y - y - 1 <= player.radius)) {\n // player is too close to the door, the door cannot close\n return;\n } else {\n // the door closes (it becomes blocking immediately)\n plane2[x][y] = true;\n }\n }\n doorTimers.push({x: x, y: y, t: 0, opening: opening});\n }\n } else if (m1 === 98) {\n // pushwall\n let timer = wallTimers.find(function (obj) {\n return obj.x === x && obj.y === y;\n });\n if (!timer && map0(x + dx, y + dy) >= 106) {\n // there is no active timer for this wall, and it can move backwards\n wallTimers.push({x: x, y: y, t: 0, dx: dx, dy: dy, steps: 2});\n score.secrets += 1;\n updateScore();\n }\n }\n };\n\n /**\n * Make the player collect collectibles on a given cell\n * @param x {number} integer x-coordinate of the cell\n * @param y {number} integer y-coordinate of the cell\n */\n this.collect = function (x, y) {\n for (let i = 0; i < things.length; i++) {\n let t = things[i];\n if (t.collectible && t.x === x + .5 && t.y === y + .5) {\n if (31 <= t.spriteIndex && t.spriteIndex <= 35) {\n // treasure or 1up\n score.treasures += 1;\n flash = new Flash(.5, .5, 0); // yellow flash for treasures\n updateScore();\n } else {\n // other collectible (ammo, weapon, food or key)\n flash = new Flash(.5, .5, .5); // white flash for other collectibles\n if (t.spriteIndex === 22) {\n // gold key\n player.goldKey = true;\n updateScore();\n } else if (t.spriteIndex === 23) {\n // silver key\n player.silverKey = true;\n updateScore();\n }\n }\n things.splice(i, 1);\n i -= 1;\n }\n }\n };\n\n /**\n * Shoot straight in front of the player (kills the first enemy in the line)\n */\n this.shoot = function () {\n if (this.weaponAnimation === undefined) {\n this.weaponAnimation = new Animation([422, 423, 424, 425]);\n let d = zIndex[pixelWidth / 2];\n for (let i = things.length - 1; i >= 0; i--) {\n let t = things[i];\n if (t.rx < 0) {\n continue;\n }\n if (t.rx >= d) {\n break;\n }\n if (Math.abs(t.ry) <= .3 && t.alive) {\n flash = new Flash(.5, 0, 0);\n t.die();\n return;\n }\n }\n }\n };\n\n this.update = function () {\n let changed = false;\n let movement = new Set();\n for (let key in keymap) {\n if (pressedKeys[key]) {\n movement.add(keymap[key]);\n }\n }\n // update player direction\n if (movement.has('turnRight')) {\n this.turnAngle += 1;\n }\n if (movement.has('turnLeft')) {\n this.turnAngle -= 1;\n }\n if (this.turnAngle !== 0) {\n player.turn(this.turnAngle * this.speed_a);\n this.turnAngle = 0;\n changed = true;\n }\n // update player position\n let forward = 0;\n let sideways = 0;\n if (movement.has('moveForward')) {\n forward += this.speed;\n }\n if (movement.has('moveBackward')) {\n forward -= this.speed;\n }\n if (movement.has('strafeLeft')) {\n sideways -= this.speed;\n }\n if (movement.has('strafeRight')) {\n sideways += this.speed;\n }\n if (forward !== 0) {\n if (sideways !== 0) {\n player.move(forward / Math.sqrt(2), sideways / Math.sqrt(2));\n } else {\n player.move(forward);\n }\n changed = true;\n } else if (sideways !== 0) {\n player.move(0, sideways);\n changed = true;\n }\n\n if (socket && socket.readyState === 1 && changed) {\n socket.send(JSON.stringify({\n 'id': netId,\n 'x': player.x,\n 'y': player.y,\n 'dx': player.dx,\n 'dy': player.dy,\n }))\n }\n\n if (this.weaponAnimation !== undefined) {\n let a = this.weaponAnimation;\n a.timer += 1;\n if (a.timer >= 6) {\n a.timer = 0;\n if (a.spriteIndex >= a.sprites.length - 1) {\n this.weaponAnimation = undefined;\n this.weaponSprite = 421;\n } else {\n a.spriteIndex += 1;\n this.weaponSprite = a.sprites[a.spriteIndex];\n }\n }\n }\n }\n}", "title": "" }, { "docid": "e8a9e1c92afe3a3abf21dfa8b8a6050d", "score": "0.6808437", "text": "function Game_Player(){this.initialize.apply(this,arguments);}", "title": "" }, { "docid": "20e612459b0fa1c865c21987a8d6c57c", "score": "0.6804909", "text": "function Player() {\n this.id = null;\n this.isHero = 0; // Possibility of being morgana, same below\n this.isVillain = 0;\n this.isInnocent = 0;\n this.isMorgana = 0;\n this.isAssasin = 0;\n this.isMordred = 0;\n this.isMerlin = 0;\n this.isPercival = 0;\n this.isDummy = 0;\n\n this.identity = null;\n }", "title": "" }, { "docid": "1de3a99a9aba8939c93eb5738249afef", "score": "0.68023765", "text": "get players() { return this._players; }", "title": "" }, { "docid": "77b686509a479f159a69836e8d589f72", "score": "0.67662835", "text": "function Player() {\n this.move = 'x'; // first move to 'x'\n }", "title": "" }, { "docid": "6a687e8d50acee1fea57e2b4b9dcc6a2", "score": "0.67596835", "text": "get type() {\n return \"player\"\n }", "title": "" }, { "docid": "58fddc01d15b1cf036a847e83ba53631", "score": "0.6758196", "text": "function RandomPlayer () {\n this.name = 'random';\n return Player.call(this);\n}", "title": "" }, { "docid": "cfd763964401971e45ce91b24afca195", "score": "0.67419857", "text": "function Player(descr,player) {\n \n // Common inherited setup logic from Entity\n this.setup(descr);\n\n /* want the stamina , and whatPLayer */\n for (var property in player) {\n this[property] = player[property];\n }\n\n}", "title": "" }, { "docid": "bcf22f9cc884ce98f5254277c8706a09", "score": "0.67401016", "text": "removePlayer(){\n\n }", "title": "" }, { "docid": "0417c74422ea3c2fcad21bb8d45f2adb", "score": "0.6739052", "text": "function setupPlayer() {\n playerX = 4 * width / 5;\n playerY = height / 2;\n playerHealth = playerMaxHealth;\n}", "title": "" }, { "docid": "141d437428eee178d9ba7a5a06d5ec44", "score": "0.672464", "text": "function Player(pName, pID) {\n\n\t// Object variables\n\tvar _genericName = pName;\n\tvar _name = pName;\n\tvar _pID = pID;\n\tvar _isLeader = false;\n\tvar _type = PlayerType.RESISTANCE;\n\tvar _ready = false;\n\tvar _connected = true;\n\n\tthis.getName = function() { return _name; };\n\tthis.getGenericName = function() { return _genericName; };\n\tthis.getId = function() { return _pID; };\n\tthis.isConnected = function() {return _connected; };\n\tthis.changeName = function(name) { _name = name; };\n\tthis.setLeader = function(isLeader) { _isLeader = isLeader; };\n\tthis.getIsLeader = function() {return _isLeader; };\n\tthis.setType = function(type) { _type = type; };\n\tthis.getType = function() { return _type; };\n\tthis.isReady = function() { return _ready; };\n\tthis.setReady = function(ready) { _ready = ready; };\n\tthis.setConnected = function(con) { _connected = con };\n\tthis.setId = function(id) { _pID = id; };\n\tthis.toggleReady = function() { _ready =! _ready };\n}", "title": "" }, { "docid": "890a14dcbb359d4d21dcbabf8a7781b8", "score": "0.6721692", "text": "function setupPlayer() {\n player.x = 4*width/5;\n player.y = height/2;\n player.health = player.maxHealth;\n}", "title": "" }, { "docid": "b0502ef616287b368342f1a45e9ba1a5", "score": "0.6715696", "text": "get activePlayer() {\n return this._activePlayer;\n }", "title": "" }, { "docid": "24d559d9869fd81865225ae6acffdc3b", "score": "0.668613", "text": "function setupPlayer() {\n playerX = 4*width/5;\n playerY = height/2;\n playerHealth = playerMaxHealth;\n}", "title": "" }, { "docid": "24d559d9869fd81865225ae6acffdc3b", "score": "0.668613", "text": "function setupPlayer() {\n playerX = 4*width/5;\n playerY = height/2;\n playerHealth = playerMaxHealth;\n}", "title": "" }, { "docid": "e66f9fa29212a318e84ae44b07ab63c8", "score": "0.6677868", "text": "function setupPlayer() {\n playerX = 1 * width / 5;\n playerY = height / 2;\n playerHealth = playerMaxHealth;\n}", "title": "" }, { "docid": "9adb96b60a8eee113ccaea984c531072", "score": "0.6674736", "text": "function Player () {\n this.totalPoints = 0;\n this.hand = [];\n this.status = 'Hit or Stand?';\n this.game = theGame;\n this.aces = 0;\n}", "title": "" }, { "docid": "66bdd9523593e93b8378c653fef9cca8", "score": "0.6671657", "text": "function setupPlayer() {\n playerX = 4*width/5;\n playerY = height/2;\n playerHealth = playerMaxHealth;\n ///////////////NEW//////////////\n // When player speed increase(sprinting), player health decrease\n playerHealthDecreaseFast = playerHealthDecrease*3;\n playerMaxSpeedDouble = playerMaxSpeed*2;\n ///////////////NEW//////////////\n}", "title": "" }, { "docid": "14fcfbc8de73d9dcb63c0b0cdae45ccb", "score": "0.6666124", "text": "function Player(x, y) {\n this.x = x;\n this.y = y;\n //update and draw are defined in the player javascript library\n}", "title": "" }, { "docid": "a1d01864ddfb6e3327677bf66cfd34d0", "score": "0.6652843", "text": "get player() {\n for(const player of this.state.players){\n if(player.uid === this.playerUID){\n return player;\n }\n }\n return null;\n }", "title": "" }, { "docid": "b83a1e21f17202dd135a4c665894bba8", "score": "0.6635939", "text": "function Game_Player() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "b83d70ad38c02ec8c441c4ba36f96033", "score": "0.66267496", "text": "function Player()\n{\n // basics\n this.ID = \"\"; // directory name\n this.slot = 0;\n this.inGame = true;\n this.hasForfeit = false; // set after first forfeit has ended\n this.xml = null;\n \n // player info\n this.name = \"\";\n this.gender = eGender.FEMALE;\n\n // behaviour stuff\n this.stage = 0;\n this.ticket = new Ticket();\n this.state = new State();\n this.wardrobe = new Wardrobe();\n \n // poker stuff\n this.hand = new Hand();\n this.outcome = eOutcome.BYSTANDER;\n \n // forfeit stuff\n this.firstTimer = {max: 20, current: 0};\n this.repeatTimer = {max: 30, current: 0};\n}", "title": "" }, { "docid": "1620b9afd0d89a97ef3fa4d71621bf10", "score": "0.6617388", "text": "function playerInit()\n{\n player = new Player(displayWidth*2/3,displayHeight*2/3);\n playerSprite = createSprite(player.body.position.x,player.body.position.y,player.width,player.height);\n playerSprite.visible = false;\n}", "title": "" }, { "docid": "30a085b67e05e23d6b51dd3cd4732b4a", "score": "0.66126275", "text": "function onPlayerReady(a){}", "title": "" }, { "docid": "05f47dc82fd9bc9a8716468cef747efb", "score": "0.66076684", "text": "function getCurrentPlayer( ) {\n\treturn playerHands.currentPlayer ; \n}", "title": "" }, { "docid": "1b821d11f412165e454423c4f1adbb1f", "score": "0.6607101", "text": "function Player(x, y, radius, color, speed, mass, player, name){\n this.x = x;\n this.y = y;\n //This angle is for moving the player\n this.angle = 0;\n this.rotationAngle = 0;\n this.speed = speed;\n //the velocity is for when the players bounce off of each other\n this.velocity = {\n x: Math.random() - 0.5,\n y: Math.random() - 0.5\n };\n //speed modifyer so all the players move at the same speed\n this.speedModifyer = 0.7;\n //Check if this player is a person or an AI\n this.player = player;\n //The mass is for the bouncing, if the player don't have a mass it dissapears when it collides\n this.mass = mass;\n this.radius = radius;\n this.color = color;\n this.name = name;\n //Check if this player has been pushed recently or if the player already lost\n this.isPush = false;\n this.lost = false;\n //Function that update the players each frame\n this.update = players => {\n this.draw();\n //check if the players collide\n for(let i = 0; i < players.length; i++){\n if(this === players[i]) continue;\n if(getDistance(this.x, this.y, players[i].x, players[i].y) - this.radius * 2 <= 0){\n push(this, players[i]);\n if(!mute) audio.play();\n }\n }\n //move the enemies\n if(!this.isPush && !this.player && players.length > 1) {\n let enemy = this.findEnemy();\n this.angle = getAngle(enemy.x, enemy.y, this.x, this.y);\n this.x += (Math.cos(this.angle) + this.speed) * this.speedModifyer;\n this.y += (Math.sin(this.angle) + this.speed) * this.speedModifyer;\n }\n else if(this.isPush && players.length > 1){\n this.x += this.velocity.x;\n this.y += this.velocity.y;\n }\n //Does not allow the players to leave the canvas\n if(this.x - this.radius <= 0 || this.x + this.radius >= maxCanvasWidth){\n this.velocity.x = -this.velocity.x;\n }\n if(this.y - this.radius <= 0 || this.y + this.radius >= maxCanvasHeight){\n this.velocity.y = -this.velocity.y;\n }\n };\n //Draw the players\n this.draw = function(){\n ctx.fillStyle = this.color;\n ctx.beginPath();\n ctx.save();\n ctx.translate(this.x, this.y);\n ctx.rotate(this.angle);\n ctx.restore();\n ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n };\n //Find the nearest enemy and return it\n this.findEnemy = function(){\n let enemies = new Array();\n let minDistance = Infinity;\n let nearestEnemy = 1;\n\n for(let i = 0; i < players.length; i++){\n if(this === players[i]) continue;\n enemies.push([i, getDistance(this.x, this.y, players[i].x, players[i].y)]);\n }\n\n for(let i = 0; i < enemies.length; i++){\n if(enemies[i][1] < minDistance) {\n minDistance = enemies[i][1];\n nearestEnemy = enemies[i][0];\n }\n }\n\n return players[nearestEnemy];\n }\n //Update the position of the person player each frame\n this.newPosition = function(){\n this.angle += this.rotationAngle * Math.PI / 180;\n this.x += this.speed * Math.sin(this.angle);\n this.y -= this.speed * Math.cos(this.angle);\n }\n}", "title": "" }, { "docid": "c74f833064ac1e02d23da3a09178a29c", "score": "0.6598721", "text": "constructor() {\n this.isHuman = [false, true, true]; // {!Array<boolean>}: [unused, Player 1 is human, Player 2 is human].\n this.name = [\"\", \"Player1\", \"Player2\"]; // {!Array<string>}: [unused, name of player 1, name of player 2].\n this.current = 0; // {number} Current player to move: 0 - empty, 1 - black, 2 - white.\n this.aiLevel = 0; // {number} AI level: must be either 1, or 2; level 0 is default for no AI player.\n this.changeNameOfPlayer = 0; // {number} Number of the player which is going to change its name.\n }", "title": "" }, { "docid": "5f65a91f173388faea0eebd32af1aced", "score": "0.6593695", "text": "function Player(experience,force,race){\n this.experience = experience,\n this.force = force,\n this.race = race\n}", "title": "" }, { "docid": "2f2a72001b75fe5fc689597a0329421b", "score": "0.6588285", "text": "_initPlayer() {\n document.querySelectorAll('.player').forEach((el) => {\n new Plyr(el);\n });\n }", "title": "" }, { "docid": "bac08d72b14f4cfbd3e630ae77426fd2", "score": "0.6583421", "text": "function Player(name) {\n this.name = name;\n this.score = 0;\n this.updatedScore = 0;\n this.hasRolled = true;\n this.firstTime =true;\n}", "title": "" }, { "docid": "806249fba1d5289f31a63f8e61a1f430", "score": "0.6577579", "text": "function Player(userName) {\n\tthis.name = userName;\n this.type = \"player\";\n this.alive = true;\n this.inCombat = false;\n this.maxHealth = 500;\n this.currentHealth = 500;\n this.previousHealth = 500;\n this.minDamage = 10;\n this.maxDamage = 10;\n // current location\n this.y = 0;\n this.x = 0;\n this.defense = 1;\n this.symbol = \"Δ\";\n this.weapons = [];\n this.items = [];\n this.commands = [];\n this.shortcuts = [];\n // crit chance out of 100\n this.critChance = 20;\n this.level = 1;\n this.equippedWeapon = {};\n // this.equippedArmor = {};\n}", "title": "" }, { "docid": "728a5ac1711a67905402587f498a4af5", "score": "0.65701836", "text": "function Player(x,y,speed,size,leftKey,rightKey,downKey,upKey) {\n this.x = x;\n this.y = y;\n this.vx = 0;\n this.vy = 0;\n this.speed = speed;\n this.size = size;\n this.leftKey = leftKey;\n this.rightKey = rightKey;\n this.downKey = downKey;\n this.upKey = upKey;\n this.color = 255;\n playerSize = size;\n}", "title": "" }, { "docid": "c4ba116becb06a157cc3c36c1cc9ac09", "score": "0.6553319", "text": "constructor(playerID) {\n this.playerID = playerID;\n }", "title": "" }, { "docid": "c1dbd62496a254bb1e502e13d30728d9", "score": "0.6537311", "text": "handleFound(player) {\n super.handleFound(player);\n }", "title": "" }, { "docid": "547e02d0f99b405d8c81fc57d1d1a380", "score": "0.6535815", "text": "get playerClass() {\n return this.state.current_player === 1 ? this.boardUI.classes.player_one : this.boardUI.classes.player_two;\n }", "title": "" }, { "docid": "59538a505800351e83027b215963a122", "score": "0.6524652", "text": "function getPlayer() {\n let player\n wrapper((gameSpace) => {\n const p = gameSpace.gameState[gameSpace.id]\n player = {\n id: gameSpace.id,\n name: p.name,\n emojiStatus: p.emojiStatus,\n map: p.map,\n x: p.x,\n y: p.y,\n }\n })\n return player\n}", "title": "" }, { "docid": "05b85e9545262d0d0fb2c4d03247aecf", "score": "0.65179956", "text": "playerReceived(player) {\n return {\n type: PLAYER_RECEIVED,\n player,\n };\n }", "title": "" }, { "docid": "6fd195d17f5d3b6ea5a06dc4785e84cf", "score": "0.65169245", "text": "getPlayer() {\n return document.getElementById(this.playerId);\n }", "title": "" }, { "docid": "730e12190b1655b44430c56a3de1786e", "score": "0.6516465", "text": "function Player(name){\n\tvar player = {};\n\n\tplayer.playerInfo = {name:name};\n\tplayer.addInfo = addInfo;\n\tplayer.increaseLevel = increaseLevel;\n\n\treturn player;\n}", "title": "" }, { "docid": "f057e954bb9a280925e996766391037f", "score": "0.6512401", "text": "function Player(name,marker)\n{\n this.name=name;\n this.marker=marker;\n \n}", "title": "" }, { "docid": "190d22b63c2fdca1642fd2529938e02b", "score": "0.6492713", "text": "function spawnPlayer() {\n pl = new Player(width/2, MAP_HEIGHT * 3/4);\n pl.init();\n}", "title": "" }, { "docid": "ff30157ef9153a28f1172d652e58066d", "score": "0.6491074", "text": "function Player() {\n 'use strict';\n Character.call(this);\n this.sprite = 'images/char-boy.png';\n this.moveable = true;\n}", "title": "" }, { "docid": "ac21f50b97e72daf55cef061d9b46ce7", "score": "0.6481205", "text": "get playerName() {\n return this._playerName;\n }", "title": "" }, { "docid": "f5c3aad8c719fa56a92f2d32ca660104", "score": "0.64782435", "text": "createPlayer() {\n\t\tthis.player = this.add.sprite(32, 400, 'player');\n\t\tthis.physics.world.enableBody(this.player);\n\t\tthis.player.body.bounce.y = 0.2;\n\t\tthis.player.body.gravity.y = 800;\n\t\tthis.player.body.syncBounds = true;\n\t\tthis.player.scale = 0.2;\n\t\tthis.anims.create({\n\t\t\tkey: 'run', \n\t\t\trepeat: -1,\n\t\t\tframes: this.anims.generateFrameNames('player', {start: 0, end: 38})\n\t\t});\n\t\tthis.player.play('run');//Player's starting animation\n\t}", "title": "" }, { "docid": "b22572641616f8b7ff66970ecf6e61ac", "score": "0.64773446", "text": "function Player(wins, losses, username, choice) {\r\n this.wins = wins;\r\n this.losses = losses;\r\n this.username = username;\r\n this.choice = choice;\r\n}", "title": "" }, { "docid": "6f9941c032190ff978504f5e550d4466", "score": "0.6470492", "text": "function Player(name, clicks, nextWin) {\n this.name = name;\n this.points = 20;\n this.clicks = clicks,\n this.nextWin= nextWin,\n this.message= \"Welcome \" + this.name\n}", "title": "" }, { "docid": "41d210021dfbcbb7b357ae6d0b4b556b", "score": "0.64694816", "text": "update() {\r\n this.position.x = this.player.position.x - this.player.unit.actual.x;\r\n this.position.y = this.player.position.y - this.player.unit.actual.y;\r\n }", "title": "" }, { "docid": "482d69a9e024574ec803a0a0e3b644a2", "score": "0.6465974", "text": "function Player() {\n this.name = '';\n this.round = 1;\n this.scoreCard = {\n ones: { value: 0, chosen: false},\n twos: { value: 0, chosen: false},\n threes: { value: 0, chosen: false},\n fours: { value: 0, chosen: false},\n fives: { value: 0, chosen: false},\n sixes: { value: 0, chosen: false},\n threeOfAKind:{ value: 0, chosen: false},\n fourOfAKind: { value: 0, chosen: false},\n fullHouse: { value: 0, chosen: false},\n smStraight: { value: 0, chosen: false},\n lgStraight: { value: 0, chosen: false},\n yahtzee: { value: 0, chosen: false},\n chance: { value: 0, chosen: false},\n bonus: 0,\n upperSub: 0,\n lowerSub: 0\n };\n this.score = 0;\n}", "title": "" }, { "docid": "edc2ff9520aaa2ec6f6bf867680858a4", "score": "0.64647824", "text": "drawPlayer () {\n const aX = this.playerAccelerationX\n const aY = this.playerAccelerationY\n const vX = this.playerVelocityX\n const vY = this.playerVelocityY\n const pX = this.playerX\n const pY = this.playerY\n\n // as long as the player is not yet at full speed\n if (aX && Math.abs(vX) < this.playerMaxVelocity) {\n this.playerVelocityX += aX // raise velocity\n // if the player is not accelerating but still moving\n } else if (aX === 0 && vX !== 0) {\n // add or substract until zero velocity\n this.playerVelocityX -= vX > 0 ? 1 : -1\n }\n if (aY && Math.abs(vY) < this.playerMaxVelocity) {\n this.playerVelocityY += aY\n } else if (aY === 0 && vY !== 0) {\n this.playerVelocityY -= vY > 0 ? 1 : -1\n }\n\n // this translates the velocity to coordinates but\n // checks that the player is still inside the screen\n if ((vX < 0 && pX > 0) || (vX > 0 && pX < this.width)) this.playerX += vX\n if ((vY < 0 && pY > 0) || (vY > 0 && pY < this.height)) this.playerY += vY\n\n // draw a little gray box a.k.a. the player\n this.fill(\n 'gray',\n this.playerX - this.playerSize / 2.0,\n this.playerY - this.playerSize / 2.0,\n this.playerSize,\n this.playerSize\n )\n }", "title": "" }, { "docid": "d03287c47e53e32b2c064306e3cdde9a", "score": "0.6463048", "text": "get players (){\n return this._players;\n }", "title": "" }, { "docid": "8d6e8b861039f0e09265f50a45ecd366", "score": "0.6461694", "text": "function Player (name,x,y,mapCharacter,sanity,boredom,level,strength) {\n\t\tthis.base = Character;\n\t\tthis.base(name,x,y,mapCharacter,sanity);\n\t\tthis.type = \"player\";\n\t\tthis.boredom = boredom; //hunger\n\t\tthis.sanity = sanity; //hp\n\t\tthis.level = 1; //character level\n\t\tthis.performance = 0; //xp\n\t\tthis.strength = strength;\n\n\n\n\t\tthis.checkBoredom=function(){\n\t\t\tif(this.boredom>100){\n\t\t\t\tdocument.getElementById('map').style.display = 'none';\n\t\t\t\tdocument.getElementById('inventory').style.display = 'none';\n\t\t\t\tdocument.getElementById('stats').style.display = 'none';\n\t\t\t\tdocument.getElementById('gameover_boredom').style.display = 'block';\n\t\t\t}\n\t\t}\n\t}// Player", "title": "" }, { "docid": "b83020fb6e5476da45df44deb2a88724", "score": "0.6452256", "text": "function Player(ctx){\n CheckCollition.call(this)\n this.x = 20,\n this.y = 165,\n this.width = 20,\n this.height = 20,\n this.speed = 1.9,\n this.velX = 0,\n this.velY = 0;\n this.ctx = ctx\n this.image = new Image();\n this.image.src; \n this.jumping= false;\n this.left = true;\n this.right = false;\n \n //Esto dibuja a player\n Player.prototype.drawPlayer = function()\n {\n this.ctx.drawImage(this.image, this.x, this.y, this.width, this.height)} \n }", "title": "" }, { "docid": "f5c324ae05bd86cac054cb37676c0c39", "score": "0.6449154", "text": "function find_player(player) {\n return player.username === socket.username;\n }", "title": "" }, { "docid": "e936b924cd1f21e50015d4173527dcb5", "score": "0.64447653", "text": "function Player(name, marker) {\n this.name = name;\n this.marker = marker;\n}", "title": "" }, { "docid": "2f6ae0c3f3319be88cf60d40f5446cbd", "score": "0.643839", "text": "function Player() {\n this.sprite = 'images/char-princess-girl.png';\n this.x = 199;\n this.y = 403;\n this.handleInput = function(param) {\n var y = this.y;\n var x = this.x;\n if (param === 'up') {\n y -= 83;\n if (y <= -40) {return};\n this.y = y;\n }\n if (param === 'down') {\n y += 83;\n if (y >= 450) {return};\n this.y = y;\n }\n if (param === 'left') {\n x -= 101;\n if (x <= -4) {return};\n this.x = x;\n }\n if (param === 'right') {\n x += 101;\n if (x >= 500) {return};\n this.x = x;\n }\n console.log(x,y);\n if (player.y <= 0) {\n console.log(\"winner winner, chicken dinner!\");\n modal.style.display = \"block\";\n };\n }\n this.update = function() {\n //console.log('Player.update error fixing');\n }\n}", "title": "" }, { "docid": "5808a9b18e70fb249572489d8ff9977a", "score": "0.6431398", "text": "function onPlayerReady(event) \n {\n // this is kinda left over from some older code. \n // left it cuz im a scared to change it. \n }", "title": "" }, { "docid": "f94b6d5ee16aca531af751f678f96b35", "score": "0.64293855", "text": "constructor(player, socket) {\n this.player = player;\n this.server = socket;\n }", "title": "" }, { "docid": "891327d03ba1b6f25437fe73eae67f7f", "score": "0.64230716", "text": "function Player(mark) {\n this.mark = mark;\n}", "title": "" }, { "docid": "e94223ef38bfcaee8cc2546c57e29863", "score": "0.64169174", "text": "function Player(name, id) {\n Entity.call(this)\n this.id = id || 0 \n this.vx = 4\n this.vy = 4\n this.colors = [Tools.getRandColor(), 'rgba(255, 224, 189, 1)', Tools.getRandColor(), Tools.getRandColor()]\n this.floor = 0\n this.name = name\n this.size = 24\n this.life = 16 \n this.keys = {'left': 37, 'right': 39, 'up': 38, 'down': 40} // arrows\n this.hitColor = Tools.getRandColor()\n this.regen = 12\n this.maxLife = 16\n this.controller = null\n this.sprite = [[0, 0, 1, 1, 1, 1, 0, 0],\n [0, 0, 1, 2, 2, 1, 0, 0],\n [0, 0, 1, 2, 2, 1, 0, 0],\n [0, 1, 1, 1, 1, 1, 1, 0],\n [2, 0, 1, 1, 1, 1, 0, 2],\n [0, 0, 3, 3, 3, 3, 0, 0],\n [0, 0, 3, 0, 0, 3, 0, 0],\n [0, 0, 2, 0, 0, 2, 0, 0]]\n }", "title": "" }, { "docid": "5a502f33364957985a0ae063db2276db", "score": "0.6416544", "text": "function Sprite_Player() {\r\n this.initialize.apply(this, arguments);\r\n}", "title": "" }, { "docid": "d08b45142e7b0abf685cef952249b8e4", "score": "0.6408086", "text": "function player(playerName, playerStatus, playerProfession, playerMoney)\n{\n this.playerName = playerName;\n this.playerStatus = playerStatus;\n this.playerProfession = playerProfession; //affects starting money\n this.playerMoney = playerMoney;\n}", "title": "" }, { "docid": "924854aa9b504e350ae056f3466fb705", "score": "0.64040244", "text": "function Player (classType, health, mana, strength, agility, speed) {\n this.classType = classType;\n this.health = health;\n this.mana = mana;\n this.strength = strength;\n this.agility = agility;\n this.speed = speed;\n}", "title": "" }, { "docid": "bdea2d6416f3aba050127a0c666a14ab", "score": "0.6403473", "text": "function onPlayerReady(event) {\n\n \n \n \n}", "title": "" }, { "docid": "fb1b021d7c88a0793d4055ee17aa1542", "score": "0.6390251", "text": "function Player(control, game_level) {\n var _this;\n\n _classCallCheck(this, Player);\n\n // control - управление клавиатурой\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Player).call(this, {\n imageName: 'player',\n speed: 100\n }));\n _this.control = control;\n _this.game_level = game_level;\n _this.arrow = false; // Позволяем стрелять только если на руках есть стрела\n\n _this.timeArrow = 1000; // Константа, время между появлением следующей стрелы, чтобы стрелы не создавались как из пулемёта\n\n _this.timerForCreatingArrow = 0; // Таймер для стрел\n\n _this.lastTimeForArrow = 0;\n _this.name = 'player'; // Для коллайдера, что опознать этот объект\n\n _this.healthStart = 20; // Начальное количество жизней\n\n _this.health = _this.healthStart;\n _this.undead = 1000; // Константа времени бессмертия, после получения урона игрок бессмертен\n\n _this.timerUndead = -1;\n /* Таймер для обратного отсчёта. Если он равен диапазону от 0 до this.undead, значит идёт обратный отсчёт и игрок бессмертен\n Если -1, игрок может получить урон */\n\n _this.lastTimeForUndead = 0;\n return _this;\n }", "title": "" }, { "docid": "d01fe6e2b3a4c3edf2085027b614f30b", "score": "0.63889277", "text": "function Player() {\r\n\tvar item;\r\n\tvar playStopped;\r\n\tvar myTimer;\r\n}", "title": "" }, { "docid": "54a1211df9ea7e7f09e9cab70a227771", "score": "0.6387766", "text": "function getPlayers() {\n return playersObject;\n}", "title": "" }, { "docid": "8990277b265347322a4008752c8f36ae", "score": "0.6381429", "text": "function Player(startingPos, direction) {\n this.Id = \"\";\n this.color = '#92F15F';\n this.Name = \"Player\";\n this.startingPos = startingPos;\n this.startingDirection = direction;\n\n // this.Cycle = new LightBike(this);\n //this.Bike = new Bike(new Coordinate(0,0),Direction.Right);\n this.Reset();\n }", "title": "" }, { "docid": "f0a58775c122f998e00da2518d6322ef", "score": "0.6381377", "text": "function Player(speed, source, x, y, width, height) {\n Component.call(this, source, x, y, width, height);\n this.speedX = speed;\n this.move = function(direction, canvasWidth) {\n /*See Game.js -- User interaction with player -- */\n if (direction === \"left\") {\n this.x -= this.speedX;\n } else if (direction === \"right\") {\n this.x += this.speedX;\n }\n this.x = Math.min(canvasWidth - this.width, Math.max(0, this.x));\n };\n this.checkCatchStock = function(stock) {\n return !(\n this.bottom() < stock.top() ||\n this.top() > stock.bottom() ||\n this.right() < stock.left() ||\n this.left() > stock.right()\n );\n };\n this.shoot = function(spaceBar) {\n // if (spaceBar === \"spaceBar\") {\n // return true;\n // } else {\n // return false;\n // }\n };\n}", "title": "" }, { "docid": "74222adfca378f188d16ad2c320f3dff", "score": "0.6380173", "text": "isPlayerPresent() {\n const {playerPosition, i, j} = this.props\n return i == playerPosition.y && j == playerPosition.x\n }", "title": "" }, { "docid": "f4a06cf9db21e46923705f2223c6cfc5", "score": "0.6377731", "text": "function Player (selfId, posX, posY, angle) {\n //Jet.call(this, selfId, posX, posY, angle);\n Jet.apply(this, [selfId, posX, posY, angle]);\n this.topPressed = \"0\";\n this.botPressed = \"0\";\n}", "title": "" }, { "docid": "d818feb265e75ab1b73e79d797abb377", "score": "0.63682973", "text": "function playerTurn() {\n\t\t\t\n\t\t}", "title": "" }, { "docid": "973bb40d91b04650bca3d2c5bda0e561", "score": "0.63670623", "text": "function Player(x, y, index, colour, userName){\n return {\n /*\n Group: Variables\n */\n\n /*\n var: size\n Size of this Player in pixels\n\n Used in <collisionBetween>\n */\n size : playerSize,\n\n /*\n var: x\n x coordinate of the top left corner of this Player\n */\n x : x - (playerSize / 2),\n\n /*\n var: y\n y coordinate of the top left corner of this Player\n */\n y : y - (playerSize / 2),\n\n /*\n var: xChange\n The amount of pixels this Player will move in the x axis in the next frame\n */\n xChange : 0,\n\n /*\n var: yChange\n The amount of pixels this Player will move in the y axis in the next frame\n */\n yChange : 0,\n\n /*\n var: health\n The current health of this Player\n */\n health : 100.00,\n\n /*\n var: bullets\n An array maintaining the <Bullet> objects this Player has fired that are still alive\n */\n bullets : [null, null, null],\n\n /*\n var: numBullets\n The number of bullets this Player can still fire\n */\n numBullets : maxBullets,\n\n /*\n var: id\n The index of this Player in <players>\n */\n id : index,\n\n /*\n var: colour\n The colour of this Player\n */\n colour : colour,\n\n /*\n var: userName\n The username of the player controlling this Player\n */\n userName : userName,\n\n /*\n boolean: alive\n True as long as this Player's health is above 0\n */\n alive : true,\n\n /*\n Group: Methods\n */\n\n /*\n Function: getHealth\n Getter for this Player's current <health>\n\n Returns:\n int health - This Player's current <health>\n */\n getHealth : function(){\n //Public getter for health\n return this.health;\n },\n\n /*\n Function: getBullets\n Getter for this Player's current <numBullets>\n\n Returns:\n int bullets - This Player's current <numBullets>\n */\n getBullets : function(){\n //Public getter for numBullets\n return this.numBullets;\n },\n\n /*\n Function: getUserName\n Getter for this Player's <userName>\n\n Returns:\n string userName - This Player's <userName>\n */\n getUserName : function(){\n //Public getter for userName\n return this.userName;\n },\n\n /*\n Function: getHealth\n Getter for whether or not this Player is still alive\n\n Returns:\n boolean alive - True if this Player is still alive\n */\n isAlive : function(){\n //Public getter for Alive state\n return this.alive;\n },\n\n /*\n Function: setX\n Setter for this Player's <x> coordinate\n\n Parameters:\n int x - The new value of this Player's <x> coordinate\n */\n setX : function(x){\n //Public setter for this.x\n this.x = x;\n },\n\n /*\n Function: setY\n Setter for this Player's <y> coordinate\n\n Parameters:\n int y - The new value of this Player's <y> coordinate\n */\n setY : function(y){\n //Public setter for this.y\n this.y = y;\n },\n\n /*\n Function: move\n Handler for the movement of this Player\n\n Parameters:\n KeyboardEvent e - The <KeyboardEvent> passed to this function from <Game Code.playerMove>\n */\n move : function(e){\n //Handles moving of player, called on keydown\n switch(e.keyCode){\n case 87: // w\n case 38: // up arrow\n if(!move.up){\n this.yChange = playerSpeed * -1;\n move.up = true;\n move.down = false;\n }\n return;\n case 65: // a\n case 37: // left arrow\n if(!move.left){\n this.xChange = playerSpeed * -1;\n move.left = true;\n move.right = false;\n }\n return;\n case 83: //s\n case 40: // down arrow\n if(!move.down){\n this.yChange = playerSpeed;\n move.down = true;\n move.up = false;\n }\n return;\n case 68: //d\n case 39: //right arrow\n if(!move.right){\n this.xChange = playerSpeed;\n move.right = true;\n move.left = false;\n }\n return;\n }\n },\n\n /*\n Function: stop\n Handler for stopping the movement of this Player\n\n Parameters:\n KeyboardEvent e - The <KeyboardEvent> passed to this function from <Game Code.playerStop>\n */\n stop : function(e){\n //Handles stopping of player, called on keyup\n switch(e.keyCode){\n case 87: // w\n case 38: // up arrow\n if(move.up){\n this.yChange = 0;\n move.up = false;\n }\n return;\n case 65: // a\n case 37: // left arrow\n if(move.left){\n this.xChange = 0;\n move.left = false;\n }\n return;\n case 83: //s\n case 40: // down arrow\n if(move.down){\n this.yChange = 0;\n move.down = false;\n }\n return;\n case 68: //d\n case 39: //right arrow\n if(move.right){\n this.xChange = 0;\n move.right = false;\n }\n return;\n }\n },\n\n /*\n Function: draw\n Draw this Player, handle collisions, update this Player's position, and draw each of this Player's <Bullet>s\n */\n draw : function(){\n //Draw the player\n context.fillStyle = this.colour;\n context.fillRect(this.x, this.y, this.size, this.size);\n //Test Collisions\n this.wallCollision();\n this.playerCollision();\n //Update position for next frame\n this.x += this.xChange;\n this.y += this.yChange;\n\n //Draw the bullets\n var player = this;\n this.bullets.forEach(function(bullet, index){\n if(bullet !== null){\n bullet.draw();\n }\n });\n },\n\n /*\n Function: fireBullet\n Handles firing of a new <Bullet>\n\n Parameters:\n obj coords - JavaScript object containing the coords of the mouse click\n */\n fireBullet : function(coords){\n //Checks if a new bullet can be fired, and fires one\n if(this.numBullets > 0){\n var i = 0;\n for(i; i < maxBullets; i ++){\n if(this.bullets[i] === null){\n break;\n }\n }\n this.bullets[i] = new Bullet(\n this.x + (this.size / 2),\n this.y + (this.size / 2),\n this.id,\n i);\n this.numBullets -= 1;\n this.bullets[i].fire(coords);\n }\n },\n\n /*\n Function: bulletDestroyed\n Handler for removing a <Bullet> from this Player's <bullets> array\n\n Parameters:\n int number - Index of the <Bullet> to be removed\n */\n bulletDestroyed : function(number){\n //this.bullets[number] has been destroyed\n this.bullets[number] = null;\n this.numBullets += 1;\n //Error checking\n if(this.numBullets > maxBullets){\n this.numBullets = maxBullets;\n }\n },\n\n /*\n Function: wallCollision\n Checks if this Player has hit a wall and prevent it from moving off the board if so\n */\n wallCollision : function(){\n //Test if the player has hit a wall, if so, stop it from moving\n //out of the board\n if(this.x < 0){\n this.x = 0;\n }\n else if(this.x + this.size > width){\n this.x = width - this.size;\n }\n if(this.y < 0){\n this.y = 0;\n }\n else if(this.y + this.size > height){\n this.y = height - this.size;\n }\n },\n\n playerCollision : function(){\n //Test if this player has run into another player, and stop\n //this player from phasing through the other one\n\n //Not sure if we need it since I'm not sure people will get too\n //close to other players\n /*\n needs co-ords of other players\n basic maths:\n case x: ((this.x + this.size) >= other.x) &&\n (this.x <= (other.x + other.size))\n case y: ((this.y + this.size) >= other.y) &&\n (this.y <= (other.y+other.size))\n */\n for(var i = 0;i< players.length;i++){\n if(i !== local){\n var other = players[i];\n if(other === null) continue;\n if(((this.x + this.size) >= other.x) &&\n (this.x <=(other.x + other.size)) &&\n ((this.y + this.size)>= other.y) &&\n (this.y <= (other.y+other.size))){\n this.takeDamage(1/60);\n }\n }\n }\n },\n\n /*\n Function: hit\n Handles when a <Bullet> owned by this Player hits another Player\n\n Parameters:\n Bullet bullet - The Bullet object that hit the Player\n int playerId - The id of the Player that was hit by a Bullet\n */\n hit : function(bullet, playerId){\n //Assume that since 'bullet' was still in bullets it has not hit someone else yet\n var damage = bullet.getDamage();\n damages.push(\n {\n id : playerId,\n damage : damage,\n sent : false\n }\n );\n },\n\n /*\n Function: takeDamage\n Updates this Player's health after getting hit by a <Bullet>\n\n Parameters:\n float damage - The damage received by this Player\n */\n takeDamage : function(damage){\n this.health = (this.health - damage).toFixed(2);\n //Check if player is still alive\n if(this.health < 0){\n this.destroy();\n }\n },\n\n /*\n Function: destroy\n Handler for the death of this Player object\n */\n destroy : function(){\n this.alive = false;\n },\n\n /*\n Function: update\n Update this Player with the data received from the server\n\n Parameters:\n obj data - JavaScript object containing all of this Player's updated variables from the server\n */\n update : function(data){\n //Update this player with the data that was sent\n $.extend(this, data);\n //Update bullets for this player\n if(this.alive){\n var player = this;\n data.bullets.forEach(function(bullet, index){\n if(bullet !== null && !bullet.hitPlayer){\n var newBullet = new Bullet(\n bullet.x, bullet.y, player.id, index);\n newBullet.xChange = bullet.xChange;\n newBullet.yChange = bullet.yChange;\n player.bullets[index] = newBullet;\n }\n });\n }\n },\n\n /*\n Function: updateDamages\n Handles damages sent from the server intended for the local Player\n\n Parameters:\n array damages - JavaScript array containing all damages meant for this Player since last update\n */\n updateDamages : function(damages){\n /*\n Damaging Bullets are sent to the server. The server will\n take them, put them in a dict based on player id and send all of the damage along with the updated data to each player\n */\n var player = this;\n damages.forEach(function(damage){\n player.takeDamage(damage);\n });\n }\n }\n }", "title": "" }, { "docid": "852e76fe069ed687f1410b9241b82476", "score": "0.6364884", "text": "hasPlayer() {\n return this.player != null;\n }", "title": "" }, { "docid": "b34cd586de040c2a1cbfa5e6816dca1b", "score": "0.6364437", "text": "function Player(name){\n\tthis.name = name;\n\tthis.choice = \"\";\n\tthis.wins = 0;\n}", "title": "" }, { "docid": "0458152d46f7f518d47dc0b4c118cc4e", "score": "0.63596666", "text": "get player() {\r\n return this.actors.find(a => a.type == \"player\");\r\n }", "title": "" }, { "docid": "b9edb1c5b1f916bd68787fe298c4ca7a", "score": "0.6356122", "text": "function mediaPlayers()\n{\n\tthis.init();\n}", "title": "" }, { "docid": "633aec4359ce1c181ebe9b0471b19e3a", "score": "0.6353086", "text": "function player(x,y){\n this.x_position = x;\n this.y_position = y;\n this.p_top = this.y_position - P_HEIGHT / 2;\n this.p_bottom = this.y_position + P_HEIGHT / 2;\n}", "title": "" }, { "docid": "7c94cf5d91f972d7e8baa8e70b01f12f", "score": "0.6352442", "text": "function getName() {\n\treturn playerName;\n}", "title": "" }, { "docid": "5dab282365867805367d71de80cdcf66", "score": "0.6351285", "text": "function playerObject(player,troops,base) {\n //may need to make the sub components of gameObject before putting them in.\n this.player = player;\n this.troops = troops;\n this.base = base;\n}", "title": "" }, { "docid": "4e6c5f9dcc3db3fed2320a01b3a483ae", "score": "0.6350243", "text": "function Player(x, y) {\n this.x = x;\n this.y = y;\n this.width = 20;\n this.height = 20;\n this.direction = -1;\n}", "title": "" }, { "docid": "ff5f93b0197328d9ee6e0b76fa036892", "score": "0.63492864", "text": "playerMoved(player) {\n console.log(\"Player at \" + player.x + \",\" + player.y);\n }", "title": "" } ]
7e3af209373632df4acaf21e63087ff4
Extend shape with parameters
[ { "docid": "e37e77e66e9ba3fc00c34547cf786ad5", "score": "0.68986076", "text": "function extendShape(opts) {\n\t return Path.extend(opts);\n\t}", "title": "" } ]
[ { "docid": "9e744638514a416825d896412acf7c7c", "score": "0.69294363", "text": "function extendShape(opts) {\n return Path.extend(opts);\n }", "title": "" }, { "docid": "7b4be314d1cf105ef7cd461beb7f1bb5", "score": "0.6895309", "text": "function extendShape(opts) {\n return Path.extend(opts);\n}", "title": "" }, { "docid": "dc8e9aa9f4bef71bd8e0afb0816a8dd7", "score": "0.68005025", "text": "function extendShape(opts) {\n return graphic_Path.extend(opts);\n}", "title": "" }, { "docid": "d64136d253d4ad08ebb19ac34b49c517", "score": "0.6784805", "text": "function extendShape(opts) {\r\n return graphic_Path.extend(opts)\r\n }", "title": "" }, { "docid": "d783c255b11e6c9adc02429768f857fb", "score": "0.5839704", "text": "set shape(shape){\n this._shape = shape;\n }", "title": "" }, { "docid": "2b640bdd35a8509a16224305440b9b0a", "score": "0.557237", "text": "constructor (width, height, shape, color, x, y) {\n\n }", "title": "" }, { "docid": "faba0e9d641ee95a208fa35dd38a9c32", "score": "0.54497683", "text": "setShape(shp) {\n shape = shp;\n}", "title": "" }, { "docid": "d41edb73db09e334cbf221f33f91b299", "score": "0.5448022", "text": "function Shape() {}", "title": "" }, { "docid": "fd135a511da7a76ef73db9f461d85aed", "score": "0.5429609", "text": "function Shape(){}", "title": "" }, { "docid": "090712064227378ee3fba83c743e4606", "score": "0.5359449", "text": "function Shape(x,y, w, h, fill){\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.fill = fill;\n}", "title": "" }, { "docid": "fcfd917c251ab361c9fbf4e431f7d15d", "score": "0.53305703", "text": "updatePart() {\n switch(this.type) {\n case \"canvas\":\n this.shape[2]();\n break;\n }\n }", "title": "" }, { "docid": "167c04e0e7a76d09053b44ea844e7334", "score": "0.5322776", "text": "function extendToDrawing() {\n try {\n\n //Create an empty extent that will gradually extend to all drawings\n var extent = ol.extent.createEmpty();\n\n var source = getLayerSource(\"drawingVector\");\n ol.extent.extend(extent, source.getExtent());\n\n //Finally fit the map's view to our combined extent\n map.getView().fit(extent, map.getSize());\n\n } catch (e) {\n alert(e.message, e.name);\n }\n}", "title": "" }, { "docid": "fa44f69dfbb6a768d8b5cf1c35be40bb", "score": "0.53112316", "text": "function SuperShape(_shapeID, _owner, _shapeConfig, _layerRadius, _layerPaint, _layerInk, _thick) {\n\tthis.shapeID = _shapeID;\n\tthis.shapeOwner = _owner;\n\tthis.shapeConfig = _shapeConfig;\n\tthis.radius = _layerRadius;\n\tthis.layerPaint = _layerPaint;\n\tthis.layerInk = _layerInk;\n\tthis.layerWeight = _thick;\n\tthis.m = this.shapeConfig[0];\n\tthis.n1 = this.shapeConfig[1];\n\tthis.n2 = this.shapeConfig[2];\n\tthis.n3 = this.shapeConfig[3];\n\tthis.c = this.shapeConfig[4];\n\tthis.a = this.shapeConfig[5];\n\tthis.b = this.shapeConfig[6];\n\t\n\tthis.showShape = function() {\n\t\t// NO LONGER just a dummy function\n\t var inc = TWO_PI / qtyPoints;\n\t\t\n\t\t// build our custom shape\n\t\t// start with buildshape(),\n\t\t// end with endShape(CLOSE).\n\t\t// the CLOSE automatically\n\t\t// connects the start with the\n\t\t// end of the line.\n\t\tbeginShape();\n\t\tfor (var angle = 0; angle < (TWO_PI * this.c); angle = angle + inc) {\n\t var r = this.plotSuperShape(angle);\n\t var x = (r * cos(angle)) * this.radius;\n\t var y = (r * sin(angle)) * this.radius;\n\t vertex(x, y);\n\t\t}\n\t\tendShape(CLOSE);\t\t\n\t}\n\t\n\tthis.plotSuperShape = function(theta) {\n var p1 = (1.0 / this.a) * cos(theta * this.m * 0.25);\n p1 = pow(abs(p1), this.n2);\n var p2 = (1.0 / this.b) * sin(theta * this.m * 0.25);\n p2 = pow(abs(p2), this.n3);\n var p3 = pow(p1 + p2, 1.0 / this.n1);\n return (1.0 / p3);\n\t}\n}", "title": "" }, { "docid": "7470f4db9daf134ac7802aba3eb1b54e", "score": "0.5298541", "text": "function Shape(width, height){\n this.width = width;\n this.height = height;\n\n}", "title": "" }, { "docid": "d603c46a71dcbcd8286b7a8837029f1f", "score": "0.5196278", "text": "function registerFuncShapeParams(path) {\n\tvar funcNode = path.node;\n\tvar funcShape = typeShapes.get(funcNode);\n\n\tfor (let [funcParamIdx,funcParam,] of funcNode.params.entries()) {\n\t\tlet paramType = nodeTypes.get(funcParam);\n\t\t// function parameter has a determined type?\n\t\tif (paramType) {\n\t\t\t// don't save a ...rest element into the shape,\n\t\t\t// but flag its presence (for shape checking)\n\t\t\tif (paramType.isRest) {\n\t\t\t\tfuncShape.hasRestParam = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!funcShape.params[funcParamIdx]) {\n\t\t\t\t\tfuncShape.params[funcParamIdx] = { ...paramType, };\n\t\t\t\t}\n\t\t\t\telse if (!typesMatch(funcShape.params[funcParamIdx],paramType)) {\n\t\t\t\t\tlet prevType = funcShape.params[funcParamIdx];\n\t\t\t\t\tdelete prevType.inferred;\n\t\t\t\t\tObject.assign(prevType,paramType);\n\t\t\t\t\tparamType = prevType;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tparamType = funcShape.params[funcParamIdx];\n\t\t\t\t}\n\n\t\t\t\t// need to register a param's shape onto function-shape's param?\n\t\t\t\tlet paramShape = typeShapes.get(funcParam);\n\t\t\t\tmarkTypeShape(paramType,paramShape,/*forceOverride=*/true);\n\t\t\t}\n\t\t}\n\t\t// function-shape's param doesn't yet have a determined type?\n\t\telse if (!funcShape.params[funcParamIdx]) {\n\t\t\tlet funcParamName;\n\n\t\t\t// simple identifier param?\n\t\t\tif (T.isIdentifier(funcParam)) {\n\t\t\t\tfuncParamName = funcParam.name;\n\t\t\t}\n\t\t\t// simple identifier param with default value?\n\t\t\telse if (\n\t\t\t\tT.isAssignmentPattern(funcParam) &&\n\t\t\t\tT.isIdentifier(funcParam.left)\n\t\t\t) {\n\t\t\t\tfuncParamName = funcParam.left.name;\n\t\t\t}\n\n\t\t\tlet funcParamBinding = funcParamName ?\n\t\t\t\tpath.scope.getBinding(funcParamName) :\n\t\t\t\tundefined;\n\n\t\t\t// ****************\n\t\t\t// TODO: this needs to handle unknowns in destructuring patterns\n\t\t\t// ****************\n\n\t\t\t// flag as needing multi-pass resolution for this parameter\n\t\t\tif (funcParamBinding) {\n\t\t\t\tmarkedUnknowns.add(funcParamBinding);\n\t\t\t}\n\n\t\t\tfuncShape.params[funcParamIdx] = { inferred: \"unknown\", };\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bfc2604d708aacd2651d87a5fd0bce52", "score": "0.5122431", "text": "updateShape() {\n switch(this.type) {\n case \"rect\":\n this.element.setAttribute(\"width\", this.shape[0]);\n this.element.setAttribute(\"height\", this.shape[1]);\n\n let css = getComputedStyle(this.element);\n this.element.setAttribute(\"rx\", css.getPropertyValue(\"border-radius\"));\n this.element.setAttribute(\"ry\", css.getPropertyValue(\"border-radius\"));\n\n break;\n case \"line\":\n this.element.setAttribute(\"x2\", Number(this.element.getAttribute(\"x1\")) + this.shape[0]);\n this.element.setAttribute(\"y2\", Number(this.element.getAttribute(\"y1\")) + this.shape[1]);\n break;\n case \"canvas\" :\n this.element.setAttribute(\"width\", this.shape[0]);\n this.element.setAttribute(\"height\", this.shape[1]);\n break;\n }\n }", "title": "" }, { "docid": "8c357c332b87dc69dce12d99e4d45ea7", "score": "0.50761896", "text": "draw(shape) {\r\n this.apply();\r\n shape.draw();\r\n }", "title": "" }, { "docid": "ecae58428f5545221679a65b7e3fce1a", "score": "0.5070356", "text": "constructor(points, shape) {\n super();\n this.points = copyPoints(points);\n if (!shape) this.shape = \"Rectangle\";\n else this.shape = shape;\n }", "title": "" }, { "docid": "9f6b80b008a0fe72d2a3699c18b907c3", "score": "0.50417453", "text": "function extendBy(xy, theta, delta) {\n var xDelta = cos(theta) * delta | 0,\n yDelta = sin(theta) * delta | 0;\n \n return init(xy.x - xDelta, xy.y - yDelta);\n }", "title": "" }, { "docid": "f99f8c4e538ec1b8f71efa461cb8bbfc", "score": "0.50394887", "text": "function calibrateShape(layer,shape) {\r\n var currX = shape.x();\r\n var currY = shape.y();\r\n\r\n var newX = 0;\r\n var newY = 0;\r\n\r\n if(currX > 0){\r\n newX = Math.floor(currX/20)*20 + Math.floor((currX%20)/10)*20;\r\n }else{\r\n newX = Math.ceil(currX/20)*20 + Math.ceil((currX%20)/10)*20;\r\n }\r\n\r\n if(currY > 0){\r\n newY = Math.floor(currY/20)*20 + Math.floor((currY%20)/10)*20;\r\n }else{\r\n newY = Math.ceil(currY/20)*20 + Math.ceil((currY%20)/10)*20;\r\n }\r\n\r\n shape.x(newX);\r\n shape.y(newY);\r\n layer.draw();\r\n\r\n}", "title": "" }, { "docid": "6024deb2f1af435b0ac7403c89e3f654", "score": "0.498555", "text": "function Shape1() {}", "title": "" }, { "docid": "c44896178415279415d24faf05b065dc", "score": "0.49833265", "text": "setParams(params) {\n let wAStart = 0;\n let wAEnd = this.hiddenLayerSize.multiply(this.inputLayerSize);\n this.wA = params.slice(wAStart, wAEnd).reshape(this.inputLayerSize, this.hiddenLayerSize);\n let wBEnd = wAEnd.add(this.hiddenLayerSize.multiply(this.outputLayerSize));\n this.wB = params.slice(wAEnd, wBEnd).reshape(this.hiddenLayerSize, this.outputLayerSize);\n }", "title": "" }, { "docid": "f3e22b10d4a267c2d2e8e1890eeab4e2", "score": "0.49829456", "text": "constructor (x,y,size) {\n this.x = x;\n this.y = y;\n this.ellipse = size;\n}", "title": "" }, { "docid": "380a9839791664c1c3a66570c2207c6c", "score": "0.4974901", "text": "function appendShape(shape,element){if(element){element.appendChild(shape);}return shape;}", "title": "" }, { "docid": "4dfcc5668ded663a234ca840929fe48e", "score": "0.49148637", "text": "constructor() {\n this.shape = ['square', 'rectangle', 'circle', 'oval', 'triangle'];\n this.weight = [50, 100, 150, 200, 250];\n }", "title": "" }, { "docid": "d023642fb6353e082ad1568adc9e0b47", "score": "0.48917568", "text": "function T_Shape(center) {\n\n // TU CÓDIGO AQUÍ: : Para programar T_Shape toma como ejemplo el código de la clase I_Shape\n var coords = [new Point(center.x - 1, center.y),\n\t new Point(center.x, center.y + 1),\n\t new Point(center.x , center.y),\n\t new Point(center.x + 1 , center.y)];\n \n Shape.prototype.init.call(this, coords, \"yellow\");\n\n}", "title": "" }, { "docid": "059fc688109ce2f222ab119292235605", "score": "0.48909286", "text": "function SimpleShapeView() {}", "title": "" }, { "docid": "8a282c4c9500ac347b2aabd29f7bd0b7", "score": "0.48879018", "text": "addToStage() {\n\t\tthis.DOMElement.appendChild(this.shape);\n\t\tthis.shape.style.strokeWidth = this.strokeWidth/2;\n\t\tthis.shape.style.opacity = 0;\n\t\tNATION.Animation.start(this.shape, {opacity: 1, strokeWidth: this.strokeWidth}, {duration: 1000, easing: \"easeInOutQuad\"});\n\t\t//this.DOMElement.appendChild(this.boundingBoxGuide);\n\t\t//this.DOMElement.appendChild(this.centerGuide);\n\t\t//this.DOMElement.appendChild(this.segmentGuide);\n\t}", "title": "" }, { "docid": "19b7810a781b7cd66850606b76c7ab4e", "score": "0.48856524", "text": "constructor(resize, reset, registerPen, resetPen, addPoint, updatePenMode, updatePenColor) {\n // (Pen) => PenOps\n this.makePenOps = this.makePenOps.bind(this);\n this.resize = resize;\n this.reset = reset;\n this.registerPen = registerPen;\n this.resetPen = resetPen;\n this.addPoint = addPoint;\n this.updatePenMode = updatePenMode;\n this.updatePenColor = updatePenColor;\n }", "title": "" }, { "docid": "042910100ff0e27bb401e86cc4cb1f32", "score": "0.4872232", "text": "reshape(shape) {\r\n this._shape = shape;\r\n let oldsize = this._size;\r\n this._calcSize();\r\n if (this._size > oldsize) {\r\n // Rellocate a buffer of bigger size, copy old data to it\r\n this._alloc(this._size, this._data, this._datatype);\r\n // Fill the excess elements in new buffer with 0\r\n this._data.fill(0, oldsize);\r\n }\r\n return this;\r\n }", "title": "" }, { "docid": "e27107caf44d3b7f8d3fe74cf5364ad7", "score": "0.4836462", "text": "function loadShape(myShape, type)\n{\n myShape.start = points.length;\n points = points.concat(myShape.points);\n colors = colors.concat(myShape.colors);\n myShape.size = points.length - myShape.start;\n myShape.type = type;\n}", "title": "" }, { "docid": "0c518e48a9a797962cc49567e91e2898", "score": "0.48361704", "text": "function O_Shape(center) {\n\n // TU CÓDIGO AQUÍ: Para programar O_Shape toma como ejemplo el código de la clase I_Shape\n var coords = [new Point(center.x - 1, center.y),\n\t new Point(center.x -1 , center.y +1),\n\t new Point(center.x , center.y),\n\t new Point(center.x, center.y +1)];\n\n Shape.prototype.init.call(this, coords, \"red\");\n\n}", "title": "" }, { "docid": "e34e10636f2f41340b87f3b8f12d01a9", "score": "0.48292726", "text": "function shapemaker() {\n}", "title": "" }, { "docid": "c8fa7d8c4b4e99c0e88cb9a4f45b1aa8", "score": "0.48245442", "text": "function Shape(pos) {\n this.constructor.prototype.getPos= function(){ return pos; }\n this.constructor.prototype.setPos= function(p){ return pos=p; }\n}", "title": "" }, { "docid": "e62ee32d861983ffe0a8caa253f95695", "score": "0.48135334", "text": "function newAllShape(opt) {\r\n var {layer,shapeAllData,shapeName,draggable} = opt;\r\n\r\n for (var key in shapeAllData){\r\n var shapeOne = shapeAllData[key];\r\n var points = shapeOne.points;\r\n var x = shapeOne[shapeName].x;\r\n var y = shapeOne[shapeName].y;\r\n\r\n var shape = new Konva.Line({\r\n id:key,\r\n name:shapeName,\r\n points: points,\r\n x:x,\r\n y:y,\r\n closed:true,\r\n fill:'#000',\r\n draggable:draggable,\r\n globalCompositeOperation:'xor'\r\n });\r\n\r\n layer.add(shape);\r\n\r\n }\r\n layer.on('dragstart',function (evt) {\r\n stopwatch.startTime();\r\n });\r\n\r\n layer.on('dragmove',function (evt) {\r\n });\r\n layer.on('dragend',function (evt) {\r\n console.log(\"evt\",evt.target);\r\n var shape = evt.target;\r\n\r\n calibrateShape(layer,shape);\r\n\r\n calculateOffset(layer,'bottomShape');\r\n checkPass();\r\n });\r\n\r\n}", "title": "" }, { "docid": "067efa846c3a40754c2b5dbb3883cc6e", "score": "0.47827232", "text": "function shapeDrag(x, y) {\n if (mode == \"selection\") {\n this.oPath = this.attr(\"path\");\n this.attr({\n opacity: 0.5\n });\n }\n\n }", "title": "" }, { "docid": "913cecee03513b905ec6197d0f9fe337", "score": "0.4743192", "text": "set offset(offset) {\n this.shape.offset = offset.clone();\n }", "title": "" }, { "docid": "b3f9acea6e043f4ac5783ad4b7b78caf", "score": "0.4737644", "text": "function addRegister(shapeFactory) {\n const functionName = 'register' + shapeFactory.className;\n Shape[functionName] = function(shapeType, cfg, extendShapeType) {\n const extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeBase;\n const shapeObj = Util.mix({}, extendShape, cfg);\n shapeObj.type = shapeType;\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n}", "title": "" }, { "docid": "40f312db21693760c27e09c5758100f5", "score": "0.4716772", "text": "function genShape2(ref, shape_params, gradient_color = 1) {\n\n if (shape_params.hasOwnProperty('gradient_color')) {\n // if gradient_color is set in shape_params, it has priority\n gradient_color = Number(shape_params.gradient_color);\n if (gradient_color != 1 && gradient_color != 2) {\n console.warn('gradient color mode is bad, taken 1 by default');\n gradient_color = 1;\n }\n }\n\n // generate the top of the shape\n shape_params.rendrParts = 1;\n var obj3d1 = generateShape(shape_params);\n var colors1 = genColors(obj3d1.polygons.length, gradient_color);\n\n var points1 = obj3d1.points;\n obj3d1.polygons.forEach((vertices, idx) => {\n let shape = [];\n vertices.forEach(item => {\n let point = points1[item];\n shape.push({x: point.x, y: point.y, z: point.z});\n });\n\n new Zdog.Shape({\n addTo: ref,\n path: shape,\n color: colors1[idx],\n closed: false,\n stroke: stroke_value,\n fill: true,\n });\n });\n\n // generate the bottom of the shape\n shape_params.rendrParts = 2;\n var obj3d2 = generateShape(shape_params);\n var colors2 = genColors(obj3d2.polygons.length, 2);\n\n var points2 = obj3d2.points;\n obj3d2.polygons.forEach((vertices, idx) => {\n let shape = [];\n vertices.forEach(item => {\n let point = points2[item];\n shape.push({x: point.x, y: point.y, z: point.z});\n });\n\n new Zdog.Shape({\n addTo: ref,\n path: shape,\n color: colors2[idx],\n closed: false,\n stroke: stroke_value,\n fill: true,\n });\n });\n }", "title": "" }, { "docid": "9c1176a0d59ca5a0caae2d0c4f28f85a", "score": "0.47144622", "text": "function insertShape() {\n let xVal = randomVal(0, MAX);\n let yVal = randomVal(0, MAX);\n}", "title": "" }, { "docid": "3dc7c3b828dd1bd44c4b9ee06b32d2a1", "score": "0.47088498", "text": "function S_Shape(center) {\n\n // TU CÓDIGO AQUÍ: Para programar S_Shape toma como ejemplo el código de la clase I_Shape \n var coords = [new Point(center.x -1 , center.y +1),\n\t new Point(center.x, center.y +1),\n\t new Point(center.x , center.y),\n\t new Point(center.x + 1, center.y)];\n \n Shape.prototype.init.call(this, coords, \"green\");\n\n}", "title": "" }, { "docid": "8d62bf552b152b64a2bc021601544dd4", "score": "0.47081903", "text": "function updateSpecialShapeOnMove(loc){\n updateSpecialShapeSize(loc);\n drawSpecialShape(loc);\n}", "title": "" }, { "docid": "65a26315ea8babfe49fb07a37cbb2a8c", "score": "0.47061974", "text": "constructor(name, x,y, r, fc, dx,dy, boundryWidth, boundryHeight ){\r\n this.name = name;\r\n this.x=x;\r\n this.y=y;\r\n this.r=r;\r\n this.fc=fc;\r\n this.dx=dx;\r\n this.dy=dy;\r\n this.boundryWidth = boundryWidth;\r\n this.boundryHeight = boundryHeight;\r\n this.staticX = x;\r\n this.staticY = y;\r\n}", "title": "" }, { "docid": "7bcf3df97818ebb9cd05697e0094eda0", "score": "0.47060573", "text": "function Shape(){\n this.x = 0;\n this.y = 0;\n}", "title": "" }, { "docid": "8b33928881c93a0625262c8a7ac6978f", "score": "0.47033045", "text": "_extendDefaults() {\n super._extendDefaults();\n this._calcPosData();\n }", "title": "" }, { "docid": "3131a941641519c697df0eefd0a56c74", "score": "0.46843922", "text": "constructor(x, y, w) {\n this.x = x;\n this.y = y;\n this.w = w;\n }", "title": "" }, { "docid": "918aa66e3ea04c9f27743a72a8cb5491", "score": "0.4683526", "text": "function extendedPoint(p1, p2, scalar){\n let x = scalar * (p2.x - p1.x) + p1.x;\n let y = scalar * (p2.y - p1.y) + p1.y;\n return createVector(x,y);\n}", "title": "" }, { "docid": "0b5aa17a8f59e34ecd9acd952a3627bd", "score": "0.4674202", "text": "clone(x) {\n const y = ENGINE.runKernel(Identity$1, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }", "title": "" }, { "docid": "e6753ed2bdc296ef81e8e8b3b7669492", "score": "0.4672915", "text": "function newShape() {\n var id = Math.floor( Math.random() * shapes.length );\n var shape = shapes[ id ]; // maintain id for color filling\n\n current = [];\n for ( var y = 0; y < 4; ++y ) {\n current[ y ] = [];\n for ( var x = 0; x < 4; ++x ) {\n var i = 4 * y + x;\n if ( typeof shape[ i ] != 'undefined' && shape[ i ] ) {\n current[ y ][ x ] = id + 1;\n }\n else {\n current[ y ][ x ] = 0;\n }\n }\n }\n // position where the shape will evolve\n currentX = 5;\n currentY = 0;\n }", "title": "" }, { "docid": "82123d9a46213b7d56284f746e7fe6ae", "score": "0.46605527", "text": "function extendDeep() {\n return FRAMEWORK.extend.apply(this, [true].concat([].slice.call(arguments)));\n }", "title": "" }, { "docid": "aaeb37038ca88afdbb1bc1e2ced025db", "score": "0.4656589", "text": "clone(x) {\n const y = ENGINE.runKernel(Identity, { x });\n const inputs = { x };\n const grad = (dy) => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = { x: dy };\n const attrs = { dtype };\n return ENGINE.runKernel(Cast, gradInputs, \n // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }", "title": "" }, { "docid": "ec892f5a57d606b97dedc9289b9651ec", "score": "0.46442878", "text": "update() {\n if (this.shape) {\n this.shape.recalc();\n }\n }", "title": "" }, { "docid": "5ff00ddb658d9ea017872242e090ae07", "score": "0.46397823", "text": "constructor(w, h, x, y) {\n this.dims = {\n width: w,\n height: h\n }\n \n this.pos = {\n x,\n y\n }\n }", "title": "" }, { "docid": "ce9ad4fd437f4f142614fc81dfc7b38e", "score": "0.46321276", "text": "constructor(x,y) {\n this.x = x ;\n this.y = y;\n this.size = [\n 10, 15, 20, 40\n ]\n }", "title": "" }, { "docid": "9f7117913c94b99025f38552688480a6", "score": "0.46125677", "text": "function rectangle(shape) {\n\tif (shape.width < minSize) {\n\t\tshape.width = minSize;\n\t}\n\tif (shape.height < minSize) {\n\t\tshape.height = minSize;\n\t}\n\tctx.strokeStyle = shape.stroke;\n\tctx.strokeRect(shape.x, shape.y, shape.width, shape.height);\n\n\tdrawCenterPoint(shape);\n\tdrawResizeDot(shape);\n}", "title": "" }, { "docid": "91b86be06fc959bf2d8e2c16f4ec8328", "score": "0.46083385", "text": "adjustToFit() {\n if (this.isImmutable()) {\n return this\n }\n this._object.fixGeometryWithOptions(0)\n return this\n }", "title": "" }, { "docid": "ca858495fe323dda754e03ea6b23bb17", "score": "0.4607199", "text": "modify(options){\n this.name = options.name || this.name;\n this.width = options.width || this.width;\n this.height = options.height || this.height;\n this.legs = options.legs || this.legs;\n\n //TODO MODIFY MESH\n //this.position.copy(options.position);\n }", "title": "" }, { "docid": "949f86d356c567dc1657547207e90280", "score": "0.46029478", "text": "clone(x) {\n const y = ENGINE.runKernel(Identity, {\n x\n });\n const inputs = {\n x\n };\n const grad = dy => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = {\n x: dy\n };\n const attrs = {\n dtype\n };\n return ENGINE.runKernel(Cast, gradInputs, // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }", "title": "" }, { "docid": "949f86d356c567dc1657547207e90280", "score": "0.46029478", "text": "clone(x) {\n const y = ENGINE.runKernel(Identity, {\n x\n });\n const inputs = {\n x\n };\n const grad = dy => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = {\n x: dy\n };\n const attrs = {\n dtype\n };\n return ENGINE.runKernel(Cast, gradInputs, // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }", "title": "" }, { "docid": "ce8546a45a5dc4bc78cfd2828ddb8563", "score": "0.46022886", "text": "function extend(obj) {\n var arguments$1 = arguments;\n\n // In JavaScript, the combination of a constructor function (e.g. `g.Line = function(...) {...}`) and prototype (e.g. `g.Line.prototype = {...}) is akin to a C++ class.\n // - When inheritance is not necessary, we can leave it at that. (This would be akin to calling extend with only `obj`.)\n // - But, what if we wanted the `g.Line` quasiclass to inherit from another quasiclass (let's call it `g.GeometryObject`) in JavaScript?\n // - First, realize that both of those quasiclasses would still have their own separate constructor function.\n // - So what we are actually saying is that we want the `g.Line` prototype to inherit from `g.GeometryObject` prototype.\n // - This method provides a way to do exactly that.\n // - It copies parent prototype's properties, then adds extra ones from child prototype/overrides parent prototype properties with child prototype properties.\n // - Therefore, to continue with the example above:\n // - `g.Line.prototype = extend(g.GeometryObject.prototype, linePrototype)`\n // - Where `linePrototype` is a properties object that looks just like `g.Line.prototype` does right now.\n // - Then, `g.Line` would allow the programmer to access to all methods currently in `g.Line.Prototype`, plus any non-overridden methods from `g.GeometryObject.prototype`.\n // - In that aspect, `g.GeometryObject` would then act like the parent of `g.Line`.\n // - Multiple inheritance is also possible, if multiple arguments are provided.\n // - What if we wanted to add another level of abstraction between `g.GeometryObject` and `g.Line` (let's call it `g.LinearObject`)?\n // - `g.Line.prototype = extend(g.GeometryObject.prototype, g.LinearObject.prototype, linePrototype)`\n // - The ancestors are applied in order of appearance.\n // - That means that `g.Line` would have inherited from `g.LinearObject` that would have inherited from `g.GeometryObject`.\n // - Any number of ancestors may be provided.\n // - Note that neither `obj` nor any of the arguments need to actually be prototypes of any JavaScript quasiclass, that was just a simplified explanation.\n // - We can create a new object composed from the properties of any number of other objects (since they do not have a constructor, we can think of those as interfaces).\n // - `extend({ a: 1, b: 2 }, { b: 10, c: 20 }, { c: 100, d: 200 })` gives `{ a: 1, b: 10, c: 100, d: 200 }`.\n // - Basically, with this function, we can emulate the `extends` keyword as well as the `implements` keyword.\n // - Therefore, both of the following are valid:\n // - `Lineto.prototype = extend(Line.prototype, segmentPrototype, linetoPrototype)`\n // - `Moveto.prototype = extend(segmentPrototype, movetoPrototype)`\n\n var i;\n var n;\n\n var args = [];\n n = arguments.length;\n for (i = 1; i < n; i++) { // skip over obj\n args.push(arguments$1[i]);\n }\n\n if (!obj) { throw new Error('Missing a parent object.'); }\n var child = Object.create(obj);\n\n n = args.length;\n for (i = 0; i < n; i++) {\n\n var src = args[i];\n\n var inheritedProperty;\n var key;\n for (key in src) {\n\n if (src.hasOwnProperty(key)) {\n delete child[key]; // delete property inherited from parent\n inheritedProperty = Object.getOwnPropertyDescriptor(src, key); // get new definition of property from src\n Object.defineProperty(child, key, inheritedProperty); // re-add property with new definition (includes getter/setter methods)\n }\n }\n }\n\n return child;\n }", "title": "" }, { "docid": "d8b7fc1ae512b0df5b1aaa6e6780b82b", "score": "0.45965543", "text": "applyOptions(options, x) {\n const point = super.applyOptions.call(this, options, x), { lat, lon } = point.options;\n if (isNumber(lon) && isNumber(lat)) {\n const { colsize = 1, rowsize = 1 } = this.series.options, x1 = lon - colsize / 2, y1 = lat - rowsize / 2;\n point.geometry = point.options.geometry = {\n type: 'Polygon',\n // A rectangle centered in lon/lat\n coordinates: [\n [\n [x1, y1],\n [x1 + colsize, y1],\n [x1 + colsize, y1 + rowsize],\n [x1, y1 + rowsize],\n [x1, y1]\n ]\n ]\n };\n }\n return point;\n /* eslint-enable valid-jsdoc */\n }", "title": "" }, { "docid": "fe328b0aa57bdebb32e47e2cc1b81499", "score": "0.4591072", "text": "constructor(x, y, size) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.size = size;\n\t}", "title": "" }, { "docid": "1940cb2b72b6d642c2d51b7fdce685c9", "score": "0.45868507", "text": "size(width, height = width) {\n this.dimension = {\n width: width,\n height: height\n };\n\n return this;\n }", "title": "" }, { "docid": "4f7de4e27b86b398dc2cb7921bb31958", "score": "0.4583456", "text": "@action setShape(shape){\n switch (shape){\n case \"square\":\n this.roomShape = \"square\";\n break;\n case \"circular\":\n this.roomShape = \"circular\";\n break;\n default:\n this.roomShape = \"square\";\n }\n \n }", "title": "" }, { "docid": "a42505da9e078842f5b9dd8adbb06226", "score": "0.45823237", "text": "function Extend(superGrammar, name, body) {\n this.superGrammar = superGrammar;\n this.name = name;\n this.body = body;\n var origBody = superGrammar.rules[name].body;\n this.terms = [body, origBody];\n}", "title": "" }, { "docid": "a42505da9e078842f5b9dd8adbb06226", "score": "0.45823237", "text": "function Extend(superGrammar, name, body) {\n this.superGrammar = superGrammar;\n this.name = name;\n this.body = body;\n var origBody = superGrammar.rules[name].body;\n this.terms = [body, origBody];\n}", "title": "" }, { "docid": "a42505da9e078842f5b9dd8adbb06226", "score": "0.45823237", "text": "function Extend(superGrammar, name, body) {\n this.superGrammar = superGrammar;\n this.name = name;\n this.body = body;\n var origBody = superGrammar.rules[name].body;\n this.terms = [body, origBody];\n}", "title": "" }, { "docid": "2a21cb9633a4e463738715872f011a69", "score": "0.45813704", "text": "function Shape(x , y , xV , yV , exists){\n this.x = x;\n this.y = y;\n this.xV = xV;\n this.yV = yV;\n this.exists = exists;\n}", "title": "" }, { "docid": "1f09ab40d7002a2600160fc07d2396fe", "score": "0.4579295", "text": "function Extend(superGrammar, name, body) {\n\t this.superGrammar = superGrammar;\n\t this.name = name;\n\t this.body = body;\n\t var origBody = superGrammar.ruleBodies[name];\n\t this.terms = [body, origBody];\n\t}", "title": "" }, { "docid": "86af4e38885438be72101e6273428427", "score": "0.45750988", "text": "constructor(x, y, w, color){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.color = color.copy();\r\n }", "title": "" }, { "docid": "87c8c244d4bd9f63ef17df576bf73c00", "score": "0.45694163", "text": "set shape(shape) {\n this._shape = shape;\n this._shape.collider = this;\n if (this.useShapeInertia) {\n this.inertia = isNaN(this._shape.inertia) ? this.inertia : this._shape.inertia;\n }\n }", "title": "" }, { "docid": "5c2593e4f7e8f2edf1f32a075d53e2de", "score": "0.45689565", "text": "function CRelativeShape()\n{\n\tthis.type='l'\n\tthis.angleToStart = 0.0 //angle from (start pt of context) to (start pt of shape)\n\tthis.lengthToStart = 0.0 //distance from (start pt of context) to (start pt of shape)\n\tthis.rotation = 0.0 //degrees. meaningless for circles.\n\tthis.length = 0.0 //for circles, radius size\n}", "title": "" }, { "docid": "6f5e5247ee0bf744ce94b28b037f9a1d", "score": "0.45661414", "text": "mergeWith(boundingBox, ctx) {\n const that = boundingBox;\n\n const new_x = this.x < that.x ? this.x : that.x;\n const new_y = this.y < that.y ? this.y : that.y;\n const new_w = Math.max(this.x + this.w, that.x + that.w) - new_x;\n const new_h = Math.max(this.y + this.h, that.y + that.h) - new_y;\n\n this.x = new_x;\n this.y = new_y;\n this.w = new_w;\n this.h = new_h;\n\n if (ctx) this.draw(ctx);\n return this;\n }", "title": "" }, { "docid": "6f5e5247ee0bf744ce94b28b037f9a1d", "score": "0.45661414", "text": "mergeWith(boundingBox, ctx) {\n const that = boundingBox;\n\n const new_x = this.x < that.x ? this.x : that.x;\n const new_y = this.y < that.y ? this.y : that.y;\n const new_w = Math.max(this.x + this.w, that.x + that.w) - new_x;\n const new_h = Math.max(this.y + this.h, that.y + that.h) - new_y;\n\n this.x = new_x;\n this.y = new_y;\n this.w = new_w;\n this.h = new_h;\n\n if (ctx) this.draw(ctx);\n return this;\n }", "title": "" }, { "docid": "a116002634058b866da6aaef899c0a51", "score": "0.45636588", "text": "initGeometry() {\n\n // We will add our shadow first so it goes in the back\n this.shadow = this.createShapeElement(this.getModel());\n this.addGraphic(this.shadow);\n this.shadow.setAttribute('fill', 'rgba(0,0,0,0.8)');\n\n super.initGeometry();\n\n }", "title": "" }, { "docid": "9cee4049649952fab08a8420daba882d", "score": "0.45611328", "text": "function extend(name, schema) {\n // makes sure new rules are properly formatted.\n guardExtend(name, schema);\n // Full schema object.\n if (typeof schema === 'object') {\n RuleContainer.extend(name, schema);\n return;\n }\n RuleContainer.extend(name, {\n validate: schema\n });\n}", "title": "" }, { "docid": "d3bf2a48a058dbe7c3920d0b030822be", "score": "0.4555243", "text": "resize(strokeWidth, scale) {\n\t\tthis.strokeWidth = strokeWidth;\n\t\tthis.halfWidth = this.originalHalfWidth * scale;\n\t\tthis.scale = scale;\n\t\tthis.shape.setAttribute(\"stroke-width\", this.strokeWidth);\n\t\tthis.shape.style.strokeWidth = this.strokeWidth;\n\t}", "title": "" }, { "docid": "68c28aceaf7e42084c272460efe72d03", "score": "0.45551154", "text": "newShape() {\n var id = Math.floor( Math.random() * this.shapes.length );\n var shape = this.shapes[ id ]; // maintain id for color filling\n\n this.current = [];\n for ( var y = 0; y < 4; ++y ) {\n this.current[ y ] = [];\n for ( var x = 0; x < 4; ++x ) {\n var i = 4 * y + x;\n if ( typeof shape[ i ] !== 'undefined' && shape[ i ] ) {\n this.current[ y ][ x ] = id + 1;\n }\n else {\n this.current[ y ][ x ] = 0;\n }\n }\n }\n // position where the shape will evolve\n this.currentX = 5;\n this.currentY = 0;\n }", "title": "" }, { "docid": "566e858032f937832dcc8d8622d72e0e", "score": "0.45547536", "text": "function squeezeInputInfo(inInfo, squeezedShape) {\n // Deep copy.\n var newInputInfo = JSON.parse(JSON.stringify(inInfo));\n newInputInfo.shapeInfo.logicalShape = squeezedShape;\n return newInputInfo;\n}", "title": "" }, { "docid": "ad5d1566d61f4f3e440bc28c9ca58e3e", "score": "0.45473748", "text": "extend (config) {\n // ...\n }", "title": "" }, { "docid": "ad5d1566d61f4f3e440bc28c9ca58e3e", "score": "0.45473748", "text": "extend (config) {\n // ...\n }", "title": "" }, { "docid": "ad5d1566d61f4f3e440bc28c9ca58e3e", "score": "0.45473748", "text": "extend (config) {\n // ...\n }", "title": "" }, { "docid": "4827a67f538529bf941c4f2e8bd98555", "score": "0.45427954", "text": "clone(x) {\n const y = ENGINE.runKernel(_kernel_names.Identity, {\n x\n });\n const inputs = {\n x\n };\n const grad = dy => ({\n x: () => {\n const dtype = 'float32';\n const gradInputs = {\n x: dy\n };\n const attrs = {\n dtype\n };\n return ENGINE.runKernel(_kernel_names.Cast, gradInputs, // tslint:disable-next-line: no-unnecessary-type-assertion\n attrs);\n }\n });\n const saved = [];\n this.addTapeNode(this.state.activeScope.name, inputs, [y], grad, saved, {});\n return y;\n }", "title": "" }, { "docid": "b09b4636e404e60d47c0a80f247878ce", "score": "0.45303202", "text": "constructor(parameters = {}) {\n parameters.depthTest = false;\n super(parameters);\n this.isCirclePointsMaterial = true;\n this.type = \"CirclePointsMaterial\";\n this.vertexShader = vertexShader;\n this.fragmentShader = fragmentShader;\n this.transparent = true;\n this.m_size = parameters.size || DEFAULT_CIRCLE_SIZE;\n this.m_color = new THREE.Color();\n this.uniforms = {\n diffuse: new THREE.Uniform(this.m_color),\n size: new THREE.Uniform(this.m_size)\n };\n this.extensions.derivatives = true;\n }", "title": "" }, { "docid": "88bba79e57173433b03c4343088831f1", "score": "0.4526256", "text": "function Shape() {\r\n\t\t\r\n\t\t// keeping all of the shape profiles/templates as squares allows for easier parsing the arrays\r\n\t\t//\r\n\t\t// O \r\n\t\t// [1][1]\r\n\t\t// [1][1]\r\n\t\t//\r\n\t\t// I\r\n\t\t// [0][1][0][0]\r\n\t\t// [0][1][0][0]\r\n\t\t// [0][1][0][0]\r\n\t\t// [0][1][0][0]\r\n\t\t//\r\n\t\t// L\r\n\t\t// [0][1][0]\r\n\t\t// [0][1][0]\r\n\t\t// [0][1][1]\r\n\t\t//\r\n\t\t// J\r\n\t\t// [0][1][0]\r\n\t\t// [0][1][0]\r\n\t\t// [1][1][0]\r\n\t\t//\r\n\t\t// S\r\n\t\t// [0][1][1]\r\n\t\t// [1][1][0]\r\n\t\t// [0][0][0]\r\n\t\t//\r\n\t\t// Z\r\n\t\t// [1][1][0]\r\n\t\t// [0][1][1]\r\n\t\t// [0][0][0]\r\n\t\t//\r\n\t\t// T\r\n\t\t// [0][1][0]\r\n\t\t// [1][1][1]\r\n\t\t// [0][0][0]\r\n\t\t//\r\n\t\t\r\n\t\t//when we rotate we don't want the move to be prevented in most cases, but to push the piece left or right as appropriate\r\n\t\t\r\n\t\t\r\n\t\tthis.init = function(letter, c, r) {\r\n\t\t\tthis.letter = letter;\r\n\t\t\tthis.col = c;\r\n\t\t\tthis.row = r;\r\n\t\t\tthis.color = this.setColor(letter);\r\n\t\t\tthis.setOrientation();\r\n\t\t\tthis.setHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.setOrientation = function() {\r\n\t\t\t\r\n\t\t\tvar obj;\r\n\t\t\t\r\n\t\t\tif ( this.letter === 'T' ) {\r\n\t\t\t\t\r\n\t\t\t\tobj =\t[\r\n\t\t\t\t\t\t[0,1,0], \r\n\t\t\t\t\t\t[1,1,1],\r\n\t\t\t\t\t\t[0,0,0],\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.orientation = obj;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tthis.setColor = function(letter) {\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\t\tthis.setHeight = function() {\r\n\t\t\t\r\n\t\t\tvar obj = 0;\r\n\t\t\t\r\n\t\t\tif (this.letter === 'T') {\r\n\t\t\t\tobj = 2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.height = obj;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//rotate updates the shape this.orientation\r\n\t\tthis.rotate = function(direction) {\r\n\t\t\t\r\n\t\t\tif ( direction === 'clock' ) {\r\n\t\t\t\t\r\n\t\t\t\t//console.log('rotated clockwise');\r\n\t\t\t\tvar matrix = this.orientation;\r\n\t\t\t\tvar len = this.orientation.length;\r\n\t\t\t\tvar newMatrix = [];\r\n\t\t\t\t\r\n\t\t\t\tmatrix.reverse();\r\n\t\t\t\t\r\n\t\t\t\tfor (var y=0; y<len; ++y) {\r\n\t\t\t\t\tnewMatrix[y] = [];\r\n\t\t\t\t\tfor (var x=0; x<len; ++x) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tnewMatrix[y][x] = matrix[x][y];\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\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.orientation = newMatrix;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "title": "" }, { "docid": "ee452f979eaa2ed05e4133ec7393fe1c", "score": "0.45144096", "text": "constructor(a, b)\n {\n this.width =a;\n this.height=b;\n }", "title": "" }, { "docid": "83233747ece12b4b1fffc688f55d14da", "score": "0.45106858", "text": "function MorphingPolygonTool() {\n }", "title": "" }, { "docid": "347ce102a47f327d27a43f51c52664c4", "score": "0.4506383", "text": "constructor(x, y, w, h) {\r\n super(x, y, w, h);\r\n }", "title": "" }, { "docid": "347ce102a47f327d27a43f51c52664c4", "score": "0.4506383", "text": "constructor(x, y, w, h) {\r\n super(x, y, w, h);\r\n }", "title": "" }, { "docid": "1b56270454c0534803c73fce2e8a3138", "score": "0.45062894", "text": "constructor( x, y ){ this.resize( x, y ); }", "title": "" }, { "docid": "e39ce0e6faea1827311b63eb55c95ec4", "score": "0.45008028", "text": "function resizeBorder(shape, shapeBorder, whiteStroke) {\n switch (shapeBorder.shapeName) {\n case 'rectangle':\n shapeBorder.width = shape.width + shape.strokeWidth +\n whiteStroke;\n shapeBorder.height = shape.height + shape.strokeWidth +\n whiteStroke;\n break;\n case 'circle':\n shapeBorder.radius = shape.radius + shape.strokeWidth / 2;\n }\n }", "title": "" }, { "docid": "675cb55cee70d5b92f3745994b747734", "score": "0.44998637", "text": "inject(Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection) {\n this.ol = {\n geom: {\n Point,\n LineString,\n LinearRing,\n Polygon,\n MultiPoint,\n MultiLineString,\n MultiPolygon,\n GeometryCollection\n }\n };\n }", "title": "" }, { "docid": "ae1996bfa72482e61c2339251062c037", "score": "0.4495279", "text": "function squeezeInputInfo(inInfo, squeezedShape) {\n // Deep copy.\n const newInputInfo = JSON.parse(JSON.stringify(inInfo));\n newInputInfo.shapeInfo.logicalShape = squeezedShape;\n return newInputInfo;\n}", "title": "" }, { "docid": "6393289c39b104841716f7056de2e7d9", "score": "0.44925505", "text": "constructor(x, y, w, h){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.h = h;\r\n }", "title": "" }, { "docid": "c8bcdca19de6c153d52d8ae4651a48f3", "score": "0.44893637", "text": "function Shape ( edge_point ) {\n\n /**\n * A shape must have a variable called edge_point of type Vector2 which\n * represents any single arbitrary point that falls on the shape's edge\n */\n this.edge_point = edge_point;\n\n}", "title": "" }, { "docid": "484d7464cb1f229b5d260d6f5bf0fefe", "score": "0.44887266", "text": "function newSize(w, h, a, canvas) {\n var rads = a * Math.PI / 180;\n var c = Math.cos(rads);\n var s = Math.sin(rads);\n if (s < 0) {\n s = -s;\n }\n if (c < 0) {\n c = -c;\n }\n size.width = h * s + w * c;\n size.height = h * c + w * s;\n\n canvas.width = size.width;\n canvas.height = size.height;\n }", "title": "" }, { "docid": "ba2cb508448f4599d2400dcd4fdbfde1", "score": "0.4487626", "text": "function Shape(area = 0.0, weight = 0.0) {\n\t\tthis.area = area;\n\t\tthis.weight = weight;\n\t\tthis.getWeight = () => weight;\n\t\tthis.getArea = () => area;\n\t}", "title": "" }, { "docid": "acffca29b5f80371b58a9d68f84b5a6c", "score": "0.4486143", "text": "function xe(b){this.radius=b}", "title": "" }, { "docid": "1946ea215144c398296043b27073915e", "score": "0.4473717", "text": "function ye(b){this.radius=b}", "title": "" }, { "docid": "09e4291294faca7986f4802f84be956b", "score": "0.44680002", "text": "function addShape(x, y, w, h, fill, sel, rectid, type, strokecol, strokew, angle) {\n var rect;\n switch (type) {\n case 'line':\n rect = new Line(x, y, w, h);\n break;\n case 'ellipse':\n rect = new Ellipse(x, y, w, h);\n break;\n case 'crect':\n rect = new CRectangle(x, y, w, h);\n break;\n case 'rect':\n default:\n rect = new ShapeObj(x, y, w, h);\n break;\n }\n\n //fill\n if (fill === '')\n rect.fill = '';\t//transparent fill\n else if (fill) rect.fill = fill;\t//arg fill\n else\n rect.fill = shapeFill;\t//global fill\n\n rect.strokecolor = strokecol || shapeBorderColor;\n rect.strokewidth = strokew || shapeBorderWidth;\n //roatation angle\n if (angle)\n rect.angle = angle;\n\n if (sel) {\n rect.select();\n } else {\n rect.unselect();\n }\n\n //shape id\n rect.shpid = rectid || rect.shpid;\n\n allshapes.push(rect);\n invalidate();\n return rect;\n }", "title": "" } ]
75ed4e52d0c8ff5bc3f3b994d063ddf5
NOTE: 'log' is dealt with at the bottom of this file to avoid cluttering up the more straightforward overrides for the other logging callbacks.
[ { "docid": "3704b9e779d9c5c5379cabd7a4f1c1c2", "score": "0.0", "text": "function notifyTestDone(theTest) {\n var results = {\n name: theTest.testName,\n module: currentModuleName,\n failed: ((theTest.status === 'failure' || theTest.status === 'error') ? 1 : 0),\n passed: (theTest.status === 'success' ? 1 : 0),\n total: 1,\n runtime: theTest.timeTaken\n };\n top.testManager.runLoggingCallbacks('testDone', results);\n }", "title": "" } ]
[ { "docid": "93e8bd30b6fd769ff3fe13e03ed3d88e", "score": "0.7915854", "text": "function log() {}", "title": "" }, { "docid": "e3feb4b7be444adddc1c58dc4d52e29d", "score": "0.7686947", "text": "function logging() {}", "title": "" }, { "docid": "c205267715d6eb2c470361d6aa66585f", "score": "0.7237471", "text": "function logger() {\n\t\t\t\t// if $log fn is called directly, default to \"info\" message\n\t\t\t\tlogger.info.apply(logger, arguments);\n\t\t\t}", "title": "" }, { "docid": "f119ac9d48d0505ddba8d530735d6c6b", "score": "0.72074604", "text": "function logger() {\n // if $log fn is called directly, default to \"info\" message\n logger.info.apply(logger, arguments);\n }", "title": "" }, { "docid": "0aed1759c2d638e18f7efc5886d9418b", "score": "0.71879315", "text": "function logger() {\n\t\t\t// if $log fn is called directly, default to \"info\" message\n\t\t\tlogger.info.apply(logger, arguments);\n\t\t}", "title": "" }, { "docid": "7b4b41919aa2eaafdccc785300138a84", "score": "0.7180938", "text": "function logger() {\r\n // if $log fn is called directly, default to \"info\" message\r\n logger.info.apply(logger, arguments);\r\n }", "title": "" }, { "docid": "44ab82c195ff3f4efed25a03e48affc4", "score": "0.6937952", "text": "log(entry) {\n }", "title": "" }, { "docid": "1f6eaf7c82d488045b162f84a05ebde3", "score": "0.6883573", "text": "static log() {\n const logger = new Logger()\n\n logger.log.apply(logger, arguments)\n }", "title": "" }, { "docid": "18c731289cf6651687a94fc4aa1be24d", "score": "0.686813", "text": "function log(err) {\n\t\t\tif (_logger) {\n\t\t\t\tif (typeof err == 'string') {\n\t\t\t\t\terr = { message: err, code: 0 };\n\t\t\t\t}\n\t\t\t\t_logger(err);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c312bf31949484befbd9a80e52620619", "score": "0.6851408", "text": "log() { return 'overridden'; }", "title": "" }, { "docid": "fa30559cc9cf5c8d8daada6c884e4814", "score": "0.6821235", "text": "log (format, ...args) {\n this._log('log', format, ...args)\n }", "title": "" }, { "docid": "f79194e13cf59bfbe79cb02b2a4051c9", "score": "0.6816437", "text": "function fbLog() {}", "title": "" }, { "docid": "86e53d7c627cee563bd50e99eed7e205", "score": "0.67940056", "text": "function log () {\n console.log(\"log function\");\n }", "title": "" }, { "docid": "f8ce8dc7769683dd5ff01ba4de0d22ea", "score": "0.6771648", "text": "get log() { return this._log; }", "title": "" }, { "docid": "f13094b1dc2e7b98b78ba0d4e5d4acfb", "score": "0.67264545", "text": "_defineLogMethods() {\n Object.keys(this._logColors).forEach((name) => {\n const fname = name.substr(0, 1).toUpperCase() + name.substr(1);\n this[`_log${fname}`] = (msg) => this._log(msg, this._logColors[name]);\n });\n }", "title": "" }, { "docid": "0153566c8dfc263deb6d6bbb19f7c527", "score": "0.6715548", "text": "Log() {\n var LogMsgs = [];\n var LogColor = '#666666';\n\n //Fake function overloading old school style... :-) \n if (arguments.length == 1) {\n const LogItem = arguments[0];\n if (LogItem.t) {\n\n switch (LogItem.t) {\n case 1:\n LogColor = '#558000';\n LogMsgs.push(LogItem.m);\n break;\n case 2:\n LogColor = '#003cb3';\n LogMsgs.push(LogItem.m);\n break;\n default:\n LogMsgs.push(LogItem.m);\n break;\n }\n\n } else {\n // debugger;\n LogMsgs.push('' + JSON.stringify(LogItem) + '');\n }\n\n } else {\n for (let index = 0; index < arguments.length; index++) {\n const argLog = arguments[index];\n LogMsgs.push('' + argLog + '');\n }\n }\n\n console.info(\"%c%s\",\n \"color: \" + LogColor + \";font-size: 16px;margin-left:5px;\",\n LogMsgs.join('\\r\\n') + \"\\r\\n\");\n }", "title": "" }, { "docid": "013f61204551419cf7609edbb79c6d8d", "score": "0.6715086", "text": "processLog(log,operation) {\n super.processLog(log, operation, this.status, this.yadamuLogger)\n return log\n }", "title": "" }, { "docid": "b8356a975748969906b4f8f3f9001b35", "score": "0.66989785", "text": "function log() {\n consoleLog('log').apply(self, arguments);\n takeAction('log', [].slice.call(arguments));\n }", "title": "" }, { "docid": "9d7b567536ddf15d919b30ae297df516", "score": "0.66948074", "text": "_appendLog(content){\n this.log += content + \"\\n\";\n if(this.onLog) this.onLog(this.log);\n }", "title": "" }, { "docid": "db1acc9a2589ffbadd71a353bdab27da", "score": "0.66643876", "text": "_log(logger, message, ...rest) {\n logger(message, ...rest);\n if (logger.enabled) {\n const formatted = `${new Date()} [${this.namespace}] ${util_1.format(message, ...rest)}`;\n for (const stream of Logger._writeStreams)\n stream.write(formatted);\n }\n }", "title": "" }, { "docid": "0de6a97d9dd4076b563e529253265853", "score": "0.66428804", "text": "function log() {\n createLog(argumentsToArray(arguments), \"LOG\")\n}", "title": "" }, { "docid": "0aefa9381078b7c0aaabed3e8ee99d1b", "score": "0.66338795", "text": "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n }", "title": "" }, { "docid": "0aefa9381078b7c0aaabed3e8ee99d1b", "score": "0.66338795", "text": "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n }", "title": "" }, { "docid": "9bec7690010ae42e55ec53e01857438c", "score": "0.6631954", "text": "static set log(val) {\n log = val;\n }", "title": "" }, { "docid": "36ef6136d0ccbcc12c596a91cef6453d", "score": "0.6626548", "text": "function log(err){\n\t\tif(_logger){\n\t\t\tif(typeof(err) == 'string'){\n\t\t\t\terr = {message:err , code:0}\n\t\t\t}\n\t\t\t_logger(err);\n\t\t}\n\t}", "title": "" }, { "docid": "2bbb9a4927723a5acc28f274f836bd30", "score": "0.6603694", "text": "log(log) {\n\t\t//Bail if debug or log is not set.\n\t\tif (\n\t\t\tenvira_gallery.debug == undefined ||\n\t\t\t!envira_gallery.debug ||\n\t\t\tlog == undefined\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(log);\n\t}", "title": "" }, { "docid": "ee2d4f44d21582eb4fca314cafe38b0d", "score": "0.6589707", "text": "function log() {\n roco.log.apply(this, [].slice.call(arguments));\n}", "title": "" }, { "docid": "4c88cb631cde89d7bd75eb9d880d6309", "score": "0.6580048", "text": "_log() {\n if (!this._settings.debug) {\n return;\n }\n let args = Array.prototype.slice.call(arguments);\n args.unshift(\"LocationManager\");\n console.log.apply(console, args);\n }", "title": "" }, { "docid": "22e6b4f321594b2eeec68280dba7cc41", "score": "0.65754676", "text": "configureLog() {\n this.log = {};\n\n this.log.info = (msg, obj) => {\n const _obj = this.addScopeToLog(obj);\n this.logger.info(this.module, msg, _obj);\n };\n\n this.log.warn = (msg, obj) => {\n const _obj = this.addScopeToLog(obj);\n this.logger.info(this.module, msg, _obj);\n };\n\n this.log.debug = (msg, obj) => {\n const _obj = this.addScopeToLog(obj);\n this.logger.debug(this.module, msg, _obj);\n };\n\n this.log.trace = (msg, obj) => {\n const _obj = this.addScopeToLog(obj);\n this.logger.trace(this.module, msg, _obj);\n };\n\n this.log.error = (msg, obj) => {\n const _obj = this.addScopeToLog(obj);\n this.logger.error(this.module, msg, _obj);\n };\n\n this.log.fatal = (msg, obj) => {\n const _obj = this.addScopeToLog(obj);\n this.logger.fatal(this.module, msg, _obj);\n };\n }", "title": "" }, { "docid": "4296ccdbf7d3d7cd69d48f4802205377", "score": "0.6559815", "text": "function log() {\n\t\twrite(util.format.apply(this, Array.prototype.slice.call(arguments)) + '\\n')\n\t}", "title": "" }, { "docid": "39623872f381bfd02b09cfb46225f627", "score": "0.6533269", "text": "_log() {\n if (this.debug) {\n console.log.apply(console, ['[ Glu.js Api Helper ] [' + this.constructor.name + ']'].concat(arguments));\n }\n }", "title": "" }, { "docid": "555266f38a50fc2844ab050a2659c4de", "score": "0.65293956", "text": "function setupLog_() {\n logArray_ = [];\n}", "title": "" }, { "docid": "555266f38a50fc2844ab050a2659c4de", "score": "0.65293956", "text": "function setupLog_() {\n logArray_ = [];\n}", "title": "" }, { "docid": "555266f38a50fc2844ab050a2659c4de", "score": "0.65293956", "text": "function setupLog_() {\n logArray_ = [];\n}", "title": "" }, { "docid": "888c7ef127a5c7556ad391e3701ed760", "score": "0.65091085", "text": "onLogFile() {\r\n this.vbLog.logFile(this.config)\r\n }", "title": "" }, { "docid": "4f8fa24a4425452be0f453f16425aa09", "score": "0.6504302", "text": "log(...args) {\n if (!devMode) return;\n\n this.emit('log', args);\n }", "title": "" }, { "docid": "4d8581398009c74d3e02c2b3b882955f", "score": "0.6504044", "text": "_writeLog () {\n if (_logToConsole.get(this))\n console.log(...arguments);\n }", "title": "" }, { "docid": "ed784141244ca53848ae94088470701d", "score": "0.64992243", "text": "function Logger(){}", "title": "" }, { "docid": "885eaf259681735870afb929b7077a50", "score": "0.64895004", "text": "function log() {\n\t console.log('%s - %s', timestamp(), format.apply(null, arguments));\n\t}", "title": "" }, { "docid": "c7702b273a2b7e2b135e169799efb492", "score": "0.64586633", "text": "function logger(){\n\tconsole.log(\"==============================\");\n}", "title": "" }, { "docid": "dbea60bba556b982ae42c07c3afd1444", "score": "0.6429474", "text": "function log(message) { console.log(message); }", "title": "" }, { "docid": "69dd8916e2323306c2813645423729c1", "score": "0.64263123", "text": "log(...data) {\n this.add(\"log\", \"log\", [], ...data);\n }", "title": "" }, { "docid": "2eb7b7802f3f23c8ba854eb0b5896ff4", "score": "0.6419139", "text": "log(...entries) {\n this._log({mode: Mode.LOG, onPrint: this.onLog}, entries);\n }", "title": "" }, { "docid": "1c71307f6a5096215e1074d92e4bdce1", "score": "0.64177775", "text": "constructor() {\n this.initLog();\n }", "title": "" }, { "docid": "fe53c7904dcddd125e0dda3cf75c7baf", "score": "0.6412596", "text": "static log() {\n\t\tif (this.debugLevel && this.debugLevel != 0 && console && typeof console.log == \"function\") {\n\t\t\tconsole.log.apply(console, arguments);\n\t\t}\n\t}", "title": "" }, { "docid": "2ea55d6428d6db5417d475c43b6f8377", "score": "0.6411252", "text": "function dLog() {\n if (debugLogging) {\n pLog.apply(this, arguments);\n }\n}", "title": "" }, { "docid": "8b336a95eea6dbf5b2e1eb267e2de5d8", "score": "0.6410165", "text": "function log(){\r\n if (typeof(console) != 'undefined' && typeof(console.log) == 'function'){ \r\n Array.prototype.unshift.call(arguments, '[Ajax Upload]');\r\n console.log( Array.prototype.join.call(arguments, ' '));\r\n }\r\n }", "title": "" }, { "docid": "d1efbef506d05d7ecc5865800ba37cc8", "score": "0.6401516", "text": "function log()\n{\n\tif (typeof (console) != \"undefined\")\n\t\tconsole.log.apply(this, arguments);\n\telse if (typeof (opera) != \"undefined\")\n\t\topera.postError(arguments);\n}", "title": "" }, { "docid": "def0921c50be5f0d2e0a70a3f2ba6cc5", "score": "0.63968825", "text": "logHandler(msg) {\n var newLog = {\n id: this.keyGen(),\n message: msg,\n };\n this.logger.unshift(newLog);\n }", "title": "" }, { "docid": "bfeb455a9017ac92bbc2322cadb85447", "score": "0.63936096", "text": "function log() {\n console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n }", "title": "" }, { "docid": "24d4f9021aa61f5ba30c13d023d0f7c7", "score": "0.63931835", "text": "function logger (log, arg) {\n if (opMode == 'DEVELOPMENT')\n console.log(log, arg);\n}", "title": "" }, { "docid": "d8ab048250f3ad3912534d8a470d2759", "score": "0.6387158", "text": "_overrideConsoleLog() {\n if (this.logger !== console) {\n console.log = this.logger.info.bind(this.logger);\n console.info = this.logger.info.bind(this.logger);\n console.error = this.logger.error.bind(this.logger);\n console.warn = this.logger.warn.bind(this.logger);\n }\n }", "title": "" }, { "docid": "d7ae89beca8cca303c456e0d90e9cd59", "score": "0.63809675", "text": "function log(){return stream.write(util.format.apply(util,arguments)+'\\n');}", "title": "" }, { "docid": "d7ae89beca8cca303c456e0d90e9cd59", "score": "0.63809675", "text": "function log(){return stream.write(util.format.apply(util,arguments)+'\\n');}", "title": "" }, { "docid": "b5d6d740ede6d8b0095e88c29984bd83", "score": "0.63585556", "text": "function Logger() {}", "title": "" }, { "docid": "0d0f7943ecbdb7c697f4fcce5712949d", "score": "0.63503003", "text": "function log(text) \n{\n if(!LOGGING)return;\n console.log(\"DDL@ebook-dl: \"+text); \n}", "title": "" }, { "docid": "3c7e1ab7c098c1afe415c879eadfce61", "score": "0.6342088", "text": "function infoLog () {\r\n\t\r\n}", "title": "" }, { "docid": "83b2593bf2d464f99b698c0703accce9", "score": "0.63290346", "text": "_initializeLogging() {\n const loggingConf = this._config.logging;\n\n Cameleer._checkAgainstSchema(loggingConf, CameleerLoggingConfigSchema);\n\n this._inMemoryLogger = new InMemoryLogger(\n Cameleer, loggingConf.numInMemory <= 0 ? 1 : loggingConf.numInMemory);\n\n this._inMemoryLogger.logLevel = loggingConf.level;\n this._inMemoryLogger.logCurrentDate = false;\n this._inMemoryLogger.logCurrentTime = true;\n this._inMemoryLogger.logCurrentType = true;\n this._inMemoryLogger.logCurrentScope = true;\n\n this._loggerType = supportedLoggingMethods.get(loggingConf.method);\n\n this.logger = this.getLogger(Cameleer);\n this.logger.logInfo(`Initialized a new Cameleer instance at ${this.startTime.toLocaleString()}`);\n this.logger.logTrace(JSON.stringify(this._config, null, \"\\t\"));\n }", "title": "" }, { "docid": "a98e055630b4c2533843640060775b22", "score": "0.63266253", "text": "function log(s) { console.log(s); }", "title": "" }, { "docid": "9ee1e99bc2b0800dae9a2caa1281357c", "score": "0.63252157", "text": "log(message) {\n // Raise an event\n this.emit('logging', message);\n }", "title": "" }, { "docid": "0108bdd6f69283f657b6d0d6ea6957cc", "score": "0.63244814", "text": "function logged(err, result) {\n self.emit('logged');\n if (err) {\n console.error('Loggly Error:', err);\n }\n callback && callback(err, result);\n }", "title": "" }, { "docid": "1270003f673c5d9acdd4c4f693bd8cd4", "score": "0.63226247", "text": "function logger(data) {\n \tif (logging == true ) {\n \t\tconsole.log(\"http.js: \" + data)\n \t}\n }", "title": "" }, { "docid": "c577188f488930196b21be586c27bb53", "score": "0.63142407", "text": "log() {\n // eslint-disable-next-line prefer-rest-params\n Array.prototype.unshift.call(arguments, `[${this.name}]`);\n // eslint-disable-next-line no-console, prefer-rest-params\n console.log.apply(console, arguments);\n }", "title": "" }, { "docid": "a119c4241ffa7d1299bfe0953e44d24e", "score": "0.6310223", "text": "function bkc_logging(str){\n\n // I am using a queue to send logs into the blockchain and sending one log at a time\n logQueue.unshift(encrypt(str));\n if (!loggerRunning) {\n logEvent();\n }\n }", "title": "" }, { "docid": "940aca5acc63b9031befa2f7f5b18bbb", "score": "0.63016456", "text": "function logger() {\n if (hasGulplog()) {\n // specifically deferring loading here to keep from registering it globally\n const gulplog = require('gulplog');\n gulplog.info.apply(gulplog, arguments);\n } else {\n // specifically deferring loading because it might not be used\n const fancylog = require('fancy-log');\n fancylog.apply(null, arguments);\n }\n}", "title": "" }, { "docid": "22daedb92adc3cfb96417d18e06d1f24", "score": "0.62989163", "text": "function transportLog(name,next){var transport=self.transports[name];transport.log(level,msg,meta,function(err){if(err){err.transport=transport;finish(err);return next();}self.emit('logging',transport,level,msg,meta);next();});}", "title": "" }, { "docid": "d5f0af95b4f2d06a7456768ffb35efb3", "score": "0.6291629", "text": "log(message, data) {\n if (this.debug) {\n if (message && !data) {\n this._log(message)\n } else {\n this._log(message, data)\n }\n }\n }", "title": "" }, { "docid": "8b5e4d434fc3a7ddf8cebf83727a3b38", "score": "0.62883264", "text": "function startLogging(){\r\n\tu_updateEvent = true;\r\n}", "title": "" }, { "docid": "95ab643a9ccbbfc98518e638ac50e7d3", "score": "0.6255309", "text": "function log(){window.console.log.apply(window.console,arguments)}", "title": "" }, { "docid": "7f325a3da7bf852d5124e9b96d790a10", "score": "0.62512946", "text": "function fbLog(name, value) {}", "title": "" }, { "docid": "692cc46eec61c0e3bc023524a0d5ae3e", "score": "0.62496114", "text": "function log(){\n log.history = log.history || [];\n log.history.push(arguments);\n if(this.console){\n console.log( Array.prototype.slice.call(arguments)[0] );\n }\n}", "title": "" }, { "docid": "522c1d7df7cb98c119fed1048c08abd2", "score": "0.62475854", "text": "_log(severity,message) {\n if (this._logFunction) {\n this._logFunction(severity,(this.__proto__.constructor.name + '[' + this._id + ']'),message);\n\n } else {\n console.log(severity.toUpperCase() + \" \" + (this.__proto__.constructor.name + '[' + this._id + ']') + \" \" + message);\n }\n }", "title": "" }, { "docid": "a074c70312d3fac3ebba32a0ecfecc48", "score": "0.6239952", "text": "function LLog(origin_name) {\n var level_name = {\n 0: \"trace\",\n 1: \"debug\",\n 2: \"info\",\n 3: \"warning\",\n 4: \"error\",\n 5: \"fatal\"\n },\n\t\torigin = origin_name ? origin_name + \": \" + \"\" : \"\";\n\t\t\n this.log = function() {\n var args = [];\n var a;\n for(var i = 0; i < arguments.length; i++) {\n a = arguments[i];\n if (is(\"Array\", a) && a.length > 5) {\n a = {array: a}; \n }\n args.push(a);\n };\n console.log.apply(console, args);\n };\n \n var log = this.log;\n \n function logWithStatus(status) {\n var name = level_name[status] + \": \"\n return function() {\n log.apply(log, [name].concat(Array.prototype.slice.call(arguments)));\n }\n \n \n }\n \n this.log.trace = logWithStatus(0);\n this.log.debug = logWithStatus(1);\n this.log.info = logWithStatus(2);\n this.log.warning = logWithStatus(3);\n this.log.error = logWithStatus(4);\n this.log.fatal = logWithStatus(5);\n\n return this.log;\n}", "title": "" }, { "docid": "f730ebbfe77c6b2ece5cfbd5760c6e64", "score": "0.6235501", "text": "function logWrapper($log, debug) {\n\n this.log = function (funcName, msg) { if (debug) { $log.log(getMessage(funcName, msg)); } };\n this.info = function (funcName, msg) { $log.info(getMessage(funcName, msg)); };\n this.warn = function (funcName, msg) { $log.warn(getMessage(funcName, msg)); };\n this.error = function (funcName, msg) { $log.error(getMessage(funcName, msg)); };\n\n function getMessage(funcName, msg) {\n return getTimeString() + ' [' + funcName + '] ' + msg;\n }\n\n function getTimeString() {\n var d = new Date();\n var seconds = d.getSeconds();\n var secondString = seconds < 10 ? '0' + seconds : seconds.toString();\n var minutes = d.getMinutes();\n var minuteString = minutes < 10 ? '0' + minutes : minutes.toString();\n var hours = d.getHours();\n var hourString = hours < 10 ? '0' + hours : hours.toString();\n var ms = d.getMilliseconds();\n var msString;\n if (ms < 10) {\n msString = '00' + ms;\n }\n else if (ms < 100) {\n msString = '0' + ms;\n }\n else {\n msString = ms;\n }\n return hourString + ':' + minuteString + ':' + secondString + '.' + msString;\n }\n }", "title": "" }, { "docid": "14d41195c2da2196b5e925e3a39b748d", "score": "0.6234401", "text": "function log(log) {\n return console.log(log);\n}", "title": "" }, { "docid": "63ab8dffe391642b1e16c400e23590da", "score": "0.6233076", "text": "set log(message) {\n const formatted = log_infos.add_debug_infos(message);\n console.log(formatted);\n this.logs.i(formatted); //Writte to file\n }", "title": "" }, { "docid": "a2cfee67dad1e134220b33ae38ee65f5", "score": "0.62314177", "text": "log(msg) {\r\n switch (msg.event_type)\r\n {\r\n default:\r\n console.log(msg);\r\n }\r\n return;\r\n }", "title": "" }, { "docid": "69d0b94c803ff94e7da5ddf0edb9f843", "score": "0.6222611", "text": "function onModuleLoaded(logger){\n $.config.logging.logger = logger;\n }", "title": "" }, { "docid": "c6b9dee95e7b115de405f8b684a9044e", "score": "0.62126523", "text": "logHandler(message) {\n this.informAllSockets(\"log\", message);\n }", "title": "" }, { "docid": "cc0086f2515165f6a6bd5a66dd9235da", "score": "0.6206156", "text": "function _log( msg) {\r\n if(typeof GM_log == 'function') {\r\n GM_log(msg);\r\n } else {\r\n console.log( msg );\r\n }\r\n}", "title": "" }, { "docid": "16b50bee0ed8e0400e72f8a5f7365e63", "score": "0.62033486", "text": "function Log() {\n\tthis.on \t\t\t\t= true;\n\tthis.log \t\t\t\t= log;\n\tfunction log(thingToLog, message) {\n\t\tif(this.on) {\n\t\t\t//check if debugging on a windows machine\n\t\t\tif ( ! window.console ) {\n\t\t\t\tconsole = { \n\t\t\t\t\tlog: function(){}\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t\tif(message != null)\n\t\t\t\tconsole.log(message);\n\t\t\telse\n\t\t\t\tconsole.log(\"Logging something:\");\n\n\t\t\tconsole.log(thingToLog);\n\t\t}\n\t}\n\n\tthis.on\t\t\t= on;\n\tfunction on() {\n\t\tthis.on = true;\n\t}\n\n\tthis.off\t\t= off;\n\tfunction off() {\n\t\tthis.on = false;\n\t}\n}", "title": "" }, { "docid": "238aa8d0d3f73a529f8c18a61d1bde87", "score": "0.6199891", "text": "log(params) {\n if (this.socket.hasLogger && this.socket.hasLogger()) {\n this.socket.log(params.kind, params.msg, params.data)\n }\n }", "title": "" }, { "docid": "558e360b9f46b9871907578f30c8f657", "score": "0.61983114", "text": "function log() {\n if (!$.fn.ajaxSubmit.debug)\n return;\n var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');\n if (window.console && window.console.log) {\n window.console.log(msg);\n }\n else if (window.opera && window.opera.postError) {\n window.opera.postError(msg);\n }\n }", "title": "" }, { "docid": "fa399ca2510dd460201f46f2dbdf5f6c", "score": "0.61948955", "text": "function log () {\n if (typeof console !== 'undefined') {\n console.log.apply(console, arguments);\n }\n }", "title": "" }, { "docid": "fa399ca2510dd460201f46f2dbdf5f6c", "score": "0.61948955", "text": "function log () {\n if (typeof console !== 'undefined') {\n console.log.apply(console, arguments);\n }\n }", "title": "" }, { "docid": "fa399ca2510dd460201f46f2dbdf5f6c", "score": "0.61948955", "text": "function log () {\n if (typeof console !== 'undefined') {\n console.log.apply(console, arguments);\n }\n }", "title": "" }, { "docid": "dd99eec454eb0635bd679f299d46238c", "score": "0.6186821", "text": "function Log() {\n Component.call(this, \"log\", {\n record: true,\n uploadInterval: 60,\n logRotation: 5,\n encrypt: false\n });\n this._logPrefix = \"mam_log_\";\n this._q = async.queue(this.onRecord.bind(this), 1);\n this.pollTimer = null;\n this.initPoll();\n var self = this;\n this.on(\"change_config\", function() {\n self.initPoll();\n });\n this.rotateLog(function() {});\n}", "title": "" }, { "docid": "19e8bee01a699750a2bd1775c0f833e2", "score": "0.6182715", "text": "function logEvent(self) {\n if (self.event) { log(self.event); }\n log(\"User: \" + getUserId(self));\n log(\"Device: \" + getDeviceId(self));\n}", "title": "" }, { "docid": "f76cacae556e1b439df493d26afc1983", "score": "0.61665666", "text": "function _log(msg) {\n\t console.log(msg);\n\t return log$1(msg);\n\t}", "title": "" }, { "docid": "57f670db6fed4a489b22ba7b5f418503", "score": "0.6164818", "text": "function logLib() {\n\n const levels = ['error', 'warn', 'info', 'verbose', 'debug', 'silly'];\n const loggingPattern = \"{{written_at}} | {{level}} | {{msg}} {{data}}\";\n\n /* Setups the logging severity priority. Being \"error\" the highest and \"silly\" the lowest.\n * The priority of the logs displayed is related to the index of the array. If set to lowest\n * all higher priority will also display.\n */\n function setLoggingLevel(level) {\n\n let loggingLevel = level;\n let msgLevel = levels[2];\n let description = `Logging level successfully setup to: ${loggingLevel}`;\n\n log.setLogPattern(loggingPattern);\n\n if (!levels.includes(loggingLevel)) {\n loggingLevel = levels[2];\n msgLevel = levels[1];\n description = `Unsupported logging level. Falling back to level: ${loggingLevel}`;\n }\n\n log.setLoggingLevel(loggingLevel);\n log.logMessage(msgLevel, description);\n }\n\n function logError(description, data, correlationId) {\n logMessage(levels[0], arguments.length, description, data, correlationId);\n }\n\n function logWarn(description, data, correlationId) {\n logMessage(levels[1], arguments.length, description, data, correlationId);\n }\n\n function logInfo(description, data, correlationId) {\n logMessage(levels[2], arguments.length, description, data, correlationId);\n }\n\n function logMessage(level, length, description, data, correlationId) {\n switch (length) {\n case 1:\n log.logMessage(level, description);\n break;\n case 2:\n log.logMessage(level, description, data);\n break;\n case 3:\n log.logMessage(level, `${description} | Correlation id: ${correlationId}`, data);\n break;\n default:\n log.info();\n }\n }\n\n function logger(req, res, callback) {\n logInfo(`Received ${req.method} request on url:${req.url}`, {'correlation_id': req.correlationId()});\n callback();\n }\n\n return {logger, setLoggingLevel, logError, logWarn, logInfo};\n}", "title": "" }, { "docid": "fdb05190e7b35c40d86e079e3f01fc55", "score": "0.61641717", "text": "function LoggerImpl() {\n\n function pad(width, string, padding) {\n return (width <= string.length) ? string : pad(width, string + padding, padding)\n }\n\n function prefix(level, log) {\n try {\n throw new Error(arguments);\n } catch (e) {\n var stack = e.stack.split('\\n');\n if (stack.length > 3) {\n var callSiteSplit = stack[4].trim().split('/');\n if (callSiteSplit.length > 0) {\n var callSite = callSiteSplit[callSiteSplit.length - 1];\n if (callSite[callSite.length - 1] === ')') {\n callSite = callSite.substring(0, callSite.length - 1);\n }\n log = pad(6, level, \" \") + \" \" + pad(30, callSite, \" \") + \" \" + log;\n }\n }\n }\n return log;\n }\n\n this.log = function (log) {\n console.log(prefix('LOG', log));\n };\n this.debug = function (log) {\n console.debug(prefix('DEBUG', log));\n };\n this.error = function (log) {\n console.error(prefix('ERROR', log));\n };\n this.info = function (log) {\n console.info(prefix('INFO', log));\n };\n }", "title": "" }, { "docid": "3233548f4b00cb97634d1c0d52d3b5a5", "score": "0.61574614", "text": "function wraplog(msg) {\n console.log('['+ request.connection.remoteAddress +'] '+ msg);\n }", "title": "" }, { "docid": "1c350482c94f329d37c9de993dd9d111", "score": "0.61552787", "text": "log(level, correlationId, error, message, ...args) { }", "title": "" }, { "docid": "ed133a393be68cd348150941f5f5e6d1", "score": "0.6149024", "text": "async log(){\r\n\r\n\t\treturn;\r\n\r\n\t let name = '';\r\n\r\n\t let curLog = this.logs;\r\n\r\n\t let newLog = {};\r\n\r\n\t let hashLog = {};\r\n\r\n\t let time = (new Date().getTime());\r\n\r\n\t let time2 = (new Date().getTime());\r\n\r\n\t let timeHash = this.count + time;\r\n\r\n\t timeHash = utils.hashFnv32a(timeHash.toString());\r\n\r\n\t if (typeof arguments[2] != 'undefined')\r\n\t {\r\n\r\n\t name = arguments[2];\r\n\r\n\t if (name=='compile')\r\n\t newLog = curLog[name] || new _Compile(name);\r\n\t //else\r\n\t //if (name=='build')\r\n\t // newLog = curLog[name] || new _Build(name);\r\n\t else\r\n\t if (name=='loop')\r\n\t newLog = curLog[name] || new _Loop(name);\r\n\t else\r\n\t if (name=='state')\r\n\t newLog = curLog[name] || new App(name);\r\n\t else\r\n\t newLog = curLog[name] || new _Log(name);\r\n\r\n\t hashLog = newLog[ this.count + \" \" +arguments[0]] || new _Log(name);\r\n\r\n\t hashLog = arguments[1];\r\n\r\n\t newLog[arguments[0]] = hashLog;\r\n\r\n\t curLog[name] = newLog;\r\n\r\n\t }\r\n\t else {\r\n\r\n\t name = arguments[0];\r\n\r\n\t if (name=='compile')\r\n\t newLog = curLog[name] || new _Compile(name);\r\n\t //else\r\n\t //if (name=='build')\r\n\t // newLog = curLog[name] || new _Build(name);\r\n\t else\r\n\t if (name=='loop')\r\n\t newLog = curLog[name] || new _Loop(name);\r\n\t else\r\n\t if (name=='state')\r\n\t newLog = curLog[name] || new App(name);\r\n\t else\r\n\t newLog = curLog[name] || new _Log(name);\r\n\r\n\t hashLog = newLog[ this.count + \" \" +arguments[0]] || new _Log(name);\r\n\r\n\t hashLog = arguments[1];\r\n\r\n\t newLog[arguments[0]] = hashLog;\r\n\r\n\t curLog[name] = newLog;\r\n\r\n\t }\r\n\r\n\t this.count++;\r\n\r\n\t this.logs = curLog;\r\n\r\n\t}", "title": "" }, { "docid": "d30a009e72a972f1d77dcffeeb30d7d1", "score": "0.6147114", "text": "function our_log(...arguments) {\n console.log(...arguments)\n}", "title": "" }, { "docid": "549989cb07005ab134846aff0563c85e", "score": "0.61460245", "text": "function LogWrapper($log, debug) {\n this.log = function (funcName, msg) {\n if (debug) { $log.log(getMessage(funcName, msg)); }\n };\n this.info = function (funcName, msg) {\n $log.info(getMessage(funcName, msg));\n };\n this.warn = function (funcName, msg) {\n $log.warn(getMessage(funcName, msg));\n };\n this.error = function (funcName, msg) {\n $log.error(getMessage(funcName, msg));\n };\n\n function getMessage(funcName, msg) {\n return getTimeString() + ' [' + funcName + '] ' + msg;\n }\n\n function getTimeString() {\n var d = new Date();\n var seconds = d.getSeconds();\n var secondString = seconds < 10 ? '0' + seconds : seconds.toString();\n var minutes = d.getMinutes();\n var minuteString = minutes < 10 ? '0' + minutes : minutes.toString();\n var hours = d.getHours();\n var hourString = hours < 10 ? '0' + hours : hours.toString();\n var ms = d.getMilliseconds();\n var msString;\n if (ms < 10) {\n msString = '00' + ms;\n }\n else if (ms < 100) {\n msString = '0' + ms;\n }\n else {\n msString = ms;\n }\n return hourString + ':' + minuteString + ':' + secondString + '.' + msString;\n }\n }", "title": "" }, { "docid": "83a63b8230c828a98815971d2fa52c1a", "score": "0.6144128", "text": "function log(){\n debug && console && console.log && console.log.apply(console, Array.prototype.slice.call(arguments));\n }", "title": "" }, { "docid": "de38d4f84687d8ca28bc320965d71b7f", "score": "0.6141641", "text": "function log() {\n\t if (!$.fn.sjpbEditor.debug) {\n\t return;\n\t }\n\t var msg = '[jquery.sjpbEditor] ' + Array.prototype.join.call(arguments,'');\n\t if (window.console && window.console.log) {\n\t window.console.log(msg);\n\t }\n\t else if (window.opera && window.opera.postError) {\n\t window.opera.postError(msg);\n\t }\n\t}", "title": "" }, { "docid": "dbdf531a90bdc64242d93051717102e1", "score": "0.61414874", "text": "log(message) {\n console.log(message);\n }", "title": "" }, { "docid": "60fd9952a4b9ae4cfb8343e3416810e7", "score": "0.61398435", "text": "function log() {\n if (!$.fn.ajaxSubmit.debug) {\n return;\n }\n var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');\n if (window.console && window.console.log) {\n window.console.log(msg);\n }\n else if (window.opera && window.opera.postError) {\n window.opera.postError(msg);\n }\n }", "title": "" }, { "docid": "920a4de6f3652b5c6df25d3ce11efe1a", "score": "0.6132507", "text": "function NodeLogger() {}", "title": "" } ]
94b4b4b4b34ec78d2fe63e8d76a4cce6
function for check actual token
[ { "docid": "b0303e4e10c62f3addc691a5e65de293", "score": "0.66802174", "text": "function checkToken(){\n return localStorage.getItem('TOKEN')\n}", "title": "" } ]
[ { "docid": "7aa4e3a83a8dfe93eee272c9f347a5ce", "score": "0.7417651", "text": "function verify_token(req, res) {}", "title": "" }, { "docid": "94e7bb9e35cb205fb63781fc5a44caed", "score": "0.74175346", "text": "function hasToken() {\n return !!token();\n}", "title": "" }, { "docid": "6763f572aa5fecb9c4e758a70fe2f808", "score": "0.7413026", "text": "function validate_token(T){\n\tif (T === Token()){\n\t\tInc_pointer();\n\t} else {\n\t\tError();\n\t}\n}", "title": "" }, { "docid": "6c2ab3b58d61b4a167a989d117d067d1", "score": "0.73516566", "text": "check(callback) {\n callback(error, tokenIfOK());\n }", "title": "" }, { "docid": "40d5780b103ac2b0c16918b61f72e945", "score": "0.72100246", "text": "isvalidToken(token) {\n const realtoken = this.realtoken(token);\n if (realtoken) {\n if (\n (realtoken.iss =\n \"http://127.0.0.1:8000/api/auth/login\" ||\n \"http://127.0.0.1:8000/api/auth/register\")\n ) {\n return true;\n } else {\n return false;\n }\n }\n }", "title": "" }, { "docid": "060970f62a4d736d5386fe11d8113c06", "score": "0.7194179", "text": "function isToken(n){return n.kind>=0/* FirstToken */&&n.kind<=152/* LastToken */;}", "title": "" }, { "docid": "3c4ace945310b502f3dcf8ed2af4901e", "score": "0.71281993", "text": "function isToken(req,res,next){\n\t// Token is passed in the authorizartion tag.\n\tconst token =req.headers['authorization'];\n\tif(typeof token =='undefined'){\n\t\tres.send('Trying to be smart buddy.. ');\n\t}\n\telse{\n\t\ttokenvalue=token.split(' ');\n\t\treq.token=tokenvalue[1];\n\t\tnext();\n\t}\n}", "title": "" }, { "docid": "0db41c1f1f4b87d7e7b97fc4a4747b33", "score": "0.7089799", "text": "function validateToken(token) {\n console.log('validate token func');\n jsonwebtoken.verify(token, PRIV_KEY, (err, decoded) => {\n if (err) {\n ``;\n console.log(err, 'we had an error in validate token');\n } else {\n console.log(decoded, 'decoded token');\n }\n });\n}", "title": "" }, { "docid": "eebbe8ed01e93d56fd7fe2f4c6520944", "score": "0.7015998", "text": "hasToken() {\n const storeToken = this.getToken();\n if (storeToken) {\n return this.isValid(storeToken) ? true : false\n }\n return false\n }", "title": "" }, { "docid": "20980e74f7f8d0a6a23ae88ccbd6cb60", "score": "0.69924045", "text": "verificationToken(token) {\n if (!token) {\n return {\n status: false,\n message: \"Missing Token Value\",\n };\n }\n return uploadToken.functions.validateToken(token, true);\n }", "title": "" }, { "docid": "df485cef7317d20ac1bdc7f5e0bb8d65", "score": "0.6991452", "text": "function checkIsHttpToken(val) {\n return tokenRegExp.test(val);\n}", "title": "" }, { "docid": "880940d2cfc8fb4d4366ed0985516dc7", "score": "0.69810677", "text": "static validate(token) {\n // For now anything that doesn't have at least\n // one word character is no good\n return /\\w+/.test(token);\n }", "title": "" }, { "docid": "3ace2040a1a297957fc93ed872d6b541", "score": "0.6958663", "text": "static verifyToken(whichToken = 'token') {\n const token = this.getToken(whichToken)\n let verified = false\n\n if (token) {\n try {\n verified = jwt.verify(token, Config.jwt.secret)\n return verified\n } catch (err) {\n return false\n }\n }\n else { return false }\n }", "title": "" }, { "docid": "96148c99d110ff00ad994e74a1f7058b", "score": "0.69542927", "text": "function checkToken(args, socket, endpoint, cb) {\n\tvar token = args.token;\n\tif(token) {\n\t\tjwt.verify(token, config.secret, function(err, decoded) {\n\t\t\tif(err) {\n\t\t\t\tsocket.emit(endpoint, {status:false, msg:\"The supplied token is either invalid or expired. Please sign-in again.\"});\n\t\t\t} else {\n\t\t\t\tcb(decoded);\n\t\t\t}\n\t\t\t\n\t\t});\n\t} else {\n\t\tsocket.emit(endpoint, {status:false, msg:\"The supplied token is either invalid or expired. Please sign-in again.\"});\n\t}\t\n}", "title": "" }, { "docid": "570d4f3c807a4d05de85c12c86b70df5", "score": "0.69327", "text": "tokenIsValid(token) { \n try {\n jwt.verify(token, jwtSecret);\n return true\n } catch (error) {\n tokenList = tokenList.filter(item => item !== token);\n return false\n }\n }", "title": "" }, { "docid": "877d336a310ffd81d37a74bb64f40f84", "score": "0.68689966", "text": "function validateToken(request, reply) {\n\t//console.log(request.auth.token);\n\t//console.log(request.auth.credentials.email);\n\t// metadatafile.saveMetadata(request.payload.metadata);\n\tsendSuccessResponse(request, reply, 'Token is valid', 1);\n}", "title": "" }, { "docid": "da6514c4e3a46cf95d412b6d0a536a6c", "score": "0.68608385", "text": "hasToken(){\n return this.tokens > 0;\n }", "title": "" }, { "docid": "7242fba5379b8e2e48f301d93aef8824", "score": "0.6852586", "text": "get TOKEN_REQUIRED() {\n return 499;\n }", "title": "" }, { "docid": "a6ceadc0f5095663b6d65aed87ec2471", "score": "0.6837492", "text": "function chkToken() {\n return (req, res, next) => {\n const token = req.headers.authorization;\n //TOKEN\n token &&\n jwt.verify(token, secret, async (err, decoded) => {\n if (err) {\n //Needs Time Validation\n res\n .status(200)\n .json({\n errors: { token: \"Invalid Token, you will need to Log back in\" }\n });\n } else {\n console.log(\"REW\",decoded)\n req.user = decoded;\n next();\n }\n });\n //No Token, No Pass\n !token &&\n res\n .status(401)\n .json({ error: \"No Token Provided, you will need to Login\" });\n };\n}", "title": "" }, { "docid": "4a049fa00590183208e23e3483cd5617", "score": "0.6836916", "text": "haveToken() {\n return this._tokenIdx < this._tokens.length;\n }", "title": "" }, { "docid": "71eba8c78a4831d9a5372b7c0f47c388", "score": "0.67272836", "text": "*ensureTokenAuthentic(type, token) {\n if(type === 0)\n return {err: false, msg: jwt.decode(token)};\n let bundle = yield jwt.verify(token, require('./../../config/auth.json').token);\n return checkRules(bundle[0], bundle[1]);\n }", "title": "" }, { "docid": "29fc93319b74846e4746cd2387c2fb97", "score": "0.67217153", "text": "validateToken(token) {\n return (0, _util2.validateToken)(token);\n }", "title": "" }, { "docid": "b36018aee8ba7f7187b3db602cdcc564", "score": "0.6717145", "text": "function checkToken(token) {\n return jwt.verify(token, secret)\n}", "title": "" }, { "docid": "1150364cdbbf2372f01615153c1d8657", "score": "0.6706792", "text": "function validTokenResponse () {\n var args = arguments\n var state = Util.getParam('state') || (args.input && args.input.state)\n return state && sessionStorage[state] && JSON.parse(sessionStorage[state]).tokenResponse !== undefined\n}", "title": "" }, { "docid": "bbfb4fdead00c5f6acf3c983892a9e38", "score": "0.66891783", "text": "function token(){return currentToken;}", "title": "" }, { "docid": "b43a5440b6c2cddff273a0cb50ddbf89", "score": "0.6672186", "text": "hasToken(){\n const storedToken = AppStorage.getToken();\n if(storedToken!=null){\n return Token.isvalid(storedToken) ? true : this.logout();\n }\n return false;\n }", "title": "" }, { "docid": "d9dda9648e588ed23db8ea6a09fb6691", "score": "0.66692257", "text": "verificationToken(p_sToken) {\n if (!p_sToken) return p_sToken;\n\n verification_token = p_sToken;\n }", "title": "" }, { "docid": "4620758efa64a0da32dc7ef4aa6216ef", "score": "0.6647362", "text": "function verifyToken(token, expectedKind, expectedValue, errMsg) {\n if (!token.isMatch(expectedKind, expectedValue)) {\n throw new Error(\n typeof errMsg !== 'undefined'\n ? errMsg\n : buildVerifyTokenErrorMessage(token, [expectedKind], expectedValue)\n );\n }\n return token.value;\n }", "title": "" }, { "docid": "6a3ad38dfd9828bb86d47d7c3082f4f4", "score": "0.6618265", "text": "function validTokenResponse() {\n var args = arguments;\n var state = _util2.default.getParam('state') || args.input && args.input.state;\n return state && sessionStorage[state] && JSON.parse(sessionStorage[state]).tokenResponse;\n}", "title": "" }, { "docid": "93f75c68f062b91d2be503e43a09a7d4", "score": "0.6587254", "text": "function verifyToken(token, succ, nosucc) {\n let conn = createConn();\n let initialQuery = `SELECT * FROM login_tokens\n WHERE token = ?;`;\n let vars = [token];\n\n conn.query(initialQuery, vars, (err, res, fields) => {\n conn.end(); // close the connection\n\n if (err)\n console.log(err);\n\n if (res.length === 1) {\n if (res[0].token) {\n if (res[0].token === token)\n succ();\n return;\n }\n }\n\n nosucc();\n });\n}", "title": "" }, { "docid": "1b7b54e20c9dadc74a370be8a546790b", "score": "0.65667355", "text": "function tokenVerification() {\n function checkToken() {\n setTimeout (function() {\n var expires = JSON.parse(atob(localStorage.token.split('.')[1])).exp;\n if (expires < ((+(new Date())) / 1000)) {\n expiredToken();\n } else {\n checkToken();\n }\n }, 10000);\n }\n\n checkToken();\n}", "title": "" }, { "docid": "c77eda71e840ff91c7afea38503fe4c3", "score": "0.65621215", "text": "function isValidToken(req, res, next) {\n //if token was given, check if valid\n if(req.query.token != null) {\n let validToken = false;\n let tokenID = req.query.token + \".json\"; //to match file names\n\n //check each file for corresponding file name\n fs.readdirSync(sessionFolder).forEach(function(file) {\n if(tokenID == file) {\n validToken = true;\n }\n });\n req.validToken = validToken;\n }\n next();\n}", "title": "" }, { "docid": "3b5ae197a3b0d755b755c6ebd3359874", "score": "0.65608335", "text": "async function validateToken(req, res, next) {\n\tconst token = req.headers.authorization.split(\" \")[1];\n try {\n const verification = jsonWebToken.verify(token, secret4Token); // Verify automaticamente hace el check del exp date.\n req.tokenInfo=verification; //Si puedo verificar el token voy al siguiente path\n next();\n\t\t}\n\t catch (e) {\n\t\tres.status(401).json(\"Unauthorized user\");\n\t}\n}", "title": "" }, { "docid": "1ef1396eccaac40f07a4ec4a432e0b1a", "score": "0.6541025", "text": "function validateToken(token, callback){\n console.log(\"token is: \" + token);\n\trequestify.get('https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=' + token).then(function(response) {\n\t\tconsole.log(\"google response: \",response);\n if(response.getBody().aud == clientID){\n callback(true);\n\t\t}\n\t},function(error){\n callback(false);\n });\n}", "title": "" }, { "docid": "61d575617963e6f1118b8d4afe61b811", "score": "0.6534861", "text": "function checkToken(req, res, next){\n\n\n var token = req.body.token || req.query.token || req.headers['x-access-token'];\n\n // decode the token\n\n if (token) {\n\n jwt.verify(token, config.jwtsecret, function(err, decoded) {\n if(err) {\n handleError(res, err.message, \"Your token is not valid.\", 403);\n } else {\n req.decoded = decoded;\n next();\n }\n });\n } else {\n handleError(res, \"no token provided\", \"You have not provided a token, please add a Bearer Token\", 403)\n }\n\n}", "title": "" }, { "docid": "2a39c1a36efccc58c57d73abdae8ac1a", "score": "0.6528471", "text": "function tokenExists() {\n return (localStorage.getItem('token')) ? true : false\n}", "title": "" }, { "docid": "dc7832de14680f0ad57a1464ae32b658", "score": "0.6527204", "text": "function token_exists() {\n var token = localStorage.getItem('token');\n if(token.length = 0) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "39e239149ddc34e2451980bea58bb097", "score": "0.6509826", "text": "function checkTokenCodeGen(expectedKind)\n {\n \n\t//Check to valiudate that we have the expected type of token\t\n\tswitch(expectedKind)\n\t{\n \n\t\t//For Digits\n\t\tcase \"digit\" : //putMessage(\"Expecting a digit\");\n\t\t\t if(currentToken.Token == \"0\" || currentToken.Token == \"1\" || currentToken.Token == \"2\" || currentToken.Token == \"3\" ||\n\t\t\t currentToken.Token == \"4\" || currentToken.Token == \"5\" || currentToken.Token == \"6\" || currentToken.Token == \"7\" ||\n\t\t\t currentToken.Token == \"8\" || currentToken.Token == \"9\" )\n\t\t\t {\n\t\t\t\t //putMessage(\"Got a digit.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t //putMessage(\"Token is not a digit. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n\t\t//For operations\n\t\tcase \"op\" : //putMessage(\"Expecting an operator\");\n\t\t\t if(currentToken.Token == \"+\" || currentToken.Token == \"-\" )\n\t\t\t {\n\t\t\t\t //putMessage(\"Got an operator.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t //putMessage(\"Token is not an operator. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n\n\n\t\t//For conditional operations\n\t\tcase \"condOp\" : //putMessage(\"Expecting a conditional operator\");\n\t\t\t if((currentToken.Token == \"=\" && peekAtToken(0).Token == \"=\" ) || (currentToken.Token == \"!\" && peekAtToken(0).Token == \"=\" ) )\n\t\t\t {\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t //putMessage(\"Got a conditional operator.\");\n\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t //putMessage(\"Token is not a conditional operator. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n\n\t\t//For characters\t\n\t\tcase \"char\" : //putMessage(\"Expecting a character\");\n\t\t\t if(currentToken.Token == \"a\" || currentToken.Token == \"b\" || currentToken.Token == \"c\" || currentToken.Token == \"d\" ||\n\t\t\t currentToken.Token == \"e\" || currentToken.Token == \"f\" || currentToken.Token == \"g\" || currentToken.Token == \"h\" ||\n\t\t\t currentToken.Token == \"i\" || currentToken.Token == \"j\" || currentToken.Token == \"k\" || currentToken.Token == \"l\" ||\n\t\t\t currentToken.Token == \"m\" || currentToken.Token == \"n\" || currentToken.Token == \"o\" || currentToken.Token == \"p\" ||\n\t\t\t currentToken.Token == \"q\" || currentToken.Token == \"r\" || currentToken.Token == \"s\" || currentToken.Token == \"t\" ||\n\t\t\t currentToken.Token == \"u\" || currentToken.Token == \"v\" || currentToken.Token == \"w\" || currentToken.Token == \"x\" ||\n\t\t\t currentToken.Token == \"y\" || currentToken.Token == \"z\" )\n\t\t\t {\n\t\t\t\t //putMessage(\"Got a character.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t //putMessage(\"Token is not a character. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n \n\t\t//For ids\n\t\tcase \"id\" :// putMessage(\"Expecting an ID\");\n\t\t\t if(currentToken.Token == \"a\" || currentToken.Token == \"b\" || currentToken.Token == \"c\" || currentToken.Token == \"d\" ||\n\t\t\t currentToken.Token == \"e\" || currentToken.Token == \"f\" || currentToken.Token == \"g\" || currentToken.Token == \"h\" ||\n\t\t\t currentToken.Token == \"i\" || currentToken.Token == \"j\" || currentToken.Token == \"k\" || currentToken.Token == \"l\" ||\n\t\t\t currentToken.Token == \"m\" || currentToken.Token == \"n\" || currentToken.Token == \"o\" || currentToken.Token == \"p\" ||\n\t\t\t currentToken.Token == \"q\" || currentToken.Token == \"r\" || currentToken.Token == \"s\" || currentToken.Token == \"t\" ||\n\t\t\t currentToken.Token == \"u\" || currentToken.Token == \"v\" || currentToken.Token == \"w\" || currentToken.Token == \"x\" ||\n\t\t\t currentToken.Token == \"y\" || currentToken.Token == \"z\" )\n\t\t\t {\n\t\t\t\t //putMessage(\"Got an ID.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Token is not an ID. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n \n\t\t//For print\n\t\tcase \"print\" : //putMessage(\"Expecting a print\");\n\t\t\t if(currentToken.Token == \"p\" && peekAtToken(0).Token == \"r\" && peekAtToken(1).Token == \"i\" && peekAtToken(2).Token == \"n\" && peekAtToken(3).Token == \"t\" )\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a print.\");\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t \n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Character Sequence is not a print. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n\n\n\n\t\t//For while\n\t\tcase \"while\" : //putMessage(\"Expecting a while\");\n\t\t\t if(currentToken.Token == \"w\" && peekAtToken(0).Token == \"h\" && peekAtToken(1).Token == \"i\" && peekAtToken(2).Token == \"l\" && peekAtToken(3).Token == \"e\" )\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a while.\");\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\t\t \n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t //putMessage(\"Character Sequence is not a while. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n\n\n\n\t\t//For if\n\t\tcase \"if\" :// putMessage(\"Expecting an if\");\n\t\t\t if(currentToken.Token == \"i\" && peekAtToken(0).Token == \"f\" )\n\t\t\t {\n\t\t\t\t // putMessage(\"Got an if.\");\n\t\t\t\t currentToken = getNextTokenCodeGen();\n\t\t\n\t\t\t\t \n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Character Sequence is not an if. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n\n\t\t//For left parenthesis\n\t\tcase \"leftParen\" : //putMessage(\"Expecting a left parenthesis\");\n\t\t\t if(currentToken.Token == \"(\")\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a left parenthesis.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Token is not a left parenthesis. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n \n \n\t\t//For right parenthesis\n\t\tcase \"rightParen\" : //putMessage(\"Expecting a right parenthesis\");\n\t\t\t if(currentToken.Token == \")\")\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a right parenthesis.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Token is not a right parenthesis. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n \n\t\t//For left curly bracket\n\t\tcase \"leftCurlyBracket\" : //putMessage(\"Expecting a left curly bracket\");\n\t\t\t if(currentToken.Token == \"{\")\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a left curly bracket.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t //putMessage(\"Token is not a left curly bracket. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\tputMessageCodeGen( machineCode[i] + \" \");\n \n \n\t\t//For right curly bracket\n\t\tcase \"rightCurlyBracket\" : //putMessage(\"Expecting a right curly bracket\");\n\t\t\t if(currentToken.Token == \"}\")\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a right curly bracket.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Token is not a right curly bracket. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n \n\t\t//For assignment operator\n\t\tcase \"assign\" :// putMessage(\"Expecting an assignment operator.\");\n\t\t\t if(currentToken.Token == \"=\")\n\t\t\t {\n\t\t\t\t // putMessage(\"Got an assignment operator.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Token is not an assignment operator. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n\t\t//For quotation marks\n\t\tcase \"quote\" : //putMessage(\"Expecting a quotation mark\");\n\t\t\t if(currentToken.Token == \"\\\"\")\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a quotation mark.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Token is not a quotation mark. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n\n\n\t\t//For space character\n\t\tcase \" \" : //putMessage(\"Expecting a space character.\");\n\t\t\t if(currentToken.Token == \" \")\n\t\t\t {\n\t\t\t\t // putMessage(\"Got a space character.\");\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t errorCount++;\n\t\t\t // putMessage(\"Token is not a space character. \\nError Position: \" + tokenIndex + \".\" );\n\t\t\t }\n\t\t\t break;\n \n \n\t}\n \n\t//After checking the current token, consume and asssigne the next token to the current token slot(variable)\n\tcurrentToken = getNextTokenCodeGen();\n \n}", "title": "" }, { "docid": "06bd32cce046f7b1925c4f7ff3043ce8", "score": "0.6497108", "text": "isTokenExpired(token) {\n try {\n const decoded = decode(token);\n if (decoded.exp < Date.now() / 1000) {\n return true;\n } else return false;\n } catch (err) {\n return false;\n }\n }", "title": "" }, { "docid": "dbcb55854e9d533b07906cb6cbf0921d", "score": "0.64876217", "text": "function validateToken(req, res, next) {\n\t\t// Handle secret admin access\n\t\tif(config.adminKeyEnabled && req.query.secret_admin === config.adminKey) {\n\t\t\tnext();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tif(!req.headers.api_token) {\n\t\t\t\t\tthrow { code: \"NO_TOKEN\" };\n\t\t\t\t}\n\n\t\t\t\tif(!req.headers.api_secret) {\n\t\t\t\t\tthrow { code: \"NO_TOKEN\" };\n\t\t\t\t}\n\n\t\t\t\tif(!tokens[req.headers.api_token]) {\n\t\t\t\t\tthrow { code: \"INVALID_TOKEN\" };\n\t\t\t\t}\n\n\t\t\t\tif(!tokens[req.headers.api_token].secret !== req.headers.api_secret) {\n\t\t\t\t\tthrow { code: \"INVALID_TOKEN\" };\n\t\t\t\t}\n\n\t\t\t\tnext();\n\t\t\t} catch(e) {\n\t\t\t\terrorHandling.handle(e, res);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c2c093bcf39e28493f1b544683a6c4bf", "score": "0.64757204", "text": "function VerifyToken(req, res, next) {\n //Get auth header value\n const TokenHeader = req.headers['authorization'];\n //check if Token is underfined\n if(typeof TokenHeader !== 'undefined'){\n //Split at the space\n const Token = TokenHeader.split(' ');\n //Get token from array\n const TokenToken = Token[1];\n //Set the token\n req.token = TokenToken;\n next();\n }else{\n //Forbidden\n res.sendStatus(403);\n }\n\n}", "title": "" }, { "docid": "a67c730ac09b36b9a7ed7b17943e6879", "score": "0.6450447", "text": "evalToken(x) {\n // declare our result variable\n let result = false;\n result =\n // is the current player chickens?\n this.props.gameState.player === \"🐔\"\n ? // then check to see if the token is part of the array of chicken tokens\n (result = this.props.gameState.cknArray.includes(x))\n : // otherwise, check to see if the token is part of the kitten array\n (result = this.props.gameState.ktnArray.includes(x));\n // let me know if the token belongs to the current player\n return result;\n }", "title": "" }, { "docid": "7ecaede7e93209a64b297afba3409288", "score": "0.6438046", "text": "tokenIsOnline(token) {\n if (tokenList.filter(item => item === token).length >= 1) {\n return true;\n } else {\n return false\n }\n }", "title": "" }, { "docid": "073aef36bb603b8fa93b325136327b71", "score": "0.643271", "text": "function checkAuth(email,token) { // function to check for token availability\n\n console.log(\"checkAuth\",email,token);\n\n if(email == null)return false;\n if(keydict[email] == token)return true;\n return false;\n}", "title": "" }, { "docid": "c8406a4aa0beca1d2422a0cc1014bbed", "score": "0.6427696", "text": "function verifytoken (req, res, next) {\n //Recuperar el header\n const header = req.headers[\"authorization\"];\n if (header == null) {\n res.status(403).json({\n msn: \"No autotizado\"\n })\n } else {\n req.token = header;\n //console.log(\"---->\"+ req.originalUrl);\n //console.log(req);\n jwt.verify(req.token, \"secretkey123\", (err, authData) => {\n if (err) {\n res.status(403).json({\n msn: \"token incorrecto\"\n })\n }\n //go to funcion\n next();\n //say user from token\n //res.status(403).json(authData);\n\n });\n }\n}", "title": "" }, { "docid": "6d66cb5d8b12fd89233359171fe5db6f", "score": "0.64214635", "text": "function checkToken(result) {\n \n node.connect(\"/requirements\", function() {\n // Timeout is necessary because SERVER needs to send the player id\n setTimeout(function() {\n node.get('MTID', function(authorized) {\n var msg;\n if (authorized.success) {\n gameLink = authorized.gameLink;\n // No errors.\n result([]);\n }\n else {\n msg = 'Token authorization failed: ' + authorized.msg;\n result([msg]);\n }\n }, 'SERVER', token);\n });\n }, 500);\n }", "title": "" }, { "docid": "a08877c06154eed327b5cda9db2574ba", "score": "0.6414604", "text": "function isTokenVaild(theToken) {\n return new Promise((resolve, reject) => {\n let tokenAuthAPI = `${keycloakAPI}${OAuthConfig.endpoints.validation}`;\n\n let request = new XMLHttpRequest();\n request.open('GET', tokenAuthAPI);\n request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n request.setRequestHeader(\"Authorization\", \"Bearer \" + theToken);\n request.responseType = 'json';\n\n request.onerror = function (e) {\n console.log(e);\n resolve(false);\n };\n request.onload = function () {\n if (request.status == \"200\") {\n resolve(true);\n }\n else {\n resolve(false);\n }\n }\n\n request.send();\n });\n}", "title": "" }, { "docid": "9ede6093d9e3a00aaa1a26d963a4fa35", "score": "0.6410902", "text": "function tokenVerify(req, res, next) {\n const bearerHeader = req.headers['authorization'];\n if (typeof bearerHeader !== 'undefined') {\n const bearerToken = bearerHeader.split(\" \")[1];\n req.token = bearerToken;\n next();\n } else {\n res.status(403).send('No autorizado');\n }\n}", "title": "" }, { "docid": "7e33f8c9a2bd4039b264cd310d6133ba", "score": "0.6409446", "text": "function verifyToken(req, res, next) {\n const bearerHeader = req.headers[\"authorization\"];\n //Check if bearer is undefined\n if (typeof bearerHeader !== \"undefined\") {\n //aplit at the space\n const bearer = bearerHeader.split(\" \");\n //Get Token from array\n const bearerToken = bearer[1];\n //Set the token\n req.token = bearerToken;\n //Next Middleware\n next();\n } else {\n //Forbidden\n console.log(\"Forbidden from VerifyToken\");\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "4a4b7f8c5cf73cedf02c112549de88a3", "score": "0.64077216", "text": "function isTokenValid() {\n //Voir si on a un token\n const token = window.localStorage.getItem(\"authToken\");\n //Voir il il est valide\n if (token) {\n const { exp: expiration } = JwtDecode(token);\n\n if (expiration * 1000 > new Date().getTime()) {\n setAxiosToken(token);\n }\n }\n}", "title": "" }, { "docid": "4f345572819599e2231429071c09fcea", "score": "0.63978535", "text": "async function verifyToken(req, res, next) {\n\tif(!req.headers.authorization){\n\t\tres.status(401).json({\n ResponseCode: 401, // Unauthorized\n Data : [],\n Message: 'Token missing !'\n });\n return;\n\t}\n\n\t/* Verify Token */\n\tjwt.verify((req.headers.authorization).replace('Bearer ','') ,process.env.TOKEN_SECRET,function(err,user){\n\t\tif(err){\n\t\t\treturn res.status(403).json({ResponseCode: 403, Data : [], Message: 'Invalid Token !' }); // Forbidden\n\t\t}else if(!user.UserType || (user.UserType != 'Parent' && user.UserType != 'Admin')){\n\t\t\treturn res.status(403).json({ResponseCode: 403, Data : [], Message: 'Access denied !' }); // Forbidden\n\t\t}\n\t\treq.body.UserID = user.UserID;\n\t\treq.body.UserType = user.UserType;\n\t\tnext();\n\t})\n}", "title": "" }, { "docid": "78feaf4eb0d6cb1ccf7b5524551f6bc3", "score": "0.63958967", "text": "function validateToken(req, res, next) {\n const tokenHeader = req.headers.authorization;\n if (typeof tokenHeader !== 'undefined'){\n const bearer = tokenHeader.split('');\n const bearerToken = bearer[1];\n req.token = bearerToken;\n\n next();\n } else {\n res.status(403).json({\n error: 'no valid token found'\n });\n };\n}", "title": "" }, { "docid": "b04401cc3365924468029df53b829609", "score": "0.63895607", "text": "function _checkToken() {\n // ignore if there is no token\n if (!token) return;\n\n // otherwise, look to update the access token\n Oauth.getAccessToken(function(t) {\n if( t != null ) token = t;\n });\n}", "title": "" }, { "docid": "8516b9b686647894b7cfd3c0f0dc59a0", "score": "0.63813794", "text": "function checkToken(req, res, next){\n if (req.query.eg){\n req.session.eg = req.query.eg; // Save the requested example number\n }\n // Do we have a token that can be used?\n // Use a 30 minute buffer time to enable the user to fill out\n // a request form and send it.\n let tokenBufferMin = 30\n , now = moment();\n if (tokenBufferMin && req.user && req.user.accessToken &&\n now.add(tokenBufferMin, 'm').isBefore(req.user.expires)) {\n console.log ('\\nUsing existing access token.')\n next()\n } else {\n console.log ('\\nGet a new access token.');\n res.redirect('/auth');\n }\n}", "title": "" }, { "docid": "7b152680f5f02109c94167ad994876ea", "score": "0.63786703", "text": "function verifyToken(req, res, next) {\n // get auth header value\n const bearerHeader = req.headers['authorization'];\n // check if bearer is undefined\n if(typeof bearerHeader !== 'undefined'){\n //Split at the space\n const bearer = bearerHeader.split(' ');\n //get token from array\n const bearerToken = bearer[1];\n // set token\n req.token = bearerToken;\n // next middleware\n next()\n }\n else{\n // forbidded\n return res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "f9762e8b6da98a7f42f06261e46c4046", "score": "0.6374476", "text": "function checkToken(token) {\n // TODO ABSOLUTELY REMOVE THIS BEFORE GOING INTO PRODUCTION\n if(token === 'debug')\n return Promise.resolve(1); // just return user id 1\n\n return cache.get('zotagoToken:' + token)\n .then(function(v) {\n debug('successfully looked up zotago token ' + token);\n return v;\n })\n .catch(function() {\n debug('failed to look up zotago token ' + token);\n return false;\n });\n}", "title": "" }, { "docid": "3b886c4209b72b14cb776beb5a574c79", "score": "0.6373619", "text": "function verifyToken(req, res, next) {\n const bearerHeader = req.headers['authorization'];\n if(typeof bearerHeader !== 'undefined') {\n const bearer = bearerHeader.split(' ');\n const bearerToken = bearer[1];\n req.token = bearerToken;\n next();\n } else {\n res.sendStatus(403);\n }\n \n }", "title": "" }, { "docid": "63d77906c0ab18c0d65366306a52097f", "score": "0.63725877", "text": "function is_token(token, type, val){\n //return token.type is type and (no val or token.value is val)\n return token.type === type && (!val || token.value === val);\n }", "title": "" }, { "docid": "0d59533a30438abf1969e9f123a8aeb9", "score": "0.63714737", "text": "checkAuthUser (state) {\n return state.token != null\n }", "title": "" }, { "docid": "22210d66ffe15a16d34fe9d06c23719a", "score": "0.6369226", "text": "function validate(token) {\n return /\\w{2,}/.test(token);\n}", "title": "" }, { "docid": "7f6a2653082d7760108b971667718783", "score": "0.6368328", "text": "function verifytoken (req, res, next) {\r\n //Recuperar el header\r\n const header = req.headers[\"authorization\"];\r\n if (header == undefined) {\r\n res.status(403).json({\r\n msn: \"No autorizado\"\r\n })\r\n } else {\r\n req.token = header.split(\" \")[1];\r\n jwt.verify(req.token, \"secretkey123\", (err, authData) => {\r\n if (err) {\r\n res.status(403).json({\r\n msn: \"No autorizado\"\r\n })\r\n } else {\r\n next();\r\n }\r\n });\r\n }\r\n}", "title": "" }, { "docid": "988bd90498e2a2af7525e9ec5f7945bc", "score": "0.6352996", "text": "function check_valid_token(token)\n{\n var is_valid = false;\n var url = \"http://adsen.co/api/tokens/verify/\"+token+\"/\";\n \n $.ajax({\n url: url,\n dataType: 'json',\n async: false,\n success: function(data) {\n $.each( data, function( key, val ) {\n if(key==\"valid\"){\n is_valid = val; \n }\n }); \n } \n });\n \n return is_valid;\n}", "title": "" }, { "docid": "f191adce7b1eb8cae67ccf46c19a4cdc", "score": "0.6352514", "text": "function verifyToken (req,res,next){\n //GET auth header value --> send into rhe header\n const bearerHeader = req.headers['authorization']\n // check if bearer is undefined \n if(typeof bearerHeader !== 'undefined'){\n // Split at the space ( split turns string into array )\n const bearer= bearerHeader.split(' ') // indeed bearer is formed with an bearer and space and <acces_token> turn into an array to separeter bearer to the access\n // Get token from array \n const bearerToken = bearer[1]\n //Set the token\n req.token =bearerToken;\n //Next middleware \n next()\n }\n else{\n //Forbidden // can't acces screen forbidden \n res.sendStatus(403)\n }\n}", "title": "" }, { "docid": "9b7cdbb5214578e1c99ee98052e7f592", "score": "0.6349314", "text": "function isTokenValid(token = {}, callback) {\n\n jwt.verify(token, process.env.SECRET, (err, decoded) => {\n if (!err) {\n // console.group();\n // console.log(\"decoded token: \");\n // console.dir(decoded);\n // console.groupEnd();\n callback(decoded)\n }\n else {\n callback(false)\n }\n });\n}", "title": "" }, { "docid": "d50434b9e57ea585d57186e58cccb72f", "score": "0.63465154", "text": "function verifytoken (req, res, next) {\n //Recuperar el header\n const header = req.headers[\"authorization\"];\n if (header == undefined) {\n res.status(403).json({\n msn: \"No autorizado\"\n })\n } else {\n req.token = header.split(\" \")[1];\n jwt.verify(req.token, \"secretkey123\", (err, authData) => {\n if (err) {\n res.status(403).json({\n msn: \"No autorizado\"\n })\n } else {\n next();\n }\n });\n }\n}", "title": "" }, { "docid": "a1330e21a13f39bdfbc3004b4bf7f3f0", "score": "0.6343408", "text": "function verifyToken(req, res, next) {\n //get Auth header value\n const bearerHeader = req.headers['authorization'];\n //Check if bearer is undefined\n if (typeof bearerHeader !== 'undefined')\n {\n //Split at the space\n const bearer = bearerHeader.split(' ');\n //Get Token From Array\n const bearerToken = bearer[1];\n //Set token\n req.token = bearerToken;\n next();\n\n\n } else {\n //Forbidden\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "67d6fe54b818d66cfde17f697d9af83a", "score": "0.63286114", "text": "function validate(token) {\n return /\\w{2,}/.test(token);\n}", "title": "" }, { "docid": "e806dd05a1cd1c2de5c9bb1ff0ac4db1", "score": "0.63247746", "text": "function verifyToken(req, res, next) {\n const bearerHeader = req.headers['authorization'];\n if(typeof bearerHeader !== 'undifiend') {\n const bearer = bearerHeader.split(' ');\n const bearerToken = bearer[1];\n req.token = bearerToken;\n next();\n } else {\n res.status(403);\n }\n}", "title": "" }, { "docid": "98a41da44ffe41d0a65dc8a04c6e01e8", "score": "0.6315834", "text": "function verifyToken(req, res, next) {\r\n let headerData = req.headers.authorization;\r\n\r\n if (headerData != undefined) {\r\n let token = headerData.split(\" \")[1];\r\n req.token = token;\r\n next();\r\n }\r\n else {\r\n res.status(403);\r\n res.send({ \"message\": \"No Token Available\" });\r\n }\r\n \r\n}", "title": "" }, { "docid": "5560005e5d3645f6b879641de0bd05b3", "score": "0.63103354", "text": "function findToken(word) {\n\n let result\n \n // short flag {-x, -xy}\n result = word.match(SHORTTOKEN)\n if (result) {\n\n if (word == result[result.index])\n return { type: TT_shortflag, value: word } \n else\n throw `illegal short flag ${word}`\n }\n\n result = word.match(LONGTOKEN)\n if (result) {\n\n if (word == result[result.index])\n return { type: TT_longflag, value: word }\n else\n throw `illegal long flag ${word}`\n }\n\n // argument to a flag -s Account\n result = word.match(ARG)\n if (result) {\n\n if (word == result[result.index]) \n return { type: TT_argument, value: word }\n else\n throw `syntax error illegal argument ${word}`\n }\n\n throw `undefined token ${word}`\n\n}", "title": "" }, { "docid": "8fb47cc711f9c7db6118b755e29bc40e", "score": "0.63056177", "text": "function verifyToken(req,res,next){\n //get auth header value\n //console.log(req.headers)\n const bearerHeader=req.headers['Authentication'];\n //check if bearer is undefined\n if (typeof bearerHeader !=='undefined'){\n //split at the space and get the token\n const bearerToken=bearerHeader.split(' ')[1]\n //set the token\n req.token=bearerToken;\n //next middleware\n next();\n }else{\n //forbidden\n res.sendStatus(403)\n }\n}", "title": "" }, { "docid": "51a4c904a6440eac99438c45cf7b6210", "score": "0.62821025", "text": "isTokenExpired(token) {\n const now = Date.now().valueOf() / 1000;\n const payload = jsonwebtoken.decode(token);\n\n return (!!payload['exp'] && payload['exp'] < (now + 30)); // Add 30 seconds to make sure , edge case is avoided and token is refreshed.\n }", "title": "" }, { "docid": "173968a6645b94806446c1db2bcfd205", "score": "0.6276819", "text": "function verifyToken(req, res, next) {\n //get auth header value\n const bearerHeader = req.headers['authorization'];\n //check if bearer is undifined\n if(typeof bearerHeader !== 'undefined') {\n const bearer = bearerHeader.split(' ');\n const bearerToken = bearer[1];\n req.token = bearerToken;\n next();\n } else {\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "d1cc1a98f620afef351a04c64de35474", "score": "0.627192", "text": "function verifyToken(req, res, next) {\n\tconst bearerHeader = req.headers['authorization'];\n\n\tif (typeof bearerHeader !== 'undefined') {\n\t\tbearerToken = bearerHeader.split(' ')[1];\n\t\treq.token = bearerToken;\n\t\tnext();\n\t} else {\n\t\tconsole.log('missing token in header');\n\t\tres.status(403).send({\n\t\t\tresult: false,\n\t\t\tdata: 'missing token in header'\n\t\t})\n\t}\n}", "title": "" }, { "docid": "472706f85058f8f9a6b27f89dc3ab645", "score": "0.6271694", "text": "function tokenIsAvailable() {\n return !!sessionStorage.getItem('alat-token');\n}", "title": "" }, { "docid": "b27b6768e385059b44a5dbd276697b83", "score": "0.6269981", "text": "function verifyToken(req,res,next){\n var token = req.headers['x-access-token'];\n if(typeof token!=='undefined'){\n // req.token = token;\n jwt.verify(token,config.secret,(err,data)=>{\n if(err) {\n return res.status(401).send({'message':'Invalid token,Please Login'})\n }else{\n next();\n }\n })\n }else{\n return res.status(401).send({'message':'No token Provided,Please Login'})\n }\n}", "title": "" }, { "docid": "8f5fce0c3fb676f59498944aeaae31cd", "score": "0.6267841", "text": "function verifyToken(req, res, next) {\n var token = req.body.token;\n if (token){\n jwt.verify(token, \"Secreet\", (err, decode)=>{\n if (err) {\n res.send(\"Wrong token\")\n } else {\n console.log(decode);\n res.locals.decode = decode\n next();\n }\n })\n } else {\n res.send(\"No token\")\n }\n}", "title": "" }, { "docid": "6b61b4f77829d849ef8330dc9e5465b6", "score": "0.6265756", "text": "function verifyToken(req, res, next) {\n //Get auth header value\n const bearerHeader = req.headers['authorization'];\n //check if bearer is undefined\n if (typeof bearerHeader !== 'undefined'){\n //Split at the space\n const bearer = bearerHeader.split(' ');\n //Get token from array\n const bearerToken = bearer[1];\n //set token\n //Next middleware\n jwt.verify(bearerToken, 'abandon_all_hope_549510o', (err, authData) => {\n if (err)\n res.sendStatus(418);//I`m teapot\n else{\n req.authData = authData;\n }\n next();\n });\n }else {\n //Forbidden\n\n res.sendStatus(403);\n }\n\n}", "title": "" }, { "docid": "b0a5e9cc7ee21554f37659ced2c0371c", "score": "0.6261036", "text": "function validarToken(req = Request, res, next) {\n const bearerHeader = req.headers['authorization'];\n if (typeof bearerHeader !== 'undefined') {\n const bearer = bearerHeader.split(' ');\n const bearerToken = bearer[1];\n req.token = bearerToken;\n next();\n }\n else {\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "013f46c750be7761283a184364ca7b88", "score": "0.62576854", "text": "function invalidToken() {\n throw new Error(`Invalid token: \"${encodedToken}\"`);\n }", "title": "" }, { "docid": "ba5e25ab0a7cc35b22b8e066110b5e68", "score": "0.62470883", "text": "function verifyToken(req,res,next){\n //Get auth header value\n const bearerHeader = req.headers['authorization'];\n console.log(bearerHeader);\n //check if bearer is undefined\n if(typeof bearerHeader !== 'undefined'){\n //Split at the space\n const bearer = bearerHeader.split(' ');\n //get token from array\n const bearerToken = bearer[1];\n //set the token\n req.token =bearerToken;\n console.log(bearerToken);\n //Next middleware\n next();\n }else {\n //Forbidden\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "58a35b177a422f21c8d2aa5ecf65781c", "score": "0.62457234", "text": "function verifyToken(req, res, next){\n //Get auth header value\n const bearerHeader = req.headers['authorization']\n //check if bearer is undefined\n if(typeof bearerHeader !== 'undefined'){\n // Spilt at space\n const bearer = bearerHeader.split(' ');\n //Get token from array\n const bearerToken = bearer[1];\n //set the token\n req.token = bearerToken;\n //next middleware\n next();\n }else{\n //Forbidden\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "64ffdabc9013c7014bb80e8980ca50ed", "score": "0.62452745", "text": "testTokenValidity() {\n let self = this;\n let url = 'https://slack.com/api/auth.test';\n let result = HTTP.post(url, {params: {token: self._authToken}});\n let data = result.data;\n return data.ok;\n }", "title": "" }, { "docid": "ac5f494768664f6399e1a515a0ed0191", "score": "0.6243528", "text": "function verfiyToken(token){\n if(!token) return next(\"NOTOKEN\");\n jwtVerify(token, 'PatientAPIKey', function(err, data) {\n if (err) return next(\"INVALIDTOKEN\")\n else return next(null, data)\n });\n}", "title": "" }, { "docid": "35cc1476496e289ce46b0fbe115bb282", "score": "0.6240204", "text": "function checkState(string,line){\n\t\tvar input=string;\n\t\t//var line=lineNum;\n\t\tputMessage(\"checking state: \"+state,1);\n\t\t//putMessage(\"ct: \"+ct);\n\t\tswitch(state) {\n\t\t\tcase 5:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Print at line '+line,1);\n\t\t\t\t//create Print Token\n\t\t\t\ttokens.push(new token('Keyword','Print',line));\n\t\t\t\t//tokens.push(x);\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: While '+line,1);\n\t\t\t\t//create While Token\n\t\t\t\t//var x = new token('While',null,line);\n\t\t\t\ttokens.push(new token('Keyword','While',line));\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: If at line '+line,1);\n\t\t\t\t//create if Token\n\t\t\t\t//var x = new token('If',null,line);\n\t\t\t\ttokens.push(new token('Keyword','If',line));\n\t\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Type(int) at line '+line,1);\n\t\t\t\t//create type Token\n\t\t\t\t//var x = new token('Type','int',line);\n\t\t\t\ttokens.push(new token('Type','Int',line));\n\t\t\t\tbreak;\n \t\t\tcase 15:\n\t\t\t\tresetState();\n\t\t\t\tif(isLetter(input.charAt(pos))){\n\t\t\t\t\tputMessage('Token found: Identifier('+input.charAt(pos)+') at line '+line,1);\n\t\t\t\t\t//create identifier Token\n\t\t\t\t\t//var x = new token('Identifier',input.charAt(i),line);\n\t\t\t\t\ttokens.push(new token('Identifier',input.charAt(pos),line));\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tct++;\n\t\t\t\tbreak;\n\t\t\tcase 21:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Type(string) at line '+line,1);\n\t\t\t\t//create string type Token\n\t\t\t\ttokens.push(new token('Type','String',line));\n\t\t\t\tbreak;\n\t\t\tcase 28:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Type(boolean) at line '+line,1);\n\t\t\t\t//create boolean type Token\n\t\t\t\ttokens.push(new token('Type','Boolean',line));\n\t\t\t\tbreak;\n\t\t\tcase 32:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Boolean Value(true) at line '+line,1);\n\t\t\t\t//create True BoolVal Token\n\t\t\t\ttokens.push(new token('Boolean Value','True',line));\n\t\t\t\tbreak;\n\t\t\tcase 37:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Boolean Value(false) at line '+line,1);\n\t\t\t\t//create False BoolVal Token\n\t\t\t\ttokens.push(new token('Boolean Value','False',line));\n\t\t\t\tbreak;\n\t\t\tcase 39:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Inequality(!=) at line '+line,1);\n\t\t\t\ttokens.push(new token('Inequality','!=',line));\n\t\t\t\t//create inequality Token\n\t\t\t\tbreak;\n\t\t\tcase 40:\n\t\t\tct=pos+1;\n\t\t\t\t//Need to check for this case because == has same initial input as =\n\t\t\t\tif(checkNextChar(input,pos,1)=='='){\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\tresetState();\n\t\t\t\t\tputMessage('Token found: Assignment(=) at line '+line,1);\n\t\t\t\t\t//create Assignment Token\n\t\t\t\t\ttokens.push(new token('Assignment','=',line));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 41:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Equality(==) at line '+line,1);\n\t\t\t\t//create equality Token\n\t\t\t\ttokens.push(new token('Equality','==',line));\n\t\t\t\tbreak;\n\t\t\tcase 42:\n\t\t\tct=pos+1;\n\t\t\t//putMessage(\"at state 42: \"+inString);\n\t\t\t\tif(!inString){\n\t\t\t\t\t//resetState();\n\t\t\t\t\tputMessage('Token found: Quote(\") at line '+line,1);\n\t\t\t\t\t//st=\"\";\n\t\t\t\t\tinString=true;\n\t\t\t\t\t//create \" Token\n\t\t\t\t\ttokens.push(new token('Quote','\"',line));\n\t\t\t\t}else if(inString){\n\t\t\t\t\t//st=st+input.charAt(i);\n\t\t\t\t\tif(isLetter(input.charAt(ct)) || input.charAt(ct)==' '){\n\t\t\t\t\t\tputMessage('Token found: String Char('+input.charAt(pos)+') at line '+line,1);\n\t\t\t\t\t\tstToken=stToken+input.charAt(pos);\n\t\t\t\t\t\t//tokens.push(new token('String Char',input.charAt(pos),line));\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t//do nothing if encountering a non-char/space in a string\n\t\t\t\t\tputMessage(\"Error: String\"+line,0);\n\t\t\t\t\tlexErrors++;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 43:\n\t\t\tct=pos+1;\n\t\t\t\tinString=false;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: String at line '+line,1);\n\t\t\t\t//create \" Token\n\t\t\t\tstToken=stToken+input.charAt(pos-1);\n\t\t\t\ttokens.push(new token('String',stToken,line));\n\t\t\t\ttokens.push(new token('Quote','\"',line));\n\t\t\t\tstToken=\"\";//EMPTY THE STRING SO IT DOESN'T ADD ANY PREVIOUS STRINGS\n\t\t\t\tbreak;\n\t\t\tcase 44:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Digit('+input.charAt(pos)+') at line '+line,1);\n\t\t\t\t//create Digit token\n\t\t\t\ttokens.push(new token('Digit',input.charAt(pos),line));\n\t\t\t\tbreak;\n\t\t\tcase 45:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Integer Operator(+) at line '+line,1);\n\t\t\t\t//create Integer Operator Token\n\t\t\t\ttokens.push(new token('IntOp',input.charAt(pos),line));\n\t\t\t\tbreak;\n\t\t\tcase 46:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Left Bracket(\"{\") at line '+line,1);\n\t\t\t\t//create Left Bracket Token\n\t\t\t\ttokens.push(new token('LeftBracket',input.charAt(pos),line));\n\t\t\t\tbreak;\n\t\t\tcase 47:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Right Bracket(\"}\") at line '+line,1);\n\t\t\t\t//create Right Bracket Token\n\t\t\t\ttokens.push(new token('RightBracket',input.charAt(pos),line));\n\t\t\t\tbreak;\n\t\t\tcase 48:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Left Parenthesis(\"(\") at line '+line,1);\n\t\t\t\t//create Left Parenthesis Token\n\t\t\t\ttokens.push(new token('LeftParen',input.charAt(pos),line));\n\t\t\t\tbreak;\n\t\t\tcase 49:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: Right Parenthesis(\")\") at line '+line,1);\n\t\t\t\t//create right Parenthesis Token\n\t\t\t\ttokens.push(new token('RightParen',input.charAt(pos),line));\n\t\t\t\tbreak;\n\t\t\tcase 50:\n\t\t\tct=pos+1;\n\t\t\t\tresetState();\n\t\t\t\tputMessage('Token found: EOF($) at line '+line,1);\n\t\t\t\t//create EOF Token\n\t\t\t\ttokens.push(new token('EOF',input.charAt(pos),line));\n\t\t\t\tbreak;\n\t\t\tcase 51:\n\t\t\t\twhile(ct<pos){\n\t\t\t\t\tif(isLetter(input.charAt(ct))){\n\t\t\t\t\t\tputMessage('Token found: Identifier('+input.charAt(ct)+') at line '+line,1)\n\t\t\t\t\t\ttokens.push(new token('Identifier',input.charAt(ct),line));\n\t\t\t\t\t}\n\t\t\t\t\tct++;\n\t\t\t\t\t//putMessage(\"ct(52): \"+ct);\n\t\t\t\t}\n\t\t\t\t//putMessage(\"Over here! \"+input.charAt(ct));\n\t\t\t\tresetState(); \n\t\t\t\t//decriement i to take in the current char again to properly reset\n\t\t\t\tpos=pos-1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//if EOF add ids for all indexes from ct to end\n\t\t\t\tif(checkNextChar(input,pos,1)==''){\n\t\t\t\t\twhile(ct<pos+1){\n\t\t\t\t\t\tif(isLetter(input.charAt(ct))){\n\t\t\t\t\t\t\tputMessage('Token found: Identifier('+input.charAt(ct)+') at line '+line,1)\n\t\t\t\t\t\t\ttokens.push(new token('Identifier',input.charAt(ct),line));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tct++;\n\t\t\t\t\t\t//putMessage(\"ct(def): \"+ct);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t}//eo switch\n\t}//eo checkState", "title": "" }, { "docid": "ea995c4a12dbb03ae6e5ed5d50e2c98b", "score": "0.62358606", "text": "function verifyToken(req, res, next) {\n\n const token = req.cookies[\"tkn\"];\n\n if (typeof token === \"string\"){\n\n try {\n req.user = jwt.verify(token, process.env.JWT_SECRET);\n next();\n } \n catch (err) {\n next(err);\n }\n}\n\nelse{\n res.sendStatus(400);\n}\n\n}", "title": "" }, { "docid": "256176899ab03c471eb6cbebc43abe1c", "score": "0.6234302", "text": "function verifyToken(req, res, next) {\n //get Auth header value\n const bearerHeader = req.headers['authorization'];\n\n //check if bearer header is undefined \n if (typeof bearerHeader !== 'undefined') {\n\n //Split at the space\n const bearer = bearerHeader.split(' ');\n\n //Get token from array\n const bearerToken = bearer[1];\n //set the token\n req.token = bearerToken;\n ///next Middleware\n next(); //stop execution and call next \n\n } else {\n //forbidden\n res.json({\n success: 'false',\n message: 'authorization is not defined'\n });\n }\n\n}", "title": "" }, { "docid": "8fe2395ef1afdfab10afc7132b540bd1", "score": "0.62308127", "text": "loggedIn(){\n\t\t//TODO : check validity of token ?\n\t\tconst token = this.getToken()\n\t\t//return !!token && !isTokenExpired(token) // handwaiving here\n\t\treturn !!token\n\t}", "title": "" }, { "docid": "d43b0fe07af2154b09ad2249246f234b", "score": "0.6229273", "text": "function verifyToken(req, res, next) {\n //get auth header value\n const bearerHeader = req.header['authorization'];\n //check if bearer is undefined\n if (typeof bearerHeader !== 'undefined') {\n //Split at the space\n const bearer = bearerHeader.split(' ');\n //get token from array\n const bearerToken = bearer[1];\n //Set the token\n req.token = bearerToken;\n //Next middleware\n next();\n }\n else {\n //Forbidden\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "486863c0db4ce75331e688ba16081a9e", "score": "0.6226013", "text": "static async verifyToken(accessToken) {\n const payload = await jwt.decode(\n process.env.ACCESS_TOKEN_SECRET,\n accessToken\n );\n if (payload.error) return false;\n return payload.value;\n }", "title": "" }, { "docid": "3af4b3b4039397fc3e29b8ecc19f3f8d", "score": "0.62234443", "text": "function checkToken(cToken) {\n\tif (!panic) {\n\t\t// Expected token type\n\t\tif (cToken != \"T_RBrace\") {\n\t\t\tprintVerbose(\"Expecting a {0}\".format(cToken));\n\t\t} else {\n\t\t\tprintVerbose(\"Expecting a {0} or a statement\".format(cToken));\n\t\t}\n\t\t\n\t\t// Acquired token type\n\t\tif (currentToken.type == cToken) {\n\t\t\tprintVerbose(\"Got a {0}!\".format(cToken));\n\t\t} else {\n\t\t\tif (cToken != \"T_RBrace\") {\n\t\t\t\tprintOutput(\"Parse Error: Expected {0}, got {1} at line {2} character {3}\".format(cToken, currentToken.type, currentToken.lineNumber, currentToken.linePosition));\n\t\t\t} else {\n\t\t\t\tprintOutput(\"Parse Error: Expected {0}, got {1} at line {2} character {3}\".format(\"T_Print | T_Id | T_Type | T_While | T_If | T_LBrace | T_RBrace\", currentToken.type, currentToken.lineNumber, currentToken.linePosition));\n\t\t\t}\n\t\t\tpanic = true;\n\t\t}\n\t\t\n\t\tif (currentToken.type != \"T_EOF\") {\n\t\t\tcurrentToken = getNext();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1a9f02286175c1c5d8f199ca4d946325", "score": "0.6218525", "text": "function verifyToken(req, res, next) {\n console.log(\"Verifying\")\n const bearerHeader = req.headers['authorization'];\n if(bearerHeader != undefined) {\n const bearerToken = bearerHeader.split(\" \")[1]\n req.token = bearerToken\n next()\n } else {\n console.log(\"Sending\")\n res.sendStatus(403)\n }\n}", "title": "" }, { "docid": "59eae34245e50becfccb726c4c475143", "score": "0.6216905", "text": "async function checkWebtoken(req, res, next) {\n try {\n const authorization = req.headers && req.headers.authorization;\n // authorization header comes in format \"bearer tokenString\". Split the bearer to get the token.\n const token = authorization && authorization.startsWith('Bearer') && authorization.split(' ')[1];\n\n const claims = await authenticateUC(token);\n // [👌] token is valid. User can continue to a protected route\n req.claims = claims;\n return next();\n } catch (e) {\n return next(e);\n }\n}", "title": "" }, { "docid": "13064ba3752a1ac3c078c1a2f22afb9c", "score": "0.6216452", "text": "function verifyToken(req, res, next){\n \n //Request header with authorization key\n const bearerHeader = req.headers['authorization'];\n \n //Check if there is a header\n if(typeof bearerHeader !== 'undefined'){\n\n const bearer = bearerHeader.split(' ');\n \n //Get Token arrray by spliting\n const bearerToken = bearer[1];\n\n req.token = bearerToken;\n\n //call next middleware\n next();\n\n }else{\n\n res.sendStatus(403);\n\n }\n\n\n}", "title": "" }, { "docid": "3a0a89223f9b2ca3a5533a4bf69288f8", "score": "0.6215906", "text": "function checkLogin(token) {\r\n return (token && new AccessToken(token).isValid());\r\n }", "title": "" }, { "docid": "a38fd6c601af950c1a047e74e2a347ef", "score": "0.62154317", "text": "function verifyToken(req, res, next){\n //Get auth header value\n const bearerHeader = req.headers['authorization'];\n //Check if bearer is undefined\n\n if(typeof bearerHeader !== 'undefined'){\n //split at the space\n const bearer = bearerHeader.split(' ');\n //Get token from array\n const bearerToken = bearer[1];\n //set the token\n req.token = bearerToken\n //Next middleware\n next();\n } else {\n //Forbidden\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "17a095f46139fcc4af2e85be08c8806d", "score": "0.621253", "text": "function nextToken() {\n var type = NONE;\n for (var i = index; i < locale.length; i++) {\n // RFC 5234 section B.1\n // ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n // DIGIT = %x30-39 ; 0-9\n var c = callFunction(std_String_charCodeAt, locale, i);\n if ((UPPER_A <= c && c <= UPPER_Z) || (LOWER_A <= c && c <= LOWER_Z))\n type |= ALPHA;\n else if (DIGIT_ZERO <= c && c <= DIGIT_NINE)\n type |= DIGIT;\n else if (c === HYPHEN && i > index && i + 1 < locale.length)\n break;\n else\n return false;\n }\n\n token = type;\n tokenStart = index;\n tokenLength = i - index;\n index = i + 1;\n return true;\n }", "title": "" }, { "docid": "a8c5ae3559e0f0605d34ba82756bfd98", "score": "0.6210459", "text": "function verifyToken(request, response, next) {\n // Get Authorization header value\n const bearerHeader = request.headers['authorization'];\n // check if the authorization header is available\n if (typeof(bearerHeader) !== 'undefined') {\n // split the 'Bearer & token by space'\n const bearer = bearerHeader.split(' ');\n // get the token\n const bearerToken = bearer[1];\n // verify the token with the private key that was used while creating the token\n jwt.verify(bearerToken, 'chandiokey', (error, authData) => {\n if (error) {\n response.status(403).send({\n message: 'Access Denied, Invalid Auth token'\n });\n } else {\n request.authData = authData\n next();\n }\n })\n\n } else {\n response.status(403).send({\n message: 'Accces Denied, Authorization header is missing'\n })\n }\n}", "title": "" }, { "docid": "3d0e7c183b00b784d0c7b21d977c7682", "score": "0.620747", "text": "function verifyToken(req, res, next) {\n var bearerHeader = req.headers['authorization'];\n\n if (typeof bearerHeader !== 'undefined') {\n var bearer = bearerHeader.split(' ');\n req.token = bearer[1];\n next();\n } else {\n res.sendStatus(403);\n }\n}", "title": "" }, { "docid": "234daa35b68709474db79d10cc5ac73e", "score": "0.62074107", "text": "function verifyToken(req, res, next) {\r\n // Get auth header value\r\n const bearerHeader = req.headers['authorization'];\r\n // Check if bearer is undefined\r\n if(typeof bearerHeader !== 'undefined') {\r\n // Split at the space\r\n const bearer = bearerHeader.split(' ');\r\n // Get token from array\r\n const bearerToken = bearer[1];\r\n // Set the token\r\n req.token = bearerToken;\r\n // Next middleware\r\n next();\r\n } else {\r\n // Forbidden\r\n res.status(403).send(\"No authorization\");\r\n }\r\n\r\n}", "title": "" } ]
aaba0c69453ff0fc723cc5c012684593
We must install signal handlers before grpc lib does it.
[ { "docid": "cd2074ea6f3b425d2330af618d30131c", "score": "0.0", "text": "async function cleanUp () {\n if (csiServer) csiServer.undoReady();\n if (apiServer) apiServer.stop();\n if (!opts.s) {\n if (volumeOper) await volumeOper.stop();\n }\n if (volumes) volumes.stop();\n if (!opts.s) {\n if (poolOper) await poolOper.stop();\n if (csiNodeOper) await csiNodeOper.stop();\n if (nodeOper) await nodeOper.stop();\n }\n if (messageBus) messageBus.stop();\n if (registry) registry.close();\n if (csiServer) await csiServer.stop();\n process.exit(0);\n }", "title": "" } ]
[ { "docid": "cbf03c9387f37ed02faed78a3264ce0a", "score": "0.6082739", "text": "handleSignal(data, callback) {\n\t\ttry {\n\t\t\tlet msg = messages.decodeMessage(data);\n\n\t\t\tswitch (msg.type) {\n\t\t\t\tcase types.SIGNAL:\n\t\t\t\t\t// decode the actual signal message\n\t\t\t\t\tlet payload = messages.decodeMessagePayload(msg.type, msg.payload);\n\t\t\t\t\tlet signal = messages.decodeSignalPayload(payload.type, payload.payload);\n\t\t\t\t\tthis.invokeCallbacks(payload.type, payload.id, signal);\n\t\t\t\t\tif (callback) {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (callback) {\n\t\t\t\t\t\tcallback('bad message received');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdebug('bad message received');\n\t\t\t\t\t}\n\t\t\t}\n\t\t} catch(e) {\n\t\t\tif (callback) {\n\t\t\t\tcallback(e);\n\t\t\t} else {\n\t\t\t\tdebug(e);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5678d3d668d83ee4a9a007545ca1e7c2", "score": "0.6069358", "text": "function sigHandler(signal) {\n console.log(`Caught signal: ${signal}. Shutting down.`);\n if (signal == 'SIGINT' || signal == 'SIGTERM') {\n fs.unlinkSync(pidFile);\n process.exit(0);\n }\n}", "title": "" }, { "docid": "ac45d6f635cbc2675e0ea21a59947321", "score": "0.59259635", "text": "function attachGracefulShutdownHandlers() {\n ['SIGTERM', 'SIGINT', 'unhandledRejection', 'uncaughtException'].forEach((eventName) => {\n handlersByEventName[eventName] = process.listeners(eventName);\n process.removeAllListeners(eventName);\n process.on(eventName, async eventData => {\n const isAnUnhandledError = !eventName.startsWith('SIG');\n if (isAnUnhandledError) {\n console.log(`An ${eventName} occurred: ${eventData}`);\n }\n await shutDownGracefully({ eventName, cause: eventData });\n if (isAnUnhandledError) { // trigger the Flex SDK graceful shutdown manually\n handlersByEventName.SIGINT.forEach(handler => handler('SIGINT'));\n }\n });\n });\n}", "title": "" }, { "docid": "57d7867219815e73b133b94b79783108", "score": "0.58375484", "text": "function handleSignal(signal) {\n\t\tswitch(signal) {\n\t\t\tcase \"reset\":\n\t\t\t\tblocking_input = true;\n\t\t\t\trequire(\"child_process\").spawn(process.argv.shift(), process.argv, {\n\t\t\t\t\tcwd: process.cwd(),\n\t\t\t\t\tdetached : true,\n\t\t\t\t\tstdio: \"inherit\",\n\t\t\t\t});\n\t\t\t\tprocess.exit();\n\t\t\t\tbreak;\n\n\t\t\tcase \"reload_commands\":\n\t\t\t\treloadCommands();\n\t\t\t\tbreak;\n\n\t\t\tcase \"reload_parsers\":\n\t\t\t\treloadParsers();\n\t\t\t\tbreak;\n\n\t\t\tcase \"quit\":\n\t\t\t\tblocking_input = true;\n\t\t\t\tsetTimeout(process.exit, 1500);\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "title": "" }, { "docid": "dc59a844bbbe4781e40902b4a55cc6e6", "score": "0.5782389", "text": "async callBeforeShutdownHook(signal) {\n const modulesContainer = this.container.getModules();\n for (const module of [...modulesContainer.values()].reverse()) {\n await hooks_1.callBeforeAppShutdownHook(module, signal);\n }\n }", "title": "" }, { "docid": "a8fbefb669b1373dde69aff011e00b39", "score": "0.57575816", "text": "function setupTerminationHandlers() {\n process.on('exit', function() { terminator(); });\n\n // Removed 'SIGPIPE' from the list - bugz 852598.\n ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',\n 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM'\n ].forEach(function(element, index, array) {\n process.on(element, function() { terminator(element); });\n });\n}", "title": "" }, { "docid": "880769efa6849ae6eb9a37aae23bed72", "score": "0.57147235", "text": "handleDeclareSignal() {\n this.props.declarefunction();\n }", "title": "" }, { "docid": "0e77a5025fdecdd1727921b5344f0a87", "score": "0.56895673", "text": "function testSignal(){\n main.webContents.send('testSignal', null);\n}", "title": "" }, { "docid": "b37a2d683f03c97cdef64e7bd27f0d2d", "score": "0.56881946", "text": "function doSignal(){\n sig = new $xirsys.signal( '/webrtc', username,{channel:channelPath} );\n sig.on('message', msg => {\n let pkt = JSON.parse(msg.data);\n //console.log('*main* signal message! ',pkt);\n let payload = pkt.p;//the actual message data sent \n let meta = pkt.m;//meta object\n let msgEvent = meta.o;//event label of message\n let toPeer = meta.t;//msg to user (if private msg)\n let fromPeer = meta.f;//msg from user\n //remove the peer path to display just the name not path.\n if(!!fromPeer) {\n let p = fromPeer.split(\"/\");\n fromPeer = p[p.length - 1];\n }\n switch (msgEvent) {\n //first Connect Success!, list of all peers connected.\n case \"peers\":\n //this is first call when you connect, \n onReady();\n // if we are connecting to a remote user and remote \n // user id is found in the list then initiate call\n if(!!remoteCallID) {\n let users = payload.users;\n if(users.indexOf(remoteCallID) > -1){\n callRemotePeer();\n }\n }\n break;\n //peer gone.\n case \"peer_removed\":\n if(fromPeer == remoteCallID) onStopCall();\n break;\n \n // new peer connected\n //case \"peer_connected\":\n // \taddUser(fromPeer);\n // \tbreak;\n // message received. Call to display.\n //case 'message':\n // \tonUserMsg(payload.msg, fromPeer, toPeer);\n // \tbreak;\n }\n })\n}", "title": "" }, { "docid": "6d4fbdaad7ca657577012a1f675e89fd", "score": "0.5624834", "text": "function _safely_install_sigint_listener() {\n\n const listeners = process.listeners(SIGINT);\n const existingListeners = [];\n for (let i = 0, length = listeners.length; i < length; i++) {\n const lstnr = listeners[i];\n /* istanbul ignore else */\n if (lstnr.name === '_tmp$sigint_listener') {\n existingListeners.push(lstnr);\n process.removeListener(SIGINT, lstnr);\n }\n }\n process.on(SIGINT, function _tmp$sigint_listener(doExit) {\n for (let i = 0, length = existingListeners.length; i < length; i++) {\n // let the existing listener do the garbage collection (e.g. jest sandbox)\n try {\n existingListeners[i](false);\n } catch (err) {\n // ignore\n }\n }\n try {\n // force the garbage collector even it is called again in the exit listener\n _garbageCollector();\n } finally {\n if (!!doExit) {\n process.exit(0);\n }\n }\n });\n}", "title": "" }, { "docid": "6d4fbdaad7ca657577012a1f675e89fd", "score": "0.5624834", "text": "function _safely_install_sigint_listener() {\n\n const listeners = process.listeners(SIGINT);\n const existingListeners = [];\n for (let i = 0, length = listeners.length; i < length; i++) {\n const lstnr = listeners[i];\n /* istanbul ignore else */\n if (lstnr.name === '_tmp$sigint_listener') {\n existingListeners.push(lstnr);\n process.removeListener(SIGINT, lstnr);\n }\n }\n process.on(SIGINT, function _tmp$sigint_listener(doExit) {\n for (let i = 0, length = existingListeners.length; i < length; i++) {\n // let the existing listener do the garbage collection (e.g. jest sandbox)\n try {\n existingListeners[i](false);\n } catch (err) {\n // ignore\n }\n }\n try {\n // force the garbage collector even it is called again in the exit listener\n _garbageCollector();\n } finally {\n if (!!doExit) {\n process.exit(0);\n }\n }\n });\n}", "title": "" }, { "docid": "c7ef32b616e9cf20675167e63148569e", "score": "0.5606312", "text": "function setupCleanPeerDisconnectHandler() {\n return process.on('SIGINT', () => {\n signale.pause('Received SIGINT. Cleaning up and exiting...')\n process.exit()\n })\n}", "title": "" }, { "docid": "fdc6bf5ca6889c1643cd7b9a0a3e88aa", "score": "0.5559568", "text": "function caller_signal_handler(signal) {\n\n if (signal.type === \"callee_arrived\") {\n log(\"caller_signal_handler:\" + $.localPeerConnection);\n $.localPeerConnection.createOffer(\n new_description_created,\n log_error\n );\n } else {\n\n }\n }", "title": "" }, { "docid": "9acb6e9535ab18afd7f319ebfb9f33e6", "score": "0.55321", "text": "function sigint() {\n\tcleanup( onCleanup( SIGINT ) );\n}", "title": "" }, { "docid": "e16ade085954b05d5c4e559929c8c423", "score": "0.55153424", "text": "setupIpc() {\n this.asyncEventName = this.getEventName('async');\n this.syncEventName = this.getEventName('sync');\n electron.ipcMain.on(this.asyncEventName, this.handleAsyncEvent.bind(this));\n electron.ipcMain.on(this.syncEventName, this.handleSyncEvent.bind(this));\n }", "title": "" }, { "docid": "d9496799e7268c908a49ebdaeb250ada", "score": "0.5502829", "text": "function handle(signal) {\n console.log(`Received ${signal}. Exiting...`);\n process.exit(1)\n }", "title": "" }, { "docid": "1b2e0f59bb388044c0f31b8825660eeb", "score": "0.5496688", "text": "handleSignal (signal) {\n const { path, member, body } = signal\n const iface = signal.interface\n if (iface === 'org.freedesktop.DBus.ObjectManager' &&\n member === 'InterfacesAdded') {\n this.interfacesAdded(...body.map(t => t.eval()))\n } else if (signal.interface === 'org.freedesktop.DBus.ObjectManager' &&\n signal.member === 'InterfacesRemoved') {\n this.interfacesRemoved(...body.map(t => t.eval()))\n } else if (signal.interface === 'org.freedesktop.DBus.Properties' &&\n signal.member === 'PropertiesChanged') {\n this.propertiesChanged(path, ...body.map(t => t.eval()))\n } else {\n console.log('unhandled signal', signal)\n }\n }", "title": "" }, { "docid": "f53d2ebde69f9cf5184768bc9572d44a", "score": "0.5443631", "text": "async callShutdownHook(signal) {\n const modulesContainer = this.container.getModules();\n for (const module of [...modulesContainer.values()].reverse()) {\n await hooks_1.callAppShutdownHook(module, signal);\n }\n }", "title": "" }, { "docid": "7a55ead35d313f4f10ef58814fd553ce", "score": "0.5411392", "text": "function onCpExit (code, signal) {\n asyncEmit(emitter, 'after', function (err) {\n if (err) {\n callback(err)\n } else if (code !== 0) {\n callback(new Error('`gyp_addon` failed with exit code: ' + code))\n } else if (process.platform == 'darwin' && gyp.opts.arch != 'ia32') {\n // XXX: Add a version check here when node upgrades gyp to a version that\n // fixes this\n remove_i386()\n } else {\n // we're done\n callback()\n }\n })\n }", "title": "" }, { "docid": "65ece21078b4e44927516e58921034f0", "score": "0.5342974", "text": "constructor() {\n super();\n throw new TypeError(\"AbortSignal cannot be constructed directly\");\n }", "title": "" }, { "docid": "65ece21078b4e44927516e58921034f0", "score": "0.5342974", "text": "constructor() {\n super();\n throw new TypeError(\"AbortSignal cannot be constructed directly\");\n }", "title": "" }, { "docid": "76bffee7cebdf36bea9a683a6efa8aba", "score": "0.5280949", "text": "function initExitHandlers() {\n // So that the server will not close instantly when Ctrl+C is pressed, etc.\n try {\n process.stdin.resume();\n } catch (err) {\n // This might happen if we're not running from a terminal or something\n //console.error(\"Error listening on stdin: \", err.stack);\n }\n\n // Catch app closing\n process.on(\"beforeExit\", runExitHandlers);\n\n // Catch exit signals (NOTE: Ctrl+C == SIGINT)\n process.on(\"SIGINT\", runExitHandlers.bind(this, \"caught SIGINT\"));\n process.on(\"SIGTERM\", runExitHandlers.bind(this, \"caught SIGTERM\"));\n process.on(\"SIGHUP\", runExitHandlers.bind(this, \"caught SIGHUP\"));\n\n // Catch uncaught exceptions\n process.on(\"uncaughtException\", function (err) {\n console.log(\"\");\n console.error(\"UNCAUGHT EXCEPTION: \", err.stack);\n runExitHandlers();\n });\n}", "title": "" }, { "docid": "6958cc4fb156f5e609b19a615c457cc2", "score": "0.5229856", "text": "_addServerEventHandlers () {}", "title": "" }, { "docid": "fffb76bf8315ceb8379691d438ac5512", "score": "0.5211382", "text": "function h$stg_sig_install(sigNo, actionCode, sigSet_d, sigSet_o) {\n // XXX dummy implementation\n return 0;\n}", "title": "" }, { "docid": "acd80a1b285bfe1e7e8ea45de0fa3818", "score": "0.5209338", "text": "function install() {\n net.Socket.prototype.abort = abort;\n}", "title": "" }, { "docid": "3706b0ddb0f72b5eafd637b1413da78b", "score": "0.51878226", "text": "async function signalTestHandlersReady() {\n const EXPECTED_ERROR =\n /No handler registered for message type 'test-handlers-ready'/;\n // Attempt to signal to the driver that we are ready to run tests, give up\n // after 10 tries and assume something went wrong so we don't spam the error\n // log too much.\n let attempts = 10;\n while (--attempts >= 0) {\n try {\n await parentMessagePipe.sendMessage('test-handlers-ready', {});\n return;\n } catch (/** @type {!GenericErrorResponse} */ e) {\n if (!EXPECTED_ERROR.test(e.message)) {\n console.error('Unexpected error in signalTestHandlersReady', e);\n return;\n }\n }\n }\n console.error('signalTestHandlersReady failed to signal.');\n}", "title": "" }, { "docid": "88da37a215d4908104c847602155a0d5", "score": "0.51852375", "text": "async _handleSignallingMessage(msg) {\n // when someone else sent the message, it is obviously of none interest to the connection between the peer and us\n if(msg.sender !== this._peer) return;\n const type = msg.type.toLowerCase();\n if(type === 'sdp'){\n await this._handleSdp(msg.data);\n }else if(type === 'ice'){\n await this._handleRemoteIceCandidate(msg.data);\n }else if(type === 'connection:close'){\n await this._handleClosingConnection();\n }else if(type === 'receiver:stop'){\n await this._stopReceiver(msg.data);\n }else if(type === 'track:meta'){\n this._changeMetaOfTrack(msg.data.mid, msg.data.meta);\n }else{\n if(this._verbose) this._logger.log('could not find handle for msg type',type,msg);\n }\n }", "title": "" }, { "docid": "038b29d1b82025199e8b3497220acf1c", "score": "0.5164897", "text": "function callee_signal_handler(signal) {\n if (signal.type === \"new_description\") {\n localPeerConnection.setRemoteDescription(\n new RTCSessionDescription($.parseJSON(decodeURIComponent(signal.message))),\n function () {\n if (localPeerConnection.remoteDescription.type == \"offer\") {\n localPeerConnection.createAnswer(new_description_created, log_error);\n }\n },\n log_error\n );\n }\n }", "title": "" }, { "docid": "29b123c09812dac3a8e71948e36f4a38", "score": "0.5149252", "text": "_onSignalFired(sender, args) {\n clearTimeout(this._timer);\n this._sender = sender;\n this._args = args;\n this._timer = window.setTimeout(() => {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }", "title": "" }, { "docid": "29b123c09812dac3a8e71948e36f4a38", "score": "0.5149252", "text": "_onSignalFired(sender, args) {\n clearTimeout(this._timer);\n this._sender = sender;\n this._args = args;\n this._timer = window.setTimeout(() => {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }", "title": "" }, { "docid": "3f020c9ff93a91bb05c1c7a945f2c4a2", "score": "0.5148831", "text": "function sighup() {\n\tcleanup( onCleanup( SIGHUP ) );\n}", "title": "" }, { "docid": "98fe80b8ae2c9b6116a8dc88022be100", "score": "0.5144411", "text": "function registerHandlers() {\n console.log(\"registerHandlers() started\");\n\t//mini.createDismissibleMessage(\"registerHandlers() started\");\n\n}", "title": "" }, { "docid": "a4f3f051c3d9628f67257bf7c6c38575", "score": "0.51285", "text": "_setupMessageHandlers() {\n this._dc.onopen = () => {\n if (this._isOnOpenCalled) {\n return;\n }\n\n logger.log('Data channel connection success');\n this.open = true;\n this._isOnOpenCalled = true;\n this.emit(dataConnection_DataConnection.EVENTS.open.key);\n };\n\n // We no longer need the reliable shim here\n this._dc.onmessage = msg => {\n this._handleDataMessage(msg);\n };\n\n this._dc.onclose = () => {\n logger.log('DataChannel closed for:', this.id);\n this.close();\n };\n\n this._dc.onerror = err => {\n logger.error(err);\n };\n }", "title": "" }, { "docid": "c063d2b0419071d2b8bc00ccb020aa6e", "score": "0.51259214", "text": "function sigterm() {\n\tcleanup( onCleanup( SIGTERM ) );\n}", "title": "" }, { "docid": "25c1c51107afaef4ff7e9afb160f6471", "score": "0.512482", "text": "function Signal() {\n /**\n * @type Array.<SignalBinding>\n * @private\n */\n this._bindings = [];\n this._prevParams = null;\n\n // enforce dispatch to aways work on same context (#47)\n var self = this;\n this.dispatch = function(){\n Signal.prototype.dispatch.apply(self, arguments);\n };\n }", "title": "" }, { "docid": "a37d3338ec4911a1e927b3d3b9c8dd00", "score": "0.50892454", "text": "function setupTerminationEvents() {\n process.removeAllListeners(\"uncaughtException\");\n process.on(\"uncaughtException\", (exception) => {\n if (_config.logJson) _log.fatal({ error: \"uncaughtException\", err: exception }, \"There was an error\")\n else _log.fatal(\"There was an error: uncaughtException\", exception);\n process.exit(1);\n });\n\n process.removeAllListeners(\"unhandledRejection\");\n process.on(\"unhandledRejection\", (reason) => { // second argument is the promise. for now, it adds no value to the error log, as the error has the same stack trace\n if (_config.logJson) _log.fatal({ error: \"unhandledRejection\", err: reason }, \"There was an error\")\n else _log.fatal(\"There was an error: unhandledRejection\", reason);\n process.exit(1);\n });\n\n process.removeAllListeners(\"multipleResolves\");\n if (_config.terminateOnMultipleResolves) { // not always desireable. look here: https://github.com/nodejs/node/issues/24321\n process.on(\"multipleResolves\", (type, promise, value) => {\n if (_config.logJson) _log.fatal({ error: \"multipleResolves\", type, promise, value }, \"There was an error\")\n else {\n _log.fatal(\"There was an error: multipleResolves\");\n _log.fatal(\"Promise: \", promise);\n _log.fatal(`Promise was ${type.length == 6 ? \"resolve\" : \"rejecte\"}d with value: ${JSON.stringify(value)}`);\n }\n process.exit(1);\n });\n }\n}", "title": "" }, { "docid": "d0bcd1968e89615e25d9a54f376623a9", "score": "0.50844795", "text": "handleSignalChannelMessage(snapshot) {\n const message = snapshot.val();\n const sender = message.sender;\n const type = message.type;\n\n console.log(type, message, sender);\n\n switch (type) {\n case 'offer':\n return this.handleOfferSignal.call(this, message);\n case 'answer':\n return this.handleAnswerSignal.call(this, message);\n case 'candidate':\n return this.isRunning && this.handleCandidateSignal.call(this, message);\n default:\n console.log('handleSignalChannelMessage', 'Unknown message type', type, message, sender);\n }\n }", "title": "" }, { "docid": "97084c43a4be632dc1091acc07ee1748", "score": "0.50395364", "text": "function caller_signal_handler(event) {\n var signal = JSON.parse(event.data);\n console.log('signal', signal);\n\n var peerConnection = getConnection(signal.id);\n console.log('caller_signal_handler signal.type : ' , signal.type, ' / conn.id : ', signal.id);\n\n if (signal.type === \"close\") {\n \n var id = signal.id;\n\n peerConnection.use = false;\n peerConnection.id = '';\n var remoteVideo = document.querySelector(\"[data-userid='\" + id + \"']\");\n if(remoteVideo != null){\n console.log(\"close remoteVideo.dataset.userid : \", remoteVideo.dataset.userid);\n console.log(\"close remoteVideo : \", remoteVideo.id);\n remoteVideo.dataset.userid = '';\n remoteVideo.src=''; //화면 초기화 방법, 다른방법이 있는지 찾아보자\n }\n }\n else if (signal.type === \"join\") {\n \n peerConnection.createOffer(\n function (description) {\n peerConnection.setLocalDescription(\n description,\n function () {\n console.log('new_description_created send');\n signaling_server.send(\n JSON.stringify({\n token: 'room',\n type: 'new_description',\n reqType: 'request',\n from: userId,\n to: signal.id,\n sdp: description\n })\n );\n },\n handleError\n );\n },\n handleError\n );\n } else if (signal.type === \"new_ice_candidate\") {\n peerConnection.addIceCandidate(\n new RTCIceCandidate(signal.candidate)\n );\n } else if (signal.type === \"new_description\") {\n if(signal.reqType == 'request'){\n peerConnection.setRemoteDescription(\n new RTCSessionDescription(signal.sdp),\n function () {\n peerConnection.createAnswer(function (description) {\n peerConnection.setLocalDescription(\n description,\n function () {\n console.log('new_description_created send');\n signaling_server.send(\n JSON.stringify({\n token: 'room',\n type: 'new_description',\n reqType: 'response',\n from: userId,\n to: signal.id,\n sdp: description\n })\n );\n },\n handleError\n );\n }, handleError);\n },\n handleError\n );\n }\n else if (signal.reqType == 'response'){\n peerConnection.setRemoteDescription(\n new RTCSessionDescription(signal.sdp),\n function () {\n console.log('peerConnection.remoteDescription.type == \"answer\"'); \n },\n handleError\n );\n }\n }\n}", "title": "" }, { "docid": "81ea78cdc51b5a6616c082318147b720", "score": "0.50377333", "text": "function setupTerminationEvents() {\n process.removeAllListeners(\"uncaughtException\");\n process.on(\"uncaughtException\", (exception) => {\n if (_config.logJson) _log.fatal(\"There was an error\", { error: \"uncaughtException\", exception } )\n else _log.fatal(\"There was an error: uncaughtException\", exception);\n process.exit(1);\n });\n\n process.removeAllListeners(\"unhandledRejection\");\n process.on(\"unhandledRejection\", (reason) => { // second argument is the promise. for now, it adds no value to the error log\n if (_config.logJson) _log.fatal(\"There was an error\", { error: \"unhandledRejection\", reason } )\n else _log.fatal(\"There was an error: unhandledRejection\", reason);\n process.exit(1);\n });\n\n process.removeAllListeners(\"multipleResolves\");\n if (_config.terminateOnMultipleResolves) { // not always desireable. look here: https://github.com/nodejs/node/issues/24321\n process.on(\"multipleResolves\", (type, promise, value) => {\n if (_config.logJson) _log.fatal(\"There was an error\", { error: \"multipleResolves\", type, promise, value })\n else {\n _log.fatal(\"There was an error: multipleResolves\");\n _log.fatal(\"Promise:\", promise);\n _log.fatal(`Promise was ${type.length == 6 ? \"resolve\" : \"rejecte\"}d with value: ${JSON.stringify(value)}`);\n }\n process.exit(1);\n });\n }\n}", "title": "" }, { "docid": "8cc8db98848619f7563e09d7d4d72983", "score": "0.50317115", "text": "sendSignal(type, id, signal) {\n\t\tthrow \"You cannot use this superclass directly\";\n\t}", "title": "" }, { "docid": "9186ce26dab35999d24360dbf37f4cd4", "score": "0.5027244", "text": "_onSignalFired(sender, args) {\n clearTimeout(this._timer);\n this._sender = sender;\n this._args = args;\n this._timer = setTimeout(() => {\n this._activityStopped.emit({\n sender: this._sender,\n args: this._args\n });\n }, this._timeout);\n }", "title": "" }, { "docid": "2ccd6572641508fd475f787bc5714a16", "score": "0.50047076", "text": "addSignal(state, payload) {\n state.signals[payload.signalId] = payload.signalDetails\n\n state.latestSignalChange.signalId = payload.signalId\n state.latestSignalChange.type = 'add'\n }", "title": "" }, { "docid": "0a9ed2d6abf3da8fe1cd378f247bbddf", "score": "0.49906623", "text": "handleMsg(data) {\n const msg = util.parseRequest(data);\n switch (msg.type) {\n case 'SIGREQ':\n this.verifyProposedRoot(msg.data, (err, sig) => {\n if (err) { logger.log('warn', `Error with SIGREQ: ${err}`); }\n else {\n this.addPeersFromMsg(msg);\n msg.data.sig = sig;\n this.broadcastMsg({ type: 'SIGPASS', data: msg.data, peers: Object.keys(this.peers) }, msg.peers);\n }\n });\n break;\n case 'SIGPASS':\n let client;\n // This header root can potentially be proposed to any chain that is not\n // the one it originates from. Check if the signature was made by someone\n // who is a validator on each chain.\n this.addrs.forEach((addr, i) => {\n if (addr != msg.data.chain) {\n client = this.clients[i];\n const chain = msg.data.chain;\n // Check if this is a validator on the desired chain. If so, save\n // the signature\n bridges.checkSig(msg.data.root, msg.data.sig, addr, client, (err, signer) => {\n if (signer) {\n if (!this.sigs[addr]) { this.sigs[addr] = {}; }\n if (!this.sigs[addr][chain]) { this.sigs[addr][chain] = {}; }\n if (!this.sigs[addr][chain][signer]) { this.sigs[addr][chain][signer] = {}; }\n this.sigs[addr][msg.data.chain][signer] = msg.data;\n this.tryPropose();\n }\n })\n }\n })\n break;\n case 'PING':\n this.addPeersFromMsg(msg);\n case 'REJECT':\n console.log('reject msg', msg);\n default:\n break;\n }\n }", "title": "" }, { "docid": "645acbe5b426edffe23d106619e20699", "score": "0.49808756", "text": "async wait()\n {\n await this._signal.signal.wait();\n }", "title": "" }, { "docid": "6d62bc99ab79756e269a0aa0bfbed075", "score": "0.49808505", "text": "constructor(socket) {\n super();\n this.socket = socket;\n this.responseHandlers = {};\n socket.on(common_1.EventTypes.RESPONSE, (data) => {\n const requestHandler = this.responseHandlers[data.requestId];\n requestHandler === null || requestHandler === void 0 ? void 0 : requestHandler.resolve(data.response);\n delete this.responseHandlers[data.requestId];\n });\n }", "title": "" }, { "docid": "ef3755a7e01341d189a6c5ded5ca87e9", "score": "0.49713597", "text": "function handleSignal(/**@type {WebSocket} */ws, /**@type {string} */id) {\n\n if (!clientMap.has(id)) {\n clientMap.set(id, new Set())\n }\n\n clientMap.get(id).add(ws)\n\n ws.on(\"close\", () => {\n if (clientMap.has(id)) {\n clientMap.get(id).delete(ws)\n clientMap.get(id).size == 0 && clientMap.delete(id)\n }\n })\n\n ws.on(\"message\", function (event) {\n try {\n let [targetId, message] = JSON.parse(event + \"\")\n\n for (let sock of clientMap.get(targetId) || []) {\n if (sock != ws) {\n sock.send(JSON.stringify([id, message]))\n }\n }\n console.log(id, \"::: -> \", targetId)\n } catch (error) { \n console.error(error)\n }\n })\n}", "title": "" }, { "docid": "622235b80d926e042382a4ea7808c2e2", "score": "0.4958386", "text": "constructor(options) {\n this._activateRequested = new signaling_1.Signal(this);\n this._isDisposed = false;\n this._registry = options.registry;\n }", "title": "" }, { "docid": "cc1931caed8eee153cd8cfa5c65f685d", "score": "0.4957205", "text": "_killingMeSoftly() {\n if (this._options.heartbeatPeriod) {\n this._emitHeartBeat({ message: 'SIGTERM/SIGINT received' }, 'stopping')\n }\n\n this._dying('diying on SIGTERM or SIGINT...')\n }", "title": "" }, { "docid": "829c4080bdabf495ab3a1179b57cd460", "score": "0.4951921", "text": "function startSignal(host, _, first) {\n\tif (host.local || host.status <= STATUS_NOT_REACHABLE || (!first && host.status <= STATUS_FOREIGN)) return;\n\ttracer && tracer(\"Host with start signal \" + util.format(_minifyHost(host)));\n\tvar challenge;\n\tvar extra; // will be not empty for first invocation - either containing certificate information or being empty object\n\t// for subsequent i\n\t// include certificate information\n\tif (first) {\n\t\tif (ownCertificate) {\n\t\t\tvar time = databaseTime.getReducedTime(_);\n\t\t\tvar ownChallenge = host.hostname + \" \" + time;\n\t\t\tchallenge = helpers.uuid.generate();\n\t\t\thost.challenge = challenge;\n\t\t\tvar signature = _signText(ownChallenge);\n\t\t\textra = {\n\t\t\t\ttime: time,\n\t\t\t\tsign: signature,\n\t\t\t\tchallenge: challenge,\n\t\t\t\tcert: ownCertificate.certificate,\n\t\t\t\tdh: diffieHellman.getPublicKey('base64')\n\t\t\t};\n\t\t\t// encrypt it\n\t\t\textra = _securePack(JSON.stringify(extra));\n\t\t\t_markTrusted(host, false); // mark host as untrusted first\n\t\t} else {\n\t\t\t// when own host is not trusted, do not mark other hosts as untrusted\n\t\t\thost.certificate = host.dhKey = undefined;\n\t\t\textra = {};\n\t\t}\n\t}\n\tvar data = get(host, \"POST\", \"/nannyCommand/started\", JSON.stringify(_minifyHost(localHost, extra)), _);\n\ttracer && tracer(\"Start signal sent \" + data);\n\t// check versions\n\tvar infos = JSON.parse(data);\n\t// console.log(\"INFOS \"+data)\n\t_copyFluentData(host, infos);\n\tif (host.status < STATUS_INIT) {\n\t\t_markTrusted(host, true); // when host cannot be used, mark it as trustworthy\n\t}\n\tif (!hosts.mainVersion) {\n\t\thosts.mainVersion = infos.extra;\n\t\tcheckVersions(_);\n\t}\n}", "title": "" }, { "docid": "38232210d43b806bea56e1cf620ec0ab", "score": "0.4950407", "text": "function registerProcessEvents() {\n process.on('uncaughtException', (error) => {\n logger_1.logger.error('UncaughtException', error);\n });\n process.on('unhandledRejection', (reason, promise) => {\n logger_1.logger.info(reason, promise);\n });\n process.on('SIGTERM', async () => {\n logger_1.logger.info('Starting graceful shutdown');\n });\n}", "title": "" }, { "docid": "ef45420f5797251337f6be53009d8805", "score": "0.49481958", "text": "wake()\n {\n this._signal.abort();\n this._signal = new AbortController();\n }", "title": "" }, { "docid": "ca240d77fd7de238ae91d4dcd5df9d50", "score": "0.4935686", "text": "kill(callback, signal = 'SIGINT') {\n if (this._closing) return;\n this._closing = true;\n let done = 0;\n \n this.invoke('beforeDestroy', signal)\n .then(() => callback())\n .then(() => this.invoke('destroyed', signal))\n .then(() => done = 1)\n .catch(e => {\n this.logger.error(e);\n done = -1;\n return Promise.resolve();\n });\n \n const timer = setInterval(() => {\n switch (done) {\n case -1:\n clearInterval(timer);\n return process.exit(1);\n case 1:\n clearInterval(timer);\n return process.exit(0);\n }\n }, 5);\n }", "title": "" }, { "docid": "1f3ed0c587a67a4cdcf77b6245a3c423", "score": "0.49351692", "text": "wireChannel(channel) {\n channel.onConnection((clientIdentity, payload) => {\n if (!this.isConnectionAuthorized(clientIdentity, payload)) {\n throw new Error(`Connection not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);\n }\n if (!clientIdentity.endpointId) {\n throw new Error('Version too old to be compatible with Interop. Please upgrade your runtime to a more recent version.');\n }\n const clientSubscriptionState = {\n contextGroupId: undefined,\n contextHandlers: new Map(),\n clientIdentity\n };\n // Only allow the client to join a contextGroup that actually exists.\n if ((payload === null || payload === void 0 ? void 0 : payload.currentContextGroup) && this.contextGroupsById.has(payload.currentContextGroup)) {\n clientSubscriptionState.contextGroupId = payload === null || payload === void 0 ? void 0 : payload.currentContextGroup;\n }\n this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);\n });\n channel.onDisconnection((clientIdentity) => {\n this.interopClients.delete(clientIdentity.endpointId);\n const targetInfo = this.intentClientMap.get(clientIdentity.name);\n if (targetInfo && clientIdentity.uuid === fin.me.identity.uuid) {\n targetInfo.forEach((handler) => {\n handler.isReady = false;\n });\n }\n });\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n channel.beforeAction((action, payload, clientIdentity) => {\n if (!this.isActionAuthorized(action, payload, clientIdentity)) {\n throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);\n }\n console.log(action, payload, clientIdentity);\n });\n channel.afterAction(console.log);\n // Client functions\n channel.register('setContext', this.setContext.bind(this));\n channel.register('fireIntent', this.handleFiredIntent.bind(this));\n // Platform window functions\n channel.register('getContextGroups', this.getContextGroups.bind(this));\n channel.register('joinContextGroup', this.joinContextGroup.bind(this));\n channel.register('removeFromContextGroup', this.removeFromContextGroup.bind(this));\n channel.register('getAllClientsInContextGroup', this.getAllClientsInContextGroup.bind(this));\n channel.register('getInfoForContextGroup', this.getInfoForContextGroup.bind(this));\n // Internal methods\n channel.register('contextHandlerRegistered', this.contextHandlerRegistered.bind(this));\n channel.register('intentHandlerRegistered', this.intentHandlerRegistered.bind(this));\n channel.register('removeContextHandler', this.removeContextHandler.bind(this));\n }", "title": "" }, { "docid": "5dd5b8e39441e258f7fd76fc1c22eb16", "score": "0.49033812", "text": "function doSignal(){\n console.log('doSignal()');\n sig = new $xirsys.signal( apiURL, userName, {channel:channelPath +'/'+ currentRoom} );\n sig.on('message', msg => {\n var pkt = JSON.parse(msg.data);\n console.log('signal message! ',pkt);\n var payload = pkt.p;//the actual message data sent \n var meta = pkt.m;//meta object\n var msgEvent = meta.o;//event label of message\n var toPeer = meta.t;//msg to user (if private msg)\n var fromPeer = meta.f;//msg from user\n if(!!fromPeer) {//remove the peer path to display just the name not path.\n var p = fromPeer.split(\"/\");\n fromPeer = p[p.length - 1];\n }\n switch (msgEvent) {\n //first connect, list of all peers connected.\n case \"peers\":\n //this is first call when you connect, \n // so we can check for channelPath here dynamically.\n var sysNum = meta.f.lastIndexOf('__sys__');//system message\n if(sysNum > -1 && !channelPath){\n channelPath = meta.f.substring(0,sysNum);//save message path for sending.\n }\n setUsers(payload.users);\n onUserMsg({msg:'You just joined <b>'+currentRoom+'</b>'}, {sys:true});\n $('#roomView #ddMenu #labelText').html(currentRoom + '<span class=\"caret\"></span>');\n if( state == 'setup') initUI();\n break;\n //new peer connected\n case \"peer_connected\":\n addUser(fromPeer);\n onUserMsg({msg:'User <b>'+fromPeer+'</b> joined room!'}, {sys:true});\n break;\n //peer left.\n case \"peer_removed\":\n removeUser(fromPeer);\n onUserMsg({msg:'User <b>'+fromPeer+'</b> left room!'}, {sys:true});\n break;\n //message received. Call to display.\n case 'message':\n onUserMsg(payload, fromPeer, toPeer);\n break;\n //if a room is created, update rooms list.\n case \"room_updated\":\n kvData.getKeys();\n onUserMsg(payload, fromPeer);\n break;\n }\n });\n}", "title": "" }, { "docid": "db69336b8bfa19d2077ecb607bceba5d", "score": "0.48973855", "text": "setupHandlers() {\n this.onConnectToSignaller = (id) => {\n console.log('Connection to signaller establised.');\n console.log(`Assigning id: ${id}`);\n if (typeof roomIdButton !== 'undefined') {\n roomIdButton.disabled = false;\n }\n //document.getElementById('selfId').innerText = 'ID: \"' + id + '\"';\n }\n // Handels if the host or peer is disconnected from the signaling server.\n this.onDisconnectFromSignaller = () => {\n console.log('Disconnected from signaller.');\n if (signallerButton) {\n signallerButton.innerText = `✘ DISCONNECTED FROM SIGNALLER. RECONNECT?`;\n signallerButton.disabled = false;\n roomIdButton.disabled = true;\n }\n }\n // Handels when a peer recives a call from the host.\n this.onCall = (call) => {\n call.answer();\n call.on('stream', (remoteStream) => {\n streamElement.srcObject = remoteStream\n });\n }\n // Handels when the host recives a connection.\n this.onConnection = (connection) => {\n connection.on('open', () => { this.onPeerConnected(connection) });\n\n connection.on('data', (data) => { this.onData(data, connection) });\n\n connection.on('disconnected', () => { this.onPeerDisconnected(connection); });\n\n connection.on('close', () => { this.onPeerDisconnected(connection) });\n }\n // Handles when a peer connects to the host.\n this.onPeerConnected = (connection) => {\n //console.log(`Connection to ${connection.peer} established.`);\n\n this.clientConnections = this.clientConnections.set(\n connection.peer,\n connection,\n );\n\n const data = {\n type: 'user-joined',\n username: connection.label,\n icon: connection.metadata,\n peer: this.peerId,\n id: connection.peer\n };\n // send host icon and username\n const hostData = {\n type: 'connected-user',\n username: this.username,\n icon: this.iconUrl,\n peer: this.peerId\n }\n connection.send(hostData);\n // Send connected users icons and usernames to peerlist\n this.clientConnections.forEach(connectedPeer => {\n let _data = {\n type: 'connected-user',\n username: connectedPeer.label,\n icon: connectedPeer.metadata,\n peer: this.peerId,\n id: connectedPeer.id\n }\n if (connection.peer != connectedPeer.peer)\n connection.send(_data);\n });\n\n this.updatePeerList();\n this.handleData(data, connection);\n this.broadcast({\n ...data,\n ...connection.peer,\n peers: this.updatePeerList(),\n });\n this.onRoomStateChanged();\n if (this.peerType == 'host') {\n if (this.stream) {\n this.broadcast_stream(connection.peer);\n }\n }\n }\n // Handels when a peer disconnects from the host.\n this.onPeerDisconnected = (connection) => {\n console.log(`Connection to ${connection.peer} is closed.`);\n this.clientConnections = this.clientConnections.delete(connection.peer.toString());\n\n const data = {\n type: 'user-left',\n peer: this.peerId,\n id: connection.peer,\n username: connection.label\n };\n\n this.updatePeerList();\n this.handleData(data, connection);\n\n this.broadcast({\n ...data,\n peers: this.updatePeerList(),\n });\n }\n // Handels when the host receives data.\n this.onData = (data, connection) => {\n data.peer = connection.peer;\n data.username = connection.label;\n this.handleData(data, connection);\n this.broadcast({\n ...data,\n ...connection.peer,\n peers: this.updatePeerList(),\n });\n }\n // Handels when ever the peer or host gets a error.\n this.onError = (error) => {\n console.log(error);\n updateMessageBoard(this.hostId, \"SYSTEM\", error);\n }\n // Helper handlers\n // Boardcasts a stream to either 1 or all connected peers depending on wether peerId is set.\n this.broadcast_stream = (peerID) => {\n console.log(\"peerid\", peerID);\n if (peerID) {\n console.log(peerID);\n this.call(peerID, this.stream);\n } else {\n this.clientConnections.forEach((connection) => {\n console.log(connection.peer);\n this.call(connection.peer, this.stream)\n });\n }\n }\n // Boardcasts data to all the connected peers.\n this.broadcast = (data) => {\n this.clientConnections.forEach((connection) =>\n connection.send(data)\n );\n }\n // Handels the way data is visualized from both the peers and the host.\n this.handleData = (data) => {\n if (!data) { } else if (data.type == \"message\") {\n updateMessageBoard(data.peer, data.username, data.message);\n } else if (data.type == \"user-joined\") {\n updateMessageBoard(data.peer, \"SYSTEM\", `${data.username} joined.`);\n addPeer(data.id, data.username, data.icon)\n } else if (data.type == \"user-left\") {\n updateMessageBoard(data.peer, \"SYSTEM\", `${data.username} left.`);\n removePeer(data.id)\n } else if (data.type == \"room-state-changed\" && data.peer == this.hostConnection.peer) {\n roomName.innerHTML = data.room.name;\n } else if (data.type == \"connected-user\" && data.peer == this.hostConnection.peer) {\n addPeer(data.id, data.username, data.icon)\n }\n }\n this.onRoomStateChanged = () => {\n var room = {\n room: {\n name: roomName.innerHTML\n },\n type: 'room-state-changed',\n peer: this.peerId\n }\n this.broadcast(room)\n }\n }", "title": "" }, { "docid": "c49251cde61a27a94b5ef3bd03fe671e", "score": "0.4894539", "text": "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "title": "" }, { "docid": "c49251cde61a27a94b5ef3bd03fe671e", "score": "0.4894539", "text": "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "title": "" }, { "docid": "33cb58ab13e2a14d9c3b7b45112a61cc", "score": "0.48899361", "text": "function hangUp() {\n pc = signalingService.hangup(pc, remoteStream, remoteVideoR);\n resetChannelState();\n }", "title": "" }, { "docid": "a07bf0679ec7fcb729622eb258ac7b6f", "score": "0.48862118", "text": "addPeerSigChannel(chan) {\n\t\tchan.on(null, null, this.handleSignal);\n\t\tthis.sigchannels[chan.id] = chan;\n\t}", "title": "" }, { "docid": "9b41b3c8db6d42dcabd5ee3134f2c774", "score": "0.4881227", "text": "function onSIGINT() {\n\t\tconsole.error( '' ); // eslint-disable-line no-console\n\t\tcli.close( 1 );\n\t}", "title": "" }, { "docid": "49383fff1533f53969530312d7a046d1", "score": "0.48695332", "text": "setupPeer() {\n this.on('open', (id) => { this.onConnectToSignaller(id) });\n\n this.on('connection', (connection) => { this.onConnection(connection) });\n\n this.on('call', (call) => { this.onCall(call) });\n\n this.on('disconnected', () => { this.onDisconnectFromSignaller() });\n\n this.on('error', (error) => {\n console.log(error);\n window.Perror = error;\n updateMessageBoard(this.hostId, \"SYSTEM\", error);\n });\n }", "title": "" }, { "docid": "199593ee87e4eb722eeb10022213f626", "score": "0.48687068", "text": "handleNotification(evt) {\n return __awaiter(this, void 0, void 0, function* () {\n // Always send errors up, no matter where they're from.\n if (evt.params.error) {\n yield this.notify(this.errorSubscriptions, evt.params.error);\n }\n switch (evt.event) {\n case \"daemon.connected\":\n yield this.notify(this.daemonConnectedSubscriptions, evt.params);\n break;\n case \"app.start\":\n yield this.notify(this.appStartSubscriptions, evt.params);\n break;\n case \"app.debugPort\":\n yield this.notify(this.appDebugPortSubscriptions, evt.params);\n break;\n case \"app.started\":\n yield this.notify(this.appStartedSubscriptions, evt.params);\n break;\n case \"app.webLaunchUrl\":\n yield this.notify(this.appWebLaunchUrlSubscriptions, evt.params);\n break;\n case \"app.stop\":\n yield this.notify(this.appStopSubscriptions, evt.params);\n break;\n case \"app.progress\":\n yield this.notify(this.appProgressSubscriptions, evt.params);\n break;\n case \"app.log\":\n yield this.notify(this.appLogSubscriptions, evt.params);\n break;\n case \"daemon.logMessage\":\n yield this.notify(this.daemonLogMessageSubscriptions, evt.params);\n break;\n case \"daemon.log\":\n yield this.notify(this.daemonLogSubscriptions, evt.params);\n break;\n }\n });\n }", "title": "" }, { "docid": "80662a8c8bce052edea283be11288310", "score": "0.48587412", "text": "function onExit (code, signal) {\n\t if (code !== 0) {\n\t return callback(new Error('`' + command + '` failed with exit code: ' + code))\n\t }\n\t if (signal) {\n\t return callback(new Error('`' + command + '` got signal: ' + signal))\n\t }\n\t callback()\n\t }", "title": "" }, { "docid": "7be19b1f6fc32d107085974fbbca50bf", "score": "0.48492765", "text": "notify(type, arg) {\n try {\n this.#rpc.notify(type, arg);\n } catch (e) {\n // this only happens if the RPC library is hitting some issues - probably redundant\n }\n }", "title": "" }, { "docid": "dd8ce400115fae8635e37fede1c0c0b1", "score": "0.4847628", "text": "function terminator (sig) {\n\tif (typeof sig === 'string') {\n\t\tconsole.log(`\\n${Date(Date.now())}: Received signal ${sig} - terminating app...\\n`);\n\t\tif (cluster.isMaster && !clusterStop) {\n\t\t\tcluster.fork();\n\t\t} else {\n\t\t\tprocess.exit(0);\n\t\t\tif (!cluster.isMaster) { console.log(`${Date(Date.now())}: Node server stopped`); }\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cc6553f0787dba65f90335f2b612321c", "score": "0.48442122", "text": "function Signal(sender) {\n this.sender = sender;\n }", "title": "" }, { "docid": "6268b2a3c8f3c4c1c0bc67cc057ad713", "score": "0.48440728", "text": "setupIPC() {\n\t\tipcMain.on('sea.subscribe', this.onIPCSubscribe.bind(this));\n\t\tipcMain.on('sea.unSubscribe', this.onIPCUnsubscribe.bind(this));\n\t\tipcMain.on('sea.publish', this.onIPCPublish.bind(this));\n\t}", "title": "" }, { "docid": "6a4f20690eeab7686aaf15215cb14faf", "score": "0.4834049", "text": "function Signal(sender) {\r\n this.sender = sender;\r\n }", "title": "" }, { "docid": "6a4f20690eeab7686aaf15215cb14faf", "score": "0.4834049", "text": "function Signal(sender) {\r\n this.sender = sender;\r\n }", "title": "" }, { "docid": "6a4f20690eeab7686aaf15215cb14faf", "score": "0.4834049", "text": "function Signal(sender) {\r\n this.sender = sender;\r\n }", "title": "" }, { "docid": "1ee17043c668596c5671809b93c5052a", "score": "0.4833132", "text": "registerAsyncMessagesHandlers(){\n //here is the endpoint where the searchs to 3er party services is done\n ipcMain.on('search-word', (event, arg) => {\n /*this type cast is not actually necesary, just do it for clarification sake */\n let capsulatedSearch=new SearchCapsule(JSON.parse(arg))\n //TranslateService inv multiplex between many translate services apis\n TranslateService.translateIMUX(capsulatedSearch).then((translateResultJSON)=>{\n let wordCapsulated= new WordCapsule({word:capsulatedSearch.word.toUpperCase()})\n WordList.loadFromFile().then(()=>{\n //we lazy check that the request has not failed,and the word is not already present in the list\n if((!TranslateService.hasFailedIMUX())&&(!WordList.findWord(wordCapsulated.word))){\n WordList.insertWord(wordCapsulated)\n }\n WordList.writeToFile()\n })\n event.sender.send('search-word-reply', translateResultJSON) \n })\n }) \n \n ipcMain.on('last-searches', (event, arg) => {\n WordList.loadFromFile().then(()=>{\n event.sender.send('last-searches-reply', JSON.stringify(WordList.lastSearches())) \n }) \n }) \n }", "title": "" }, { "docid": "b23d123e80e858b1d303f578c7f67ab9", "score": "0.48131925", "text": "function signalGracefulHalt() {\n if (isCircleciBuild()) {\n const loggingPrefix = getLoggingPrefix();\n const sentinelFile = `/tmp/workspace/.CI_GRACEFULLY_HALT_${circleciBuildNumber()}`;\n fs.closeSync(fs.openSync(sentinelFile, 'w'));\n logWithoutTimestamp(\n `${loggingPrefix} Created ${cyan(sentinelFile)} to signal graceful halt.`\n );\n }\n}", "title": "" }, { "docid": "9ef32d11e1696e7c893d4d10e9679653", "score": "0.48010203", "text": "function postSetup() {\n socket.removeAllListeners('error')\n .removeAllListeners('close')\n .removeAllListeners('end')\n .removeAllListeners('timeout');\n\n // Work around lack of close event on tls.socket in node < 0.11\n ((socket.socket) ? socket.socket : socket).once('close',\n self._onClose.bind(self));\n socket.on('end', function onEnd() {\n if (log.trace())\n log.trace('end event');\n\n self.emit('end');\n socket.end();\n });\n socket.on('error', function onSocketError(err) {\n if (log.trace())\n log.trace({err: err}, 'error event: %s', new Error().stack);\n\n self.emit('error', err);\n socket.destroy();\n });\n socket.on('timeout', function onTimeout() {\n if (log.trace())\n log.trace('timeout event');\n\n self.emit('socketTimeout');\n socket.end();\n });\n }", "title": "" }, { "docid": "807d199578948092958be9a1ce12c28e", "score": "0.4795657", "text": "_setupMessageHandlers() {\n config.MESSAGE_TYPES.SERVER.enums.forEach(type => {\n if (type.key === config.MESSAGE_TYPES.SERVER.OPEN.key) {\n this._io.on(type.key, openMessage => {\n if (!openMessage || !openMessage.peerId) {\n return;\n }\n if (!this._isPeerIdSet) {\n // set peerId for when reconnecting to the server\n this._io.io.opts.query += `&peerId=${openMessage.peerId}`;\n this._isPeerIdSet = true;\n }\n this._reconnectAttempts = 0;\n\n this._startPings();\n this._sendQueuedMessages();\n\n if (!this._isOpen) {\n this._isOpen = true;\n\n // To inform the peer that the socket successfully connected\n this.emit(type.key, openMessage);\n }\n });\n } else {\n this._io.on(type.key, message => {\n this.emit(type.key, message);\n });\n }\n });\n }", "title": "" }, { "docid": "3be10e82aabea047408853bdffa515ad", "score": "0.47841522", "text": "function abortSignal(signal) {\n if (abortedFlags.get(signal) !== false) {\n return;\n }\n abortedFlags.set(signal, true);\n signal.dispatchEvent({ type: \"abort\" });\n}", "title": "" }, { "docid": "3be10e82aabea047408853bdffa515ad", "score": "0.47841522", "text": "function abortSignal(signal) {\n if (abortedFlags.get(signal) !== false) {\n return;\n }\n abortedFlags.set(signal, true);\n signal.dispatchEvent({ type: \"abort\" });\n}", "title": "" }, { "docid": "2712545804dbdf0673ce69b0d28c02ef", "score": "0.47815016", "text": "setup(handler) {\n if (!navigator.requestMIDIAccess) {\n handler('This browser does not support WebMIDI');\n return;\n }\n\n navigator.requestMIDIAccess({\n sysex: true,\n software: false\n\n }).then((access) => {\n this.system = access;\n\n // Subscribe to device connect/disconnect events.\n this.system.onstatechange = () => {\n this.notifiers.state.forEach((notifier) => {\n notifier(event);\n })\n };\n handler();\n\n }, () => {\n handler('Unable to access MIDI devices');\n });\n }", "title": "" }, { "docid": "885d88b87b85fdcbf74011760a42c598", "score": "0.4776961", "text": "syncCall () {\n return (process, signal, event) => {\n process.on(signal, event)\n return process\n }\n }", "title": "" }, { "docid": "2f11afc55c8dbe012f43a96737ab4f9f", "score": "0.4761586", "text": "graceful () {\n // do something when app is closing\n process.on('exit', () => {\n this.close();\n process.exit();\n });\n\n // catches ctrl+c event\n process.on('SIGINT', () => {\n this.close();\n process.exit();\n });\n process.on('SIGTERM', () => {\n this.close();\n process.exit();\n });\n }", "title": "" }, { "docid": "795f4481a63d8cb85e05757637f63b8e", "score": "0.4759197", "text": "install_on_server(server, default_handler) {\n return server.on('request', (req, res) => {\n if (req.url.startsWith(RpcHttpConnection.BASE_PATH)) return this.handle_request(req, res);\n if (default_handler) return default_handler(req, res);\n dbg.warn('unrecognized http request (responding 404)', req.method, req.url, req.headers);\n res.statusCode = 404;\n res.end();\n });\n }", "title": "" }, { "docid": "9eb1a014d12511abdb931ba3ffc77080", "score": "0.4759159", "text": "signalFatalException(error) {\n throw e;\n }", "title": "" }, { "docid": "553e8bcd8526960ba83ac5857c4550d3", "score": "0.4758637", "text": "function signal (ev_name, fn) {\n return function (e) {\n var val = fn ? fn.bind(this)(e) : e;\n setTimeout(function () {\n mainloop(appState, ev_name, val);\n }, 0);\n };\n }", "title": "" }, { "docid": "aa594152131a69f726d65e9ddeb38d3f", "score": "0.47581428", "text": "bindGateway() {\n return new Promise((resolve) => {\n // Socket Communication Request\n this.externalInterfaces.apiGateway.on(\n 'COM_REQUEST',\n (clientSocket, data) => {\n // Confirm Connection\n this.log(\n `[${this.conId}] Service core connection request recieved`,\n 'log'\n );\n // Execute handlers\n if (\n Object.prototype.hasOwnProperty.call(\n this.eventHandlers,\n 'onConRequest'\n )\n ) {\n this.eventHandlers.onConRequest(data);\n }\n // Process Communication Request\n if (data) {\n this.processComRequest(data, clientSocket, this.conId);\n } else {\n this.processComError(data, clientSocket, this.conId);\n }\n // Process Connection\n this.log(`[${this.conId}] Service core connection request processed`);\n // Increment\n this.conId += 1;\n }\n );\n\n // Socket Communication Close\n this.externalInterfaces.apiGateway.on('COM_CLOSE', (clientSocket) => {\n // Connection Close Requested\n this.log(`[${this.conId}] Service core connection close requested`);\n // Execute handlers\n if (\n Object.prototype.hasOwnProperty.call(this.eventHandlers, 'onConClose')\n ) {\n this.eventHandlers.onConClose();\n }\n // Destroy Socket (Close Connection)\n clientSocket.conn.destroy();\n // Connection Closed\n this.log(`[${this.conId}] Service core connection successfully closed`);\n // Increment\n this.conId += 1;\n });\n\n // Socket Communication Kill Process\n this.externalInterfaces.apiGateway.on('KILL', () => {\n process.exit();\n });\n\n // Resolve promise\n return resolve();\n });\n }", "title": "" }, { "docid": "808c381fbdf1f38a4c577054c2748d9b", "score": "0.47580242", "text": "function main() {\n var server = new grpc.Server();\n server.addService(data_handler_proto.TraceService.service, {Export: Export});\n server.bindAsync('0.0.0.0:55671', grpc.ServerCredentials.createInsecure(), () => {\n server.start();\n });\n http.createServer(app).listen(8080, \"0.0.0.0\");\n}", "title": "" }, { "docid": "f20ae0b70ce364bd21e3ea594d71345c", "score": "0.47547737", "text": "function signalStateChange(event, data) {\n switch (event) {\n case \"RtcDisconnectEvent\":\n document.dispatchEvent(new Event(\"RtcDisconnectEvent\"));\n break;\n case \"RtcConnectedEvent\":\n document.dispatchEvent(new Event(\"RtcConnectedEvent\"));\n break;\n case \"RtcClosedEvent\":\n document.dispatchEvent(new Event(\"RtcClosedEvent\"));\n break;\n case \"RtcInitiatedEvent\":\n document.dispatchEvent(new Event(\"RtcInitiatedEvent\"));\n break;\n case \"SocketConnectedEvent\":\n document.dispatchEvent(new Event(\"SocketConnectedEvent\"));\n break;\n case \"confirmationFailedEvent\":\n document.dispatchEvent(new Event(\"confirmationFailedEvent\"));\n break;\n case \"RtcSignalEvent\":\n document.dispatchEvent(new Event(\"RtcSignalEvent\"));\n break;\n case \"RtcMessageEvent\":\n document.dispatchEvent(new CustomEvent(\"RtcMessageEvent\", {detail: data}));\n break;\n case \"checkNumber\":\n document.dispatchEvent(new CustomEvent(\"checkNumber\", {detail: data}));\n break;\n case \"ConnectionId\":\n document.dispatchEvent(new CustomEvent(\"ConnectionId\", {detail: data}));\n break;\n case \"signatureCheck\":\n document.dispatchEvent(new CustomEvent(\"signatureCheck\", {detail: data}));\n break;\n case \"InvalidConnection\":\n document.dispatchEvent(new Event(\"RtcClosedEvent\"));\n break;\n }\n}", "title": "" }, { "docid": "6875b0f3f50b61cfbb2432150c1eaad6", "score": "0.47529346", "text": "onChildAppCrashRestart () {\n\n }", "title": "" }, { "docid": "3694c450001f4d39766c31bb82541cf0", "score": "0.47527927", "text": "function abort_signalAbort(signal) {\n var e_1, _a;\n /**\n * 1. If signal’s aborted flag is set, then return.\n * 2. Set signal’s aborted flag.\n * 3. For each algorithm in signal’s abort algorithms: run algorithm.\n * 4. Empty signal’s abort algorithms.\n * 5. Fire an event named abort at signal.\n */\n if (signal._abortedFlag)\n return;\n signal._abortedFlag = true;\n try {\n for (var _b = __values(signal._abortAlgorithms), _c = _b.next(); !_c.done; _c = _b.next()) {\n var algorithm = _c.value;\n algorithm.call(signal);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n signal._abortAlgorithms.clear();\n EventAlgorithm_1.event_fireAnEvent(\"abort\", signal);\n}", "title": "" }, { "docid": "c50641ef206aee88d32303aea8d0e284", "score": "0.47412664", "text": "onChildAppRestart (/* reason */) {\n\n }", "title": "" }, { "docid": "55414d6f28d7d8dbff605836b36d975d", "score": "0.47399732", "text": "function registerGracefulShutdown(callback) {\n var calledOnce = false;\n ['SIGINT', 'SIGTERM', 'SIGUSR2'].forEach(function (signal) {\n process.once(signal, function () { return callback(signal); });\n });\n}", "title": "" }, { "docid": "d96449587778de2bf95c834a2715f036", "score": "0.4738604", "text": "function defaultPossiblyUnhandledRejectionHandledHandler(promise) {\n // First try to emit Node event\n if (typeof process !== \"undefined\" && typeof process.emit === \"function\") {\n process.emit(\"rejectionHandled\", promise);\n }\n else if (typeof PromiseRejectionEvent === \"function\") {\n // Then fire a browser event if supported by the browser\n emitRejectionEvent(\"rejectionhandled\", promise.reason(), promise);\n }\n}", "title": "" }, { "docid": "fa91a07b6b9dce8e2629bb6f46913c08", "score": "0.47377917", "text": "async start() {\n let exitCode = 0;\n const sdk = this.sdk;\n const die = async (err) => {\n otel.diag.error(err.stack || String(err));\n exitCode = 1;\n await shutdown();\n };\n const shutdown = async () => {\n await this.stop();\n process.exit(exitCode);\n };\n if (sdk) {\n process.once('SIGTERM', shutdown);\n process.once('beforeExit', shutdown);\n process.once('uncaughtException', die);\n process.once('unhandledRejection', async (reason, _) => {\n await die(reason);\n });\n await sdk.start();\n }\n this.started = true;\n }", "title": "" }, { "docid": "245e487f869c41c272c869e7b7fed38b", "score": "0.47350988", "text": "notify(...args) {\r\n this.native.notify.apply(this.native, args)\r\n }", "title": "" }, { "docid": "834912ae9c989c8d359bfc8762b55b15", "score": "0.4729394", "text": "function preinit_state(signal) {\n switch (signal) {\n case 'ENTER':\n console.log('preinit_state recieved ENTER signal');\n return;\n case 'INIT':\n console.log('preinit_state recieved INIT signal');\n changeState(initial_state);\n return;\n case 'EXIT':\n console.log('preinit_state recieved EXIT signal');\n break;\n default:\n console.log('preinit_state received unknown signal: ' + signal);\n break;\n }\n }", "title": "" }, { "docid": "ab4ff0feba4ebf785e0a7381fe3b6748", "score": "0.47194302", "text": "function abortSignal(signal) {\n if (signal.aborted) {\n return;\n }\n if (signal.onabort) {\n signal.onabort.call(signal);\n }\n var listeners = listenersMap.get(signal);\n if (listeners) {\n listeners.forEach(function (listener) {\n listener.call(signal, { type: \"abort\" });\n });\n }\n abortedMap.set(signal, true);\n }", "title": "" }, { "docid": "ab4ff0feba4ebf785e0a7381fe3b6748", "score": "0.47194302", "text": "function abortSignal(signal) {\n if (signal.aborted) {\n return;\n }\n if (signal.onabort) {\n signal.onabort.call(signal);\n }\n var listeners = listenersMap.get(signal);\n if (listeners) {\n listeners.forEach(function (listener) {\n listener.call(signal, { type: \"abort\" });\n });\n }\n abortedMap.set(signal, true);\n }", "title": "" }, { "docid": "ceded556e59955a276e38c3538778b05", "score": "0.47168168", "text": "function handleStartup() {\n\ncreateAlarm();\n\n}", "title": "" }, { "docid": "ac3007d4875c08066fe4ac95900f86ef", "score": "0.47167137", "text": "function abortSignal(signal) {\n if (signal.aborted) {\n return;\n }\n if (signal.onabort) {\n signal.onabort.call(signal);\n }\n var listeners = listenersMap.get(signal);\n if (listeners) {\n listeners.forEach(function (listener) {\n listener.call(signal, { type: \"abort\" });\n });\n }\n abortedMap.set(signal, true);\n}", "title": "" }, { "docid": "95df7d5f9e7a7515934a7544dbc0cf9d", "score": "0.4713403", "text": "function handleAsyncExceptions() {\n if (handleAsyncExceptions.hooked === false) {\n process.on('unhandledRejection', (err) => {\n throw err;\n });\n\n handleAsyncExceptions.hooked = true;\n }\n}", "title": "" }, { "docid": "9a97a56530aa3e127f63125bc911534e", "score": "0.47130033", "text": "_addClientEventHandlers() {}", "title": "" }, { "docid": "b5b1869f01d053b96f0df0f025bc2688", "score": "0.47091866", "text": "get signal() {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n }", "title": "" }, { "docid": "b5b1869f01d053b96f0df0f025bc2688", "score": "0.47091866", "text": "get signal() {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n }", "title": "" } ]
38c8f7ffee11d80daf177508d90667cf
makes the `entry` the freshEnd of the LRU linked list
[ { "docid": "a2a69d545549a1e172620199a74ae98c", "score": "0.70368665", "text": "function refresh(entry) {\n\t\t\t\t\tif (entry != freshEnd) {\n\t\t\t\t\t\tif (!staleEnd) {\n\t\t\t\t\t\t\tstaleEnd = entry;\n\t\t\t\t\t\t} else if (staleEnd == entry) {\n\t\t\t\t\t\t\tstaleEnd = entry.n;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlink(entry.n, entry.p);\n\t\t\t\t\t\tlink(entry, freshEnd);\n\t\t\t\t\t\tfreshEnd = entry;\n\t\t\t\t\t\tfreshEnd.n = null;\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" } ]
[ { "docid": "ac42976b32fe555269399e9a8c09da8e", "score": "0.70475626", "text": "function refresh(entry) {\n\t if (entry !== freshEnd) {\n\t if (!staleEnd) {\n\t staleEnd = entry;\n\t } else if (staleEnd === entry) {\n\t staleEnd = entry.n;\n\t }\n\n\t link(entry.n, entry.p);\n\t link(entry, freshEnd);\n\t freshEnd = entry;\n\t freshEnd.n = null;\n\t }\n\t }", "title": "" }, { "docid": "c16fcf8dfb9fade776854a714e7a840e", "score": "0.7032381", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "d6213f36f4770df5a61353ccd8eb8469", "score": "0.7011987", "text": "function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "c6d964bce214e14a635cb7c8c61cae10", "score": "0.7004992", "text": "function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }", "title": "" }, { "docid": "6b774d9cf356a84dbc93f1c1316ec406", "score": "0.68676007", "text": "function refresh(entry){if(entry!==freshEnd){if(!staleEnd){staleEnd=entry;}else if(staleEnd===entry){staleEnd=entry.n;}link(entry.n,entry.p);link(entry,freshEnd);freshEnd=entry;freshEnd.n=null;}}", "title": "" }, { "docid": "992e190538c983792f21ad8497c65c30", "score": "0.6857649", "text": "function refresh(entry){if(entry!=freshEnd){if(!staleEnd){staleEnd=entry;}else if(staleEnd==entry){staleEnd=entry.n;}link(entry.n,entry.p);link(entry,freshEnd);freshEnd=entry;freshEnd.n=null;}}", "title": "" }, { "docid": "992e190538c983792f21ad8497c65c30", "score": "0.6857649", "text": "function refresh(entry){if(entry!=freshEnd){if(!staleEnd){staleEnd=entry;}else if(staleEnd==entry){staleEnd=entry.n;}link(entry.n,entry.p);link(entry,freshEnd);freshEnd=entry;freshEnd.n=null;}}", "title": "" }, { "docid": "1dd42163bbcb8795498d34fbf99ac54b", "score": "0.6223324", "text": "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n _classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList", "title": "" }, { "docid": "5efdc73123318e7bbf3c2603a44e2682", "score": "0.62168336", "text": "function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n LRUCache_classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList", "title": "" }, { "docid": "c478c81fa450daf3b0f5129f5f2547cd", "score": "0.5456758", "text": "addEntry(t,e,n){const s=e.key,i=this.docs.get(s),r=i?i.size:0,o=this.ps(e);return this.docs=this.docs.insert(s,{document:e.clone(),size:o,readTime:n}),this.size+=o-r,this.Ht.addToCollectionParentIndex(t,s.path.popLast());}", "title": "" }, { "docid": "3b40990c64c66c2561f920ef432f231c", "score": "0.5375314", "text": "function LRUCache (limit) {\n // Current size of the cache. (Read-only).\n this.size = 0;\n // Maximum number of items this cache can hold.\n this.limit = limit;\n this._keymap = {};\n}", "title": "" }, { "docid": "1f34612e0d1d2ed305fe3f14028b8eac", "score": "0.5338596", "text": "function Entry (key, value, lu, length, now) {\n this.key = key\n this.value = value\n this.lu = lu\n this.length = length\n this.now = now\n}", "title": "" }, { "docid": "1f34612e0d1d2ed305fe3f14028b8eac", "score": "0.5338596", "text": "function Entry (key, value, lu, length, now) {\n this.key = key\n this.value = value\n this.lu = lu\n this.length = length\n this.now = now\n}", "title": "" }, { "docid": "46129d514010163ba53cbbd5418396e9", "score": "0.5336649", "text": "function Entry (key, value, lu, length, now, maxAge) {\n this.key = key\n this.value = value\n this.lu = lu\n this.length = length\n this.now = now\n if (maxAge) this.maxAge = maxAge\n}", "title": "" }, { "docid": "46129d514010163ba53cbbd5418396e9", "score": "0.5336649", "text": "function Entry (key, value, lu, length, now, maxAge) {\n this.key = key\n this.value = value\n this.lu = lu\n this.length = length\n this.now = now\n if (maxAge) this.maxAge = maxAge\n}", "title": "" }, { "docid": "f020fe98a41a66b7a6190d039b37f6c9", "score": "0.52966064", "text": "addToTail(value) {\n const node = new Node({ value });\n if (this.head === null && this.tail === null) {\n this.head = node;\n this.tail = node;\n this.length++;\n } else {\n node.prev = this.tail;\n this.tail.next = node;\n this.tail = node;\n this.tail.next = null;\n this.length++;\n }\n }", "title": "" }, { "docid": "fa47ce1bef35fa324107a1015eb3a371", "score": "0.52777565", "text": "write(key, value) {\n this.ensureLimit();\n\n if (!this.head) {\n this.head = this.tail = new Node(key, value);\n } else {\n const node = new Node(key, value, this.head);\n this.head.prev = node;\n this.head = node;\n }\n\n //Update the cache map\n this.cache[key] = this.head;\n this.size++;\n }", "title": "" }, { "docid": "47a611a067b46549a131dc938e309c26", "score": "0.525877", "text": "addToTail(value) {\n const newNode = {\n value: value,\n next: null\n };\n\n if (!this.head && !this.tail) {\n this.head = newNode;\n this.tail = newNode;\n return;\n }\n this.tail.next = newNode;\n this.tail = newNode;\n }", "title": "" }, { "docid": "8280b31ec32d5be3362f85532cf4fa9a", "score": "0.5251977", "text": "addEntry(t, e, n) {\n const s = e.key,\n i = this.docs.get(s),\n r = i ? i.size : 0,\n o = this.ps(e);\n return this.docs = this.docs.insert(s, {\n document: e.clone(),\n size: o,\n readTime: n\n }), this.size += o - r, this.Ht.addToCollectionParentIndex(t, s.path.popLast());\n }", "title": "" }, { "docid": "575852f00cc0fa536c9e9e7cf48f4a1a", "score": "0.52472556", "text": "constructor(cacheSize){\n console.log(cacheSize);\n \n this.cacheSize = cacheSize;\n this.headNode = new NodeLRU();\n this.tailNode = new NodeLRU();\n this.headNode.next = this.tailNode;\n this.tailNode.prev = this.headNode;\n this.map = new Map(); //cache value and length\n }", "title": "" }, { "docid": "21468b85babbaaa3cf5e55cd2eb9b3b8", "score": "0.52390337", "text": "function incrementLRU(){\n for (let [key, value] of lruMap) {\n lruMap.set(key,value + 1);\n }\n }", "title": "" }, { "docid": "bae3faec4b60c89539c9f59a1fbdf002", "score": "0.52158624", "text": "addToTail(value) {\r\n const node = {\r\n value,\r\n next: null\r\n };\r\n if (this.head === null) {\r\n this.head = node;\r\n this.tail = node;\r\n } else {\r\n this.tail.next = node;\r\n this.tail = node;\r\n }\r\n }", "title": "" }, { "docid": "05f7f870a0d3d66a7628a9b92d50ef13", "score": "0.5197553", "text": "function Entry (key, value, length, now, maxAge) {\n\t this.key = key\n\t this.value = value\n\t this.length = length\n\t this.now = now\n\t this.maxAge = maxAge || 0\n\t}", "title": "" }, { "docid": "b87a582e2a7e132e34456f67a36ce491", "score": "0.51883024", "text": "function addEntry(entry) {\n setId(id + 1);\n setEntries([...entries, {...entry, id: id}]);\n }", "title": "" }, { "docid": "868bca128defc30c2b1900b8bd0459d1", "score": "0.5167541", "text": "function lruCache(maxsize) {\n maxsize = +maxsize || DEFAULT_MAX_SIZE;\n\n let curr, prev, size;\n\n const clear = () => {\n curr = {};\n prev = {};\n size = 0;\n };\n\n const update = (key, value) => {\n if (++size > maxsize) {\n prev = curr;\n curr = {};\n size = 1;\n }\n return (curr[key] = value);\n };\n\n clear();\n\n return {\n clear,\n has: key => has(curr, key) || has(prev, key),\n get: key => has(curr, key) ? curr[key]\n : has(prev, key) ? update(key, prev[key])\n : undefined,\n set: (key, value) => has(curr, key)\n ? (curr[key] = value)\n : update(key, value)\n };\n }", "title": "" }, { "docid": "2afa43177854eaf79415dd529adf67ad", "score": "0.5150184", "text": "function retry() {\n var entry = cache.list[lru];\n if (!entry) throw new Error('fail to set key ' + key);\n\n return del(entry).then(function() {\n return cache.set(key, hit);\n });\n }", "title": "" }, { "docid": "406c74c3af720760abd7d5f8105da4ea", "score": "0.51490927", "text": "addToTail(val) {\n const node = new Node(val)\n if(this.head === null){\n this.head = node;\n this.tail = node;\n } else{\n this.tail.next = node;\n this.tail = node;\n }\n this.length++\n // console.log(this)\n return this\n\n }", "title": "" }, { "docid": "b0e9295a54a6a208faa0360eec058029", "score": "0.5135769", "text": "add(location, {setIndexToHead = true, message} = {}) {\n const newEntry = new Entry(location)\n if (atom.config.get(\"cursor-history.keepSingleEntryPerBuffer\")) {\n const isSameURI = entry => newEntry.URI === entry.URI\n this.entries.filter(isSameURI).forEach(destroyEntry)\n } else {\n const isAtSameRow = entry => newEntry.isAtSameRow(entry)\n this.entries.filter(isAtSameRow).forEach(destroyEntry)\n }\n\n this.entries.push(newEntry)\n\n if (setIndexToHead) {\n this.setIndexToHead()\n }\n if (atom.config.get(\"cursor-history.debug\") && message) {\n this.log(message)\n }\n }", "title": "" }, { "docid": "b016fa4a9fee2b48be436a493b6df26c", "score": "0.51200277", "text": "ensureCapacity() {\n if (this.cacheMap.size > this.maxEntries) {\n // delete first item\n for (const [key, value] of this.cacheMap) {\n this.cacheMap.delete(key);\n break;\n }\n }\n }", "title": "" }, { "docid": "37f34606d2e05abd905cdcb41a0aa996", "score": "0.5112644", "text": "function Entry (key, value, mru, len, age) {\n this.key = key\n this.value = value\n this.lu = mru\n this.length = len\n this.now = age\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "d8aadf4cc16f6b4a23b7328cd5131a23", "score": "0.5100961", "text": "function Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}", "title": "" }, { "docid": "f0dfd2e0205a28ea1aebf77a8a9ee9d2", "score": "0.50898635", "text": "addAtTail(val) {\n var node = new Node(val);\n node.prev = this.tail;\n this.tail.next = node;\n this.tail = node;\n this.size++;\n }", "title": "" }, { "docid": "d2cb3cf13eb2d6b2646b2d6f4f596980", "score": "0.5082959", "text": "addToTail(value) {\n\t\tconst newNode = {\n\t\t\tvalue: value,\n\t\t\tnext: null,\n\t\t};\n\t\tif (!this.head) {\n\t\t\tthis.head = newNode;\n\t\t\tthis.tail = newNode;\n\t\t} else if (this.head === this.tail) {\n\t\t\tthis.head.next = newNode;\n\t\t\tthis.tail = newNode;\n\t\t} else {\n\t\t\tthis.tail.next = newNode;\n\t\t\tthis.tail = newNode;\n\t\t}\n\t}", "title": "" }, { "docid": "a91bf2b265669e11e3171396ca470c1d", "score": "0.50748706", "text": "insertAtTailLinearTime(value) {\n if (this.head === null) {\n this.head = new Node(value);\n } \n \n if (this.head !== null) {\n let current = this.head;\n \n while (current.next) {\n current = current.next;\n }\n \n current.next = new Node(value);\n }\n }", "title": "" }, { "docid": "56b07227eedd0dd66d288843a7d425db", "score": "0.50689995", "text": "_doubleEntriesSizeAndRehashEntries() {\n const entries = this._entries;\n const oldLength = this._entryRange;\n const newLength = oldLength * 2;\n //Reset the values\n this._entries = new Array(newLength);\n this._entryRange = newLength;\n this._spaceTaken = 0;\n for (let entry of entries) {\n if(!entry) {\n //Make sure we skip empty entries\n continue;\n }\n //Re-insert each entry back into the map\n this.addEntry(entry.key, entry.value);\n }\n }", "title": "" }, { "docid": "5001b2f83056be9fcbf75ace8f41913b", "score": "0.50599796", "text": "function cacheTile (tile) {\n\t\tif (TILES_CACHE_MAX > 0) {\n\t\t\tvar index = Z.Utils.arrayIndexOf(tilesCachedNames, tile.name);\n\t\t\tif (index != -1) {\n\t\t\t\ttilesCachedNames = Z.Utils.arraySplice(tilesCachedNames, index, 1);\n\t\t\t\ttilesCached = Z.Utils.arraySplice(tilesCached, index, 1);\n\t\t\t}\n\t\t\ttilesCachedNames[tilesCachedNames.length] = tile.name;\n\t\t\ttilesCached[tilesCached.length] = tile;\n\t\t}\t\t\n\t\t// Debug option: console.log(tilesCached.length + ' ' + tilesCached[tilesCached.length - 1].name + ' ' + tilesCachedNames.length + ' ' + tilesCachedNames[tilesCachedNames.length - 1]);\n\t}", "title": "" }, { "docid": "10a5c781eb83e4f78f835a46d64135d0", "score": "0.5048685", "text": "function appendCache() {\n document\n .getElementById(\"isl_content-section\")\n .appendChild(cache.bottom.pop());\n}", "title": "" }, { "docid": "738505be19227b46ec5fff6f86e887ad", "score": "0.50483", "text": "function lruPromote(model, object) {\n\t var root = model._root;\n\t var head = root[__head];\n\t if (head === object) {\n\t return;\n\t }\n\t\n\t // The item always exist in the cache since to get anything in the\n\t // cache it first must go through set.\n\t var prev = object[__prev];\n\t var next = object[__next];\n\t if (next) {\n\t next[__prev] = prev;\n\t }\n\t if (prev) {\n\t prev[__next] = next;\n\t }\n\t object[__prev] = void 0;\n\t\n\t // Insert into head position\n\t root[__head] = object;\n\t object[__next] = head;\n\t head[__prev] = object;\n\t}", "title": "" }, { "docid": "5a9be960874fe4dc3f6ee4053eb93e8e", "score": "0.50321615", "text": "restoreEntry(id, name, enabled, obj)\n{\n let entry;\n try\n {\n entry = new Entry();\n if (null === this._pushoverInstance)\n {\n obj.pushover.enabled = false;\n }\n entry.setId(id);\n entry.setName(name).setAny(obj.any).setPushOver(obj.pushover.enabled, obj.pushover.priority, obj.pushover.minDelay);\n entry.setConditions(obj.conditions);\n // should be called at the end\n entry.enable(enabled);\n // we don't want to consider this entry as new\n entry.setNew(false);\n // set expiry\n if (0 != this._maxDuration) {\n const ts = Date.now() + this._maxDuration;\n entry.setExpiryTimestamp(parseInt(ts / 1000.0));\n }\n // after restoring an entry, no need to store it unless it changes\n entry._disableStorage();\n this._entries[id] = entry;\n }\n catch (e)\n {\n Errors.logError(e, 'tickerMonitor');\n }\n}", "title": "" }, { "docid": "e65dcbc6735909bd17a31390c51c3a73", "score": "0.5004961", "text": "addEntry(entry){\n if (this.nextAvailableEntry<this.maxHistory)\n {\n if (this.refTime==0)\n {\n this.refTime=entry.time-978307200;\n switch (this.accessoryType)\n {\n case \"weather\":\n this.history[this.nextAvailableEntry]= {time: entry.time, temp:0, pressure:0, humidity:0};\n break;\n case \"energy\":\n this.history[this.nextAvailableEntry]= {time: entry.time, power:0xFFFF};\n break;\n }\n this.nextAvailableEntry++;\n }\n this.history[this.nextAvailableEntry] = (entry);\n this.nextAvailableEntry++;\n }\n else\n {\n this.history[1] = (entry);\n this.nextAvailableEntry = 2;\n }\n\n this.getCharacteristic(S2R1Characteristic)\n .setValue(hexToBase64(numToHex(swap32(entry.time-this.refTime-978307200),8) + '00000000' + numToHex(swap32(this.refTime),8) + '0401020202' + this.accessoryType116 +'020f03' + numToHex(swap16(this.nextAvailableEntry),4) +'ed0f00000000000000000101'));\n console.log(\"Next available entry \" + this.accessoryType + \": \" + this.nextAvailableEntry.toString(16));\n console.log(\"116 \" + this.accessoryType + \": \" + numToHex(swap32(entry.time-this.refTime-978307200),8) + '00000000' + numToHex(swap32(this.refTime),8) + '0401020202' + this.accessoryType116 +'020f03' + numToHex(swap16(this.nextAvailableEntry),4) +'ed0f00000000000000000101');\n\n }", "title": "" }, { "docid": "ba83372a27aa60b53d3a7a0c5702f4e1", "score": "0.50047576", "text": "static addEntry(entry) {\n var entries = Storage.getEntries()\n entries.push(entry)\n localStorage.setItem('entries',JSON.stringify(entries))\n }", "title": "" }, { "docid": "c9879ea4067650c6e9509959eaf375d0", "score": "0.4998673", "text": "function LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = priv(this, 'max', options.max)\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n priv(this, 'max', Infinity)\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n priv(this, 'lengthCalculator', lc)\n\n priv(this, 'allowStale', options.stale || false)\n priv(this, 'maxAge', options.maxAge || 0)\n priv(this, 'dispose', options.dispose)\n this.reset()\n}", "title": "" }, { "docid": "c9879ea4067650c6e9509959eaf375d0", "score": "0.4998673", "text": "function LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = priv(this, 'max', options.max)\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n priv(this, 'max', Infinity)\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n priv(this, 'lengthCalculator', lc)\n\n priv(this, 'allowStale', options.stale || false)\n priv(this, 'maxAge', options.maxAge || 0)\n priv(this, 'dispose', options.dispose)\n this.reset()\n}", "title": "" }, { "docid": "c9879ea4067650c6e9509959eaf375d0", "score": "0.4998673", "text": "function LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = priv(this, 'max', options.max)\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n priv(this, 'max', Infinity)\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n priv(this, 'lengthCalculator', lc)\n\n priv(this, 'allowStale', options.stale || false)\n priv(this, 'maxAge', options.maxAge || 0)\n priv(this, 'dispose', options.dispose)\n this.reset()\n}", "title": "" }, { "docid": "b1ac62a9f2b120bb1013b22049b13f54", "score": "0.49852154", "text": "put(key, value) {\n if(this.cache.has(key)) {\n this.cache.delete(key);\n } \n this.cache.set(key, value);\n // Recognize that there is a capacity. We want to delete the least recently used item. \n if(this.cache.size > this.capacity) {\n let least = this.cache.keys().next().value;\n this.cache.delete(least);\n }\n }", "title": "" }, { "docid": "859d4535458fe1f9cdcf474ac8683550", "score": "0.49844477", "text": "function LRUCache(options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options);\n }\n\n if (typeof options === 'number') {\n options = {\n max: options\n };\n }\n\n if (!options) {\n options = {};\n }\n\n var max = this[MAX] = options.max; // Kind of weird to have a default max of Infinity, but oh well.\n\n if (!max || !(typeof max === 'number') || max <= 0) {\n this[MAX] = Infinity;\n }\n\n var lc = options.length || naiveLength;\n\n if (typeof lc !== 'function') {\n lc = naiveLength;\n }\n\n this[LENGTH_CALCULATOR] = lc;\n this[ALLOW_STALE] = options.stale || false;\n this[MAX_AGE] = options.maxAge || 0;\n this[DISPOSE] = options.dispose;\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;\n this.reset();\n} // resize the cache when the max changes.", "title": "" }, { "docid": "859d4535458fe1f9cdcf474ac8683550", "score": "0.49844477", "text": "function LRUCache(options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options);\n }\n\n if (typeof options === 'number') {\n options = {\n max: options\n };\n }\n\n if (!options) {\n options = {};\n }\n\n var max = this[MAX] = options.max; // Kind of weird to have a default max of Infinity, but oh well.\n\n if (!max || !(typeof max === 'number') || max <= 0) {\n this[MAX] = Infinity;\n }\n\n var lc = options.length || naiveLength;\n\n if (typeof lc !== 'function') {\n lc = naiveLength;\n }\n\n this[LENGTH_CALCULATOR] = lc;\n this[ALLOW_STALE] = options.stale || false;\n this[MAX_AGE] = options.maxAge || 0;\n this[DISPOSE] = options.dispose;\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;\n this.reset();\n} // resize the cache when the max changes.", "title": "" }, { "docid": "859d4535458fe1f9cdcf474ac8683550", "score": "0.49844477", "text": "function LRUCache(options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options);\n }\n\n if (typeof options === 'number') {\n options = {\n max: options\n };\n }\n\n if (!options) {\n options = {};\n }\n\n var max = this[MAX] = options.max; // Kind of weird to have a default max of Infinity, but oh well.\n\n if (!max || !(typeof max === 'number') || max <= 0) {\n this[MAX] = Infinity;\n }\n\n var lc = options.length || naiveLength;\n\n if (typeof lc !== 'function') {\n lc = naiveLength;\n }\n\n this[LENGTH_CALCULATOR] = lc;\n this[ALLOW_STALE] = options.stale || false;\n this[MAX_AGE] = options.maxAge || 0;\n this[DISPOSE] = options.dispose;\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;\n this.reset();\n} // resize the cache when the max changes.", "title": "" }, { "docid": "09061cd74a4c45e3ef59763b7e6c4d77", "score": "0.4962136", "text": "function LevelLRUCache (level, limit) {\n this.level = level\n this.limit = limit === undefined ? undefined : limit - 1\n}", "title": "" }, { "docid": "65cd1fe2dece104993746b64c7a66ebd", "score": "0.4949741", "text": "function LRUCache (options) {\n\t if (!(this instanceof LRUCache)) {\n\t return new LRUCache(options)\n\t }\n\n\t if (typeof options === 'number') {\n\t options = { max: options }\n\t }\n\n\t if (!options) {\n\t options = {}\n\t }\n\n\t var max = priv(this, 'max', options.max)\n\t // Kind of weird to have a default max of Infinity, but oh well.\n\t if (!max ||\n\t !(typeof max === 'number') ||\n\t max <= 0) {\n\t priv(this, 'max', Infinity)\n\t }\n\n\t var lc = options.length || naiveLength\n\t if (typeof lc !== 'function') {\n\t lc = naiveLength\n\t }\n\t priv(this, 'lengthCalculator', lc)\n\n\t priv(this, 'allowStale', options.stale || false)\n\t priv(this, 'maxAge', options.maxAge || 0)\n\t priv(this, 'dispose', options.dispose)\n\t this.reset()\n\t}", "title": "" }, { "docid": "ea21d750491c6cfd38b15e187e33d390", "score": "0.49485773", "text": "function HLL(){\n\thead=null\n}", "title": "" }, { "docid": "9a22f03c76e85bd7b6c85f9e95135290", "score": "0.49443436", "text": "function compact_entry(entry) {\n const ce = entry_utils.create_entry_object();\n ce.dateCreated = entry.dateCreated;\n\n // Retain this past archival date so that it can still be displayed\n // in front end queries on datePublished index as of version 26 of database.\n ce.datePublished = entry.datePublished;\n\n // Prior to datePublished index being added in database version 26, entries\n // could be created without a publish date. Now entries must have one. This is\n // a migration fix.\n if (!ce.datePublished) {\n ce.datePublished = ce.dateCreated;\n }\n\n if (entry.dateRead) {\n ce.dateRead = entry.dateRead;\n }\n\n ce.feed = entry.feed;\n ce.id = entry.id;\n ce.readState = entry.readState;\n ce.urls = entry.urls;\n return ce;\n}", "title": "" }, { "docid": "fbd70348278b896766445e008b5c5732", "score": "0.49304464", "text": "addToBack(value) {\n var new_node = new ListNode(value);\n​\n // if list is empty\n if (this.head == null) {\n this.head = new_node;\n this.tail = new_node;\n }\n​\n else {\n this.tail.next = new_node;\n this.tail = new_node;\n }\n }", "title": "" }, { "docid": "5196dd19e3121eaded47995ebcf157c6", "score": "0.4923305", "text": "addToTail(fromOutside) {\n const node = {\n value: fromOutside, // <--- e.g. 'The Godfather'\n next: null\n };\n if (this.head === null) {\n this.head = node;\n } else if (this.head.next === null) {\n this.head.next = node;\n } else { this.tail.next = node; }\n this.tail = node;\n }", "title": "" }, { "docid": "48ecad8e6b94a2cf12b11cab15e3a22c", "score": "0.49158636", "text": "function removeOldestTest(listItem, final){\n var values = listItem.values;\n if(tempNode == null){\n tempNode = listItem;\n oldest = tempNode;\n }else{\n // created before , and no accesstime, set\n if(values.dateTimeCreated <= oldest.values.dateTimeCreated && values.dateTimeAccessed == undefined){\n console.log('setting');\n oldest = listItem;\n // created before , and access time is more than oldest time created, donts set\n }else if(values.dateTimeAccessed > oldest.values.dateTimeCreated){\n oldest = oldest;\n // accessed is less than date time created\n }else if(values.dateTimeAccessed < oldest.values.dateTimeCreated){\n oldest = listItem;\n }\n if(final == true){ // on final call... declare the poor soul BANISHED mwahahah\n console.log(\"EXPECTED STRING = T32TQE2\\nActual String = \", oldest.values.data)\n test_list.removeNode(oldest);\n testCache.update();\n oldest = null;\n }\n }\n}", "title": "" }, { "docid": "57b0c8b261f2e714fb1a66a723467095", "score": "0.49141204", "text": "addEntry(t,e,n){return Gi(t).put(zi(e),n);}", "title": "" }, { "docid": "8b9754d683e4005c29d1678f9d2d4792", "score": "0.49003243", "text": "add() {\n if(!this.added) {\n this.added = true;\n var template = Entry.getReplacedString(this.template, this.replacements, \"%\");\n\n // If no entries available, set whole content of div, otherwise append\n if(!GUI.hasEntries()) {\n $(\".entries\").html(template);\n } else {\n $(\".entries > .entry:last\").after(template);\n }\n\n this.updateMiddleWidth();\n\n // Add entry to global entries variable\n entries[this.id] = this;\n\n GUI.onEntriesChange();\n GUI.updateWindowHeight();\n GUI.scrollToBottom();\n }\n }", "title": "" }, { "docid": "aca489954116a38c48ac9f44dac3aaae", "score": "0.48765892", "text": "addToBack(value) {\n var newNode = new SLLNode(value);\n\n if (this.head == null) {\n this.head = newNode;\n return;\n }\n\n var runner = this.head;\n\n while (runner.next != null) {\n // console.log(runner.value)\n runner = runner.next;\n }\n runner.next = newNode;\n }", "title": "" }, { "docid": "bf72dfc6f77a64e6150a07767b42d8ba", "score": "0.48646122", "text": "function LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = this[MAX] = options.max\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n this[MAX] = Infinity\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n this[LENGTH_CALCULATOR] = lc\n\n this[ALLOW_STALE] = options.stale || false\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this.reset()\n}", "title": "" }, { "docid": "bf72dfc6f77a64e6150a07767b42d8ba", "score": "0.48646122", "text": "function LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = this[MAX] = options.max\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n this[MAX] = Infinity\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n this[LENGTH_CALCULATOR] = lc\n\n this[ALLOW_STALE] = options.stale || false\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this.reset()\n}", "title": "" } ]
22b5b3755f36767727ab31927e0c1062
Assignment: Explain what the push/pop functions do for this API. What effect would it have on the fluent API if we did not have them?
[ { "docid": "80f4d23a384b1797b026142624295d8a", "score": "0.0", "text": "function create(){\n let waitingFor={\n counters: {},\n push:function(verb){\n waitingFor.counters[verb]=waitingFor.counters[verb] || [];\n waitingFor.counters[verb].push(verb);\n },\n pop:function(verb, message){\n if(!waitingFor.counters[verb]){\n if(verb!==\"GameCreated\"){\n fail(\"Not waiting on \" + verb + \", ERROR!\" + JSON.stringify(message) + JSON.stringify(game));\n }\n } else {\n waitingFor.counters[verb].pop();\n }\n },\n count(){\n let count=0;\n _.forEach(waitingFor.counters, (list)=>{\n count += list.length;\n });\n return count;\n },\n printWait(){\n _.each(waitingFor.counters, function(counter, verb){\n if(counter.length>0){\n console.log(game.side, \":\", verb, counter.length ,JSON.stringify(game.userSession.user.userName), \" GameId\", game.gameId);\n }\n })\n }\n };\n allWaits.push(waitingFor);\n let game={\n receivedMessages:{},\n sentCommands:[]\n };\n allGames.push(game);\n\n function popIfMyGame(eventMessage, callback){\n if(eventMessage.gameId===game.gameId){\n if(game.receivedMessages[eventMessage.eventId]){\n console.warn(\"Already received message \" + eventMessage.eventId, JSON.stringify(eventMessage))\n } else {\n game.receivedMessages[eventMessage.eventId] = eventMessage;\n waitingFor.pop(eventMessage.type, eventMessage);\n callback && callback();\n }\n }\n }\n\n let routingContext = RoutingContext(inject({\n io,\n env:\"test\",\n fs: require('fs'),\n incomingEventLogFile : \"./user-api-incoming-events.log\",\n outgoingCommandLogFile : \"./user-api-outgoing-commands.log\"\n }));\n\n routingContext.eventRouter.on('GameCreated', function(eventMessage){\n popIfMyGame(eventMessage, ()=>{\n game.userSession = eventMessage.userSession;\n });\n });\n\n routingContext.eventRouter.on(\"NotYourMove\", function(eventMessage){\n fail(\"Move out of turn...that should not happen.\" + JSON.stringify(eventMessage));\n });\n\n routingContext.eventRouter.on('GameWon', function(eventMessage){\n popIfMyGame(eventMessage, ()=>{\n game.complete = true;\n });\n });\n\n routingContext.eventRouter.on('GameJoined', function(eventMessage){\n popIfMyGame(eventMessage, ()=>{\n game.userSession = eventMessage.userSession;\n });\n });\n\n routingContext.eventRouter.on('MovePlaced', function(eventMessage){\n popIfMyGame(eventMessage);\n });\n\n\n function routeCommand(command){\n game.sentCommands.push(command);\n routingContext.commandRouter.routeMessage(command);\n }\n\n\n connectCount++;\n const me = {\n expectUserAck:(cb)=>{\n waitingFor.push(\"sessionAck\");\n routingContext.socket.on('sessionAck', function(ackMessage){\n expect(ackMessage.clientId).not.toBeUndefined();\n waitingFor.pop(\"sessionAck\");\n });\n return me;\n },\n sendChatMessage:(message)=>{\n let cmdId = generateUUID();\n routeCommand({commandId:cmdId, type:\"chatCommand\", message });\n return me;\n },\n expectChatMessageReceived:(message)=>{\n waitingFor.push(\"chatMessageReceived\");\n routingContext.eventRouter.on('chatMessageReceived', function(chatMessage){\n expect(chatMessage.sender).not.toBeUndefined();\n if(chatMessage.message===message){\n waitingFor.pop(\"chatMessageReceived\");\n }\n });\n return me;\n },\n\n createGame:()=>{\n let cmdId = generateUUID();\n game.gameId= generateUUID();\n routeCommand({commandId:cmdId, type:\"CreateGame\", gameId: game.gameId });\n game.side='X';\n\n return me;\n },\n getGame:()=>{\n return game\n },\n joinGame:(gameId)=>{\n let cmdId = generateUUID();\n game.gameId=gameId;\n routeCommand({commandId:cmdId, type:\"JoinGame\", gameId:game.gameId});\n game.side='O';\n return me;\n },\n\n placeMove:(x, y)=>{\n let cmdId = generateUUID();\n routeCommand(\n {\n commandId:cmdId,\n type:\"PlaceMove\",\n gameId:game.gameId,\n move: {\n xy: {x: x, y: y},\n side: game.side\n }\n\n });\n return me;\n },\n expectGameWon:()=>{\n waitingFor.push(\"GameWon\");\n return me;\n },\n expectGameCreated:()=>{\n waitingFor.push(\"GameCreated\");\n return me;\n },\n expectGameJoined:()=>{\n waitingFor.push(\"GameJoined\");\n return me;\n },\n expectMoveMade:()=>{\n waitingFor.push(\"MovePlaced\");\n return me;\n },\n then:(whenDoneWaiting)=>{\n function waitLonger(){\n if(waitingFor.count()>0){\n setTimeout(waitLonger, 0);\n return;\n }\n whenDoneWaiting();\n }\n waitLonger();\n return me;\n },\n disconnect:function(){\n routingContext.socket.disconnect();\n },\n };\n return me;\n }", "title": "" } ]
[ { "docid": "1b3865e4d78cfb6186f85ce36a8bebc6", "score": "0.62745786", "text": "get push() { return this._push; }", "title": "" }, { "docid": "1b3865e4d78cfb6186f85ce36a8bebc6", "score": "0.62745786", "text": "get push() { return this._push; }", "title": "" }, { "docid": "1b3865e4d78cfb6186f85ce36a8bebc6", "score": "0.62745786", "text": "get push() { return this._push; }", "title": "" }, { "docid": "98bd1f76f1e5365543215906d6f01618", "score": "0.6101189", "text": "function push(){\n var toPush = _slice.call(arguments);\n return function(xf){\n return new Push(toPush, xf);\n };\n}", "title": "" }, { "docid": "63691cfc2399ebf10b39e2c1afb0c4ec", "score": "0.60156125", "text": "pop() {\n\n }", "title": "" }, { "docid": "2a2106caafbc5b600f73b40097f7fc8f", "score": "0.59773904", "text": "push(_) { }", "title": "" }, { "docid": "c5a5db1241b3760e726906765cb221cf", "score": "0.59093225", "text": "Push() {\n\n }", "title": "" }, { "docid": "e64c9e20b784fd68f89c4216bdbf382f", "score": "0.58328485", "text": "function nonMutatingPush(original, newItem) {\n // Only change code below this line\n return original.concat(newItem);\n\n // Only change code above this line\n}", "title": "" }, { "docid": "bf44865c5939b6e663e1297e676fec63", "score": "0.5818425", "text": "function push() {\n\t\t\t\tvar j = this.length;\n\t\t\t\tfor (var i = 0; i < push.arguments.length; ++i) {\n\t\t\t\t\tthis[j] = push.arguments[i];\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "4621877db193f9f69c333302c40a39a4", "score": "0.58122027", "text": "pop() {\n const ret = [].pop.call(this);\n this._registerAtomic('$set', this);\n this._markModified();\n return ret;\n }", "title": "" }, { "docid": "a034b7ce1f105ee200bdbf6b7f1c9e9e", "score": "0.56636417", "text": "push(value) {\n return this.stack.push(value);\n }", "title": "" }, { "docid": "42aeb6ca67ad66296ae935f1efaf7789", "score": "0.5639727", "text": "function Push(method) {\n this.method = method;\n}", "title": "" }, { "docid": "6b31da3c204f6c353e7c43e01842c44a", "score": "0.5572456", "text": "observePopped(oldValue, newValue) {\n const changes = Object.assign([], this.changes);\n changes.push({ property: 'popped', newValue, oldValue });\n this.changes = changes;\n }", "title": "" }, { "docid": "2d5106bb2aef84894640842a2d35f604", "score": "0.5549288", "text": "push(...items) {\n this.modified = true;\n return super.push(...items);\n }", "title": "" }, { "docid": "3736cb145b4516eccba7691053896821", "score": "0.5504874", "text": "Pop() {\n\n }", "title": "" }, { "docid": "d77b4f88b978358afd9dd7c0dc1fc17c", "score": "0.54769826", "text": "function pushOrConcat(base,toPush){if(toPush){if(helpers.isArray(toPush)){//base = base.concat(toPush);\nArray.prototype.push.apply(base,toPush);}else{base.push(toPush);}}return base;}", "title": "" }, { "docid": "d69eefb8fe46bc7502832735a6f3df87", "score": "0.5453195", "text": "function push(element){\n\t\treturn this.stack.push(element);\n\t}", "title": "" }, { "docid": "c4cfa23fe26ccaaab842e54c0613fad0", "score": "0.54398763", "text": "function Stack(){\n var collection = [];\n this.print = function(){\n console.log(collection);\n };\n this.push = function(value){\n return collection.push(value);\n }\n this.pop = function(){\n return collection.pop();\n }\n this.peek = function(){\n return collection[collection.length - 1];\n }\n this.isEmpty = function(){\n return collection.length === 0;\n };\n this.clear = function(){\n collection.length = 0;\n };\n}", "title": "" }, { "docid": "5c1122922ec8af466cb23440b24670e7", "score": "0.5419007", "text": "push(element) {\n // put element onto stack\n this.items.push(element)\n // set the top to the element we just put on\n this.top = element\n }", "title": "" }, { "docid": "1d3de8922770d02b9c167252ad489138", "score": "0.5398045", "text": "function pushOrConcat(base, toPush) {\n\t\t\t\t\tif (toPush) {\n\t\t\t\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t\t\t\t// base = base.concat(toPush);\n\t\t\t\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbase.push(toPush);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn base;\n\t\t\t\t}", "title": "" }, { "docid": "e444ff3144adf77c252af80b87174b2e", "score": "0.53675437", "text": "function Queue() {\n\tthis._push_stack = [];\n\tthis._pop_stack = [];\n\n\tthis.push.apply(this, arguments);\n}", "title": "" }, { "docid": "e444ff3144adf77c252af80b87174b2e", "score": "0.53675437", "text": "function Queue() {\n\tthis._push_stack = [];\n\tthis._pop_stack = [];\n\n\tthis.push.apply(this, arguments);\n}", "title": "" }, { "docid": "7ccaab6be3c99316320d7cfab539ea53", "score": "0.535625", "text": "pop() {\n this._stack.pop();\n }", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.53236395", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.53236395", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.53236395", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.53236395", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.53236395", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.53236395", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "54219d3ee084e4373b4721b823d8cea0", "score": "0.53236395", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "edbcf6c62765742c2acebb1bf937ff02", "score": "0.5321622", "text": "push(element) {\n const oldBack = this._back;\n let newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }", "title": "" }, { "docid": "a2b6f1c2e2822fbcaa7f53571a3186e3", "score": "0.5318743", "text": "function pushOrConcat(base, toPush) {\r\n\tif (toPush) {\r\n\t\tif (helpers$1.isArray(toPush)) {\r\n\t\t\t// base = base.concat(toPush);\r\n\t\t\tArray.prototype.push.apply(base, toPush);\r\n\t\t} else {\r\n\t\t\tbase.push(toPush);\r\n\t\t}\r\n\t}\r\n\r\n\treturn base;\r\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "87e3561d8fa310fa7ffd74fecf1936c6", "score": "0.5311924", "text": "function pushOrConcat(base, toPush) {\n\tif (toPush) {\n\t\tif (helpers$1.isArray(toPush)) {\n\t\t\t// base = base.concat(toPush);\n\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t} else {\n\t\t\tbase.push(toPush);\n\t\t}\n\t}\n\n\treturn base;\n}", "title": "" }, { "docid": "a39d968716b9a0e7f387d42f3df2f885", "score": "0.5298524", "text": "pushTop(element) {\n let temp = this.internalStack.get(this);\n temp.unshift(element);\n }", "title": "" }, { "docid": "3b34c428add79594ecc0edf6b0333d70", "score": "0.5295256", "text": "function pushOrConcat(base, toPush) {\r\n\t\tif (toPush) {\r\n\t\t\tif (helpers.isArray(toPush)) {\r\n\t\t\t\t// base = base.concat(toPush);\r\n\t\t\t\tArray.prototype.push.apply(base, toPush);\r\n\t\t\t} else {\r\n\t\t\t\tbase.push(toPush);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn base;\r\n\t}", "title": "" }, { "docid": "264783bc21b938af7f443c7e8d51878b", "score": "0.5294058", "text": "function Stack() {\n this.items = [...arguments];\n}", "title": "" }, { "docid": "fbbf4f83e29c887f66145edae92a7ccb", "score": "0.52828807", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers$1.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }", "title": "" }, { "docid": "fbbf4f83e29c887f66145edae92a7ccb", "score": "0.52828807", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers$1.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }", "title": "" }, { "docid": "096fe5bc6e707b19d09a1fc0d06f253f", "score": "0.52784693", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers$1.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }", "title": "" }, { "docid": "a9933ad42286427bcbb41af9a515bf60", "score": "0.5261705", "text": "function pushOrConcat(base, toPush) {\n \tif (toPush) {\n \t\tif (helpers$1.isArray(toPush)) {\n \t\t\t// base = base.concat(toPush);\n \t\t\tArray.prototype.push.apply(base, toPush);\n \t\t} else {\n \t\t\tbase.push(toPush);\n \t\t}\n \t}\n\n \treturn base;\n }", "title": "" }, { "docid": "d3e5959daf69518b64372d1a4e63f067", "score": "0.52535486", "text": "function pushOrConcat(base, toPush) {\n\t\t\tif (toPush) {\n\t\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t\t// base = base.concat(toPush);\n\t\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t\t} else {\n\t\t\t\t\tbase.push(toPush);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base;\n\t\t}", "title": "" }, { "docid": "38892158cc040f460204fd859ad6846e", "score": "0.5250323", "text": "push(val) {\n //Accepts a val\n // Create a newNode. \n let newNode = new Node(val);\n // Cheak if there is head\n if(!this.head) { \n // Set newNode to head \n this.head = newNode;\n // Set newNode to tail\n this.tail = newNode;\n }\n else{ \n // Else set the tail next to the newNode. \n this.tail.next = newNode;\n // Update tail to be the newNode. \n this.tail = newNode;\n }\n\n // Inceremnt the length\n this.length++;\n // return this\n return this;\n }", "title": "" }, { "docid": "68e64b1aa52bc10d44af576ae9d23613", "score": "0.52449614", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers$1.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n }", "title": "" }, { "docid": "ad12b97381aae576773d4aa67375f187", "score": "0.52421147", "text": "function makeSmartPush(self, nullCb) {\n var count = 0, originalPush = self.push;\n return function (element) {\n if (!element) {\n if (!nullCb(count))\n originalPush.call(self, element);\n }\n else {\n count++;\n originalPush.call(self, element);\n }\n };\n }", "title": "" }, { "docid": "7691f634bac48300a9967beb3544e9ae", "score": "0.5241343", "text": "shift() {\n const ret = [].shift.call(this);\n this._registerAtomic('$set', this);\n this._markModified();\n return ret;\n }", "title": "" }, { "docid": "31546cd42d92e38f88544dac26fd23d8", "score": "0.5238005", "text": "push(...v) {\n const thing = this.thing;\n v.forEach(vv => {\n const r = this.raw.push(...v);\n thing.applyProp(r - 1, vv);\n }); // this.thing.applyProp has extra function level?\n const rr = this.raw.length;\n this.events.trigger('push', rr); //TODO better argument passing\n return rr;\n }", "title": "" }, { "docid": "0f4d36cec91ba536e258af8e8683d4df", "score": "0.5230748", "text": "function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }", "title": "" }, { "docid": "a99d2716eee7b6bf0ba96ea53cb235aa", "score": "0.5229607", "text": "function Stack () {\n this.elements = [];\n this.size = function() {\n return this.elements.length;\n };\n this.push = function (element){\n this.elements[this.elements.length] = element;\n };\n this.pop = function () {\n var lastElement = this.elements[this.elements.length - 1];\n this.elements.length = this.elements.length - 1;\n return lastElement;\n };\n}", "title": "" }, { "docid": "e515986ccca33d17d971cacc0e1e800b", "score": "0.5229208", "text": "popArrayValue(value) {\n value = value || this.pop();\n let target = this[this.length - 1];\n\n target.push(value);\n\n return target;\n }", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "384103bf54a41f54f85c618b652a6aff", "score": "0.52258164", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t// base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "9152a712ab0d43835b95f430c12a1580", "score": "0.522574", "text": "pop() {\n // YOUR CODE HERE\n }", "title": "" }, { "docid": "31a2ca0cebcb79ad1ed94da574c3d62b", "score": "0.52115464", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t//base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "31a2ca0cebcb79ad1ed94da574c3d62b", "score": "0.52115464", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t//base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "31a2ca0cebcb79ad1ed94da574c3d62b", "score": "0.52115464", "text": "function pushOrConcat(base, toPush) {\n\t\tif (toPush) {\n\t\t\tif (helpers.isArray(toPush)) {\n\t\t\t\t//base = base.concat(toPush);\n\t\t\t\tArray.prototype.push.apply(base, toPush);\n\t\t\t} else {\n\t\t\t\tbase.push(toPush);\n\t\t\t}\n\t\t}\n\n\t\treturn base;\n\t}", "title": "" }, { "docid": "16c0790e1ea29ae973af04c4b4a8b951", "score": "0.52083564", "text": "shift() {\n const ret = super.shift.apply(this, arguments);\n\n _updateParentPopulated(this);\n\n return ret;\n }", "title": "" }, { "docid": "7d3d5445c621dfc0d2ee67ae83976a16", "score": "0.5202694", "text": "function newStack() {\n var stack = [];\n\n return {\n \n push: function(arg) {\n stack.push(arg);\n },\n\n pop: function() {\n return stack.pop();\n },\n \n printStack: function() {\n stack.forEach(el => console.log(el));\n },\n }\n\n}", "title": "" }, { "docid": "6c60ea4544f9fb932b076ee72c680b40", "score": "0.51920426", "text": "push(element) {\n let stack = items.get(sKey);\n stack.push(element);\n }", "title": "" }, { "docid": "8187c6edf60c891a212afc0800e740c3", "score": "0.51908374", "text": "push(item){\n this.stack.push(item);\n }", "title": "" }, { "docid": "e36b178b0aa94f31c838def79f88927f", "score": "0.5188194", "text": "push(...args) {\n args.forEach((arg) => {\n this.add(arg);\n });\n return this.length;\n }", "title": "" }, { "docid": "9c9035791819eefcd21108038d00313c", "score": "0.51697105", "text": "pop() {\n return this.data.pop();\n }", "title": "" } ]
78ba5ef6d1a4d9294d026b5ee42fd39a
Begining of Input Processing //
[ { "docid": "2b722c881f58214d5b5fe6e31c17fe36", "score": "0.0", "text": "async function inputAsync(source) {\n try {\n if(source) {\n await validateFile(source);\n return await parseJSONFromFile(source);\n }\n else {\n return await parseJSONFromStdin();\n }\n } catch(err) {\n handleException(err)\n }\n}", "title": "" } ]
[ { "docid": "8d100496396a52d1e254a78bab8298a8", "score": "0.65628046", "text": "handleInput() {}", "title": "" }, { "docid": "1839e55dca53f03fda13d5c67dec2fd7", "score": "0.65451765", "text": "handleInput(input) {\n\t\t\n\t}", "title": "" }, { "docid": "5f3ebfc4d9b8e3d28a3f9470d715d26b", "score": "0.62521124", "text": "function start() {\r\n inputName = document.querySelector('#inputName');\r\n preventFormSubmit();\r\n activateInput();\r\n render();\r\n}", "title": "" }, { "docid": "c81f0b95a9dac53da5e9de53909222dd", "score": "0.6231465", "text": "function __processInput() {\n var degreeInc = 2.0,\n zInc = 0.05;\n //console.log(_keyPressed);\n\n for (var keyCode in __keyPressed) {\n\n if (!__keyPressed[keyCode]) {\n continue;\n }\n\n var key = parseInt(keyCode);\n\n switch (key) {\n case 87: // rotate up keys = (w, W)\n case 119:\n __rotateMap(degreeInc);\n break;\n\n case 83: // rotate down keys = (s, S)\n case 115:\n __rotateMap(-degreeInc);\n break;\n\n case 65: // rotate left keys = (a, A)\n case 97:\n __rotateMap(null, degreeInc);\n break;\n\n case 68: // rotate right keys = (d, D)\n case 100:\n __rotateMap(null, -degreeInc);\n break;\n\n case 32: // space bar\n __hasGameStarted = true;\n __setGamePauseStatus(!__getGameStatus());\n break;\n\n case 37: // move player left\n if (!__isGamePaused()) {\n __thePlayer.setDirection(__DIRECTIONS.EAST);\n }\n break;\n\n case 39: // move player right\n if (!__isGamePaused()) {\n __thePlayer.setDirection(__DIRECTIONS.WEST);\n }\n break;\n\n case 49: // zoom out\n __rotateMap(null, null, -zInc);\n break;\n\n case 50: // zoom in\n __rotateMap(null, null, zInc);\n break;\n\n default:\n console.log('Did not recognize key with code: ' + keyCode);\n __keyPressed[keyCode] = false;\n __keyReleased[keyCode] = false;\n\n break;\n }\n\n if (key === 32 || (__keyPressed[keyCode] && __keyReleased[keyCode])) {\n\n switch (key) {\n case 37: // stop player\n case 39:\n __thePlayer.setDirection(__DIRECTIONS.NONE);\n break;\n\n default:\n break;\n }\n\n __keyPressed[keyCode] = false;\n __keyReleased[keyCode] = false;\n //console.log(__keyReleased);\n }\n\n }\n }", "title": "" }, { "docid": "1e1f86b2969489f3af68f6ac121139b2", "score": "0.62048745", "text": "function initInput()\r\n{\r\n inputHead = null;\r\n inputTail = null;\r\n inputCurrent = null;\r\n inputLength = 0;\r\n lock = false;\r\n}", "title": "" }, { "docid": "9219e08ceb99f257367be531954dc1ee", "score": "0.6177968", "text": "function OpenPCS_Read_NodeHandler_OnInput (Msg_p)\n {\n\n TraceMsg ('{OpenPCS_Read_Node} procesing input message...');\n\n // This node is an input node and therefore it does not process any messages\n\n return;\n\n }", "title": "" }, { "docid": "b22d53686499bc73af415a90e8d9ed33", "score": "0.61492103", "text": "enterSingle_input(ctx) {\n\t}", "title": "" }, { "docid": "99a41a10527700f040f083c60c2e21c9", "score": "0.6116874", "text": "function gatherInputs() {\n\t // Nothing to do here!\n\t // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "4a6e337dba99a7c4acbc05d23e711845", "score": "0.61165035", "text": "enterFile_input(ctx) {\n\t}", "title": "" }, { "docid": "15b131ff8231819ccca062c5a035d98f", "score": "0.6115701", "text": "function pollKeyStuff() {\n var thrufl = 0x81de; // line input done flag\n\n var ch = nextChar();\n if (phase < 0) {\n phase++;\n } else if ((phase === 0) &&\n (ccemu.rd(thrufl) === 0)) { // buffer accepting input\n keybrd.asciiKey(ch); // set it\n phase = 1;\n } else if (phase === 1) {\n keybrd.asciiKey(); // clear it\n // heuristic: delay to allow for line processing\n phase = (ch === '\\r') ? -key_at_a_time_eol_delay : 0;\n offset++;\n if (offset >= text.length) {\n phase = 0;\n offset = -1; // signal that we are done\n }\n }\n }", "title": "" }, { "docid": "eddd431827ec131687a75a7a609015b9", "score": "0.6059238", "text": "function start() {\n\t\tvar inputSpace = document.getElementById(\"input\");\n\t\tinput = inputSpace.value.split(/[ \\t\\n]+/);\n\t\tensureWpm();\n\t\tensureFontSize();\n\t\tswitchEnabled();\n\t\t// ensure timer doesn't create multiple instances\n\t\tif (timer) {\n\t\t\tclearInterval(timer);\n\t\t}\n\t\ttimer = setInterval(animate, frameDelay);\n\t}", "title": "" }, { "docid": "218598e35ba80c69ee50713525c42a9a", "score": "0.6048091", "text": "prepare(){\n this.input.prepare();\n }", "title": "" }, { "docid": "d7012b1337614108a2357da0f8282484", "score": "0.60205835", "text": "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "title": "" }, { "docid": "d7012b1337614108a2357da0f8282484", "score": "0.60205835", "text": "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "title": "" }, { "docid": "d7012b1337614108a2357da0f8282484", "score": "0.60205835", "text": "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "title": "" }, { "docid": "48bbec345d4e4d81391285b568215a1d", "score": "0.59925854", "text": "start() {\r\n this.io.prompt();\r\n }", "title": "" }, { "docid": "a2cf157e7e49ae80d79e5c329edcf60a", "score": "0.5943286", "text": "function initInput(){\n keys = game.input.keyboard.createCursorKeys();\n game.input.mouse.mouseDownCallback = onMouseDown;\n game.input.mouse.mouseUpCallback = onMouseUp;\n }", "title": "" }, { "docid": "e14a54aa6d69359c83917dca94f14f4b", "score": "0.5939454", "text": "_cliHandlerStart()\n\t\t{\n\t\t\tif(process.stdout.isTTY)\n\t\t\t{\n\t\t\t\tkeypress(process.stdin);\n\t\t\t\tprocess.stdin.on('keypress', this._keypressHandler);\n\t\t\t\tprocess.stdin.setRawMode(true);\n\t\t\t\tprocess.stdin.resume();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.59071296", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.59071296", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.59071296", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.59071296", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.59071296", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.59071296", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "29fee7e1efb5084b119142c37571fd77", "score": "0.59071296", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "8c2fa07371b8c41b231d87baebf95c8b", "score": "0.5900644", "text": "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "title": "" }, { "docid": "d3f5ebbb9cfac43538b1462c4f5d28d3", "score": "0.58912706", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "d3f5ebbb9cfac43538b1462c4f5d28d3", "score": "0.58912706", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "d3f5ebbb9cfac43538b1462c4f5d28d3", "score": "0.58912706", "text": "function gatherInputs() {\n // Nothing to do here!\n // The event handlers do everything we need for now.\n}", "title": "" }, { "docid": "846b36ced574bb774030543f483f57fd", "score": "0.58904344", "text": "resume() {\r\n\t\tthis._input.on(\"data\", this._dataListener);\r\n\t}", "title": "" }, { "docid": "f8661f0ff1b00d743a6462d15a67d9af", "score": "0.5868967", "text": "function start(){\n\n \tif (document.getElementById('textarea').value !== ''){\n \t\tuser_name();\n \t\ttime_determine();\n \t\tcreate_message();\t\t\t\n \t}\n }", "title": "" }, { "docid": "8be889fa4941c249e3f9b601851d5fde", "score": "0.5865073", "text": "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "title": "" }, { "docid": "8be889fa4941c249e3f9b601851d5fde", "score": "0.5865073", "text": "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "title": "" }, { "docid": "8be889fa4941c249e3f9b601851d5fde", "score": "0.5865073", "text": "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "title": "" }, { "docid": "a46d3bb8e20336051fcd2e9db0470159", "score": "0.58509415", "text": "handleStart(inputData) {\n return this.startHandler(inputData);\n }", "title": "" }, { "docid": "fcd43c5a7b7363d7439832a0c8f20948", "score": "0.5848757", "text": "function handleStartReading() {\n let q = $$('question')\n q.style.textAlign = 'left';\n q.innerText = global_passages[global_passage_pointer];\n\n $$('start_reading_button').remove();\n\n let stb = makeStopReadingButton();\n q.after(stb);\n global_passage_pointer += 1;\n global_timestamp = new Date();\n}", "title": "" }, { "docid": "b225b01094abd03240b47db4d9bfa391", "score": "0.5804462", "text": "function Input() {}", "title": "" }, { "docid": "03cc17ada13e872274abfa04f676daf0", "score": "0.57980657", "text": "onLineStart() { }", "title": "" }, { "docid": "5b2ec1e4173378be72bb4a4434fab47e", "score": "0.57756937", "text": "preStep() {\n if (this.pressedKeys.up) {\n this.sendInput('up', { movement: true });\n }\n\n if (this.pressedKeys.down) {\n this.sendInput('down', { movement: true });\n }\n\n if (this.pressedKeys.left) {\n this.sendInput('left', { movement: true });\n }\n\n if (this.pressedKeys.right) {\n this.sendInput('right', { movement: true });\n }\n\n if (this.pressedKeys.space) {\n this.sendInput('space', { movement: true });\n }\n }", "title": "" }, { "docid": "cd5a0ff48f1d21ed6563c7a37e402f4d", "score": "0.57420474", "text": "constructor(input, start){\n this.input = input\n this.start = start \n }", "title": "" }, { "docid": "cd5a0ff48f1d21ed6563c7a37e402f4d", "score": "0.57420474", "text": "constructor(input, start){\n this.input = input\n this.start = start \n }", "title": "" }, { "docid": "00a70f31bbabaef0e7a03b6594b05744", "score": "0.5739593", "text": "preStep() {\n if (this.controls) {\n if (this.controls.activeInput.up) {\n this.sendInput('up', { movement: true });\n }\n\n if (this.controls.activeInput.left) {\n this.sendInput('left', { movement: true });\n }\n\n if (this.controls.activeInput.right) {\n this.sendInput('right', { movement: true });\n }\n\n if (this.controls.activeInput.down) {\n this.sendInput('down', { movement: true });\n }\n }\n }", "title": "" }, { "docid": "642518e37ac50b36692437f373d3b029", "score": "0.5721225", "text": "function processInput (input, data) {\n let {settings, commands, player, places, messages, defaults} = data\n\n input = input.toLowerCase()\n\n if (input.length > 0) {\n println(settings.prepend + input)\n line()\n }\n\n // ask for help\n if (input.indexOf(commands.help) > -1) {\n println(messages.helpText)\n\n // look around describe where you are\n } else if (input.indexOf(commands.observe) > -1) {\n if (canSee(player)) {\n println(description(player.currentLocation, places))\n } else {\n println(messages.visibilityError)\n }\n\n // walk places\n } else if (input.indexOf(commands.move) > -1) {\n // input = input.replace(\"walk to\", \"\").trim().input.replace(\"the\", \"\").trim()\n let placeName = trimInput(input, commands.move)\n let place = placeFromString(placeName, places)\n if (place !== undefined) {\n place = applyPlaceDefaults(place, defaults)\n if (locationIsAccessable(place, player.currentLocation, places) && place !== undefined) {\n if (!locationIsLocked(place, player.pockets)) {\n player = walkTo(player, placeName, places, defaults)\n if (player.currentLocation.settings.isLocked) {\n println(player.currentLocation.messages.successEntryGranted)\n }\n player.currentLocation = unlockLocation(player.currentLocation, player.pockets)\n if (player.currentLocation.leaveUnlocked) {\n println(player.currentLocation.messages.unlock)\n }\n println(messages.moveMessage + placeName)\n } else {\n println(place.messages.locked)\n }\n } else if (place === player.currentLocation) {\n println(messages.moveRedundancy + place.name)\n } else {\n println(messages.moveError)\n }\n } else {\n println(messages.moveError)\n }\n\n // take items\n } else if (input.indexOf(commands.gainItem) > -1) {\n let item = trimInput(input, commands.gainItem)\n if (item in player.currentLocation.objects) {\n player.currentLocation.objects = hashRemove(item, player.currentLocation.objects)\n player.pockets = hashAdd(item, player.pockets)\n println(messages.pickUpSuccess + addArticle(item))\n } else {\n println(messages.pickUpError + addArticle(item))\n }\n\n // drop items\n } else if (input.indexOf(commands.loseItem) > -1) {\n let item = trimInput(input, commands.loseItem)\n if (item in player.pockets) {\n player.pockets = hashRemove(item, player.pockets)\n player.currentLocation.objects = hashAdd(item, player.currentLocation.objects)\n println(messages.dropSuccess + addArticle(item))\n } else {\n println(messages.inventoryItemError + addArticle(item))\n }\n } else if (input.indexOf(commands.useItem) > -1) {\n let item = trimInput(input, commands.useItem)\n if (item in player.pockets) {\n if (player.currentLocation.exchanges[item]) {\n player.pockets = hashRemove(item, player.pockets)\n player.pockets = hashAdd(player.currentLocation.exchanges[item], player.pockets)\n println(messages.exchangeSuccess + addArticle(player.currentLocation.exchanges[item]))\n } else {\n println(messages.useError)\n }\n } else {\n println(messages.inventoryItemError + addArticle(item))\n }\n\n // take inventory\n } else if (input.indexOf(commands.takeInventory) > -1) {\n if (player.pockets !== {}) {\n println(hashList(player.pockets, messages.inventoryError))\n }\n } else if (input.indexOf(commands.perceiveItems) > -1) {\n println(hashList(player.currentLocation.objects))\n } else {\n if (input.length > 0) {\n println(messages.commandInvalid)\n }\n }\n Object.assign(data, {player, places})\n return data\n}", "title": "" }, { "docid": "02650f301674d92b2bedf2aa4b30dc8c", "score": "0.5721043", "text": "start(){\r\n process.stdin.resume();\r\n process.stdin.setEncoding('utf8');\r\n prompt();\r\n \r\n process.stdin.on('data', function(chunk) {\r\n let [success, res, more] = parseCommand(chunk.replace('\\n', '').replace('\\r', ''));\r\n if (!success){\r\n switch(res){\r\n case errcodes.NOCOMMAND :\r\n console.error(`CommandLine Error : nonexistant command (${more})`);\r\n break;\r\n case errcodes.NONAMESPACE :\r\n console.error(`CommandLine Error : nonexistant namespace (${more})`);\r\n break;\r\n } \r\n }\r\n logging = false;\r\n prompt();\r\n });\r\n logging = false;\r\n }", "title": "" }, { "docid": "443396074c7f108a223879c4a5b19d5b", "score": "0.57184917", "text": "function\trunProcessing() {\n initProcessing();\n}", "title": "" }, { "docid": "4659af89ea53888de41c2daaecafc494", "score": "0.57123506", "text": "function start() {\n\t\tdisabled(\"start\", true);\n\t\tinput = document.getElementById(\"content\").value;\n\t\tinput = input.split(/\\s+/);\n\n\t\tvar speed = speedChange();\n\t\ttimer = setInterval(readIt, speed);\n\t}", "title": "" }, { "docid": "a2e9c598ec2da1a38f11e2627236486f", "score": "0.5711759", "text": "processUserInput() {\n this.state.clearControllers();\n this.state.flags[Defines.INPUT] = false;\n this.state.flags[Defines.HADMATCH] = false;\n this.state.vars[Defines.UNKNOWN_WORD] = 0;\n this.state.vars[Defines.LAST_CHAR] = 0;\n\n // If opening of the menu was \"triggered\" in the last cycle, we open it now before processing the rest of the input.\n if (this.state.menuOpen) {\n this.menu.menuInput();\n }\n\n // F12 shows the priority and control screens.\n if (this.userInput.keys[123] && !userInput.oldKeys[123]) {\n while (this.userInput.keys[123]);\n this.commands.showPriorityScreen();\n }\n\n // Handle arrow keys.\n if (this.state.userControl) {\n if (this.state.holdKey) {\n // In \"hold key\" mode, the ego direction directly reflects the direction key currently being held down.\n let direction = 0;\n if (this.userInput.Keys[38]) direction = 1; // UP\n if (this.userInput.Keys[33]) direction = 2; // PAGEUP\n if (this.userInput.Keys[39]) direction = 3; // RIGHT\n if (this.userInput.Keys[34]) direction = 4; // PAGEDOWN\n if (this.userInput.Keys[40]) direction = 5; // DOWN\n if (this.userInput.Keys[35]) direction = 6; // END\n if (this.userInput.Keys[37]) direction = 7; // LEFT\n if (this.userInput.Keys[36]) direction = 8; // HOME\n this.state.vars[Defines.EGODIR] = direction;\n }\n else {\n // Whereas in \"release key\" mode, the direction key press will toggle movement in that direction.\n let direction = 0;\n if (this.userInput.keys[38] && !this.userInput.oldKeys[38]) direction = 1; // UP\n if (this.userInput.keys[33] && !this.userInput.oldKeys[33]) direction = 2; // PAGEUP\n if (this.userInput.keys[39] && !this.userInput.oldKeys[39]) direction = 3; // RIGHT\n if (this.userInput.keys[34] && !this.userInput.oldKeys[34]) direction = 4; // PAGEDOWN\n if (this.userInput.keys[40] && !this.userInput.oldKeys[40]) direction = 5; // DOWN\n if (this.userInput.keys[35] && !this.userInput.oldKeys[35]) direction = 6; // END\n if (this.userInput.keys[37] && !this.userInput.oldKeys[37]) direction = 7; // LEFT\n if (this.userInput.keys[36] && !this.userInput.oldKeys[36]) direction = 8; // HOME\n if (direction > 0) {\n this.state.vars[Defines.EGODIR] = (this.state.vars[Defines.EGODIR] == direction ? 0 : direction);\n }\n }\n }\n\n // Check all waiting characters.\n let ch;\n while ((ch = this.userInput.getKey()) > 0) {\n // Check controller matches. They take precedence.\n if (this.state.keyToControllerMap.has(ch)) {\n this.state.controllers[this.state.keyToControllerMap[ch]] = true;\n }\n else if ((ch >= (0x80000 + 'A'.charCodeAt(0))) && (ch <= (0x80000 + 'Z'.charCodeAt(0))) && \n (this.state.keyToControllerMap.has(0x80000 + String.fromCharCode(ch - 0x80000).toLowerCase().charCodeAt(0)))) {\n // We map the lower case alpha chars in the key map, so check for upper case and convert to\n // lower when setting controller state. This allows for if the user has CAPS LOCK on.\n this.state.controllers[this.state.keyToControllerMap[0x80000 + String.fromCharCode(ch - 0x80000).toLowerCase().charCodeAt(0)]] = true;\n }\n else if ((ch & 0xF0000) == 0x80000) // Standard char from a keypress event. \n {\n this.state.vars[Defines.LAST_CHAR] = (ch & 0xff);\n\n if (this.state.acceptInput) {\n // Handle normal characters for user input line.\n if ((this.state.strings[0].length + (this.state.cursorCharacter != '' ? 1 : 0) + this.state.currentInput.length) < Defines.MAXINPUT)\n {\n this.state.currentInput += String.fromCharCode(ch & 0xff);\n }\n }\n }\n else if ((ch & 0xFF) == ch) // Unmodified Keys value, i.e. there is no modifier. \n {\n this.state.vars[Defines.LAST_CHAR] = (ch & 0xff);\n\n if (this.state.acceptInput) {\n // Handle enter and backspace for user input line.\n switch (ch) {\n case 13: // ENTER\n if (this.state.currentInput.length > 0)\n {\n this.parser.parse(this.state.currentInput);\n this.state.lastInput = this.state.currentInput;\n this.state.currentInput = '';\n }\n while (this.userInput.keys[13]) { /* Wait until ENTER released */ }\n break;\n\n case 8: // BACK\n if (this.state.currentInput.length > 0) {\n this.state.currentInput = this.state.currentInput.slice(0, -1);\n }\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "03b63e1485bc9fd89ed53365feba69f4", "score": "0.56983745", "text": "function readInt() {\n while (true) {\n const code = _base.input.charCodeAt(_base.state.pos);\n if (\n (code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) ||\n (code >= _charcodes.charCodes.lowercaseA && code <= _charcodes.charCodes.lowercaseF) ||\n (code >= _charcodes.charCodes.uppercaseA && code <= _charcodes.charCodes.uppercaseF) ||\n code === _charcodes.charCodes.underscore\n ) {\n _base.state.pos++;\n } else {\n break;\n }\n }\n}", "title": "" }, { "docid": "e6b1c51a5a4fc96e5c283051cdafff62", "score": "0.569558", "text": "function OpenPCS_Read_NodeHandler_OnNodesStarted ()\n {\n\n TraceMsg ('{OpenPCS_Read_Node} process initial input state...');\n\n // show initial IPC state in editor\n OpenPCS_Read_ShowIpcState (IPC_STATE_IDLE);\n\n return;\n\n }", "title": "" }, { "docid": "0d8da17f25c01e19c2882c2feac52d6b", "score": "0.5692721", "text": "function readInput(err,data){\r\n if (err) {\r\n return console.log(err);\r\n }\r\n inputString = data.split('\\n');\r\n \r\n main();\r\n}", "title": "" }, { "docid": "226b970b5bed79fd529669216c9e7223", "score": "0.56872064", "text": "function checkInput() {\n transformToUpper();\n if (!isStart) {\n showInitialMessage();\n } else {\n initmessageStatus();\n }\n renderTextColor();\n disableBth();\n}", "title": "" }, { "docid": "b6b3882fdc4c2d41e903753cfa03bfdf", "score": "0.56832254", "text": "function processInput() {\n //\n // Double buffering on the queue so we don't asynchronously receive inputs\n // while processing.\n let processMe = inputQueue;\n inputQueue = [];\n\n for (let inputIndex in processMe) {\n let input = processMe[inputIndex];\n let client = activeClients[input.clientId];\n client.lastMessageId = input.message.id;\n switch (input.message.type) {\n case 'thrust':\n // Need to compute the difference since the last update and when the thrust\n // input was received. This time difference needs to be simulated before the\n // thrust input is processed in order to keep the client and server thinking\n // the same think about the player's ship.\n client.player.thrust(input.message.elapsedTime, input.receiveTime - lastUpdateTime);\n lastUpdateTime = input.receiveTime;\n break;\n case 'rotate-left':\n client.player.rotateLeft(input.message.elapsedTime);\n break;\n case 'rotate-right':\n client.player.rotateRight(input.message.elapsedTime);\n break;\n case 'fire':\n client.player.fire(input.message.elapsedTime);\n break;\n case 'join-game':\n handleJoinGame(input);\n break;\n case 'hyperspace':\n client.player.hyperspace(input);\n break;\n }\n }\n}", "title": "" }, { "docid": "5ff7ebe67ba31c50ef80f0b8b0489e73", "score": "0.56656474", "text": "function preRunFunc() {\n\t\tonglets_ui.tabs();\n\t\tgetOngletsChannels();\n\t\tonInputFocus();\n\t\tonInputFocusOut();\n\t\tformSubmit();\n\t\tputButtonsEvents();\n\t}", "title": "" }, { "docid": "a9da2d93378367ebbd1cab8c60f95624", "score": "0.5660496", "text": "function readInt() {\n while (true) {\n const code = input.charCodeAt(state.pos);\n if (\n (code >= charCodes.digit0 && code <= charCodes.digit9) ||\n (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) ||\n (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) ||\n code === charCodes.underscore\n ) {\n state.pos++;\n } else {\n break;\n }\n }\n}", "title": "" }, { "docid": "3792a731f4550b1cc4d7a2a03c67eb58", "score": "0.5658239", "text": "function processInput() {\r\n let construction = $(\"#opaqueThick\").val();\r\n let constructionType = $(\"#insulationOptions option:selected\").val();\r\n let window = $(\"#windowSlider\").val();\r\n let chapters = $(\"#chapters\").val()\r\n \r\n\r\n draw(construction, window);\r\n opaqueThick(construction, constructionType);\r\n calculateOutputBoxes(construction, window);\r\n concept();\r\n\r\n \r\n\r\n}", "title": "" }, { "docid": "d85c8fd86beded7af6211e3f564a87a6", "score": "0.5642268", "text": "function startPipeline() {\n // In this way we read one block while we decode and play another.\n if (state.state == STATE.PLAYING) {\n processState();\n }\n processState();\n }", "title": "" }, { "docid": "feba7ddebafd35a8519a892e1c9d7b19", "score": "0.5642256", "text": "function Input()\n{\n\tmap.input();\n\tplayer1.input(input1);\n\tplayer2.input(input2);\n}", "title": "" }, { "docid": "a5333c0a18c79122f14d5f02b36eded7", "score": "0.5636012", "text": "function readIt() {\n\t\tdisplayText(false); \n\t\tcount++;\n\n\t\tif (count >= input.length) { // stop when the input reaches the last word\n\t\t\tcount = 0;\n\t\t\tstop();\n\t\t}\n\t}", "title": "" }, { "docid": "6b09b98e289f6bb1396834272a4322fe", "score": "0.56147426", "text": "_start_instruction() {\n\t\t\tthis.current_start_time = Date.now();\n\t\t\tthis._start_mouse_track();\n\t\t}", "title": "" }, { "docid": "7afb3abb5ffcd68bdd830f8eb7b59c4e", "score": "0.56083983", "text": "function readInput() {\n if (controls.moveUp) player.moveUp();\n if (controls.moveDown) player.moveDown();\n if (controls.moveLeft) player.moveLeft();\n if (controls.moveRight) player.moveRight();\n if (controls.faceUp) player.faceUp();\n if (controls.faceDown) player.faceDown();\n if (controls.faceLeft) player.faceLeft();\n if (controls.faceRight) player.faceRight();\n if (controls.shoot) player.shoot();\n}", "title": "" }, { "docid": "a9dec66ebf231d93932371552bfae139", "score": "0.5601557", "text": "begin() {\n //for (let [, arr] of this.arrangements.filter(a => a.at === this.iterations && a.when === \"start\")) arr.exe();\n this.engine.phases.current = this;\n this.engine.events.emit(this.name, this);\n }", "title": "" }, { "docid": "1f96aba9704043824a8261b4d8cafb77", "score": "0.5601379", "text": "function beginProcess() {\n checkArrays((checkArraysErr) => {\n if (checkArraysErr) {\n course.error(checkArraysErr);\n callback(null, course, item);\n return;\n }\n\n checkPages();\n callback(null, course, item);\n });\n }", "title": "" }, { "docid": "51f8e02aa3a27dd8f54d0ba760bc7ebe", "score": "0.55920976", "text": "async run() { \n\t//loop read from the input channel \n\twhile(true ) {\n\n\t this.feedback(\"continue\")\n\n\t let text = await this.get_input() \n\t if (text == undefined || text == \"finished\") { break }\n\t this.chunks.push(text) \n\t}\n\t//input channel has been closed \n\tthis.finish({payload : { result : this.chunks.join(this.args.joiner || \"\\n\")} }) \n }", "title": "" }, { "docid": "2afc447b314447afd4da2acbcdd24228", "score": "0.5591767", "text": "function inputSetup() {\n nameInpX = windowWidth / 2 - 240;\n nounInpX = windowWidth / 2 - 65.5;\n adjInpX = windowWidth / 2 + 127;\n //name\n nameInput = createInput('');\n nameInput.size(inpW, inpH);\n // nameInput.position(nameInpX, inpY);\n nameInput.id('name');\n nameInput.changed(updateName);\n //what do you like\n nounInput = createInput('');\n nounInput.size(inpW, inpH);\n nounInput.position(nounInpX, inpY);\n //describe yourself\n adjInput = createInput('');\n adjInput.size(inpW, inpH);\n adjInput.position(adjInpX, inpY);\n}", "title": "" }, { "docid": "ac9ba2ad04bfdc0d432fb30ef8a733be", "score": "0.5584081", "text": "async start() {\n await this._wait(this.startDelay)\n\n for (let line of this.lines) {\n const type = line.getAttribute(this.pfx)\n const delay = line.getAttribute(`${this.pfx}-delay`) || this.lineDelay\n\n if (type == \"input\") {\n line.setAttribute(`${this.pfx}-cursor`, this.cursor)\n await this.type(line)\n await this._wait(delay)\n } else if (type == \"progress\") {\n await this.progress(line)\n await this._wait(delay)\n } else {\n this.container.appendChild(line)\n await this._wait(delay)\n }\n\n line.removeAttribute(`${this.pfx}-cursor`)\n }\n }", "title": "" }, { "docid": "a2de24a93a16a108ff074295016259e3", "score": "0.5551101", "text": "function userinput()\n{\n\twindow.addEventListener(\"keydown\", function (event) {\n\t\tif (event.defaultPrevented) {\n\t\t\treturn; // Do nothing if the event was already processed\n\t\t}\n\n\t\tswitch (event.key) {\n\t\t\tcase \"b\":\n\t\t\t\t// code for \" \" key press.\n\t\t\t\tif(baw==0)\n\t\t\t\t{\n\t\t\t\t\tbaw=1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbaw=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"l\":\n\t\t\t\t// code for \" \" key press.\n\t\t\t\tif(lighton==0)\n\t\t\t\t{\n\t\t\t\t\tlighton=1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlighton=0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \" \":\n\t\t\t\t// code for \" \" key press.\n\t\t\t\tconsole.log(hoverbonus);\n\t\t\t\tif(hoverbonus>0)\n\t\t\t\t{\n\t\t\t\t\tend-=1;\n\t\t\t\t\thoverbonus-=1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"ArrowDown\":\n\t\t\t\t// code for \"down arrow\" key press.\n\t\t\t\tcharacter.tick(\"d\",ontrain);\n\t\t\t\tbreak;\n\t\t\tcase \"ArrowLeft\":\n\t\t\t\t// code for \"left arrow\" key press.\n\t\t\t\tpol.tick(\"l\");\n\t\t\t\td.tick(\"l\");\n\t\t\t\tcharacter.tick(\"l\",ontrain);\n\t\t\t\tif(character.getpos()[0]==-6)\n\t\t\t\t{\n\t\t\t\t\tdead=1;\n\t\t\t\t\tend+=1;\n\t\t\t\t\tpol.tick(\"r\");\n\t\t\t\t\td.tick(\"r\");\n\t\t\t\t\tcharacter.tick(\"r\",ontrain);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"ArrowRight\":\n\t\t\t\t// code for \"right arrow\" key press.\n\t\t\t\tpol.tick(\"r\");\n\t\t\t\td.tick(\"r\");\n\t\t\t\tcharacter.tick(\"r\",ontrain);\n\t\t\t\tif(character.getpos()[0]==6)\n\t\t\t\t{\n\t\t\t\t\tdead=1;\n\t\t\t\t\tend+=1;\n\t\t\t\t\tpol.tick(\"l\");\n\t\t\t\t\td.tick(\"l\");\n\t\t\t\t\tcharacter.tick(\"l\",ontrain);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn; // Quit when this doesn't handle the key event.\n\t\t}\n\n\t\t// Cancel the default action to avoid it being handled twice\n\t\tevent.preventDefault();\n\t}, true);\n\t// the last option dispatches the event to the listener first,\n\t// then dispatches event to window\n}", "title": "" }, { "docid": "a3b1366299d24b2ae0ef33c818c9a497", "score": "0.554081", "text": "function processInput(){\n // add anything from all files\n $('.input').each(function(i, e){\n var data = $(e).val();\n if (data.startsWith(PREFIX_BTCDE)) doBitcoinDe(data);\n else if (data.startsWith(PREFIX_BITWALA_BANK)) doBitwalaBank(data);\n else if (data.startsWith(PREFIX_BITWALA_TOPUP)) doBitwalaTopup(data);\n else if (data.startsWith(PREFIX_XAPO)) doXapo(data);\n else if (data.startsWith(PREFIX_KRAKEN)) doKraken(data);\n else if (data.startsWith(PREFIX_OTC)) doOtc(data);\n else if (data.startsWith(PREFIX_WALLETS)) doWallets(data);\n else alert('Input not suported: '+$(e).prev().html());\n postProcessInput();\n });\n}", "title": "" }, { "docid": "fd52e1e4b886a385a5c65c2c3b9b58e7", "score": "0.5539944", "text": "begin() {\n for (let i = 0; i < this.operationCount; i++) {\n this.read();\n this.write();\n this.move();\n this.changeState();\n }\n }", "title": "" }, { "docid": "65782c1052b6b2ecc2b27f3e9afd80c7", "score": "0.55209833", "text": "function start(){\n\tautoCompleteSearch();\n\tsubmitButton();\n\tsubmitButtonRandom();\n\tnewSearch();\n\trandomChar();\n\thideCarouselNav();\n}", "title": "" }, { "docid": "63695f1be1bf72f57e4fe71f5cdfe2b1", "score": "0.55140126", "text": "doInputLocal(message) {\n\n // some synchronization strategies (interpolate) ignore inputs on client side\n if (this.gameEngine.ignoreInputs) {\n return;\n }\n\n const inputEvent = { input: message.data, playerId: this.gameEngine.playerId };\n this.gameEngine.emit('client__processInput', inputEvent);\n this.gameEngine.emit('processInput', inputEvent);\n this.gameEngine.processInput(message.data, this.gameEngine.playerId, false);\n }", "title": "" }, { "docid": "6e63f75a460da2f2d61a4b3b58fd8f8c", "score": "0.5507063", "text": "function startingState( FIELD ){\n\tif( MSGIN==0 && KEYIN==0 && CLICK==1){//If message and key index are zero\n\t\t$( FIELD ).val(\"\");\t\t\t\t\t\t//Blank out the text of the specified field\n\t\tupdateData();\t\t\t\t\t\t\t\t\t//Update the global data values\n\t\t$(\"#msgbox\").fadeIn(500);\t\t\t//Show the hidden messagebox\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Based on encryption or decryption is run\n\t\tif( FIELD == \"#ctext\")\t\t\t\t//Disable decryption buttons\n\t\t\t$(\"#decryptRun,#decryptStep\").prop(\"disabled\", true);\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t//Disable encryption buttons\n\t\t\t$(\"#encryptRun,#encryptStep\").prop(\"disabled\", true);\n\t}\n}", "title": "" }, { "docid": "e5e22510cd279cdc22c2a83cdc905aea", "score": "0.55045736", "text": "function startAI() {\n if (nameInput.value !== \"\") {\n changeName();\n addRemoveEL(1);\n }\n}", "title": "" }, { "docid": "d6a87a2f93b88ee1d39fe6c7dccc0cbb", "score": "0.5504377", "text": "function handleInput() {\n process(input.value());\n}", "title": "" }, { "docid": "d6a87a2f93b88ee1d39fe6c7dccc0cbb", "score": "0.5504377", "text": "function handleInput() {\n process(input.value());\n}", "title": "" }, { "docid": "7774048a3569309d166202e50365f8d6", "score": "0.54968846", "text": "start() {// [3]\n }", "title": "" }, { "docid": "e05c3369f75311b17969cd66a86e33d8", "score": "0.5468505", "text": "function processingHotkey() {\n canAcceptNewInput = false;\n }", "title": "" }, { "docid": "1f5602643b033db887529e831b9d9b87", "score": "0.54641575", "text": "_autobegin(){\r\n if(!this._started)\r\n this.begin(false);\r\n }", "title": "" }, { "docid": "54ae3f03c9ec3d663b0eebb73dffd161", "score": "0.5459892", "text": "function start(){\n\tquestionOne();\n\t//submitForm();\n\tcheckBrowser();\n} // end start", "title": "" }, { "docid": "faf554e6f5f080f7efa4a78e384d5886", "score": "0.5458969", "text": "_inputChangedStart(evt) {\n var text = this._inputStart.value;\n\n this._inputChanged(text, this._inputStart, '#formatterStart', 'value');\n }", "title": "" }, { "docid": "fc273e89207ad4f9fa29e2bef9f3401f", "score": "0.5456792", "text": "function input() {\n rl.question('Length: ', length => {\n rl.question('Width: ', width => {\n rl.question('Height: ', height => {\n if (!isNaN(length) && !isNaN(width) && !isNaN(height)) {\n console.log(`\\nBeam: ${beam(length, width, height)}`);\n rl.close()\n } else {\n console.log(`Length, Width and Height must be a number\\n`);\n input()\n }\n })\n })\n })\n}", "title": "" }, { "docid": "b6bcc4c6e43bae0156c331c4a27f4c44", "score": "0.54502136", "text": "function Ctr700_DO_NodeHandler_OnNodesStarted ()\n {\n\n TraceMsg ('{Ctr700_DO_Node} process initial input state...');\n\n return;\n\n }", "title": "" }, { "docid": "09ca3a891199b6ca4a16ccb6a72ed20a", "score": "0.54457325", "text": "function processInputCommand()\n {\n var inputText = my.html.input.value\n var goodChars = my.current.correctInputLength\n\n if (inputCommandIs('restart') || inputCommandIs('rst')) {\n location.href = '#restart'\n } else if (inputCommandIs('fix') || inputCommandIs('xxx')){\n my.html.input.value = inputText.substring(0, goodChars)\n updatePracticePane()\n } else if (inputCommandIs('qtpi')) {\n qtpi()\n }\n }", "title": "" }, { "docid": "09ea2b57b6b4c201e43da87acb49524a", "score": "0.5444407", "text": "function handleStart (){\n $('#start').on('submit', function(e){\n e.preventDefault();\n store.quizStarted = true;\n store.questionNumber++;\n render();\n handleStart();\n handleSubmit();\n handleNext();\n handleRestart();\n });\n}", "title": "" }, { "docid": "6906de9a3a37287fc7a2c996a4423d5b", "score": "0.543331", "text": "_read(size) {\n if (this.inputs.length != 0) {\n // remove the first input, and push that on the next event loop\n let input = this.inputs[0];\n this.inputs = this.inputs.slice(1);\n // have to send with a newline\n setImmediate(() => this.push(`${input}\\n`));\n }\n }", "title": "" }, { "docid": "692f94f92b05c48a4b58a106e815d59a", "score": "0.5432599", "text": "scan(input){\n\n }", "title": "" }, { "docid": "a6ce703ee39143ccf60b2e781b78fa4a", "score": "0.5409141", "text": "function handleInput() {\n\t\t\tif (onInput) {\n\t\t\t\tonInput(value);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "287cb9def033a4cea1f323455f35720b", "score": "0.5403", "text": "function onReadableListener() {\n // Mark our flag as \"flowing\" so we know we're processing\n stdinFlowing = true;\n let chunk;\n // Use a loop to make sure we read all available data.\n while ((chunk = process.stdin.read()) !== null) {\n stdin += chunk.toString();\n }\n }", "title": "" }, { "docid": "2f5620804017d424d6556620b6ff9295", "score": "0.53842676", "text": "function startUpload(){\r\n if (checkInput()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "3e408681b752a4078be3e16f35e2e84b", "score": "0.5379804", "text": "function startByLine(line){\n inputs = \"\";\n var text = line.split(\",\");\n lCmd = text[0];\n\n\n for(var j=1; j<text.length;j++){\n inputs += text[j];\n inputs += \" \";\n }\n start();\n}", "title": "" }, { "docid": "80702f902ced1b0b952f6bce5569f431", "score": "0.5375244", "text": "function readLine() {\n return input_stdin_array[input_currentline++];\n}", "title": "" }, { "docid": "80702f902ced1b0b952f6bce5569f431", "score": "0.5375244", "text": "function readLine() {\n return input_stdin_array[input_currentline++];\n}", "title": "" }, { "docid": "9481310825b7baf05d5329d965754628", "score": "0.5364699", "text": "function doWhatItSays(){\n fs.readFile(\"random.txt\", \"utf8\", function(err,data){\n if(err){\n return console.log(err);\n }else{\n dataArray = data.split(\",\");\n request = dataArray[0];\n input= dataArray[1];\n userInput();\n\n }\n\n\n });\n}", "title": "" }, { "docid": "146b56b41199c0d76d228c30ffdf6925", "score": "0.5364087", "text": "function step(inputArray) {\n input = inputArray;\n createBlocksFromInput();\n moveBlocks();\n pressButtonsFromUserInput();\n fadeHitBlocks();\n}", "title": "" }, { "docid": "b3e512c25ebf532c17d761425de4d389", "score": "0.5359885", "text": "function setup() {\n\n//=============================================================================\n// Event Reader\n//=============================================================================\n\t\t\n\t\t// Creating the wrapper object the user will interface with.\n\t\tfunction EventReader() {}\n\t\tEventReader.fs = require('fs');\n\t\tEventReader.readline = require('readline');\n\t\tEventReader.utf8 = require('utf8');\n\t\t\n\t\t// Create an object to save event states into if we need to call external RMMV commands.\n\t\tEventReader.save = {};\n\t\t\n\t\t// Create an object to store RMMV commands into.\n\t\tEventReader.rmmvCommand = null;\n\t\t\n\t\t// Define within the object the line we're currently reading.\n\t\tEventReader.curr = 0;\t\n\t\t\n\t\t// Define a global container to access the event from.\n\t\tEventReader.lines = null;\n\t\t\n\t\t// The text to put before the main message, if anything.\n\t\tEventReader.pretext = \"\";\n\t\t\n\t\t// Records the choiceBlock. If this isn't null, it should trigger the 'readChoice' function.\n\t\tEventReader.choiceBlock = null;\n\t\t\n\t\t// The last file we saw.\n\t\tEventReader.lastSeenFile = null;\n\t\t\n\t\t// The block we're currently observing.\n\t\tEventReader.lastSeenBlock = null;\n\t\t\n\t\t// User command interface to read event files.\n\t\tEventReader.readEvent = function () {\n\t\t\t\n\t\t\t// Ensure we're in the correct mode to read messages.\n\t\t\t$gameMap._interpreter.setWaitMode(\"message\");\n\t\t\t\n\t\t\t// Pull from the first variable the value to read.\n\t\t\tlet filenameOrLines = $gameVariables.value(1);\n\t\t\t\n\t\t\t// Retrieve the file in pieces.\n\t\t\tif (Array.isArray(filenameOrLines)) {\n\t\t\t\tthis.lines = filenameOrLines;\n\t\t\t} else {\n\t\t\t\tthis.lastSeenFile = filenameOrLines;\n\t\t\t\tthis.lines = this.__processFile(filenameOrLines).split(/\\r?\\n/);\n\t\t\t}\n\t\t\t\n\t\t\t// Process the data.\n\t\t\tthis.__processLines();\n\t\t};\n\t\t\n\t\t// Actually does the meat of reading an event.\n\t\t// Most of what it's looping over is global, so be careful when calling this.\n\t\tEventReader.__processLines = function() {\n\t\t\t\n\t\t\t// Set the curr pointer to a saved value if it exists, then clear the saved value.\n\t\t\tlet filenameOrLines = $gameVariables.value(1);\n\t\t\tif (!Array.isArray(filenameOrLines) && this.save[filenameOrLines]) {\n\t\t\t\tthis.curr = this.save[filenameOrLines];\n\t\t\t\tthis.save[filenameOrLines] = 0;\n\t\t\t} else {\n\t\t\t\tthis.curr = 0;\n\t\t\t}\n\t\t\t\n\t\t\t// Iterate through the commands, queuing the messages.\n\t\t\tfor (; this.curr < this.lines.length; this.curr++) {\n\t\t\t\t\n\t\t\t\tlet line = this.lines[this.curr];\n\t\t\t\tif (this.__isCommand(line)) {\n\t\t\t\t\t\n\t\t\t\t\t// Use the command code to reference the correct event action.\n\t\t\t\t\tif (!this.commands[this.__getCommandCode(line)](this.__getCommandArgs(line), this)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the command was invalid, though, print out an error.\n\t\t\t\t\t\t$gameMessage.newPage(); \n\t\t\t\t\t\t$gameMessage.add(\"<WordWrap>Whoops, this isn't a recognized code: \\n\" +\n\t\t\t\t\t\t\t\t\t\t this.__getCommandCode(line) +\n\t\t\t\t\t\t\t\t\t\t \"\\nPlease report this to Demi ASAP to get it fixed.\");\n\t\t\t\t\t}\n\t\t\t\t} else if (this.__isComment(line)) {\n\t\t\t\t\t\n\t\t\t\t\t// Ignore comments.\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// By default, queue a the line to display, adding any prepared pretext.\n\t\t\t\t\t$gameMessage.newPage();\n\t\t\t\t\t$gameMessage.add(\"<WordWrap>\" + this.pretext + line);\n\t\t\t\t\tthis.pretext = \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (this.rmmvCommand) {\n\t\t\t\t\tthis.__popCommand();\n\t\t\t\t\tthis.__saveEvent();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\n//=============================================================================\n// Event Reader Commands\n//=============================================================================\n\t\t\n\t\t// Prep the commands wrapper.\n\t\tEventReader.commands = {};\n\t\t\n\t\t// Queues a bit of text to separate messy text codes from the writing.\n\t\tEventReader.commands.pretext = function (theText, cntxt) {\n\t\t\tcntxt.pretext = theText;\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Sets an RMMV switch.\n\t\tEventReader.commands.setSwitch = function (rawArgs, cntxt) {\n\t\t\t\n\t\t\t// Split the args into meaning chunks.\n\t\t\tlet args = rawArgs.split(\" \");\n\t\t\tlet name = \"\";\n\t\t\tlet value = null;\n\t\t\t\n\t\t\tif (args[1].toLowerCase() !== \"true\" && args[1].toLowerCase() !== \"false\") {\n\t\t\t\tthrow \"InvalidInputError: cannot assign nonboolean value to switch.\";\n\t\t\t} else {\n\t\t\t\t// The RMMV name this switch is indexed with.\n\t\t\t\tname = cntxt.__formatVar(args[0]);\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t// The RMMV value to change it to.\n\t\t\t\tvalue = (args[1].toLowerCase() === \"true\");\t\n\t\t\t}\n\t\t\t\n\t\t\t// Update the value. Throw an error if the value isn't found.\n\t\t\tif ($dataSystem.switches.indexOf(name) === -1) {\n\t\t\t\tthrow \"DataNotFound: requested switch wasn't found!\";\n\t\t\t} else {\n\t\t\t\t$gameSwitches.setValue($dataSystem[\"switches\"].indexOf(name), value);\t\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Sets an RMMV switch.\n\t\tEventReader.commands.flipSwitch = function (theSwitch, cntxt) {\n\t\t\t\n\t\t\t// Update the value. Throw an error if the value isn't found.\n\t\t\tlet id = $dataSystem.switches.indexOf(cntxt.__formatVar(theSwitch));\n\t\t\tif (id === -1) {\n\t\t\t\tthrow \"DataNotFound: requested switch wasn't found!\";\n\t\t\t} else {\n\t\t\t\t$gameSwitches.setValue(id, !$gameSwitches.value(id));\t\n\t\t\t}\n\t\t\t\n\t\t\t// Confirm to the caller this worked properly.\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Sets an RMMV variable.\n\t\tEventReader.commands.setVar = function (rawArgs, cntxt) {\n\t\t\t\n\t\t\t// Split the args into meaning chunks.\n\t\t\tlet args = rawArgs.split(\"|\");\n\t\t\t\n\t\t\t// The RMMV name this value is indexed with, trimmed for whitespace and removing single quotes.\n\t\t\tlet name = cntxt.__formatVar(args[0]);\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t// The new value to set the var to.\n\t\t\tlet updatedValue = LogicEvaluator.__evaluateLogic(args[1]);\t\n\t\t\t\n\t\t\t// Update the value. Throw an error if the value isn't found.\n\t\t\tlet varIndex = $dataSystem.variables.indexOf(name);\n\t\t\tif (varIndex === -1) {\n\t\t\t\tthrow \"DataNotFound: requested variable wasn't found!\";\n\t\t\t} else {\n\t\t\t\t$gameVariables.setValue(varIndex, updatedValue);\t\n\t\t\t}\n\t\t\t\n\t\t\t// Let anything using this command know it executed properly.\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Begins an if statement.\n\t\t// Updates this.curr from outside the normal structure.\n\t\tEventReader.commands.stateIf = function (statement, cntxt) {\n\t\t\t\n\t\t\t// Whether we've executed a block already or not.\n\t\t\tlet hasExecuted = false;\n\t\t\t\n\t\t\t// Loop through the statements to find the first valid if statement in the chain.\n\t\t\t// Simultaneously, finds the end of the if block by ending when we see the endIf command.\n\t\t\twhile (cntxt.__getCommandCode(cntxt.lines[cntxt.curr]) !== \"endIf\") {\n\t\t\t\t\n\t\t\t\t// If this is a new elif statement, then change the statement to evaluate for entering the block.\n\t\t\t\tif (!hasExecuted && cntxt.__getCommandCode(cntxt.lines[cntxt.curr]) === \"elif\") {\n\t\t\t\t\tstatement = cntxt.__getCommandArgs(cntxt.lines[cntxt.curr]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If this if-statement is true, run its block, then return to the block we were at before.\n\t\t\t\tlet blockOpen = LogicEvaluator.__evaluateLogic(statement);\n\t\t\t\tif (!hasExecuted && typeof blockOpen === \"boolean\" && blockOpen) {\n\t\t\t\t\tcntxt.__runBlock(cntxt.__getIfBlock(cntxt.curr + 1), cntxt);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Check and update our status relative to the lines.\n\t\t\t\tif (cntxt.curr === cntxt.lines.length - 1) {\n\t\t\t\t\t\n\t\t\t\t\t// If the command never hit a endIf, alert the player.\n\t\t\t\t\t$gameMessage.newPage(); \n\t\t\t\t\t$gameMessage.add(\"<WordWrap>Whoops, I didn't close this if statement... \\n\",\n\t\t\t\t\t\t\t\t\t \"\\nPlease report this to Demi ASAP to get it fixed.\");\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcntxt.curr++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Exit the satement on the line after the endIf code.\n\t\t\tif (cntxt.__getCommandCode(cntxt.lines[cntxt.curr]) === \"endIf\") { cntxt.curr++; }\n\t\t\t\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Begins a while statement.\n\t\t// Updates this.curr from outside the normal structure.\n\t\tEventReader.commands.stateWhile = function (statement, cntxt) {\n\t\t\t\n\t\t\t// Prep the block of code if the initial loop is valid.\n\t\t\tlet block = [];\n\t\t\tif (LogicEvaluator.__evaluateLogic(statement)) { \n\t\t\t\tblock = cntxt.__getWhileBlock(cntxt.curr + 1); \n\t\t\t}\n\t\t\t\n\t\t\t// Repeatedly process this block if true. \n\t\t\t// May infinitely loop, if there's no exit condition.\n\t\t\twhile (block.length > 0 && LogicEvaluator.__evaluateLogic(statement)) {\n\t\t\t\tcntxt.__runBlock(block, cntxt);\n\t\t\t}\n\t\t\t\n\t\t\t// Update our status relative to the lines.\n\t\t\twhile (cntxt.__getCommandCode(cntxt.lines[cntxt.curr]) !== \"endWhile\") {\n\t\t\t\tif (cntxt.curr === cntxt.lines.length - 1) {\n\t\t\t\t\t\n\t\t\t\t\t// If the command never hit a whileEnd, alert the player.\n\t\t\t\t\t$gameMessage.newPage(); \n\t\t\t\t\t$gameMessage.add(\"<WordWrap>Whoops, I didn't close this if statement... \\n\",\n\t\t\t\t\t\t\t\t\t \"\\nPlease report this to Demi ASAP to get it fixed.\");\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcntxt.curr++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Exit the satement on the line after the endWhile code.\n\t\t\tif (cntxt.__getCommandCode(cntxt.lines[cntxt.curr]) === \"endWhile\") { cntxt.curr++; }\n\t\t\t\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Opens a new file and starts us looking at that, then returns us back to the file we were at.\n\t\tEventReader.commands.openEvent = function (filename, cntxt) {\n\t\t\t\n\t\t\tcntxt.__runBlock(cntxt.__processFile(\"./js/events/\" + filename).split(/\\r?\\n/), cntxt);\n\t\t\t\n\t\t\t// Note to the outside function this ran properly.\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Creates an RMMV choice. \n\t\t// Adding 'd' to the left of a choice makes it default. Adding 'c' to the left of a choice makes it a cancel. \n\t\tEventReader.commands.stateChoice = function (args, cntxt) {\n\t\n\t\t\t// Set the 'default' option to the first choice by default.\n\t\t\tlet defaultOption = 0;\n\t\t\t\n\t\t\t// Turn off the 'cancel' option by default.\n\t\t\tlet cancelOption = -1;\n\t\t\t\n\t\t\t// Construct the choices.\n\t\t\targs = args.split(\" \");\n\t\t\tlet choices = [];\n\t\t\tfor (let i = 0; i < args.length; i++) {\n\t\t\t\t\n\t\t\t\tchoices.push(cntxt.__formatVar(args[i]));\n\t\t\t\t\n\t\t\t\t// Check if the option is default or cancel.\n\t\t\t\tif (cntxt.__isDefault(args[i])) { defaultOption = i; }\n\t\t\t\telse if (cntxt.__isCancel(args[i])) { cancelOption = i; }\n\t\t\t}\n\t\t\t\n\t\t\t// Assign the choices and blocks to read on a choice.\n\t\t\t$gameMessage.setChoices(choices, defaultOption, cancelOption);\n\t\t\tlet tempCurr = cntxt.curr;\n\t\t\t$gameMessage.setChoiceCallback(function(choice) {\n\t\t\t\tthis.choiceBlock = this.__getChoiceBlock(tempCurr, choice);\n\t\t\t}.bind(cntxt));\n\t\t\t\n\t\t\t// Continue to keep reading after the player chooses an option.\n\t\t\twhile (cntxt.__getCommandCode(cntxt.lines[cntxt.curr]) !== \"endChoice\") {\n\t\t\t\t\n\t\t\t\t// Check and update our status relative to the lines.\n\t\t\t\tif (cntxt.curr === cntxt.lines.length - 1) {\n\t\t\t\t\t\n\t\t\t\t\t// If the command never hit a endIf, alert the player.\n\t\t\t\t\t$gameMessage.newPage(); \n\t\t\t\t\t$gameMessage.add(\"<WordWrap>Whoops, I didn't close this choice statement... \\n\",\n\t\t\t\t\t\t\t\t\t \"\\nPlease report this to Demi ASAP to get it fixed.\");\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcntxt.curr++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Prep this command to run the choice in RMMV.\n\t\t\tlet readChoice = {\n\t\t\t\tcode: 355,\n\t\t\t\tindent: $gameMap._interpreter._indent,\n\t\t\t\tparameters: [\"EventReader.__readChoice();\"]\n\t\t\t};\n\t\t\tcntxt.__pushCommand(readChoice);\n\t\t\t\n\t\t\t// Note to the outside function this ran properly.\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t// Runs an RMMV Script Command.\n\t\tEventReader.commands.stateCommand = function (command, cntxt) {\n\t\n\t\t\t// Prep this command to pass to RMMV.\n\t\t\tlet rmmvScriptCommand = {\n\t\t\t\tcode: 356,\n\t\t\t\tindent: $gameMap._interpreter._indent,\n\t\t\t\tparameters: [command]\n\t\t\t};\n\t\t\tcntxt.__pushCommand(rmmvScriptCommand);\n\t\t\t\n\t\t\t// Note to the outside function this ran properly.\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\t\n\t\t\n//=============================================================================\n// Event Reader Dummy Commands\n//=============================================================================\n\t\t\n\t\t// The standard interpreter should never see this.\n\t\tEventReader.commands.elif = function (line) {\n\t\t\t$gameMessage.newPage(); \n\t\t\t$gameMessage.add(\"<WordWrap>Whoops, this shouldn't be legally reachable: \\n\",\n\t\t\t\t\t\t\t EventReader.__getCommandCode(line),\n\t\t\t\t\t\t\t \"\\nPlease report the event this is in to Demi ASAP to get it fixed!\");\n\t\t};\n\t\t\n\t\t// The standard interpreter should never see this.\n\t\tEventReader.commands.endIf = function (line) {\n\t\t\t$gameMessage.newPage(); \n\t\t\t$gameMessage.add(\"<WordWrap>Whoops, this shouldn't be legally reachable: \\n\",\n\t\t\t\t\t\t\t EventReader.__getCommandCode(line),\n\t\t\t\t\t\t\t \"\\nPlease report the event this is in to Demi ASAP to get it fixed!\");\n\t\t};\n\t\t\n\t\t// The standard interpreter should never see this.\n\t\tEventReader.commands.endWhile = function (line) {\n\t\t\t$gameMessage.newPage(); \n\t\t\t$gameMessage.add(\"<WordWrap>Whoops, this shouldn't be legally reachable: \\n\",\n\t\t\t\t\t\t\t EventReader.__getCommandCode(line),\n\t\t\t\t\t\t\t \"\\nPlease report the event this is in to Demi ASAP to get it fixed!\");\n\t\t};\n\t\t\n\t\t// The standard interpreter should never see this.\n\t\tEventReader.commands.endChoice = function (line) {\n\t\t\t$gameMessage.newPage(); \n\t\t\t$gameMessage.add(\"<WordWrap>Whoops, this shouldn't be legally reachable: \\n\",\n\t\t\t\t\t\t\t EventReader.__getCommandCode(line),\n\t\t\t\t\t\t\t \"\\nPlease report the event this is in to Demi ASAP to get it fixed!\");\n\t\t};\n\t\t\n\t\t\n//=============================================================================\n// Event Reader Helper Functions\n//=============================================================================\n\t\t\n\t\t// Runs the given block, then returns us back to running the block from before.\n\t\tEventReader.__runBlock = function(block, cntxt) {\n\t\t\tthis.lastSeenBlock = block;\n\t\t\tlet tempLines = cntxt.lines;\n\t\t\tlet tempCurr = cntxt.curr;\n\t\t\tcntxt.lines = block;\n\t\t\tcntxt.__processLines();\n\t\t\tcntxt.lines = tempLines;\n\t\t\tcntxt.curr = tempCurr;\n\t\t};\n\t\t\n\t\t// Returns an array of lines that defines an if-block.\n\t\t// Valid blocks: stateIf => elif; elif => elif; stateIf => endIf; elif => endIf\n\t\tEventReader.__getIfBlock = function (init) {\n\t\t\t\n\t\t\t// Loop until we see an ending statement or exhaust all lines.\n\t\t\t// Add anything that doesn't end the statement to the IfBlock.\n\t\t\tlet block = [];\n\t\t\tlet endSeen = false;\n\t\t\tfor (let i = init; !endSeen && i < this.lines.length; i++) {\n\t\t\t\t\n\t\t\t\tlet line = this.lines[i];\n\t\t\t\tif (this.__isCommand(line) \n\t\t\t\t && this.__getCommandCode(line) === \"elif\" \n\t\t\t || this.__getCommandCode(line) === \"endIf\" ) {\n\t\t\t\t\tendSeen = true;\n\t\t\t\t} else {\n\t\t\t\t\tblock.push(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn block;\n\t\t};\n\t\t\n\t\t// Returns an array of lines that defines a while-block.\n\t\tEventReader.__getWhileBlock = function (init) {\n\t\t\t\n\t\t\t// Loop until we see an ending statement or exhaust all lines.\n\t\t\t// Add anything that doesn't end the statement to the IfBlock.\n\t\t\tlet block = [];\n\t\t\tlet endSeen = false;\n\t\t\tfor (let i = init; !endSeen && i < this.lines.length; i++) {\n\t\t\t\t\n\t\t\t\tlet line = this.lines[i];\n\t\t\t\tif (this.__isCommand(line) && this.__getCommandCode(line) === \"endWhile\") {\n\t\t\t\t\tendSeen = true;\n\t\t\t\t} else {\n\t\t\t\t\tblock.push(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn block;\n\t\t};\n\t\t\n\t\t// Returns an array of lines that defines a choice-block.\n\t\tEventReader.__getChoiceBlock = function (init, choice) {\n\t\t\t\n\t\t\t\n\t\t\t// Add lines to the block until we see an ending statement or another choice.\n\t\t\tlet block = [];\n\t\t\tlet choiceFound = false;\n\t\t\tlet endSeen = false;\n\t\t\t\n\t\t\t// If we're within a block of some sort, properly observe the inside of the block.\n\t\t\tlet theLines = \"\";\n\t\t\tif (this.lastSeenBlock) {\n\t\t\t\ttheLines = this.lastSeenBlock;\n\t\t\t} else {\n\t\t\t\ttheLines = this.lines;\n\t\t\t}\n\t\t\t\n\t\t\tfor (let i = init; !endSeen && i < theLines.length; i++) {\n\t\t\t\t\n\t\t\t\tlet line = theLines[i];\n\t\t\t\tlet isChoiceCommand = this.__isCommand(line) && !isNaN(this.__getCommandCode(line));\n\t\t\t\t\n\t\t\t\tif (isChoiceCommand && !choiceFound && parseInt(this.__getCommandCode(line)) === choice) {\n\t\t\t\t\tchoiceFound = true;\n\t\t\t\t} else if ((isChoiceCommand && choiceFound || this.__getCommandCode(line) === \"endChoice\") && !endSeen) {\n\t\t\t\t\tendSeen = true;\n\t\t\t\t} else if (choiceFound) {\n\t\t\t\t\tblock.push(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn block;\n\t\t};\n\t\t\n\t\tEventReader.__getCommandCode = function (line) {\n\t\t\tlet code = line.split(':')[0];\n\t\t\treturn code.substring(3, code.length);\n\t\t};\n\t\t\n\t\tEventReader.__getCommandArgs = function (line) { return line.split(':')[1].trim(); };\n\t\t\n\t\tEventReader.__isCommand = function (line) {\n\t\t\treturn line.charAt(0) === '`' && line.charAt(1) === '`' && line.charAt(2) === '`'; \n\t\t};\n\n\t\tEventReader.__isComment = function (line) {\n\t\t\treturn line === \"\" || line.charAt(0) === '/' && line.charAt(1) === '/'; \n\t\t};\t\n\n\t\tEventReader.__isCancel = function (variable) {\n\t\t\treturn variable.endsWith(\"'c\");\n\t\t};\n\t\t\n\t\tEventReader.__isDefault = function (variable) {\n\t\t\treturn variable.endsWith(\"'d\");\n\t\t};\n\t\t\n\t\t// Trims any command codes and single-quotes around variables.\n\t\tEventReader.__formatVar = function (variable) {\n\t\t\tif (this.__isCancel(variable)) {\n\t\t\t\treturn variable.trim().replace(/'c/, \"\").replace(/'/g, \"\");\n\t\t\t} else if (this.__isDefault(variable)) {\n\t\t\t\treturn variable.trim().replace(/'d/, \"\").replace(/'/g, \"\");\n\t\t\t} else {\n\t\t\t\treturn variable.trim().replace(/'/g, \"\");\n\t\t\t}\n\t\t};\n\t\t\n\t\t// Allows a command to prep a command to run in RMMV.\n\t\tEventReader.__pushCommand = function (theCommand) {\n\t\t\tthis.rmmvCommand = theCommand;\n\t\t};\n\t\t\n\t\t// Sets up the pushed command for RMMV to run.\n\t\tEventReader.__popCommand = function () {\n\t\t\tlet nextCommand = $gameMap._interpreter._index + 1;\n\t\t\t$gameMap._interpreter._list[nextCommand] = this.rmmvCommand;\n\t\t\t$gameMap._interpreter._list[nextCommand + 1] = this.__returnToEvent;\n\t\t\tthis.rmmvCommand = null;\n\t\t};\n\t\t\n\t\t// Saves the event data\n\t\tEventReader.__saveEvent = function () {\n\t\t\tthis.save[this.lastSeenFile] = this.curr;\n\t\t};\n\t\t\n\t\t// Returns the gameMap back to the event command.\n\t\tEventReader.__returnToEvent = function () {\n\t\t\t$gameMap._interpreter._index -= 3;\n\t\t};\n\t\t\n\t\t// Reads choice contents in a separate command from runEvent.\n\t\t// Has to exist as a consequence of the way the update loop works for RMMV.\n\t\t// Essentially, after a callback, the gameMessage is cleared.\n\t\t// Anything added to it is lost, so you can't add more text. \n\t\tEventReader.__readChoice = function () {\n\t\t\t$gameVariables.setValue(1, this.choiceBlock);\n\t\t\tthis.choiceBlock = null;\n\t\t};\n\t\t\n\t\t// From Kino's tutorial. Reads a file and spits it out in utf8 format.\n\t\tEventReader.__processFile = function (filepath) {\n\t\t\treturn this.fs.readFileSync(filepath, \"utf8\");\n\t\t};\n\t\t\n\t\t\n//=============================================================================\n// Logic Evaluator\n//=============================================================================\n\t\t\n\t\t// Design the logic evaluator: \n\t\t// A tool for reading boolean logic for if statements and loops from RMMV templates.\n\n\t\t// Creating the wrapper object the user will interface with.\n\t\tfunction LogicEvaluator() {}\n\t\tLogicEvaluator.math = require(\"mathjs\");\n\t\t\n\t\t// The interface function through which the event reader will evaulate \n\t\t// logic that involves RMMV booleans.\n\t\tLogicEvaluator.__evaluateLogic = function(statement) {\n\t\t\t\n\t\t\t// If this statement has variables or switches, suss them out and replace with concrete values.\n\t\t\tlet names = this.__nameSnip(statement);\n\t\t\tlet values = [];\n\t\t\tfor (let n of names) { values.push(this.__rmmvNameQuery(n)); }\n\t\t\tlet logic = this.__nameStitch(statement, values);\n\t\t\t\n\t\t\treturn this.math.evaluate(logic);\n\t\t};\n\n\t\t// A helper function which pulls out a variable or switch name for use.\n\t\t// Returns an array of all variable and switch names it finds.\n\t\tLogicEvaluator.__nameSnip = function(toSnip) {\n\t\t\t\n\t\t\t// Split on \" ' \" then evaluate every other element for whether it's a valid RMMV name.\n\t\t\tlet diced = this.__splitLogic(toSnip);\n\t\t\tlet names = [];\n\t\t\tfor (let name = 1; name < diced.length - 1; name += 2) {\n\t\t\t\tif (!this.__isRMMVVar(diced[name]) && !this.__isRMMVSwitch(diced[name])) { \n\t\t\t\t\tthrow \"TypeError: This name doesn't follow proper var or switch naming conventions.\";\n\t\t\t\t} else {\n\t\t\t\t\tnames.push(diced[name]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn names;\n\t\t};\n\n\t\t// A helper function which queries RMMV for the var or switch information.\n\t\tLogicEvaluator.__rmmvNameQuery = function(varName) {\n\t\t\t\n\t\t\t// Query RMMV to find the relevant value.\n\t\t\tlet result = null;\n\t\t\tlet rmmvIndex = null;\n\t\t\tif (this.__isRMMVSwitch(varName)) {\n\t\t\t\trmmvIndex = $dataSystem.switches.indexOf(varName);\n\t\t\t\tresult = $gameSwitches.value($dataSystem.switches.indexOf(varName));\n\t\t\t} else if (this.__isRMMVVar(varName)) {\n\t\t\t\trmmvIndex = $dataSystem.variables.indexOf(varName);\n\t\t\t\tresult = $gameVariables.value($dataSystem.variables.indexOf(varName));\n\t\t\t} else {\n\t\t\t\tthrow \"DataNotFound: the queried variable or switch wasn't found in RMMV.\";\n\t\t\t}\n\t\t\t\n\t\t\t// If RMMV didn't find a valid entry...\n\t\t\tif (rmmvIndex === -1) {\n\t\t\t\tthrow \"TypeError: input is not formatted as a variable or switch string!\";\n\t\t\t} \n\t\t\t\n\t\t\treturn result;\n\t\t};\n\n\t\t// A helper function which stitches the queried var or switch values back into its string.\n\t\t// Expects the values to be in left to right order.\n\t\tLogicEvaluator.__nameStitch = function(toStitch, values) {\n\t\t\t\n\t\t\t// Split on \" ' \" then evaluate every other element for whether it's a valid RMMV name.\n\t\t\tlet diced = this.__splitLogic(toStitch);\n\t\t\t\n\t\t\t// But before that, check to make sure that the lengths of the paired arrays make sense.\n\t\t\tif ((diced.length - 1) / 2 < values.length) {\n\t\t\t\tthrow \"ValueMismatchError: there are too many values to stitch this string!\";\n\t\t\t} else if ((diced.length - 1) / 2 > values.length) {\n\t\t\t\tthrow \"ValueMismatchError: there aren't enough values to stitch this string!\";\n\t\t\t}\n\t\t\t\n\t\t\tlet stitched = \"\";\n\t\t\tfor (let name = 0; name < diced.length; name++) {\n\t\t\t\tif (name % 2 === 0) {\n\t\t\t\t\tstitched += diced[name];\n\t\t\t\t} else {\n\t\t\t\t\tstitched += String(values[(name - 1) / 2]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn stitched;\n\t\t};\n\n\n\t\t// Helpers Functions:\n\n\t\t// A helper function which splits away RMMV names from logic strings.\n\t\t// As RMMV names are between \" ' \"s, on a split, they'll always be odd numbered values.\n\t\tLogicEvaluator.__splitLogic = function(statement) { return statement.split(\"'\"); };\n\n\t\t// A helper function which determines if a name belongs to a var.\n\t\tLogicEvaluator.__isRMMVVar = function(name) { \n\t\t\treturn name.charAt(0) === 'v' && name.charAt(1) === '_';\n\t\t};\n\n\t\t// A helper function which determines if a name belongs to a switch.\n\t\tLogicEvaluator.__isRMMVSwitch = function(name) {\n\t\t\treturn name.charAt(0) === 's' && name.charAt(1) === '_';\n\t\t};\n\t\t\n\t\t// Add to RMMV.\n\t\twindow.LogicEvaluator = LogicEvaluator;\n\t\twindow.EventReader = EventReader;\n\t}", "title": "" }, { "docid": "d22146676de27a78c87f2ea6838b41f4", "score": "0.53579175", "text": "function processInput() {\n string = inputForm.value.toLowerCase();\n raiseError = checkInputError(string);\n\n if (raiseError) {\n showInputError();\n }\n else if (string != body.style.backgroundColor) {\n setColour(string);\n }\n}", "title": "" }, { "docid": "0dae94a36e6ca56eeb443c388980a3b6", "score": "0.53460884", "text": "function preRun(){\n console.log(\"preRun: Begin\")\n\n console.log(\"preRun: End\")\n\n}", "title": "" }, { "docid": "61008ffb81d2534313747cd50aa3c45c", "score": "0.5345916", "text": "enterEval_input(ctx) {\n\t}", "title": "" }, { "docid": "2fc4940c80f0ec2257b29aab0ab0c1c0", "score": "0.5343505", "text": "input()\n{\n const readline = require('readline-sync');\n const r1 = readline.createInterface({input: ProcessingInstruction.stdin, output : ProcessingInstruction.stdout})\n return r1;\n\n}", "title": "" }, { "docid": "f24ff0f732cbe14e8e9bc4764a7b29a6", "score": "0.5341068", "text": "startInput () {\n console.log('Starting input');\n\n this.ctx.canvas.tabIndex = 0;;\n\n let getXandY = function (e) {\n let x = e.clientX - that.ctx.canvas.getBoundingClientRect().left;\n let y = e.clientY - that.ctx.canvas.getBoundingClientRect().top;\n\n if (x < 1024) {\n x = Math.floor(x / 32);\n y = Math.floor(y / 32);\n }\n\n return { x: x, y: y };\n }\n\n let that = this;\n\n // control event listeners go here\n let map = {};\n\n this.ctx.canvas.addEventListener(\"mousemove\", function (e) {\n // e.preventDefault();\n that.cursor = that.getCursorPos(e);\n // console.log(`${e.code} is ${that.controls[e.code].active}`);\n\n }, false);\n\n this.ctx.canvas.addEventListener(\"mousedown\", function (e) {\n that.mouseDown = true;\n }, false);\n\n this.ctx.canvas.addEventListener(\"mouseup\", function (e) {\n that.mouseDown = false;\n }, false);\n\n this.ctx.canvas.addEventListener(\"keypress\", function (e) {\n if (String.fromCharCode(e.which) === ' ') that.pause = !that.pause;\n e.preventDefault();\n }, false);\n\n console.log('Input started');\n }", "title": "" }, { "docid": "19a159b1c96f7534c7d210088d988c6d", "score": "0.5339864", "text": "function initializeMenu() {\n \n showMainMenu();\n process.stdin.setEncoding('utf8');\n //assign callback for handling user input\n process.stdin.once('data', function (data) {\n \n var input = data.toString().trim();\n var inputArray = new Array();\n //var input = process.stdin.read();\n if (input !== null) {\n\n //split input into array\n \n if (input.match(/'/g)) {\n testArray = input.split(\"'\");\n var count = input.match(/'/g).length;\n //console.log(testArray);\n for (var i = 0; i < testArray.length; i++) {\n \n if (testArray[i] != '') {\n testArray[i] = testArray[i].trim();\n var token = new Array();\n if (i % 2 == 0) {\n token = testArray[i].split(' ');\n }\n else {\n token.push(testArray[i]);\n }\n //var token = testArray[i].split(' ');\n for (var j = 0; j < token.length; j++) {\n if (token[j] != '') {\n inputArray.push(token[j]);\n }\n\n }\n }\n };\n }\n else {\n inputArray = input.split(' ');\n }\n //menuHandler takes input array as an input\n menuHandler(inputArray);\n }\n });\n \n}", "title": "" }, { "docid": "d9a69d37d54059b8ab44b9fbfd0387b7", "score": "0.53328544", "text": "function setup() {\n\n noCanvas();\n\n // Selecting the text field and button\n input = select('#textinput');\n button = select('#submit');\n // What to do when button pressed\n button.mousePressed(handleInput);\n\n loadStrings('files/rainbow.txt', fileLoaded);\n\n regexInput = select('#regex');\n globalCheck = select('#global');\n caseCheck = select('#case');\n}", "title": "" } ]
e07fbb9052785363839ad94ca3f1daba
Do deep traversal of tree to find id that macthes
[ { "docid": "dbb5997aa81912f63eecda6a733ab7e0", "score": "0.70042974", "text": "function _findInTree(id, _tree, lc) {\n // console.log('_findInTree',id,_tree, lc)\n \n let found = false;\n let _obj = null\n \n while (!found) {\n \n // console.log('_tree.length',_tree.length)\n for (var i in _tree) {\n // console.log('_tree[i]',_tree[i])\n \n let _node = _tree[i] || null;\n // console.log('_node',_node)\n \n if (_node.id === id) {\n found = true;\n _obj = _node;\n break;\n } else {\n // console.log('_node.children',_node.children) \n var _kids = _node.children || null;\n // console.log('_kids',_kids) \n if (_kids) {\n let tmp = _findInTree(id, _kids, lc+1);\n // console.log('tmp',tmp)\n if (tmp) {\n found = true;\n _obj = tmp;\n break;\n } else {\n found = false;\n }\n }\n found = false;\n } // end if === else\n \n } // end i in tree\n break;\n \n } // end while\n \n // console.log('_findInTree return', _obj)\n return _obj;\n } // end findInTree", "title": "" } ]
[ { "docid": "2b2f4dcfb853cfdc60052e9616c056ff", "score": "0.63910615", "text": "function nextAnythingOf (_id) {\r\n\r\n\t\tvar previousId = '0',\r\n\t\t\tresult = _id,\r\n\t\t\tdone = false;\r\n\r\n\t\tfunction r (_metaNode) {\r\n\t\t\r\n\t\t\tvar thisId = _metaNode[0].id;\r\n\r\n\t\t\t// Test for end condition\r\n\t\t\tif (previousId === _id) { result = thisId; done = true; console.log(\"Found: \" + thisId + \" - prev=\" + previousId + \", target=\" + _id); return; }\r\n\r\n\t\t\t// Update backreference, unless it's the tree in which case skip it\r\n\t\t\tpreviousId = (thisId !== '0') ? thisId : previousId;\r\n\r\n\t\t\t// Check for more children\r\n\t\t\tif (_metaNode.length > 1 && !_metaNode[0].folded) {\r\n\r\n\t\t\t\tfor (var i = 1; i < _metaNode.length; i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tr(_metaNode[i]);\r\n\r\n\t\t\t\t\tif (done) { return; }\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tr(tree);\r\n\r\n\t\treturn result;\r\n\r\n\t}", "title": "" }, { "docid": "b5c5336e93970c4c59f90e2880c88573", "score": "0.6352258", "text": "function prevAnythingOf (_id) {\r\n\r\n\t\tvar previousId = '1',\r\n\t\t\tresult = _id,\r\n\t\t\tdone = false;\t\t\t// TODO: Is this a hack?? research algorthims\r\n\r\n\t\tfunction r (_metaNode) {\r\n\t\t\r\n\t\t\tvar thisId = _metaNode[0].id;\r\n\r\n\t\t\t// Test for end condition\r\n\t\t\tif (thisId === _id) { result = previousId; done = true; return; }\r\n\r\n\t\t\t// Update backreference, unless it's the tree in which case skip it\r\n\t\t\tpreviousId = (thisId !== '0') ? thisId : previousId;\r\n\r\n\t\t\t// Check for more children\r\n\t\t\tif (_metaNode.length > 1 && !_metaNode[0].folded) {\r\n\r\n\t\t\t\tfor (var i = 1; i < _metaNode.length; i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tr(_metaNode[i]);\r\n\r\n\t\t\t\t\tif (done) { return; }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tr(tree);\r\n\r\n\t\treturn result;\r\n\r\n\t}", "title": "" }, { "docid": "4ec12e01b0b278a5f73b8883bb5bec6e", "score": "0.6332513", "text": "isRecursivelyInId(el, id) {\n if (el.id === id) return true;\n\n while (el.parentNode) {\n el = el.parentNode;\n if (el.id === id) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "14de506fd38f72639195927099f5d3e6", "score": "0.63191265", "text": "function findNode(id) {\r\n function recurse(nodes) {\r\n var found;\r\n $.each(nodes, function(i, node) {\r\n if (id == idOf(node)) {\r\n found = node;\r\n return false; // Stop\r\n }\r\n if (node.children) found = recurse(node.children);\r\n if (found) return false; // Stop\r\n });\r\n return found;\r\n }\r\n return recurse(tree);\r\n }", "title": "" }, { "docid": "470fcc6ce2133b5ab622c73cc1d4576a", "score": "0.62748754", "text": "findNodeById(id, node = this.model.root) {\n if (id == node.id) {\n return node;\n }\n else if (node.hasChildren()) {\n for (const child of node.children) {\n let found = this.findNodeById(id, child);\n if (found) {\n return found;\n }\n }\n }\n else {\n return false;\n }\n return false;\n }", "title": "" }, { "docid": "077d30b46162b9858b35e6fc504c1eda", "score": "0.60771435", "text": "function findID(mapItem, id) {\n let ret = \"\";\n if (!(\"children\" in mapItem)) {\n return ret;\n }\n if (mapItem[\"children\"] == undefined) {\n return ret;\n }\n for (let i = 0; i < mapItem[\"children\"].length; i++) {\n if (mapItem[\"children\"][i][\"name\"] == featureName) {\n ret = mapItem[\"children\"][i][\"id\"];\n break;\n }\n\n let temp = findID(mapItem[\"children\"][i], id)\n if (temp != \"\") {\n ret = temp;\n break;\n }\n\n }\n return ret;\n}", "title": "" }, { "docid": "ea8d5eb40cc024025c44ce50f172e43c", "score": "0.6068117", "text": "async findNode(id) {\n id = (0, _URL.URL_file)(id);\n if (this.id === id) return this;\n if ((0, _startsWith.default)(id).call(id, this.id)) for (const c of await this._children()) {\n // depth first search by default\n const cc = await c.findNode(id);\n if (cc) return cc;\n }\n return undefined;\n }", "title": "" }, { "docid": "5b883a53bf917039067e40b792107d31", "score": "0.6065967", "text": "function test2(arr, id) {\n // TODO: 여기에 코드를 작성합니다.\n \n let result = null;\n for(let i = 0 ; i < arr.length; ++i){ \n if(arr[i].id === id){\n result = arr[i];\n break;\n }\n else\n {\n if(arr[i].children !== undefined)\n {\n result = test2(arr[i].children, id)\n if( result !== null)\n break;\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "998fa3a8908ae15548c4aaedda0d179d", "score": "0.5999079", "text": "function findFolder(ObjTree,name,id){\n var res;\n //debugger;\n $.each(ObjTree, function(k, v) {\n if (k===name){\n res= v;\n return false;\n }\n if (k.indexOf(\".\")===-1 && k!='state' && k!='id' && k!='path****'){\n res = findFolder(v,name);\n if (res!=undefined){\n return false;\n }\n \n }\n \n });\n return res;\n }", "title": "" }, { "docid": "e296b5fbabd3af8228a9b33887317692", "score": "0.5990051", "text": "function getChildNodeIds(node) { // get nodes are childeren if not narrower\n // console.log('getChildNodeIds')\n // console.log('getChildNodeIds',node)\n\n let NodeIds = []\n \n let parent_id = node.id || node['@id'];\n \n let _narrower = node.narrower || node['skos:narrower'] || null;\n let _supports = node.supports || node['skos:supports'] || null;\n \n // if narrower add appropriate ids\n if (_narrower != null) {\n \n if ( (typeof _narrower) === 'string') {\t\n let _nn = _narrower ;\n // console.log('_nn', _nn)\n NodeIds.push(_nn) ;\n \n } else {\n // console.log('_narrower.length',_narrower.length)\n for (let n = 0; n < _narrower.length; n++) {\n let _nn = _narrower[n]\n // console.log('_nn', _nn)\n NodeIds.push(_nn) ;\n }\n }\n } // end if _narrow\n \n // if supports add appropriate ids\n if (_supports != null) {\n \n if ( (typeof _supports) === 'string') {\t\n let _ss = _supports ;\n // console.log('_ss', _ss)\n NodeIds.push(_ss) ;\n \n } else {\n // console.log('_supports.length',_supports.length)\n for (let s = 0; s < _supports.length; s++) {\n let _ss = _supports[s]\n // console.log('_ss', _ss)\n NodeIds.push(_ss) ;\n }\n }\n } // end if _narrow\n\n // console.log('getChildNodeIds child NodeIds', NodeIds)\n return NodeIds;\n} // end getChildNodeIds", "title": "" }, { "docid": "e296b5fbabd3af8228a9b33887317692", "score": "0.5990051", "text": "function getChildNodeIds(node) { // get nodes are childeren if not narrower\n // console.log('getChildNodeIds')\n // console.log('getChildNodeIds',node)\n\n let NodeIds = []\n \n let parent_id = node.id || node['@id'];\n \n let _narrower = node.narrower || node['skos:narrower'] || null;\n let _supports = node.supports || node['skos:supports'] || null;\n \n // if narrower add appropriate ids\n if (_narrower != null) {\n \n if ( (typeof _narrower) === 'string') {\t\n let _nn = _narrower ;\n // console.log('_nn', _nn)\n NodeIds.push(_nn) ;\n \n } else {\n // console.log('_narrower.length',_narrower.length)\n for (let n = 0; n < _narrower.length; n++) {\n let _nn = _narrower[n]\n // console.log('_nn', _nn)\n NodeIds.push(_nn) ;\n }\n }\n } // end if _narrow\n \n // if supports add appropriate ids\n if (_supports != null) {\n \n if ( (typeof _supports) === 'string') {\t\n let _ss = _supports ;\n // console.log('_ss', _ss)\n NodeIds.push(_ss) ;\n \n } else {\n // console.log('_supports.length',_supports.length)\n for (let s = 0; s < _supports.length; s++) {\n let _ss = _supports[s]\n // console.log('_ss', _ss)\n NodeIds.push(_ss) ;\n }\n }\n } // end if _narrow\n\n // console.log('getChildNodeIds child NodeIds', NodeIds)\n return NodeIds;\n} // end getChildNodeIds", "title": "" }, { "docid": "667de398c6e845c092c059425d082806", "score": "0.5977471", "text": "function getChildNodeIds(node) { // get nodes are childeren if not narrower\n // console.log('getChildNodeIds')\n // console.log('getChildNodeIds',node)\n \n let NodeIds = []\n \n let parent_id = node.id || node['@id'];\n \n let _narrower = node.narrower || node['skos:narrower'] || null;\n \n // if narrower add appropriate ids\n if (_narrower != null) {\n \n if ( (typeof _narrower) === 'string') {\t\n let _nn = _narrower ;\n // console.log('_nn', _nn)\n NodeIds.push(_nn) ;\n \n } else {\n // console.log('_narrower.length',_narrower.length)\n for (let n = 0; n < _narrower.length; n++) {\n let _nn = _narrower[n]\n // console.log('_nn', _nn)\n NodeIds.push(_nn) ;\n }\n }\n } // end if _narrow\n\n // console.log('getChildNodeIds child NodeIds', NodeIds)\n return NodeIds;\n } // end getChildNodeIds", "title": "" }, { "docid": "1313ff80893b1ba419020c7492db2ceb", "score": "0.5958302", "text": "function walk (_id, _fn) {\r\n\t\t\r\n\t\tvar result = null,\r\n\t\t\tdone = false;\r\n\r\n\t\tfunction r (_metaNode) {\r\n\t\t\r\n\t\t\tvar thisId = _metaNode[0].id;\r\n\r\n\t\t\t// Test for end condition\r\n\t\t\tif (_fn(thisId) === true) { result = thisId; done = true; return; }\r\n\r\n\t\t\t// Check for more children\r\n\t\t\tif (_metaNode.length > 1 && !_metaNode[0].folded) {\r\n\r\n\t\t\t\tfor (var i = 1; i < _metaNode.length; i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tr(_metaNode[i]);\r\n\r\n\t\t\t\t\tif (done) { return; }\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\r\n\t}", "title": "" }, { "docid": "d5784d85c24ccf3570bbac7fe1a7f682", "score": "0.5942814", "text": "function findIDMap(step) {\n if (typeof step === 'string') {\n if (step === id)\n return step;\n else\n return\n }\n for (let s in step) {\n // if an array is found, call findIDArray on each element\n if (step[s] instanceof Array) {\n return findIDArray(step[s]);\n // if an id is found, check if it matches and return the data if so\n } else if (s === \"id\") {\n if (step[s] === id)\n return step;\n }\n }\n }", "title": "" }, { "docid": "dc94d84bde34371d04af06f14a1f3ec9", "score": "0.59234035", "text": "function getEntityIdsFromTree(data){\n nodeList = getIdsFromTree(data);\n idList = [];\n nodeList.forEach(element => {\n idList.push(data.instance.get_node(element.toString()).li_attr['data-entity-id']);\n });\n \n // Put a last element at the front.\n // tmp = idList.pop();\n // idList.unshift(tmp);\n return idList.reverse();\n}", "title": "" }, { "docid": "3d5496a294a990fefcf1a762e01e5d30", "score": "0.5914981", "text": "async function getAllDescendants(_id){\n //implementing Bread first algorithm for getting all descendants of particular user\n var finalStack = new Stack();\n var outputStack = new Stack();\n outputStack.items.push(_id);\n while(outputStack.items.length !== 0){\n let checkingAncestor = outputStack.items[0];\n var getAncestorChildren = await getChildrens(checkingAncestor);\n for(i=0;i<getAncestorChildren.length;i++){\n outputStack.items.push(getAncestorChildren[i].userId);\n }\n let nextEle = outputStack.items.shift();\n finalStack.items.push(nextEle);\n }\n var ancestorId = finalStack.items.shift();\n let AllDescendants = finalStack.items.filter( onlyUnique );\n return AllDescendants;\n}", "title": "" }, { "docid": "0d02b2a65ed0296391a35e5b085dc957", "score": "0.5880112", "text": "function getRealParentId(id) {\n\n const getNextParentsLayer = (nodes) => {\n // get parents for every node\n // then flatten\n // then select uniq\n return _.uniq(_.flatten(nodes.map(getParents)))\n }\n\n const getParentLayer = (parents, fallback) => {\n if (parents.length === 0) {\n // ENTRY found\n return fallback\n } else if (parents.length === 1) {\n console.log('Real parent', fallback, parents)\n // Parent detected\n return getRealParentId(parents[0])\n } else if (parents.includes(entryModule)) {\n console.log('Entry in parents, stop traverse', fallback, parents)\n // Module includes entry\n // BUG: hardcode!\n return fallback\n }\n const nextParents = getNextParentsLayer(parents)\n return getParentLayer(nextParents, fallback)\n }\n\n const parents = getParents(id)\n return getParentLayer(parents, id)\n}", "title": "" }, { "docid": "2b241001f068eb01955e2fcf9c22e17f", "score": "0.5874196", "text": "function findParent(id) {\n for (var i = 0; i < iteration.length; i++) {\n for (var k = 0; k < iteration[i].data.length; k++) {\n if (iteration[i].data[k].id === id) {\n return iteration[i];\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "216779414b995fd7d78b294fddc3c00e", "score": "0.57910544", "text": "function findInTreeById(tree, idOrAlias, pathInReverse) {\n return findInTree(tree, function (item) {\n return item && (item.id === idOrAlias || item.alias === idOrAlias);\n }, pathInReverse);\n }", "title": "" }, { "docid": "a626b5cf4a74b7867ee8d6e9dd1c0a9c", "score": "0.5777444", "text": "function retriveNodeChildren(id) {\n var children = ej.DataManager(jsonTree).executeLocal(new ej.Query().where(\"ParentId\", \"Equal\", id, false));\n for (var i = 0; i < children.length; i++) {\n idList.push({ Id: children[i].Id, EntityType: children[i].EntityType });\n retriveNodeChildren(children[i].Id);\n }\n }", "title": "" }, { "docid": "8486fb7a0588268ec0c97c748952e89b", "score": "0.5748679", "text": "findClosestAncestorsNodeWithId(id) {\n let current = this;\n\n while (current.parent) {\n const parent = current.parent;\n const node = parent.getNode(id);\n\n current = parent;\n\n if (node) {\n return node;\n }\n }\n }", "title": "" }, { "docid": "bb1845a975ee39bff1993d00d724a8bc", "score": "0.5721494", "text": "findAllAncestorNodesWithId(id) {\n const nodes = [];\n let current = this;\n\n while (current.parent) {\n const parent = current.parent;\n const node = parent.getNode(id);\n\n current = parent;\n\n if (node) {\n nodes.push(node);\n }\n }\n\n return nodes;\n }", "title": "" }, { "docid": "cf2c57a63ddf6eb2a2f55f4ffce0c5cf", "score": "0.5710522", "text": "getAllChildrenId(idName){\n return this.getAllChildren(idName).map(i=>i.id)\n }", "title": "" }, { "docid": "1326f0fec238c2796d81ae6eaf9ff848", "score": "0.5701519", "text": "function findElementTreeHelper(ids) {\n return new Promise((resolve, reject) => {\n // Find all elements whose parent is in the list of given ids\n Element.find({ parent: { $in: ids } }, '_id').lean()\n .then(elements => {\n // Get a list of element ids\n const foundIDs = elements.map(e => e._id);\n // Add these elements to the global list of found elements\n foundElements = foundElements.concat(foundIDs);\n\n // If no elements were found, exit the recursive function\n if (foundIDs.length === 0) {\n return '';\n }\n\n // Recursively find the sub-children of the found elements in batches of 50000 or less\n for (let i = 0; i < foundIDs.length / 50000; i++) {\n const tmpIDs = foundIDs.slice(i * 50000, i * 50000 + 50000);\n return findElementTreeHelper(tmpIDs);\n }\n })\n .then(() => resolve())\n .catch((error) => reject(error));\n });\n }", "title": "" }, { "docid": "086fe1027008a5310b11d520e98921a6", "score": "0.5661057", "text": "function findObj(id, currentNode) {\n if (typeof currentNode === \"string\" || typeof currentNode === \"number\") {\n return false;\n }\n\n var i, currentChild, result;\n if (Array.isArray(currentNode)) {\n for (i = 0; i < currentNode.length; i++) {\n currentChild = currentNode[i];\n result = findObj(id, currentChild);\n if (result != false) {\n return result;\n }\n }\n return false;\n }\n // At this point we know that currentNode is an object, so we check\n // for the id.\n if (currentNode.hasOwnProperty('id') && currentNode.id == id) {\n return currentNode;\n }\n // At this point we have to check all the subobjects. First build a list\n // of the properties.\n var properties = [];\n for (var property in currentNode) {\n if (currentNode.hasOwnProperty(property)) {\n properties.push(property);\n }\n }\n // Now check each child node.\n for (i = 0; i < properties.length; i++) {\n currentChild = currentNode[properties[i]];\n result = findObj(id, currentChild);\n if (result != false) {\n return result;\n }\n }\n // We didn't find it anywhere, and there were no children to check.\n return false;\n}", "title": "" }, { "docid": "0d4eff83a8833dc1618c019e6e8c363a", "score": "0.5648424", "text": "function getTreeItemIndex(tree, id) {\n\n const result = {\n siblingCount: 0,\n index: 0\n }\n\n function traverse(subTree, id) {\n for (let i = 0; i < subTree.length; i++) {\n const node = subTree[i];\n if (!node) continue;\n if (node.id === id) {\n result.siblingCount = subTree.length;\n result.index = i;\n break;\n } else {\n if (node.children) {\n traverse(node.children, id);\n }\n }\n }\n }\n\n traverse(tree, id);\n return result;\n}", "title": "" }, { "docid": "9ebef10cce796adb2a0347057e6422c0", "score": "0.56392294", "text": "function findNode(id) {\n return allNodes.filter(function (node) {\n return node.id.toString() == id.toString();\n })[0];\n }", "title": "" }, { "docid": "0efb9280448315f1c13d1b5e6a8ace3c", "score": "0.56389505", "text": "function asu_dir_get_id_from_nid(tree, dept_nid) {\n\n var id = null;\n for (var i = 0; i < tree.length; i++) {\n if (id == null) {\n if (tree[i].dept_nid == dept_nid) {\n return tree[i].id;\n }\n else if (tree[i].hasOwnProperty('children')) {\n id = asu_dir_get_id_from_nid(tree[i].children, dept_nid);\n }\n }\n else {\n break;\n }\n }\n\n return id;\n}", "title": "" }, { "docid": "2241448d29a6c125406c15bd01ca3ad8", "score": "0.56360817", "text": "function isContainedChild(a, m) {\n if (a){\n for (var i=0; i<a.length;i++){\n if (a[i].id==m.id)\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "1ff7e1524f57ac600b12474f19480365", "score": "0.5633641", "text": "function resolveIdPath(fromObj, path, id) {\n log(log.debug && \"Resolving path \"+path+\" to id \"+id);\n var firstDot = path.indexOf('][');\n var nextPath = null;\n var nextProp = path.substring(1, path.length-1);\n var targetObj = null;\n var nextObj = null;\n if(firstDot>-1){\n nextProp = path.substring(1, firstDot);\n nextPath = path.substring(firstDot+1);\n }\n if(fromObj instanceof Array){\n if(NumberRegex.test(nextProp)){\n nextObj=fromObj[number(nextProp)];\n targetObj=resolveIdPath(nextObj, nextPath, id);\n }\n else {\n for(var i=0; i<fromObj.length; i++){\n var el = fromObj[i];\n if(el.hasOwnProperty(nextProp)){\n targetObj=resolveIdPath(el, path, id);\n if(targetObj!=null)\n break;\n }\n }\n }\n }\n else if(typeof fromObj == 'object'){\n if(nextPath==null) {\n //we're on the object with id property in it\n //TODO return object matching path if not locating an id\n log(log.debug && \"checking for id \"+id+\" on '\"+nextProp+\"' property\");\n if(fromObj.hasOwnProperty(nextProp) && fromObj[nextProp]===id){\n log(log.debug && \"matching id found\");\n targetObj = fromObj;\n }\n else if(fromObj[nextProp]!==undefined){\n log(log.debug && \"value: \"+fromObj[nextProp]+\"doesn't match id \"+id);\n }\n }\n else {\n nextObj=fromObj[nextProp];\n targetObj=resolveIdPath(nextObj, nextPath, id);\n }\n }\n return targetObj;\n}", "title": "" }, { "docid": "0c0501d57346e639cd2e10ebeac995d0", "score": "0.560245", "text": "function handleSearchRecurseChildren(id, tagsTable){\n var res = [id];\n const children = tagsTable[id].children.slice();\n for(var n=0; n<children.length; n++){\n res = res.concat(handleSearchRecurseChildren(children[n], tagsTable));\n }\n return res;\n}", "title": "" }, { "docid": "e302ebc4889ffc4df78bf8700d1e34e7", "score": "0.55651677", "text": "getValueById(data, id) {\n\n let { transform } = this.props\n\n if (data && data.length > 0) {\n\n for (let item of data) {\n\n let tItem = transform(item)\n\n if (tItem.id == id) {\n return tItem.text\n }\n else if (tItem.children && tItem.children.length > 0) {\n let tmpVal = this.getValueById(tItem.children, id)\n if (tmpVal !== id) {\n return tmpVal\n }\n }\n\n }\n }\n\n return id\n }", "title": "" }, { "docid": "88322080708d8941edc87514f814e545", "score": "0.55601066", "text": "function findIDArray(arr) {\n for (let a in arr) {\n // if a string, aka an ID\n if (typeof arr[a] === 'string') {\n // return the ID if found\n if (arr[a] === id) {\n return id;\n }\n }\n // if a data map is found with the correct id, return the data map\n else if (arr[a].id === id) {\n return arr[a];\n // otherwise, call findID step on the datamap that has the incorrect ID\n } else {\n let s = findIDMap(arr[a]);\n if (s)\n return s;\n }\n }\n }", "title": "" }, { "docid": "cf9212fe9390c6c3374ced155c05dfe8", "score": "0.55334675", "text": "function findInTreeByIdAndState(tree, item, pathInReverse) {\n return findInTree(tree, function (treeItem) {\n return treeItem && item &&\n (treeItem.id === item.id || treeItem.alias === item.id) &&\n (!item.state ||\n treeItem.state && item.state.name === treeItem.state.name);\n }, pathInReverse);\n }", "title": "" }, { "docid": "63e7593df13384896d7fd70c1ef90752", "score": "0.55189514", "text": "function nodeAt (_id) {\r\n\r\n\t\tif (_id == \"0\") { return tree; }\r\n\r\n\t\tvar idParts\t\t= String(_id).split('.'),\r\n\t\t\tlastParent\t= tree;\r\n\r\n\t\tuntil(idParts.length, function (_i) { lastParent = lastParent[idParts[_i]]; });\r\n\r\n\t\treturn lastParent;\r\n\t}", "title": "" }, { "docid": "385491d6784252c107c596a9c267dcba", "score": "0.5518142", "text": "function depthFirst(graph, doFunc, id) {\n if (!id) {\n // start at the top fo the graph and operate on all roots\n getRoots(graph).forEach(function (rid) {\n doFunc(rid);\n depthFirst(graph, doFunc, rid);\n });\n }\n else {\n // act on node and keep going down\n doFunc(id);\n getSuccessors(graph, id).forEach(function (cid) {\n depthFirst(graph, doFunc, cid);\n });\n }\n }", "title": "" }, { "docid": "f1d9d2090cf299a137f8eafea90eb9b8", "score": "0.5516049", "text": "function get_id(elem) {\n if(document.contains(elem)){\n // SVG traversal\n if(!elem.hasAttribute(\"oldid\"))\n return elem.id;\n else\n return get_id(document.getElementById(elem.getAttribute(\"oldid\")))\n }else if(elem.hasAttribute(\"xml:id\")){\n // MEI traversal\n if(elem.hasAttribute(\"sameas\"))\n return get_id(get_by_id(mei,elem.getAttribute(\"sameas\")))\n else if(elem.hasAttribute(\"corresp\"))\n return get_id(get_by_id(mei,elem.getAttribute(\"corresp\")))\n else if(elem.hasAttribute(\"copyof\"))\n return get_id(get_by_id(mei,elem.getAttribute(\"copyof\")))\n else if(elem.hasAttribute(\"xml:id\"))\n return elem.getAttribute(\"xml:id\")\n }\n}", "title": "" }, { "docid": "aa4a34fdc9b7a2716b3bc36ec4dd37bb", "score": "0.5467597", "text": "function r (_metaNode) {\r\n\t\t\r\n\t\t\tvar thisId = _metaNode[0].id;\r\n\r\n\t\t\t// Test for end condition\r\n\t\t\tif (thisId === _id) { result = previousId; done = true; return; }\r\n\r\n\t\t\t// Update backreference, unless it's the tree in which case skip it\r\n\t\t\tpreviousId = (thisId !== '0') ? thisId : previousId;\r\n\r\n\t\t\t// Check for more children\r\n\t\t\tif (_metaNode.length > 1 && !_metaNode[0].folded) {\r\n\r\n\t\t\t\tfor (var i = 1; i < _metaNode.length; i++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tr(_metaNode[i]);\r\n\r\n\t\t\t\t\tif (done) { return; }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "09dfd228f7d7566ae3334a90505db556", "score": "0.5445359", "text": "function getId() {\n idRoot++;\n return idRoot;\n\n }", "title": "" }, { "docid": "09dfd228f7d7566ae3334a90505db556", "score": "0.5445359", "text": "function getId() {\n idRoot++;\n return idRoot;\n\n }", "title": "" }, { "docid": "3138a5a34af446a94d42d4aa7ef62e75", "score": "0.54399484", "text": "function findDeepestCachedAncestor(targetID){deepestNodeSoFar = null;ReactInstanceHandles.traverseAncestors(targetID,findDeepestCachedAncestorImpl);var foundNode=deepestNodeSoFar;deepestNodeSoFar = null;return foundNode;}", "title": "" }, { "docid": "b93e326f7180b2cc90e0c6463f837a38", "score": "0.5423838", "text": "function buildBookmarkId (a_BTN, id, level, force = true) {\r\n let node;\r\n for (let i of a_BTN) {\r\n if (i.id == id) {\r\n if ((i.children.length > 0) || force) {\r\n node = buildTree(i, level);\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return(node);\r\n}", "title": "" }, { "docid": "9cbd18847abec30128cb44fbbc239334", "score": "0.5412575", "text": "function resolveIds(root, idTypeResolver, obj){\n log(log.debug && \"resolveIds..\");\n if(obj == undefined){\n var obj = root;\n }\n if(obj instanceof Array) {\n \t log(log.debug && \"scanning array elements..\");\n for(var i=0; i<obj.length; i++){\n log(log.debug && \"inspecting element \"+i+\"..\");\n if(typeof obj[i] == 'string'){\n obj[i]=resolveIdString(root, idTypeResolver, obj[i])\n }\n else {\n resolveIds(root, idTypeResolver, obj[i]);\n }\n }\n }\n else if(typeof obj == 'object'){\n \t log(log.debug && \"scanning object properties..\");\n for(var p in obj){\n log(log.debug && \"inspecting property '\"+p+\"'..\");\n if(typeof obj[p] == 'string'){\n obj[p]=resolveIdString(root, idTypeResolver, obj[p]);\n }\n else {\n resolveIds(root, idTypeResolver, obj[p]);\n }\n }\n }\n else {\n \t log(log.debug && \"do nothing with type: \"+typeof obj);\n }\n return obj;\n}//resolveIds", "title": "" }, { "docid": "efbd94da819d7985507e91a136c5db03", "score": "0.54098177", "text": "function storeTreeIds(tree) { //used for adding things to those uneditable folders\r\n // //console.log(\"rootId:\" + rootId + \" toolbarId:\" + bookmarksBarId + \" Other bookmark id:\" + otherBookmarksId);\r\n if (!_rootId) { //should only have to do this once since these special folders never change\r\n tree = tree[0];\r\n _localTree = tree; //store the entire tree\r\n _rootId = tree.id;\r\n var i;\r\n for (i = 0; i < tree.children.length; i++) { //get all children in root\r\n var node = tree.children[i];\r\n node.parentFolders = \"/\"; // isToolbar, etc, checks if parent folders match too\r\n if (!node || !node.id) continue; //set to null in removeduplicates?\r\n if (isToolbar(node)) { //firefox and chrome\r\n _bookmarksBarId = node.id;\r\n } else if (isOtherBookmarks(node)) { //firefox and chrome\r\n _otherBookmarksId = node.id;\r\n otherBookmarksNode = node; //store for use below\r\n } else if (isBookmarksMenu(node)) { //firefox\r\n _bookmarksMenuId = node.id;\r\n } else if (isMobileBookmarks(node)) { //firefox\r\n _mobileBookmarksId = node.id;\r\n }\r\n }\r\n //mobilebookmarks and bookmarks menu exist only on chrome, will never be found in root on chrome\r\n if (!_mobileBookmarksId || !_bookmarksMenuId) { //chrome doesn't have these - I'm putting them in the other bookmarks folder. Search there to get their ids\r\n for (i = 0; i < otherBookmarksNode.children.length; i++) { //get all children in root\r\n var node = otherBookmarksNode.children[i];\r\n node.parentFolders = \"/\"; // isToolbar, etc, checks if parent folders match too\r\n if (!node || !node.id) continue; //set to null in removeduplicates?\r\n if (isBookmarksMenu(node) && !_bookmarksMenuId) { //chrome - the !_ is important cuz theyu might have identical folders in root AND other bookmarks\r\n _bookmarksMenuId = node.id;\r\n } else if (isMobileBookmarks(node) && !_mobileBookmarksId) {\r\n _mobileBookmarksId = node.id;\r\n }\r\n }\r\n }\r\n }\r\n // addAllSpecialFolders(); // all special folders are in root, so when adding, just check if parent id is root and change it to otherBookmarks! doesn't need whole separate function\r\n}", "title": "" }, { "docid": "03470fe7a2b11641587a5cc08dc6a1fb", "score": "0.54052556", "text": "function getNodePath(dataObj, searchId) {\n\n // Check for id of clicked node and current chart object data\n if (searchId === dataObj.id) {\n\n return dataObj;\n } else {\n if (dataObj.children) {\n\n for (var i = 0; i < dataObj.children.length; i++) {\n var path = getNodePath(dataObj.children[i], searchId);\n\n if (path) {\n return path;\n }\n\n }\n }\n }\n }", "title": "" }, { "docid": "90d89c2cbbe4f4de0ecec80a4106e2f8", "score": "0.5396835", "text": "function get_relative_by_id(id) {\n\tfor (var relative in personal_information) {\n\t\tif (personal_information[relative]) { // line added to prevent undefined error on id property\n\t\t\tif (typeof personal_information[relative].id != 'undefined') {\n\t\t\t\tif (personal_information[relative].id == id) return relative;\n\t\t\t}\n\t\t} //\n\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "a365968988e9acc3567c940de14cab80", "score": "0.53765696", "text": "findNode(id, stop = false) {\n const promises = [];\n if (this.nodes.hasOwnProperty(id)) {\n return Promise.resolve(this.getInfo(id));\n }\n if (stop) {\n Promise.resolve('node not found');\n }\n for (const key in this.nodes) {\n if (this.nodes.hasOwnProperty(key)) {\n promises.push(this.getChildren(this.nodes[key].getId().get(), []));\n }\n }\n return Promise.all(promises).then((childrens) => __awaiter(this, void 0, void 0, function* () {\n try {\n const res = yield this.findNode(id, true);\n return Promise.resolve(res);\n }\n catch (e) {\n return Promise.resolve(e);\n }\n }));\n }", "title": "" }, { "docid": "fc1b0994d10bacd849c6fec81e066ee2", "score": "0.53746617", "text": "function findChild(id, type) {\n var i = 0;\n while(i<links.length) {\n if (links[i].targetId === id) {\n if (type) {\n if (links[i].source.type === type) {\n return links[i].sourceId;\n }\n } else {\n return links[i].sourceId;\n }\n }\n i++;\n } \n}", "title": "" }, { "docid": "39131694819d45fc6a4163584beef5f5", "score": "0.5358411", "text": "function getJsonNetObjectById(parentObj, id, depth) {\n\n if (depth > 15) {\n return null;\n }\n\n var objId = parentObj[\"$id\"];\n if (typeof (objId) !== \"undefined\" && objId != null && objId == id) {\n // $id key exists, and the id matches the id of interest, so you have the object... return it\n return parentObj;\n }\n for (var i in parentObj) {\n if (typeof (parentObj[i]) == \"object\" && parentObj[i] != null) {\n //going one step down in the object tree\n var result = getJsonNetObjectById(parentObj[i], id, depth + 1);\n if (result != null) {\n // return found object\n return result;\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "39131694819d45fc6a4163584beef5f5", "score": "0.5358411", "text": "function getJsonNetObjectById(parentObj, id, depth) {\n\n if (depth > 15) {\n return null;\n }\n\n var objId = parentObj[\"$id\"];\n if (typeof (objId) !== \"undefined\" && objId != null && objId == id) {\n // $id key exists, and the id matches the id of interest, so you have the object... return it\n return parentObj;\n }\n for (var i in parentObj) {\n if (typeof (parentObj[i]) == \"object\" && parentObj[i] != null) {\n //going one step down in the object tree\n var result = getJsonNetObjectById(parentObj[i], id, depth + 1);\n if (result != null) {\n // return found object\n return result;\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "8bca2ebe87a816bf87ef4facadf12ad0", "score": "0.5358084", "text": "function recursiveFind(id, storageArray, parentObject) {\n for (var i = 0; i < storageArray.length; i++) {\n if (storageArray[i].id === id) {\n var searchResults = {\n todoIndex: i\n };\n\n if (parentObject) {\n searchResults.parentObject = parentObject;\n } else {\n searchResults.parentObject = nestedTodo.todoStorage;\n }\n\n searchResults.todo = storageArray[i];\n\n return searchResults;\n }\n if (storageArray[i].subTodos.length > 0) {\n var searchedSubtodos = recursiveFind(id, storageArray[i].subTodos, storageArray[i]);\n if (searchedSubtodos) {\n return searchedSubtodos;\n }\n }\n }\n }", "title": "" }, { "docid": "9e740f33bd672547b0a1f92eefc60e24", "score": "0.53526133", "text": "function get_tree(id) {\n let sql = `SELECT * FROM member m\n WHERE parent_id = \"${id}\"`\n\n return new Promise((resolve, reject) => {\n dbConn.query(sql, (err, result) => {\n if (err) {\n reject(err)\n } else {\n resolve(result.map(res => {\n const plainObject = _.toPlainObject(res)\n const camelCaseObject = humps.camelizeKeys(plainObject)\n return camelCaseObject\n })\n )\n }\n })\n\n })\n}", "title": "" }, { "docid": "54dc114de4718feb2de17d2cffec909e", "score": "0.5351964", "text": "function selectID() {\n let x = document.getElementById(\"selectID\").value;\n let node = tree.branches[x];\n if (typeof node !== 'undefined') {\n selectNodeWithID(node.id)\n }\n else\n alert(\"No node found with ID \" + x);\n}", "title": "" }, { "docid": "74c04f7c5214e62012917b030983b0b0", "score": "0.5340218", "text": "visitIdentificationDivision(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "964de4352898d490a955d0c64009201c", "score": "0.53350216", "text": "collateIds(node) {\n let result = [];\n // debug diagnostic\n if (!node) {\n return [];\n }\n if (node.left) {\n result = this.collateIds(this.nodes[node.left]);\n }\n result.push(node.id);\n result.push(...node.siblings);\n if (node.right) {\n result.push(...this.collateIds(this.nodes[node.right]));\n }\n return result;\n }", "title": "" }, { "docid": "68cfde7e2a31dee75778b5590bec3f41", "score": "0.532191", "text": "function getSelectedNode(id) {\n console.log('getSelectedNode', id)\n console.log('myTree', myTree)\n \n var _node = _findInTree(id,myTree,0) || null;\n \n console.log('_node',_node)\n return _node;\n } // end getSelectedNode", "title": "" }, { "docid": "ac9b97cf53a2a29539912ee576dc75df", "score": "0.52903986", "text": "function findIndex(id) {\n for (var i = 0; i < graph.nodes.length; i++) {\n if (graph.nodes[i].id === id) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "ec0bf4f24ed0dd27c8c4e2c6c29f050e", "score": "0.52877885", "text": "function nodeIndex(id, list) {\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (list[i].id === id) return i;\n\t}\n\n\treturn -1;\n}", "title": "" }, { "docid": "d1994d175bd2a8790440eea740a0ce46", "score": "0.5287656", "text": "function findObjectById(idnum){\n for(var i=0; i<Object_List.length; i++){\n for(var j=0; j<Object_List[i].strokes.length; j++){\n for(var k=0; k<Object_List[i].strokes[j].length; k++){\n if(Object_List[i].strokes[j][k] == idnum){\n return Object_List[i];\n }\n }\n }\n }\n return -1;\n}", "title": "" }, { "docid": "d1994d175bd2a8790440eea740a0ce46", "score": "0.5287656", "text": "function findObjectById(idnum){\n for(var i=0; i<Object_List.length; i++){\n for(var j=0; j<Object_List[i].strokes.length; j++){\n for(var k=0; k<Object_List[i].strokes[j].length; k++){\n if(Object_List[i].strokes[j][k] == idnum){\n return Object_List[i];\n }\n }\n }\n }\n return -1;\n}", "title": "" }, { "docid": "0889f7fe9bdf9a85daf0e689f55655c9", "score": "0.52817816", "text": "static treeBBoxID(point, store, startid) {\n function pointInTreeBBox(point, id) {\n const tree_bbox = store.getStyle(id).tree_bbox.toJS()\n return Style.pointInsideBBox(point, tree_bbox)\n }\n\n let sofar = startid\n const traverer = (tree)=>{\n const {id} = tree\n if (id !== startid && pointInTreeBBox(point, id)) {\n sofar = id\n if (store.getNodeExpand(id)) {\n return true\n } else {\n return false\n }\n } else {\n return true\n }\n }\n DFPreTraversal(store.forest, startid, traverer)\n return sofar\n }", "title": "" }, { "docid": "e330c8a33b5025c121899de37854fec0", "score": "0.5275186", "text": "function getNodeElmFromID(id) {\n // ${id} is case insensitive so need filter \n return $(`.node#${id}`).filter((index, elm) => $(elm).attr('id') == id); \n}", "title": "" }, { "docid": "90a2afe623f666066b5dd6a662820e7b", "score": "0.5266261", "text": "function updatekids()\n{\n for (var i = 0; i < tree.length; i++)\n {\n checkid = \"#\" + tree[i].name;\n if ($(checkid).next().attr('class') == \"node\")\n {\n tree[i].kids = [$(checkid).next().attr('id')];\n }\n else if ($(checkid).next().attr('class') == \"branchl\")\n {\n var child1 = $(checkid).siblings(\".branchl\").find('.node').first().attr('id');\n var child2 = $(checkid).siblings(\".branchr\").find('.node').first().attr('id');\n tree[i].kids = [child1, child2];\n }\n else\n {\n }\n }\n}", "title": "" }, { "docid": "c68020b6b9f7a7084703335ec35d9166", "score": "0.5265061", "text": "getParentsOfPhonenumber(data, phone) {\n // double loop that shit prolly not the best for scaling architecture\n for (let i in data) {\n for (let j in data[i]) {\n console.log(data[i][j].phoneNumber);\n if (data[i][j].phoneNumber === phone) {\n return {\n parent: i,\n child: j,\n };\n }\n }\n }\n }", "title": "" }, { "docid": "c22f14532efa4abd8c9f2dadbcc80756", "score": "0.5264856", "text": "function getFirstParentId(elem) {\n if(!elem) {\n if(thruk_debug_js) { alert(\"ERROR: got no element in getFirstParentId()\"); }\n return false;\n }\n nr = 0;\n while(nr < 10 && !elem.id) {\n nr++;\n if(!elem.parentNode) {\n // this may happen when looking for the parent of a event\n return false;\n }\n elem = elem.parentNode;\n }\n return elem.id;\n}", "title": "" }, { "docid": "02ea7b2878b6532c68779267a4ffc653", "score": "0.5263873", "text": "function getTree(arr, result = {}, a = 0) {\n if (arr.length === 0) {\n return result;\n }\n if (arr[0].parent === null) {\n result[arr[0].id] = {};\n arr.shift();\n return getTree(arr, result, )\n }\n if (result[arr[0].parent]) {\n result[arr[0].parent][arr[0].id] = {};\n arr.shift();\n return getTree(arr, result)\n }\n if (result[0].hasOwnProperty(arr[0].parent)) {\n result[a][arr[0].parent][arr[0].id] = {}\n\n arr.shift()\n return getTree(arr, result)\n }\n a++\n if (result[0][a].hasOwnProperty(arr[0].parent)) {\n\n result[0][a][arr[0].parent][arr[0].id] = {}\n\n arr.shift()\n }\n if (arr.length === 0) {\n return result;\n } else return getTree(arr, result, a);\n}", "title": "" }, { "docid": "b8d8c0ef3f15c7b2b85adf0305a382b4", "score": "0.52592105", "text": "function ids(root, goal, limit){\n\tvar openedNodes = [];\n\tvar closedNodes = [];\n\n\tnodosSolucion = [];\n\tarcosSolucion = [];\n\n\tvar node;\n\tvar depth;\n\tvar to;\n\n\tvar s_p = new Array();\n\tvar sd_p = new Array();\n\n\ts_p.push(root);\n\tsd_p.push(0);\n\tnodosSolucion.push(root);\n\topenedNodes.push(root.text);\n\n\twhile(s_p.length > 0) {\n\t\tnode = s_p.pop();\n\t\tdepth = sd_p.pop();\n\t\tconsole.log(node.text + \" en la profundidad \" + depth);\n\t\tcontrolNodos(node.text, closedNodes, openedNodes);\n\n\t\tif (node == goal) {\n\t\t\tmostrarNodos(openedNodes, 'openedNodes');\n\t\t\tmostrarNodos(closedNodes, 'closedNodes');\n\t\t\treturn 1;\n\t\t}\n\t\tif (depth < limit) {\n\t\t\tgetNodosAdyacentes(node);\n\t\t\tfor (to = nodosAdyacentes.length - 1; to >= 0; to--) {\n\t\t\t\tvar arco = getArco(node, nodosAdyacentes[to]);\n\t\t\t\tarcosSolucion.push(arco);\n\t\t\t\ts_p.push(nodosAdyacentes[to]);\n\t\t\t\tsd_p.push(depth+1);\n\t\t\t\tnodosSolucion.push(nodosAdyacentes[to]);\n\t\t\t\topenedNodes.push(nodosAdyacentes[to].text);\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "9f8524df4cde0458578b18f4ec73f912", "score": "0.5259086", "text": "traverseForUUID(target_uuid){\n if(this.response_object.obj.uuid === target_uuid){\n return [this];\n }else{\n if(this.overlay_children){\n return this.overlay_children.flatMap(g => g.traverseForUUID(target_uuid))\n }else{\n return [];\n }\n }\n }", "title": "" }, { "docid": "300a33e535492121813e39f1e1a93642", "score": "0.5247616", "text": "function match(id,arr){\n for(var i=0;i<arr.length;i++){\n if(id === arr[i].id) return true;\n }\n return false;\n}", "title": "" }, { "docid": "aca003949ea6c20d1eb2257f26f2fe4d", "score": "0.5236921", "text": "function getNodeById(param){\n\t\tvar result =null;\t\t\n\t\tfor (i=0;i<nodes.length;i++){\t\t\n\t\t\tif (param == nodes[i].id){\n\t\t\t\tresult = nodes[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\n\t\treturn result;\n\t}", "title": "" }, { "docid": "2c8fe293b131896476e0992614b46031", "score": "0.5234734", "text": "function find (branch) {\n\n //fb fined branch\n var fb;\n\n if (treeId == branch.id) {\n\n return branch;\n }\n else {\n\n if (branch.children) {\n\n if (branch.children.length > 0) {\n\n for (var i=0;i<branch.children.length;i++) {\n\n fb = find(branch.children[i]);\n if (fb) {\n\n branchFound = {parent: branch, index: i};\n }\n }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "c794a7a1ffd2e0e43cb47bc2447e3d98", "score": "0.5234729", "text": "function firstChildOf (_id) {\r\n\r\n\t\tvar thisMetaNode = nodeAt(_id);\r\n\r\n\t\t// If folded, open\r\n\t\tif (thisMetaNode[0].folded === true) { fold(_id); }\r\n\r\n\t\t// if no children, don't bother\r\n\t\tif (thisMetaNode.length < 2) { return _id; }\r\n\r\n\t\t// if still here, get first child\r\n\t\treturn _id + '.1';\r\n\r\n\t}", "title": "" }, { "docid": "2d4b9421ca1fcac8edb8f8170d132db5", "score": "0.5227396", "text": "function findRoots(id, adjList) {\n if(adjList[id].length == 0) {\n return [id];\n } else {\n var roots = [];\n for(var i=0; i<adjList[id].length; i++) {\n roots = _.union(roots, findRoots(adjList[id][i], adjList));\n }\n return roots;\n }\n}", "title": "" }, { "docid": "ed9cfc607c21232c8dc30feb50f16a78", "score": "0.52266276", "text": "function findById(id) {\n for (var i = 0; i < iteration.length; i++) {\n for (var k = 0; k < iteration[i].data.length; k++) {\n if (iteration[i].data[k].id === id) {\n return iteration[i].data[k];\n }\n }\n }\n return null;\n }", "title": "" }, { "docid": "7454ca68f5fa2245fc5642882b42b89b", "score": "0.5216724", "text": "function getIDsBySearchPath(id, path, skipFirstId, callback) {\n var ids = [];\n var _id = id + '';\n var storage = getFieldValueFromStorage;\n\n if (id && path && callback) {\n if (!skipFirstId) {\n ids.push(id + '');\n }\n //for each path's elements will looking for a match.\n //When an id is found it will be used as the next id.\n forEach(path, function (p) {\n var modelField = getModelField(p);\n __log('path', p);\n var next = this.async();\n storage(modelField.model, _id, modelField.field, function (err, id) {\n if (id) {\n id = id + '';\n ids.push(id);\n _id = id;\n }\n next();\n });\n\n }, function () {\n callback(null, ids);\n });\n } else {\n callback(null, ids);\n }\n }", "title": "" }, { "docid": "400a6819098edd7f11a65668188fda68", "score": "0.5215891", "text": "function getNodes(data) {\n var nodesArr = [];\n var nodes = [];\n $.each(data, function (i) {\n var node = data[i][0];\n\n if (nodesArr.indexOf(node) == -1) {\n nodesArr.push(node);\n }\n });\n $.each(nodesArr, function (i) {\n var node = {};\n node.id = nodesArr[i];\n nodes.push(node);\n });\n return nodes;\n }", "title": "" }, { "docid": "026bd1c9e00eace1d7a4538ebf118a94", "score": "0.52135926", "text": "get parentEntityId() {\n let result = this.ancestorIds.find(id => ! isNaN(id) )\n return result ? parseInt(result, 10) : NaN\n }", "title": "" }, { "docid": "ebe9caa4b50b1c28eb10ccdb1fc9190d", "score": "0.52108043", "text": "depthFirstSearch(link, spaces) {\n var res = '-'.repeat(spaces*4) + link;\n\n console.log(res);\n\n res += '\\n';\n\n if (!this.map.hasOwnProperty(link)) return;\n\n for (var child of this.map[link]) {\n res += this.depthFirstSearch(child, spaces+1);\n }\n\n return res;\n }", "title": "" }, { "docid": "50df0227b7b11e41e96b1b6e3a7b0517", "score": "0.5208139", "text": "function findPathToRoot (tree, hash) {\n const list = [ hash ]\n let current = hash\n while (!tree[current].root) {\n const parentHash = tree[current].parentHash\n list.push(parentHash)\n current = parentHash\n }\n list.pop()\n return list\n}", "title": "" }, { "docid": "2b172e54b91a628f81f65aa99342b9c0", "score": "0.52013963", "text": "function selectNodeWithID(id){\n Object.values(tree.branches).forEach(branch => branch.selected = false);\n let subtrees;\n const divNumSubtrees = document.getElementById(\"subtreeNum\");\n tree.branches[id].selected = !tree.branches[id].selected;\n tree.branches[id].cascadeFlag(\"selected\", true);\n subtrees = tree.getAllSubtreeRootIdsWithFlag(\"selected\");\n divNumSubtrees.innerText = subtrees.join();\n changeNodeDetailInformation(tree.branches[id]);\n tree.draw();\n}", "title": "" }, { "docid": "e7f531277fa5ac4f6a2c22351615a29d", "score": "0.51959014", "text": "function encontrarIndice(objeto){\n return objeto.id == this;\n}", "title": "" }, { "docid": "80214517bbbff031330ff50f5652c743", "score": "0.51829684", "text": "function find (branch) {\n\n //fb fined branch\n var fb;\n\n if (treeId == branch.id) {\n\n return branch;\n }\n else {\n\n if (branch.children) {\n\n if (branch.children.length > 0) {\n\n for (var i=0;i<branch.children.length;i++) {\n\n fb = find(branch.children[i]);\n if (fb) {\n return fb;\n }\n }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "054f04f23f8699f196c51f6086c6ba75", "score": "0.5181654", "text": "function findId(obj) {\n var categoryArray = obj.data;\n for (var i = 0; i < categoryArray.length; i++) {\n console.log(\"Heyf\")\n if (categoryArray[i].id == id) {\n console.log(\"Found stuff\")\n console.log(categoryArray[i])\n return categoryArray[i];\n\n }\n }\n }", "title": "" }, { "docid": "9e336ebe6ebb90e1c51ee4a3df10beab", "score": "0.51734614", "text": "depthFirstSearch(array) {\n // Write your code here.\n array.push(this.name);\n for(const child of this.children){\n child.depthFirstSearch(array);\n }\n return array;\n }", "title": "" }, { "docid": "0a73ba84e2cae8fad90e8c8bd5107cb8", "score": "0.5171455", "text": "findNodeById(array, searchTerm, nodeId) {\n for (var i = 0; i < array.length; i++) {\n if (array[i][searchTerm] === nodeId) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "b81deef6e4b96c1ce061264dedc3e272", "score": "0.51704085", "text": "function dfs (v) {\r\n used[v.id] = true\r\n if (!v.children) return\r\n v.children.forEach(u => {\r\n if (!used[u.id]) dfs(u)\r\n if (u.id === path[0].parent) {\r\n path.unshift({\r\n text: u.name,\r\n href: u.id,\r\n parent: +u.parent_id\r\n })\r\n }\r\n })\r\n }", "title": "" }, { "docid": "6fe28165858e77589cd8710110adfc27", "score": "0.51446146", "text": "function flatten(key) {\n var nodes = [];\n\n\tfunction recurse(key) {\n\n\t if (set[key].children != undefined){\n\t \tfor (var j = 0; j < set[key].children.length; j++){\n\t \t\trecurse(set[key].children[j].value);\n\t \t}\n\t }\n\n\t temp = set[key];\n\n\t\tvar tempNode = {\n\t\t\t\"description\": temp.description,\n\t\t\t\"name\": key, \n\t\t\t\"level\": temp.level, \n\t\t\t\"id\": id, \n\t\t\t\"size\": temp.level, \n\t\t\t\"group\": temp.group\n\t\t};\n\n\t\ttemp.id = id;\n\t\tid++;\n\n\t\tif (temp.children != undefined) \n\t\t{\n\t\t\tvar tempChildren = [];\n\t\t\tfor (var k = 0; k < temp.children.length; k ++){\n\t\t\t\ttempChildren.push(set[set[key].children[k].value].id);\n\t\t\t}\n\t\t\ttempNode.children = tempChildren;\n\t\t}\n\t\telse{\n\t\t\ttempNode.children = null;\n\t\t}\n\n\t\tnodes.push(tempNode);\n\t}\n\n\trecurse(key);\n\tconsole.log(nodes);\n\treturn nodes;\n}", "title": "" }, { "docid": "2ac06ded7a803cb57be0d3f94f72d936", "score": "0.51345915", "text": "function searchChildForId(parent,searchId){\n\tfor(var x=0;x!=parent.childNodes.length;++x){\n\t\tif(typeof parent.childNodes[x]!=='undefined'&&parent.childNodes[x].id==searchId){\n\t\t\treturn x;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "f593cff1146426dc514993d8f041570d", "score": "0.5132954", "text": "function get_children_ids(node) {\n var children = node.childNodes;\n children_ids = []\n for ( var i = 0; i < children.length; i++ ) {\n // for each child, get the id (if no id, make proxy and return id)\n if ( children[i].hasOwnProperty(\"_id\") ) {\n children_ids.push(children[i]._id);\n }\n }\n return children_ids;\n }", "title": "" }, { "docid": "5cbfa1642d8780ee8ba07416e5fc9809", "score": "0.51327115", "text": "function findIterationsById(id) {\n for (var i = 0; i < iteration.length; i++) {\n if (iteration[i].id === id) {\n return iteration[i];\n }\n }\n return null;\n }", "title": "" }, { "docid": "841a46be815b73e12af6f52f80f6c362", "score": "0.51302516", "text": "function iterateTree(nwck) {\n if (nwck.children != null) {\n nwck.children.forEach(function (x) {\n return iterateTree(x);\n });\n } else {\n //found a leave\n var seq = seqs.filter(function (s) {\n return s.name === nwck.name;\n })[0];\n\n if (seq != null) {\n if (typeof seq.id === 'number') {\n //no tree has been uploaded so far, seqs have standard IDs\n seq.ids = [\"s\" + (seq.id + 1)];\n nwck.name = \"s\" + (seq.id + 1);\n } else {\n //seqs have custom ids - don't mess with these\n nwck.name = seq.id;\n }\n }\n }\n }", "title": "" }, { "docid": "a43348959e29fa91dc18d5e1720c12da", "score": "0.5129078", "text": "function findFirst(array,p){var low=0,high=array.length;if(high===0){return 0;// no children\n}while(low<high){var mid=Math.floor((low+high)/2);if(p(array[mid])){high=mid;}else{low=mid+1;}}return low;}", "title": "" }, { "docid": "d21bc1c1f216daa1a6d46878549d5a6e", "score": "0.5128058", "text": "function flatten(root) {\n var nodes = [], i = 0;\n\n function recurse(node) {\n if (node.children) node.children.forEach(recurse);\n\n if (leaft) node.id = ++i;\n else\n if (!node.id) node.id = ++i;\n\n nodes.push(node);\n }\n\n recurse(root);\n return nodes;\n}", "title": "" }, { "docid": "56e13c212786d78850fb437a52996e6b", "score": "0.51251", "text": "function getRootIdFromTreeId(treeId) {\n var rootNodeService = \"http://localhost:7474/db/data/ext/treeJsons/graphdb/getRootNodeIdForTreeId\";\n var xhr = getXhr(rootNodeService);\n xhr.send(JSON.stringify({\"treeId\":treeId}));\n return JSON.parse(xhr.responseText);\n}", "title": "" }, { "docid": "5022ef9ea99b3e71360463b5af311301", "score": "0.5122881", "text": "findChildById(...id) {\n if (!this.hasChildren || id.length === 0) {\n return null;\n }\n const numericId = typeof id[0] === \"string\" ? parseInt(id[0], 10) : id[0];\n const resource = this.children.find(x => x.id === numericId);\n if (resource === undefined) {\n return null;\n }\n if (id.length === 1) {\n return resource;\n }\n id.shift();\n return resource.findChildById(...id);\n }", "title": "" }, { "docid": "81a310af0c0b10d9b9a5c54a1e7c04c8", "score": "0.512279", "text": "function whosyrdada2(row)\r\n{\r\n //oo navigate up to the top level of this div s\r\n var me = row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;\r\n var me6 = row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;\r\n \r\n if (me.id == 'confnum') {\r\n console.log('a breakthrough');\r\n console.log(me);\r\n }\r\n\r\n\r\n console.log(row.parentNode.id); // bingodd\r\n console.log(row.parentNode.parentNode.id); // bingo\r\n console.log(row.parentNode.parentNode.parentNode.id);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.id);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode.id);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode);\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.rows);\r\n //console.log(row.parentNode.parentNode.parentNode.parentNode.rows.length);\r\n // if we're in the place where we\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id);\r\n if (row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id == 'confnum') {\r\n console.log('part 1');\r\n }\r\n \r\n if (me.id == 'confnum') {\r\n console.log('part 2');\r\n\r\n// var i=row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;\r\n var i=me.parentNode;\r\n // say no to this chanve \r\n var id = i['id'];// = 'confnum' + document.getElementsByTagName('')\r\n console.log('id=',id);\r\n // this is the top level entry point, do the needful\r\n //row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id = 'vcn' + document.getElementById('vc_num').value ;\r\n me.id = 'vcn' + document.getElementById('vc_num').value ;\r\n document.getElementById('cumulative').innerHTML += i.innerHTML;\r\n console.log(row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rows.length);\r\n // put it back\r\n me.id ='confnum';\r\n //console.log(me.getElementById('watch'));\r\n console.log(me);\r\n\r\n\r\n //cheating - there are only one of each of these so i can start searching at document. \r\n document.getElementById('watch_check').checked = false;\r\n document.getElementById('rec_check').checked = false;\r\n document.getElementById('mg_check').checked = false;\r\n document.getElementById('vip_check').checked = false;\r\n document.getElementById('cert_check').checked = false;\r\n \r\n // clear out the leg rows to make the input thing ready to go for the next one \r\n //first 4 rows are headers...\r\n\r\n for (var j = row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rows.length;j > 4; j--) {\r\n console.log(j,row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rows[j-1]);\r\n var elem = row.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rows[j-1];\r\n elem.parentNode.removeChild(elem);\r\n }\r\n // should reset the buttons and setup times here, as well \r\n document.getElementById('setup_time').value = 15;\r\n \r\n copyfields();\r\n\r\n } else {\r\n console.log(\"can't dup a dup'ed conference based on the name\");\r\n }\r\n}", "title": "" }, { "docid": "ea09401349bcb633d2c49208867e369f", "score": "0.5098621", "text": "function findNodes(node) {\n\t\t\t\t\tvar foundOne = false;\n\t\t\t\t\t// See if node matches an ID we wanted; add to results.\n\t\t\t\t\t// For simple folder queries, check both itemId and the concrete\n\t\t\t\t\t// item id.\n\t\t\t\t\tvar index = ids.indexOf(node.itemId);\n\t\t\t\t\tif (index == -1 && node.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT) {\n\t\t\t\t\t\tif (typeof asQuery == 'function') index = ids.indexOf(asQuery(node).folderItemId);\n\t\t\t\t\t\telse index = ids.indexOf(PlacesUtils.asQuery(node).folderItemId); //xxx Bug 556739 3.7a5pre\n\t\t\t\t\t}\n\t\t\t\t\tif (index != -1) {\n\t\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t\tfoundOne = true;\n\t\t\t\t\t\tif (!showAll) ids.splice(index, 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (ids.length == 0 || !PlacesUtils.nodeIsContainer(node) || nodesURIChecked.indexOf(node.uri) != -1) return foundOne;\n\t\t\t\t\tnodesURIChecked.push(node.uri);\n\t\t\t\t\tif (typeof asContainer == 'function') asContainer(node);\n\t\t\t\t\telse PlacesUtils.asContainer(node); //xxx Bug 556739 3.7a6pre\n\t\t\t\t\t// Remember the beginning state so that we can re-close\n\t\t\t\t\t// this node if we don't find any additional results here.\n\t\t\t\t\tvar previousOpenness = node.containerOpen;\n\t\t\t\t\tnode.containerOpen = true;\n\t\t\t\t\tfor (var child = 0; child < node.childCount && ids.length > 0;\n\t\t\t\t\tchild++) {\n\t\t\t\t\t\tvar childNode = node.getChild(child);\n\t\t\t\t\t\tvar found = findNodes(childNode);\n\t\t\t\t\t\tif (!foundOne) foundOne = found;\n\t\t\t\t\t}\n\t\t\t\t\t// If we didn't find any additional matches in this node's\n\t\t\t\t\t// subtree, revert the node to its previous openness.\n\t\t\t\t\tif (foundOne) nodesToOpen.unshift(node);\n\t\t\t\t\tnode.containerOpen = previousOpenness;\n\t\t\t\t\treturn foundOne;\n\t\t\t\t}", "title": "" }, { "docid": "76c80ec74eed726ba733732d27d4d33d", "score": "0.5089177", "text": "function processTreeSelect(id) {\n\n\tvar val, \n\t\tstrAry, \n\t\tparm2, \n\t\treqUrl;\n\n\t// determine which package to retrieve\n\t//\n\t// recall: ident = parent + \"|\" + thisObj.name + \"@\" + ver; -- from loadDataObj\n\t//\n\t//parm2 = id[0].slice(2);\n\tstrAry = id[0].split('|');\n\n\tlogger(strAry);\n\tif (!exists(strAry[1])) {\n\t\tdisplayReadMe(CURR_PJSON);\n\t\treturn;\n\t}\n\n\tparm2 = id[0].slice(id[0].indexOf(\"|\") + 1);\n\n\tval = strAry[strAry.length-1];\n\n\tdataObj = {\"pid\" : CURR_PID};\n\tif (val.substr(0,4) == \"<ni>\") {\n\t\tdataObj.npmmod = val.substr(4);\n\t} else {\n\t\tdataObj.modpath = encodeURIComponent(parm2);\n\t}\n\t// retrieve data for val, and fill the \n\t// content pane\n\n\t$.ajax({\n\n\t\turl: \"/npmapi/npminfo\",\n\t\tdata: dataObj,\n\t\tdataType: \"json\",\n\t\ttype: \"GET\",\n\n\t\tsuccess:function(obj){\n\t\t\tdisplayReadMe (obj.resp);\n \t}\t\n \t});\n\n}", "title": "" }, { "docid": "72b293e80fc1b02a8abaa5b81d0287eb", "score": "0.5086497", "text": "function scanTree(element){return scanLevel(element)||(scanDeep?scanChildren(element):null);}", "title": "" }, { "docid": "3de39e6a16b77e4c959445699c20c6e3", "score": "0.50803363", "text": "function find(p) { return id[p]; }", "title": "" } ]
1e816746ba7205547a6361de1c9f3af3
todo B. Division return a / b
[ { "docid": "79af4c8971ee186b83a9c1474290a3b8", "score": "0.8253136", "text": "function division(a, b) {\n\treturn printResult(parseInt(a) / parseInt(b));\n}", "title": "" } ]
[ { "docid": "4ce411ad33e748e409ab78fe153952e8", "score": "0.87975955", "text": "function division(a, b) {\r\n\treturn a / b;\r\n}", "title": "" }, { "docid": "d561eb43f4b7b4ad1bedc9a026b46690", "score": "0.84993297", "text": "function divide(a,b) {\n\treturn a / b\n}", "title": "" }, { "docid": "3a362697189221fb9b2cbf6ffcee5b60", "score": "0.83531666", "text": "function divide(a,b){\n return a / b\n}", "title": "" }, { "docid": "73d61adcbed540cabdd9d8b48af00ddb", "score": "0.83423716", "text": "function divide(a, b) {\n return divide(a, b);\n}", "title": "" }, { "docid": "78b908de9d98aa97d95ec894cbbfcc69", "score": "0.8307502", "text": "function divide1(a, b) {\n return a / b; \n}", "title": "" }, { "docid": "a4171fc0644260d9f40c887ca84a761a", "score": "0.8299321", "text": "function div(a, b) {\n return (a-(a%b))/b;\n}", "title": "" }, { "docid": "32c5ad8204268930a445b455fe78e7cc", "score": "0.8295621", "text": "function divide(a, b) {\n\t\tvar result = a / b;\n\t\treturn result;\n\t}", "title": "" }, { "docid": "3621e9b1080d16f2540386055b93a2c9", "score": "0.8161317", "text": "function div(a, b) {\n return ~~(a / b);\n}", "title": "" }, { "docid": "347a2437c7b88276af01feea65085381", "score": "0.80837226", "text": "function dividieren(a,b) {\n if(b!=0){\n return a / b;\n } \n return \"Divison durch 0 nicht OK!\";\n}", "title": "" }, { "docid": "84a8b7616602640769450588bbf40884", "score": "0.80340606", "text": "function divide(a, b) {\n int1 = a / b;\n return int1;\n}", "title": "" }, { "docid": "d6c36152d551ed76ed8406b2cd7e85fe", "score": "0.80240387", "text": "function customDiv( a, b ) { return b ? a / b : 0; }", "title": "" }, { "docid": "e359f4a15ab2e58af0038fb6024093e1", "score": "0.7909662", "text": "function dividieren(a,b) {\r\n if (b!=0) \r\n {\r\n return a/b;\r\n } \r\n return \"Dividieren durch 0 nicht möglich!\";\r\n}", "title": "" }, { "docid": "495e4794171344adb5748c92ccce39d6", "score": "0.7908878", "text": "function divide(a, b) {\n\t\ta = a + 0.0;\n\t\tb = b + 0.0;\n\t\tif(Math.abs(b) < 0.00001) {\n\t\t\tb = 0.0001;\n\t\t}\t\n\t\treturn a / b;\n\t}", "title": "" }, { "docid": "140924e7e60c8afb00362ceb302776bb", "score": "0.7868501", "text": "function division_Function(a, b) { //Function returns a divided by b\n return a / b;\n}", "title": "" }, { "docid": "341bd588d335cbcfd083a8803716878b", "score": "0.78254366", "text": "function div(num1, num2) {\n return num1 / num2;\n}", "title": "" }, { "docid": "42d3295573bee059286ece6f1af68442", "score": "0.7823976", "text": "function dividieren(a,b) {\r\n if (b==0) { //wenn b = 0 - dann Fehlermeldung\r\n return \"Dividieren durch 0 nicht möglich!\";\r\n }\r\n else {\r\n return a / b;\r\n } \r\n}", "title": "" }, { "docid": "ba8134f5b223832d64dd58bbdfe74711", "score": "0.7823519", "text": "function div(num1,num2)\n{\n return num1/num2;\n}", "title": "" }, { "docid": "c50e574197d31b8c561f549830ea5c2c", "score": "0.777441", "text": "function divide(a,b) {\n return(a%b)\n}", "title": "" }, { "docid": "da5aeeb3296743c7ddf40c0b15af618c", "score": "0.77701014", "text": "function divide(a, b) {\n console.log(a/b);\n}", "title": "" }, { "docid": "06f12fce2d8d0555e2a24fc5fb9a2ae0", "score": "0.77504283", "text": "div(a, b) {\n\t\tthis.registers[a] = Math.trunc(this.get(a) / this.get(b));\n\t}", "title": "" }, { "docid": "caaeb6ed9f094e728920ca0c2e86c466", "score": "0.7717295", "text": "function div(x, y) {\n return x / y;\n}", "title": "" }, { "docid": "dd3a3e7eb95ad619fd7aad2209c77ada", "score": "0.7679021", "text": "function divide(a, b) {\n\n if ( isNaN(parseInt(a)) || isNaN(parseInt(b)) || b == 0 )\n // lazy error\n throw 'beep boop. does not compute';\n\n return 'quotient: ' + Math.floor(a/b) + ' remainder: ' + a % b;\n}", "title": "" }, { "docid": "97e9ff84399b1b05874971719d16531c", "score": "0.7676015", "text": "function divison(num1, num2) {\n var divisonTotal = num1 / num2;\n return divisonTotal;\n}", "title": "" }, { "docid": "729479d4c334b55a73db9318904c51f8", "score": "0.7647852", "text": "function divide(a, b) {\r\n // if (b === 0) {\r\n // throw 'Division by zero is undefined: ' + a + '/' + b;\r\n // }\r\n var sign = 1;\r\n if (a < 0) {\r\n a = -a;\r\n sign = -sign;\r\n }\r\n if (b < 0) {\r\n b = -b;\r\n sign = -sign;\r\n }\r\n var result = 0;\r\n while (a >= 0) {\r\n a -= b;\r\n result++;\r\n }\r\n return (result - 1) * sign;\r\n }", "title": "" }, { "docid": "7a71acf217d0185d00ee2b9602edf2ea", "score": "0.76304716", "text": "function divided(x,y) {\nreturn x/y;\n}", "title": "" }, { "docid": "7a71acf217d0185d00ee2b9602edf2ea", "score": "0.76304716", "text": "function divided(x,y) {\nreturn x/y;\n}", "title": "" }, { "docid": "aec24f54ffa99516fd15178d9e5a29d5", "score": "0.76190645", "text": "function divide(num1, num2) {\n return num1 / num2;\n }", "title": "" }, { "docid": "f7dbff10098125f64d1ffbb77b2581f9", "score": "0.7606083", "text": "function divide(num1, num2) {\r\n return num1 / num2;\r\n}", "title": "" }, { "docid": "d919b2f0350079382fcac00bcbcbacd5", "score": "0.75881326", "text": "function divide (x, y) {\n var answer = x / y\n return answer\n}", "title": "" }, { "docid": "4ee99a66d615e3421e1cfe58bdc92ec4", "score": "0.7578657", "text": "function division(num1, num2){\n return -1;\n }", "title": "" }, { "docid": "29648cfcd9276c4b0430d4960386e5cd", "score": "0.7559843", "text": "function divide (num1,num2) {\n return num1/num2;\n}", "title": "" }, { "docid": "1da84da2bf2b94424a642538d6b9ca42", "score": "0.7545591", "text": "function divide(num1, num2){\n return num1/num2;\n}", "title": "" }, { "docid": "c9bfc98d4a74c7b3cd7eb0b7044dd727", "score": "0.75346184", "text": "function div(a,b)\n{\nreturn(a*b);\n}", "title": "" }, { "docid": "aee4463cbb2079ea5ee9400ca179f635", "score": "0.753006", "text": "function divide (x,y){\n return x/y;\n}", "title": "" }, { "docid": "edcf002fd0556e6c512741a5dfdf65f2", "score": "0.75292665", "text": "function divide(x,y){\n return x/y;\n}", "title": "" }, { "docid": "ba8f6c96e7a1868ed904cb2ab5f2ce66", "score": "0.7528809", "text": "function Divide(This, A, B) {\n\n evaluate(A);\n evaluate(B);\n if (act[A] === true && act[b] === true && val[b] !== 0) {\n val[This] = val[A] / val[B];\n act[This] = true;} else \n {\n act[This] = false;}\n\n return true;}", "title": "" }, { "docid": "7d1745649c2a5d7035cecd6466f5e28e", "score": "0.7520823", "text": "function divide(a, b) {\n return null;\n}", "title": "" }, { "docid": "6845dc369ce4734a82e94f9e88a6346e", "score": "0.75127435", "text": "div(val) {\r\n let a = this.a * val.b;\r\n let b = val.a * this.b;\r\n return new Rational(a, b).reduce();\r\n }", "title": "" }, { "docid": "53dfba386c45f4132d2d99a44a6e46b5", "score": "0.7475557", "text": "function divi() {\r\n return 6 / 7\r\n}", "title": "" }, { "docid": "68aeb1f1da7fcba4acde2f06b423b5a4", "score": "0.74752", "text": "function div(a, b) {\n if (b instanceof complex_1.Complex) {\n return _mul_two(a, b.inverse());\n }\n else {\n return _mul_two(a, 1 / b);\n }\n}", "title": "" }, { "docid": "916d965d365863dd6f32a2d1d7937f5a", "score": "0.7458193", "text": "function toDivision(num1, num2){\n let quotient = num1 / num2\n output(quotient)\n}", "title": "" }, { "docid": "b35542bc32dfcd6b7b6ff5a4a5579be1", "score": "0.74539906", "text": "function divy(a, b) {\n if (a % b === 0) {\n\n return b;\n } else {\n b = a % b;\n return divy(a, b)\n }\n}", "title": "" }, { "docid": "8a89deff5cd8ce61e732f17e87432737", "score": "0.73963565", "text": "function divide(n1, n2) {\n return n1 / n2;\n }", "title": "" }, { "docid": "e629ff621107e21c80d6907d454aacce", "score": "0.7341607", "text": "function div(a, b) {\n var answer = a % b;\n console.log(\"Solution one = \" + answer);\n}", "title": "" }, { "docid": "8c1635220a028c8a27883b733e37487d", "score": "0.73285544", "text": "function greatComDiv(a, b) {\n if ( ! b) {\n return a;\n }\n return greatComDiv(b, a % b);\n}", "title": "" }, { "docid": "bcb56624d3ae0bc87e8bc7f935ca5ffc", "score": "0.73216987", "text": "function div(num1, num2) {\n\tconsole.log(\"4) \" + (num1 / num2));\n\n}", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "43c36a8e2b29b6447c79000463b409d9", "score": "0.728868", "text": "function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }", "title": "" }, { "docid": "4ceb0c139e60ac09527bacdb6dbe105a", "score": "0.72642493", "text": "function divide(numer, denom) {\n return numer / denom;\n}", "title": "" }, { "docid": "50f62609bc5d41c0a6674d4bc2102003", "score": "0.7257152", "text": "function divide( x, y ) {\n return ( ( +x ) / ( +y ) );\n}", "title": "" }, { "docid": "c8c0f65a0866001408c3b6311bbc7641", "score": "0.7247436", "text": "function fdiv(x,y) {\n return Math.floor(x/y);\n}", "title": "" }, { "docid": "3e016917f9525de1a676a912ab62a8e1", "score": "0.72433865", "text": "function bnDivide(a) {\n var r = nbi();this.divRemTo(a, r, null);return r;\n }", "title": "" }, { "docid": "3e016917f9525de1a676a912ab62a8e1", "score": "0.72433865", "text": "function bnDivide(a) {\n var r = nbi();this.divRemTo(a, r, null);return r;\n }", "title": "" }, { "docid": "3e016917f9525de1a676a912ab62a8e1", "score": "0.72433865", "text": "function bnDivide(a) {\n var r = nbi();this.divRemTo(a, r, null);return r;\n }", "title": "" }, { "docid": "a050bfbba8e3e23531bfeaeeb8ab6d31", "score": "0.72409284", "text": "function div(num1, num2 = 1) {\n return num1 / num2;\n}", "title": "" }, { "docid": "83cf2ac909d602b41774b2ddbffde318", "score": "0.7202435", "text": "function safe_div(a, b) {\n if (b === 0) {\n return 0\n }\n\n if (a === -2147483648 && b === -1) {\n return 0\n }\n\n return Math.floor(a / b)\n}", "title": "" }, { "docid": "080f19d689889cc1eea074d6e0a635f1", "score": "0.71851057", "text": "function tdiv(x,y) {\n return x / y | 0;\n}", "title": "" }, { "docid": "a33e8ef3a73c82a15069033b78b5ee61", "score": "0.7177525", "text": "function div(a, b, bitPrecision) {\n if (a == 0) {\n return 0;\n }\n if (a < b) {\n return 1 / _div(b, a, bitPrecision);\n }\n return _div(a, b, bitPrecision);\n}", "title": "" }, { "docid": "2c8ba2c484f139fa4a0bd6d45df915a0", "score": "0.71758145", "text": "function sc_div(x) {\n if (arguments.length === 1)\n\treturn 1/x;\n else {\n\tvar res = x;\n\tfor (var i = 1; i < arguments.length; i++)\n\t res /= arguments[i];\n\treturn res;\n }\n}", "title": "" } ]
8c63dda8042f5ac272e0875e5e56b178
DOCUMENT DATA STRUCTURE By default, updates that start and end at the beginning of a line are treated specially, in order to make the association of line widgets and marker elements with the text behave more intuitive.
[ { "docid": "76f88e081ef9322a6c59e2b119fb37d1", "score": "0.0", "text": "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore);\n }", "title": "" } ]
[ { "docid": "ae243f8d0f35522ba9581bc684460200", "score": "0.59927076", "text": "function isWholeLineUpdate(doc,change){return change.from.ch==0&&change.to.ch==0&&lst(change.text)==\"\"&&(!doc.cm||doc.cm.options.wholeLineUpdateBefore);} // Perform a change on the document data structure.", "title": "" }, { "docid": "05ccfc3ffd3a7332ec9495e842bba777", "score": "0.57649523", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n\t\t function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n\t\t function update(line, text, spans) {\n\t\t updateLine(line, text, spans, estimateHeight);\n\t\t signalLater(line, \"change\", line, change);\n\t\t }\n\t\t function linesFor(start, end) {\n\t\t var result = [];\n\t\t for (var i = start; i < end; ++i)\n\t\t { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n\t\t return result\n\t\t }\n\n\t\t var from = change.from, to = change.to, text = change.text;\n\t\t var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n\t\t var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n\t\t // Adjust the line structure\n\t\t if (change.full) {\n\t\t doc.insert(0, linesFor(0, text.length));\n\t\t doc.remove(text.length, doc.size - text.length);\n\t\t } else if (isWholeLineUpdate(doc, change)) {\n\t\t // This is a whole-line replace. Treated specially to make\n\t\t // sure line objects move the way they are supposed to.\n\t\t var added = linesFor(0, text.length - 1);\n\t\t update(lastLine, lastLine.text, lastSpans);\n\t\t if (nlines) { doc.remove(from.line, nlines); }\n\t\t if (added.length) { doc.insert(from.line, added); }\n\t\t } else if (firstLine == lastLine) {\n\t\t if (text.length == 1) {\n\t\t update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n\t\t } else {\n\t\t var added$1 = linesFor(1, text.length - 1);\n\t\t added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n\t\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t\t doc.insert(from.line + 1, added$1);\n\t\t }\n\t\t } else if (text.length == 1) {\n\t\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n\t\t doc.remove(from.line + 1, nlines);\n\t\t } else {\n\t\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t\t update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n\t\t var added$2 = linesFor(1, text.length - 1);\n\t\t if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n\t\t doc.insert(from.line + 1, added$2);\n\t\t }\n\n\t\t signalLater(doc, \"change\", doc, change);\n\t\t }", "title": "" }, { "docid": "7d3e7a827a449e97539f735121cb5862", "score": "0.5735358", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\r\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\r\n function update(line, text, spans) {\r\n updateLine(line, text, spans, estimateHeight)\r\n signalLater(line, \"change\", line, change)\r\n }\r\n function linesFor(start, end) {\r\n var result = []\r\n for (var i = start; i < end; ++i)\r\n { result.push(new Line(text[i], spansFor(i), estimateHeight)) }\r\n return result\r\n }\r\n\r\n var from = change.from, to = change.to, text = change.text\r\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)\r\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line\r\n\r\n // Adjust the line structure\r\n if (change.full) {\r\n doc.insert(0, linesFor(0, text.length))\r\n doc.remove(text.length, doc.size - text.length)\r\n } else if (isWholeLineUpdate(doc, change)) {\r\n // This is a whole-line replace. Treated specially to make\r\n // sure line objects move the way they are supposed to.\r\n var added = linesFor(0, text.length - 1)\r\n update(lastLine, lastLine.text, lastSpans)\r\n if (nlines) { doc.remove(from.line, nlines) }\r\n if (added.length) { doc.insert(from.line, added) }\r\n } else if (firstLine == lastLine) {\r\n if (text.length == 1) {\r\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)\r\n } else {\r\n var added$1 = linesFor(1, text.length - 1)\r\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))\r\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\r\n doc.insert(from.line + 1, added$1)\r\n }\r\n } else if (text.length == 1) {\r\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))\r\n doc.remove(from.line + 1, nlines)\r\n } else {\r\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\r\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)\r\n var added$2 = linesFor(1, text.length - 1)\r\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }\r\n doc.insert(from.line + 1, added$2)\r\n }\r\n\r\n signalLater(doc, \"change\", doc, change)\r\n}", "title": "" }, { "docid": "c369293641a3639c9d025c20bb275448", "score": "0.57186216", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight)\n signalLater(line, \"change\", line, change)\n }\n function linesFor(start, end) {\n var result = []\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)) }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length))\n doc.remove(text.length, doc.size - text.length)\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1)\n update(lastLine, lastLine.text, lastSpans)\n if (nlines) { doc.remove(from.line, nlines) }\n if (added.length) { doc.insert(from.line, added) }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)\n } else {\n var added$1 = linesFor(1, text.length - 1)\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n doc.insert(from.line + 1, added$1)\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))\n doc.remove(from.line + 1, nlines)\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)\n var added$2 = linesFor(1, text.length - 1)\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }\n doc.insert(from.line + 1, added$2)\n }\n\n signalLater(doc, \"change\", doc, change)\n}", "title": "" }, { "docid": "c369293641a3639c9d025c20bb275448", "score": "0.57186216", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight)\n signalLater(line, \"change\", line, change)\n }\n function linesFor(start, end) {\n var result = []\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)) }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length))\n doc.remove(text.length, doc.size - text.length)\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1)\n update(lastLine, lastLine.text, lastSpans)\n if (nlines) { doc.remove(from.line, nlines) }\n if (added.length) { doc.insert(from.line, added) }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)\n } else {\n var added$1 = linesFor(1, text.length - 1)\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n doc.insert(from.line + 1, added$1)\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))\n doc.remove(from.line + 1, nlines)\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)\n var added$2 = linesFor(1, text.length - 1)\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }\n doc.insert(from.line + 1, added$2)\n }\n\n signalLater(doc, \"change\", doc, change)\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "86b85f67d3cbebffc7d19a38c830db1f", "score": "0.56859195", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n}", "title": "" }, { "docid": "5ba964a53d483a5ef354f4d096948488", "score": "0.5680825", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n\t function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n\t function update(line, text, spans) {\n\t updateLine(line, text, spans, estimateHeight)\n\t signalLater(line, \"change\", line, change)\n\t }\n\t function linesFor(start, end) {\n\t var result = []\n\t for (var i = start; i < end; ++i)\n\t { result.push(new Line(text[i], spansFor(i), estimateHeight)) }\n\t return result\n\t }\n\n\t var from = change.from, to = change.to, text = change.text\n\t var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)\n\t var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line\n\n\t // Adjust the line structure\n\t if (change.full) {\n\t doc.insert(0, linesFor(0, text.length))\n\t doc.remove(text.length, doc.size - text.length)\n\t } else if (isWholeLineUpdate(doc, change)) {\n\t // This is a whole-line replace. Treated specially to make\n\t // sure line objects move the way they are supposed to.\n\t var added = linesFor(0, text.length - 1)\n\t update(lastLine, lastLine.text, lastSpans)\n\t if (nlines) { doc.remove(from.line, nlines) }\n\t if (added.length) { doc.insert(from.line, added) }\n\t } else if (firstLine == lastLine) {\n\t if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)\n\t } else {\n\t var added$1 = linesFor(1, text.length - 1)\n\t added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n\t doc.insert(from.line + 1, added$1)\n\t }\n\t } else if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))\n\t doc.remove(from.line + 1, nlines)\n\t } else {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))\n\t update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)\n\t var added$2 = linesFor(1, text.length - 1)\n\t if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }\n\t doc.insert(from.line + 1, added$2)\n\t }\n\n\t signalLater(doc, \"change\", doc, change)\n\t}", "title": "" }, { "docid": "392dfc2530151888b73eb64ecc761db1", "score": "0.5640316", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "392dfc2530151888b73eb64ecc761db1", "score": "0.5640316", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "392dfc2530151888b73eb64ecc761db1", "score": "0.5640316", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "392dfc2530151888b73eb64ecc761db1", "score": "0.5640316", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "392dfc2530151888b73eb64ecc761db1", "score": "0.5640316", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "392dfc2530151888b73eb64ecc761db1", "score": "0.5640316", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "392dfc2530151888b73eb64ecc761db1", "score": "0.5640316", "text": "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "840743da9f15f0c44b29e143fcde1d7c", "score": "0.56389827", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "2a3eb5b49cee27c1cc000f3a36df6cd0", "score": "0.56242853", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "2a3eb5b49cee27c1cc000f3a36df6cd0", "score": "0.56242853", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "dea78ccfaffd0aa588f898072791ed98", "score": "0.55946803", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n for (var i = start, result = []; i < end; ++i)\n result.push(new Line(text[i], spansFor(i), estimateHeight));\n return result;\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added = linesFor(1, text.length - 1);\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added = linesFor(1, text.length - 1);\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "276f2fa63bcc18261c10becf8bfdac74", "score": "0.55940616", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n\t function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n\t function update(line, text, spans) {\n\t updateLine(line, text, spans, estimateHeight);\n\t signalLater(line, \"change\", line, change);\n\t }\n\t function linesFor(start, end) {\n\t for (var i = start, result = []; i < end; ++i)\n\t result.push(new Line(text[i], spansFor(i), estimateHeight));\n\t return result;\n\t }\n\n\t var from = change.from, to = change.to, text = change.text;\n\t var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n\t var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n\t // Adjust the line structure\n\t if (change.full) {\n\t doc.insert(0, linesFor(0, text.length));\n\t doc.remove(text.length, doc.size - text.length);\n\t } else if (isWholeLineUpdate(doc, change)) {\n\t // This is a whole-line replace. Treated specially to make\n\t // sure line objects move the way they are supposed to.\n\t var added = linesFor(0, text.length - 1);\n\t update(lastLine, lastLine.text, lastSpans);\n\t if (nlines) doc.remove(from.line, nlines);\n\t if (added.length) doc.insert(from.line, added);\n\t } else if (firstLine == lastLine) {\n\t if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n\t } else {\n\t var added = linesFor(1, text.length - 1);\n\t added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t doc.insert(from.line + 1, added);\n\t }\n\t } else if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n\t doc.remove(from.line + 1, nlines);\n\t } else {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n\t var added = linesFor(1, text.length - 1);\n\t if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n\t doc.insert(from.line + 1, added);\n\t }\n\n\t signalLater(doc, \"change\", doc, change);\n\t }", "title": "" }, { "docid": "276f2fa63bcc18261c10becf8bfdac74", "score": "0.55940616", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n\t function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n\t function update(line, text, spans) {\n\t updateLine(line, text, spans, estimateHeight);\n\t signalLater(line, \"change\", line, change);\n\t }\n\t function linesFor(start, end) {\n\t for (var i = start, result = []; i < end; ++i)\n\t result.push(new Line(text[i], spansFor(i), estimateHeight));\n\t return result;\n\t }\n\n\t var from = change.from, to = change.to, text = change.text;\n\t var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n\t var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n\t // Adjust the line structure\n\t if (change.full) {\n\t doc.insert(0, linesFor(0, text.length));\n\t doc.remove(text.length, doc.size - text.length);\n\t } else if (isWholeLineUpdate(doc, change)) {\n\t // This is a whole-line replace. Treated specially to make\n\t // sure line objects move the way they are supposed to.\n\t var added = linesFor(0, text.length - 1);\n\t update(lastLine, lastLine.text, lastSpans);\n\t if (nlines) doc.remove(from.line, nlines);\n\t if (added.length) doc.insert(from.line, added);\n\t } else if (firstLine == lastLine) {\n\t if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n\t } else {\n\t var added = linesFor(1, text.length - 1);\n\t added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t doc.insert(from.line + 1, added);\n\t }\n\t } else if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n\t doc.remove(from.line + 1, nlines);\n\t } else {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n\t var added = linesFor(1, text.length - 1);\n\t if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n\t doc.insert(from.line + 1, added);\n\t }\n\n\t signalLater(doc, \"change\", doc, change);\n\t }", "title": "" }, { "docid": "276f2fa63bcc18261c10becf8bfdac74", "score": "0.55940616", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n\t function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n\t function update(line, text, spans) {\n\t updateLine(line, text, spans, estimateHeight);\n\t signalLater(line, \"change\", line, change);\n\t }\n\t function linesFor(start, end) {\n\t for (var i = start, result = []; i < end; ++i)\n\t result.push(new Line(text[i], spansFor(i), estimateHeight));\n\t return result;\n\t }\n\n\t var from = change.from, to = change.to, text = change.text;\n\t var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n\t var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n\t // Adjust the line structure\n\t if (change.full) {\n\t doc.insert(0, linesFor(0, text.length));\n\t doc.remove(text.length, doc.size - text.length);\n\t } else if (isWholeLineUpdate(doc, change)) {\n\t // This is a whole-line replace. Treated specially to make\n\t // sure line objects move the way they are supposed to.\n\t var added = linesFor(0, text.length - 1);\n\t update(lastLine, lastLine.text, lastSpans);\n\t if (nlines) doc.remove(from.line, nlines);\n\t if (added.length) doc.insert(from.line, added);\n\t } else if (firstLine == lastLine) {\n\t if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n\t } else {\n\t var added = linesFor(1, text.length - 1);\n\t added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t doc.insert(from.line + 1, added);\n\t }\n\t } else if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n\t doc.remove(from.line + 1, nlines);\n\t } else {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n\t var added = linesFor(1, text.length - 1);\n\t if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n\t doc.insert(from.line + 1, added);\n\t }\n\n\t signalLater(doc, \"change\", doc, change);\n\t }", "title": "" }, { "docid": "e2d8ed15ce1693b17e82903e1bb6f2b1", "score": "0.5572725", "text": "updateLineContentsAndFormatting() {\n this.clearDirtyFlag();\n this.updateLineContents();\n this.updateFormatting();\n }", "title": "" }, { "docid": "1bf4daa260d9eda5d6359dacd0afcf16", "score": "0.5568422", "text": "layoutRow(row, str, lineStart, stopOnNewline=true)\n {\n let ts = this.CalcTextRunSize(str, lineStart, -1, stopOnNewline);\n row.x0 = 0.;\n row.x1 = ts.x;\n row.baselineYDelta = ts.y;\n row.ymin = 0.;\n row.ymax = ts.y;\n row.numChars = ts.consumed - lineStart;\n // numChars may be 0!\n }", "title": "" }, { "docid": "a3a34295ca225674f46881bf27a46de1", "score": "0.556378", "text": "function DTSection(start, end, parent) {\n var format = editor.doc.getRawFormatAt(start);\n this.start = start;\n this.end = end;\n this.children = [];\n this.id = 'node_' + ('x' + Math.random()).replace( /\\D/g, \"\" );\n this.name = format.st || 'content';\n this.nodesToUpdate = new DTUpdateQueue();\n this.currentBuildNode = null;\n this.nodelessRange = null;\n this.view = {};\n this.doc = parent;\n this.lists = {};\n this.headings = {};\n this.tables = {};\n this.nodes = {};\n this.def = null;\n this.type = 'section';\n var hdr_ftr_type = editor.doc.getBodyFormat()[ATTR_BODY.DS_HF_TYPE];\n if (this.name == 'header_primary') {\n if (!format.hftype) {\n format.hftype = 1;\n }\n if (hdr_ftr_type == 2 || hdr_ftr_type == 3) { //TEMP\n this.name = 'header_odd';\n } else {\n this.name = 'header';\n }\n } else if (this.name == 'footer_primary') {\n if (!format.hftype) {\n format.hftype = 3;\n }\n if (hdr_ftr_type == 2 || hdr_ftr_type == 3) { //TEMP\n this.name = 'footer_odd';\n } else {\n this.name = 'footer';\n }\n } else if (format.hftype == CONST.HEADER_PRIMARY) {\n if (hdr_ftr_type == 2 || hdr_ftr_type == 3) {\n this.name = 'header_odd';//No I18N \n } else {\n this.name = 'header';\n }\n } else if (format.hftype == CONST.FOOTER_PRIMARY) {\n if (hdr_ftr_type == 2 || hdr_ftr_type == 3) {\n this.name = 'footer_odd'; //No I18N\n } else {\n this.name = 'footer';\n }\n } else if (format.hftype == CONST.HEADER_EVEN) {\n this.name = 'header_even'; //No I18N \n } else if (format.hftype == CONST.FOOTER_EVEN) {\n this.name = 'footer_even';//No I18N \n } else if (format.hftype == CONST.HEADER_FIRST) {\n this.name = 'header_first';\n } else if (format.hftype == CONST.FOOTER_FIRST) {\n this.name = 'footer_first';\n }\n \n var i, c,\n child, childStart, childEnd, fn,\n nodeIndex;\n this.unknownImages = {};\n this.format = format;\n /*for (i = editor.doc.getCharAt(this.start) == UNICODE.SECTION_START ? this.start + 1 : this.start; i < this.end;) {\n c = editor.doc.getCharAt(i);\n if (!DTNode.types[c]) {\n i += 1;\n continue;\n }\n \n if (c == UNICODE.PARA) {\n childStart = getStart(UNICODE.PARA, i) - this.start;\n childEnd = i + 1 - this.start;\n } else {\n childStart = i - this.start;\n childEnd = getEnd(c, i) - this.start;\n }\n //nodeIndex = this.nodesToUpdate.length;\n child = new DTNode.types[c](childStart, childEnd, this);\n this.addChild(child);\n this.nodesToUpdate.push(child.id, DTUtils.makeOp(child, 'create')); // NO I18N\n i = this.start + child.end;\n }*/\n}", "title": "" }, { "docid": "fa43e37736aece19aa93a3f0a6013c1a", "score": "0.55560696", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n\t function spansFor(n) {\n\t return markedSpans ? markedSpans[n] : null;\n\t }\n\t function update(line, text, spans) {\n\t updateLine(line, text, spans, estimateHeight);\n\t signalLater(line, \"change\", line, change);\n\t }\n\t function linesFor(start, end) {\n\t var result = [];\n\t for (var i = start; i < end; ++i) {\n\t result.push(new Line(text[i], spansFor(i), estimateHeight));\n\t }\n\t return result;\n\t }\n\n\t var from = change.from,\n\t to = change.to,\n\t text = change.text;\n\t var firstLine = getLine(doc, from.line),\n\t lastLine = getLine(doc, to.line);\n\t var lastText = lst(text),\n\t lastSpans = spansFor(text.length - 1),\n\t nlines = to.line - from.line;\n\n\t // Adjust the line structure\n\t if (change.full) {\n\t doc.insert(0, linesFor(0, text.length));\n\t doc.remove(text.length, doc.size - text.length);\n\t } else if (isWholeLineUpdate(doc, change)) {\n\t // This is a whole-line replace. Treated specially to make\n\t // sure line objects move the way they are supposed to.\n\t var added = linesFor(0, text.length - 1);\n\t update(lastLine, lastLine.text, lastSpans);\n\t if (nlines) {\n\t doc.remove(from.line, nlines);\n\t }\n\t if (added.length) {\n\t doc.insert(from.line, added);\n\t }\n\t } else if (firstLine == lastLine) {\n\t if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n\t } else {\n\t var added$1 = linesFor(1, text.length - 1);\n\t added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t doc.insert(from.line + 1, added$1);\n\t }\n\t } else if (text.length == 1) {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n\t doc.remove(from.line + 1, nlines);\n\t } else {\n\t update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n\t update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n\t var added$2 = linesFor(1, text.length - 1);\n\t if (nlines > 1) {\n\t doc.remove(from.line + 1, nlines - 1);\n\t }\n\t doc.insert(from.line + 1, added$2);\n\t }\n\n\t signalLater(doc, \"change\", doc, change);\n\t }", "title": "" }, { "docid": "c5bed2adea24799574ca75968a08fb25", "score": "0.55473775", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n for (var i = 0, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n for (var added = [], i = 1; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n for (var i = 1, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "c5bed2adea24799574ca75968a08fb25", "score": "0.55473775", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n for (var i = 0, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n for (var added = [], i = 1; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n for (var i = 1, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "c5bed2adea24799574ca75968a08fb25", "score": "0.55473775", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n for (var i = 0, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n for (var added = [], i = 1; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n for (var i = 1, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "c5bed2adea24799574ca75968a08fb25", "score": "0.55473775", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n for (var i = 0, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n for (var added = [], i = 1; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n for (var i = 1, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "db36c0368e6b642edcee8826f98d836a", "score": "0.5484322", "text": "function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {\n return markedSpans ? markedSpans[n] : null;\n }\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n // Adjust the line structure\n if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n for (var i = 0, added = []; i < text.length - 1; ++i) added.push(new Line(text[i], spansFor(i), estimateHeight));\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n for (var added = [], i = 1; i < text.length - 1; ++i) added.push(new Line(text[i], spansFor(i), estimateHeight));\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n for (var i = 1, added = []; i < text.length - 1; ++i) added.push(new Line(text[i], spansFor(i), estimateHeight));\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n signalLater(doc, \"change\", doc, change);\n }", "title": "" }, { "docid": "0880f643385a093f7417883f8a65abdb", "score": "0.5447761", "text": "function insertLineContent(line,builder,styles){var spans=line.markedSpans,allText=line.text,at=0;if(!spans){for(var i=1;i<styles.length;i+=2)builder.addToken(builder,allText.slice(at,at=styles[i]),interpretTokenStyle(styles[i+1],builder.cm.options));return;}var len=allText.length,pos=0,i=1,text=\"\",style,css;var nextChange=0,spanStyle,spanEndStyle,spanStartStyle,title,collapsed;for(;;){if(nextChange==pos){ // Update current marker set\n\tspanStyle=spanEndStyle=spanStartStyle=title=css=\"\";collapsed=null;nextChange=Infinity;var foundBookmarks=[],endStyles;for(var j=0;j<spans.length;++j){var sp=spans[j],m=sp.marker;if(m.type==\"bookmark\"&&sp.from==pos&&m.widgetNode){foundBookmarks.push(m);}else if(sp.from<=pos&&(sp.to==null||sp.to>pos||m.collapsed&&sp.to==pos&&sp.from==pos)){if(sp.to!=null&&sp.to!=pos&&nextChange>sp.to){nextChange=sp.to;spanEndStyle=\"\";}if(m.className)spanStyle+=\" \"+m.className;if(m.css)css=(css?css+\";\":\"\")+m.css;if(m.startStyle&&sp.from==pos)spanStartStyle+=\" \"+m.startStyle;if(m.endStyle&&sp.to==nextChange)(endStyles||(endStyles=[])).push(m.endStyle,sp.to);if(m.title&&!title)title=m.title;if(m.collapsed&&(!collapsed||compareCollapsedMarkers(collapsed.marker,m)<0))collapsed=sp;}else if(sp.from>pos&&nextChange>sp.from){nextChange=sp.from;}}if(endStyles)for(var j=0;j<endStyles.length;j+=2)if(endStyles[j+1]==nextChange)spanEndStyle+=\" \"+endStyles[j];if(!collapsed||collapsed.from==pos)for(var j=0;j<foundBookmarks.length;++j)buildCollapsedSpan(builder,0,foundBookmarks[j]);if(collapsed&&(collapsed.from||0)==pos){buildCollapsedSpan(builder,(collapsed.to==null?len+1:collapsed.to)-pos,collapsed.marker,collapsed.from==null);if(collapsed.to==null)return;if(collapsed.to==pos)collapsed=false;}}if(pos>=len)break;var upto=Math.min(len,nextChange);while(true){if(text){var end=pos+text.length;if(!collapsed){var tokenText=end>upto?text.slice(0,upto-pos):text;builder.addToken(builder,tokenText,style?style+spanStyle:spanStyle,spanStartStyle,pos+tokenText.length==nextChange?spanEndStyle:\"\",title,css);}if(end>=upto){text=text.slice(upto-pos);pos=upto;break;}pos=end;spanStartStyle=\"\";}text=allText.slice(at,at=styles[i++]);style=interpretTokenStyle(styles[i++],builder.cm.options);}}} // DOCUMENT DATA STRUCTURE", "title": "" }, { "docid": "d81ab6d0702ecdb45585e96a529976ef", "score": "0.5442625", "text": "function insertLineContent(line, builder, styles) {\n\t\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t\t if (!spans) {\n\t\t for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n\t\t { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n\t\t return\n\t\t }\n\n\t\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n\t\t for (;;) {\n\t\t if (nextChange == pos) { // Update current marker set\n\t\t spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n\t\t attributes = null;\n\t\t collapsed = null; nextChange = Infinity;\n\t\t var foundBookmarks = [], endStyles = (void 0);\n\t\t for (var j = 0; j < spans.length; ++j) {\n\t\t var sp = spans[j], m = sp.marker;\n\t\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t\t foundBookmarks.push(m);\n\t\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t\t nextChange = sp.to;\n\t\t spanEndStyle = \"\";\n\t\t }\n\t\t if (m.className) { spanStyle += \" \" + m.className; }\n\t\t if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n\t\t if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n\t\t if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n\t\t // support for the old title property\n\t\t // https://github.com/codemirror/CodeMirror/pull/5673\n\t\t if (m.title) { (attributes || (attributes = {})).title = m.title; }\n\t\t if (m.attributes) {\n\t\t for (var attr in m.attributes)\n\t\t { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n\t\t }\n\t\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t\t { collapsed = sp; }\n\t\t } else if (sp.from > pos && nextChange > sp.from) {\n\t\t nextChange = sp.from;\n\t\t }\n\t\t }\n\t\t if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n\t\t { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n\t\t if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n\t\t { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n\t\t if (collapsed && (collapsed.from || 0) == pos) {\n\t\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t\t collapsed.marker, collapsed.from == null);\n\t\t if (collapsed.to == null) { return }\n\t\t if (collapsed.to == pos) { collapsed = false; }\n\t\t }\n\t\t }\n\t\t if (pos >= len) { break }\n\n\t\t var upto = Math.min(len, nextChange);\n\t\t while (true) {\n\t\t if (text) {\n\t\t var end = pos + text.length;\n\t\t if (!collapsed) {\n\t\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n\t\t }\n\t\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n\t\t pos = end;\n\t\t spanStartStyle = \"\";\n\t\t }\n\t\t text = allText.slice(at, at = styles[i++]);\n\t\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t\t }\n\t\t }\n\t\t }", "title": "" }, { "docid": "811c1dd70f1af5ad6dad06edf7f5734e", "score": "0.5383469", "text": "function Line(start,end) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.kind = \"line\"\n\t}", "title": "" }, { "docid": "0e7c279f643908361219f9559883bb12", "score": "0.53605336", "text": "function LineView(doc,line,lineN){ // The starting line\n\tthis.line=line; // Continuing lines, if any\n\tthis.rest=visualLineContinued(line); // Number of logical lines in this visual line\n\tthis.size=this.rest?lineNo(lst(this.rest))-lineN+1:1;this.node=this.text=null;this.hidden=lineIsHidden(doc,line);} // Create a range of LineView objects for the given lines.", "title": "" }, { "docid": "919d35fc3f52633040f6725ce2de188b", "score": "0.5352672", "text": "function updateGeometry (geometry, data, font) {\n geometry.update(utils.extend({}, data, {\n font: font,\n width: computeWidth(data.wrapPixels, data.wrapCount, font.widthFactor),\n text: data.value.replace(/\\\\n/g, '\\n').replace(/\\\\t/g, '\\t'),\n lineHeight: data.lineHeight || font.common.lineHeight\n }));\n}", "title": "" }, { "docid": "f14174e452218667eced17a1d7dd09c1", "score": "0.5336214", "text": "function insertDocumentStructure(type) {\n var doc = DocumentApp.getActiveDocument();\n // check if document is empty\n if (isDocumentEmpty()) {\n // if empty - insert document structure\n var cursor = doc.getCursor();\n if (cursor) {\n generateStructure(type, cursor);\n } else {\n DocumentApp.getUi().alert('Cannot find a cursor.');\n }\n } else {\n // if not empty - ask user what he wants to do\n var docUi = DocumentApp.getUi();\n var response = docUi.alert('Warning','Do you want to replace your content (Yes button)' \n + ' or insert in place of cursor (No button)?', docUi.ButtonSet.YES_NO);\n if (response == docUi.Button.YES) {\n // replace all content\n removeAllContent();\n }\n // if insert in place of cursor\n var cursor = doc.getCursor();\n if (cursor) {\n \n generateStructure(type, cursor);\n } else {\n DocumentApp.getUi().alert('Cannot find a cursor.');\n }\n } // if document is not empty\n}", "title": "" }, { "docid": "245f27f634c53941bc4b2d8a30aa7cd8", "score": "0.53108835", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "4a08c5187c37593c791af8695e988474", "score": "0.5299156", "text": "constructor(obj) {\n this.start = obj.start;\n this.startOffset = obj.startOffset;\n this.end = obj.end;\n this.endOffset = obj.endOffset;\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.52899903", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "eadcee84fb8112c162d8b903e3e289dc", "score": "0.52891773", "text": "function TextLine() {\n this.data = [];\n }", "title": "" }, { "docid": "eda11b7961555409ba85c14ff1adcc85", "score": "0.5287693", "text": "function isWholeLineUpdate(doc, change) {\n\t\t return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n\t\t (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n\t\t }", "title": "" }, { "docid": "f04a8cc6e4dcea3fb321b70e125a3a5a", "score": "0.528524", "text": "function TextLine() {\r\n\t this.data = [];\r\n\t }", "title": "" }, { "docid": "dfba7bef6c00f4c9638d1733728d22fa", "score": "0.527678", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "title": "" }, { "docid": "dfba7bef6c00f4c9638d1733728d22fa", "score": "0.527678", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "title": "" }, { "docid": "83a6fb64ed8d91c64ee6848728f08d17", "score": "0.52715176", "text": "function _entry(data) {\n var entry = {};\n var array = data.split('\\r\\n');\n if (array.length === 1) {\n array = data.split('\\n');\n }\n var idx = 1;\n if (array[0].indexOf(' --> ') > 0) {\n idx = 0;\n }\n if (array.length > idx + 1 && array[idx + 1]) {\n // This line contains the start and end.\n var line = array[idx];\n var index = line.indexOf(' --> ');\n if (index > 0) {\n entry.begin = (0, _strings.seconds)(line.substr(0, index));\n entry.end = (0, _strings.seconds)(line.substr(index + 5));\n // Remaining lines contain the text\n entry.text = array.slice(idx + 1).join('\\r\\n');\n }\n }\n return entry;\n}", "title": "" }, { "docid": "83a6fb64ed8d91c64ee6848728f08d17", "score": "0.52715176", "text": "function _entry(data) {\n var entry = {};\n var array = data.split('\\r\\n');\n if (array.length === 1) {\n array = data.split('\\n');\n }\n var idx = 1;\n if (array[0].indexOf(' --> ') > 0) {\n idx = 0;\n }\n if (array.length > idx + 1 && array[idx + 1]) {\n // This line contains the start and end.\n var line = array[idx];\n var index = line.indexOf(' --> ');\n if (index > 0) {\n entry.begin = (0, _strings.seconds)(line.substr(0, index));\n entry.end = (0, _strings.seconds)(line.substr(index + 5));\n // Remaining lines contain the text\n entry.text = array.slice(idx + 1).join('\\r\\n');\n }\n }\n return entry;\n}", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "0ecaf1fba8d60bb43a6999c8a5ec69f0", "score": "0.52616537", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "title": "" }, { "docid": "43fadfe7dc24b7e78296c71498a4767d", "score": "0.52572906", "text": "newDocument() {\n setModel({ blocks: [{ type: 'paragraph', data: { text: '' }, current: false }] });\n renderDOM();\n }", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" }, { "docid": "3e971c51cba4b0f881ab03198b3d5d9b", "score": "0.5250489", "text": "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "title": "" } ]
3c210950c105ad5599234cba4509f39b
Make the phylogeny Panel small, and the minimap Panel big
[ { "docid": "f50aef9c72632fd7376eea8b2a768324", "score": "0.5780118", "text": "function fullSizeMinimap() {\n $(\"#zoom\").animate({\n height: screenHeight - 250 - $('#header').height()\n }, 500);\n\n $('#phylogenyContainer').animate({\n 'width': 30\n }, 1000, function () {\n zoom(1, 0, 1);\n screenResize();\n });\n}", "title": "" } ]
[ { "docid": "42f6fa2e4e7b03144313322f9a58cc88", "score": "0.6200275", "text": "function screenResize() {\n //If the width has changed since last time, update the width of the left sub panel accordingly\n if ($(window).width() != screenWidth) {\n $(\"#phylogenyContainer\").width(Math.ceil($(\"#phylogenyContainer\").width() * $(window).width() / screenWidth));\n screenWidth = $(window).width();\n }\n\n //If the height has changed since last time, update the height of the zoom panel accordingly\n if ($(window).height() != screenHeight) {\n $(\"#zoom\").height(Math.ceil($(\"#zoom\").height() * $(window).height() / screenHeight));\n screenHeight = $(window).height();\n }\n\n if ($(\"#zoom\").height() + $(\"#header\").height() > (screenHeight - 25)) {\n $(\"#zoom\").height(screenHeight - 25 - $(\"#header\").height());\n }\n\n //Update the height of the sub panel after change of the zoom panel.\n //The sub panel becomes the height of the screen, minus the height of the zoom and header bar.\n var borderHeight = parseInt($(\"#zoom\").css(\"border-bottom-width\").replace('px', ''));\n $('#sub').height($(window).height() - $(\"#zoom\").height() - $(\"#header\").height() - borderHeight);\n $('#sub').height($(window).height() - $(\"#zoom\").height() - $(\"#header\").height() - borderHeight);\n $('#minimap').height($('#sub').height());\n $('#minimap .slider').css('height', '100%');\n if ($('#zoom').find('canvas').length) { //Update the canvas height and width in the zoom panel\n $('#zoom').find('canvas')[0].height = $('#zoomWindow').height();\n $('#zoom').find('canvas')[0].width = $('#zoomWindow').width();\n updatezoomWindow();\n }\n\n //Update the width of the sub panel and zoom panel and the canvasses in it.\n //If the width of a subpanel has changed or the screen, update both the upper canvas and the panels in the sub.\n //Both canvasses need to be updated as well.\n var borderWidth = parseInt($(\"#phylogenyContainer\").css(\"border-right-width\").replace('px', ''));\n $('#minimapContainer').width($(\"#sub\").width() - $(\"#phylogenyContainer\").width() - borderWidth - 2);\n if ($('#minimapContainer').find('canvas').length) {\n $('#minimap').find('canvas')[0].width = $('#minimap').width();\n $('#minimap').find('canvas')[0].height = $('#minimap').height();\n drawMinimap(null); //Update the canvas\n zoom(1, 0, 1);\n if (treeRedrawTimeout) {\n clearTimeout(treeRedrawTimeout);\n }\n treeRedrawTimeout = setTimeout(function () {\n resizePhyloTree();\n }, 500);\n }\n\n if ($('#phyloButtons').width() < 180) {\n $('#compGenomesButton').hide();\n } else {\n $('#compGenomesButton').show();\n }\n}", "title": "" }, { "docid": "a177df891d2c3b80966dc3763b85d385", "score": "0.5949177", "text": "function setLevel(size, mines) {\r\n if (gIsManualMode) return;\r\n gLevel.size = size;\r\n gLevel.mines = mines;\r\n restart();\r\n if (size === 4) document.querySelector('table').style.left = 30 + '%';\r\n if (size === 8) document.querySelector('table').style.left = 30 + '%';\r\n if (size === 12) document.querySelector('table').style.left = 30 + '%';\r\n if (size === 4) document.querySelector('table').style.bottom = 0 + '%';\r\n if (size === 8) document.querySelector('table').style.bottom = 0 + '%';\r\n if (size === 12) document.querySelector('table').style.bottom = 0 + '%';\r\n}", "title": "" }, { "docid": "02ac41d466ef02fefad670e679f5f2ab", "score": "0.5907267", "text": "function setPanelSize() {\n var gridSize = g_objGrid.getSize();\n\n //set panel size\n if (g_temp.isHorType == true)\n g_temp.panelHeight = gridSize.height + g_options.gridpanel_padding_border_top + g_options.gridpanel_padding_border_bottom;\n else\n g_temp.panelWidth = gridSize.width + g_options.gridpanel_padding_border_left + g_options.gridpanel_padding_border_right;\n\n g_functions.setElementSize(g_objPanel, g_temp.panelWidth, g_temp.panelHeight);\n\n }", "title": "" }, { "docid": "d9087a7ad2176ba4c85463031634100b", "score": "0.5848011", "text": "function setDimensions(){ pieces = getDimensions(); pinMenu(); }", "title": "" }, { "docid": "c037c840b2a0ad2d65b0c06cdfed5154", "score": "0.56237966", "text": "function PropertiesPanel(_canvas) {\n var me = this;\n var canvas = _canvas;\n var Cn = canvas.getConstruction();\n $U.extend(this, new VerticalBorderPanel(canvas, 240, false));\n me.setBounds(me.getBounds().left + 15, -5, 0, 0); // Le fond n'est pas affiché\n\n me.show();\n\n me.getCS = function() {\n return Cn.coordsSystem;\n };\n\n me.setMagnifierMode = function(_val) {\n canvas.magnifyManager.setMagnifierMode(_val);\n };\n me.getMagnifierMode = function() {\n return canvas.magnifyManager.getMagnifierMode();\n };\n me.setDragOnlyMoveable = function(_val) {\n Cn.setDragOnlyMoveable(_val);\n };\n me.isDragOnlyMoveable = function() {\n return Cn.isDragOnlyMoveable();\n };\n me.setDegree = function(_val) {\n Cn.setDEG(_val);\n Cn.computeAll();\n canvas.paint();\n };\n me.getDegree = function(_val) {\n return Cn.isDEG();\n };\n me.setDemoMode = function(_val) {\n canvas.demoModeManager.setDemoMode(_val);\n };\n me.getDemoMode = function() {\n return canvas.demoModeManager.getDemoMode();\n };\n me.getBackgroundColor = function() {\n return canvas.getBackground();\n };\n me.setBackgroundColor = function(val) {\n return canvas.setBackground(val);\n };\n\n var props_name = new props_namePanel(me);\n var props_color = new props_colorPanel(me);\n var props_grid = new props_gridPanel(me);\n var props_message = new props_messagePanel(me);\n // Une ineptie necessaire parce que sinon le clavier virtuel\n // de l'ipad change la position du panneau de propriété :\n if (Object.touchpad) {\n window.scrollTo(0, 0);\n }\n\n props_message.show();\n\n me.showProperties = function(_obj) {\n if ($U.isMobile.mobilePhone()) {\n props_color.clearContent();\n props_message.clearContent();\n }\n\n props_message.close();\n if (_obj.getCode().startsWith(\"axis\")) {\n if ($U.isMobile.mobilePhone())\n props_color.clearContent();\n props_color.close();\n props_name.close();\n props_grid.show();\n props_grid.set();\n } else {\n props_grid.close();\n if (_obj.getCode() === \"expression_cursor\")\n props_name.close();\n else\n props_name.set(_obj);\n\n props_color.set(_obj);\n // Une ineptie necessaire parce que sinon le clavier virtuel\n // de l'ipad change la position du panneau de propriété :\n if (Object.touchpad) {\n window.scrollTo(0, 0);\n }\n }\n };\n //\n me.compute = function() {\n Cn.computeAll();\n };\n me.repaint = function() {\n canvas.paint();\n };\n me.getAnimationSpeed = function(_o) {\n return Cn.getAnimationSpeed(_o)\n };\n\n me.setAnimationSpeed = function(_o, _v) {\n Cn.setAnimationSpeed(_o, _v);\n };\n\n\n me.setAllSize = function(_type, _sze) {\n Cn.setAllSize(_type, _sze);\n };\n me.setAllSegSize = function(_type, _sze) {\n Cn.setAllSegSize(_type, _sze);\n };\n me.setAllColor = function(_type, _sze) {\n Cn.setAllColor(_type, _sze);\n };\n me.setAllOpacity = function(_type, _sze) {\n Cn.setAllOpacity(_type, _sze);\n };\n me.setAllLayer = function(_type, _sze) {\n Cn.setAllLayer(_type, _sze);\n };\n me.setAllPtShape = function(_shape) {\n Cn.setAllPtShape(_shape);\n };\n me.setAllFontSize = function(_type, _sze) {\n Cn.setAllFontSize(_type, _sze);\n };\n me.setAllPrecision = function(_type, _sze) {\n Cn.setAllPrecision(_type, _sze);\n };\n me.setAllIncrement = function(_type, _sze) {\n Cn.setAllIncrement(_type, _sze);\n };\n me.setAllDash = function(_type, _sze) {\n Cn.setAllDash(_type, _sze);\n };\n me.setAll360 = function(_type, _360) {\n Cn.setAll360(_type, _360);\n };\n me.setAllTrigo = function(_type, _t) {\n Cn.setAllTrigo(_type, _t);\n };\n me.setAllNoMouse = function(_type, _sze) {\n Cn.setAllNoMouse(_type, _sze);\n };\n me.setTrack = function(_o, _val) {\n if (_val)\n canvas.trackManager.add(_o);\n else\n canvas.trackManager.remove(_o);\n };\n me.setAllTrack = function(_type, _val) {\n canvas.trackManager.setAllTrack(_type, _val);\n };\n // me.setAnimation=function(_o,_val){\n\n // };\n\n}", "title": "" }, { "docid": "de879079b1c86fe95a6ef5eb93b88402", "score": "0.5617021", "text": "function toggle_on() {\n\n document.getElementById('toggle').className = 'togle_btn';\n document.getElementById('toggle_up').className = 'togle_btn_up';\n\n var h = document.getElementById('side_panel_id').clientHeight;\n document.getElementById('panel_td').style.height = h + 'px';\n\n hide('side_panel_id');\n hide('tg');\n show('tg_1');\n show('search_top');\n document.getElementById('action_panel_main_id').className = 'action_panel_main_new';\n document.getElementById('left_container_id').className = 'left_container_new';\n document.getElementById('right_section_id').className = 'right_section';\n document.getElementById('right_container_id').className = 'right_container_new';\n //load('toggle');\n if (getWindowWidth() > 650)\n googlemap.map.checkResize(); // for manage map accroding to the new width and hieght\n}", "title": "" }, { "docid": "cd7b97b105a07efcad7dafae8ab667c7", "score": "0.55896944", "text": "function repositionPanel(A){function toggleFixedChildPanels(t,e){for(var n,i=0;i<M.length;i++)if(M[i]!=A)for(n=M[i].parent();n&&(n=n.parent());)n==A&&M[i].fixed(t).moveBy(0,e).repaint()}var t=n.getViewPort().y;A.settings.autofix&&(A.state.get(\"fixed\")?A._autoFixY>t&&(A.fixed(!1).layoutRect({y:A._autoFixY}).repaint(),toggleFixedChildPanels(!1,A._autoFixY-t)):(A._autoFixY=A.layoutRect().y,A._autoFixY<t&&(A.fixed(!0).layoutRect({y:0}).repaint(),toggleFixedChildPanels(!0,t-A._autoFixY))))}", "title": "" }, { "docid": "693308870291dc0675477b9c89cedeb5", "score": "0.5552084", "text": "function setNorthSize(pp){\r\n\t\t\tif (pp.length == 0) return;\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: cc.width(),\r\n\t\t\t\theight: pp.panel('options').height,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\ttop: 0\r\n\t\t\t});\r\n\t\t\tcpos.top += pp.panel('options').height;\r\n\t\t\tcpos.height -= pp.panel('options').height;\r\n\t\t}", "title": "" }, { "docid": "6e42080b29182a32a9f5f740cfb72e08", "score": "0.553578", "text": "function resize_for_exploration() {\n if (d3.select('#left').empty()) {\n append_divs();\n }\n d3.select('#left').style('width', '18%');\n d3.select('#right').style('width', '70%');\n}", "title": "" }, { "docid": "6e42080b29182a32a9f5f740cfb72e08", "score": "0.553578", "text": "function resize_for_exploration() {\n if (d3.select('#left').empty()) {\n append_divs();\n }\n d3.select('#left').style('width', '18%');\n d3.select('#right').style('width', '70%');\n}", "title": "" }, { "docid": "dc0beb287501a0d5350ee96a2d9f8b55", "score": "0.5498717", "text": "function GRID_100$static_(){ContainerSkin.GRID_100=( new ContainerSkin(\"grid-100\"));}", "title": "" }, { "docid": "628446be918fe06ac51268ae3f0b6fc6", "score": "0.54889905", "text": "function setWestSize(pp){\r\n\t\t\tif (pp.length == 0) return;\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: pp.panel('options').width,\r\n\t\t\t\theight: cpos.height,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\ttop: cpos.top\r\n\t\t\t});\r\n\t\t\tcpos.left += pp.panel('options').width;\r\n\t\t\tcpos.width -= pp.panel('options').width;\r\n\t\t}", "title": "" }, { "docid": "e349ed5f1bde4ba7cbdebc7d4096c9dd", "score": "0.5475832", "text": "function setSize(container){\r\n\t\tvar opts = $.data(container, 'layout').options;\r\n\t\tvar panels = $.data(container, 'layout').panels;\r\n\t\t\r\n\t\tvar cc = $(container);\r\n\t\t\r\n\t\tif (opts.fit == true){\r\n\t\t\tvar p = cc.parent();\r\n\t\t\tcc.width(p.width()).height(p.height());\r\n\t\t}\r\n\t\t\r\n\t\tvar cpos = {\r\n\t\t\ttop:0,\r\n\t\t\tleft:0,\r\n\t\t\twidth:cc.width(),\r\n\t\t\theight:cc.height()\r\n\t\t};\r\n\t\t\r\n\t\t// set north panel size\r\n\t\tfunction setNorthSize(pp){\r\n\t\t\tif (pp.length == 0) return;\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: cc.width(),\r\n\t\t\t\theight: pp.panel('options').height,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\ttop: 0\r\n\t\t\t});\r\n\t\t\tcpos.top += pp.panel('options').height;\r\n\t\t\tcpos.height -= pp.panel('options').height;\r\n\t\t}\r\n\t\tif (isVisible(panels.expandNorth)){\r\n\t\t\tsetNorthSize(panels.expandNorth);\r\n\t\t} else {\r\n\t\t\tsetNorthSize(panels.north);\r\n\t\t}\r\n\t\t\r\n\t\t// set south panel size\r\n\t\tfunction setSouthSize(pp){\r\n\t\t\tif (pp.length == 0) return;\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: cc.width(),\r\n\t\t\t\theight: pp.panel('options').height,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\ttop: cc.height() - pp.panel('options').height\r\n\t\t\t});\r\n\t\t\tcpos.height -= pp.panel('options').height;\r\n\t\t}\r\n\t\tif (isVisible(panels.expandSouth)){\r\n\t\t\tsetSouthSize(panels.expandSouth);\r\n\t\t} else {\r\n\t\t\tsetSouthSize(panels.south);\r\n\t\t}\r\n\t\t\r\n\t\t// set east panel size\r\n\t\tfunction setEastSize(pp){\r\n\t\t\tif (pp.length == 0) return;\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: pp.panel('options').width,\r\n\t\t\t\theight: cpos.height,\r\n\t\t\t\tleft: cc.width() - pp.panel('options').width,\r\n\t\t\t\ttop: cpos.top\r\n\t\t\t});\r\n\t\t\tcpos.width -= pp.panel('options').width;\r\n\t\t}\r\n\t\tif (isVisible(panels.expandEast)){\r\n\t\t\tsetEastSize(panels.expandEast);\r\n\t\t} else {\r\n\t\t\tsetEastSize(panels.east);\r\n\t\t}\r\n\t\t\r\n\t\t// set west panel size\r\n\t\tfunction setWestSize(pp){\r\n\t\t\tif (pp.length == 0) return;\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: pp.panel('options').width,\r\n\t\t\t\theight: cpos.height,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\ttop: cpos.top\r\n\t\t\t});\r\n\t\t\tcpos.left += pp.panel('options').width;\r\n\t\t\tcpos.width -= pp.panel('options').width;\r\n\t\t}\r\n\t\tif (isVisible(panels.expandWest)){\r\n\t\t\tsetWestSize(panels.expandWest);\r\n\t\t} else {\r\n\t\t\tsetWestSize(panels.west);\r\n\t\t}\r\n\t\t\r\n\t\tpanels.center.panel('resize', cpos);\r\n\t}", "title": "" }, { "docid": "ed0d08a0d68f6c3d3953f1d07e237785", "score": "0.5464251", "text": "adjust() {\n const lattice_width = 3 * this.distance + 1;\n const step = this.info.size / (lattice_width + 1);\n this.graph.set_size(step, lattice_width);\n }", "title": "" }, { "docid": "61313d95467ca2075365ddb81e657769", "score": "0.5463781", "text": "function clearUnwantedPanels(hasViewer, hasMap, hasGlobe) {\r\n if (!hasViewer && !hasGlobe) {\r\n $('#mapSplit').off('mousedown', mapSplitOnMouseDown)\r\n $('#mapSplit').off('touchstart', mapSplitOnMouseDown)\r\n d3.select('#viewerSplit').selectAll('*').remove()\r\n d3.select('#viewerSplit').style('width', 0)\r\n $('#mapSplit div:not(#mapSplitText)').remove()\r\n d3.select('#mapSplit')\r\n .style('cursor', 'default')\r\n .style('box-shadow', 'none')\r\n $('#globeSplit').off('mousedown', globeSplitOnMouseDown)\r\n $('#globeSplit').off('touchstart', globeSplitOnMouseDown)\r\n d3.select('#globeSplit').selectAll('*').remove()\r\n d3.select('#globeSplit')\r\n .style('width', '0')\r\n .style('cursor', 'default')\r\n .style('box-shadow', 'none')\r\n d3.select('#mapSplit').selectAll('*').remove()\r\n d3.select('#mapSplit').style('width', '0')\r\n d3.select('#mapScreen').style('top', '0')\r\n UserInterface.splitterSize = 0\r\n } else if (!hasViewer) {\r\n $('#mapSplit').off('mousedown', mapSplitOnMouseDown)\r\n $('#mapSplit').off('touchstart', mapSplitOnMouseDown)\r\n d3.select('#viewerSplit').selectAll('*').remove()\r\n d3.select('#viewerSplit').style('width', 0)\r\n $('#mapSplit div:not(#mapSplitText)').remove()\r\n d3.select('#mapSplit')\r\n .style('cursor', 'default')\r\n .style('box-shadow', 'none')\r\n } else if (!hasGlobe) {\r\n $('#globeSplit').off('mousedown', globeSplitOnMouseDown)\r\n $('#globeSplit').off('touchstart', globeSplitOnMouseDown)\r\n d3.select('#globeSplit').selectAll('*').remove()\r\n d3.select('#globeSplit')\r\n .style('width', '0')\r\n .style('cursor', 'default')\r\n .style('box-shadow', 'none')\r\n }\r\n windowresize()\r\n Map_.map.invalidateSize()\r\n}", "title": "" }, { "docid": "43be0c8c071379eacd30dba6691a46b2", "score": "0.5461712", "text": "function draw_minimap() {\n\n\tlet scale = 5;\n\tlet xshift = resolutionW * 18.8/20;\n\tlet yshift = resolutionH * 1.3/20;\n\tlet padding = 30/scale;\n\n\tfunction minimapizex(x) {return (x/scale)+xshift;}\n\tfunction minimapizey(y) {return (y/scale)+yshift;}\n\n\t// bg for minimap\n\tfill(0, 0, 255, 127);\n\trect(xshift - (width/(scale*4))-padding, yshift - (height/(scale*4))-padding, (width/(scale*2))+padding*2, (height/(scale*2))+padding*2);\n\n\tfor (var keyy in blobsdict) {\n\t\tlet x = blobsdict[keyy].x;\n\t\tlet y = blobsdict[keyy].y;\n\t\tlet r = blobsdict[keyy].r;\n\n\t\ttextAlign(CENTER);\n\t\ttextSize(4/scale);\n\t\tfill(255);\n\t\ttext(blobsdict[keyy].lastchat, minimapizex(x), minimapizey(y + r + 4));\n\n\t\tfill(0);\n\t\ttext(blobsdict[keyy].name, minimapizex(x), minimapizey(y - r + 2));\n\t\t\n\t\tfill(0, 255, 255);\n\t\tellipse(minimapizex(x), minimapizey(y), (r*2)/scale, (r*2)/scale);\n\t}\n\t\n\tfor (var k = 0; k < serverpermanents.length; k++) {\n\t\t// portal & portaltext\n\t\tfill(255);\n\t\tellipse(minimapizex(serverpermanents[k].x), minimapizey(serverpermanents[k].y), serverpermanents[k].r/scale, serverpermanents[k].r/scale);\n\t\t\n\t\tfill('blue');\n\t\ttextAlign(CENTER);\n\t\ttextSize(6/scale);\n\t\ttext(serverpermanents[k].name, serverpermanents[k].x-1/scale, -5/scale);\n\t}\n\n}", "title": "" }, { "docid": "7243e2724a916a5d1873ccfbb9764808", "score": "0.5451257", "text": "function setHtmlPanel() {\n\n //add panel wrapper\n g_objWrapper.append(\"<div class='ug-grid-panel'></div>\");\n\n g_objPanel = g_objWrapper.children('.ug-grid-panel');\n\n //add arrows:\n if (g_temp.isHorType) {\n\n g_objPanel.append(\"<div class='grid-arrow grid-arrow-left-hortype ug-skin-\" + g_options.gridpanel_arrows_skin + \"'></div>\");\n g_objPanel.append(\"<div class='grid-arrow grid-arrow-right-hortype ug-skin-\" + g_options.gridpanel_arrows_skin + \"'></div>\");\n\n g_objArrowPrev = g_objPanel.children(\".grid-arrow-left-hortype\");\n g_objArrowNext = g_objPanel.children(\".grid-arrow-right-hortype\");\n }\n else if (g_options.gridpanel_vertical_scroll == false) {\t\t//horizonatl arrows\n g_objPanel.append(\"<div class='grid-arrow grid-arrow-left ug-skin-\" + g_options.gridpanel_arrows_skin + \"'></div>\");\n g_objPanel.append(\"<div class='grid-arrow grid-arrow-right ug-skin-\" + g_options.gridpanel_arrows_skin + \"'></div>\");\n\n g_objArrowPrev = g_objPanel.children(\".grid-arrow-left\");\n g_objArrowNext = g_objPanel.children(\".grid-arrow-right\");\n\n } else {\t\t//vertical arrows\n g_objPanel.append(\"<div class='grid-arrow grid-arrow-up ug-skin-\" + g_options.gridpanel_arrows_skin + \"'></div>\");\n g_objPanel.append(\"<div class='grid-arrow grid-arrow-down ug-skin-\" + g_options.gridpanel_arrows_skin + \"'></div>\");\n\n g_objArrowPrev = g_objPanel.children(\".grid-arrow-up\");\n g_objArrowNext = g_objPanel.children(\".grid-arrow-down\");\n }\n\n g_panelBase.setHtml(g_objPanel);\n\n //hide the arrows\n g_objArrowPrev.fadeTo(0, 0);\n g_objArrowNext.fadeTo(0, 0);\n\n //init the grid panel\n g_options.parent_container = g_objPanel;\n g_gallery.initThumbsPanel(\"grid\", g_options);\n\n //get the grid object\n var objects = g_gallery.getObjects();\n g_objGrid = objects.g_objThumbs;\n\n setHtmlProperties();\n }", "title": "" }, { "docid": "2fdb655459cf663d539c4efbaafe4630", "score": "0.5432874", "text": "function applyTileSize () {\n $('.tile.small').css({\n 'width': small_tile_size + 'px',\n 'height': small_tile_size + 'px'\n })\n \n $('.tile.medium, .s2mC').css({\n 'width': medium_tile_size + 'px',\n 'height': medium_tile_size + 'px'\n })\n \n $('.tile.big, .m2bC').css({\n 'width': big_tile_size + 'px',\n 'height': big_tile_size + 'px'\n })\n }", "title": "" }, { "docid": "28b7bbd7da8f57c39e7662fa203d9c06", "score": "0.5431767", "text": "function handlePanelResize(e, size) {\n \n\t\t// Only refresh codemirror every other call (perf). \n\t\tif (size & 1) {\n\t\t\tvar cm = EditorManager.getCurrentFullEditor()._codeMirror;\n\t\t\tcm.refresh();\n\t\t}\n\t\t\n\t\t// Adjust things properly if in horizontal mode.\n\t\tif (mode & 1) {\n\t\t\tmainView.style.left = (parseInt(size, 10) + 15) + 'px';\n\n\t\t\t// resize the toolbar\n\t\t\ttoolbar.resize(size);\n\t\t\t\n\t\t\treturn;\n\t\t}\n\n\t\t// Were in vertical mode so adjust things accordingly.\n\t\tmainView.style.height = (window.innerHeight - size - 16) + 'px';\n\t}", "title": "" }, { "docid": "e8b4c33d490118dda820a00b5ca3bf79", "score": "0.54257977", "text": "function changeSize(){\r\n //reset level \r\n levelTracker = 0;\r\n clearInterval(clock);\r\n timerVar=0;\r\nif (size===13) {\r\n size=7;\r\n getLevels(drawLevel);\r\n}\r\nelse {\r\n size =13;\r\n getLevels(drawLevel);\r\n}\r\nupdateCellSize();\r\n \r\n \r\n}", "title": "" }, { "docid": "5a63e7dc29ef153cf343081e62bfc3fb", "score": "0.54248416", "text": "_setDOM() {\n const props = this.props;\n const dom = this.dom;\n\n props.leftContainer.width = props.left.width;\n props.rightContainer.width = props.right.width;\n const centerWidth = props.root.width - props.left.width - props.right.width;\n props.center.width = centerWidth;\n props.centerContainer.width = centerWidth;\n props.top.width = centerWidth;\n props.bottom.width = centerWidth;\n\n // resize the panels\n dom.background.style.height = `${props.background.height}px`;\n dom.backgroundVertical.style.height = `${props.background.height}px`;\n dom.backgroundHorizontal.style.height = `${props.centerContainer.height}px`;\n dom.centerContainer.style.height = `${props.centerContainer.height}px`;\n dom.leftContainer.style.height = `${props.leftContainer.height}px`;\n dom.rightContainer.style.height = `${props.rightContainer.height}px`;\n\n dom.background.style.width = `${props.background.width}px`;\n dom.backgroundVertical.style.width = `${props.centerContainer.width}px`;\n dom.backgroundHorizontal.style.width = `${props.background.width}px`;\n dom.centerContainer.style.width = `${props.center.width}px`;\n dom.top.style.width = `${props.top.width}px`;\n dom.bottom.style.width = `${props.bottom.width}px`;\n\n // reposition the panels\n dom.background.style.left = '0';\n dom.background.style.top = '0';\n dom.backgroundVertical.style.left = `${props.left.width + props.border.left}px`;\n dom.backgroundVertical.style.top = '0';\n dom.backgroundHorizontal.style.left = '0';\n dom.backgroundHorizontal.style.top = `${props.top.height}px`;\n dom.centerContainer.style.left = `${props.left.width}px`;\n dom.centerContainer.style.top = `${props.top.height}px`;\n dom.leftContainer.style.left = '0';\n dom.leftContainer.style.top = `${props.top.height}px`;\n dom.rightContainer.style.left = `${props.left.width + props.center.width}px`;\n dom.rightContainer.style.top = `${props.top.height}px`;\n dom.top.style.left = `${props.left.width}px`;\n dom.top.style.top = '0';\n dom.bottom.style.left = `${props.left.width}px`;\n dom.bottom.style.top = `${props.top.height + props.centerContainer.height}px`;\n dom.center.style.left = '0';\n dom.left.style.left = '0';\n dom.right.style.left = '0';\n }", "title": "" }, { "docid": "a9c16d8b7e0cbc091417326b460aea72", "score": "0.5412642", "text": "function GRID_200$static_(){ContainerSkin.GRID_200=( new ContainerSkin(\"grid-200\"));}", "title": "" }, { "docid": "d396bff8903e2a2488d6b0b5dda33a73", "score": "0.53962183", "text": "adjust() {\n const lattice_width = 1 + 3 * (this.distance - 1);\n const step = this.info.size / (lattice_width + 1);\n this.graph.set_size(step, lattice_width);\n }", "title": "" }, { "docid": "39366fdc7fb17888b9bf82bf5629479e", "score": "0.538083", "text": "function defineJogadorPequeno(){\n tamanhoJogador = 'pequeno';\n jogador.scale.setTo(0.8,0.8);\n}", "title": "" }, { "docid": "0e0a1f6313b5f027d2b09b4c28b45b0a", "score": "0.53769404", "text": "goXSmall() {\n this.goResize('xs');\n }", "title": "" }, { "docid": "b75505e6af83543b9bf0da8bc75e2ab9", "score": "0.536548", "text": "function onResize() {\n updateSpanning();\n}", "title": "" }, { "docid": "a6b1bdce53e145cbfb2338acb7d12618", "score": "0.53617936", "text": "function large() {\n if (isLarge) return;\n body.appendChild(parent);\n // bigContainer.setAttribute('style', par.hasRound ? 'padding-top:3%':'padding-top:6%');\n startFont = fontSize;\n startWidth = par.width;\n var h = screen.height - screen.height/8; //document.body.clientHeight;\n var w = document.body.clientWidth;\n par.width = (w > h) ? Math.round(0.85 * h) : Math.round(0.85 * w);\n fontSize = fontSize * par.width / startWidth;\n deviceSVG.innerHTML = emptySVG();\n bigContainer.setAttribute('style','padding-top:' + (h-par.width)/2 + 'px; height: '+ par.width + 'px;');\n drawSVG(bigContainer);\n isLarge = true;\n }", "title": "" }, { "docid": "cd3d5d45737f6906721948030318ea12", "score": "0.5356384", "text": "function noBigTileInXS () {\n if(page_Width_Class == \"xs\") {\n for(var i in tiles) {\n tiles[i].size = (tiles[i].size == \"big\") ? \"medium\" : tiles[i].size;\n }\n }\n }", "title": "" }, { "docid": "905c20333db08fb204138cdf8ab30c0e", "score": "0.53542423", "text": "function ciniki_links_main() {\n //\n // Panels\n //\n this.toggleOptions = {'off':'Off', 'on':'On'};\n\n this.init = function() {\n //\n // links panel\n //\n this.menu = new M.panel('Links',\n 'ciniki_links_main', 'menu',\n 'mc', 'medium', 'sectioned', 'ciniki.links.main.menu');\n this.menu.sections = {\n '_':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':[''],\n 'addTxt':'Add Link',\n 'addFn':'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showMenu();\\',0);',\n 'noData':'No links added',\n },\n };\n this.menu.sectionData = function(s) { return this.data[s]; }\n this.menu.cellValue = function(s, i, j, d) { return d.link.name; }\n this.menu.rowFn = function(s, i, d) { return 'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showMenu();\\',' + d.link.id + ');' }\n this.menu.noData = function(s) { return this.sections[s].noData; }\n this.menu.addButton('add', 'Add', 'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showMenu();\\',0);');\n this.menu.addClose('Back');\n\n //\n // tags or category list panel\n //\n this.tags = new M.panel('Links',\n 'ciniki_links_main', 'tags',\n 'mc', 'medium', 'sectioned', 'ciniki.links.main.tags');\n this.tags.tag_type = 40;\n this.tags.sections = {\n 'types':{'label':'', 'visible':'no', 'selected':'categories', 'type':'paneltabs', 'tabs':{\n 'categories':{'label':'Categories', 'fn':'M.ciniki_links_main.showTagsTab(10);'},\n 'tags':{'label':'Tags', 'fn':'M.ciniki_links_main.showTagsTab(40);'},\n }},\n 'categories':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':[''],\n 'addTxt':'Add Link',\n 'addFn':'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showTags();\\',0);',\n 'noData':'No links added',\n },\n 'tags':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':[''],\n 'addTxt':'Add Link',\n 'addFn':'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showTags();\\',0);',\n 'noData':'No links added',\n },\n };\n this.tags.sectionData = function(s) { return this.data[s]; }\n this.tags.cellValue = function(s, i, j, d) { \n return d.tag.name + (d.tag.count!=null?' <span class=\"count\">'+d.tag.count+'</span>':''); \n }\n this.tags.rowFn = function(s, i, d) { return 'M.ciniki_links_main.showList(\\'M.ciniki_links_main.showTags();\\',M.ciniki_links_main.tags.tag_type,\\'' + escape(d.tag.name) + '\\');' }\n this.tags.noData = function(s) { return this.sections[s].noData; }\n this.tags.addButton('add', 'Add', 'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showTags();\\',0);');\n this.tags.addClose('Back');\n\n //\n // tags or category list panel\n //\n this.list = new M.panel('Links',\n 'ciniki_links_main', 'list',\n 'mc', 'medium', 'sectioned', 'ciniki.links.main.list');\n this.list.tag_type = 40;\n this.list.tag_name = '';\n this.list.sections = {\n 'links':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':['multiline'],\n 'addTxt':'Add Link',\n 'addFn':'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showList();\\',0,M.ciniki_links_main.list.tag_type,escape(M.ciniki_links_main.list.tag_name));',\n 'noData':'No links added',\n },\n };\n this.list.sectionData = function(s) { return this.data[s]; }\n this.list.cellValue = function(s, i, j, d) { \n return '<span class=\"maintext\">' + d.link.name + '</span><span class=\"subtext\">' + d.link.url + '</span>'; \n }\n this.list.rowFn = function(s, i, d) { return 'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showList();\\',' + d.link.id + ');' }\n this.list.noData = function(s) { return this.sections[s].noData; }\n this.list.addButton('add', 'Add', 'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showList();\\',0,M.ciniki_links_main.list.tag_type,M.ciniki_links_main.list.tag_name);');\n this.list.addClose('Back');\n\n //\n // The edit link panel \n //\n this.edit = new M.panel('Link',\n 'ciniki_links_main', 'edit',\n 'mc', 'medium', 'sectioned', 'ciniki.links.main.edit');\n this.edit.data = null;\n this.edit.link_id = 0;\n this.edit.sections = { \n 'general':{'label':'General', 'fields':{\n 'name':{'label':'Name', 'hint':'Company or links name', 'type':'text'},\n// 'category':{'label':'Category', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes'},\n 'url':{'label':'URL', 'hint':'Enter the http:// address for your links website', 'type':'text'},\n }}, \n '_categories':{'label':'Categories', 'active':'no', 'fields':{\n 'categories':{'label':'', 'hidelabel':'yes', 'type':'tags', 'tags':[], 'hint':'Enter a new category:'},\n }},\n '_tags':{'label':'Tags', 'active':'no', 'fields':{\n 'tags':{'label':'', 'hidelabel':'yes', 'type':'tags', 'tags':[], 'hint':'Enter a new tag:'},\n }},\n '_description':{'label':'Additional Information', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'hint':'Add additional information about your link', 'type':'textarea'},\n }},\n '_notes':{'label':'Notes', 'fields':{\n 'notes':{'label':'', 'hidelabel':'yes', 'hint':'Other notes about this link', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_links_main.saveLink();'},\n 'delete':{'label':'Delete', 'visible':'no', 'fn':'M.ciniki_links_main.deleteLink();'},\n }},\n }; \n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\n// this.edit.liveSearchCb = function(s, i, value) {\n// if( i == 'category' ) {\n// var rsp = M.api.getJSONBgCb('ciniki.links.linkSearchField', {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'limit':15},\n// function(rsp) {\n// M.ciniki_links_main.edit.liveSearchShow(s, i, M.gE(M.ciniki_links_main.edit.panelUID + '_' + i), rsp.results);\n// });\n// }\n// };\n// this.edit.liveSearchResultValue = function(s, f, i, j, d) {\n// if( (f == 'category' ) && d.result != null ) { return d.result.name; }\n// return '';\n// };\n// this.edit.liveSearchResultRowFn = function(s, f, i, j, d) { \n// if( (f == 'category' )\n// && d.result != null ) {\n// return 'M.ciniki_links_main.edit.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.result.name) + '\\');';\n// }\n// };\n// this.edit.updateField = function(s, lid, result) {\n// M.gE(this.panelUID + '_' + lid).value = unescape(result);\n// this.removeLiveSearch(s, lid);\n// };\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.links.linkHistory', 'args':{'tnid':M.curTenantID, 'link_id':this.link_id, 'field':i}};\n }\n this.edit.addButton('save', 'Save', 'M.ciniki_links_main.saveLink();');\n this.edit.addClose('Cancel');\n\n };\n\n //\n // Arguments:\n // aG - The arguments to be parsed into args\n //\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) {\n args = eval(aG);\n }\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_links_main', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n if( (M.curTenant.modules['ciniki.links'].flags&0x01) > 0 ) {\n this.edit.sections._categories.active = 'yes';\n// this.edit.sections.general.fields.category.active = 'no';\n } else {\n this.edit.sections._categories.active = 'no';\n// this.edit.sections.general.fields.category.active = 'yes';\n }\n if( (M.curTenant.modules['ciniki.links'].flags&0x02) > 0 ) {\n this.edit.sections._tags.active = 'yes';\n } else {\n this.edit.sections._tags.active = 'no';\n }\n if( (M.curTenant.modules['ciniki.links'].flags&0x10) > 0 ) {\n this.edit.sections._notes.active = 'yes';\n } else {\n this.edit.sections._notes.active = 'no';\n }\n \n if( (M.curTenant.modules['ciniki.links'].flags&0x03) == 0x03 ) {\n this.tags.sections.tags.label = '';\n this.tags.sections.categories.label = '';\n this.tags.sections.types.visible = 'yes';\n this.showTags(cb, 10);\n } else if( (M.curTenant.modules['ciniki.links'].flags&0x01) == 0x01 ) {\n this.tags.sections.categories.label = 'Categories';\n this.tags.sections.tags.label = 'Tags';\n this.tags.sections.types.visible = 'no';\n this.showTags(cb, 10);\n } else if( (M.curTenant.modules['ciniki.links'].flags&0x02) == 0x02 ) {\n this.tags.sections.categories.label = 'Categories';\n this.tags.sections.tags.label = 'Tags';\n this.tags.sections.types.visible = 'no';\n this.showTags(cb, 40);\n } else {\n this.showMenu(cb);\n }\n };\n\n this.showMenu = function(cb) {\n this.menu.data = [];\n //\n // Grab the list of sites\n //\n var rsp = M.api.getJSONCb('ciniki.links.linkList', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_links_main.menu;\n p.data = rsp.links;\n\n p.sections = {};\n // \n // Setup the menu to display the categories\n //\n p.data = {};\n if( rsp.sections.length > 0 ) {\n for(i in rsp.sections) {\n p.data[rsp.sections[i].section.sname] = rsp.sections[i].section.links;\n p.sections[rsp.sections[i].section.sname] = {'label':rsp.sections[i].section.sname,\n 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':[''],\n 'addTxt':'Add Link',\n 'addFn':'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showMenu();\\',0,0,\\'' + rsp.sections[i].section.sname + '\\');',\n 'noData':'No links added',\n };\n if( (M.curTenant.modules['ciniki.links'].flags&0x01) == 0 ) {\n p.sections[rsp.sections[i].section.sname].label = 'Links';\n }\n }\n } else {\n p.data = {'_':{}};\n p.sections['_'] = {'label':'',\n 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':[''],\n 'addTxt':'Add Link',\n 'addFn':'M.ciniki_links_main.showEdit(\\'M.ciniki_links_main.showMenu();\\',0);',\n 'noData':'No links added',\n };\n }\n\n p.refresh();\n p.show(cb);\n });\n };\n \n this.showTags = function(cb, t) {\n if( t != null ) { this.tags.tag_type = t; }\n if( this.tags.tag_type == 10 ) {\n this.tags.sections.categories.visible = 'yes';\n this.tags.sections.tags.visible = 'no';\n this.tags.sections.types.selected = 'categories';\n } else {\n this.tags.sections.categories.visible = 'no';\n this.tags.sections.tags.visible = 'yes';\n this.tags.sections.types.selected = 'tags';\n }\n M.api.getJSONCb('ciniki.links.linkTags', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_links_main.tags;\n p.data = rsp;\n p.refresh();\n p.show(cb);\n });\n };\n\n this.showTagsTab = function(t) {\n if( t != null ) {\n this.tags.tag_type = t;\n }\n if( this.tags.tag_type == 10 ) {\n this.tags.sections.categories.visible = 'yes';\n this.tags.sections.tags.visible = 'no';\n this.tags.sections.types.selected = 'categories';\n } else {\n this.tags.sections.categories.visible = 'no';\n this.tags.sections.tags.visible = 'yes';\n this.tags.sections.types.selected = 'tags';\n }\n this.tags.refresh();\n this.tags.show();\n };\n\n //\n // t - tag type\n // n - tag name\n this.showList = function(cb,t,n) {\n if( t != null ) { this.list.tag_type = t; }\n if( n != null ) { this.list.tag_name = unescape(n); }\n this.list.sections.links.label = this.list.tag_name;\n M.api.getJSONCb('ciniki.links.linkList', \n {'tnid':M.curTenantID, \n 'tag_type':this.list.tag_type, 'tag_name':encodeURIComponent(this.list.tag_name)}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_links_main.list;\n p.data = rsp;\n p.refresh();\n p.show(cb);\n });\n };\n\n this.showEdit = function(cb, lid, t, n) {\n this.edit.reset();\n this.edit.sections._buttons.buttons.delete.visible = 'no';\n if( lid != null ) { this.edit.link_id = lid; }\n this.edit.sections._buttons.buttons.delete.visible = (this.edit.link_id>0?'yes':'no');\n M.api.getJSONCb('ciniki.links.linkGet', \n {'tnid':M.curTenantID, 'link_id':this.edit.link_id, 'tags':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_links_main.edit;\n p.data = rsp.link;\n if( rsp.link.id == 0 ) {\n if( t != null && n != null ) {\n if( t == 10 ) {\n p.data.categories = unescape(n);\n } else if( t == 40 ) {\n p.data.tags = unescape(n);\n }\n }\n }\n if( (M.curTenant.modules['ciniki.links'].flags&0x01) > 0 && rsp.categories != null ) {\n var tags = [];\n for(i in rsp.categories) {\n tags.push(rsp.categories[i].tag.name);\n }\n p.sections._categories.fields.categories.tags = tags;\n } else {\n p.sections._categories.fields.categories.tags = [];\n }\n if( (M.curTenant.modules['ciniki.links'].flags&0x02) > 0 && rsp.tags != null ) {\n var tags = [];\n for(i in rsp.tags) {\n tags.push(rsp.tags[i].tag.name);\n }\n p.sections._tags.fields.tags.tags = tags;\n } else {\n p.sections._tags.fields.tags.tags = [];\n }\n p.refresh();\n p.show(cb);\n });\n };\n\n this.saveLink = function() {\n if( this.edit.link_id > 0 ) {\n var c = this.edit.serializeForm('no');\n if( c != '' ) {\n var rsp = M.api.postJSONCb('ciniki.links.linkUpdate', \n {'tnid':M.curTenantID, 'link_id':this.edit.link_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_links_main.edit.close();\n });\n } else {\n M.ciniki_links_main.edit.close();\n }\n } else {\n var c = this.edit.serializeForm('yes');\n var rsp = M.api.postJSONCb('ciniki.links.linkAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_links_main.edit.close();\n });\n }\n };\n\n this.deleteLink = function() {\n M.confirm(\"Are you sure you want to remove '\" + this.edit.data.name + \"' as an link ?\",null,function() {\n var rsp = M.api.getJSONCb('ciniki.links.linkDelete', \n {'tnid':M.curTenantID, 'link_id':M.ciniki_links_main.edit.link_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_links_main.edit.close();\n });\n });\n };\n}", "title": "" }, { "docid": "ca3f4a323273a9a845dd7910be062290", "score": "0.5346733", "text": "function setElementsSize() {\n\n if (g_options.strippanel_vertical_type == false)\n setElementsSize_hor();\n else\n setElementsSize_vert();\n }", "title": "" }, { "docid": "51f60567a0c582bf7f706d7510bed6bb", "score": "0.5345014", "text": "function setuplayout()\n{\n\t// round to fixed for better display, but use full float in calculations\n var x1 = Q.layout.hudxmin.toFixed(1);\n var x2 = Q.layout.hudxmax.toFixed(1); \n var y1 = Q.layout.hudymin.toFixed(1);\n var y2 = Q.layout.hudymax.toFixed(1);\n \n var wx1 = Q.layout.worldxmin.toFixed(1);\n var wx2 = Q.layout.worldxmax.toFixed(1); \n var wy1 = Q.layout.worldymin.toFixed(1);\n var wy2 = Q.layout.worldymax.toFixed(1);\n\n\tvar areas = new Array();\n\t\n\t// add text labels\n\tvar item = new LayoutArea();\n\titem.type = \"text.mline\"; // multiline\n\titem.background=\"FFEE1111\";\n\titem.location= \"0.0,0.0,0.0\";\n\titem.size = \"2,22\";\t\t\t// size 2 rows with 22 chars\n\titem.bounds=\"3.2,0.4\";\n\titem.text = \" this is on world domain \";\n\tareas.push(item);\n\n\tvar item = new LayoutArea();\n\titem.type = \"text.mline\"; // multiline\n\titem.background=\"FFEE1111\";\n\titem.location= \"0.0,0.8,0.0\";\n\titem.display =\"hud\";\n\titem.size = \"2,22\";\t\t\t// size 2 rows with 22 chars\n\titem.bounds=\"3.2,0.4\";\n\titem.text = \" this is on hud domain \";\n\tareas.push(item);\n\n\tvar item = new LayoutArea();\n\titem.type = \"text.mline\"; // multiline\n\titem.background=\"FF1111EE\";\n\titem.location= \"0.0,0.0,0.0\";\n\titem.display =\"domain1\";\n\titem.size = \"2,22\";\t\t\t// size 2 rows with 22 chars\n\titem.bounds=\"12.0,4.0\";\n\titem.text = \" this is on domain1 \";\n\tareas.push(item);\n\t\n\n\tvar item = new LayoutArea();\n\titem.type = \"text.mline\"; // multiline\n\titem.background=\"FF11EE11\";\n\titem.location= \"0.0,0.0,2.0\";\n\titem.display =\"domain2\";\n\titem.size = \"2,22\";\t\t\t// size 2 rows with 22 chars\n\titem.bounds=\"4.5,1.0\";\n\titem.text = \" this is on domain2 \";\n\tareas.push(item);\n\t\n\t// add exit area\n\tvar areaExit = new LayoutArea(); \n\tareaExit.type = 'layout.back';\n\tareaExit.background = 'FFFFFFFF,icons.2.8.8';\n\tareaExit.location= '0.0,0.4';\n\tareaExit.bounds = '0.20,0.20';\n\tareaExit.display = 'hud';\n\tareaExit.onclick = 'js:test_exit';\n areas.push(areaExit);\n \n\tQ.layout.add(\"domains\", areas).now();\n\t// show page\n\tQ.layout.show(\"domains\").now();\t\n\t\n\t\n}", "title": "" }, { "docid": "491242abe7cdf2af1f895fcbc0c41c5a", "score": "0.534441", "text": "function sizeDOMelements() {\n\t\t\t\tvar maxWidth = Math.max.apply( null,\n\t\t\t\t $('#' + settings.menuID + ' div.levelHolderClass').map(function(){ return $(this).width(); }).get() ),\n\t\t\t\t\tmaxLevel = Math.max.apply( null,\n\t\t\t\t $('#' + settings.menuID + ' div.levelHolderClass').map(function(){ return $(this).attr( 'data-level' ); }).get() ),\n\t\t\t\t\tmaxExtWidth = maxWidth + maxLevel * settings.overlapWidth,\n\t\t\t\t\tmaxHeight = Math.max.apply( null,\n\t\t\t\t $('#' + settings.menuID + ' div.levelHolderClass').map(function(){ return $(this).height(); }).get() );\n\t\t\t\tvar extWidth = ( isValidDim( settings.menuWidth ) || ( isInt( settings.menuWidth ) && settings.menuWidth > 0 ) ),\n\t\t\t\t\textHeight = ( isValidDim( settings.menuHeight ) || ( isInt( settings.menuHeight ) && settings.menuHeight > 0 ) );\n\t\t\t\t( extWidth ) ? $('#' + settings.menuID + ' div.levelHolderClass').width(settings.menuWidth) : $('#' + settings.menuID + ' div.levelHolderClass').width( maxWidth );\n\t\t\t\t( extHeight ) ? $('#' + settings.menuID).height(settings.menuHeight) : $('#' + settings.menuID).height( maxHeight );\n\t\t\t\t$container.width( maxExtWidth );\n\t\t\t\t$container.height( maxHeight );\n\t\t\t}", "title": "" }, { "docid": "d26a68443f8691daa5c6663b77652acc", "score": "0.5342533", "text": "function size() {\n //set up ui\n $(\"#container\").css('padding-top', $(\"#controls\").outerHeight()+\"px\");\n\n $graphicsContainer = $(\"#graphics-container\");\n $graphics.attr(\"height\", $graphicsContainer.height());\n $graphics.attr(\"width\", $graphicsContainer.width());\n\n //logo\n var $logo = $(\"#logo\");\n var $controls = $(\"#controls\");\n $logo.css({\n lineHeight: $controls.outerHeight()+\"px\"\n });\n\n $controls.children('#runners').css('margin-left', $logo.outerWidth());\n }", "title": "" }, { "docid": "c44d47cf3518a5d52c67c95da2f835b7", "score": "0.5334394", "text": "function resize() {\n var canvas = document.getElementById(\"canvas1\");\n var graphDIV = document.getElementById(\"graph\");\n if (graphDIV === null) {\n graphDIV = document.getElementById(\"graphinline\");\n }\n var toolsDIV = document.getElementById(\"tools\");\n\n canvas.width = graphDIV.clientWidth;\n canvas.height = graphDIV.clientHeight;\n graphEditor.resizeContent(canvas.width, canvas.height);\n }", "title": "" }, { "docid": "26415cebf441ab8c625438a86ee81818", "score": "0.53283894", "text": "function ResponsiveSetSize( setting, level, v ) {\r\n G.tn.settings[setting][level]['xs'] = v;\r\n G.tn.settings[setting][level]['sm'] = v;\r\n G.tn.settings[setting][level]['me'] = v;\r\n G.tn.settings[setting][level]['la'] = v;\r\n G.tn.settings[setting][level]['xl'] = v;\r\n }", "title": "" }, { "docid": "6e46e8b9b57eadc4887eedac634f0eba", "score": "0.5320603", "text": "function toggle_off() {\n\n document.getElementById('toggle').className = 'togle_btn_new';\n document.getElementById('toggle_up').className = 'togle_btn_up_new';\n var h1 = document.getElementById('side_panel_id').clientHeight;\n document.getElementById('panel_td').style.height = h1 + 'px';\n\n if (side_p_hieght < 665) {\n document.getElementById('left_container_id').className = \"left_container\";\n document.getElementById('right_section_id').className = 'right_section_new';\n document.getElementById('side_panel_id').className = 'side_panel';\n }\n else {\n\n document.getElementById('right_section_id').className = 'right_section_scrool';\n document.getElementById('side_panel_id').className = \"side_panel_scroll\";\n document.getElementById('left_container_id').className = \"left_container_scrool\";\n }\n\n show('side_panel_id');\n show('tg');\n hide('tg_1');\n hide('search_top');\n document.getElementById('action_panel_main_id').className = 'action_panel_main';\n //document.getElementById('left_container_id').className='left_container';\n //document.getElementById('right_section_id').className='right_section_new';\n document.getElementById('right_container_id').className = 'right_container';\n\n\n}", "title": "" }, { "docid": "4402577a212f9f0fa451099fdbb15457", "score": "0.53174275", "text": "function onResize() {\n\t\t\t\t\tcanvas.width = showBoard.width = window.innerWidth - offsetSize.x;\n\t\t\t\t\tcanvas.height = showBoard.height = 2 * window.innerHeight;\n\t\t\t\t}", "title": "" }, { "docid": "248d9aa7693820cbbead22a634212d8e", "score": "0.53171724", "text": "function fixTileWidthAndHeight() {\n\t\tvar pixelCorrection = 1;\n\t\tvar scale = 1,\n\t\t\tcWidth = document.documentElement.clientWidth,\n\t\t\tcHeight = document.documentElement.clientHeight,\n\t\t\tsWidth = window.screen.width,\n\t\t\tsHeight = window.screen.height;\n\t\twidth = cWidth;\n\t\theight = cHeight - bottomToolbarHeight;\n\t\t// initialise tile height and width\n\t\ttileWidth = width / 3;\n\t\ttileHeight = height / 3;\n\t\t$(\"body\").css({\n\t\t\twidth: width + \"px\",\n\t\t\theight: height + \"px\"\n\t\t});\n\t\t$(\".tile, .back\").css({\n\t\t\twidth: tileWidth + \"px\",\n\t\t\theight: tileHeight + \"px\"\n\t\t});\n\t}", "title": "" }, { "docid": "7c0de93903a837bb11f0a499f9d46ff7", "score": "0.53151375", "text": "function FRAME_GRID_200$static_(){ContainerSkin.FRAME_GRID_200=( new ContainerSkin(\"frame-grid-200\"));}", "title": "" }, { "docid": "f92f65a3dae2d27609323a674596a566", "score": "0.53081316", "text": "function setUpPanels(){\n\t\t$('.UI_resize *').on(\n\t\t\t'mousedown',\n\t\t\tfunction(event){\n\t\t\t\t$('.UI_resize').removeClass('selected');\n\t\t\t\t$(event.currentTarget).parents('.UI_resize').addClass('selected');\n\t\t\t}\n\t\t);\n\t\t$('.UI_resize .UI_tab').on(\n\t\t\t'mousedown',\n\t\t\tfunction(event){\n\t\t\t\tevent.currentTarget.dragging = true;\n\t\t\t}\n\t\t);\n\t\t$('.UI_resize .UI_tab').on(\n\t\t\t'mouseup',\n\t\t\tfunction(event){\n\t\t\t\tevent.currentTarget.dragging = false;\n\t\t\t}\n\t\t);\n\t\t$('*').on(\n\t\t\t'mousemove',\n\t\t\tfunction(event){\n\t\t\t\t$('.UI_resize .UI_tab').each(\n\t\t\t\t\tfunction(i, element){\n\t\t\t\t\t\tif(!element.dragging){\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!event.which){\n\t\t\t\t\t\t\telement.dragging = false;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telement = $(element);\n\t\t\t\t\t\tvar element_position = {x:element.offset().left, y:element.offset().top};\n\t\t\t\t\t\tvar element_size = {x:element.outerWidth(true), y:element.outerHeight(true)};\n\t\t\t\t\t\tvar mouse_position = {x: event.pageX, y: event.pageY};\n\t\t\t\t\t\tvar center_relitive_position = \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tx: mouse_position.x - (element_position.x+Math.floor(element_size.x/2)),\n\t\t\t\t\t\t\t\ty: mouse_position.y - (element_position.y+Math.floor(element_size.y/2))\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tvar panel = element.parent();\n\t\t\t\t\t\tif(panel.is('.UI_resize_bottom, .UI_resize_top')){\n\t\t\t\t\t\t\tpanel.height(panel.height() - center_relitive_position.y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(panel.is('.UI_resize_right')){\n\t\t\t\t\t\t\tpanel.width(panel.width() - center_relitive_position.x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(panel.is('.UI_resize_left')){\n\t\t\t\t\t\t\tpanel.width(panel.width() + center_relitive_position.x);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "c1abe8bdb7b33196693b0805be8ff6e3", "score": "0.5307908", "text": "function setPanelSize(){\n\t\t\t\tvar windowHeight = $(window).height();\n\t\t\t\tvar windowWidth = $(window).width();\n\t\t\t\tvar videoWidth;\n\t\t\t\t//calculate whether the video is too tall for the space\n\t\t\t\tif ( ((windowWidth-120)*.5625) > (windowHeight-160) ) {\n\t\t\t\t\tvideoWidth = (windowHeight-160)*1.777;\n\t\t\t\t}\n\t\t\t\t//resize video and panel\n\t\t\t $('.videocontent').css({'max-width':videoWidth+'px'});\n\t\t\t $('.panel').css({'height':windowHeight+'px'});\n\t\t\t}", "title": "" }, { "docid": "530015eb114d7d6346e06b10a8265ab1", "score": "0.53002787", "text": "rescale() {\n\t\tconst {dimensions, spacing} = this.properties.node;\n\n\t\t// 2 means for both sides\n\t\tthis._scale.x = dimensions.width + (2 * spacing.horizontal);\n\t\tthis._scale.y = dimensions.height + (2 * spacing.vertical);\n\t}", "title": "" }, { "docid": "cfc8240ea39565151d3ac226e94d205b", "score": "0.5285123", "text": "function setSize(container){\r\n\t\tvar state = $.data(container, 'layout');\r\n\t\tvar opts = state.options;\r\n\t\tvar panels = state.panels;\r\n\t\t\r\n\t\tvar cc = $(container);\r\n\t\tif (container.tagName == 'BODY'){\r\n\t\t\tcc._fit();\r\n\t\t} else {\r\n\t\t\topts.fit ? cc.css(cc._fit()) : cc._fit(false);\r\n\t\t}\r\n\t\t\r\n//\t\topts.fit ? cc.css(cc._fit()) : cc._fit(false);\r\n//\t\tif (opts.fit == true){\r\n//\t\t\tvar p = cc.parent();\r\n//\t\t\tp.addClass('panel-noscroll');\r\n//\t\t\tif (p[0].tagName == 'BODY') $('html').addClass('panel-fit');\r\n//\t\t\tcc.width(p.width());\r\n//\t\t\tcc.height(p.height());\r\n//\t\t}\r\n\t\t\r\n\t\tvar cpos = {\r\n\t\t\ttop:0,\r\n\t\t\tleft:0,\r\n\t\t\twidth:cc.width(),\r\n\t\t\theight:cc.height()\r\n\t\t};\r\n\t\t\r\n\t\tsetVSize(isVisible(panels.expandNorth) ? panels.expandNorth : panels.north, 'n');\r\n\t\tsetVSize(isVisible(panels.expandSouth) ? panels.expandSouth : panels.south, 's');\r\n\t\tsetHSize(isVisible(panels.expandEast) ? panels.expandEast : panels.east, 'e');\r\n\t\tsetHSize(isVisible(panels.expandWest) ? panels.expandWest : panels.west, 'w');\r\n\t\t\r\n\t\tpanels.center.panel('resize', cpos);\r\n\t\t\r\n\t\tfunction getPanelHeight(pp){\r\n\t\t\tvar opts = pp.panel('options');\r\n\t\t\treturn Math.min(Math.max(opts.height, opts.minHeight), opts.maxHeight);\r\n\t\t}\r\n\t\tfunction getPanelWidth(pp){\r\n\t\t\tvar opts = pp.panel('options');\r\n\t\t\treturn Math.min(Math.max(opts.width, opts.minWidth), opts.maxWidth);\r\n\t\t}\r\n\t\tfunction setVSize(pp, type){\r\n\t\t\tif (!pp.length){return}\r\n\t\t\tvar opts = pp.panel('options');\r\n\t\t\tvar height = getPanelHeight(pp);\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: cc.width(),\r\n\t\t\t\theight: height,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\ttop: (type=='n' ? 0 : cc.height()-height)\r\n\t\t\t});\r\n\t\t\tcpos.height -= height;\r\n\t\t\tif (type == 'n'){\r\n\t\t\t\tcpos.top += height;\r\n\t\t\t\tif (!opts.split && opts.border){cpos.top--;}\r\n\t\t\t}\r\n\t\t\tif (!opts.split && opts.border){\r\n\t\t\t\tcpos.height++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction setHSize(pp, type){\r\n\t\t\tif (!pp.length){return}\r\n\t\t\tvar opts = pp.panel('options');\r\n\t\t\tvar width = getPanelWidth(pp);\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: width,\r\n\t\t\t\theight: cpos.height,\r\n\t\t\t\tleft: (type=='e' ? cc.width()-width : 0),\r\n\t\t\t\ttop: cpos.top\r\n\t\t\t});\r\n\t\t\tcpos.width -= width;\r\n\t\t\tif (type == 'w'){\r\n\t\t\t\tcpos.left += width;\r\n\t\t\t\tif (!opts.split && opts.border){cpos.left--;}\r\n\t\t\t}\r\n\t\t\tif (!opts.split && opts.border){cpos.width++;}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a0c6acbee13158c3d3ccc9accb99e2fb", "score": "0.52832884", "text": "function pano2vrSkin(player,base) {\n\tplayer.addVariable('vis_thumbnail_menu', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_1', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_1', 2, true);\n\tplayer.addVariable('category_visible', 2, false);\n\tplayer.addVariable('node_visible', 2, false);\n\tplayer.addVariable('category_visible_1', 2, false);\n\tplayer.addVariable('node_visible_1', 2, false);\n\tplayer.addVariable('vis_map', 2, false);\n\tplayer.addVariable('vis_loader', 2, true);\n\tplayer.addVariable('category_visible_2', 2, false);\n\tplayer.addVariable('node_visible_2', 2, false);\n\tplayer.addVariable('category_visible_3', 2, false);\n\tplayer.addVariable('node_visible_3', 2, false);\n\tplayer.addVariable('category_visible_4', 2, false);\n\tplayer.addVariable('node_visible_4', 2, false);\n\tplayer.addVariable('category_visible_5', 2, false);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_2', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_2', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_3', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_3', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_4', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_4', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_5', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_5', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_6', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_6', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_7', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_7', 2, true);\n\tplayer.addVariable('opt_thumbnail_menu_tooltip_8', 2, true);\n\tplayer.addVariable('vis_thumbnail_menu_8', 2, true);\n\tplayer.addVariable('vis_info_popup', 2, false);\n\tvar me=this;\n\tvar skin=this;\n\tvar flag=false;\n\tvar hotspotTemplates={};\n\tvar skinKeyPressed = 0;\n\tthis.player=player;\n\tthis.player.skinObj=this;\n\tthis.divSkin=player.divSkin;\n\tthis.ggUserdata=player.userdata;\n\tthis.lastSize={ w: -1,h: -1 };\n\tvar basePath=\"\";\n\t// auto detect base path\n\tif (base=='?') {\n\t\tvar scripts = document.getElementsByTagName('script');\n\t\tfor(var i=0;i<scripts.length;i++) {\n\t\t\tvar src=scripts[i].src;\n\t\t\tif (src.indexOf('skin.js')>=0) {\n\t\t\t\tvar p=src.lastIndexOf('/');\n\t\t\t\tif (p>=0) {\n\t\t\t\t\tbasePath=src.substr(0,p+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else\n\tif (base) {\n\t\tbasePath=base;\n\t}\n\tthis.elementMouseDown=[];\n\tthis.elementMouseOver=[];\n\tvar cssPrefix='';\n\tvar domTransition='transition';\n\tvar domTransform='transform';\n\tvar prefixes='Webkit,Moz,O,ms,Ms'.split(',');\n\tvar i;\n\tvar hs,el,els,elo,ela,elHorScrollFg,elHorScrollBg,elVertScrollFg,elVertScrollBg,elCornerBg;\n\tif (typeof document.body.style['transform'] == 'undefined') {\n\t\tfor(var i=0;i<prefixes.length;i++) {\n\t\t\tif (typeof document.body.style[prefixes[i] + 'Transform'] !== 'undefined') {\n\t\t\t\tcssPrefix='-' + prefixes[i].toLowerCase() + '-';\n\t\t\t\tdomTransition=prefixes[i] + 'Transition';\n\t\t\t\tdomTransform=prefixes[i] + 'Transform';\n\t\t\t}\n\t\t}\n\t}\n\t\n\tplayer.setMargins(0,0,0,0);\n\t\n\tthis.updateSize=function(startElement) {\n\t\tvar stack=[];\n\t\tstack.push(startElement);\n\t\twhile(stack.length>0) {\n\t\t\tvar e=stack.pop();\n\t\t\tif (e.ggUpdatePosition) {\n\t\t\t\te.ggUpdatePosition();\n\t\t\t}\n\t\t\tif (e.hasChildNodes()) {\n\t\t\t\tfor(var i=0;i<e.childNodes.length;i++) {\n\t\t\t\t\tstack.push(e.childNodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tthis.callNodeChange=function(startElement) {\n\t\tvar stack=[];\n\t\tstack.push(startElement);\n\t\twhile(stack.length>0) {\n\t\t\tvar e=stack.pop();\n\t\t\tif (e.ggNodeChange) {\n\t\t\t\te.ggNodeChange();\n\t\t\t}\n\t\t\tif (e.hasChildNodes()) {\n\t\t\t\tfor(var i=0;i<e.childNodes.length;i++) {\n\t\t\t\t\tstack.push(e.childNodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tplayer.addListener('changenode', function() { me.ggUserdata=player.userdata; me.callNodeChange(me.divSkin); });\n\t\n\tvar parameterToTransform=function(p) {\n\t\tvar hs='translate(' + p.rx + 'px,' + p.ry + 'px) rotate(' + p.a + 'deg) scale(' + p.sx + ',' + p.sy + ')';\n\t\treturn hs;\n\t}\n\t\n\tthis.findElements=function(id,regex) {\n\t\tvar r=[];\n\t\tvar stack=[];\n\t\tvar pat=new RegExp(id,'');\n\t\tstack.push(me.divSkin);\n\t\twhile(stack.length>0) {\n\t\t\tvar e=stack.pop();\n\t\t\tif (regex) {\n\t\t\t\tif (pat.test(e.ggId)) r.push(e);\n\t\t\t} else {\n\t\t\t\tif (e.ggId==id) r.push(e);\n\t\t\t}\n\t\t\tif (e.hasChildNodes()) {\n\t\t\t\tfor(var i=0;i<e.childNodes.length;i++) {\n\t\t\t\t\tstack.push(e.childNodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}\n\t\n\tthis.addSkin=function() {\n\t\tvar hs='';\n\t\tthis.ggCurrentTime=new Date().getTime();\n\t\tel=me._screentint_info=document.createElement('div');\n\t\tel.ggId=\"screentint_info\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+='background : rgba(0,0,0,0.392157);';\n\t\ths+='border : 1px solid #000000;';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0%;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0%;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._screentint_info.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._screentint_info.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_info_popup') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._screentint_info.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._screentint_info.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._screentint_info.style[domTransition]='';\n\t\t\t\tif (me._screentint_info.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._screentint_info.style.visibility=(Number(me._screentint_info.style.opacity)>0||!me._screentint_info.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._screentint_info.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._screentint_info.style.visibility=\"hidden\";\n\t\t\t\t\tme._screentint_info.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._screentint_info.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_info_popup', false);\n\t\t\tme._info_title.ggText=\"\";\n\t\t\tme._info_title.ggTextDiv.innerHTML=me._info_title.ggText;\n\t\t\tif (me._info_title.ggUpdateText) {\n\t\t\t\tme._info_title.ggUpdateText=function() {\n\t\t\t\t\tvar hs=\"\";\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._info_title.ggUpdatePosition) {\n\t\t\t\tme._info_title.ggUpdatePosition();\n\t\t\t}\n\t\t\tme._info_title.ggTextDiv.scrollTop = 0;\n\t\t\tme._info_text_body.ggText=\"\";\n\t\t\tme._info_text_body.ggTextDiv.innerHTML=me._info_text_body.ggText;\n\t\t\tif (me._info_text_body.ggUpdateText) {\n\t\t\t\tme._info_text_body.ggUpdateText=function() {\n\t\t\t\t\tvar hs=\"\";\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (me._info_text_body.ggUpdatePosition) {\n\t\t\t\tme._info_text_body.ggUpdatePosition();\n\t\t\t}\n\t\t\tme._info_text_body.ggTextDiv.scrollTop = 0;\n\t\t}\n\t\tme._screentint_info.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme.divSkin.appendChild(me._screentint_info);\n\t\tel=me._information=document.createElement('div');\n\t\tel.ggId=\"information\";\n\t\tel.ggDx=0;\n\t\tel.ggDy=0;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_container \";\n\t\tel.ggType='container';\n\t\ths ='';\n\t\ths+='height : 377px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 330px;';\n\t\ths+='pointer-events:none;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._information.ggIsActive=function() {\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._information.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((player.getVariableValue('vis_info_popup') == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._information.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._information.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._information.style[domTransition]='';\n\t\t\t\tif (me._information.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._information.style.visibility=(Number(me._information.style.opacity)>0||!me._information.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._information.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._information.style.visibility=\"hidden\";\n\t\t\t\t\tme._information.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._information.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tel=me._informationbg=document.createElement('div');\n\t\tel.ggId=\"informationbg\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_rectangle \";\n\t\tel.ggType='rectangle';\n\t\ths ='';\n\t\ths+=cssPrefix + 'border-radius : 10px;';\n\t\ths+='border-radius : 10px;';\n\t\ths+='background : rgba(0,0,0,0.509804);';\n\t\ths+='border : 0px solid #ffffff;';\n\t\ths+='cursor : default;';\n\t\ths+='height : 100%;';\n\t\ths+='left : 0px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 100%;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._informationbg.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._informationbg.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._informationbg);\n\t\tel=me._info_text_body=document.createElement('div');\n\t\tels=me._info_text_body__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"info_text_body\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_text modal-pano-contet-text\";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='height : 342px;';\n\t\ths+='left : 0px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 36px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 330px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: 330px;';\n\t\ths+='height: 342px;';\n\t\ths+='background: #ffffff;';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(49,49,49,1);';\n\t\ths+='text-align: left;';\n\t\ths+='white-space: pre-wrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\ths+='overflow-y: auto;';\n\t\tels.setAttribute('style',hs);\n\t\tme._info_text_body.ggUpdateText=function() {\n\t\t\tvar hs=player.hotspot.description;\n\t\t\tif (hs!=this.ggText) {\n\t\t\t\tthis.ggText=hs;\n\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t}\n\t\t}\n\t\tme._info_text_body.ggUpdateText();\n\t\tplayer.addListener('activehotspotchanged', function() {\n\t\t\tme._info_text_body.ggUpdateText();\n\t\t});\n\t\tel.appendChild(els);\n\t\tme._info_text_body.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._info_text_body.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._info_text_body);\n\t\tel=me._info_title=document.createElement('div');\n\t\tels=me._info_title__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"info_title\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_text modal-pano-title\";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='height : 43px;';\n\t\ths+='left : 0px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 0px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 330px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='cursor: default;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: 330px;';\n\t\ths+='height: 43px;';\n\t\ths+='background: #313131;';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: left;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tme._info_title.ggUpdateText=function() {\n\t\t\tvar hs=player.hotspot.title;\n\t\t\tif (hs!=this.ggText) {\n\t\t\t\tthis.ggText=hs;\n\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t}\n\t\t}\n\t\tme._info_title.ggUpdateText();\n\t\tplayer.addListener('activehotspotchanged', function() {\n\t\t\tme._info_title.ggUpdateText();\n\t\t});\n\t\tel.appendChild(els);\n\t\tme._info_title.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._info_title.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._info_title);\n\t\tel=me._ht_info_close=document.createElement('div');\n\t\tels=me._ht_info_close__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgJy0vL1czQy8vRFREIFNWRyAxLjEvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE1LjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbDpzcGFjZT0icHJlc2VydmUiIHg9IjBweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBoZWlnaHQ9IjMycHgiIHZlcnNpb249IjEuMSIgdmlld0JveD'+\n\t\t\t'0iMCAwIDMyIDMyIiB5PSIwcHgiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzJweCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIGlkPSJMYXllcl8xIj4KIDxnIG9wYWNpdHk9IjAuNCI+CiAgPHBhdGggZD0iTTIxLjEzMiwxOS40MzlMMTcuNjkyLDE2bDMuNDQtMy40NGMwLjQ2OC0wLjQ2NywwLjQ2OC0xLjIyNSwwLTEuNjkzJiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTAuNDY3LTAuNDY3LTEuMjI1LTAuNDY3LTEuNjkxLDAuMDAxTDE2LDE0LjMwOGwtMy40NDEtMy40NDFjLTAuNDY3LTAuNDY3LTEuMjI0LTAuNDY3LTEuNjkxLDAuMDAx'+\n\t\t\t'JiN4ZDsmI3hhOyYjeDk7JiN4OTtjLTAuNDY3LDAuNDY3LTAuNDY3LDEuMjI0LDAsMS42OUwxNC4zMDksMTZsLTMuNDQsMy40NGMtMC40NjcsMC40NjctMC40NjcsMS4yMjYsMCwxLjY5MmMwLjQ2NywwLjQ2NywxLjIyNiwwLjQ2NywxLjY5MiwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMy40NC0zLjQ0bDMuNDM5LDMuNDM5YzAuNDY4LDAuNDY4LDEuMjI1LDAuNDY4LDEuNjkxLDAuMDAxQzIxLjU5OSwyMC42NjQsMjEuNiwxOS45MDcsMjEuMTMyLDE5LjQzOXogTTI0LjgzOSw3LjE2MSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy00Ljg4Mi00Ljg4Mi0xMi43OTYtNC44ODItMTcuNjc4LDBjLTQuODgxLDQuOD'+\n\t\t\t'gxLTQuODgxLDEyLjc5NSwwLDE3LjY3OGM0Ljg4MSw0Ljg4LDEyLjc5Niw0Ljg4LDE3LjY3OCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtDMjkuNzIsMTkuOTU2LDI5LjcyLDEyLjA0MiwyNC44MzksNy4xNjF6IE0xNiwyNi4xMDZjLTIuNTg5LTAuMDAxLTUuMTctMC45ODUtNy4xNDYtMi45NjFTNS44OTUsMTguNTksNS44OTQsMTYmI3hkOyYjeGE7JiN4OTsmI3g5O2MwLTIuNTkxLDAuOTg0LTUuMTcsMi45Ni03LjE0N0MxMC44Myw2Ljg3OCwxMy40MDksNS44OTQsMTYsNS44OTRjMi41OTEsMC4wMDEsNS4xNywwLjk4NCw3LjE0NywyLjk1OSYjeGQ7JiN4YTsmI3g5OyYjeDk7YzEuOTc2LDEuOTc3LDIu'+\n\t\t\t'OTU3LDQuNTU2LDIuOTYsNy4xNDdjLTAuMDAxLDIuNTkxLTAuOTg1LDUuMTY5LTIuOTYsNy4xNDhDMjEuMTY5LDI1LjEyMiwxOC41OTEsMjYuMTA2LDE2LDI2LjEwNnoiIHN0cm9rZT0iIzNDM0MzQyIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KIDwvZz4KIDxnPgogIDxwYXRoIGQ9Ik0yMS4xMzIsMTkuNDM5TDE3LjY5MiwxNmwzLjQ0LTMuNDRjMC40NjgtMC40NjcsMC40NjgtMS4yMjUsMC0xLjY5MyYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjQ2Ny0wLjQ2Ny0xLjIyNS0wLjQ2Ny0xLjY5MSwwLjAwMUwxNiwxNC4zMDhsLTMuNDQxLTMuNDQxYy0wLjQ2Ny0wLjQ2Ny0xLjIyNC0wLjQ2Ny0xLjY5MSwwLj'+\n\t\t\t'AwMSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjQ2NywwLjQ2Ny0wLjQ2NywxLjIyNCwwLDEuNjlMMTQuMzA5LDE2bC0zLjQ0LDMuNDRjLTAuNDY3LDAuNDY3LTAuNDY3LDEuMjI2LDAsMS42OTJjMC40NjcsMC40NjcsMS4yMjYsMC40NjcsMS42OTIsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7bDMuNDQtMy40NGwzLjQzOSwzLjQzOWMwLjQ2OCwwLjQ2OCwxLjIyNSwwLjQ2OCwxLjY5MSwwLjAwMUMyMS41OTksMjAuNjY0LDIxLjYsMTkuOTA3LDIxLjEzMiwxOS40Mzl6IE0yNC44MzksNy4xNjEmI3hkOyYjeGE7JiN4OTsmI3g5O2MtNC44ODItNC44ODItMTIuNzk2LTQuODgyLTE3LjY3OCwwYy00Ljg4MSw0'+\n\t\t\t'Ljg4MS00Ljg4MSwxMi43OTUsMCwxNy42NzhjNC44ODEsNC44OCwxMi43OTYsNC44OCwxNy42NzgsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7QzI5LjcyLDE5Ljk1NiwyOS43MiwxMi4wNDIsMjQuODM5LDcuMTYxeiBNMTYsMjYuMTA2Yy0yLjU4OS0wLjAwMS01LjE3LTAuOTg1LTcuMTQ2LTIuOTYxUzUuODk1LDE4LjU5LDUuODk0LDE2JiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0yLjU5MSwwLjk4NC01LjE3LDIuOTYtNy4xNDdDMTAuODMsNi44NzgsMTMuNDA5LDUuODk0LDE2LDUuODk0YzIuNTkxLDAuMDAxLDUuMTcsMC45ODQsNy4xNDcsMi45NTkmI3hkOyYjeGE7JiN4OTsmI3g5O2MxLjk3NiwxLjk3Ny'+\n\t\t\t'wyLjk1Nyw0LjU1NiwyLjk2LDcuMTQ3Yy0wLjAwMSwyLjU5MS0wLjk4NSw1LjE2OS0yLjk2LDcuMTQ4QzIxLjE2OSwyNS4xMjIsMTguNTkxLDI2LjEwNiwxNiwyNi4xMDZ6IiBzdHJva2U9IiMwMDAwMDAiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMC4yIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_info_close__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_info_close__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgJy0vL1czQy8vRFREIFNWRyAxLjEvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE1LjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHhtbDpzcGFjZT0icHJlc2VydmUiIHg9IjBweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBoZWlnaHQ9IjMycHgiIHZlcnNpb249IjEuMSIgdmlld0JveD'+\n\t\t\t'0iMCAwIDMyIDMyIiB5PSIwcHgiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzJweCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIGlkPSJMYXllcl8xIj4KIDxnIG9wYWNpdHk9IjAuNCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYsMTYpIHNjYWxlKDEuMSkgdHJhbnNsYXRlKC0xNiwtMTYpIj4KICA8cGF0aCBkPSJNMjEuMTMyLDE5LjQzOUwxNy42OTMsMTZsMy40MzktMy40NGMwLjQ2OC0wLjQ2NywwLjQ2OC0xLjIyNiwwLjAwMS0xLjY5MyYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjQ2Ny0wLjQ2Ny0xLjIyNS0wLjQ2Ny0xLjY5Miww'+\n\t\t\t'LjAwMWwtMy40NCwzLjQ0bC0zLjQ0MS0zLjQ0MWMtMC40NjgtMC40NjgtMS4yMjUtMC40NjctMS42OTMsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjQ2NywwLjQ2Ny0wLjQ2NywxLjIyNSwwLDEuNjkyTDE0LjMwOSwxNmwtMy40NCwzLjQ0Yy0wLjQ2NywwLjQ2Ni0wLjQ2NywxLjIyNCwwLDEuNjkxYzAuNDY3LDAuNDY3LDEuMjI2LDAuNDY3LDEuNjkyLDAuMDAxJiN4ZDsmI3hhOyYjeDk7JiN4OTtsMy40NC0zLjQ0bDMuNDQsMy40MzljMC40NjgsMC40NjgsMS4yMjQsMC40NjcsMS42OTEsMEMyMS41OTgsMjAuNjY0LDIxLjYsMTkuOTA3LDIxLjEzMiwxOS40Mzl6IE0yNC44MzksNy4xNjEmI3hkOy'+\n\t\t\t'YjeGE7JiN4OTsmI3g5O2MtNC44ODItNC44ODItMTIuNzk2LTQuODgyLTE3LjY3OCwwYy00Ljg4MSw0Ljg4MS00Ljg4MSwxMi43OTYsMCwxNy42NzhjNC44ODIsNC44ODEsMTIuNzk2LDQuODgxLDE3LjY3OCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTtDMjkuNzIsMTkuOTU3LDI5LjcyMSwxMi4wNDMsMjQuODM5LDcuMTYxeiBNMTYsMjYuMTA2Yy0yLjU5LDAtNS4xNzEtMC45ODQtNy4xNDYtMi45NTlDNi44NzgsMjEuMTcsNS44OTUsMTguNTkxLDUuODk0LDE2JiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC0yLjU5MSwwLjk4My01LjE3LDIuOTU5LTcuMTQ3YzEuOTc3LTEuOTc2LDQuNTU2LTIuOTU5LDcuMTQ4'+\n\t\t\t'LTIuOTZjMi41OTEsMC4wMDEsNS4xNywwLjk4NCw3LjE0NywyLjk1OSYjeGQ7JiN4YTsmI3g5OyYjeDk7YzEuOTc1LDEuOTc3LDIuOTU3LDQuNTU2LDIuOTU5LDcuMTQ3Yy0wLjAwMSwyLjU5Mi0wLjk4NCw1LjE3LTIuOTYsNy4xNDhDMjEuMTcsMjUuMTIzLDE4LjU5MSwyNi4xMDcsMTYsMjYuMTA2eiIgc3Ryb2tlPSIjM0MzQzNDIiBzdHJva2Utd2lkdGg9IjEuNSIvPgogPC9nPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYsMTYpIHNjYWxlKDEuMSkgdHJhbnNsYXRlKC0xNiwtMTYpIj4KICA8cGF0aCBkPSJNMjEuMTMyLDE5LjQzOUwxNy42OTMsMTZsMy40MzktMy40NCYjeGQ7JiN4YTsmI3'+\n\t\t\t'g5OyYjeDk7YzAuNDY4LTAuNDY3LDAuNDY4LTEuMjI2LDAuMDAxLTEuNjkzYy0wLjQ2Ny0wLjQ2Ny0xLjIyNS0wLjQ2Ny0xLjY5MiwwLjAwMWwtMy40NCwzLjQ0bC0zLjQ0MS0zLjQ0MSYjeGQ7JiN4YTsmI3g5OyYjeDk7Yy0wLjQ2OC0wLjQ2OC0xLjIyNS0wLjQ2Ny0xLjY5MywwYy0wLjQ2NywwLjQ2Ny0wLjQ2NywxLjIyNSwwLDEuNjkyTDE0LjMwOSwxNmwtMy40NCwzLjQ0Yy0wLjQ2NywwLjQ2Ni0wLjQ2NywxLjIyNCwwLDEuNjkxJiN4ZDsmI3hhOyYjeDk7JiN4OTtjMC40NjcsMC40NjcsMS4yMjYsMC40NjcsMS42OTIsMC4wMDFsMy40NC0zLjQ0bDMuNDQsMy40MzljMC40NjgsMC40NjgsMS4y'+\n\t\t\t'MjQsMC40NjcsMS42OTEsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7QzIxLjU5OCwyMC42NjQsMjEuNiwxOS45MDcsMjEuMTMyLDE5LjQzOXogTTI0LjgzOSw3LjE2MWMtNC44ODItNC44ODItMTIuNzk2LTQuODgyLTE3LjY3OCwwYy00Ljg4MSw0Ljg4MS00Ljg4MSwxMi43OTYsMCwxNy42NzgmI3hkOyYjeGE7JiN4OTsmI3g5O2M0Ljg4Miw0Ljg4MSwxMi43OTYsNC44ODEsMTcuNjc4LDBDMjkuNzIsMTkuOTU3LDI5LjcyMSwxMi4wNDMsMjQuODM5LDcuMTYxeiBNMTYsMjYuMTA2Yy0yLjU5LDAtNS4xNzEtMC45ODQtNy4xNDYtMi45NTkmI3hkOyYjeGE7JiN4OTsmI3g5O0M2Ljg3OCwyMS4xNyw1Ljg5NS'+\n\t\t\t'wxOC41OTEsNS44OTQsMTZjMC0yLjU5MSwwLjk4My01LjE3LDIuOTU5LTcuMTQ3YzEuOTc3LTEuOTc2LDQuNTU2LTIuOTU5LDcuMTQ4LTIuOTYmI3hkOyYjeGE7JiN4OTsmI3g5O2MyLjU5MSwwLjAwMSw1LjE3LDAuOTg0LDcuMTQ3LDIuOTU5YzEuOTc1LDEuOTc3LDIuOTU3LDQuNTU2LDIuOTU5LDcuMTQ3Yy0wLjAwMSwyLjU5Mi0wLjk4NCw1LjE3LTIuOTYsNy4xNDgmI3hkOyYjeGE7JiN4OTsmI3g5O0MyMS4xNywyNS4xMjMsMTguNTkxLDI2LjEwNywxNiwyNi4xMDZ6IiBzdHJva2U9IiMwMDAwMDAiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMC4yIi8+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_info_close__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_info_close\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 32px;';\n\t\ths+='position : absolute;';\n\t\ths+='right : -15px;';\n\t\ths+='top : -15px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info_close.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn player.getCurrentNode();\n\t\t}\n\t\tme._ht_info_close.onclick=function (e) {\n\t\t\tplayer.setVariableValue('vis_info_popup', false);\n\t\t}\n\t\tme._ht_info_close.onmouseover=function (e) {\n\t\t\tme._ht_info_close__img.style.visibility='hidden';\n\t\t\tme._ht_info_close__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_info_close.onmouseout=function (e) {\n\t\t\tme._ht_info_close__img.style.visibility='inherit';\n\t\t\tme._ht_info_close__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_info_close.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._information.appendChild(me._ht_info_close);\n\t\tme.divSkin.appendChild(me._information);\n\t\tplayer.addListener('sizechanged', function() {\n\t\t\tme.updateSize(me.divSkin);\n\t\t});\n\t};\n\tthis.hotspotProxyClick=function(id, url) {\n\t}\n\tthis.hotspotProxyDoubleClick=function(id, url) {\n\t}\n\tme.hotspotProxyOver=function(id, url) {\n\t}\n\tme.hotspotProxyOut=function(id, url) {\n\t}\n\tme.callChildLogicBlocksHotspot_ht_node_mouseover = function(){\n\t\tif(hotspotTemplates['ht_node']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_node'][i]._tt_ht_node && hotspotTemplates['ht_node'][i]._tt_ht_node.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_node'][i]._tt_ht_node.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_simple_mouseover = function(){\n\t\tif(hotspotTemplates['ht_simple']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_simple'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_simple'][i]._tt_ht_simple && hotspotTemplates['ht_simple'][i]._tt_ht_simple.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_simple'][i]._tt_ht_simple.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info_configloaded = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information && hotspotTemplates['ht_info'][i]._tt_information.logicBlock_position) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information.logicBlock_position();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.callChildLogicBlocksHotspot_ht_info_mouseover = function(){\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\tif (hotspotTemplates['ht_info'][i]._tt_information && hotspotTemplates['ht_info'][i]._tt_information.logicBlock_visible) {\n\t\t\t\t\thotspotTemplates['ht_info'][i]._tt_information.logicBlock_visible();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tplayer.addListener('changenode', function() {\n\t\tme.ggUserdata=player.userdata;\n\t});\n\tme.skinTimerEvent=function() {\n\t\tme.ggCurrentTime=new Date().getTime();\n\t};\n\tplayer.addListener('timer', me.skinTimerEvent);\n\tfunction SkinHotspotClass_ht_node(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_node=document.createElement('div');\n\t\tel.ggId=\"ht_node\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 485px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 318px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_node.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_node']=true;\n\t\t\tme._tt_ht_node.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_node']=false;\n\t\t\tme._tt_ht_node.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_node.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_node']=false;\n\t\t\tme._tt_ht_node.logicBlock_visible();\n\t\t}\n\t\tme._ht_node.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_node_image=document.createElement('div');\n\t\tels=me._ht_node_image__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PCEtLSBCeSBTYW0gSGVyYmVydCAoQHNoZXJiKSwgZm9yIGV2ZXJ5b25lLiBNb3JlIEAgaHR0cDovL2dvby5nbC83QUp6YkwgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBoZWlnaHQ9IjQ1IiB2aWV3Qm94PSIwIDAgNDUgNDUiIHN0cm9rZT0iI2ZmZiIgd2lkdGg9IjQ1Ij4KIDxnIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0ibm9uZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgc3Ryb2tlLXdpZHRoPSIyIj4KICA8Y2lyY2xlIGN5PSIyMiIgc3Ryb2tlLW9wYWNpdHk9IjAiIHI9IjYiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIH'+\n\t\t\t'ZhbHVlcz0iNjsyMiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS13aWR0aCIgdmFsdWVzPSIyOzAiIGNhbGNNb2RlPSJsaW5lYXIiIGR1cj0iM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS41cyIvPgogIDwvY2lyY2xlPgog'+\n\t\t\t'IDxjaXJjbGUgY3k9IjIyIiBzdHJva2Utb3BhY2l0eT0iMCIgcj0iNiIgY3g9IjIyIj4KICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgdmFsdWVzPSI2OzIyIiBjYWxjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIzcyIvPgogICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utd2lkdGgiIHZhbHVlcz0iMjswIiBjYW'+\n\t\t\t'xjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgPC9jaXJjbGU+CiAgPGNpcmNsZSBjeT0iMjIiIHI9IjgiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIHZhbHVlcz0iNjsxOzI7Mzs0OzU7NiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIxLjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIi8+CiAgPC9jaXJjbGU+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_node_image__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_node_image__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PCEtLSBCeSBTYW0gSGVyYmVydCAoQHNoZXJiKSwgZm9yIGV2ZXJ5b25lLiBNb3JlIEAgaHR0cDovL2dvby5nbC83QUp6YkwgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBoZWlnaHQ9IjQ1IiB2aWV3Qm94PSIwIDAgNDUgNDUiIHN0cm9rZT0iI2ZmZiIgd2lkdGg9IjQ1Ij4KIDxnIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0ibm9uZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgc3Ryb2tlLXdpZHRoPSIyIj4KICA8Y2lyY2xlIGN5PSIyMiIgc3Ryb2tlLW9wYWNpdHk9IjAiIHI9IjYiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIH'+\n\t\t\t'ZhbHVlcz0iNjsyMiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS13aWR0aCIgdmFsdWVzPSIyOzAiIGNhbGNNb2RlPSJsaW5lYXIiIGR1cj0iM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS41cyIvPgogIDwvY2lyY2xlPgog'+\n\t\t\t'IDxjaXJjbGUgY3k9IjIyIiBzdHJva2Utb3BhY2l0eT0iMCIgcj0iNiIgY3g9IjIyIj4KICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgdmFsdWVzPSI2OzIyIiBjYWxjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIzcyIvPgogICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utd2lkdGgiIHZhbHVlcz0iMjswIiBjYW'+\n\t\t\t'xjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgPC9jaXJjbGU+CiAgPGNpcmNsZSBjeT0iMjIiIHI9IjgiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIHZhbHVlcz0iNjsxOzI7Mzs0OzU7NiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIxLjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIi8+CiAgPC9jaXJjbGU+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_node_image__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_node_image\";\n\t\tel.ggDx=-1.5;\n\t\tel.ggDy=9.5;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 45px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 45px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_node_image.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_node_image.onmouseover=function (e) {\n\t\t\tme._ht_node_image__img.style.visibility='hidden';\n\t\t\tme._ht_node_image__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_node_image.onmouseout=function (e) {\n\t\t\tme._ht_node_image__img.style.visibility='inherit';\n\t\t\tme._ht_node_image__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_node_image.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_node.appendChild(me._ht_node_image);\n\t\tel=me._tt_ht_node=document.createElement('div');\n\t\tels=me._tt_ht_node__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_node\";\n\t\tel.ggDx=1;\n\t\tel.ggDy=-33;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\ths+='font-size:0.8em;text-transform:uppercase;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #1c69d4;';\n\t\ths+='background: rgba(28,105,212,0.745098);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='border-radius: 1px;';\n\t\ths+=cssPrefix + 'border-radius: 1px;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=\"<div style=\\\"padding:10px;font-weight:700;\\\">&nbsp;\"+me.hotspot.title+\"&nbsp;<\\/div>\";\n\t\tel.appendChild(els);\n\t\tme._tt_ht_node.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_node.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_node'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_node.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_node.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_node.style[domTransition]='';\n\t\t\t\tif (me._tt_ht_node.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_node.style.visibility=(Number(me._tt_ht_node.style.opacity)>0||!me._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_node.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_node.style.visibility=(Number(me._tt_ht_node.style.opacity)>0||!me._tt_ht_node.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_node.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_node.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_node.appendChild(me._tt_ht_node);\n\t\tme.__div = me._ht_node;\n\t};\n\tfunction SkinHotspotClass_ht_weg(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_weg=document.createElement('div');\n\t\tel.ggId=\"ht_weg\";\n\t\tel.ggParameter={ rx:0,ry:0,a:-10,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 0px;';\n\t\ths+='left : 196px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 235px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tel.style[domTransform]=parameterToTransform(el.ggParameter);\n\t\tme._ht_weg.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_weg.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_weg.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_weg.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_weg.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_weg.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_weg_image=document.createElement('div');\n\t\tels=me._ht_weg_image__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\tme._ht_weg_image__img.setAttribute('src',basePath + 'images/ht_weg_image.svg');\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\tel.ggId=\"ht_weg_image\";\n\t\tel.ggDx=19;\n\t\tel.ggDy=-3;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 198px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 112px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_weg_image.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_weg_image.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_weg.appendChild(me._ht_weg_image);\n\t\tme.ggUse3d=true;\n\t\tme.gg3dDistance=900;\n\t\tme.__div = me._ht_weg;\n\t};\n\tfunction SkinHotspotClass_ht_simple(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_simple=document.createElement('div');\n\t\tel.ggId=\"ht_simple\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='height : 0px;';\n\t\ths+='left : 328px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 169px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_simple.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_simple.onclick=function (e) {\n\t\t\tplayer.openUrl(me.hotspot.url,me.hotspot.target);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_simple.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_simple.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_simple']=true;\n\t\t\tme._tt_ht_simple.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_simple.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_simple']=false;\n\t\t\tme._tt_ht_simple.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_simple.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_simple']=false;\n\t\t\tme._tt_ht_simple.logicBlock_visible();\n\t\t}\n\t\tme._ht_simple.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_simple_image=document.createElement('div');\n\t\tels=me._ht_simple_image__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PCEtLSBCeSBTYW0gSGVyYmVydCAoQHNoZXJiKSwgZm9yIGV2ZXJ5b25lLiBNb3JlIEAgaHR0cDovL2dvby5nbC83QUp6YkwgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBoZWlnaHQ9IjQ1IiB2aWV3Qm94PSIwIDAgNDUgNDUiIHN0cm9rZT0iI2ZmZiIgd2lkdGg9IjQ1Ij4KIDxnIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0ibm9uZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgc3Ryb2tlLXdpZHRoPSIyIj4KICA8Y2lyY2xlIGN5PSIyMiIgc3Ryb2tlLW9wYWNpdHk9IjAiIHI9IjYiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIH'+\n\t\t\t'ZhbHVlcz0iNjsyMiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS13aWR0aCIgdmFsdWVzPSIyOzAiIGNhbGNNb2RlPSJsaW5lYXIiIGR1cj0iM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS41cyIvPgogIDwvY2lyY2xlPgog'+\n\t\t\t'IDxjaXJjbGUgY3k9IjIyIiBzdHJva2Utb3BhY2l0eT0iMCIgcj0iNiIgY3g9IjIyIj4KICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgdmFsdWVzPSI2OzIyIiBjYWxjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIzcyIvPgogICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utd2lkdGgiIHZhbHVlcz0iMjswIiBjYW'+\n\t\t\t'xjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgPC9jaXJjbGU+CiAgPGNpcmNsZSBjeT0iMjIiIHI9IjgiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIHZhbHVlcz0iNjsxOzI7Mzs0OzU7NiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIxLjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIi8+CiAgPC9jaXJjbGU+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_simple_image__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_simple_image__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PCEtLSBCeSBTYW0gSGVyYmVydCAoQHNoZXJiKSwgZm9yIGV2ZXJ5b25lLiBNb3JlIEAgaHR0cDovL2dvby5nbC83QUp6YkwgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBoZWlnaHQ9IjQ1IiB2aWV3Qm94PSIwIDAgNDUgNDUiIHN0cm9rZT0iI2ZmZiIgd2lkdGg9IjQ1Ij4KIDxnIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0ibm9uZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgc3Ryb2tlLXdpZHRoPSIyIj4KICA8Y2lyY2xlIGN5PSIyMiIgc3Ryb2tlLW9wYWNpdHk9IjAiIHI9IjYiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIH'+\n\t\t\t'ZhbHVlcz0iNjsyMiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjVzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS13aWR0aCIgdmFsdWVzPSIyOzAiIGNhbGNNb2RlPSJsaW5lYXIiIGR1cj0iM3MiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS41cyIvPgogIDwvY2lyY2xlPgog'+\n\t\t\t'IDxjaXJjbGUgY3k9IjIyIiBzdHJva2Utb3BhY2l0eT0iMCIgcj0iNiIgY3g9IjIyIj4KICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgdmFsdWVzPSI2OzIyIiBjYWxjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZS1vcGFjaXR5IiB2YWx1ZXM9IjE7MCIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIzcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIzcyIvPgogICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2Utd2lkdGgiIHZhbHVlcz0iMjswIiBjYW'+\n\t\t\t'xjTW9kZT0ibGluZWFyIiBkdXI9IjNzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjNzIi8+CiAgPC9jaXJjbGU+CiAgPGNpcmNsZSBjeT0iMjIiIHI9IjgiIGN4PSIyMiI+CiAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InIiIHZhbHVlcz0iNjsxOzI7Mzs0OzU7NiIgY2FsY01vZGU9ImxpbmVhciIgZHVyPSIxLjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIi8+CiAgPC9jaXJjbGU+CiA8L2c+Cjwvc3ZnPgo=';\n\t\tme._ht_simple_image__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_simple_image\";\n\t\tel.ggDx=-1.5;\n\t\tel.ggDy=9.5;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 45px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 45px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_simple_image.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_simple_image.onmouseover=function (e) {\n\t\t\tme._ht_simple_image__img.style.visibility='hidden';\n\t\t\tme._ht_simple_image__imgo.style.visibility='inherit';\n\t\t\tme.elementMouseOver['ht_simple_image']=true;\n\t\t}\n\t\tme._ht_simple_image.onmouseout=function (e) {\n\t\t\tme._ht_simple_image__img.style.visibility='inherit';\n\t\t\tme._ht_simple_image__imgo.style.visibility='hidden';\n\t\t\tme.elementMouseOver['ht_simple_image']=false;\n\t\t}\n\t\tme._ht_simple_image.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_simple_image']=false;\n\t\t}\n\t\tme._ht_simple_image.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t}\n\t\tme._ht_simple.appendChild(me._ht_simple_image);\n\t\tel=me._tt_ht_simple=document.createElement('div');\n\t\tels=me._tt_ht_simple__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_ht_simple\";\n\t\tel.ggDx=1;\n\t\tel.ggDy=-30;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\ths+='font-size:0.8em;text-transform:uppercase;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #1c69d4;';\n\t\ths+='background: rgba(28,105,212,0.745098);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='border-radius: 1px;';\n\t\ths+=cssPrefix + 'border-radius: 1px;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=\"<div style=\\\"padding:10px;font-weight:700;\\\">&nbsp;\"+me.hotspot.title+\"&nbsp;<\\/div>\";\n\t\tel.appendChild(els);\n\t\tme._tt_ht_simple.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_ht_simple.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_simple'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_ht_simple.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_ht_simple.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_ht_simple.style[domTransition]='';\n\t\t\t\tif (me._tt_ht_simple.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_ht_simple.style.visibility=(Number(me._tt_ht_simple.style.opacity)>0||!me._tt_ht_simple.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_simple.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_ht_simple.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_ht_simple.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_ht_simple.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_simple.appendChild(me._tt_ht_simple);\n\t\t\tme.hotspotTimerEvent=function() {\n\t\t\t\tsetTimeout(function() { me.hotspotTimerEvent(); }, 10);\n\t\t\t\tif (me.elementMouseOver['ht_simple_image']) {\n\t\t\t\t\tme._tt_ht_simple.style[domTransition]='none';\n\t\t\t\t\tme._tt_ht_simple.style.visibility=(Number(me._tt_ht_simple.style.opacity)>0||!me._tt_ht_simple.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_ht_simple.ggVisible=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tme.hotspotTimerEvent();\n\t\tme.__div = me._ht_simple;\n\t};\n\tfunction SkinHotspotClass_ht_info(parentScope,hotspot) {\n\t\tvar me=this;\n\t\tvar flag=false;\n\t\tvar hs='';\n\t\tme.parentScope=parentScope;\n\t\tme.hotspot=hotspot;\n\t\tvar nodeId=String(hotspot.url);\n\t\tnodeId=(nodeId.charAt(0)=='{')?nodeId.substr(1, nodeId.length - 2):''; // }\n\t\tme.ggUserdata=skin.player.getNodeUserdata(nodeId);\n\t\tme.elementMouseDown=[];\n\t\tme.elementMouseOver=[];\n\t\tme.findElements=function(id,regex) {\n\t\t\treturn skin.findElements(id,regex);\n\t\t}\n\t\tel=me._ht_info=document.createElement('div');\n\t\tel.ggId=\"ht_info\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_hotspot \";\n\t\tel.ggType='hotspot';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 0px;';\n\t\ths+='left : 89px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : 434px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 0px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info.ggIsActive=function() {\n\t\t\treturn player.getCurrentNode()==this.ggElementNodeId();\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif (me.hotspot.url!='' && me.hotspot.url.charAt(0)=='{') { // }\n\t\t\t\treturn me.hotspot.url.substr(1, me.hotspot.url.length - 2);\n\t\t\t} else {\n\t\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t\t} else {\n\t\t\t\t\treturn player.getCurrentNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._ht_info.onclick=function (e) {\n\t\t\tskin._info_title.ggText=me.hotspot.title;\n\t\t\tskin._info_title.ggTextDiv.innerHTML=skin._info_title.ggText;\n\t\t\tif (skin._info_title.ggUpdateText) {\n\t\t\t\tskin._info_title.ggUpdateText=function() {\n\t\t\t\t\tvar hs=me.hotspot.title;\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (skin._info_title.ggUpdatePosition) {\n\t\t\t\tskin._info_title.ggUpdatePosition();\n\t\t\t}\n\t\t\tskin._info_title.ggTextDiv.scrollTop = 0;\n\t\t\tskin._info_text_body.ggText=me.hotspot.description;\n\t\t\tskin._info_text_body.ggTextDiv.innerHTML=skin._info_text_body.ggText;\n\t\t\tif (skin._info_text_body.ggUpdateText) {\n\t\t\t\tskin._info_text_body.ggUpdateText=function() {\n\t\t\t\t\tvar hs=me.hotspot.description;\n\t\t\t\t\tif (hs!=this.ggText) {\n\t\t\t\t\t\tthis.ggText=hs;\n\t\t\t\t\t\tthis.ggTextDiv.innerHTML=hs;\n\t\t\t\t\t\tif (this.ggUpdatePosition) this.ggUpdatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (skin._info_text_body.ggUpdatePosition) {\n\t\t\t\tskin._info_text_body.ggUpdatePosition();\n\t\t\t}\n\t\t\tskin._info_text_body.ggTextDiv.scrollTop = 0;\n\t\t\tplayer.setVariableValue('vis_info_popup', true);\n\t\t\tskin.hotspotProxyClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.ondblclick=function (e) {\n\t\t\tskin.hotspotProxyDoubleClick(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.onmouseover=function (e) {\n\t\t\tplayer.setActiveHotspot(me.hotspot);\n\t\t\tme.elementMouseOver['ht_info']=true;\n\t\t\tme._tt_information.logicBlock_visible();\n\t\t\tskin.hotspotProxyOver(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.onmouseout=function (e) {\n\t\t\tplayer.setActiveHotspot(null);\n\t\t\tme.elementMouseOver['ht_info']=false;\n\t\t\tme._tt_information.logicBlock_visible();\n\t\t\tskin.hotspotProxyOut(me.hotspot.id, me.hotspot.url);\n\t\t}\n\t\tme._ht_info.ontouchend=function (e) {\n\t\t\tme.elementMouseOver['ht_info']=false;\n\t\t\tme._tt_information.logicBlock_visible();\n\t\t}\n\t\tme._ht_info.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tel=me._ht_info_image=document.createElement('div');\n\t\tels=me._ht_info_image__img=document.createElement('img');\n\t\tels.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PHN2ZyBzdHlsZT0ibWFyZ2luOiBhdXRvOyBiYWNrZ3JvdW5kOiByZ2IoMjQxLCAyNDIsIDI0Myk7IGRpc3BsYXk6IGJsb2NrOyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBoZWlnaHQ9IjIwMHB4IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwcHgiPgogPGNpcmNsZSBjeT0iNTAiIHN0cm9rZT0iI2ZlZmVmZSIgZmlsbD0ibm9uZSIgcj0iMCIgc3Ryb2tlLXdpZHRoPSI2IiBjeD0iNTAiPgogIDxhbmltYXRlIGtleVNwbGluZXM9Ij'+\n\t\t\t'AgMC4yIDAuOCAxIiBhdHRyaWJ1dGVOYW1lPSJyIiB2YWx1ZXM9IjA7NDAiIGNhbGNNb2RlPSJzcGxpbmUiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlUaW1lcz0iMDsxIiBiZWdpbj0iLTAuNXMiLz4KICA8YW5pbWF0ZSBrZXlTcGxpbmVzPSIwLjIgMCAwLjggMSIgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgdmFsdWVzPSIxOzAiIGNhbGNNb2RlPSJzcGxpbmUiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlUaW1lcz0iMDsxIiBiZWdpbj0iLTAuNXMiLz4KIDwvY2lyY2xlPgogPGNpcmNsZSBjeT0iNTAiIHN0cm9rZT0iI2ZlZmVmZSIgZmlsbD0ibm9u'+\n\t\t\t'ZSIgcj0iMCIgc3Ryb2tlLXdpZHRoPSI2IiBjeD0iNTAiPgogIDxhbmltYXRlIGtleVNwbGluZXM9IjAgMC4yIDAuOCAxIiBhdHRyaWJ1dGVOYW1lPSJyIiB2YWx1ZXM9IjA7NDAiIGNhbGNNb2RlPSJzcGxpbmUiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBrZXlUaW1lcz0iMDsxIi8+CiAgPGFuaW1hdGUga2V5U3BsaW5lcz0iMC4yIDAgMC44IDEiIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMTswIiBjYWxjTW9kZT0ic3BsaW5lIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5VGltZXM9IjA7MSIvPgogPC9jaXJjbGU+Cjwvc3ZnPgo=';\n\t\tme._ht_info_image__img.setAttribute('src',hs);\n\t\tels.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;pointer-events:none;;');\n\t\tels['ondragstart']=function() { return false; };\n\t\tel.appendChild(els);\n\t\tel.ggSubElement = els;\n\t\telo=me._ht_info_image__imgo=document.createElement('img');\n\t\telo.className='ggskin ggskin_svg';\n\t\ths='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgJy0vL1czQy8vRFREIFNWRyAxLjEgQmFzaWMvL0VOJyAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEtYmFzaWMuZHRkJz4KPCEtLSBHYXJkZW4gR25vbWUgU29mdHdhcmUgLSBTa2luIEJ1dHRvbnMgLS0+CjxzdmcgYmFzZVByb2ZpbGU9ImJhc2ljIiB4bWw6c3BhY2U9InByZXNlcnZlIiB4PSIwcHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgaGVpZ2h0PSIzMnB4IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeT0iMH'+\n\t\t\t'B4IiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjMycHgiIGlkPSJMYXllcl8xIj4KIDxnIG9wYWNpdHk9IjAuNCIgc3Ryb2tlPSIjM0MzQzNDIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNiwxNikgc2NhbGUoMS4xKSB0cmFuc2xhdGUoLTE2LC0xNikiIHN0cm9rZS13aWR0aD0iMS41Ij4KICA8Zz4KICAgPHBhdGggZD0iTTMuNSwxNkMzLjUsOS4wOTYsOS4wOTYsMy41LDE2LDMuNWwwLDBjNi45MDMsMCwxMi40OTksNS41OTYsMTIuNSwxMi41bDAsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MtMC4wMDEsNi45MDMtNS41OTcsMTIuNDk5LTEy'+\n\t\t\t'LjUsMTIuNWwwLDBDOS4wOTYsMjguNDk5LDMuNSwyMi45MDMsMy41LDE2TDMuNSwxNnogTTguODU0LDguODUzJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzcuMDIyLDEwLjY4Niw1Ljg5NCwxMy4yMDUsNS44OTMsMTZsMCwwYzAuMDAxLDIuNzk1LDEuMTI5LDUuMzE0LDIuOTYxLDcuMTQ2bDAsMGMxLjgzMiwxLjgzMSw0LjM1MiwyLjk2LDcuMTQ2LDIuOTZsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7YzIuNzk1LDAsNS4zMTQtMS4xMjksNy4xNDctMi45NmwwLDBjMS44MzEtMS44MzIsMi45NTktNC4zNTIsMi45Ni03LjE0NmwwLDBjLTAuMDAxLTIuNzk1LTEuMTI5LTUuMz'+\n\t\t\t'E0LTIuOTYtNy4xNDdsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzIxLjMxMyw3LjAyMiwxOC43OTUsNS44OTMsMTYsNS44OTJsMCwwQzEzLjIwNSw1Ljg5MywxMC42ODYsNy4wMjIsOC44NTQsOC44NTNMOC44NTQsOC44NTN6Ii8+CiAgPC9nPgogIDxnPgogICA8cGF0aCBkPSJNMTQuOTYzLDEwLjA1VjkuNTIxYzAtMC42NjEsMC41MzYtMS4xOTYsMS4xOTctMS4xOTZsMCwwYzAuNjYsMCwxLjE5NiwwLjUzNiwxLjE5NiwxLjE5NmwwLDB2MC41MjkmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtjMCwwLjY2MS0wLjUzNiwxLjE5Ni0xLjE5NiwxLjE5NmwwLDBDMTUuNSwxMS4y'+\n\t\t\t'NDcsMTQuOTYzLDEwLjcxMSwxNC45NjMsMTAuMDVMMTQuOTYzLDEwLjA1eiIvPgogICA8Zz4KICAgIDxwYXRoIGQ9Ik0xOC41MzIsMjAuMzkxaC0xLjE3NnYtNi40NzNjMC0wLjAyMS0wLjAwNS0wLjA0Mi0wLjAwNi0wLjA2M2MwLTAuMDE0LDAuMDA0LTAuMDI2LDAuMDA0LTAuMDQmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MwLTAuNjYxLTAuNTM2LTEuMTk2LTEuMTk2LTEuMTk2aC0yLjIyNmMtMC42NjEsMC0xLjE5NywwLjUzNi0xLjE5NywxLjE5NmMwLDAuNjYsMC41MzYsMS4xOTYsMS4xOTcsMS4xOTZoMS4wMzF2NS4zNzloLTEuMjA3JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3'+\n\t\t\t'g5OyYjeDk7JiN4OTtjLTAuNjYxLDAtMS4xOTcsMC41MzUtMS4xOTcsMS4xOTZjMCwwLjY2LDAuNTM2LDEuMTk2LDEuMTk3LDEuMTk2aDQuNzc1YzAuNjYsMCwxLjE5Ny0wLjUzNiwxLjE5Ny0xLjE5NiYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5OyYjeDk7QzE5LjcyOSwyMC45MjYsMTkuMTkyLDIwLjM5MSwxOC41MzIsMjAuMzkxeiIvPgogICA8L2c+CiAgPC9nPgogPC9nPgogPGcgc3Ryb2tlPSIjMDAwMDAwIiBmaWxsPSIjRkZGRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNiwxNikgc2NhbGUoMS4xKSB0cmFuc2xhdGUoLTE2LC0xNikiIHN0cm9rZS13aWR0aD0iMC4yIj4KICA8Zz4K'+\n\t\t\t'ICAgPHBhdGggZD0iTTMuNSwxNkMzLjUsOS4wOTYsOS4wOTYsMy41LDE2LDMuNWwwLDBjNi45MDMsMCwxMi40OTksNS41OTYsMTIuNSwxMi41bDAsMCYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5O2MtMC4wMDEsNi45MDMtNS41OTcsMTIuNDk5LTEyLjUsMTIuNWwwLDBDOS4wOTYsMjguNDk5LDMuNSwyMi45MDMsMy41LDE2TDMuNSwxNnogTTguODU0LDguODUzJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzcuMDIyLDEwLjY4Niw1Ljg5NCwxMy4yMDUsNS44OTMsMTZsMCwwYzAuMDAxLDIuNzk1LDEuMTI5LDUuMzE0LDIuOTYxLDcuMTQ2bDAsMGMxLjgzMiwxLjgzMSw0LjM1MiwyLj'+\n\t\t\t'k2LDcuMTQ2LDIuOTZsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7YzIuNzk1LDAsNS4zMTQtMS4xMjksNy4xNDctMi45NmwwLDBjMS44MzEtMS44MzIsMi45NTktNC4zNTIsMi45Ni03LjE0NmwwLDBjLTAuMDAxLTIuNzk1LTEuMTI5LTUuMzE0LTIuOTYtNy4xNDdsMCwwJiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7QzIxLjMxMyw3LjAyMiwxOC43OTUsNS44OTMsMTYsNS44OTJsMCwwQzEzLjIwNSw1Ljg5MywxMC42ODYsNy4wMjIsOC44NTQsOC44NTNMOC44NTQsOC44NTN6Ii8+CiAgPC9nPgogIDxnPgogICA8cGF0aCBkPSJNMTQuOTYzLDEwLjA1VjkuNTIxYzAtMC42NjEs'+\n\t\t\t'MC41MzYtMS4xOTYsMS4xOTctMS4xOTZsMCwwYzAuNjYsMCwxLjE5NiwwLjUzNiwxLjE5NiwxLjE5NmwwLDB2MC41MjkmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTtjMCwwLjY2MS0wLjUzNiwxLjE5Ni0xLjE5NiwxLjE5NmwwLDBDMTUuNSwxMS4yNDcsMTQuOTYzLDEwLjcxMSwxNC45NjMsMTAuMDVMMTQuOTYzLDEwLjA1eiIvPgogICA8Zz4KICAgIDxwYXRoIGQ9Ik0xOC41MzIsMjAuMzkxaC0xLjE3NnYtNi40NzNjMC0wLjAyMS0wLjAwNS0wLjA0Mi0wLjAwNi0wLjA2M2MwLTAuMDE0LDAuMDA0LTAuMDI2LDAuMDA0LTAuMDQmI3hkOyYjeGE7JiN4OTsmI3g5OyYjeDk7JiN4OTsmI3g5O2'+\n\t\t\t'MwLTAuNjYxLTAuNTM2LTEuMTk2LTEuMTk2LTEuMTk2aC0yLjIyNmMtMC42NjEsMC0xLjE5NywwLjUzNi0xLjE5NywxLjE5NmMwLDAuNjYsMC41MzYsMS4xOTYsMS4xOTcsMS4xOTZoMS4wMzF2NS4zNzloLTEuMjA3JiN4ZDsmI3hhOyYjeDk7JiN4OTsmI3g5OyYjeDk7JiN4OTtjLTAuNjYxLDAtMS4xOTcsMC41MzUtMS4xOTcsMS4xOTZjMCwwLjY2LDAuNTM2LDEuMTk2LDEuMTk3LDEuMTk2aDQuNzc1YzAuNjYsMCwxLjE5Ny0wLjUzNiwxLjE5Ny0xLjE5NiYjeGQ7JiN4YTsmI3g5OyYjeDk7JiN4OTsmI3g5OyYjeDk7QzE5LjcyOSwyMC45MjYsMTkuMTkyLDIwLjM5MSwxOC41MzIsMjAuMzkxeiIv'+\n\t\t\t'PgogICA8L2c+CiAgPC9nPgogPC9nPgo8L3N2Zz4K';\n\t\tme._ht_info_image__imgo.setAttribute('src',hs);\n\t\telo.setAttribute('style','position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;-webkit-user-drag:none;visibility:hidden;pointer-events:none;;');\n\t\telo['ondragstart']=function() { return false; };\n\t\tel.appendChild(elo);\n\t\tel.ggId=\"ht_info_image\";\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=true;\n\t\tel.className=\"ggskin ggskin_svg \";\n\t\tel.ggType='svg';\n\t\ths ='';\n\t\ths+='height : 32px;';\n\t\ths+='left : -15px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -15px;';\n\t\ths+='visibility : inherit;';\n\t\ths+='width : 32px;';\n\t\ths+='pointer-events:auto;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\tme._ht_info_image.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._ht_info_image.onmouseover=function (e) {\n\t\t\tme._ht_info_image__img.style.visibility='hidden';\n\t\t\tme._ht_info_image__imgo.style.visibility='inherit';\n\t\t}\n\t\tme._ht_info_image.onmouseout=function (e) {\n\t\t\tme._ht_info_image__img.style.visibility='inherit';\n\t\t\tme._ht_info_image__imgo.style.visibility='hidden';\n\t\t}\n\t\tme._ht_info_image.ggUpdatePosition=function (useTransition) {\n\t\t}\n\t\tme._ht_info.appendChild(me._ht_info_image);\n\t\tel=me._tt_information=document.createElement('div');\n\t\tels=me._tt_information__text=document.createElement('div');\n\t\tel.className='ggskin ggskin_textdiv';\n\t\tel.ggTextDiv=els;\n\t\tel.ggId=\"tt_information\";\n\t\tel.ggDx=2;\n\t\tel.ggDy=-50;\n\t\tel.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };\n\t\tel.ggVisible=false;\n\t\tel.className=\"ggskin ggskin_text \";\n\t\tel.ggType='text';\n\t\ths ='';\n\t\ths+='cursor : pointer;';\n\t\ths+='height : 20px;';\n\t\ths+='left : -10000px;';\n\t\ths+='position : absolute;';\n\t\ths+='top : -10000px;';\n\t\ths+='visibility : hidden;';\n\t\ths+='width : 100px;';\n\t\ths+='pointer-events:auto;';\n\t\ths+='font-size:0.8em;';\n\t\tel.setAttribute('style',hs);\n\t\tel.style[domTransform + 'Origin']='50% 50%';\n\t\ths ='position:absolute;';\n\t\ths += 'box-sizing: border-box;';\n\t\ths+='left: 0px;';\n\t\ths+='top: 0px;';\n\t\ths+='width: auto;';\n\t\ths+='height: auto;';\n\t\ths+='background: #1c69d4;';\n\t\ths+='background: rgba(28,105,212,0.745098);';\n\t\ths+='border: 0px solid #000000;';\n\t\ths+='border-radius: 1px;';\n\t\ths+=cssPrefix + 'border-radius: 1px;';\n\t\ths+='color: rgba(255,255,255,1);';\n\t\ths+='text-align: center;';\n\t\ths+='white-space: nowrap;';\n\t\ths+='padding: 0px 1px 0px 1px;';\n\t\ths+='overflow: hidden;';\n\t\tels.setAttribute('style',hs);\n\t\tels.innerHTML=\"<div style=\\\"padding:10px;font-weight:700;\\\">&nbsp;\"+me.hotspot.title+\"&nbsp;<\\/div>\";\n\t\tel.appendChild(els);\n\t\tme._tt_information.ggIsActive=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggIsActive)) {\n\t\t\t\treturn this.parentNode.ggIsActive();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tel.ggElementNodeId=function() {\n\t\t\tif ((this.parentNode) && (this.parentNode.ggElementNodeId)) {\n\t\t\t\treturn this.parentNode.ggElementNodeId();\n\t\t\t}\n\t\t\treturn me.ggNodeId;\n\t\t}\n\t\tme._tt_information.logicBlock_position = function() {\n\t\t\tvar newLogicStatePosition;\n\t\t\tif (\n\t\t\t\t((player.getIsMobile() == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStatePosition = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStatePosition = -1;\n\t\t\t}\n\t\t\tif (me._tt_information.ggCurrentLogicStatePosition != newLogicStatePosition) {\n\t\t\t\tme._tt_information.ggCurrentLogicStatePosition = newLogicStatePosition;\n\t\t\t\tme._tt_information.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_information.ggCurrentLogicStatePosition == 0) {\n\t\t\t\t\tthis.ggDx = 2;\n\t\t\t\t\tthis.ggDy = 30;\n\t\t\t\t\tme._tt_information.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_information.ggDx=2;\n\t\t\t\t\tme._tt_information.ggDy=-50;\n\t\t\t\t\tme._tt_information.ggUpdatePosition(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_information.logicBlock_visible = function() {\n\t\t\tvar newLogicStateVisible;\n\t\t\tif (\n\t\t\t\t((me.elementMouseOver['ht_info'] == true))\n\t\t\t)\n\t\t\t{\n\t\t\t\tnewLogicStateVisible = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewLogicStateVisible = -1;\n\t\t\t}\n\t\t\tif (me._tt_information.ggCurrentLogicStateVisible != newLogicStateVisible) {\n\t\t\t\tme._tt_information.ggCurrentLogicStateVisible = newLogicStateVisible;\n\t\t\t\tme._tt_information.style[domTransition]='left 0s, top 0s';\n\t\t\t\tif (me._tt_information.ggCurrentLogicStateVisible == 0) {\n\t\t\t\t\tme._tt_information.style.visibility=(Number(me._tt_information.style.opacity)>0||!me._tt_information.style.opacity)?'inherit':'hidden';\n\t\t\t\t\tme._tt_information.ggVisible=true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tme._tt_information.style.visibility=\"hidden\";\n\t\t\t\t\tme._tt_information.ggVisible=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tme._tt_information.ggUpdatePosition=function (useTransition) {\n\t\t\tif (useTransition==='undefined') {\n\t\t\t\tuseTransition = false;\n\t\t\t}\n\t\t\tif (!useTransition) {\n\t\t\t\tthis.style[domTransition]='none';\n\t\t\t}\n\t\t\tif (this.parentNode) {\n\t\t\t\tvar pw=this.parentNode.clientWidth;\n\t\t\t\tvar w=this.offsetWidth + 0;\n\t\t\t\t\tthis.style.left=(this.ggDx + pw/2 - w/2) + 'px';\n\t\t\t\tvar ph=this.parentNode.clientHeight;\n\t\t\t\tvar h=this.offsetHeight;\n\t\t\t\t\tthis.style.top=(this.ggDy + ph/2 - h/2) + 'px';\n\t\t\t}\n\t\t\tthis.style[domTransition]='left 0';\n\t\t\tthis.ggTextDiv.style.left=((98-this.ggTextDiv.offsetWidth)/2) + 'px';\n\t\t}\n\t\tme._ht_info.appendChild(me._tt_information);\n\t\tme.__div = me._ht_info;\n\t};\n\tme.addSkinHotspot=function(hotspot) {\n\t\tvar hsinst = null;\n\t\tif (hotspot.skinid=='ht_node') {\n\t\t\thotspot.skinid = 'ht_node';\n\t\t\thsinst = new SkinHotspotClass_ht_node(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_node_mouseover();;\n\t\t} else\n\t\tif (hotspot.skinid=='ht_weg') {\n\t\t\thotspot.skinid = 'ht_weg';\n\t\t\thsinst = new SkinHotspotClass_ht_weg(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t} else\n\t\tif (hotspot.skinid=='ht_simple') {\n\t\t\thotspot.skinid = 'ht_simple';\n\t\t\thsinst = new SkinHotspotClass_ht_simple(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_simple_mouseover();;\n\t\t} else\n\t\t{\n\t\t\thotspot.skinid = 'ht_info';\n\t\t\thsinst = new SkinHotspotClass_ht_info(me, hotspot);\n\t\t\tif (!hotspotTemplates.hasOwnProperty(hotspot.skinid)) {\n\t\t\t\thotspotTemplates[hotspot.skinid] = [];\n\t\t\t}\n\t\t\thotspotTemplates[hotspot.skinid].push(hsinst);\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_configloaded();;\n\t\t\tme.callChildLogicBlocksHotspot_ht_info_mouseover();;\n\t\t}\n\t\treturn hsinst;\n\t}\n\tme.removeSkinHotspots=function() {\n\t\tif(hotspotTemplates['ht_node']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_node'].length; i++) {\n\t\t\t\thotspotTemplates['ht_node'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_weg']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_weg'].length; i++) {\n\t\t\t\thotspotTemplates['ht_weg'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_simple']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_simple'].length; i++) {\n\t\t\t\thotspotTemplates['ht_simple'][i] = null;\n\t\t\t}\n\t\t}\n\t\tif(hotspotTemplates['ht_info']) {\n\t\t\tvar i;\n\t\t\tfor(i = 0; i < hotspotTemplates['ht_info'].length; i++) {\n\t\t\t\thotspotTemplates['ht_info'][i] = null;\n\t\t\t}\n\t\t}\n\t\thotspotTemplates = [];\n\t}\n\tme.addSkin();\n\tvar style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.appendChild(document.createTextNode('.ggskin { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px;}'));\n\tdocument.head.appendChild(style);\n\tme._screentint_info.logicBlock_visible();\n\tme._information.logicBlock_visible();\n\tplayer.addListener('changenode', function(args) { me._screentint_info.logicBlock_visible();me._information.logicBlock_visible(); });\n\tplayer.addListener('varchanged_vis_info_popup', function(args) { me._screentint_info.logicBlock_visible();me._information.logicBlock_visible(); });\n\tplayer.addListener('configloaded', function(args) { me.callChildLogicBlocksHotspot_ht_info_configloaded(); });\n\tplayer.addListener('mouseover', function(args) { me.callChildLogicBlocksHotspot_ht_node_mouseover();me.callChildLogicBlocksHotspot_ht_simple_mouseover();me.callChildLogicBlocksHotspot_ht_info_mouseover(); });\n\tplayer.addListener('hotspotsremoved', function(args) { me.removeSkinHotspots(); });\n\tme.skinTimerEvent();\n}", "title": "" }, { "docid": "b69a363043340c25a56491ef553db69f", "score": "0.5278926", "text": "function setSquareReferences() {\n\tone_panel = document.getElementById(\"one\");\n\ttwo_panel = document.getElementById(\"two\");\n\tthree_panel = document.getElementById(\"three\");\n\tfour_panel = document.getElementById(\"four\");\n\tfive_panel = document.getElementById(\"five\");\n\tsix_panel = document.getElementById(\"six\");\n\tseven_panel = document.getElementById(\"seven\");\n\teight_panel = document.getElementById(\"eight\");\n\tnine_panel = document.getElementById(\"nine\");\n}", "title": "" }, { "docid": "06c1140dd945dd125899c13237f07513", "score": "0.52769464", "text": "function addInformationPanel() {\r\n\r\n\t\t// header/label\r\n\t\tvar lbDesc = new this.routingFrame.Ext.form.Label( {\r\n\t\t\ttext : this.messages['IGEO_ROUTE_LB_DESCRIPTION'],\r\n\t\t\tx : 10,\r\n\t\t\ty : 5,\r\n\t\t\tanchor : '100%',\r\n\t\t\theight : 'auto'\r\n\t\t});\r\n\r\n\t\tvar pnLabel = new this.routingFrame.Ext.Panel( {\r\n\t\t\tregion : 'north',\r\n\t\t\tborder : false,\r\n\t\t\tlayout : 'absolute',\r\n\t\t\theight : 30,\r\n\t\t\titems : [ lbDesc ]\r\n\t\t});\r\n\r\n\t\t// description text area\r\n\t\tvar taDesc = new this.routingFrame.Ext.form.TextArea( {\r\n\t\t\tid : 'infDesc',\r\n\t\t\tanchor : '100% 100%',\r\n\t\t\tborder : false,\r\n\t\t\tvalue : ''\r\n\t\t});\r\n\r\n\t\tvar pnTA = new this.routingFrame.Ext.Panel( {\r\n\t\t\tregion : 'center',\r\n\t\t\tborder : false,\r\n\t\t\tlayout : 'absolute',\r\n\t\t\theight : 150,\r\n\t\t\titems : [ taDesc ]\r\n\t\t});\r\n\r\n\t\t// some label for info about route length, no. of nodes etc.\r\n\t\tvar lbLength = new this.routingFrame.Ext.form.Label( {\r\n\t\t\tid : 'routeLength',\r\n\t\t\ttext : this.messages['IGEO_ROUTE_LB_ROUTELENGTH'],\r\n\t\t\tx : 10,\r\n\t\t\ty : 5,\r\n\t\t\tanchor : '100%',\r\n\t\t\theight : 'auto'\r\n\t\t});\r\n\r\n\t\tvar lbNodes = new this.routingFrame.Ext.form.Label( {\r\n\t\t\tid : 'osmNodes',\r\n\t\t\ttext : this.messages['IGEO_ROUTE_LB_OSMNODES'],\r\n\t\t\tx : 10,\r\n\t\t\ty : 25,\r\n\t\t\tanchor : '100%',\r\n\t\t\theight : 'auto'\r\n\t\t});\r\n\r\n//\t\tvar lbSegments = new this.routingFrame.Ext.form.Label( {\r\n//\t\t\ttext : 'segments (way points): ',\r\n//\t\t\tx : 10,\r\n//\t\t\ty : 50,\r\n//\t\t\tanchor : '100%',\r\n//\t\t\theight : 'auto'\r\n//\t\t});\r\n\r\n\t\tvar pnRI = new this.routingFrame.Ext.Panel( {\r\n\t\t\tregion : 'south',\r\n\t\t\tborder : false,\r\n\t\t\tlayout : 'absolute',\r\n\t\t\theight : 150,\r\n\t\t\titems : [ lbLength, lbNodes ]\r\n\t\t});\r\n\r\n\t\tvar main = new this.routingFrame.Ext.Panel( {\r\n\t\t\tid : 'infoPanel',\r\n\t\t\tborder : false,\r\n\t\t\tregion : 'center',\r\n\t\t\tlayout : 'border',\r\n\t\t\titems : [ pnLabel, pnTA, pnRI ]\r\n\t\t});\r\n\r\n\t\tvar cmp = this.routingFrame.Ext.getCmp('tabInfoPanel');\r\n\t\tcmp.add(main);\r\n\t\tcmp.doLayout();\r\n\t}", "title": "" }, { "docid": "4e2a73a7516dad349803f5f40753c245", "score": "0.5268144", "text": "function setSizes() {\n\n // Put the scatter plot on the left.\n scatterPlot.box = {\n x: 0,\n y: 0,\n width: div.clientWidth / 2,\n height: div.clientHeight\n };\n\n // Put the bar chart on the right.\n barChart.box = {\n x: div.clientWidth / 2,\n y: 0,\n width: div.clientWidth / 2,\n height: div.clientHeight\n };\n }", "title": "" }, { "docid": "62d3128c023eb2262d494bc4215b9abc", "score": "0.5261093", "text": "function SetResizeContent() {\n\t\t\t// all function call\n\t\t\tfeature_dynamic_font_line_height();\n\t\t\tSetMegamenuPosition();\n\t\t\tsetPageTitleSpace();\n\t\t\tsetButtonPosition();\n\t\t\tparallax_text();\n\t\t\tfullScreenHeight();\n\t\t\tequalizeHeight();\n\t\t}", "title": "" }, { "docid": "5f15c43ed891740a05912e7de7b7ed16", "score": "0.5256705", "text": "function drawpanel() {\n //Fill in some values\n redrawpanel();\n\n //Renders control panel visible\n d3.select(\"#controlpanel\").attr(\"style\", \"display:inline;\");\n\n //Turns on a small footnote at the end of the page\n d3.select(\"#pagefooter\").attr(\"style\", \"display:inline;\");\n}", "title": "" }, { "docid": "97028d09114b49d5679ddc5a458dcdfe", "score": "0.52421325", "text": "function PanelManager(...panels) {\r\n //Constants\r\n const node = appendNewElement(null, 'div', 'panel-region');\r\n const containerList = [];\r\n //Private Properties\r\n //Public Attributes\r\n //Public Methods\r\n this.node = () => node;\r\n this.appendTo = function(elem) {\r\n node.style.visibility = 'hidden';\r\n elem.appendChild(node);\r\n fitPanels();\r\n node.style.visibility = '';\r\n }\r\n this.addPanels = addPanels;\r\n this.fitPanels = fitPanels;\r\n this.contains = containsPanel;\r\n this.togglePanel = function togglePanel(panel, show) {\r\n if (!(panel instanceof Panel)) {\r\n throw new TypeError('Wrong type of argument, expected a instanceof ' +\r\n 'Panel or an array. Check the function details for more information'\r\n );}\r\n if (show) {\r\n if (!containsPanel(panel)) {addPanels(panel);}\r\n }\r\n else {\r\n let container = containerList.find(c => c.contains(panel));\r\n if (container) {container.removePanel(panel); fitPanels();}\r\n }\r\n }\r\n /**\r\n * Focus on a single panel or, if no panel is given, removes the focus on any\r\n * panel and returns the panel region to normal.\r\n * @param {Panel=} panel - Panel to focus\r\n */\r\n this.focusPanel = function(panel) {\r\n if (!panel) {\r\n node.classList.remove('inactive');\r\n let active = Array.from(node.getElementsByClassName('active'));\r\n for (let elem of active) {elem.classList.remove('active');}\r\n return;\r\n }\r\n let container = containerList.find(c => c.contains(panel));\r\n if (!container) {return;}\r\n node.classList.add('inactive');\r\n container.focusPanel(panel);\r\n }\r\n //Private Functions\r\n function containsPanel(panel) {\r\n return containerList.some(c => c.contains(panel));\r\n }\r\n function addPanels(...panels) {\r\n let wasEmpty = !node.children.length;\r\n for (let panelList of panels) {\r\n if (!(panelList instanceof Panel) && !Array.isArray(panelList)) {\r\n throw new TypeError('Wrong type of argument, expected a instanceof ' +\r\n 'Panel or an array. Check the function details for more information'\r\n );}\r\n let container;\r\n if (panelList instanceof Panel) { //Argument TYPE 1\r\n container = new PanelContainer(panelList);\r\n }\r\n else if (Array.isArray(panelList)) { //Argument TYPE 2\r\n container = new PanelContainer(...panelList);\r\n }\r\n container.onCallParent(respondChild);\r\n containerList.push(container);\r\n appendNewElement(node, 'div', 'ew-resize');\r\n node.appendChild(container.node());\r\n }\r\n if (wasEmpty) {node.firstElementChild.remove();}\r\n fitPanels();\r\n }\r\n function fitPanels(id = containerList.length - 1) {\r\n if (!containerList[id]) {return;}\r\n let {width} = node.getBoundingClientRect();\r\n if (!width) {return;} //if the node was not appended yet\r\n let childrenWidth = containerList.reduce(\r\n (acc, container) => acc + container.getWidth(), 0\r\n );\r\n let i = 0;\r\n while (childrenWidth > width) {\r\n if (i === id) {i++; continue;}\r\n let container = containerList[i];\r\n if (!container) {break;}\r\n let w0 = container.getWidth();\r\n container.setWidth(Math.max(\r\n w0 + width - childrenWidth, container.MIN_WIDTH\r\n ));\r\n childrenWidth += container.getWidth() - w0;\r\n i++;\r\n }\r\n if (childrenWidth !== width) {\r\n let container = containerList[id];\r\n container.changeWidth(width - childrenWidth);\r\n }\r\n containerList.forEach(container => container.fitPanels());\r\n }\r\n function handleResize({target, x}) {\r\n if (!target.classList.contains('ew-resize')) {return;}\r\n let resizerPos = Array.prototype.indexOf.call(node.children, target);\r\n //All resizers are on odd numbered positions, so we subtract 1 and\r\n //divide to get the real position\r\n resizerPos = (resizerPos - 1) / 2;\r\n //Get all containers at the right and left side of the resizer element\r\n let rightContainers = [], leftContainers = [];\r\n for (let i = resizerPos; containerList[i]; i--) {\r\n leftContainers.push(containerList[i]);\r\n }\r\n if(!leftContainers.length) {return;}\r\n for (let i = resizerPos + 1; containerList[i]; i++) {\r\n rightContainers.push(containerList[i]);\r\n }\r\n if(!rightContainers.length) {return;}\r\n let x0 = x;\r\n function move({x}) {\r\n let dx = x - x0;\r\n if (dx > 0) { //Extend first left container and shrink any right container\r\n if (rightContainers.some(container => container.changeWidth(-dx))) {\r\n leftContainers[0].changeWidth(dx);\r\n x0 = x;\r\n }\r\n }\r\n else { //Extend first right container and shrink any left container\r\n if (leftContainers.some(container => container.changeWidth(dx))) {\r\n rightContainers[0].changeWidth(-dx);\r\n x0 = x;\r\n }\r\n }\r\n }\r\n function stop() {\r\n window.removeEventListener('mousemove', move);\r\n window.removeEventListener('mouseup', stop);\r\n document.body.style.cursor = oldCursor;\r\n node.dispatchEvent(new Event('resize', {bubbles: true}));\r\n }\r\n window.addEventListener('mousemove', move);\r\n window.addEventListener('mouseup', stop);\r\n let oldCursor = document.body.style.cursor;\r\n document.body.style.cursor = 'ew-resize';\r\n }\r\n function prepareDocking({caller, panel, x0, y0}) {return new Promise((resolve) => {\r\n let dockLight = new DockLight();\r\n let container = new PanelContainer(panel);\r\n let bRect = node.getBoundingClientRect();\r\n let cNode = container.node();\r\n let nChildren = node.children.length;\r\n let target, region;\r\n cNode.classList.add('undocked');\r\n cNode.style.left = `${x0 - bRect.x}px`;\r\n cNode.style.top = `${y0 - bRect.y}px`;\r\n cNode.style.zIndex = 1;\r\n node.appendChild(cNode);\r\n node.appendChild(dockLight.node());\r\n x0 = bRect.x; y0 = bRect.y;\r\n \r\n //Event Handlers\r\n function move({x, y}) {\r\n cNode.style.left = `${x - x0}px`;\r\n cNode.style.top = `${y - y0}px`;\r\n let moveTarget, moveRegion;\r\n for (let i = 0; i < nChildren; i++) {\r\n moveRegion = dockLight.findPointedRegion(x, y, node.children[i]);\r\n if (moveRegion !== 'o') {\r\n moveTarget = node.children[i];\r\n break;\r\n }\r\n }\r\n if (!moveTarget) {return;}\r\n target = moveTarget; region = moveRegion;\r\n if (target.classList.contains('ew-resize')) {\r\n target = target.nextSibling; region = 'w';\r\n }\r\n if (region === 'w');\r\n else if (region === 'e' || target.classList.contains('ew-resize')) {\r\n if (target.nextSibling !== cNode) {\r\n target = target.nextSibling.nextSibling; region = 'w';\r\n }\r\n }\r\n else {\r\n let containerElem = target;\r\n for (let i = 0, n = containerElem.children.length; i < n; i++) {\r\n target = containerElem.children[i];\r\n region = dockLight.findPointedRegion(x, y, target);\r\n if (region !== 'o') {break;}\r\n }\r\n if (target.classList.contains('ns-resize')) {\r\n target = target.nextSibling; region = 'n';\r\n }\r\n if (region === 'e' || region === 'w') {region = 'c';}\r\n if (region === 's') {\r\n if (target.nextSibling) {\r\n target = target.nextSibling.nextSibling; region = 'n';\r\n }\r\n }\r\n }\r\n dockLight.changeTarget(target);\r\n dockLight.lightTarget(region);\r\n }\r\n function stop() {\r\n cNode.remove(); dockLight.remove();\r\n window.removeEventListener('mousemove', move);\r\n window.removeEventListener('mouseup', stop);\r\n if (caller === target && region === 'c') {resolve(true);}\r\n else {endDocking(); resolve(false);}\r\n }\r\n function endDocking() {\r\n if (region === 'w' || region === 'e') {\r\n cNode.classList.remove('undocked');\r\n cNode.style.left = cNode.style.right = cNode.style.zIndex = '';\r\n container.onCallParent(respondChild);\r\n let resizer = appendNewElement(null, 'div', 'ew-resize');\r\n if (region === 'w') {\r\n let id = Array.prototype.indexOf.call(node.children, target);\r\n containerList.splice(id / 2, 0, container);\r\n node.insertBefore(resizer, node.children[id]);\r\n node.insertBefore(cNode, resizer);\r\n }\r\n else {\r\n containerList.push(container);\r\n node.appendChild(resizer);\r\n node.appendChild(cNode);\r\n }\r\n fitPanels();\r\n }\r\n else {\r\n container = containerList.find(c => c.node().contains(target));\r\n if (region === 'c') {container.addPanelsToHolder(target, panel);}\r\n else {\r\n let id = Array.prototype.indexOf.call(container.node().children, target);\r\n id = region === 's' ? id / 2 + 1 : id / 2;\r\n container.insertHolderAt(id, panel);\r\n }\r\n }\r\n }\r\n window.addEventListener('mousemove', move);\r\n window.addEventListener('mouseup', stop);\r\n });}\r\n function respondChild(message, details) {\r\n if (message === 'empty') {\r\n let id = containerList.findIndex((holder) => holder.node() === details.caller);\r\n let container = containerList[id];\r\n if (!container) {return;}\r\n let resizer = node.children[id === 0 ? 1 : 2 * id - 1];\r\n if (resizer) {resizer.remove();}\r\n containerList.splice(id, 1)[0];\r\n container.node().remove();\r\n fitPanels();\r\n return Promise.resolve(null);\r\n }\r\n if (message === 'undock') {\r\n return prepareDocking(details);\r\n }\r\n else {return Promise.reject(new Error('Message to parent invalid'));}\r\n }\r\n\r\n //Initialize Object\r\n (function () {\r\n if (panels.length) {addPanels(...panels);}\r\n node.addEventListener('mousedown', handleResize);\r\n })();\r\n}", "title": "" }, { "docid": "35d844ef074d662ead791f4ec32ca66f", "score": "0.52391624", "text": "function resize() {\n if (parseInt(d3.select(\"#graph\").style(\"height\")) < 200) {\n my.brushHeight(0);\n }\n else if (parseInt(d3.select(\"#graph\").style(\"height\")) < 400) {\n my.brushHeight(30);\n }\n else {\n my.brushHeight(50);\n }\n\n // On redefinit les tailles\n var width = parseInt(d3.select(\"#graph\").style(\"width\")) - my.margin() * 2,\n height = parseInt(d3.select(\"#graph\").style(\"height\")) - my.brushHeight() - options.brush.marginTop - my.margin() * 2;\n\n // Modification de la hauteur et de la largeur\n my.resize(height, width);\n\n // Redessine le graphe de maniere reponsive\n my.redraw();\n }", "title": "" }, { "docid": "48179035fc06d3353b21ab8f254a1809", "score": "0.52189744", "text": "function setup(){\r\n\t//ganti disini !\r\n\tpanjang \t= \t12; //\t\t<-- 25 > panjang > 4\r\n\ttinggi \t\t= \t24; //\t\t<-- 50 > tinggi > 8\r\n\tratioBoard \t= 15 * 1.5;\r\n\r\n\t//jangan diganti !\r\n\ttile = Array(panjang * tinggi).fill(0)\r\n\tfreedom = Array(panjang * tinggi).fill(0)\r\n\tif(panjang > 25){panjang=25}\r\n\tif(panjang < 4){panjang=4}\r\n\tif(tinggi > 50){tinggi=50}\r\n\tif(tinggi < 8){tinggi=8}\r\n\tcreateCanvas(panjang * ratioBoard,tinggi * ratioBoard)\r\n}", "title": "" }, { "docid": "97f78cee98f3b2552baac5cb31e1d7e9", "score": "0.52129924", "text": "function gridChange() {\n if (pathLength - 10 > 0){ //Level 11\n cols = 5;\n rows = 5;\n }else if (pathLength - 7 > 0){ //Level 8\n cols = 4;\n rows = 4; \n }else if (pathLength - 4 > 0){ //Level 5\n cols = 3;\n rows = 3; \n }else if (pathLength - 1 > 0){ //Level 2\n cols = 2;\n rows = 2; \n } else { //Level 1\n cols = 1;\n rows = 1;\n }\n}", "title": "" }, { "docid": "9a57da14e3fba376ad59f4e03c603d97", "score": "0.52128565", "text": "function updateMosaicNav()\n{\n updateBaseImageDiv(navMinimizeFlags[0]);\n updateTileImagesDiv(navMinimizeFlags[1]);\n updateSettingsDiv(navMinimizeFlags[2]);\n\n // ------ nav base image thumb update \n var sc = Math.min(window.innerWidth * 0.00013, window.innerHeight * 0.00013);\n sizeFontAndBtns(sc);\n}", "title": "" }, { "docid": "042217bac1898310ec054e7877fc3e8c", "score": "0.5212656", "text": "function resizeElements(){\n\t$('#settingsContainer').css({\"top\":$(\"#graphTitle\").height()+10+\"px\"});\n\t$('#commentTextContainer').css({\"top\":$(\"#graphTitle\").height()+10+\"px\"});\n}", "title": "" }, { "docid": "5a2cd96c838c5930043aad1c5fd33dd6", "score": "0.52118313", "text": "function resizeCanvas(){\n canvasSize = Math.min(window.innerWidth, window.innerHeight) - offset;\n leinwand.width = canvasSize;\n leinwand.height = canvasSize;square\n tileSize = canvasSize/8;\n //draw();\n}", "title": "" }, { "docid": "b97fc392b780e02c712d3f7ba192b9f4", "score": "0.5210759", "text": "function minimizeWindow()\n{\n var panelID = $(this).parents(\".panel\").attr(\"id\");\n deselectNodeSideBarByPanel(panelID);\n createNewIcon(panelID);\n checkLimits(isSideBarActive());\n centerLine(panelID, true);\n $(\"#\"+ panelID).hide();\n}", "title": "" }, { "docid": "c44bccec1e8a68953f4c43bbfbaa8a86", "score": "0.5208776", "text": "function SetPanel(){\n\n\n YAHOO.module.container.panel1 = new YAHOO.widget.Panel('panel1', {\n constraintoviewport:true,\n close: false,\n autofillheight: \"body\", // default value, specified here to highlight its use in the example\n width: '500px',\n height: '500px',\n xy: [100, 100]\n });\n\n YAHOO.module.container.panel1.setHeader(\"<div class='tl'></div><span>Panel Name</span><div class='tr'></div>\");\n YAHOO.module.container.panel1.setBody('<div id=\"layout\"> '+\n '' +\n '</div>');\n YAHOO.module.container.panel1.setFooter(\"<span>End of Panel </span>\");\n}", "title": "" }, { "docid": "ebe8294c41e8e3f11b7368ed5dbb8726", "score": "0.5206132", "text": "initPanels() {\n this.panels.defaults.minimizeTo = false;\n this.panels.defaults.onminimized = function(container) {\n window.client.react.taskbar.pushTask(this);\n window.client.focus();\n };\n \n this.panels.defaults.onclosed = function(container) {\n ReactDOM.unmountComponentAtNode(container.content);\n window.client.delSpawn(this.id);\n window.client.focus();\n };\n \n this.panels.defaults.dragit.start = function() {\n window.client.input.saveCursor();\n };\n \n this.panels.defaults.resizeit.start = function() {\n window.client.input.saveCursor();\n };\n \n this.panels.defaults.dragit.stop = function() {\n window.client.focus();\n window.client.input.resetCursor();\n };\n \n this.panels.defaults.resizeit.stop = function() {\n window.client.focus();\n window.client.input.resetCursor();\n };\n }", "title": "" }, { "docid": "c567edc523ad6d33361c44e350a0e701", "score": "0.51946986", "text": "function resize() {\n\n // Layout variables\n width = d3Container.node().getBoundingClientRect().width - margin.left - margin.right,\n nodes = tree.nodes(json),\n links = tree.links(nodes);\n\n // Layout\n // -------------------------\n\n // Main svg width\n container.attr(\"width\", width + margin.left + margin.right);\n\n // Width of appended group\n svg.attr(\"width\", width + margin.left + margin.right);\n\n\n // Tree size\n tree.size([height, width - 180]);\n\n\n // Chart elements\n // -------------------------\n\n // Link paths\n svg.selectAll(\".d3-tree-link\").attr(\"d\", diagonal)\n\n // Node paths\n svg.selectAll(\".d3-tree-node\").attr(\"transform\", function(d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; });\n }", "title": "" }, { "docid": "a34db8666bb0f3a846676cccbfdcf928", "score": "0.5191646", "text": "function LaneResizingTool() {\n go.ResizingTool.call(this);\n }", "title": "" }, { "docid": "44db33aa85fae305712a2e67a7aefcd8", "score": "0.5191366", "text": "function setScreenClass(){\n\t\n\tif (window.innerWidth) {\n\t\t// good browsers\n\t\tmySize.width = window.innerWidth;\n\t\tmySize.height = window.innerHeight;\n\t} else if (document.body.offsetWidth){\n\t\t// IE\n\t\tmySize.width = document.body.offsetWidth;\n\t\tmySize.height = document.body.offsetHeight;\n\t};\n\t\n\t$j('#squaremile').css({\n\t\twidth: mySize.width+\"px\",\n\t\theight: mySize.height+\"px\",\n\t\ttop: '0px',\n\t\tleft: '0px'\n\t});\n\t \n\t// if the lightbox is showing, then resize the content\n\tsizeLB();\n\t\n\t// set cpanel location\n\t$j('#cpanel').css({\n\t\tleft: mySize.cpanelx+\"px\",\n\t\ttop: mySize.cpanely+\"px\"\n\t});\n\t\n\t// figure out how many rows and cols to draw at once \n\tmySize.oneFoot = (mySize.scale * 12);\n\t\n\t// see if we need to remove any foot divs\n\tif( mySize.numCols){\n\t\tmySize.oldCols = mySize.numCols;\n\t\tmySize.oldRows = mySize.numRows;\n\t};\n\t\n\tmySize.numCols = Math.ceil(mySize.width / (mySize.oneFoot * mySize.mag) ) + 3; // number of columns to draw at once\n mySize.numRows = Math.ceil(mySize.height / (mySize.oneFoot * mySize.mag) ) + 3; // number of rows to draw at once\n\t\n\tmySize.numCols += (mySize.numCols % 2);\n\tmySize.numRows += (mySize.numRows % 2);\n\t\n\tmySize.totalWidth = mySize.numCols * mySize.oneFoot * mySize.mag;\n\tmySize.totalHeight = mySize.numRows * mySize.oneFoot * mySize.mag;\n\t\n\tbuildScreen();\n}", "title": "" }, { "docid": "2f752e02584505d4512b12625a656a02", "score": "0.51911026", "text": "function resizeBigField() {\n if (window.innerWidth >= 500 && fieldSize >= 6) {\n contentArea.style.transform = 'translate(-50%, -50%) scale(0.6)';\n } else if (window.innerWidth < 500 && fieldSize >= 6 ) {\n contentArea.style.transform = 'translate(-50%, -50%) scale(0.38)';\n } else if (fieldSize < 6) {\n contentArea.style.transform = \"\";\n } \n}", "title": "" }, { "docid": "3635ea4cbf16c55359b75ada4c417530", "score": "0.51856476", "text": "function side_panel() {\n\t\n spacing();\n habitat();\n spacing();\n legend();\n spacing();\n trend();\n}", "title": "" }, { "docid": "a38dcaa2b24ff70ebf96e80bc84521a4", "score": "0.51847273", "text": "function resizeHats() {\n hats.forEach(hat => {\n hat.resize();\n })\n }", "title": "" }, { "docid": "39f77b28deeb021a691c1ee0b984be53", "score": "0.5174421", "text": "function resize_for_story() {\n if (d3.select('#left').empty()) {\n append_divs();\n }\n d3.select('#left').style('width', '30%');\n d3.select('#right').style('width', '58%');\n}", "title": "" }, { "docid": "39f77b28deeb021a691c1ee0b984be53", "score": "0.5174421", "text": "function resize_for_story() {\n if (d3.select('#left').empty()) {\n append_divs();\n }\n d3.select('#left').style('width', '30%');\n d3.select('#right').style('width', '58%');\n}", "title": "" }, { "docid": "e018bdee23b7a0c4ad97ed9c3fb766ac", "score": "0.51737833", "text": "function resize() {\n var ps = highed.dom.size(parent),\n cs = highed.dom.size(container);\n\n if (responsive && ps.h < 50 && ps.h !== 0 && ps.h) {\n highed.dom.style(compactIndicator, {\n display: 'block'\n });\n highed.dom.style(container, {\n display: 'none'\n });\n } else if (responsive) {\n highed.dom.style(compactIndicator, {\n display: 'none'\n });\n highed.dom.style(container, {\n display: ''\n });\n }\n\n // highed.dom.style(container, {\n // //height: ps.height + 'px'\n // height: '100%'\n // });\n }", "title": "" }, { "docid": "8a5cde128cd5d038be6777dc414b774e", "score": "0.5172105", "text": "updateWidthHeight() {\n const newWidth = this.container.current.clientWidth;\n // This is due to a stupid bug which I will fix SoonTM\n const newHeight = this.container.current.clientHeight - 5;\n // keep julia pin in correct location\n this.juliaPin.move(\n this.juliaPin.x + (newWidth - this.width) / 2,\n this.juliaPin.y + (newHeight - this.height) / 2,\n );\n this.width = newWidth;\n this.height = newHeight;\n this.renderer.width = this.width;\n this.renderer.height = this.height;\n }", "title": "" }, { "docid": "63a39687da1672d10b69b18884e85c1f", "score": "0.5166661", "text": "function setSouthSize(pp){\r\n\t\t\tif (pp.length == 0) return;\r\n\t\t\tpp.panel('resize', {\r\n\t\t\t\twidth: cc.width(),\r\n\t\t\t\theight: pp.panel('options').height,\r\n\t\t\t\tleft: 0,\r\n\t\t\t\ttop: cc.height() - pp.panel('options').height\r\n\t\t\t});\r\n\t\t\tcpos.height -= pp.panel('options').height;\r\n\t\t}", "title": "" }, { "docid": "e4c7db377e52091b6f716b57df4ed35c", "score": "0.51654404", "text": "function resizeMap() {\n var targetWidth = svgmap.node().parentNode.offsetWidth;\n svgmap.attr(\"width\", targetWidth);\n svgmap.attr(\"height\", targetWidth / aspect);\n }", "title": "" }, { "docid": "4e2cc8601bb490bd11a7fc37bf53cded", "score": "0.5157335", "text": "function create_drone_pane()\n\t{\n\t\tvar display;\n\n\t\t// Shadow + glowing background\n\t\tPanes.drone = new Entity()\n\t\t\t.add(\n\t\t\t\tnew Sprite()\n\t\t\t\t\t.setXY( Coordinates.drone.pane.x, Coordinates.drone.pane.y )\n\t\t\t)\n\t\t\t.addChild(\n\t\t\t\tnew Entity( 'shadow' )\n\t\t\t\t\t.add(\n\t\t\t\t\t\tnew Sprite( Graphics.DRONE_PANE_SHADOW )\n\t\t\t\t\t),\n\t\t\t\tnew Entity( 'glow' )\n\t\t\t\t\t.add(\n\t\t\t\t\t\tnew Sprite( Graphics.DRONE_PANE_GLOW )\n\t\t\t\t\t\t\t.setXY( 0, -14 )\n\t\t\t\t\t)\n\t\t\t\t\t.add(\n\t\t\t\t\t\tnew Flicker()\n\t\t\t\t\t\t\t.setAlphaRange( 0.1, 0.8 )\n\t\t\t\t\t\t\t.oscillate( 1.5 )\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t// Stat meters\n\t\tfor ( var meter in Coordinates.drone.meters )\n\t\t{\n\t\t\tdisplay = Coordinates.drone.meters[meter];\n\n\t\t\tPanes.drone\n\t\t\t\t.addChild(\n\t\t\t\t\tnew Entity( meter )\n\t\t\t\t\t\t.add(\n\t\t\t\t\t\t\tnew FillSprite( display.color, display.width, display.height )\n\t\t\t\t\t\t\t\t.setXY( display.x, display.y )\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\n\t\t// System indicator icons\n\t\tfor ( var indicator in Coordinates.drone.system ) {\n\t\t\tdisplay = Coordinates.drone.system[indicator];\n\n\t\t\tPanes.drone\n\t\t\t\t.addChild(\n\t\t\t\t\tnew Entity()\n\t\t\t\t\t\t.add(\n\t\t\t\t\t\t\tnew Sprite()\n\t\t\t\t\t\t\t\t.setXY( display.x, display.y )\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\n\t\t// Glass pane cover\n\t\tPanes.drone\n\t\t\t.addChild(\n\t\t\t\tnew Entity( 'pane' )\n\t\t\t\t\t.add(\n\t\t\t\t\t\tnew Sprite( Graphics.DRONE_PANE )\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t// Health meter\n\t\tElements.health = new Entity()\n\t\t\t.add(\n\t\t\t\tnew Sprite()\n\t\t\t\t\t.setXY( 20, 68 )\n\t\t\t)\n\t\t\t.addToParent( Panes.drone );\n\n\t\tfor ( var i = 0 ; i < 28 ; i++ ) {\n\t\t\tElements.health\n\t\t\t\t.addChild(\n\t\t\t\t\tnew Entity()\n\t\t\t\t\t\t.add(\n\t\t\t\t\t\t\tnew Sprite( Graphics.DRONE_HEALTH )\n\t\t\t\t\t\t\t\t.setXY( i * 20, 0 )\n\t\t\t\t\t\t\t\t.centerOrigin()\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\n\t\tElements.panes.drone.shadow = Panes.drone.$( 'shadow' ).get( Sprite );\n\t\tElements.panes.drone.pane = Panes.drone.$( 'pane' ).get( Sprite );\n\n\t\t// Set charge meter to invisible by default\n\t\tPanes.drone.$( 'charge' ).get( FillSprite ).setAlpha( 0 );\n\t}", "title": "" }, { "docid": "61e0ba60736232deb9da2a117c93123f", "score": "0.51504576", "text": "_adjustSize() {\n if (this.options.resize) {\n let player = this.ndjp.player\n let parent = this.ndjp.player.parentElement\n if (player.clientHeight > parent.clientHeight) {\n let ratioW = this.ndjp.canvas.height / this.ndjp.canvas.width;\n let ratioH = 1 / ratioW;\n this.ndjp.canvas.height = parent.clientHeight - (this.options.controls ? player.querySelector(\".controls\").clientHeight : 0);\n this.ndjp.canvas.width = parent.clientWidth * (ratioW < 1 ? ratioW : ratioH);\n }\n }\n }", "title": "" }, { "docid": "61e0ba60736232deb9da2a117c93123f", "score": "0.51504576", "text": "_adjustSize() {\n if (this.options.resize) {\n let player = this.ndjp.player\n let parent = this.ndjp.player.parentElement\n if (player.clientHeight > parent.clientHeight) {\n let ratioW = this.ndjp.canvas.height / this.ndjp.canvas.width;\n let ratioH = 1 / ratioW;\n this.ndjp.canvas.height = parent.clientHeight - (this.options.controls ? player.querySelector(\".controls\").clientHeight : 0);\n this.ndjp.canvas.width = parent.clientWidth * (ratioW < 1 ? ratioW : ratioH);\n }\n }\n }", "title": "" }, { "docid": "0fff99a61509d065c847c498f034fd35", "score": "0.5150012", "text": "function sizePanes() {\n\tvar leftHeight = $(\"#left-pane\").height();\n\tvar rightHeight = $(\"#easel\").height();\n\t\n\tif (rightHeight > leftHeight) {\n\t\t$(\"#left-pane\").height(rightHeight);\n\t} else if (leftHeight > rightHeight) {\n\t\t$(\"#easel\").height(leftHeight);\n\t}\n}", "title": "" }, { "docid": "e201a7fa679b885b66c6e3df01fc15f5", "score": "0.5147761", "text": "function resizeOLGA()\n{\n var w = window.innerWidth\n || document.documentElement.clientWidth\n || document.body.clientWidth;\n\n var h = window.innerHeight\n || document.documentElement.clientHeight\n || document.body.clientHeight;\n\n var scale_ratio = BOARD_RATIO/100;\n // if portrait\n if(h > w)\n {\n //defined board ratio *\n OLGA_MAIN.board_div.style.width = BOARD_RATIO +'%';\n OLGA_MAIN.board.resize();\n $(OLGA_MAIN.alpha_id).css(\"font-size\", (OLGA_MAIN.alpha_width * scale_ratio));\n $(OLGA_MAIN.numeric_id).css(\"font-size\", (OLGA_MAIN.numeric_width * scale_ratio));\n }\n else // if landscape\n {\n var ratio = h/w;\n var width_r = BOARD_RATIO * ratio;\n OLGA_MAIN.board_div.style.width = (OLGA_MAIN.board_css_ratio * BOARD_RATIO) +'%';\n OLGA_MAIN.board.resize();\n $(OLGA_MAIN.alpha_id).css(\"font-size\", (OLGA_MAIN.alpha_width * scale_ratio));\n $(OLGA_MAIN.numeric_id).css(\"font-size\", (OLGA_MAIN.numeric_width * scale_ratio));\n }\n\n setLightColor(OLGA_MAIN.lightColor);\n setDarkColor(OLGA_MAIN.darkColor);\n}", "title": "" }, { "docid": "c72e691b1f6f98028bffb13a639fa0e1", "score": "0.51451814", "text": "function matrixLinkResize(){\n\t\tmainSvg.attr(\"width\", width)\n\t\t .attr(\"height\", height);\n\t\n\t\tmainRect.attr(\"width\", width)\n .attr(\"height\", height);\n\t}", "title": "" }, { "docid": "c96864bf33d5a50b92e70a266424e25c", "score": "0.51445425", "text": "function setElementsSize_hor() {\n\n // get strip height\n var stripHeight = g_objStrip.getHeight();\n var panelWidth = g_temp.panelWidth;\n\n // set buttons height\n if (g_objButtonNext) {\n g_objButtonPrev.height(stripHeight);\n g_objButtonNext.height(stripHeight);\n\n // arrange buttons tip\n var prevTip = g_objButtonPrev.children(\".ug-strip-arrow-tip\");\n g_functions.placeElement(prevTip, \"center\", \"middle\");\n\n var nextTip = g_objButtonNext.children(\".ug-strip-arrow-tip\");\n g_functions.placeElement(nextTip, \"center\", \"middle\");\n }\n\n // set panel height\n var panelHeight = stripHeight + g_options.strippanel_padding_top\n + g_options.strippanel_padding_bottom;\n\n // set panel size\n g_objPanel.width(panelWidth);\n g_objPanel.height(panelHeight);\n\n g_temp.panelHeight = panelHeight;\n\n // set strip size\n var stripWidth = panelWidth - g_options.strippanel_padding_left\n - g_options.strippanel_padding_right;\n\n if (g_objButtonNext) {\n var buttonWidth = g_objButtonNext.outerWidth();\n stripWidth = stripWidth - buttonWidth * 2\n - g_options.strippanel_padding_buttons * 2;\n }\n\n g_objStrip.resize(stripWidth);\n }", "title": "" }, { "docid": "286a545cd9d1f2cf7f0e90b0ec3baa34", "score": "0.51444626", "text": "function minimap(){\n var W = 20; //TODO Abstract\n for (var i=max(Character.y-20,0);i<min(Character.y+20, size);i++){\n for (var j=max(Character.x-20,0);j<min(Character.x+20, size);j++){\n writeTileGeneric(j-screenX+220, i-screenY+300, 2, map[j][i], seen[j][i], true, true);\n }\n }\n\n for (i in monsters){\n if (Character.revealm){\n writeTileGeneric(monsters[i].x-screenX+220, monsters[i].y-screenY+300, 2, \"j\", true, true);\n }\n }\n\n for (i in items){\n if (Character.reveali){\n try { \n writeTileGeneric(items[i].x-screenX+220, items[i].y-screenY+300, 2, \"?\", true, true);\n } catch(e) {\n debugger;\n }\n }\n }\n wTile(7*W+Character.x - screenX,6*W+ Character.y - screenY, \"ff\", \"ff\", \"ff\", 2);\n\n if (keys[27]){\n showMap = false;\n }\n }", "title": "" }, { "docid": "11179e43dd112ac560f074f2283a0195", "score": "0.51416713", "text": "function updateLeftPanel_fix( sels , oppos ) {\n pr(\"updateLeftPanel() corrected version** \")\n var namesDIV=''\n var alterNodesDIV=''\n var informationDIV=''\n\n // var alternodesname=getNodeLabels(opos)\n\n namesDIV+='<div id=\"selectionsBox\"><h4>';\n namesDIV+= getNodeLabels( sels ).join(' <b>/</b> ')//aqui limitar\n namesDIV += '</h4></div>';\n\n if(oppos.length>0) {\n\t alterNodesDIV+='<div id=\"opossitesBox\">';//tagcloud\n\t alterNodesDIV+= htmlfied_alternodes( oppos ).join(\"\\n\") \n\t alterNodesDIV+= '</div>';\n\t}\n\n sameNodesDIV = \"\";\n sameNodesDIV+='<div id=\"sameNodes\"><ul style=\"list-style: none;\">';//tagcloud\n sameNodesDIV += htmlfied_samenodes( getNodeIDs(sels) ).join(\"\\n\") ;\n sameNodesDIV+= '</ul></div>';\n\n // getTopPapers(\"semantic\");\n\n informationDIV += '<br><h4>Information:</h4><ul>';\n informationDIV += htmlfied_nodesatts( getNodeIDs(sels) ).join(\"<br>\\n\")\n informationDIV += '</ul><br>';\n\n //using the readmore.js\n // ive put a limit for nodes-name div\n // and opposite-nodes div aka tagcloud div\n // and im commenting now because github is not \n // pushing my commit\n // because i need more lines, idk\n $(\"#names\").html(namesDIV).readmore({maxHeight:100}); \n $(\"#tab-container\").show();\n $(\"#opossiteNodes\").html(alterNodesDIV).readmore({maxHeight:200}); \n $(\"#sameNodes\").html(sameNodesDIV).readmore({maxHeight:200}); \n $(\"#information\").html(informationDIV);\n $(\"#tips\").html(\"\");\n\n if(categoriesIndex.length==1) getTopPapers(\"semantic\");\n else getTopPapers(swclickActual); \n}", "title": "" }, { "docid": "2b6d6a27a3fc477e76fd8264e846b256", "score": "0.5141609", "text": "function smallerGrid()\n{\n if (GRID_TIGHTNESS == 1)\n return;\n GRID_TIGHTNESS /= 2;\n updateGridDisplay();\n}", "title": "" }, { "docid": "a13e0064ce5b65e9c9f0c525703d7761", "score": "0.5141331", "text": "function positionPanels() {\n $('body').css({\n\theight: $(window).height() + \"px\"\n });\n\n $('html').css({\n\theight: $(window).height() + \"px\"\n });\n \n $('div.panel').each(function(index) {\n\t$(this).css({\n\t height: $(window).height() + \"px\", \n\t top: $(window).height() * index + \"px\"\n\t});\n });\n \n $('#slider-gallery').css({\n\twidth: $(window).width() + \"px\",\n\theight: $(window).height() + \"px\"\n });\n \n $('#slider-gallery ul').css({\n\twidth: $(window).width() * $('#slider-gallery ul li').size() + \"px\" \n }); \n \n $('#slider-gallery li').each(function() {\n\t$(this).css({\n\t width: $(window).width() + \"px\",\n\t height: $(window).height() + \"px\"\n\t}); \n });\n \n browserHeight = $(window).height();\n \n // position social media icons\n var sidebarOffset = ($(window).width() - 1202) / 2;\n $('div.nav-social-media').css(\"left\", sidebarOffset);\n}", "title": "" }, { "docid": "01caa2fb7bb2626bd25d47adb33cd878", "score": "0.51395124", "text": "function mainPanelOff() {\n (Settings.niceView) ? mainPanel1.setAttributeNS(null, \"fill\", \"#000\") : mainPanel0.setAttributeNS(null, \"fill\", \"#000\");\n}", "title": "" }, { "docid": "883c610812543b5ac0a6b993e99389be", "score": "0.5138211", "text": "function addAllPlateformesLevel1() {\n\tinitElevateur();\n\tinitPlateforme();\n\taddElevateur(1000-195, canvas.height - sol.height, 1000-195, 200);//position de la plateforme (ligne ci-après) moins la largeur de l'image d'un élévateur\n\taddPlateforme(1000, 200);\n\taddElevateur(8900-195, canvas.height - sol.height, 8900-195, 200);\n\taddPlateforme(8900, 200);\n\tlancerElevateurs();\n}", "title": "" }, { "docid": "096bba9df9c2a44455ad52a5fa55ab0e", "score": "0.51288", "text": "function showpan() {\n BottomDisplayVar.panelRender(true);\n }", "title": "" }, { "docid": "0ec93ad34f08417a82571cf21cce82fa", "score": "0.512406", "text": "onBrickResize(activeBrickId, position) {\n var editorLeft = this.jqueryMap.$story.position().left;\n var editorTop = this.jqueryMap.$story.position().top;\n var editorWidth = this.jqueryMap.$story.width();\n var editorHeight = this.jqueryMap.$story.height();\n\n var self = this;\n //Constrain the component inside the container\n if(position.left < 0){\n position.left = 0;\n }\n if(position.top < 0){\n position.top = 0;\n }\n\n if( position.left + position.width > editorWidth ){\n position.left = editorWidth - position.width;\n }\n\n if(position.top + position.height > editorHeight){\n position.top = editorHeight - position.height;\n }\n\n if(position.left >= editorWidth ){\n position.left = 0;\n //position.width = 1;\n }\n\n if(position.top >= editorHeight){\n position.top = 0;\n //position.height = 1;\n }\n\n var record = Collections.BrickCollections.find({ id: activeBrickId }, this.props.treeName).getValue();\n if(!record){\n return;\n }\n\n //Page cannot change width & height\n if (this.state.activeBrickType == \"Page\") {\n position.width = record.offset.width;\n position.height = record.offset.height;\n }\n\n //delte parents' offset\n var ids = activeBrickId.split(\"/\");\n var lastBrickId = \"\";\n if (ids.length > 1) {\n ids.map(function(id, i){\n if (i == ids.length-1) {\n return;\n }\n var brickId = i==0?id: lastBrickId+\"/\"+id;\n lastBrickId = brickId;\n var parent = Collections.BrickCollections.find({ id: lastBrickId }, self.props.treeName).getValue();\n var offset = parent.offset;\n position.top -= offset.top;\n position.left -= offset.left;\n })\n position.top -= 64;\n }\n\n _.merge(record, { offset: position });\n\n this.setState({\n activeBrickId: activeBrickId,\n activeBrickPosition: position,\n settingChangeName: null,\n settingChangeValue: null,\n activeTransitionId: null\n });\n }", "title": "" }, { "docid": "5d274257682ee2d88f3a07b0b40ce75b", "score": "0.5119238", "text": "function Panel() {}", "title": "" }, { "docid": "0f38e86023fc492c4a57116a3ec8fe8a", "score": "0.51155645", "text": "function ciniki_membersonly_pages() {\n //\n // Panels\n //\n this.init = function() {\n //\n // events panel\n //\n this.menu = new M.panel('Members Only',\n 'ciniki_membersonly_pages', 'menu',\n 'mc', 'medium', 'sectioned', 'ciniki.membersonly.main.menu');\n this.menu.sections = {\n 'pages':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'addTxt':'Add a page',\n 'addFn':'M.ciniki_membersonly_pages.pageEdit(\\'M.ciniki_membersonly_pages.showMenu();\\',0,0);',\n },\n };\n this.menu.sectionData = function(s) { return this.data[s]; }\n this.menu.cellValue = function(s, i, j, d) { \n return d.page.title;\n };\n this.menu.rowFn = function(s, i, d) { \n return 'M.ciniki_membersonly_pages.pageEdit(\\'M.ciniki_membersonly_pages.showMenu();\\',\\'' + d.page.id + '\\',0);';\n };\n this.menu.addClose('Back');\n }\n\n\n this.createEditPanel = function(cb, pid, parent_id, rsp) {\n var pn = 'edit_' + pid;\n //\n // Check if panel already exists, and reset for use\n //\n if( this.pn == null ) {\n //\n // The panel to display the edit form\n //\n this[pn] = new M.panel('Page',\n 'ciniki_membersonly_pages', pn,\n 'mc', 'medium mediumaside', 'sectioned', 'ciniki.membersonly.pages.edit');\n this[pn].data = {}; \n this[pn].stackedData = [];\n this[pn].page_id = pid;\n this[pn].sections = {\n '_image':{'label':'', 'aside':'yes', 'type':'imageform', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', \n 'controls':'all', 'history':'no', \n 'addDropImage':function(iid) {\n M.ciniki_membersonly_pages[pn].setFieldValue('primary_image_id', iid, null, null);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':'M.ciniki_membersonly_pages.'+pn+'.deletePrimaryImage',\n },\n }},\n '_image_caption':{'label':'', 'aside':'yes', 'fields':{\n 'primary_image_caption':{'label':'Caption', 'type':'text'},\n // 'primary_image_url':{'label':'URL', 'type':'text'},\n }},\n 'details':{'label':'', 'aside':'yes', 'fields':{\n 'parent_id':{'label':'Parent Page', 'type':'select', 'options':{}},\n 'title':{'label':'Title', 'type':'text'},\n 'sequence':{'label':'Page Order', 'type':'text', 'size':'small'},\n }},\n '_synopsis':{'label':'Synopsis', 'fields':{\n 'synopsis':{'label':'', 'type':'textarea', 'size':'small', 'hidelabel':'yes'},\n }},\n '_content':{'label':'Content', 'fields':{\n 'content':{'label':'', 'type':'textarea', 'size':'large', 'hidelabel':'yes'},\n }},\n 'files':{'label':'Files', 'aside':'yes',\n 'type':'simplegrid', 'num_cols':1,\n 'headerValues':null,\n 'cellClasses':[''],\n 'addTxt':'Add File',\n 'addFn':'M.ciniki_membersonly_pages.'+pn+'.editComponent(\\'ciniki.membersonly.pagefiles\\',\\'M.ciniki_membersonly_pages.'+pn+'.updateFiles();\\',{\\'file_id\\':\\'0\\'});',\n },\n '_files':{'label':'', 'aside':'yes', 'fields':{\n '_flags_10':{'label':'Reverse Order', 'type':'flagtoggle', 'bit':0x1000, 'field':'flags', 'default':'off'},\n }},\n 'images':{'label':'Gallery', 'aside':'yes', 'type':'simplethumbs'},\n '_images':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'addTxt':'Add Image',\n 'addFn':'M.ciniki_membersonly_pages.'+pn+'.editComponent(\\'ciniki.membersonly.pageimages\\',\\'M.ciniki_membersonly_pages.'+pn+'.addDropImageRefresh();\\',{\\'add\\':\\'yes\\'});',\n },\n '_child_title':{'label':'Child Pages Heading', 'fields':{\n 'child_title':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n 'pages':{'label':'', 'type':'simplegrid', 'num_cols':1, \n 'seqDrop':function(e,from,to) {\n M.ciniki_membersonly_pages[pn].savePos();\n M.api.getJSONCb('ciniki.membersonly.pageUpdate', {'tnid':M.curTenantID, \n 'page_id':M.ciniki_membersonly_pages[pn].data.pages[from].page.id,\n 'parent_id':M.ciniki_membersonly_pages[pn].page_id,\n 'sequence':M.ciniki_membersonly_pages[pn].data.pages[to].page.sequence, \n }, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_membersonly_pages[pn].updateChildren();\n });\n },\n 'addTxt':'Add Child Page',\n 'addFn':'M.ciniki_membersonly_pages.'+pn+'.childEdit(0);',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_membersonly_pages.'+pn+'.savePage();'},\n 'delete':{'label':'Delete', 'fn':'M.ciniki_membersonly_pages.'+pn+'.deletePage();'},\n }},\n };\n this[pn].fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.membersonly.pageHistory', 'args':{'tnid':M.curTenantID,\n 'page_id':this.page_id, 'field':i}};\n };\n this[pn].sectionData = function(s) { \n return this.data[s];\n };\n this[pn].fieldValue = function(s, i, j, d) {\n return this.data[i];\n };\n this[pn].cellValue = function(s, i, j, d) {\n if( s == 'pages' ) {\n return d.page.title;\n } else if( s == 'files' ) {\n return d.file.name;\n }\n };\n this[pn].rowFn = function(s, i, d) {\n if( s == 'pages' ) {\n // return 'M.ciniki_membersonly_pages.pageEdit(\\'M.ciniki_membersonly_pages.updateChildren();\\',\\'' + d.page.id + '\\',0);';\n return 'M.ciniki_membersonly_pages.'+pn+'.childEdit(\\'' + d.page.id + '\\');';\n } else if( s == 'files' ) {\n return 'M.startApp(\\'ciniki.membersonly.pagefiles\\',null,\\'M.ciniki_membersonly_pages.'+pn+'.updateFiles();\\',\\'mc\\',{\\'file_id\\':\\'' + d.file.id + '\\'});';\n }\n };\n this[pn].thumbFn = function(s, i, d) {\n return 'M.startApp(\\'ciniki.membersonly.pageimages\\',null,\\'M.ciniki_membersonly_pages.'+pn+'.addDropImageRefresh();\\',\\'mc\\',{\\'page_id\\':M.ciniki_membersonly_pages.'+pn+'.page_id,\\'page_image_id\\':\\'' + d.image.id + '\\'});';\n };\n this[pn].deletePrimaryImage = function(fid) {\n this.setFieldValue(fid, 0, null, null);\n return true;\n };\n this[pn].addDropImage = function(iid) {\n if( this.page_id == 0 ) {\n var c = this.serializeForm('yes');\n var rsp = M.api.postJSON('ciniki.membersonly.pageAdd', \n {'tnid':M.curTenantID}, c);\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n this.page_id = rsp.id;\n }\n var rsp = M.api.getJSON('ciniki.membersonly.pageImageAdd', \n {'tnid':M.curTenantID, 'image_id':iid, 'page_id':this.page_id});\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n return true;\n };\n this[pn].addDropImageRefresh = function() {\n if( M.ciniki_membersonly_pages[pn].page_id > 0 ) {\n M.api.getJSONCb('ciniki.membersonly.pageGet', {'tnid':M.curTenantID, \n 'page_id':M.ciniki_membersonly_pages[pn].page_id, 'images':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_membersonly_pages[pn];\n p.data.images = rsp.page.images;\n p.refreshSection('images');\n p.show();\n });\n }\n return true;\n };\n this[pn].editComponent = function(a,cb,args) {\n if( this.page_id == 0 ) {\n var p = this;\n var c = this.serializeFormData('yes');\n M.api.postJSONFormData('ciniki.membersonly.pageAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.page_id = rsp.id;\n args['page_id'] = rsp.id;\n M.startApp(a,null,cb,'mc',args);\n });\n } else {\n args['page_id'] = this.page_id;\n M.startApp(a,null,cb,'mc',args);\n }\n };\n\n this[pn].updateFiles = function() {\n if( this.page_id > 0 ) {\n M.api.getJSONCb('ciniki.membersonly.pageGet', {'tnid':M.curTenantID, \n 'page_id':this.page_id, 'files':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_membersonly_pages[pn];\n p.data.files = rsp.page.files;\n p.refreshSection('files');\n p.show();\n });\n }\n return true;\n };\n\n this[pn].updateChildren = function() {\n if( this.page_id > 0 ) {\n M.api.getJSONCb('ciniki.membersonly.pageGet', {'tnid':M.curTenantID, \n 'page_id':this.page_id, 'children':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_membersonly_pages[pn];\n p.data.pages = rsp.page.pages;\n p.refreshSection('pages');\n p.show();\n });\n }\n return true;\n };\n\n this[pn].childEdit = function(cid) {\n if( this.page_id == 0 ) {\n var p = this;\n var c = this.serializeFormData('yes');\n M.api.postJSONFormData('ciniki.membersonly.pageAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.page_id = rsp.id;\n M.ciniki_membersonly_pages.pageEdit('M.ciniki_membersonly_pages.'+pn+'.updateChildren();',cid,p.page_id);\n });\n } else {\n M.ciniki_membersonly_pages.pageEdit('M.ciniki_membersonly_pages.'+pn+'.updateChildren();',cid,this.page_id);\n }\n };\n this[pn].addButton('save', 'Save', 'M.ciniki_membersonly_pages.'+pn+'.savePage();');\n this[pn].addClose('Cancel');\n this[pn].savePage = function() {\n var p = this;\n if( this.page_id > 0 ) {\n var c = this.serializeFormData('no');\n if( c != null ) {\n M.api.postJSONFormData('ciniki.membersonly.pageUpdate', \n {'tnid':M.curTenantID, 'page_id':this.page_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.close();\n });\n } else {\n this.close();\n }\n } else {\n var c = this.serializeFormData('yes');\n M.api.postJSONFormData('ciniki.membersonly.pageAdd', \n {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.close();\n });\n }\n };\n this[pn].deletePage = function() {\n var p = this;\n M.confirm('Are you sure you want to delete this page? All files and images will also be removed from this page.',null,function() {\n M.api.getJSONCb('ciniki.membersonly.pageDelete', {'tnid':M.curTenantID, 'page_id':p.page_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n p.close();\n });\n });\n };\n }\n\n// this[pn].sections.details.fields.parent_id.options = {'0':'None'};\n if( rsp.parentlist != null && rsp.parentlist.length > 0 ) {\n for(i in rsp.parentlist) {\n if( rsp.parentlist[i].page.id != this[pn].page_id ) {\n this[pn].sections.details.fields.parent_id.options[rsp.parentlist[i].page.id] = rsp.parentlist[i].page.title;\n }\n }\n }\n this[pn].data = rsp.page;\n this[pn].sections.details.fields.parent_id.active = 'yes';\n if( this[pn].page_id == 0 && parent_id != null ) {\n this[pn].data.parent_id = parent_id;\n if( parent_id == 0 ) {\n this[pn].data.title = 'Members Only';\n }\n }\n if( this[pn].data.parent_id == 0 ) {\n this[pn].sections.details.fields.parent_id.active = 'no';\n }\n this[pn].refresh();\n this[pn].show(cb);\n }\n\n //\n // Arguments:\n // aG - The arguments to be parsed into args\n //\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) { args = eval(aG); }\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_membersonly_pages', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n this.showMenu(cb);\n }\n\n this.showMenu = function(cb) {\n M.api.getJSONCb('ciniki.membersonly.pageList', {'tnid':M.curTenantID, \n 'parent_id':'0'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n if( rsp.pages.length == 0 ) {\n M.ciniki_membersonly_pages.pageEdit(cb, 0, 0);\n } else if( rsp.pages.length == 1 ) {\n M.ciniki_membersonly_pages.pageEdit(cb, rsp.pages[0].page.id, 0);\n } else {\n var p = M.ciniki_membersonly_pages.menu;\n p.data = rsp;\n p.refresh();\n p.show(cb);\n }\n });\n };\n\n this.pageEdit = function(cb, pid, parent_id) {\n M.api.getJSONCb('ciniki.membersonly.pageGet', {'tnid':M.curTenantID,\n 'page_id':pid, 'images':'yes', 'files':'yes', \n 'children':'yes', 'parentlist':'yes', 'parent_id':parent_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_membersonly_pages.createEditPanel(cb, pid, parent_id, rsp); \n });\n };\n\n\n}", "title": "" }, { "docid": "42c8b56c372b1560a1a0d2fda5de3cea", "score": "0.51150304", "text": "function initializeMinimap() {\n var minimap = $('#minimap');\n\n minimap.height($('#minimapContainer').height());\n\n var slider = minimap.find('.slider');\n slider.width($('#minimapContainer').width());\n\n minimap.find('.canvasContainer').html(\n $('<canvas/>', {'class': 'genomeCanvas', Width: minimap.width(), Height: minimap.height()})\n );\n\n var boundingBox = computeBoundingBox(0, 10000000, 1, true);\n getNodes(boundingBox, drawMinimap);\n zoom(-1, 1, 1);\n}", "title": "" }, { "docid": "f92e76a4a685194654c5e19aaf5df207", "score": "0.5111996", "text": "function draw_all_minicubes_extra() {\n\tdraw_all_minicubes0();\n\tdraw_all_minicubes1();\n\tdraw_all_minicubes2();\n}", "title": "" }, { "docid": "ff2a03b83f6a20db5fa3dcdde17d8149", "score": "0.5109774", "text": "function dungeonArea(){\n\tplayPanel.innerHTML = \" \"\n\tlet horizontalOffset = 0\n\tlet verticalOffset = 0\n\tlet charPosLeft = 0\n\tlet charPosTop = 0\n\tfor( x = 0; x< 135; x++){\n\t\tif(horizontalOffset <750){\n\t\t\tdungeonPanel.innerHTML += `<div style=\"position: absolute; width: 50px; height: 50px; padding-left:${horizontalOffset}px; padding-top: ${verticalOffset}px\"><img src=\"tile0000.png\"></div>`\n\t\t\thorizontalOffset +=50\n\t\t}else{\n\t\t\tverticalOffset += 50\n\t\t\thorizontalOffset = 0\n\t\t\tdungeonPanel.innerHTML += `<div style=\"position: absolute; width: 50px; height: 50px; padding-left:${horizontalOffset}px; padding-top: ${verticalOffset}px\"><img src=\"tile0000.png\"></div>`\n\t\t\thorizontalOffset +=50\n\t\t}\n\t}\n\n\tdungeonPanel.innerHTML += `<div id='me' style=\"position: absolute; width: 50px; height: 50px; padding-left:${charPosLeft}px; padding-top: ${charPosTop}px\"><img src=\"smiley.png\"></div>`\n}", "title": "" }, { "docid": "a8914a567a597536dd6af4d271cacfa8", "score": "0.51096356", "text": "function changeBoardSize(){\n level.board = generateBoard($(\"#sldRows\").val(), $(\"#sldCols\").val());\n displaySliderValues();\n addCanvas();\n}", "title": "" }, { "docid": "67985917d2ad12862ead715434a5fe51", "score": "0.51082945", "text": "ReSize() {\n var width = this.girdElement.width()\n var height = this.girdElement.height()\n var maxNumX = Math.floor(width / this.minX)\n var maxNumY = Math.floor(height / this.minY)\n if (this.items.length < maxNumX) maxNumX = this.items.length\n if (this.items.length < maxNumY) maxNumY = this.items.length\n var collectNx = Math.ceil(this.items.length / maxNumX)\n var collectNy = Math.ceil(this.items.length / maxNumY)\n\n var maxX = 0\n var maxY = 0\n for (var index = 0; index < this.items.length; index++) {\n var item = this.items[index]\n item.rankCX = Math.floor(item.xRank / collectNx)\n if (item.rankCX > maxX) maxX = item.rankCX\n item.rankCY = Math.floor(item.yRank / collectNy)\n if (item.rankCY > maxY) maxY = item.rankCY\n item.visible = false\n }\n\n var W = Math.floor(width / (maxX + 1))\n var H = Math.floor(height / (maxY + 1))\n this.eachW = Math.min(W, H)\n this.eachH = Math.min(W, H)\n this.columN = maxX + 1\n this.rowN = maxY + 1\n\n //console.log('width '+width)\n //console.log('items '+this.items.length)\n //console.log('colum '+this.columN)\n //console.log('row '+this.rowN)\n\n //Matrix\n this.girdMatrix = []\n for (var i = 0; i < this.rowN; i++) {\n this.girdMatrix[i] = []\n\n for (var k = 0; k < this.columN; k++) {\n this.girdMatrix[i][k] = \"0\";\n }\n }\n //Init visible\n\n for (var k = 0; k < this.eleItems.length; k++) {\n this.eleItems[k].visible = false\n }\n\n //put \n var count = 0\n for (var i = 0; i < this.items.length; i++) {\n var gx = this.items[i].rankCX\n var gy = this.items[i].rankCY\n\n if (this.girdMatrix[gy][gx] == \"0\") {\n this.girdMatrix[gy][gx] = this.items[i]\n this.items[i].MoveTo = [gx * this.eachW, (this.rowN - gy - 1) * this.eachH]\n this.items[i].visible = true\n } else {\n var [tx, ty] = this.FindClosetPos(gx, gy)\n if (tx != -1) {\n this.girdMatrix[ty][tx] = this.items[i]\n this.items[i].MoveTo = [tx * this.eachW, (this.rowN - ty - 1) * this.eachH]\n this.items[i].visible = true\n count++\n } else {\n this.items[i].visible = false\n break;\n }\n }\n }\n //console.log(count)\n\n //updata UI \n var o = {}\n for (var k = 0; k < this.eleItems.length; k++) {\n var item = this.eleItems[k]\n if (!item.visible) {\n //check exist\n var checkEle = $('#' + item.productID + \"_Item_LB\")\n if (typeof checkEle.html() != \"undefined\") {\n checkEle.remove()\n $('#' + item.productID + \"_Item_CB\").remove()\n }\n continue;\n }\n\n o['ID'] = item.productID\n\n //check exist\n var checkEle = $('#' + item.productID + \"_Item_LB\")\n if (typeof checkEle.html() == \"undefined\") {\n //add\n var s = FormatTemplate(this.temp, o)\n\n var add = $('#RSGird').append(s);\n\n //function\n\n var cb = $('#' + item.productID + \"_Item_CB\")\n var lb = $('#' + item.productID + \"_Item_LB\")\n cb.checkboxradio({\n icon: false\n }).on(\"change\", function(e) {\n var id = $(this).attr('productID')\n if ($(this).is(\":checked\")) {\n if (typeof selectList[id] == 'undefined') {\n selectList[id] = true\n } else {\n selectList[id] = true\n }\n } else {\n if (typeof selectList[id] == 'undefined') {\n //selectList[id]=false\n } else {\n //selectList[id]=false\n delete selectList[id]\n }\n }\n //console.log(selectList)\n $(document).trigger('sai_SelectChange');\n })\n if (typeof selectList[item.productID] != 'undefined') {\n cb.prop('checked', true);\n cb.checkboxradio('refresh')\n }\n\n lb.css(\"background\", \"rgb(255,255,255) url(\\\"\" + item.img + \"\\\") 50% 50% repeat-x\")\n .animate({ width: this.eachW, height: this.eachH, left: item.MoveTo[0], top: item.MoveTo[1] })\n\n } else {\n //move \n\n $('#' + item.productID + \"_Item_LB\").css(\"background\", \"rgb(255,255,255) url(\\\"\" + item.img + \"\\\") 50% 50% repeat-x\")\n .animate({ width: this.eachW, height: this.eachH, left: item.MoveTo[0], top: item.MoveTo[1] })\n }\n }\n }", "title": "" }, { "docid": "d38d84a11d8e89c54b75835fd20102a5", "score": "0.5104161", "text": "function showPusheen() {\n document.getElementById(\"outerpanel\").style.left = '0px';\n pushleft = 0;\n}", "title": "" }, { "docid": "3d430bf9a1e15ae18ee37da4732185df", "score": "0.51035905", "text": "function panelPopper(x = 10, y = 50, w = 200, h = 60, num = 1) {\n\n for (i = 0; i <= num; i++) {\n stPanel(x, y, w, h);\n x += w + 3.5;\n }\n //stPanel(100, 50, 200, 60);\n //stPanel(301, 50, 200, 60);\n //stPanel(502, 50, 50, 60);\n //stPanel(553, 50, 50, 60);\n}", "title": "" }, { "docid": "1fec97e1d3054b6d8316954c2665882c", "score": "0.5095966", "text": "function manualLayout() {\n for (j = 0; j < nodes.length; j++) {\n pickNode = d3.selectAll(\".node\")._groups[0][j];\n d = nodes[j];\n if (d.name === \"Animals\") {\n d3.select(pickNode).attr(\n \"transform\",\n \"translate(\" +\n (d.x = d.x) +\n \",\" +\n (d.y = Math.max(0, Math.min(height - d.dy))) +\n \")\"\n );\n }\n }\n\n sankey.relayout();\n link.attr(\"d\", path);\n }", "title": "" }, { "docid": "53b3301ceefdba9da76233049fb31281", "score": "0.50956756", "text": "function hidePusheen() {\n document.getElementById(\"outerpanel\").style.left = '-80%';\n pushleft = 1;\n}", "title": "" }, { "docid": "d188a8bc3908c6d48a92b0b5998615bb", "score": "0.509345", "text": "function updateVision() {\r\n /** set up the win style by the params */\r\n var sw = top._sw;\r\n /** if 800*600 use relate */\r\n if (typeof(sw)==\"undefined\") {\r\n sw = screen.availWidth;\r\n }\r\n\r\n if (sw<1000) {\r\n _params['relate'] = 0.97;\r\n }\r\n\tif(_params['maxsize']==true){\r\n _domPanel.style.width = document.body.clientWidth * 0.97;\r\n _domPanel.style.height = document.body.clientHeight * 0.97;\r\n _params['float']=\"lefttop\";\r\n\t}else if (_params['relate']!=null) {\r\n _domPanel.style.width = document.body.clientWidth * _params['relate'];\r\n _domPanel.style.height = document.body.clientHeight * _params['relate'];\r\n }else {\r\n /** 如果是大字体模式时有提供高与宽的都增加40*/\r\n if (\"B\"==_MY_SET['Style']) {\r\n if (_params['width']!=null) {\r\n _params['width'] = _params['width']*1+60;\r\n }\r\n if (_params['height']!=null) {\r\n _params['height'] = _params['height']*1+50;\r\n }\r\n }else {\r\n\r\n if (_params['width']!=null) {\r\n _params['width'] = _params['width']*1+20;\r\n }\r\n if (_params['height']!=null) {\r\n _params['height'] = _params['height']*1+30;\r\n }\r\n }\r\n\r\n if (_params['width']!=null) {\r\n _domPanel.style.width = _params['width'];\r\n }\r\n if (_params['height']!=null) {\r\n _domPanel.style.height = _params['height'];\r\n }\r\n }\r\n if (_params['center']!=null) {\r\n __center(_panelNode);\r\n }\r\n\t//设置在事件触发位置显示\r\n if (_params['eventPos']!=null) {\r\n var p = __getEventPos();\r\n _panelNode.style.top = p.y;\r\n _panelNode.style.left = p.x;\r\n }\r\n if (_params['float']==\"righttop\") {\r\n _panelNode.style.top = 2;\r\n _panelNode.style.left = document.body.clientWidth - _panelNode.clientWidth - 2;\r\n }else if (_params['float']==\"lefttop\") {\r\n _panelNode.style.top = 2;\r\n _panelNode.style.left = 2;\r\n }\r\n fixVLine();\r\n }", "title": "" }, { "docid": "6502e35904dae173702d364795bc5097", "score": "0.50928444", "text": "function biggerGrid()\n{\n GRID_TIGHTNESS *= 2;\n updateGridDisplay(); \n}", "title": "" }, { "docid": "a4eef85da4e39ddef09c2487737a9b56", "score": "0.5086484", "text": "function setViewport() {\n vpHeight = document.body.clientHeight;\n var sidePnlPos = $('#sidePanel').offset(); // NOTE: includes border box\n sidePnlLoc = sidePnlPos.top;\n var usable = vpHeight - sidePnlLoc;\n var mapHt = Math.floor(0.65 * usable);\n var chartHt = Math.floor(0.35 * usable);\n var pnlHeight = (mapHt + chartHt) - pnlTopBottom;\n $panel.height(pnlHeight); // Fits panel to page when debug/inspect\n $mapEl.height(mapHt);\n $chartEl.height(chartHt);\n}", "title": "" } ]
5ab1332b5583952b37f25997ed94ad36
Configure and populate FontAwesome library faConfig.autoAddCss = false faLibrary.add(fasIcons) faLibrary.add(fabIcons) faLibrary.add(farIcons)
[ { "docid": "eed134ec3f03f7dc113aa2c4572960fd", "score": "0.0", "text": "function App(props) {\n\tconst {\n\t\tComponent,\n\t\tisServer,\n\t\tpageProps,\n\t\tstore,\n\t} = props\n\tconst router = useRouter()\n\n\tuseEffect(() => {\n\t\tNProgress.configure({ showSpinner: false })\n\t\tLocalForage.config({\n\t\t\tname: 'A Monster\\'s Nature',\n\t\t\tstoreName: 'designer',\n\t\t})\n\t}, [])\n\n\tuseEffect(() => {\n\t\tconst startNProgress = () => NProgress.start()\n\t\tconst finishNProgress = () => NProgress.done()\n\n\t\trouter.events.on('routeChangeStart', startNProgress)\n\t\trouter.events.on('routeChangeError', finishNProgress)\n\t\trouter.events.on('routeChangeComplete', finishNProgress)\n\n\t\treturn () => {\n\t\t\trouter.events.off('routeChangeStart', startNProgress)\n\t\t\trouter.events.off('routeChangeError', finishNProgress)\n\t\t\trouter.events.off('routeChangeComplete', finishNProgress)\n\t\t}\n\t}, [router.events])\n\n\treturn (\n\t\t<AssetsContextProvider>\n\t\t\t<EditorContextProvider>\n\t\t\t\t<KeyStateContextProvider>\n\t\t\t\t\t<div role=\"application\">\n\t\t\t\t\t\t<NextHead>\n\t\t\t\t\t\t\t<meta name=\"viewport\" content=\"initial-scale=1.0, viewport-fit=cover, width=device-width\" />\n\n\t\t\t\t\t\t\t<link\n\t\t\t\t\t\t\t\thref=\"https://fonts.googleapis.com/css?family=Source+Code+Pro&amp;display=swap\"\n\t\t\t\t\t\t\t\trel=\"stylesheet\" />\n\t\t\t\t\t\t</NextHead>\n\n\t\t\t\t\t\t<Component {...pageProps} />\n\n\t\t\t\t\t\t<div id=\"modal-portal\" />\n\t\t\t\t\t</div>\n\t\t\t\t</KeyStateContextProvider>\n\t\t\t</EditorContextProvider>\n\t\t</AssetsContextProvider>\n\t)\n}", "title": "" } ]
[ { "docid": "40b45e1ac51148c1c7da35e6d79afb9c", "score": "0.6603216", "text": "async function constructFontAwesome() {\n await cloneFACss();\n await cloneFAWebfonts();\n}", "title": "" }, { "docid": "100bb569f569edfb9968088ef0a00602", "score": "0.6143243", "text": "readConfig() {\n const config = this.app.project.config();\n const appConfig = config['fontawesome'] || {};\n const configDefaults = {\n enableExperimentalBuildTimeTransform: false,\n icons: {},\n defaultPrefix: 'fas',\n };\n let buildConfig = {};\n\n let addonOptions =\n (this.parent && this.parent.options) ||\n (this.app && this.app.options) ||\n {};\n if ('fontawesome' in addonOptions) {\n this.ui\n .writeWarnLine(`fontawesome is no longer configured in 'ember-cli-build.js'.\n All configuration should be moved to 'environment.js'.\n See https://github.com/FortAwesome/ember-fontawesome#subsetting-icons for details.\n `);\n buildConfig = addonOptions.fontawesome;\n }\n if ('icons' in appConfig) {\n this.ui\n .writeWarnLine(`Configuring icons in config/environment.js is no longer recommended\n and will be removed in a future version.\n\n Move icon list to config/icons.js for better performance.\n See https://github.com/FortAwesome/ember-fontawesome#subsetting-icons for instructions.\n `);\n }\n const mergedConfig = Object.assign(configDefaults, buildConfig, appConfig);\n const configuredIcons = discoverConfiguredIcons(this.app.project);\n mergedConfig.icons = combineIconSets(mergedConfig.icons, configuredIcons);\n\n this.fontawesomeConfig = mergedConfig;\n }", "title": "" }, { "docid": "47cb16629b636a5f6d55ffddd4add8c9", "score": "0.58820766", "text": "function addFontAwesome() {\n var linkTag = document.createElement('link')\n linkTag.rel = 'stylesheet'\n linkTag.href = 'https://use.fontawesome.com/releases/v5.3.1/css/all.css'\n linkTag.integrity =\n 'sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU'\n linkTag.crossOrigin = 'anonymous'\n\n headTag.appendChild(linkTag)\n}", "title": "" }, { "docid": "68a6f5aa54afe888a97478db3f3acfa0", "score": "0.55456305", "text": "function fa(done) {\n return gulp.src('node_modules/font-awesome/css/font-awesome.min.css')\n .pipe(gulp.dest('src/css'))\n}", "title": "" }, { "docid": "9319361fd487f688c85663ea7e57c5e5", "score": "0.5531216", "text": "get library_add () {\n return new IconData(0xe02e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "d6deb7cef8735a8dc0367385d4d546e3", "score": "0.54702324", "text": "function Favicons(done) {\n $.realFavicon.generateFavicon({\n masterPicture: SRC_PATHS.media.favicons + 'favicon_master.png',\n dest: SRC_PATHS.media.favicons,\n iconsPath: 'favicons/',\n design: {\n ios: {\n pictureAspect: 'noChange',\n master_picture: {}\n },\n desktopBrowser: {},\n windows: {\n pictureAspect: 'noChange',\n backgroundColor: '#da532c',\n onConflict: 'override'\n },\n androidChrome: {\n pictureAspect: 'noChange',\n themeColor: '#ffffff',\n manifest: {\n name: PROJECT.name,\n display: 'browser',\n orientation: 'notSet',\n onConflict: 'override',\n declared: true\n }\n },\n safariPinnedTab: {\n pictureAspect: 'silhouette',\n themeColor: '#5bbad5'\n }\n },\n settings: {\n scalingAlgorithm: 'Mitchell',\n errorOnImageTooSmall: false\n },\n markupFile: FAVICON_DATA_FILE\n }, function () {\n STAGE_POINTS.favicons=true;\n done();\n });\n\n}", "title": "" }, { "docid": "54de47934264e88c9f2ddf0510995c5e", "score": "0.54358816", "text": "function IconOptions() { }", "title": "" }, { "docid": "d198b92b2c05005a05cffb30f0e070b7", "score": "0.5432818", "text": "function fontawesome() {\n\treturn src(paths.fontFiles + '/font-awesome/**.*')\n\t\t.pipe(rename(function(path) {path.dirname = '';}))\n\t\t.pipe(dest(paths.siteFontFiles))\n\t\t.on('error', log.error);\n}", "title": "" }, { "docid": "5ddc3122f3f30a8865de544bef190bfb", "score": "0.543201", "text": "function IconAndFileUpload(config) {\n var isOrder = _.where(config.context.record.data.assetManager, { state : false , srcAttr : config.srcAttr}).length,\n\t\t\tdisableClass = '';\n\n\t\tif(config.isMultiNarration){\n\t\t\tvar locale = config.srcAttr.split('.')[1];\n\t\t\tif(!config.context.record.data.multiNarrations[locale]){\n\t\t\t\tdisableClass= 'disabled';\n\t\t\t}\n\n\t\t}else{\n\t\t\tif(!config.context.record.data[config.repoItemName] || _.isEmpty(config.context.record.data[config.repoItemName])) {\n\t\t\t\tdisableClass= 'disabled';\n\t\t\t}\n\t\t}\n\n\n\t\t\n\t\tthis.data = {\tinitiator: config.context,\n\t\t\t\t\t\tcallback: config.callback,\n\t\t\t\t\t\ticonClass: config.type + \"_icon\",\n iconId: \"icon_\" + config.repoItemName,\n\t\t\t\t\t\tButtonId: \"Button_upload_\" + config.repoItemName,\n\t\t\t\t\t\ticonDisabledClass:disableClass,\n\t\t\t\t\t\ticonOrderClass : isOrder? 'ordered': '',\n\t\t\t\t\t\tsrcAttr: config.srcAttr\n\t\t\t\t\t};\n\t\tif (!(config.itemId instanceof $)) {\n\t\t\tconfig.itemId = $(config.itemId);\n\t\t}\n\t\tthis.itemId = config.itemId;\n\n\t\t//append item to scrren\n\t\tconfig.itemId.append(Mustache.render(_template, this));\n\n\t\tvar options = {};\n\t\tswitch(config.type) {\n\t\t\tcase 'sound':\n\t\t\tcase 'narration':\n\t\t\t\toptions = FileUpload.params.audio;\n\t\t\t\tbreak;\n\t\t\tcase 'video':\n\t\t\t\toptions = FileUpload.params.video;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//init file upload button\n\t\tnew FileUpload({\n\t\t\tactivator: config.itemId.find(\".\" + this.data.ButtonId),\n\t\t\toptions: options,\n\t\t\tcallback: this.afterFileUpload,\n\t\t\tcontext: this,\n\t\t\trecordId: config.recordId,\n\t\t\tsrcAttr: config.srcAttr,\n\t\t\tenableAssetManager: config.enableAssetManager,\n\t\t\tenableDelete: config.enableDelete,\n\t\t\tenableEdit: config.enableEdit,\n\t\t\tisNarration: config.isNarration,\n\t\t\tisMultiNarration: config.isMultiNarration\n\t\t});\n\t}", "title": "" }, { "docid": "870d86bb128cc94b1e4dbe1faed541b9", "score": "0.5325692", "text": "function fa() {\n return gulp.src('node_modules/font-awesome/css/font-awesome.min.css')\n .pipe(gulp.dest('src/css'));\n}", "title": "" }, { "docid": "99e86e799033c7e171c87cc75ed39a80", "score": "0.52930665", "text": "initialize ({ icon, iconSize = 24, color = '#000', bearing = false }) {\n // if there's a bearing indicator the icon is a bit bigger than requested to make room\n const trueIconSize = bearing !== false ? iconSize * 1.5 : iconSize\n\n super.initialize({\n html: bearing === false\n ? `<i class=\"fa fa-${icon}\" style=\"font-size: ${iconSize}px; color: ${color}\"></i>`\n : `<i class=\"fa fa-${icon}\" style=\"font-size: ${iconSize}px; color: ${color}\"></i>\n <i class=\"fa fa-caret-up\" style=\"font-size: ${iconSize}px; color: ${color}; transform-origin: 60% 135%; transform: translateY(-${iconSize * 1.75}px) rotate(${bearing}deg)\"></i>`,\n iconSize: point(trueIconSize, trueIconSize),\n className: 'FontawesomeIcon'\n })\n }", "title": "" }, { "docid": "82a39f5e5d1b02ed4dd421851c2ec36f", "score": "0.5250515", "text": "getCategoryFont (_icon) {\n\t\treturn brand[_icon]===1?\"fab\":\"fas\"\n\t}", "title": "" }, { "docid": "494ba205116fd272c1bee57c5cfc918e", "score": "0.52334464", "text": "componentDidMount() {\r\n loadFontAwesomeIcons();\r\n }", "title": "" }, { "docid": "a23ebb884bc7b0ceaf6ab76384121530", "score": "0.5172119", "text": "function overrides(config, env) {\n config.resolve.alias[\"@ant-design/icons/lib/dist$\"] = path.join(\n __dirname,\n \"src/icons.js\"\n );\n\n return config;\n}", "title": "" }, { "docid": "c33d6d113c1b839d85af65b23a50c483", "score": "0.5152273", "text": "componentDidMount() {\n loadFontAwesomeIcons();\n }", "title": "" }, { "docid": "662b0b09d567f51c738c063d243dd516", "score": "0.51310456", "text": "function addFonts() {\n let node = document.createElement(\"link\");\n node.setAttribute(\"rel\", \"stylesheet\");\n node.setAttribute(\n \"href\",\n \"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css\"\n );\n document.head.appendChild(node);\n}", "title": "" }, { "docid": "4fb0a7c1e2a84897ade9a6d174f6d3f2", "score": "0.5105794", "text": "function qodefOnDocumentReady() {\n\t\tqodefIcon().init();\n\t}", "title": "" }, { "docid": "edb8e7df7f3f335f60917ab679219e62", "score": "0.50809395", "text": "function setupAdditionalCufonFontReplacement()\n{\n Cufon.replace(\".tabHeader\", {fontWeight: 400});\n Cufon.replace(\".tabsHeader\", {fontWeight: 700});\n \n //Cufon.replace(\".accordionDescHeader\", {fontWeight: 700});\n Cufon.replace(\"#servicesProductsHeader\", {fontWeight: 300});\n Cufon.replace(\"#latestNewsHeader\", {fontWeight: 300});\n}", "title": "" }, { "docid": "6631f85f97385be337f06d406a7ce041", "score": "0.50801843", "text": "function setFormEventListeners(){\r\n\t\t//Remove event listeners that may already be attached\r\n\t\t$('.iconContainer').off();\r\n\t\t//Standard form event listeners that need to be reattached\r\n\t\t$('.floating-label .form-control').on('keyup change', function (e) {\r\n\t\t\tvar input = $(e.currentTarget);\r\n\r\n\t\t\tif ($.trim(input.val()) !== '') {\r\n\t\t\t\tinput.addClass('dirty').removeClass('static');\r\n\t\t\t\t} else {\r\n\t\t\t\tinput.removeClass('dirty').removeClass('static');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$('.floating-label .form-control').each(function () {\r\n\t\t\tvar input = $(this);\r\n\t\t\tif ($.trim(input.val()) !== '') {\r\n\t\t\t\tinput.addClass('static').addClass('dirty');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$('.form-horizontal .form-control').each(function () {\r\n\t\t\t$(this).after('<div class=\"form-control-line\"></div>');\r\n\t\t});\r\n\t\t//TODO figure out why the colorpicker isn't working here.\r\n\t\t$('.colorInput').colorpicker();\r\n\t\t$('.iconContainer').on('click', function(){\r\n\t\t\tvar iconImg = $(this).children('img').clone();\r\n\t\t\tif($(this).hasClass('1')){\r\n\t\t\t\t$('#iconDisplay1').html(iconImg);\r\n\t\t\t\t}else if($(this).hasClass('2')){\r\n\t\t\t\t$('#iconDisplay2').html(iconImg);\r\n\t\t\t\t}else{\r\n\t\t\t\t$('#iconDisplay3').html(iconImg);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "cc7be89672ab363a7b4e0c551711cdac", "score": "0.5061032", "text": "function initIconStyle() {\n setLabel(\"iconStyle\");\n $(\"#iconStyle\").find(\"input[value='\" + bp.settings.iconStyle + \"']\").prop(\"checked\", true);\n $(\"#iconStyle\").find(\"input\").click(stringUpdater(\"iconStyle\", bp.settings));\n }", "title": "" }, { "docid": "43bb4e811f90369c807ba8a19a5c2cf4", "score": "0.5060669", "text": "extend (config) {\n if (!config.module) {\n return\n }\n\n const svgRule = config.module.rules.find(rule => rule.test instanceof RegExp && rule.test.test('.svg'))\n\n if (!svgRule) {\n return\n }\n\n svgRule.test = /\\.(png|jpe?g|gif|webp)$/\n\n config.module.rules.push({\n test: /\\.svg$/,\n use: [\n 'babel-loader',\n 'vue-svg-loader'\n ],\n exclude: [\n /@fortawesome[\\\\/]fontawesome-free[\\\\/]webfonts[\\\\/][^\\\\/]+\\.svg$/\n ]\n })\n\n config.module.rules.push({\n test: /@fortawesome[\\\\/]fontawesome-free[\\\\/]webfonts[\\\\/][^\\\\/]+\\.svg$/,\n use: [\n {\n loader: 'url-loader',\n options: {\n limit: 1000,\n name: '[path][name].[ext]'\n }\n }\n ]\n })\n }", "title": "" }, { "docid": "ea730bc7294d4f1a6fcb515985e6a60e", "score": "0.5056011", "text": "get settings () {\n return new IconData(0xe8b8,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "f8977b6093abb63dd251751afc0f2ae2", "score": "0.50540894", "text": "function qodefOnDocumentReady() {\n\t\tqodefInitIconList().init();\n\t}", "title": "" }, { "docid": "a61fa0a22615ae3582bf7242de52548d", "score": "0.5037414", "text": "get blur_circular () {\n return new IconData(0xe3a2,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "a61fa0a22615ae3582bf7242de52548d", "score": "0.5037414", "text": "get blur_circular () {\n return new IconData(0xe3a2,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "793abfd5f5d6c773e3c5597f8c3d5745", "score": "0.5029978", "text": "function makeIcon(){\n if(au) return;\n au = true;\n $(\"link[rel='icon']\").attr(\"href\", \"../static/favicon_au.png\");\n}", "title": "" }, { "docid": "852e7f7c63d7ce9f18efa408d488775f", "score": "0.50287145", "text": "iniFonts() {\n node_modules_webfontloader__WEBPACK_IMPORTED_MODULE_0__[\"load\"]({\n google: {\n families: ['Montserrat:400,600,700', 'Roboto:400,500,700']\n }\n });\n }", "title": "" }, { "docid": "5020864d7872a98aac3c3273948e2d5d", "score": "0.5027985", "text": "get settings_bluetooth () {\n return new IconData(0xe8bb,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "391c2e771fdd7588b7aba679942d77a4", "score": "0.5006311", "text": "function addBuiltIns(PfeIcon) {\n [\n {\n name: \"web\",\n path: \"https://access.redhat.com/webassets/avalon/j/lib/rh-iconfont-svgs\"\n },\n {\n name: \"rh\",\n path: \"https://access.redhat.com/webassets/avalon/j/lib/rh-iconfont-svgs\"\n }\n ].forEach(set =>\n PfeIcon.addIconSet(set.name, set.path, (name, iconSetName, iconSetPath) => {\n const regex = new RegExp(`^${iconSetName}(-icon)?-(.*)`);\n const [, , iconName] = regex.exec(name);\n\n const iconId = `${iconSetName}-icon-${iconName}`;\n const iconPath = `${iconSetPath}/${iconId}.svg`;\n\n return iconPath;\n })\n );\n}", "title": "" }, { "docid": "87e311185a9be5f7bfb7ef62de2807ff", "score": "0.49970403", "text": "function registerIcons(iconSubset, options) {\n var subset = __WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __assign */]({}, iconSubset, { isRegistered: false, className: undefined });\n var icons = iconSubset.icons;\n // Grab options, optionally mix user provided ones on top.\n options = options ? __WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __assign */]({}, _iconSettings.__options, options) : _iconSettings.__options;\n for (var iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n var code = icons[iconName];\n var normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n }\n else {\n _iconSettings[normalizedIconName] = {\n code: code,\n subset: subset\n };\n }\n }\n }\n}", "title": "" }, { "docid": "93a721e6a1646344f6516d1197dcff3c", "score": "0.49647534", "text": "function initializeIcons() {\n // no-op\n}", "title": "" }, { "docid": "3ac28ad38ab6ec2b111e7cc38fac3705", "score": "0.49428475", "text": "function linkFA_decorate() {\n // these root elements can contain FA-/GA-links\n var rootIds = new Array(\"topbar\", \"footer\");\n for (var i=0; i<rootIds.length; i++) {\n var root = document.getElementById(rootIds[i]);\n if (!root) continue;\n\n // if the root exists, try to decorate all the links within\n var links = root.getElementsByTagName(\"a\");\n for (var j=0; j<links.length; j++) {\n decorate(links[j], \"-fa\", linkFA_bullet, linkFA_description, linkFA_style);\n decorate(links[j], \"-ga\", linkGA_bullet, linkGA_description, linkGA_style);\n }\n }\n }", "title": "" }, { "docid": "4b21c93aecd83e8e3095751dd9f1e732", "score": "0.49378932", "text": "_addSvgIconConfig(namespace, iconName, config) {\n this._svgIconConfigs.set(iconKey(namespace, iconName), config);\n return this;\n }", "title": "" }, { "docid": "523a581cf5d36b0bc280a60e30e5031f", "score": "0.49255404", "text": "get settings_input_antenna () {\n return new IconData(0xe8bf,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "807ea8e0df787c5fd69a38a4aa18dd5a", "score": "0.49130654", "text": "get local_florist () {\n return new IconData(0xe545,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "38421c08e04747f0e5e182cd42a53fa2", "score": "0.4904721", "text": "async function cloneFACss() {\n gulp\n .src(\n [\n 'assets/fontawesome/css/**',\n ]\n )\n .pipe(\n gulp\n .dest(PATHS.root.dest + '/css')\n );\n}", "title": "" }, { "docid": "5b8d952d1524e1cfc97936a2ced27914", "score": "0.4902919", "text": "function font_awesome(icon, id, color) {\n \t\treturn \"<span class='fa fa-fw \" +icon+\"' id='icon\"+id+\"' style='color:\"+color+\";'></span>\"; \t\n }", "title": "" }, { "docid": "f526a40bcd70f91f231d0feffd743080", "score": "0.4895913", "text": "function FabricConfig() {}", "title": "" }, { "docid": "603ae43479d90b9033e79083000cc4cc", "score": "0.48948038", "text": "function initEditorIcons() {\n // ------------------------------------------------------------------------\n // Locate each element that has a class 'bpIcon' assigned and contains a\n // 'data-icon' attribute. Iterate through each match and draw the custom\n // icons into the specified element.\n // ------------------------------------------------------------------------\n $('.bpIcon[data-icon]').each(function () {\n $(this).html(bpIcons[$(this).attr('data-icon')]);\n });\n}", "title": "" }, { "docid": "deaf7ae3312a5f1f311e6024e37f5de9", "score": "0.48929295", "text": "function iconSetting() {\n\tvar icon = document.getElementsByClassName(\"icon\")[0];\n\tEventUtil.addHandler(icon, \"click\", oneByOne(0));\n}", "title": "" }, { "docid": "9a93288df669aa8152609d42e792b2b1", "score": "0.48912928", "text": "function setIconOptions(options) {\n _iconSettings.__options = __WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __assign */]({}, _iconSettings.__options, options);\n}", "title": "" }, { "docid": "be068e8a3ff64d4ca0ba66e9739260b3", "score": "0.48849243", "text": "function registerIcons(iconSubset, options) {\n var subset = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, iconSubset, { isRegistered: false, className: undefined });\n var icons = iconSubset.icons;\n // Grab options, optionally mix user provided ones on top.\n options = options ? tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, _iconSettings.__options, options) : _iconSettings.__options;\n for (var iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n var code = icons[iconName];\n var normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n }\n else {\n _iconSettings[normalizedIconName] = {\n code: code,\n subset: subset\n };\n }\n }\n }\n}", "title": "" }, { "docid": "9f9d7f52280c8241493958f31b36560d", "score": "0.48813677", "text": "get add_circle () {\n return new IconData(0xe147,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "9f9d7f52280c8241493958f31b36560d", "score": "0.48813677", "text": "get add_circle () {\n return new IconData(0xe147,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "069d4cb51cb223b71f18b81f7056951e", "score": "0.48671097", "text": "function toggleFab() {\n //$('.prime').toggleClass('fa-commnet-alt');\n //$('.prime').toggleClass('');\n //$('.prime').toggleClass('is-active');\n //$('.prime').toggleClass('is-visible');\n //$('#prime').toggleClass('is-float');\n //$('.fab').toggleClass('is-visible');\n}", "title": "" }, { "docid": "1a42675a42ee891c25d395c2e1909804", "score": "0.48662096", "text": "get library_books () {\n return new IconData(0xe02f,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "d0c910024bab64900c6d198bda36fb40", "score": "0.48656046", "text": "get local_library () {\n return new IconData(0xe54b,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "7422b6f12b8378daa91b37de6ba42523", "score": "0.48635048", "text": "get settings_input_composite () {\n return new IconData(0xe8c1,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "bdb61577240a32587fb3f455b59c4356", "score": "0.48633087", "text": "function setIcons(iconType, shouldRenderMissions = true) {\n if (iconType != \"none\") {\n iconType = \"image\"; // Force it to these two options\n }\n \n setGlobal('IconConfig', iconType);\n \n $('#config-style-icons').removeClass('active');\n if (iconType == \"image\") {\n $('#config-style-icons').addClass('active');\n }\n \n if (shouldRenderMissions) {\n renderMissions();\n }\n}", "title": "" }, { "docid": "8d772adafd7ec1e555176e7e7127a608", "score": "0.4857651", "text": "addIcon(...icons) {\n icons.forEach(icon => {\n this._svgDefinitions.set(withSuffix(icon.name, icon.theme), icon);\n });\n }", "title": "" }, { "docid": "003b7440b011890eef39365423ca0c13", "score": "0.48562083", "text": "async function cloneFAWebfonts() {\n gulp\n .src(\n [\n 'assets/fontawesome/webfonts/**',\n ]\n )\n .pipe(\n gulp\n .dest(PATHS.root.dest + '/webfonts')\n );\n}", "title": "" }, { "docid": "614805ced5301701c582aa734c69238d", "score": "0.48526263", "text": "get done_all () {\n return new IconData(0xe877,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "614805ced5301701c582aa734c69238d", "score": "0.48526263", "text": "get done_all () {\n return new IconData(0xe877,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "8892b384bb6f16cb7e07e072964829b3", "score": "0.4848263", "text": "get done () {\n return new IconData(0xe876,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "8892b384bb6f16cb7e07e072964829b3", "score": "0.4848263", "text": "get done () {\n return new IconData(0xe876,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "6c1ef3dd2afa575a4c5d1394f4662578", "score": "0.48464844", "text": "get settings_applications () {\n return new IconData(0xe8b9,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "f3c0b416b7bff17058acde49347c809c", "score": "0.4828932", "text": "function icon_definitions() {\n var data = ''\n fs.recurseSync(paths.icbuild, function(filepath, relative, filename) {\n if (!filename) return\n data += 'export const ' + filename.slice(0, -4).replace('-','_') + '_icon = '\n data += '`' + fs.fs.readFileSync(filepath) + '`;'\n data += '\\n\\n'\n })\n data = data.replace(/ stroke=\"#[0-9A-Fa-f]+\"/g,'').replace(/ fill=\"#[0-9A-Fa-f]+\"/g,'')\n fs.writeFile(paths.src + \"ts/icon-definitions.ts\", data)\n return Promise.resolve('')\n}", "title": "" }, { "docid": "6f93273ac00b432ba36333ffca863854", "score": "0.4796909", "text": "get looks_6 () {\n return new IconData(0xe3ff,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "0c4b06bea0b361e41bc6177202dabecc", "score": "0.47951573", "text": "appendIcon(icon) {\n var link = $('<link>', {href: \"https://fonts.googleapis.com/icon?family=\" + icon, rel: \"stylesheet\"});\n $('head').append(link);\n }", "title": "" }, { "docid": "0c4b06bea0b361e41bc6177202dabecc", "score": "0.47951573", "text": "appendIcon(icon) {\n var link = $('<link>', {href: \"https://fonts.googleapis.com/icon?family=\" + icon, rel: \"stylesheet\"});\n $('head').append(link);\n }", "title": "" }, { "docid": "2d8f5ff8ffd352be092620dd13443bd1", "score": "0.47908577", "text": "get beach_access () {\n return new IconData(0xeb3e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "2d8f5ff8ffd352be092620dd13443bd1", "score": "0.47908577", "text": "get beach_access () {\n return new IconData(0xeb3e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "0cbd5a6c45e0e9a36df615ad59d25f28", "score": "0.47846425", "text": "get settings_overscan () {\n return new IconData(0xe8c4,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "13ce44a49aad4e6c0b2d42b775507d73", "score": "0.4780482", "text": "get looks_3 () {\n return new IconData(0xe3fb,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "4822109ea860adf13d2fa4ec4ee91abe", "score": "0.47789448", "text": "get fastfood () {\n return new IconData(0xe57a,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "ee2e616aae447dc7db8a72db1ef2b211", "score": "0.47766662", "text": "setFavicon() {\n var link = document.querySelector(\"link[rel*='icon']\") || document.createElement('link');\n link.type = 'image/x-icon';\n link.rel = 'shortcut icon';\n link.href = this.relativeURL(this._assets.favicon.default.url);\n document.getElementsByTagName('head')[0].appendChild(link);\n }", "title": "" }, { "docid": "0d3055f9739332584f90e89ff270a98e", "score": "0.47749108", "text": "get flare () {\n return new IconData(0xe3e4,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "6dde43e090e1363c6911a9448416eee8", "score": "0.47721875", "text": "function copy_fontawsome_webfonts(){\n return gulp\n .src('./node_modules/@fortawesome/fontawesome-free/webfonts/**/*.*')\n .pipe(gulp.dest('./public/plugins/fontawesome/webfonts'));\n}", "title": "" }, { "docid": "12253d9dd520da505a6d968f0a98288a", "score": "0.47541597", "text": "extend(config, ctx) {\n const svgRule = config.module.rules.find((rule) => rule.test.test('.svg'))\n svgRule.exclude = [path.resolve(__dirname, 'icons/svg')]\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'svg-sprite-loader',\n include: [path.resolve(__dirname, 'icons/svg')],\n options: {\n symbolId: 'icon-[name]'\n }\n })\n }", "title": "" }, { "docid": "5dc760f42ae21d24ec2a8866f098d8fe", "score": "0.4744139", "text": "function addFontSupport(cfg) {\n const rule = {\n test: /\\.(eot|woff|woff2|ttf|svg)$/,\n type: 'asset/resource',\n };\n\n return R.pipe(\n addRule(rule)\n )(cfg);\n}", "title": "" }, { "docid": "9e56eb17473e6a13407e84c31b94d9a1", "score": "0.47439092", "text": "generateFavicons(cb) {\n rfg.generateFavicon(this.request, this.options.outputPath, cb);\n }", "title": "" }, { "docid": "59ccb681259727569f3315b8d644b06a", "score": "0.47421977", "text": "get flash_auto () {\n return new IconData(0xe3e5,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "252c952dd3efdbab42198ab3d285f826", "score": "0.47382355", "text": "get cloud_done () {\n return new IconData(0xe2bf,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "252c952dd3efdbab42198ab3d285f826", "score": "0.47382355", "text": "get cloud_done () {\n return new IconData(0xe2bf,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "d38f0a43b218844cc2b7b27d9f493413", "score": "0.47376984", "text": "get casino () {\n return new IconData(0xeb40,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "d38f0a43b218844cc2b7b27d9f493413", "score": "0.47376984", "text": "get casino () {\n return new IconData(0xeb40,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "974b4bf91c811b6c36c9ff23eee3e287", "score": "0.4735804", "text": "get add_call () {\n return new IconData(0xe0e8,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "974b4bf91c811b6c36c9ff23eee3e287", "score": "0.4735804", "text": "get add_call () {\n return new IconData(0xe0e8,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "35b8c2c01dd63ad31010bdf1d6d3228f", "score": "0.47303206", "text": "function init( returnedSettings ){\n\n\tif ( returnedSettings.changeIconURL )\n\t{\n\t\tif( returnedSettings.iconURLTxt == null || returnedSettings.iconURLTxt == 'undefined' )\n\t\t{\n\t\t\tchangeIconUrl(defaultURL);\n\t\t}else{\n\t\t\tchangeIconUrl(returnedSettings.iconURLTxt);\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "3165d758dae49d7f6637b09d547c492b", "score": "0.47214147", "text": "get forum () {\n return new IconData(0xe0bf,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "c75c164d529c46544686978150402da4", "score": "0.4719101", "text": "function addloader(){\n\n\t$('.loader').removeClass('fa-upload');\n\t$('.loader').addClass('fa-cog fa-spin');\n\t}", "title": "" }, { "docid": "9a1d7db7818cf33bf98ed85532cfe3d1", "score": "0.4706881", "text": "get looks_one () {\n return new IconData(0xe400,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "e86dd84a1a50406b1bbac14f469e8a8b", "score": "0.470638", "text": "get cake () {\n return new IconData(0xe7e9,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "e86dd84a1a50406b1bbac14f469e8a8b", "score": "0.470638", "text": "get cake () {\n return new IconData(0xe7e9,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "b818562356899af102930d22ca4c1236", "score": "0.46979636", "text": "function setIconOptions(options) {\n _iconSettings.__options = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, _iconSettings.__options, options);\n}", "title": "" }, { "docid": "61ffb568f9fdd87c5902e4c0112f3be3", "score": "0.46960405", "text": "_loadSvgIconFromConfig(config) {\n return this._fetchIcon(config).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"tap\"])(svgText => config.svgText = svgText), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__[\"map\"])(() => this._svgElementFromConfig(config)));\n }", "title": "" }, { "docid": "fb49aa438ca5994da27fed2e9ebdffaf", "score": "0.46936035", "text": "configure() {\n this.js = '//keith-wood.name/js/jquery.signature.js';\n this.css = '//keith-wood.name/css/jquery.signature.css';\n }", "title": "" }, { "docid": "0c8e53a52e9150ac3f1f2ce8fe2766a5", "score": "0.46915063", "text": "get bluetooth_searching () {\n return new IconData(0xe1aa,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "0c8e53a52e9150ac3f1f2ce8fe2766a5", "score": "0.46915063", "text": "get bluetooth_searching () {\n return new IconData(0xe1aa,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "da898661a99fae4a572b46d8b2f6906d", "score": "0.46895084", "text": "async initializeAsync() {\n try {\n await Promise.all([\n cacheAssetsAsync({\n fonts: [\n {\n \"paperboy-heading-bold\": paperboyHeadingBold\n },\n {\n \"paperboy-heading-regular\": paperboyHeadingRegular\n },\n {\n \"paperboy-icons\": paperboyIcons\n }\n ]\n })\n ]);\n } catch (e) {\n console.log(`error loading assets`);\n } finally {\n this.setState({ appIsReady: true });\n }\n }", "title": "" }, { "docid": "48ba5acd445d87a90839b3cf0505971a", "score": "0.4689412", "text": "function setIconOptions(options) {\r\n _iconSettings.__options = tslib_1.__assign({}, _iconSettings.__options, options);\r\n}", "title": "" }, { "docid": "a2b0bd0c3c11359d4ff70329d8c66d6e", "score": "0.46890914", "text": "function init() {\n if (config.paths) {\n paths.helpers = config.paths.helpers || paths.helpers;\n paths.gadgets = config.paths.gadgets || paths.gadgets;\n }\n }", "title": "" }, { "docid": "86062f42b187da595bb018d22dbbcb37", "score": "0.46887186", "text": "get add () {\n return new IconData(0xe145,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "86062f42b187da595bb018d22dbbcb37", "score": "0.46887186", "text": "get add () {\n return new IconData(0xe145,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "c8405169ae983f22654f8b49bcc292f5", "score": "0.46842283", "text": "function registerIcons(iconSubset, options) {\n var subset = tslib_1.__assign({}, iconSubset, { isRegistered: false, className: undefined });\n var icons = iconSubset.icons;\n // Grab options, optionally mix user provided ones on top.\n options = options ? tslib_1.__assign({}, _iconSettings.__options, options) : _iconSettings.__options;\n for (var iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n var code = icons[iconName];\n var normalizedIconName = iconName.toLowerCase();\n if (_iconSettings[normalizedIconName]) {\n if (!options.disableWarnings) {\n warn_1.warn(\"Icon '\" + iconName + \" being re-registered. Ignoring duplicate registration.\");\n }\n }\n else {\n _iconSettings[normalizedIconName] = {\n code: code,\n subset: subset\n };\n }\n }\n }\n}", "title": "" }, { "docid": "a0e7d6002a0d7ee6477b9f624bf395c5", "score": "0.4675774", "text": "get hdr_weak () {\n return new IconData(0xe3f2,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "0e0a3b50e58268520c7e0e67ae86a95d", "score": "0.46720284", "text": "get settings_remote () {\n return new IconData(0xe8c7,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "35688c402d13c03ad1c8cd9a27979f87", "score": "0.46717176", "text": "function registerIcons(iconSubset, options) {\r\n var subset = tslib_1.__assign({}, iconSubset, { isRegistered: false, className: undefined });\r\n var icons = iconSubset.icons;\r\n // Grab options, optionally mix user provided ones on top.\r\n options = options ? tslib_1.__assign({}, _iconSettings.__options, options) : _iconSettings.__options;\r\n for (var iconName in icons) {\r\n if (icons.hasOwnProperty(iconName)) {\r\n var code = icons[iconName];\r\n var normalizedIconName = iconName.toLowerCase();\r\n if (_iconSettings[normalizedIconName]) {\r\n if (!options.disableWarnings) {\r\n warn_1.warn(\"Icon '\" + iconName + \" being re-registered. Ignoring duplicate registration.\");\r\n }\r\n }\r\n else {\r\n _iconSettings[normalizedIconName] = {\r\n code: code,\r\n subset: subset\r\n };\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a7f5e0c4241775a7dbfc62379d952ec0", "score": "0.46650085", "text": "function setIconOptions(options) {\n _iconSettings.__options = tslib_1.__assign({}, _iconSettings.__options, options);\n}", "title": "" }, { "docid": "94e005fd1ca7d74f9a15215c9e08e535", "score": "0.4662227", "text": "get local_cafe () {\n return new IconData(0xe541,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "9abfdd21fce5297c33b75d258de1b815", "score": "0.4661303", "text": "get add_location () {\n return new IconData(0xe567,{fontFamily:'MaterialIcons'})\n }", "title": "" } ]
b5c191a658900bcd0006a40ea761f21c
Provides header/body/footer button support for Widgets that use the `WidgetStdMod` extension. This Widget extension makes it easy to declaratively configure a widget's buttons. It adds a `buttons` attribute along with button accessor and mutator methods. All button nodes have the `Y.Plugin.Button` plugin applied. This extension also includes `HTML_PARSER` support to seed a widget's `buttons` from those which already exist in its DOM.
[ { "docid": "807a62f46b54802cb55c1ba07c120716", "score": "0.70439684", "text": "function WidgetButtons() {\n // Has to be setup before the `initializer()`.\n this._buttonsHandles = {};\n}", "title": "" } ]
[ { "docid": "6fb0ec608f526a27c0a19f104932b55f", "score": "0.62102777", "text": "function createButtons(){\n\n for (i=0; i < moduleNames.length; i++){\n bttns[i] = new Button(moduleNames[i],moduleLinks[i], picFilenames[i], moduleDescriptions[i]);\n bttns[i].createButton();\n }\n\n for (i=0; i < moduleNames.length; i++){\n\n if(experimental[i]){\n setExperimental(i);\n }\n }\n\n createClearFloat();\n}", "title": "" }, { "docid": "0dd61b832b967986beb797608b09b288", "score": "0.6010946", "text": "function _addButtons() {\n var buttons_list = editor.button.buildGroup(_screenButtons());\n editor.$tb.append(buttons_list); // Set the height of all more toolbars\n\n setMoreToolbarsHeight();\n editor.button.bindCommands(editor.$tb);\n }", "title": "" }, { "docid": "e738c3d929649445f16a5a4457ec12ca", "score": "0.5988741", "text": "static createInWebLayoutContentUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"8.0.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "fc6971e3d9f6da3c4e3259b0454ba84e", "score": "0.5847283", "text": "button(x, y, content, opts){\n\n let button = new Button(x, y, content, opts);\n this.layer.buttons.push(button);\n return button;\n\n }", "title": "" }, { "docid": "4793ceb87a9341d7836d9d41025245ea", "score": "0.57946867", "text": "static createInSnippetUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "9b3a6f80fcac4c14624d8eec016f0bd6", "score": "0.57563704", "text": "function widgetsHelper(){}", "title": "" }, { "docid": "29cc7312ca0c66171c5ff1b24a56583f", "score": "0.5756239", "text": "function makeButtons() {\n\n\tdocument.querySelector('.scene-maker.buttons').innerHTML = `\n\t\t<button class='btn previous btn--secondary btn--disabled' disabled>Previous</button>\n\t\t<button class='btn next btn--primary'>Next</button>\n\t`;\n}", "title": "" }, { "docid": "6c56b31cb4a8414686516a0600eae8be", "score": "0.57445073", "text": "static createInLayoutUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\", end: \"7.23.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "cd16080dc88fbda06b2dcdaabaddfdd7", "score": "0.57410645", "text": "static createInTabPageUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "31dbf359c7f1b358236b7e060402274a", "score": "0.57068014", "text": "static createInNativeLayoutContentUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"8.0.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "8ea984f88c26549361b1f29a785487ee", "score": "0.5687919", "text": "function appendButtons(memeId) {\n createEditButton(memeId);\n createDeleteButton(memeId);\n createDownloadButton(memeId);\n createShareButton(memeId);\n}", "title": "" }, { "docid": "973f38d5f12f2d776d73f601b34b70b6", "score": "0.5646187", "text": "static createInTemplateGridContentsUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "bf4d5a9924c00b1f96a0a390f856e21d", "score": "0.5636345", "text": "_getHeaderButtons() {\r\n let buttons = super._getHeaderButtons();\r\n\r\n // Token Configuration\r\n const canConfigure = game.user.isGM || this.actor.owner;\r\n if (this.options.editable && canConfigure) {\r\n buttons = [\r\n {\r\n label: game.i18n.localize(\"ADD2E.dialog.tweaks\"),\r\n class: \"configure-actor\",\r\n icon: \"fas fa-code\",\r\n onclick: (ev) => this._onConfigureActor(ev),\r\n },\r\n ].concat(buttons);\r\n }\r\n return buttons;\r\n }", "title": "" }, { "docid": "192ea2c8cccf5d44b2aa59833a75a1a0", "score": "0.5617917", "text": "static createInBuildingBlockUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "f2b63f2b18509f7561ff9260cfbd1848", "score": "0.56102216", "text": "static createInLayoutUnderWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widget\", false);\n }", "title": "" }, { "docid": "0f6f4a7d80b761e63d797b847d75e5cf", "score": "0.5598852", "text": "static createInTabPageUnderWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widget\", false);\n }", "title": "" }, { "docid": "c9dec6141b356ee6e961e105a3a8c433", "score": "0.5572412", "text": "static createInSnippetUnderWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widget\", false);\n }", "title": "" }, { "docid": "487726dd3f6e24c701c4f67b2384fe5f", "score": "0.5570635", "text": "buildBtn() {\n if (this.btnEl) {\n return;\n }\n let tf = this.tf;\n let span = createElm('span');\n span.className = this.spanCssClass;\n\n // Container element (rdiv or custom element)\n let targetEl = !this.btnTgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.btnTgtId);\n\n if (!this.btnTgtId) {\n let firstChild = targetEl.firstChild;\n firstChild.parentNode.insertBefore(span, firstChild);\n } else {\n targetEl.appendChild(span);\n }\n\n if (!this.btnHtml) {\n let btn = createElm('a', ['href', 'javascript:;']);\n btn.className = this.btnCssClass;\n btn.title = this.desc;\n\n btn.innerHTML = this.btnText;\n span.appendChild(btn);\n if (!this.enableHover) {\n addEvt(btn, 'click', (evt) => this.toggle(evt));\n } else {\n addEvt(btn, 'mouseover', (evt) => this.toggle(evt));\n }\n } else { // Custom html\n span.innerHTML = this.btnHtml;\n let colVisEl = span.firstChild;\n if (!this.enableHover) {\n addEvt(colVisEl, 'click', (evt) => this.toggle(evt));\n } else {\n addEvt(colVisEl, 'mouseover', (evt) => this.toggle(evt));\n }\n }\n\n this.spanEl = span;\n this.btnEl = this.spanEl.firstChild;\n\n this.onLoaded(this);\n }", "title": "" }, { "docid": "08b8c81d49c7c46f506916a91e3a4712", "score": "0.5549826", "text": "function addButtonClickHandlers()\n {\n \n $(\"#perc-wb-button-new\").unbind().click(function(){\n handleWidgetNew();\n });\n $(\"#perc-widget-save\").on(\"click\",function(){\n handleWidgetSave();\n });\n $(\"#perc-widget-close\").on(\"click\",function(){\n handleWidgetClose();\n });\n \n WidgetBuilderApp.updateToolBarButtons = function(disableButtons){\n if(disableButtons){\n $(\"#perc-wb-button-delete\").addClass(\"ui-disabled\").removeClass(\"ui-enabled\").unbind();\n $(\"#perc-wb-button-edit\").addClass(\"ui-disabled\").removeClass(\"ui-enabled\").unbind();\n $(\"#perc-wb-button-deploy\").addClass(\"ui-disabled\").removeClass(\"ui-enabled\").unbind();\n }\n else{\n $(\"#perc-wb-button-delete\").removeClass(\"ui-disabled\").addClass(\"ui-enabled\").unbind().click(function(){\n handleWidgetDelete();\n });\n $(\"#perc-wb-button-edit\").removeClass(\"ui-disabled\").addClass(\"ui-enabled\").unbind().click(function(){\n handleWidgetEdit();\n });\n $(\"#perc-wb-button-deploy\").removeClass(\"ui-disabled\").addClass(\"ui-enabled\").unbind().click(function(){\n handleWidgetDeploy();\n });\n }\n }\n }", "title": "" }, { "docid": "dbe2b9a890fe434c97983ce278b00ce5", "score": "0.5537198", "text": "function ButtonManager(opt_root) {\n var root = opt_root || document.body;\n this.loadIcons_();\n\n // Make the fullscreen button.\n var fsButton = this.createButton();\n fsButton.src = this.ICONS.fullscreen;\n fsButton.title = 'Fullscreen mode';\n var s = fsButton.style;\n s.bottom = 0;\n s.right = 0;\n fsButton.addEventListener('click', this.createClickHandler_('fs'));\n root.appendChild(fsButton);\n this.fsButton = fsButton;\n\n // Make the VR button.\n var vrButton = this.createButton();\n vrButton.src = this.ICONS.cardboard;\n vrButton.title = 'Virtual reality mode';\n var s = vrButton.style;\n s.bottom = 0;\n s.right = '48px';\n vrButton.addEventListener('click', this.createClickHandler_('vr'));\n root.appendChild(vrButton);\n this.vrButton = vrButton;\n\n this.isVisible = true;\n\n}", "title": "" }, { "docid": "f7c3a77521f1517444278483826cf90c", "score": "0.5535166", "text": "static createInTemplateGridContentsUnderWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widget\", false);\n }", "title": "" }, { "docid": "ee7079e1985ec0fab64e62ffa4540719", "score": "0.5513872", "text": "static createInNativeLayoutUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.21.0\", end: \"7.23.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "cefa3ce870bd2e132f654e28a009d62f", "score": "0.5511876", "text": "static createInWidgetValueUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"8.2.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "4fd04eb17a819f64bf865e1203a6a75e", "score": "0.5507866", "text": "static createInHeaderUnderRightWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"rightWidgets\", true);\n }", "title": "" }, { "docid": "75647f6bc5be9022e6c3ac1900e9983b", "score": "0.550115", "text": "static createInLayoutCallArgumentUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "006c5495b6728e6fca88e83a5ea7d1f8", "score": "0.5489976", "text": "function addButtons() {\n target.css({\n 'border-width': '5px'\n });\n //console.log(\"INSIDE addButtons, thisID: \" + thisId + \" and thisKittenId: \" + thisKittenId);\n // append the delete and edit buttons, with data of metric document id, and kitten document id\n target.append(\"<button type='button' class='btn btn-default btn-xs littleX' data_idKitten=\" + \n thisKittenId + \" data_id=\" + \n thisId + \"><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></button>\");\n target.append(\"<button type='button' class='btn btn-default btn-xs littleE' data_idKitten=\" + \n thisKittenId + \" data_id=\" + \n thisId + \"><span class='glyphicon glyphicon-pencil' aria-hidden='true'></span></button>\");\n // set boolean to true that delete and edit buttons exist\n littleButton = true;\n }", "title": "" }, { "docid": "f8f450fe31aaa15d83150a7e87f6522b", "score": "0.5486945", "text": "function DecorativeCtrl_CButtonST(form, component)\n{\n var codegen=form.Code;\n var cmpName=component.Item(\"Name\");\n \n CheckComponent(form, component);\n\n var headerStr=codegen.Format(component,\"\\tCButtonST\\t[!Name];\\n\"); \n headerStr+=MakeContainedDecl(form,component);\n headerStr+=MakeFontDeclaration(component);\n\n var sourceStr=codegen.Format(component,\"\\t[!Name].Create([!ParentName],\"); \n sourceStr+=MakeRect(component)+\",\";\n sourceStr+=MakeLocalizedCString(component.Item(\"Caption\"),component)+\",\"+\n MakeWindowStyle(component)+\"|BS_PUSHBUTTON,\"+\n MakeExWindowStyle(component)+\",\"+\n component.Item(\"ID\")+\");\\n\"; \n sourceStr+=MakeControlFont(component); \n\n sourceStr+=\"\\t\"+cmpName+\".SetFlat(\"+component.Item(\"Flat\")+\");\\n\";\n //sourceStr+=\"\\t\"+cmpName+\".DrawTransparent(\"+component.Item(\"Transparent\")+\");\\n\";\n sourceStr+=\"\\t\"+cmpName+\".SetAlign(\"+component.Item(\"Alignment\")+\");\\n\";\n\tif(component.Item(\"Caption\").length)\n\t{\n\t\tsourceStr+=\"\\t\"+cmpName+\".SetColor(CButtonST::BTNST_COLOR_FG_IN,\"+MakeColor(component.Item(\"TextColorIn\"))+\");\\n\";\n\t\tsourceStr+=\"\\t\"+cmpName+\".SetColor(CButtonST::BTNST_COLOR_FG_OUT,\"+MakeColor(component.Item(\"TextColorOut\"))+\");\\n\";\n\t}\t\t\n\tsourceStr+=\"\\t\"+cmpName+\".SetColor(CButtonST::BTNST_COLOR_BK_IN,\"+MakeColor(component.Item(\"BkColorIn\"))+\");\\n\";\n\tsourceStr+=\"\\t\"+cmpName+\".SetColor(CButtonST::BTNST_COLOR_BK_OUT,\"+MakeColor(component.Item(\"BkColorOut\"))+\");\\n\";\n\n\tif (component.Item(\"EnableToolTip\") == true)\n\t{\n\t CheckProperty(form, component, \"ToolTip\", \"\");\n\t sourceStr += \"\\t\" + cmpName + \".SetTooltipText(\" + MakeLocalizedCStringEx(component.Item(\"ToolTip\"), \".t\", component) + \");\\n\";\n\t}\n \n imageFlag=false;\n if (component.Item(\"InImage.ImageType\") == \"Bitmap\" && CheckProperty(form, component, \"InImage.ID\", \"\") == true)\n {\n if (component.Item(\"OutImage.ImageType\") != \"Bitmap\")\n {\n sourceStr += codegen.Format(component, \"\\t[!Name].SetBitmaps([!InImage.ID],RGB(0,0,0),[!InImage.ID],RGB(0,0,0));\\n\");\n }\n else\n {\n sourceStr += codegen.Format(component, \"\\t[!Name].SetBitmaps([!InImage.ID],RGB(0,0,0),[!OutImage.ID],RGB(0,0,0));\\n\");\n }\n imageFlag = true;\n }\n\n if ( component.Item(\"InImage.ImageType\")==\"Icon\" && CheckProperty(form, component, \"InImage.ID\", \"\") == true)\n {\n if (component.Item(\"OutImage.ImageType\") != \"Icon\")\n {\n sourceStr += codegen.Format(component, \"\\t[!Name].SetIcon([!InImage.ID],[!InImage.ID]);\\n\");\n }\n else\n {\n if (CheckProperty(form, component, \"OutImage.ID\", \"\") == true)\n {\n sourceStr += codegen.Format(component, \"\\t[!Name].SetIcon([!InImage.ID],[!OutImage.ID]);\\n\");\n }\n }\n imageFlag = true;\n }\n\t\n\tif(component.Item(\"EnablePressed\")==true)\n\t{\n\t\tsourceStr+=\"\\t\"+cmpName+\".EnablePressedState(true);\\n\";\n\t\tif(component.Item(\"Pressed\")==true)\n\t\t\tsourceStr+=\"\\t\"+cmpName+\".SetPressed(true);\\n\";\n\t}\n sourceStr+=\"\\n\";\n\n MakeSetFocus(form,component); \n MakeContained(form,component);\n \n if ( imageFlag == true )\n codegen.AddInclude(endIncludeDecl,\"resource.h\");\n\n codegen.AddInclude(endIncludeDecl,CorrectPath(component.Item(\"IncludePath\"))+\"ButtonST.h\");\n codegen.Insert(endMemberDecl,headerStr);\n codegen.Insert(endMemberCreation,sourceStr);\n codegen.Insert(endCtrlIDDecl,MakeControlID(component));\n}", "title": "" }, { "docid": "9ae288500b58c190a45ffe70b330f906", "score": "0.54824096", "text": "static createInBuildingBlockUnderWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widget\", false);\n }", "title": "" }, { "docid": "3abc4dc30fd881ceabe1ca4e3c2ce79f", "score": "0.5473804", "text": "static set toolbarButton(value) {}", "title": "" }, { "docid": "579b88c96543a22e3fd2ecaacd618ad7", "score": "0.5468308", "text": "function create_all_buttons() {\n // Getting the header_admin_bar of each module\n const header_admin_bars = document.querySelectorAll('.ig-header-admin');\n for (const header_admin_bar of header_admin_bars) {\n // Create new button\n let new_button = create_button();\n // The parentElement of the header_admin_bar is the module itself, which has a unique id\n let module_id = header_admin_bar.parentElement.id;\n // Setting this so we can refer to it later\n new_button.id = `unpublish_all_items_btn_${module_id}`;\n header_admin_bar.insertBefore(new_button, header_admin_bar.childNodes[1]);\n }\n}", "title": "" }, { "docid": "39f02a414130d1429b9ad2bc60c76e45", "score": "0.54632556", "text": "function button(content, action) {\n return {\n data: { action: action, content: content },\n component: ButtonComp\n };\n }", "title": "" }, { "docid": "c82c97504a96304e28963095c29466e5", "score": "0.54570585", "text": "function buildContentButtons() {\n const buttonHit = createButton('Pesca', '#3399ff');\n buttonHit.style.marginRight = '10px';\n buttonHit.addEventListener('click', functionHitButt);\n\n const buttonStop = createButton('Fermati', 'red');\n buttonStop.addEventListener('click', functionStopButt);\n\n buttonContent.appendChild(buttonHit);\n buttonContent.appendChild(buttonStop);\n }", "title": "" }, { "docid": "cbeaae6e0253ca32d2f37ea930be0185", "score": "0.5452531", "text": "setButtons() {\n let ingredientButton = new IngredientButton(this.allIngredients);\n ingredientButton.setIngredientButton();\n let applianceButton = new ApplianceButton(this.allAppliances);\n applianceButton.setApplianceButton();\n let ustensilButton = new UstensilButton(this.allUstensils);\n ustensilButton.setUstensilButton();\n }", "title": "" }, { "docid": "4fc202470db39bd5e9684576c7714202", "score": "0.54344565", "text": "function ButtonControl() {}", "title": "" }, { "docid": "52a56a009aa94778f8ba97ef5a91255c", "score": "0.5430691", "text": "setButtons(buttons) {\n this.children.slice().forEach((item) => item.destroy());\n this.children.length = 0;\n if (buttons.indexOf(NavbarCaption.id) !== -1 && buttons.indexOf(DescriptionButton.id) === -1) {\n buttons.splice(buttons.indexOf(NavbarCaption.id), 0, DescriptionButton.id);\n }\n buttons.forEach((button) => {\n if (typeof button === \"object\") {\n new CustomButton(this, button);\n } else if (AVAILABLE_BUTTONS[button]) {\n new AVAILABLE_BUTTONS[button](this);\n } else if (AVAILABLE_GROUPS[button]) {\n AVAILABLE_GROUPS[button].forEach((buttonCtor) => {\n new buttonCtor(this);\n });\n } else {\n logWarn(`Unknown button ${button}`);\n }\n });\n new MenuButton(this);\n this.children.forEach((item) => {\n if (item instanceof AbstractButton) {\n item.checkSupported();\n }\n });\n this.autoSize();\n }", "title": "" }, { "docid": "904bc7ae5a5ef263fddd9589a9ca9b9a", "score": "0.5425147", "text": "function initButtons () {\n\n // reset button\n $(analytics.csts.css.reset).click(function() {\n display.filterAll();\n display.redraw();\n }\n );\n\n // resize button\n var paddingTopInit = $('body').css('padding-top');\n var headerInitHeight = $(analytics.csts.css.header).height();\n var interfaceInitTop = $(analytics.csts.css.columns).cssUnit('top'); // ex : [100, 'px']\n\n $(analytics.csts.css.resize).click(function() {\n $(analytics.csts.css.header).toggle();\n\n if ($(analytics.csts.css.header).is(':hidden')) {\n $(analytics.csts.css.columns).css('top', interfaceInitTop[0] - headerInitHeight + interfaceInitTop[1]);\n $('body').css('padding-top', '0');\n }\n else {\n $(analytics.csts.css.columns).css('top', interfaceInitTop.join(''));\n $('body').css('padding-top', paddingTopInit);\n }\n\n resize();\n });\n\n // add a chart button\n $(analytics.csts.css.addchart).click(function () {\n addChart();\n });\n }", "title": "" }, { "docid": "12fd7871734596da6a7eab7ac27ac690", "score": "0.5423371", "text": "function generateIdeHeaderButtons(providedGrammar) {\n return [\n generateMenu(providedGrammar),\n generateFindAndReplace(),\n generateButton('Toggle default values', $ctrl.api.toggleDefaultValues),\n generateButton('Validate commands', $ctrl.api.validateLines),\n generateButton('Token inspector', $ctrl.api.toggleTokenInspector)\n ];\n }", "title": "" }, { "docid": "430f310fd37a0878639fd318d861b9a6", "score": "0.54195", "text": "function _______MULTI_BLOCK_BUTTONS______() {}", "title": "" }, { "docid": "2c0bef62264403d7b2dead9203a02f02", "score": "0.5417212", "text": "get Button() {}", "title": "" }, { "docid": "5416abb3303e70081f7b8722f005fafe", "score": "0.541649", "text": "static register() {\r\n if (window.customElements.get(tag) === undefined) {\r\n window.customElements.define(tag, Component, { extends: \"button\" });\r\n }\r\n }", "title": "" }, { "docid": "41facc7d09031437794785fe5b09a7b4", "score": "0.5407745", "text": "function toolbarButtons (allTools, usedTools) {\n\n var toolbarButtons = document.createElement(\"span\");\n\n toolbarButtons.classList.add(\"buttons\");\n\n // Walk base buttons list - save buttons origin sorting\n allTools.forEach(function(item) {\n\n if (usedTools.indexOf(item) >= 0) toolbarButtons.appendChild( this.toolbarButton(item) );\n\n }, this);\n\n return toolbarButtons;\n\n }", "title": "" }, { "docid": "775d0080ec18fbcfcee400f4cf4a80a1", "score": "0.5395446", "text": "function pluginButton(options) {\n options = Object.assign({\n show: true,\n onToggle: function () { }\n }, options);\n\n this._btn = button(); // Plugin toggle button\n this._btn.onclick = options.onToggle;\n this.elem = container(this._btn, options.show);\n}", "title": "" }, { "docid": "27116775487dbdafa4ee76f947627645", "score": "0.5393367", "text": "function appendButton(that, opts){\n var opClass = ' op-' + opts.opacity;\n var shClass = ' sh-' + opts.shape;\n var bpClass = ' bp-' + opts.position;\n var bmClass = ' bm-' + opts.margin;\n var szClass = ' sz-' + opts.size;\n var bwClass = ' bw-' + opts.border.width;\n var filterClass = '';\n var hideClass = '';\n var isClass = '';\n var bsClass = '';\n var pClass = '';\n \n var imgCClasses = opts.imgClasses.join(' ');\n var linkCClasses = opts.linkClasses.join(' ');\n var linkClasses = '';\n var imgClasses = '';\n \n var linkStyle = '';\n var imgPath = '';\n var iconColor = '';\n \n // determine icon color\n iconColor = opts.iconColor == 'b' ? 'b' : 'w';\n \n // image path\n imgPath = opts.imagePath + '/' + iconColor + '/' + opts.arrowType + '.svg';\n \n // border\n bwClass = bwClass + iconColor;\n \n // shadows\n if(opts.iconShadow != '')\n isClass = ' is-' + opts.iconShadow ;\n \n if(opts.btnShadow != '')\n bsClass = ' bs-' + opts.btnShadow;\n \n // palette\n if(opts.palette != '')\n pClass = ' p-' + opts.palette.toLowerCase();\n \n // auto hide\n if(opts.autoHide)\n hideClass = ' hide';\n \n // filter\n if(opts.filter)\n filterClass = ' filter';\n \n // build styles \n if(opts.border.color != '' || opts.backgroundColor != '' || !showMobile(opts)){\n var boColor = 'border-color:' + opts.border.color;\n var bgColor = 'background-color:' + opts.backgroundColor;\n var display = !showMobile(opts) ? 'display:none' : '';\n linkStyle = ' style=\"' + bgColor + ';' + boColor + ';' + display + '\"';\n }\n \n // build custom classes \n imgCClasses = imgCClasses.length > 0 ? imgCClasses + ' ' : imgCClasses;\n linkCClasses = linkCClasses.length > 0 ? linkCClasses + ' ' : linkCClasses;\n \n // build link and image classes\n linkClasses = btnClass + opClass + shClass + bpClass + bmClass + pClass + szClass \n + bwClass + bsClass + hideClass + filterClass + linkCClasses;\n \n imgClasses = imgClass + isClass + ' ' + opts.arrowType + '-img' + imgCClasses;\n \n // append to DOM\n $(that).prepend('<a href=\"#\" class=\"' + linkClasses + '\"' + linkStyle \n + '><img src=\"' + imgPath + '\" class=\"' + imgClasses + '\"></a>');\n }", "title": "" }, { "docid": "3511f2a30d309e09f14d9cbe592c9491", "score": "0.539138", "text": "static createInHeaderUnderRightWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"rightWidget\", false);\n }", "title": "" }, { "docid": "7c27da29011017d7e3b3bc8fe8a9be24", "score": "0.5389625", "text": "function attach_buttons() {\n var all_cells = Jupyter.notebook.get_cells();\n $.each(all_cells, function(i, cell) {\n add_wysiwyg_button(cell);\n });\n }", "title": "" }, { "docid": "5e0b7dd3b31e359b4390dd2d896e0bb7", "score": "0.5387211", "text": "function addControlButtons(el) {\n \n var $content = $(el).find('div.dd3-content');\n \n $content.prepend('<a class=\"btn btn-mini controlButton editElement\" title=\"Edit\"><i class=\"icon icon-pencil\"></i></a>');\n $content.prepend('<a class=\"btn btn-mini btn-danger controlButton deleteElement\" title=\"Delete\"><i class=\"icon-white icon-minus\"></i></a>');\n}", "title": "" }, { "docid": "7cfb21a54ddbedddd4cb69659d7eafd7", "score": "0.53825104", "text": "static createInVerticalFlowUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "70e28446a6e9aff1cf24c06f37c351dc", "score": "0.53734857", "text": "function pluginButton(options) {\n options = Object.assign({\n show: true,\n onToggle: function() {}\n }, options);\n\n this._btn = button(); // Plugin toggle button\n this._btn.onclick = options.onToggle;\n this._input = textInput(); // Plugin text input\n this.elem = container(this._btn, this._input, options.show);\n}", "title": "" }, { "docid": "e662708c4a2234d343c058ea53322de5", "score": "0.53734577", "text": "get buttons() {\n return this.__buttons;\n }", "title": "" }, { "docid": "7944b732120e113e08b7ab8932191073", "score": "0.53637654", "text": "static createInTableCellUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "87903aa6215cb0340dc5721893e23ccb", "score": "0.53579074", "text": "function createDescriptorButtonsC(){\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'mw', \"MW\", \".descriptor_buttons_c>button:nth-of-type(1)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'clogp', \"CLOGP\", \".descriptor_buttons_c>button:nth-of-type(2)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'arom', \"AROM\", \".descriptor_buttons_c>button:nth-of-type(3)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'hba', \"HBA\", \".descriptor_buttons_c>button:nth-of-type(4)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'hbd', \"HBD\", \".descriptor_buttons_c>button:nth-of-type(5)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'rtb', \"RTB\", \".descriptor_buttons_c>button:nth-of-type(6)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'psa', \"PSA\", \".descriptor_buttons_c>button:nth-of-type(7)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'apka', \"APKA\", \".descriptor_buttons_c>button:nth-of-type(8)\");\n\t\t\tcreateButton(\".descriptor_buttons_c\", 'bpka', \"BPKA\", \".descriptor_buttons_c>button:nth-of-type(9)\");\n\t\t} //end createDescriptorButtonsC function", "title": "" }, { "docid": "25aae1be45c95d8ab2070e98dc9f0b11", "score": "0.53520143", "text": "function insertButtons() {\n createButton('yes', 'Add Diagram', 'next()');\n createButton('no', 'Reject Diagram', 'draw()');\n showName('or','OR');\n createButton('ready', 'Send Now', 'sendSelected()');\n}", "title": "" }, { "docid": "7a94a61977ba724fd7fab45f21e5e72d", "score": "0.535186", "text": "@api\n get buttons() {\n return this._buttons;\n }", "title": "" }, { "docid": "28429565675ee6304bf415501398aa77", "score": "0.53301233", "text": "function ButtonManager(opt_root) {\n var root = opt_root || document.body;\n this.loadIcons_();\n\n // Make the fullscreen button.\n var fsButton = this.createButton();\n fsButton.src = this.ICONS.fullscreen;\n fsButton.title = 'Fullscreen mode';\n var s = fsButton.style;\n s.bottom = 0;\n s.right = 0;\n fsButton.addEventListener('click', this.createClickHandler_('fs'));\n root.appendChild(fsButton);\n this.fsButton = fsButton;\n\n // Make the VR button.\n var vrButton = this.createButton();\n vrButton.src = this.ICONS.cardboard;\n vrButton.title = 'Virtual reality mode';\n var s = vrButton.style;\n s.bottom = 0;\n s.right = '48px';\n vrButton.addEventListener('click', this.createClickHandler_('vr'));\n root.appendChild(vrButton);\n this.vrButton = vrButton;\n\n this.isVisible = true;\n\n }", "title": "" }, { "docid": "bd42ee67aa89f436d66263a65b8b44ad", "score": "0.5320232", "text": "button(x, y, label) {\n return this.appendChild(new Button(x, y, label));\n }", "title": "" }, { "docid": "c6db1d3a59f5c0873fd8a9396e7f487d", "score": "0.5312691", "text": "static get toolbarButton() {}", "title": "" }, { "docid": "dd366464ed1e5e300007bc778d3a981f", "score": "0.531217", "text": "function createButtons() {\n startButton.remove();\n buttons.forEach((btn) => {\n const button = document.createElement('Button');\n button.setAttribute('type', 'button');\n button.classList.add('btn', 'btn-lg', 'btn-secondary');\n button.style.marginRight = '20px';\n button.innerHTML = `${btn}`;\n buttonWrapper.append(button);\n\n if (button.innerHTML === 'Shuffle') {\n button.addEventListener('click', shuffleAction);\n } else if (button.innerHTML === 'Show/Hide') {\n button.addEventListener('click', showAndHide);\n } else {\n button.addEventListener('click', magicMove);\n }\n });\n\n\n// shuffleButton.setAttribute('type', 'button');\n // shuffleButton.innerHTML = 'Shuffle';\n // shuffleButton.classList.add('btn', 'btn-lg', 'btn-secondary');\n // shuffleButton.style.marginRight = '20px';\n // buttonWrapper.append(shuffleButton);\n // shuffleButton.addEventListener('click', shuffleAction);\n //\n // showHideButton.setAttribute('type', 'button');\n // showHideButton.innerHTML = 'Show/Hide';\n // showHideButton.classList.add('btn', 'btn-lg', 'btn-secondary');\n // showHideButton.style.marginRight = '20px';\n // buttonWrapper.append(showHideButton);\n // showHideButton.addEventListener('click', showAndHide);\n //\n // magicButton.setAttribute('type', 'button');\n // magicButton.innerHTML = 'Magic';\n // magicButton.classList.add('btn', 'btn-lg', 'btn-secondary');\n // buttonWrapper.append(magicButton);\n // magicButton.addEventListener('click', magicMove);\n}", "title": "" }, { "docid": "d9991d6c7b15ed68ebdbedff178de4b3", "score": "0.530923", "text": "function Button() {\n\tthis.createButton = function(text, id) {\n\t\tthis.item = document.createElement(\"button\");\n\t\tthis.item.setAttribute(\"id\", id);\n\t\tthis.item.innerHTML = text;\n\t},\n\n\tthis.addClickEventHandler = function(handler, args) {\n\t\tthis.item.onmouseup = function () { handler(args); };\n\t}\n}", "title": "" }, { "docid": "19b79d46d4431c5ecd6890d56b7ffcff", "score": "0.5308709", "text": "function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText)\n{\n mwCustomEditButtons[mwCustomEditButtons.length] =\n {\"imageFile\": imageFile,\n \"speedTip\": speedTip,\n \"tagOpen\": tagOpen,\n \"tagClose\": tagClose,\n \"sampleText\": sampleText};\n}", "title": "" }, { "docid": "d3e952bb5f0af8c8ab3ffd0b81a910d6", "score": "0.53040785", "text": "function add_users_browtab_ui_buttons(){\n $( \"#button-activate-all\" ).button({\n icons: {\n primary: \"ui-icon-unlocked\",\n secondary: \"ui-icon-folder-collapsed\"\n }\n });\n $( \"#button-set-member-all\" ).button({\n icons: {\n primary: \"ui-icon-person\",\n secondary: \"ui-icon-folder-collapsed\"\n }\n });\n $( \"#button-recognize-account\" ).button({\n icons: {\n primary: \"ui-icon-check\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deny-account\" ).button({\n icons: {\n primary: \"ui-icon-cancel\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-activate-account\" ).button({\n icons: {\n primary: \"ui-icon-unlocked\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deactivate-account\" ).button({\n icons: {\n primary: \"ui-icon-locked\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-set-member-account\" ).button({\n icons: {\n primary: \"ui-icon-person\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deny-member-account\" ).button({\n icons: {\n primary: \"ui-icon-cancel\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-delete-account\" ).button({\n icons: {\n primary: \"ui-icon-trash\",\n secondary: \"ui-icon-tag\"\n }\n });\n}", "title": "" }, { "docid": "751daf49c643ed840e0513797a863609", "score": "0.5300678", "text": "renderToolbarButton() {\n const toolbars = this.instance.getChildByClass(this.instance.root, 'gm-toolbar');\n if (!toolbars) {\n return; // if we don't have toolbar, we can't spawn the widget\n }\n\n const toolbar = toolbars.children[0];\n this.toolbarBtn = document.createElement('li');\n this.toolbarBtnImage = document.createElement('div');\n this.toolbarBtnImage.className = 'gm-icon-button gm-battery-button';\n this.toolbarBtnImage.title = this.i18n.BATTERY_TITLE || 'Battery';\n this.toolbarBtn.appendChild(this.toolbarBtnImage);\n this.toolbarBtn.onclick = this.toggleWidget.bind(this);\n toolbar.appendChild(this.toolbarBtn);\n }", "title": "" }, { "docid": "8aa8427920480db63684b015bda985f5", "score": "0.5294895", "text": "function commandButtons() {\n\tbtnArray = new Array(\n\t\tMM.BTN_OK,\t\t\"clickedOK()\", \n\t MM.BTN_Cancel,\t\"clickedCancel()\", \n\t\tMM.BTN_Help, \t\"displayHelp()\" \n\t);\n\treturn btnArray;\n}", "title": "" }, { "docid": "a6747b423df2319554dcf17e49ae3153", "score": "0.52877486", "text": "function addButtons() {\n const buttonFrame = document.createElement(\"DIV\");\n buttonFrame.classList.add(\"buttonFrame\");\n detailButton = document.createElement(\"P\");\n detailButton.textContent = \"Show Details\";\n detailButton.classList.add(\"detailButton\");\n sortButton = document.createElement(\"P\");\n sortButton.textContent = \"Sort Items\";\n sortButton.classList.add(\"sortButton\");\n componentElement.insertBefore(buttonFrame, listElement);\n buttonFrame.appendChild(detailButton);\n buttonFrame.appendChild(sortButton);\n detailButton = componentElement.querySelector(\".detailButton\");\n detailButton.addEventListener(\"click\", expandAllItems);\n sortButton = componentElement.querySelector(\".sortButton\");\n sortButton.addEventListener(\"click\", sortItems);\n}", "title": "" }, { "docid": "f6d5d470a41936793c15aec2aeddf1eb", "score": "0.5284876", "text": "function _createButton(label, name, action, disabled) {\n var retorno = {};\n retorno.buttonAction = action;\n retorno.disabled = disabled;\n retorno.label = label;\n retorno.name = name;\n retorno.type = \"button\";\n return retorno;\n }", "title": "" }, { "docid": "f6d5d470a41936793c15aec2aeddf1eb", "score": "0.5284876", "text": "function _createButton(label, name, action, disabled) {\n var retorno = {};\n retorno.buttonAction = action;\n retorno.disabled = disabled;\n retorno.label = label;\n retorno.name = name;\n retorno.type = \"button\";\n return retorno;\n }", "title": "" }, { "docid": "1f7f247986ea9bb43dd950587dd2b4f5", "score": "0.5282042", "text": "static createInDataViewUnderFooterWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"footerWidgets\", true);\n }", "title": "" }, { "docid": "e03fad7cbd8b9090c38ce5f733485c45", "score": "0.52786684", "text": "function addLibraryButtons(li, id, yt) {\n var btnstrip = $(\"<div />\").attr(\"class\", \"btn-group qe_buttons\").prependTo(li);\n\n if(hasPermission(\"playlistnext\")) {\n var btnNext = $(\"<button />\").addClass(\"btn qe_btn\")\n .text(\"Next\")\n .appendTo(btnstrip);\n btnNext.click(function() {\n if(yt) {\n socket.emit(\"queue\", {\n id: id,\n pos: \"next\",\n type: \"yt\"\n });\n }\n else {\n socket.emit(\"queue\", {\n id: id,\n pos: \"next\"\n });\n }\n });\n }\n\n var btnEnd = $(\"<button />\").addClass(\"btn qe_btn\").text(\"End\").appendTo(btnstrip);\n btnEnd.click(function() {\n if(yt) {\n socket.emit(\"queue\", {\n id: id,\n pos: \"end\",\n type: \"yt\"\n });\n }\n else {\n socket.emit(\"queue\", {\n id: id,\n pos: \"end\"\n });\n }\n });\n\n if(RANK >= Rank.Moderator) {\n var btnDelete = $(\"<button/>\").addClass(\"btn qe_btn btn-danger\").appendTo(btnstrip);\n $(\"<i/>\").addClass(\"icon-remove\").appendTo(btnDelete);\n btnDelete.click(function() {\n socket.emit(\"uncache\", {\n id: id\n });\n $(li).hide(\"blind\", function() {\n $(li).remove();\n });\n });\n }\n}", "title": "" }, { "docid": "417a51cc0e94aa31c68ac2360dbc6efb", "score": "0.5278115", "text": "static createInDataViewUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "8a8e5c830c2ffd9e9671cc4c4fe30383", "score": "0.5273017", "text": "function showButtons() {\n let self = this;\n\n this.newButton = function (_name, _class, _action, _parent) {\n const button = createButton(_name);\n button.addClass(_class);\n button.parent(_parent);\n button.mousePressed(_action);\n return button;\n }\n\n this.initialize = function () {\n // open homepage button\n let backIcon = '<svg viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z\" /></svg>';\n backButton = self.newButton(backIcon, \"homeButton\", openIndex, \"header\");\n\n // take photo button\n takePhotoButton = self.newButton('Take picture', \"cameraWhiteButton\", takePhoto, \"innerButtonsContainer\");\n\n // confirm button button\n confirmButton = self.newButton('Confirm', \"cameraWhiteButton\", confirmPhoto, \"innerButtonsContainer\");\n confirmButton.hide();\n\n // retake photo button\n retakePhotoButton = self.newButton('Retake picture', \"cameraButton\", retakePhoto, \"innerButtonsContainer\");\n retakePhotoButton.hide();\n }\n\n this.initialize();\n\n //console.log(confirmButton);\n}", "title": "" }, { "docid": "a2fcabcdb5c2d049af1fa46cf90a2a37", "score": "0.5272904", "text": "function RemoteButton() {\r\n\tthis.id = remoteButtonIdCounter++;\r\n\t\r\n\tthis.text = getRes(\"remoteButtonText\");\r\n\tthis.executeFns = [];\r\n\t\r\n\tthis.showAutoSpanAfterRect = [];\r\n\tthis.hideAutoSpanAfterRect = [];\r\n\t\r\n\t\r\n /**\r\n\t * write the HTML code that will be used for displaying the remoteButton button\r\n\t */\r\n\tthis.WriteHtml = function() {\r\n\t\tvar idstring = \"\\\"RemoteButtonButton\" + this.id + \"\\\"\";\r\n\t\tdocument.write(\"<form onsubmit=\\\"return false;\\\">\");\r\n\t\tdocument.write(\"<input type=\\\"button\\\" name=\" + idstring + \" id=\"\r\n\t\t\t\t+ idstring + \" value=\\\"\" + this.text\r\n\t\t\t\t+ \"\\\" onclick=\\\"remoteButtonArray[\" + this.id + \"].OnClick()\\\"/>\");\r\n\t\tdocument.write(\"</form>\");\r\n\t};\r\n\r\n\t/**\r\n\t * this function sets the text of the component\r\n\t * \r\n\t * @returns this\r\n\t */\r\n\tthis.Text = function(text) {\r\n\t\tthis.text = text;\r\n\t\treturn this;\r\n\t};\r\n\r\n\t/**\r\n\t * this is called whenever the button is clicked\r\n\t */\r\n\tthis.OnClick = function() {\r\n\t\t\r\n\t\tmyLogger.Log(\"remoteButton[\"+this.id+\"] clicked.\");\r\n\t\t\r\n\t\tvar all_done = true;\r\n\t\t\r\n\t\tfor ( var int = 0; int < this.executeFns.length; int++) {\r\n\t\t\tvar fn = this.executeFns[int];\r\n\t\t\tvar retval = fn();\r\n\t\t\tif (typeof retval == \"undefined\") {\r\n\t\t\t\t\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tif (!retval)\r\n\t\t\t\t\tall_done = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (all_done) {\r\n\t\t\tmyLogger.Log(\"Remote button \" + this.id+ \": show/hide autospans.\");\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * magically hide some elements\r\n\t\t\t */\r\n\t\t\t\r\n\t\t\tfor ( var int99 = 0; int99 < this.hideAutoSpanAfterRect.length; int99++) {\r\n\t\t\t\tvar name = this.hideAutoSpanAfterRect[int99];\r\n\t\t\t\t\r\n\t\t\t\tvar span = autoSpanNames[name];\r\n\t\t\t\t\r\n\t\t\t\tif (span)\r\n\t\t\t\t{\r\n\t\t\t\t\tspan.SetValue(0);\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/**\r\n\t\t\t * magically show some elements\r\n\t\t\t */\r\n\t\t\t\r\n\t\t\tfor ( var int99 = 0; int99 < this.showAutoSpanAfterRect.length; int99++) {\r\n\t\t\t\tvar name = this.showAutoSpanAfterRect[int99];\r\n\t\t\t\t\r\n\t\t\t\tvar span = autoSpanNames[name];\r\n\t\t\t\t\r\n\t\t\t\tif (span)\r\n\t\t\t\t{\r\n\t\t\t\t\tspan.SetValue(1);\r\n\t\t\t\t}\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t};\r\n\t\r\n\t/**\r\n\t * adds autospans to hide after rectification\r\n\t * \r\n\t * @param namelist a string with , separated names for autospan objects\r\n\t * \r\n\t * @returns this\r\n\t */\r\n\t\r\n\tthis.HideAfter = function(namelist) {\r\n\t\tvar split = namelist.split(\",\");\r\n\t\tfor ( var int = 0; int < split.length; int++) {\r\n\t\t\tvar x = split[int];\r\n\t\t\tthis.hideAutoSpanAfterRect.push(x);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * adds autospans to show after rectification\r\n\t * \r\n\t * @param namelist a string with , separated names for autospan objects\r\n\t * \r\n\t * @returns this\r\n\t */\r\n\t\r\n\tthis.ShowAfter = function(namelist) {\r\n\t\tvar split = namelist.split(\",\");\r\n\t\tfor ( var int = 0; int < split.length; int++) {\r\n\t\t\tvar x = split[int];\r\n\t\t\tthis.showAutoSpanAfterRect.push(x);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn this;\r\n\t};\r\n\r\n\r\n\t/**\r\n\t * adds a slave call\r\n\t */\r\n\t\r\n\tthis.AddSlaveCall = function(fn) {\r\n\t\tthis.executeFns.push(fn);\r\n\t\treturn this;\r\n\t};\r\n\r\n\tremoteButtonArray[this.id] = this;\r\n}", "title": "" }, { "docid": "5014bbd9041d2902a5511dfeb55ead86", "score": "0.5270744", "text": "function btnArray(a,bf) {\n\t\tvar\tb = 'button', c = cre('div'), d,i,j,k;\n\n\t\t\tfunction btnContent(e, a) {\n\t\t\tvar\tt = lang.b[a[0]], d = '<div class=\"'+b+'-', c = '</div>';\n\t\t\t\te.title = t.t?t.t:t;\n\t\t\t\tsetContent(e, d+'key\">'+a[1]+c+a[2]+d+'subtitle\"><br>'+(t.t?t.sub:a[0])+c);\n\t\t\t\treturn e;\n\t\t\t}\n\n\t\t\tfor (i in a) if (isNaN(k = a[i])) {\n\t\t\t\td = cre(b);\n\n\t\t\t\tif (k[0].indexOf('|') > 0) {\n\t\t\t\tvar\tsubt = k[0].split('|')\n\t\t\t\t,\tpict = k[2].split('|');\n\t\t\t\t\tfor (j in subt) setClass(d.appendChild(btnContent(\n\t\t\t\t\t\tcre('div'), [subt[j], k[1], pict[j]]\n\t\t\t\t\t)), 'abc'[j]);\n\t\t\t\t} else btnContent(d, k);\n\n\t\t\t\tsetClass(d, b);\n\t\t\t\tif (k.length > 3) setEvent(d, 'onclick', k[3]);\n\t\t\t\tif (k.length > 4) setId(d, k[4]);\n\t\t\t\tc.appendChild(d);\n\t\t\t} else if (k != -1) c.innerHTML += k < 0?'<hr>':(k?repeat(s,k):'<br>');\n\t\t\tsetClass(c, b+'s');\n\t\t\treturn bf ? e.insertBefore(c, bf) : e.appendChild(c);\n\t\t}", "title": "" }, { "docid": "4a751159b2a0a933a214e8d233914fd9", "score": "0.5268745", "text": "function makeButton(classes, content, selected, size, color, inlineType, icon, inner, toggle,\n func, useCapture, listners) {\n let workClasses = [\"btn\"];\n\n switch (size) {\n case \"extra-small\":\n workClasses.push(\"btn-xs\");\n break;\n case \"small\":\n workClasses.push(\"btn-sm\");\n break;\n case \"large\":\n workClasses.push(\"btn-lg\");\n break;\n default:\n }\n\n switch (color) {\n case \"primary\":\n workClasses.push(\"btn-primary\");\n break;\n case \"info\":\n workClasses.push(\"btn-info\");\n break;\n case \"success\":\n workClasses.push(\"btn-success\");\n break;\n case \"warning\":\n workClasses.push(\"btn-warning\");\n break;\n case \"error\":\n workClasses.push(\"btn-error\");\n break;\n default:\n }\n\n switch (inlineType) {\n case \"inline\":\n workClasses.push(\"inline-block\");\n break;\n case \"inline-tight\":\n workClasses.push(\"inline-block\");\n break;\n default:\n }\n\n if (selected === true) {\n workClasses.push(\"selected\");\n }\n if (icon !== null && icon !== \"no-icon\") {\n workClasses = workClasses.concat([\"icon\", icon]);\n }\n\n let ele = createElementWithClass(\"button\", workClasses.concat(classes));\n if (content !== null) {\n ele.textContent = content;\n }\n if (inner !== null) {\n ele.innerHTML = inner;\n }\n if (toggle !== null) {\n setToggleState(ele, toggle);\n listners.push(setEventListener(ele, \"click\", changeToggleState(ele), useCapture));\n }\n if (!isEmptyObject(func)) {\n listners.push(setEventListener(ele, \"click\", func, useCapture)); //spaceを押すとclickイベントが起こる\n }\n return ele;\n}", "title": "" }, { "docid": "d89309f96efb2f4fc46fe4040c78f683", "score": "0.5267194", "text": "showButtons() {\n const buttons = this._plugin.getButtons();\n\n var activeButtons = [];\n\n //\n // Query editor to know what buttons are active\n // - reflect button in toolbar\n // - update the block status\n //\n\n // Find what buttons are active\n buttons.forEach((name) => {\n var isActive = false;\n let el = $(this.getSelectedElement());\n\n // if we're in a b, span, a, etc element inside of the block element (i.e. b/c of a chosen color, or link),\n // get the block as the selected element.\n const closestBlockElement = el.parents('.block')[0];\n if (el.is('b, i, u, span, a') && closestBlockElement) {\n el = closestBlockElement;\n }\n else {\n el = el[0];\n }\n\n // if the button is a left/center/right justify, see if the button should be active based on the element's text-align value.\n if ((/^justify.+/i).test(name)) {\n const regexResult = (/^justify(.+)/i).exec(name);\n // get the position value of the button -- left, center, right\n const justifyPosition = regexResult && typeof regexResult[1] === 'string' ? regexResult[1].toLowerCase() : '';\n // if the text-align value matches the button position, the button should be selected.\n isActive = $(el).css('text-align') === justifyPosition;\n }\n else {\n isActive = this._buttonsClasses[name].isAlreadyApplied(el);\n }\n\n if (isActive) {\n activeButtons.push(name);\n }\n });\n\n // Update the buttons status\n buttons.forEach((name) => {\n var isActive = activeButtons.indexOf(name) > -1;\n $('.block-button[data-button=' + name + ']').toggleClass('active', isActive);\n });\n\n var activeButton = 'justifyLeft';\n\n if (activeButtons.length) {\n if(activeButtons.indexOf('h1') > -1) {\n activeButton = 'h1';\n }\n else if(activeButtons.indexOf('h2') > -1) {\n activeButton = 'h2';\n }\n else if(activeButtons.indexOf('quote') > -1) {\n activeButton = 'quote';\n }\n else {\n activeButton = activeButtons[0];\n }\n }\n // For IE\n else {\n activeButtons = [activeButton];\n $('.block-button[data-button=' + activeButton + ']').toggleClass('active', true);\n }\n\n // Set the button icon\n this._button.innerHTML = `<a class=\"block-toolbar-button-status\">${this._defaultButtons[activeButton].contentFA}</a>`;\n\n // Display and position the toolbar\n this._button.classList.add('active');\n this.positionToolbar();\n this._activeButtons = activeButtons;\n }", "title": "" }, { "docid": "57f15719101ccbca9c235dcfa3646c64", "score": "0.52641827", "text": "function commandButtons()\n{\n\t// find the index of the current recordset in MM.rsTypes\n\t//rsIndex = recordsetDialog.searchByType(RECORDSET_TYPE);\n\t\n\tbtnArray = new Array(\n\t\tMM.BTN_OK, \"clickedOK()\", \n MM.BTN_Cancel, \"clickedCancel()\", \n MM.BTN_Test, \"PopUpTestDialog()\");\n\t// add a button for each different rs type\n\tfor (i = 0;i < MM.rsTypes.length;i++) {\n\t\tif(MM.rsTypes[i].single == \"true\") {\n\t\t\tcontinue;\n\t\t}\n \tif (dw.getDocumentDOM().serverModel.getServerName() == MM.rsTypes[i].serverModel) {\n \t\tif (RECORDSET_TYPE.toLowerCase() != MM.rsTypes[i].type.toLowerCase()) {\n\t\t\t\tvar btnLabel = dw.loadString(\"recordsetType/\" + MM.rsTypes[i].type);\n\t\t\t\tif (!btnLabel) \n\t\t\t\t\tbtnLabel = MM.rsTypes[i].type;\n\t\t\t\tbtnArray.push(btnLabel+\"...\");\n\t\t\t\tbtnArray.push(\"clickedChange(\" + i + \")\");\n\t\t\t}\n\t\t}\n\t}\n\tbtnArray.push(MM.BTN_Help);\n\tbtnArray.push(\"displayHelp()\"); \n\treturn btnArray;\n}", "title": "" }, { "docid": "cf3cd9ebb31ce17f926a6f68ed805095", "score": "0.5260045", "text": "static createInTableCellUnderWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widget\", false);\n }", "title": "" }, { "docid": "e429dd343696ecccad708be9fafa9c4a", "score": "0.52556247", "text": "function commandButtons()\n{ \n return new Array(MM.BTN_OK, \"okClicked()\",\n MM.BTN_Cancel, \"cancelClicked()\",\n MM.BTN_Help, \"displayHelp()\" );\n}", "title": "" }, { "docid": "e44cb81fe5ff5b97387c8ef4a4ba348d", "score": "0.52554315", "text": "get buttons() {\n\t\tconst slot = this.shadowRoot.querySelector('slot[name=\"button\"]');\n\t\treturn slot.assignedElements();\n\t}", "title": "" }, { "docid": "d41d6ca3efcdb91b817f0697ac110ef8", "score": "0.5249114", "text": "static createInNativeLayoutCallArgumentUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.23.0\", end: \"7.23.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "6e512fb7268cd3e60eaf932701c6146e", "score": "0.52479607", "text": "function createButtons(buttons)\r\n\t\t\t{\r\n\t\t\t\tif ($.isArray(buttons) && buttons.length > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar reservedAttr = ['html', 'action'];\r\n\t\t\t\t\tvar buttonsContainer = $(document.createElement('div'));\r\n\r\n\t\t\t\t\tbuttonsContainer.addClass('speedo-notify-custom-buttons');\r\n\r\n\t\t\t\t\tfor (var i = 0; i < buttons.length; i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar button = $(document.createElement('a'));\r\n\r\n\t\t\t\t\t\tbutton.attr('href', 'javascript: void(0);');\r\n\t\t\t\t\t\tif (buttons[i]['html'])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tbutton.html(buttons[i]['html']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor (var key in buttons[i])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (reservedAttr.indexOf(key) == -1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbutton.attr(key, buttons[i][key]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($.isFunction(buttons[i]['action']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Register callback.\r\n\t\t\t\t\t\t\tbutton.click(buttons[i]['action']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbuttonsContainer.append(button);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn buttonsContainer;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}", "title": "" }, { "docid": "d0abf8f01c445eea86c09a938d45d86b", "score": "0.52434593", "text": "function createButtons() {\n let body = document.getElementsByTagName(\"body\")[0];\n let div = document.createElement(\"div\");\n div.className = \"buttons\";\n body.appendChild(div);\n let btnVideoGames = document.createElement(\"button\");\n btnVideoGames.innerText = \"Video Games\";\n btnVideoGames.onclick = onVideoGames;\n div.appendChild(btnVideoGames);\n\n let btnMovies = document.createElement(\"button\");\n btnMovies.innerText = \"Movies\";\n btnMovies.onclick = onMovies;\n div.appendChild(btnMovies);\n\n let btnKickStarter = document.createElement(\"button\");\n btnKickStarter.innerText = \"Kickstarter\";\n btnKickStarter.onclick = onKickStarter;\n div.appendChild(btnKickStarter);\n}", "title": "" }, { "docid": "cdfe9778a9ceb87434cadb7db36ec3e0", "score": "0.5237715", "text": "function w3_btn(text, cb)\n{\n console.log('### DEPRECATED: w3_btn');\n return w3_button('', text, cb);\n}", "title": "" }, { "docid": "cc5c0ab5d4137f431deea6f126d21a72", "score": "0.52373487", "text": "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var wgt = $this.data('bs.button')\n var options = typeof option == 'object' && option\n\n if (!wgt) {\n $this.data('bs.button', (wgt = new Button(this, options)));\n }\n\n if (option == 'toggle') {\n wgt.toggle();\n } else if (option) {\n wgt.setState(option);\n }\n });\n }", "title": "" }, { "docid": "6425abdb187b01e4f47939004caad677", "score": "0.5229385", "text": "static createInGroupBoxUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "0480af8818af9bdc51dc9f558cf80132", "score": "0.5224474", "text": "function init() {\n /**\n * -----------------------------------------------------------------\n * Purpose: Create a top panel button (Empty Icon by Default).\n * -----------------------------------------------------------------\n * StBin is a simple container with one actor, the hierarchy inherits\n * more from StWidget, see the graph below. This is common for the\n * St Items.\n *\n * -----------------------------------------------------------------\n * Structure: Making Sense of the Object\n * -----------------------------------------------------------------\n * GObject\n * ╰── GInitiallyUnowned\n * ╰── ClutterActor\n * ╰── StWidget <-- Properties Inherited\n * ╰── StBin\n * ╰── StButton <-- Item we Created\n *\n * - StWidget Parent Properties Used:\n * style_class, reactive, can_focus,track_hover\n * - StBin Properties Used:\n * x_fill, y_fill\n *\n * -----------------------------------------------------------------\n * Answers: What's Happening\n * -----------------------------------------------------------------\n * - Creates a Single Element\n * - Parameters pass do the following:\n * - style_class: refers to your stylesheets.css, aka .panel-button styles`\n * - reactive: ST Parameter which allows responding to Mouse Clicks.\n * - can_focus: ST Parameter which allows responding to Keyboard.\n * - x_fill: (Default false)\n * Whether the child should fill the horizontal allocation\n * - y_fill: (Default false, shouldnt need to be here)\n * Whether the child should fill the vertical allocation\n * - track_hover: ST Parameter which allows Reacting to Mouse Hover.\n *\n * -----------------------------------------------------------------\n * References\n * -----------------------------------------------------------------\n * StBin: https://developer.gnome.org/st/stable/StBin.html\n * StWidget (Inherited): https://developer.gnome.org/st/stable/StWidget.html\n * - See the Properties\n * -----------------------------------------------------------------\n */\n button = new St.Bin({\n style_class: 'panel-button',\n reactive: true,\n can_focus: true,\n x_fill: true,\n y_fill: false,\n track_hover: true\n });\n\n\n /**\n * -----------------------------------------------------------------\n * Purpose: Creates an Icon\n * -----------------------------------------------------------------\n * This create an Icon and placed it in the button we created above.\n *\n * -----------------------------------------------------------------\n * Structure: Making Sense of the Object\n * -----------------------------------------------------------------\n * GObject\n * ╰── GInitiallyUnowned\n * ╰── ClutterActor\n * ╰── StWidget <-- Properties Inherited\n * ╰── StIcon <-- Item we Create\n *\n * -----------------------------------------------------------------\n * Answers: What's Happening\n * -----------------------------------------------------------------\n * - Create a new Icon\n * - icon_name: A name of the icon\n * - style_class: CSS Style for Icon (From extended StWiget)\n * Appears to be a built in style somewhere.\n *\n * -----------------------------------------------------------------\n * References\n * -----------------------------------------------------------------\n * StIcon: https://developer.gnome.org/st/stable/st-st-icon.html\n * StWidget (Inherited): https://developer.gnome.org/st/stable/StWidget.html\n * - See the Properties\n */\n let icon = new St.Icon({\n icon_name: 'system-run',\n style_class: 'system-status-icon'\n });\n\n\n /**\n * -----------------------------------------------------------------\n * Purpose: Append the icon to the botton.\n * -----------------------------------------------------------------\n * This is called an \"Actor\" because it \"Acts as Someting\"\n *\n * @TODO Figure out where this is defined?\n * @TODO Asked at SO:\n * https://stackoverflow.com/questions/46399598/gnome-shell-extension-library-beginner-where-is-the-button-connect-defined\n * -----------------------------------------------------------------\n * References\n * -----------------------------------------------------------------\n * - [https://developer.gnome.org/st/stable/StBin.html#st-bin-set-child](https://developer.gnome.org/st/stable/StBin.html#st-bin-set-child)\n * - set_child comes from StBin, it omits 'st_bin' from 'st_bin_set_child()'\n * thus only using set_child().\n */\n button.set_child(icon);\n\n /**\n * -----------------------------------------------------------------\n * Purpose: Connect the button to an Event (Make it do something)\n * -----------------------------------------------------------------\n * Action: button-press-event\n * Custom Function: _showHello\n *\n * This \"Emits\" a \"Signal\" for the UI.\n *\n * Signals come from the \"ClutterActor.Signals\", most things are\n * in the \"Clutter\" class which is a C library we speak to with JS bindings.\n */\n button.connect('button-press-event', _showHello);\n}", "title": "" }, { "docid": "d43139eeb3795348bebcae64e0da3740", "score": "0.5223451", "text": "function Button(label, size = ImVec2.ZERO) {\r\n return bind.Button(label, size);\r\n }", "title": "" }, { "docid": "a15a3aeb7f11aa6bdda18fdeb83a8f20", "score": "0.5220314", "text": "function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data(\"bs.button\"),options=\"object\"==typeof option&&option;data||$this.data(\"bs.button\",data=new Button(this,options)),\"toggle\"==option?data.toggle():option&&data.setState(option)})}", "title": "" }, { "docid": "a15a3aeb7f11aa6bdda18fdeb83a8f20", "score": "0.5220314", "text": "function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data(\"bs.button\"),options=\"object\"==typeof option&&option;data||$this.data(\"bs.button\",data=new Button(this,options)),\"toggle\"==option?data.toggle():option&&data.setState(option)})}", "title": "" }, { "docid": "5538125031d1d0c9cb2b1708ee775d10", "score": "0.52172714", "text": "static createInGroupBoxUnderWidget(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widget\", false);\n }", "title": "" }, { "docid": "18547006e29bee87ae0284058d02fe61", "score": "0.5217257", "text": "addButtons(buttons) {\n if (buttons && buttons.length) {\n this.asset.config.buttons.push(...buttons);\n this.asset.map.buttons = ArrayMapSetter(this.asset.config.buttons, 'id');\n this._emitChange('buttons');\n }\n }", "title": "" }, { "docid": "de0526b977c47fd76b3ac9a85754ec10", "score": "0.52147543", "text": "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.button');var options=(typeof option==='undefined'?'undefined':_typeof2(option))=='object'&&option;if(!data)$this.data('bs.button',data=new Button(this,options));if(option=='toggle')data.toggle();else if(option)data.setState(option);});}", "title": "" }, { "docid": "de0526b977c47fd76b3ac9a85754ec10", "score": "0.52147543", "text": "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.button');var options=(typeof option==='undefined'?'undefined':_typeof2(option))=='object'&&option;if(!data)$this.data('bs.button',data=new Button(this,options));if(option=='toggle')data.toggle();else if(option)data.setState(option);});}", "title": "" }, { "docid": "0767cf0eb8cda249568d9c27139c9ecc", "score": "0.5211563", "text": "function Button (options) {\n options || (options = {});\n Component.prototype.constructor.apply(this, arguments);\n return this;\n}", "title": "" }, { "docid": "66b7b6a661161daeee5d9f863e8a1950", "score": "0.521085", "text": "function ToolbarButton(image, label, description) {\n\tthis.image = image;\n\tthis.label = label;\n\tthis.description = description;\n\tthis.button = null;\n\n\t/**\n\t * Creates a button with the input image and label.\n\t * @param none\n\t * @return - The HTML string of the button.\n\t */\n\tthis.create = function createToolbarButton() {\n\t\tvar html = '<table class=\"toolbar-button-table\">';\n\t\thtml += '<tr>';\n\t\thtml += '<td class=\"toolbar-button-left\"></td>';\n\t\thtml += '<td class=\"toolbar-button-image\"><div class=\"'+ this.image + '\"></div></td>';\n\t\thtml += '<td class=\"toolbar-button-label\">' + this.label + '</td>';\n\t\thtml += '<td class=\"toolbar-button-right\"></td>';\n\t\thtml += '</tr>';\n\t\thtml += '</table>';\n\t\treturn html;\n\t};\n\t\n\t/**\n\t * Displays the button and initializes the various states of the button\n\t * @param toolbar - The toolbar to display this button on.\n\t * @param dialog - The dialog to display when clicking the button.\n\t */\n\tthis.display = function displayToolbarButton(toolbar, dialog) {\n\t\tthis.button = $(document.createElement('div'));\n\t\tthis.button.addClass(\"toolbar-button\");\n\t\tthis.button.append(this.create());\n\n\t\tthis.button.mouseover(function() {\n\t\t\tif(this.disabled == true) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$($(this).children()[0].rows[0].cells[0]).addClass(\"toolbar-button-left hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[1]).addClass(\"toolbar-button-image hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[2]).addClass(\"toolbar-button-label hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[3]).addClass(\"toolbar-button-right hover\");\n\t\t});\n\t\tthis.button.mouseleave(function() {\n\t\t\tif(this.disabled == true) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$($(this).children()[0].rows[0].cells[0]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[1]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[2]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[3]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[0]).removeClass(\"click\");\n\t\t\t$($(this).children()[0].rows[0].cells[1]).removeClass(\"click\");\n\t\t\t$($(this).children()[0].rows[0].cells[2]).removeClass(\"click\");\n\t\t\t$($(this).children()[0].rows[0].cells[3]).removeClass(\"click\");\n\t\t});\n\t\tthis.button.mousedown(function() {\n\t\t\tif(this.disabled == true) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$($(this).children()[0].rows[0].cells[0]).addClass(\"toolbar-button-left click\");\n\t\t\t$($(this).children()[0].rows[0].cells[1]).addClass(\"toolbar-button-image click\");\n\t\t\t$($(this).children()[0].rows[0].cells[2]).addClass(\"toolbar-button-label click\");\n\t\t\t$($(this).children()[0].rows[0].cells[3]).addClass(\"toolbar-button-right click\");\n\t\t});\n\t\tthis.button.mouseup(function() {\n\t\t\tif(this.disabled == true) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(dialog != null) {\n\t\t\t\tdialog.display();\n\t\t\t}\n\t\t\t$($(this).children()[0].rows[0].cells[0]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[1]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[2]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[3]).removeClass(\"hover\");\n\t\t\t$($(this).children()[0].rows[0].cells[0]).removeClass(\"click\");\n\t\t\t$($(this).children()[0].rows[0].cells[1]).removeClass(\"click\");\n\t\t\t$($(this).children()[0].rows[0].cells[2]).removeClass(\"click\");\n\t\t\t$($(this).children()[0].rows[0].cells[3]).removeClass(\"click\");\n\t\t});\n\t\ttoolbar.append(this.button);\n\t}\n\t\n\t/**\n\t * Disables the button by dithering its display and text.\n\t * @param none\n\t */\n\tthis.disable = function disableToolbarButton() {\n\t\tthis.button[0].disabled = true;\n\t\t$(this.button.children()[0].rows[0].cells[1]).addClass(\"dithered\");\n\t}\n\t\n\t/**\n\t * Enables the button.\n\t * @param none\n\t */\n\tthis.enable = function enableToolbarButton() {\n\t\tthis.button[0].disabled = false;\n\t\t$(this.button.children()[0].rows[0].cells[1]).removeClass(\"dithered\");\n\t}\n\t\n\t\t/**\n\t * Hides and disables the button by changing the display.\n\t * @param none\n\t */\n\tthis.hide = function hideToolbarButton() {\n\t\tthis.button[0].disabled = true;\n\t\t$(this.button.children()[0].rows[0]).addClass(\"toolbar-button-hide\");\n\t}\n\t\n\t/**\n\t * Shows and enables the button by changing the display.\n\t * @param none\n\t */\n\tthis.show = function showToolbarButton() {\n\t\tthis.button[0].disabled = false;\n\t\t$(this.button.children()[0].rows[0]).removeClass(\"toolbar-button-hide\");\n\t}\n}", "title": "" }, { "docid": "e1d1bc9769ab8d4edb2f847097b2422b", "score": "0.5208858", "text": "get buttonContainer() {}", "title": "" }, { "docid": "31be3c23c1af90e21e31574d71f8798d", "score": "0.520872", "text": "function _buildControls() {\n // Create html array\n var html = [],\n iconUrl = _getIconUrl(),\n iconPath = (!iconUrl.absolute ? iconUrl.url : '') + '#' + config.iconPrefix;\n\n // Larger overlaid play button\n if (_inArray(config.controls, 'play-large')) {\n html.push(\n '<button type=\"button\" data-plyr=\"play\" class=\"plyr__play-large\">',\n '<svg><use xlink:href=\"' + iconPath + '-play\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.play + '</span>',\n '</button>'\n );\n }\n\n html.push('<div class=\"plyr__controls\">');\n\n // Restart button\n if (_inArray(config.controls, 'restart')) {\n html.push(\n '<button type=\"button\" data-plyr=\"restart\">',\n '<svg><use xlink:href=\"' + iconPath + '-restart\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.restart + '</span>',\n '</button>'\n );\n }\n\n // Rewind button\n if (_inArray(config.controls, 'rewind')) {\n html.push(\n '<button type=\"button\" data-plyr=\"rewind\">',\n '<svg><use xlink:href=\"' + iconPath + '-rewind\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.rewind + '</span>',\n '</button>'\n );\n }\n\n // Play Pause button\n // TODO: This should be a toggle button really?\n if (_inArray(config.controls, 'play')) {\n html.push(\n '<button type=\"button\" data-plyr=\"play\">',\n '<svg><use xlink:href=\"' + iconPath + '-play\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.play + '</span>',\n '</button>',\n '<button type=\"button\" data-plyr=\"pause\">',\n '<svg><use xlink:href=\"' + iconPath + '-pause\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.pause + '</span>',\n '</button>'\n );\n }\n\n // Fast forward button\n if (_inArray(config.controls, 'fast-forward')) {\n html.push(\n '<button type=\"button\" data-plyr=\"fast-forward\">',\n '<svg><use xlink:href=\"' + iconPath + '-fast-forward\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.forward + '</span>',\n '</button>'\n );\n }\n\n // Progress\n if (_inArray(config.controls, 'progress')) {\n // Create progress\n html.push('<span class=\"plyr__progress\">',\n '<label for=\"seek{id}\" class=\"plyr__sr-only\">Seek</label>',\n '<input id=\"seek{id}\" class=\"plyr__progress--seek\" type=\"range\" min=\"0\" max=\"100\" step=\"0.1\" value=\"0\" data-plyr=\"seek\">',\n '<progress class=\"plyr__progress--played\" max=\"100\" value=\"0\" role=\"presentation\"></progress>',\n '<progress class=\"plyr__progress--buffer\" max=\"100\" value=\"0\">',\n '<span>0</span>% ' + config.i18n.buffered,\n '</progress>');\n\n // Seek tooltip\n if (config.tooltips.seek) {\n html.push('<span class=\"plyr__tooltip\">00:00</span>');\n }\n\n // Close\n html.push('</span>');\n }\n\n // Media current time display\n if (_inArray(config.controls, 'current-time')) {\n html.push(\n '<span class=\"plyr__time\">',\n '<span class=\"plyr__sr-only\">' + config.i18n.currentTime + '</span>',\n '<span class=\"plyr__time--current\">00:00</span>',\n '</span>'\n );\n }\n\n // Media duration display\n if (_inArray(config.controls, 'duration')) {\n html.push(\n '<span class=\"plyr__time\">',\n '<span class=\"plyr__sr-only\">' + config.i18n.duration + '</span>',\n '<span class=\"plyr__time--duration\">00:00</span>',\n '</span>'\n );\n }\n\n // Toggle mute button\n if (_inArray(config.controls, 'mute')) {\n html.push(\n '<button type=\"button\" data-plyr=\"mute\">',\n '<svg class=\"icon--muted\"><use xlink:href=\"' + iconPath + '-muted\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath + '-volume\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleMute + '</span>',\n '</button>'\n );\n }\n\n // Volume range control\n if (_inArray(config.controls, 'volume')) {\n html.push(\n '<span class=\"plyr__volume\">',\n '<label for=\"volume{id}\" class=\"plyr__sr-only\">' + config.i18n.volume + '</label>',\n '<input id=\"volume{id}\" class=\"plyr__volume--input\" type=\"range\" min=\"' + config.volumeMin + '\" max=\"' + config.volumeMax + '\" value=\"' + config.volume + '\" data-plyr=\"volume\">',\n '<progress class=\"plyr__volume--display\" max=\"' + config.volumeMax + '\" value=\"' + config.volumeMin + '\" role=\"presentation\"></progress>',\n '</span>'\n );\n }\n\n // Toggle captions button\n if (_inArray(config.controls, 'captions')) {\n html.push(\n '<button type=\"button\" data-plyr=\"captions\">',\n '<svg class=\"icon--captions-on\"><use xlink:href=\"' + iconPath + '-captions-on\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath+ '-captions-off\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleCaptions + '</span>',\n '</button>'\n );\n }\n\n // Toggle fullscreen button\n if (_inArray(config.controls, 'fullscreen')) {\n html.push(\n '<button type=\"button\" data-plyr=\"fullscreen\">',\n '<svg class=\"icon--exit-fullscreen\"><use xlink:href=\"' + iconPath + '-exit-fullscreen\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath + '-enter-fullscreen\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleFullscreen + '</span>',\n '</button>'\n );\n }\n\n // Close everything\n html.push('</div>');\n\n return html.join('');\n }", "title": "" }, { "docid": "8fa88595ab0f8323d0dde1a3eae2f89f", "score": "0.5208231", "text": "function createButton(opts) {\n opts = $.extend(\n {\n // Aria label for the button\n label: \"\",\n\n // Icon to show\n icon: \"\",\n\n // Inner text\n text: \"\",\n\n // Right or left position\n position: \"left\",\n\n // Other class name to add to the button\n className: \"\",\n\n // Triggered when user click on the button\n onClick: defaultOnClick,\n\n // Button is a dropdown\n dropdown: null,\n\n // Position in the toolbar\n index: null,\n\n // Button id for removal\n id: generateId(),\n },\n opts || {}\n );\n\n buttons.push(opts);\n updateButton(opts);\n\n return opts.id;\n}", "title": "" }, { "docid": "c87404ce1cd6ac9e5bda6a1dfbdb13c7", "score": "0.5206456", "text": "static createInLayoutGridColumnUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ReportButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ReportButton, \"widgets\", true);\n }", "title": "" }, { "docid": "771cf184112715a358a946670cc376ee", "score": "0.5199767", "text": "function _buildControls() {\n // Create html array\n var html = [],\n iconUrl = _getIconUrl(),\n iconPath = (!iconUrl.absolute ? iconUrl.url : '') + '#' + config.iconPrefix;\n\n // Larger overlaid play button\n if (_inArray(config.controls, 'play-large')) {\n html.push(\n '<button type=\"button\" data-plyr=\"play\" class=\"plyr__play-large\">',\n '<svg><use xlink:href=\"' + iconPath + '-play\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.play + '</span>',\n '</button>'\n );\n }\n\n html.push('<div class=\"plyr__controls\">');\n\n // Restart button\n if (_inArray(config.controls, 'restart')) {\n html.push(\n '<button type=\"button\" data-plyr=\"restart\">',\n '<svg><use xlink:href=\"' + iconPath + '-restart\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.restart + '</span>',\n '</button>'\n );\n }\n\n // Rewind button\n if (_inArray(config.controls, 'rewind')) {\n html.push(\n '<button type=\"button\" data-plyr=\"rewind\">',\n '<svg><use xlink:href=\"' + iconPath + '-rewind\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.rewind + '</span>',\n '</button>'\n );\n }\n\n // Play Pause button\n // TODO: This should be a toggle button really?\n if (_inArray(config.controls, 'play')) {\n html.push(\n '<button type=\"button\" data-plyr=\"play\">',\n '<svg><use xlink:href=\"' + iconPath + '-play\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.play + '</span>',\n '</button>',\n '<button type=\"button\" data-plyr=\"pause\">',\n '<svg><use xlink:href=\"' + iconPath + '-pause\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.pause + '</span>',\n '</button>'\n );\n }\n\n // Fast forward button\n if (_inArray(config.controls, 'fast-forward')) {\n html.push(\n '<button type=\"button\" data-plyr=\"fast-forward\">',\n '<svg><use xlink:href=\"' + iconPath + '-fast-forward\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.forward + '</span>',\n '</button>'\n );\n }\n\n // Progress\n if (_inArray(config.controls, 'progress')) {\n // Create progress\n html.push(\n '<span class=\"plyr__progress\">',\n '<label for=\"seek{id}\" class=\"plyr__sr-only\">Seek</label>',\n '<input id=\"seek{id}\" class=\"plyr__progress--seek\" type=\"range\" min=\"0\" max=\"100\" step=\"0.1\" value=\"0\" data-plyr=\"seek\">',\n '<progress class=\"plyr__progress--played\" max=\"100\" value=\"0\" role=\"presentation\"></progress>',\n '<progress class=\"plyr__progress--buffer\" max=\"100\" value=\"0\">',\n '<span>0</span>% ' + config.i18n.buffered,\n '</progress>'\n );\n\n // Seek tooltip\n if (config.tooltips.seek) {\n html.push('<span class=\"plyr__tooltip\">00:00</span>');\n }\n\n // Close\n html.push('</span>');\n }\n\n // Media current time display\n if (_inArray(config.controls, 'current-time')) {\n html.push(\n '<span class=\"plyr__time\">',\n '<span class=\"plyr__sr-only\">' + config.i18n.currentTime + '</span>',\n '<span class=\"plyr__time--current\">00:00</span>',\n '</span>'\n );\n }\n\n // Media duration display\n if (_inArray(config.controls, 'duration')) {\n html.push(\n '<span class=\"plyr__time\">',\n '<span class=\"plyr__sr-only\">' + config.i18n.duration + '</span>',\n '<span class=\"plyr__time--duration\">00:00</span>',\n '</span>'\n );\n }\n\n // Toggle mute button\n if (_inArray(config.controls, 'mute')) {\n html.push(\n '<button type=\"button\" data-plyr=\"mute\">',\n '<svg class=\"icon--muted\"><use xlink:href=\"' + iconPath + '-muted\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath + '-volume\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleMute + '</span>',\n '</button>'\n );\n }\n\n // Volume range control\n if (_inArray(config.controls, 'volume')) {\n html.push(\n '<span class=\"plyr__volume\">',\n '<label for=\"volume{id}\" class=\"plyr__sr-only\">' + config.i18n.volume + '</label>',\n '<input id=\"volume{id}\" class=\"plyr__volume--input\" type=\"range\" min=\"' +\n config.volumeMin +\n '\" max=\"' +\n config.volumeMax +\n '\" value=\"' +\n config.volume +\n '\" data-plyr=\"volume\">',\n '<progress class=\"plyr__volume--display\" max=\"' + config.volumeMax + '\" value=\"' + config.volumeMin + '\" role=\"presentation\"></progress>',\n '</span>'\n );\n }\n\n // Toggle captions button\n if (_inArray(config.controls, 'captions')) {\n html.push(\n '<button type=\"button\" data-plyr=\"captions\">',\n '<svg class=\"icon--captions-on\"><use xlink:href=\"' + iconPath + '-captions-on\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath + '-captions-off\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleCaptions + '</span>',\n '</button>'\n );\n }\n\n // Toggle fullscreen button\n if (_inArray(config.controls, 'fullscreen')) {\n html.push(\n '<button type=\"button\" data-plyr=\"fullscreen\">',\n '<svg class=\"icon--exit-fullscreen\"><use xlink:href=\"' + iconPath + '-exit-fullscreen\" /></svg>',\n '<svg><use xlink:href=\"' + iconPath + '-enter-fullscreen\" /></svg>',\n '<span class=\"plyr__sr-only\">' + config.i18n.toggleFullscreen + '</span>',\n '</button>'\n );\n }\n\n // Close everything\n html.push('</div>');\n\n return html.join('');\n }", "title": "" }, { "docid": "11616ddaaded08d23a7f6743146ecbbb", "score": "0.5195826", "text": "function createDescriptorButtonsD(){\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'mw', \"MW\", \".descriptor_buttons_d>button:nth-of-type(1)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'clogp', \"CLOGP\", \".descriptor_buttons_d>button:nth-of-type(2)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'arom', \"AROM\", \".descriptor_buttons_d>button:nth-of-type(3)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'hba', \"HBA\", \".descriptor_buttons_d>button:nth-of-type(4)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'hbd', \"HBD\", \".descriptor_buttons_d>button:nth-of-type(5)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'rtb', \"RTB\", \".descriptor_buttons_d>button:nth-of-type(6)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'psa', \"PSA\", \".descriptor_buttons_d>button:nth-of-type(7)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'apka', \"APKA\", \".descriptor_buttons_d>button:nth-of-type(8)\");\n\t\t\tcreateButton(\".descriptor_buttons_d\", 'bpka', \"BPKA\", \".descriptor_buttons_d>button:nth-of-type(9)\");\n\t\t} //end createDescriptorButtonsD function", "title": "" } ]
c74c0c174262f6fc82112c364bc72855
Resume the observers. Observers immediately receive change notifications to bring them to the current state of the database. Note that this is not just replaying all the changes that happened during the pause, it is a smarter 'coalesced' diff.
[ { "docid": "2f47f7c0d46f2273a2d06cbcee397d67", "score": "0.7793419", "text": "resumeObservers() {\n // No-op if not paused.\n if (!this.paused) {\n return;\n }\n\n // Unset the 'paused' flag. Make sure to do this first, otherwise\n // observer methods won't actually fire when we trigger them.\n this.paused = false;\n\n Object.keys(this.queries).forEach(qid => {\n const query = this.queries[qid];\n\n if (query.dirty) {\n query.dirty = false;\n\n // re-compute results will perform `LocalCollection._diffQueryChanges`\n // automatically.\n this._recomputeResults(query, query.resultsSnapshot);\n } else {\n // Diff the current results against the snapshot and send to observers.\n // pass the query object for its observer callbacks.\n LocalCollection._diffQueryChanges(\n query.ordered,\n query.resultsSnapshot,\n query.results,\n query,\n {projectionFn: query.projectionFn}\n );\n }\n\n query.resultsSnapshot = null;\n });\n\n this._observeQueue.drain();\n }", "title": "" } ]
[ { "docid": "72c75d2c763a6cce590e48503472705f", "score": "0.65065014", "text": "pauseObservers() {\n // No-op if already paused.\n if (this.paused) {\n return;\n }\n\n // Set the 'paused' flag such that new observer messages don't fire.\n this.paused = true;\n\n // Take a snapshot of the query results for each query.\n Object.keys(this.queries).forEach(qid => {\n const query = this.queries[qid];\n query.resultsSnapshot = EJSON.clone(query.results);\n });\n }", "title": "" }, { "docid": "771a8770ae112482c5f1e548d1046391", "score": "0.6434074", "text": "resume() {\n this.paused = false;\n this.flush();\n }", "title": "" }, { "docid": "e67c1859b066ecf2761e397fa2083122", "score": "0.61010677", "text": "resume () {\n\t\t\tif (this.runOnResume !== false) {\n\t\t\t\tthis.run();\n\t\t\t}\n\n\t\t\tdelete this.runOnResume;\n\t\t}", "title": "" }, { "docid": "6e98eb27c65665f47c7962fb6c714cf0", "score": "0.60570514", "text": "resume() {\n if (!this._loadAndCheckSession()) {\n return;\n }\n\n this._isPaused = false;\n this.startRecording();\n }", "title": "" }, { "docid": "d09678fa44ccfc59f9965e50329ffc05", "score": "0.60446286", "text": "resume() { this.setPaused(false); }", "title": "" }, { "docid": "67dd7dc27417c82ba4474fd409d147d3", "score": "0.60231715", "text": "resume() {\n this._isSuspended = false;\n }", "title": "" }, { "docid": "c7ecd960cc4e7c7e573584b5d0e19791", "score": "0.5931752", "text": "pause () {\n\t\t\tthis.runOnResume = this.running;\n\t\t\tthis.stop();\n\t\t}", "title": "" }, { "docid": "85ad5b1fd9aef14a5e9e1831cd44c263", "score": "0.5915815", "text": "function resume() {\n var _this = this;\n\n this.defaultCallback = function (operation) {\n _this.isRecording && _this.patches.push(operation);\n _this.userCallback && _this.userCallback(operation);\n };\n this.isObserving = true;\n }", "title": "" }, { "docid": "6530cadd7c2c8ce6b8d6660b5b23c293", "score": "0.58833057", "text": "resume() {this.paused = false;}", "title": "" }, { "docid": "91b701c5bf8424f806016b1831277d09", "score": "0.58785427", "text": "resume() {\n this.paused = false;\n for (const container of this._dispatchers.values()) {\n for (const dispatcher of container.values()) {\n dispatcher.resume();\n }\n }\n }", "title": "" }, { "docid": "91b701c5bf8424f806016b1831277d09", "score": "0.58785427", "text": "resume() {\n this.paused = false;\n for (const container of this._dispatchers.values()) {\n for (const dispatcher of container.values()) {\n dispatcher.resume();\n }\n }\n }", "title": "" }, { "docid": "6e116bde69dbdad673ee3ea04f955f24", "score": "0.5847096", "text": "function resume() {\n paused = false;\n timeout = setTimeout(executeNext, stepDelay);\n }", "title": "" }, { "docid": "26b9f3a6594f5a5ce5300870dcd191ba", "score": "0.58166003", "text": "resume() {\n this.source.attach();\n }", "title": "" }, { "docid": "6f060f3c2df48b1f8f3631ee1b821c0c", "score": "0.57824", "text": "resume() {\n\t\tthis._context.resume();\n\t}", "title": "" }, { "docid": "cf0fb35163915bd40260ad14bc621a03", "score": "0.568363", "text": "resume() {\n this.isStopped = false;\n }", "title": "" }, { "docid": "5b883477a822795fb0ff0860d1f9b6eb", "score": "0.56405836", "text": "function onResume() {\n\t\talert(\"resume\");\n\t\tresumed_count++;\n\t\tupdateDisplay();\n }", "title": "" }, { "docid": "3bcf03657b8ac5e135bd995eb9bdde99", "score": "0.56132513", "text": "resume() {\n this.state_ = WindowState.RESUMING;\n this.foregroundOps_.resume();\n }", "title": "" }, { "docid": "e89e841cb99a74d1ebc2f93d92ea465a", "score": "0.5572448", "text": "pauseResume() {\n this.pauseResume().bind(timer);\n }", "title": "" }, { "docid": "ff23b72d2bf0331f4be6ec44aadbf926", "score": "0.5565556", "text": "function resumeWithCursor(newCursor) {\n changeStream.cursor = newCursor;\n processResumeQueue(changeStream);\n }", "title": "" }, { "docid": "05d7ea2d3edabc81ae90201e1dbc493d", "score": "0.5563146", "text": "resume() {\n this.context.resume();\n }", "title": "" }, { "docid": "d84bb2c7b0ba7bd502f21eb9eb1ababe", "score": "0.5489052", "text": "function resume() {\n\n var wasPaused = dom.wrapper.classList.contains('paused');\n dom.wrapper.classList.remove('paused');\n\n cueAutoSlide();\n\n if (wasPaused) {\n dispatchEvent('resumed');\n }\n\n }", "title": "" }, { "docid": "3bbea6fb3753c609a510bc96510a1ed0", "score": "0.54864085", "text": "resume() {\n if (overrides.requestCount > 0) {\n overrides.requestCount -= 1;\n }\n\n if (overrides.requestCount === 0) {\n paused = false;\n overrides = $copy(overrideDefaults);\n }\n }", "title": "" }, { "docid": "2ffa500c86ef18cd0a7465aad5027c2c", "score": "0.54853916", "text": "resume() {\n if (this.pausePoints.pop() === undefined)\n throw new Error('Was not paused');\n return this;\n }", "title": "" }, { "docid": "d75213ccc5aaf3415c5c75e3d0610c30", "score": "0.5469101", "text": "function resumeGameStateChangeStarter() {\n store.dispatch( {\n type: PLAYPAUSE_CHANGE,\n payload: {\n isGamePaused: false,\n }\n });\n }", "title": "" }, { "docid": "de3a18940fbd888249213cb7e175b89b", "score": "0.5453831", "text": "function stopResume() {\n // If the watch is running, save the current time, stop the clock, and\n // toggle the running flag.\n if (running) {\n pauseTime = Date.now();\n clearInterval(interval);\n running = false;\n } else {\n // Otherwise, shift the starting time to account for the duration for\n // which the clock was paused, start the clock again, and toggle the\n // running flag.\n startTime += Date.now() - pauseTime;\n interval = setInterval(calculateTime, refreshInterval);\n running = true;\n }\n}", "title": "" }, { "docid": "511f05c326d7b111b9bd75be0a93cc78", "score": "0.54522675", "text": "[RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }", "title": "" }, { "docid": "511f05c326d7b111b9bd75be0a93cc78", "score": "0.54522675", "text": "[RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }", "title": "" }, { "docid": "511f05c326d7b111b9bd75be0a93cc78", "score": "0.54522675", "text": "[RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }", "title": "" }, { "docid": "511f05c326d7b111b9bd75be0a93cc78", "score": "0.54522675", "text": "[RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }", "title": "" }, { "docid": "511f05c326d7b111b9bd75be0a93cc78", "score": "0.54522675", "text": "[RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }", "title": "" }, { "docid": "4d928a8ee2bea17d10be97c51823fd86", "score": "0.5440078", "text": "function Resume() {}", "title": "" }, { "docid": "83bedea76374256afcb7cfb09ae67d55", "score": "0.54261047", "text": "resume(){\n if(this._isPaused){\n this._isPaused = false;\n this._togglePauseBtn.classList.remove(\"paused\");\n this.onResume(); \n }\n }", "title": "" }, { "docid": "88e11e43cce7a5765c425e6d1d9ee69e", "score": "0.53949803", "text": "function resume() {\n\tif (resume_status === false && pause_status === true) {\n\t\tconsole.log('The voice of the system is resumed.');\n\t\tassistant.resume();\n\t\tpause_status = false;\n\t\tresume_status = true;\n\t} else {\n\t\tconsole.log('The voice of the system is already resumed.');\n\t}\n}", "title": "" }, { "docid": "afdfa22a107125d850f71cc9afb22550", "score": "0.53628004", "text": "pauseResume(paused) {\n if (paused) {\n this.timeout = setTimeout(() => { this.changeWord(); }, this.wordTimer);\n } else {\n clearInterval(this.timeout);\n this.timeout = null;\n }\n }", "title": "" }, { "docid": "0030ccc4f0d2a45eff69ed79a97826a9", "score": "0.53578466", "text": "resume () {\n this.isPaused = false;\n\n for (var i = 0; i < this.queue.length; i++) {\n publish.apply(publish, this.queue[i]);\n }\n\n this.queue = [];\n }", "title": "" }, { "docid": "b508f6980ec89ebe3414339d5fb7f792", "score": "0.5299064", "text": "function onResume() {\n console.log('on resume');\n \n // reiniciamos Scrolls\n window.scrollHome = 0;\n window.scrollLocales = 0;\n window.scrollFavor = 0;\n window.scrollNuevos = 0;\n \n // para que espere hasta que se haya cargado\n eventosList.fetchComplete = 0;\n \n // para reiniciar marcador de notificaciones\n window.notif_recibidas = 0; // cuando se inicia la app debe ser cero, sólo será 1 cuando se reciban notificaciones\n\n // actualizamos desde el servidor\n homeView.model.fetch({reset: true, \n success: function() {\n console.log( 'fetch success' ); \n },\n complete: function() {\n //alert('fetch complete');\n console.log( 'fetch complete del onresume' );\n \n // para notificaciones\n eventosList.trigger(\"fcomplete\");\n\n // resetea\n homeView.ciudad = 0;\n homeView.categoria = 0;\n \n // renderiza eventos una vez descargados\n homeView.cargarEventos();\n homeView.render();\n }\n });\n \n }", "title": "" }, { "docid": "8917700639628bb6f496dd11609cbc55", "score": "0.5283527", "text": "function resumeGame() {\n\tpause = false;\n\tstart = true;\n}", "title": "" }, { "docid": "6801da46321294ae8f52c55e9850d97d", "score": "0.52656543", "text": "onResume(callback) {\n\t\tthis.onResumeCallback = callback;\n\t}", "title": "" }, { "docid": "12a72c5c9da01cb756feef02a81c5f5f", "score": "0.5261919", "text": "resume() {\n if (this.props.isStop) {\n\n this.props.setIsPlaying(true);\n this.props.setIsStop(false);\n this.startTimer(this.props.timer)\n }\n }", "title": "" }, { "docid": "b4053c9d341aee4b4adee8bb8aa293c9", "score": "0.5256484", "text": "sync () {\n if (this.pendingStart) {\n this.moveToStart()\n if (this.status === Sequencer.PAUSED) {\n this._status = Sequencer.PLAYING\n }\n }\n }", "title": "" }, { "docid": "6a39aa4104ae91d7f103ae3767875eea", "score": "0.52387536", "text": "function resume(){\n\tfor( let i = 0; i < subplanes.length ; i++ ){\n\t\tsubplanes[i].resume();\n\t}\n\tpaused = false;\n}", "title": "" }, { "docid": "9bed1529c274c88aef08dbe1a090ec91", "score": "0.5236738", "text": "function resumeCapture () {\n state.paused = false\n log.debug('resuming capture')\n}", "title": "" }, { "docid": "e29e167a6c4192dd0c082fa61f31f0a2", "score": "0.5183164", "text": "function onResume() {\n }", "title": "" }, { "docid": "0791672f03ed69f450fd6524e4a88bfd", "score": "0.518027", "text": "Resume() {\n if(this.isPlaying) {\n this.dispatcher.resume();\n }\n }", "title": "" }, { "docid": "696edba59ebce0e38c4946f145ca83df", "score": "0.51725775", "text": "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "title": "" }, { "docid": "e8025df5075b4a1fc70bcef77d7fe641", "score": "0.51563597", "text": "resume() {\n this.setState({\n // update the last tick timing to prevent a large spike in time\n \"last\": Date.now(),\n }, () => {\n // begin the updating loop for the timer\n window.requestAnimationFrame(this.updateTimer.bind(this));\n });\n }", "title": "" }, { "docid": "d9bd02340e13fdfaca38bc352826c801", "score": "0.5155649", "text": "function Resume_StatesLoaded()\n{\n\t//loop through our ids\n\tfor (var i = 0, c = this[2].length; i < c; i++)\n\t{\n\t\t//set it the state \n\t\t__SIMULATOR.History.States[i] = __CACHE.Get_State(this[2][i]);\n\t}\n\t//now check for optimisation\n\tthis.VerifySatesOptimised();\n}", "title": "" }, { "docid": "e6eab62d6981fecac773675d7f7241cd", "score": "0.5128442", "text": "function resume() {\n paused = false; // Set paused to true\n ctx.clearRect(0,0,canvas.width, canvas.height); // Clear the entire canvas\n drawTopData(); // Redraw the top data bar\n drawGameArea(); // Redraw the game board/blocks\n mainInterval = setInterval(dropBlock, dropDelay); // restart the main game loop, automatically dropping the block\n}", "title": "" }, { "docid": "1094eadbd2d094c64ff77be64926c43e", "score": "0.5102016", "text": "function enterModificationReal() {\n suspendEvents += 1;\n }", "title": "" }, { "docid": "1094eadbd2d094c64ff77be64926c43e", "score": "0.5102016", "text": "function enterModificationReal() {\n suspendEvents += 1;\n }", "title": "" }, { "docid": "552c09294f34ea9c679f40fb892f09bc", "score": "0.50908226", "text": "function playPause() {\n\t\tDBR.act('pause');\n\t\tsyncState();\n\t}", "title": "" }, { "docid": "03f3ef658fb72ec190a795e478fca1d8", "score": "0.5077567", "text": "suspend() {\n\t\tthis._context.suspend();\n\t}", "title": "" }, { "docid": "92fffbfd63899d15d11a3bf77dfc6b73", "score": "0.5058855", "text": "resume() {\r\n if(this._endScript) {\r\n this._resetStates();\r\n } else {\r\n this._wait = false;\r\n }\r\n this._next();\r\n }", "title": "" }, { "docid": "0ecd784b0de3311d2f5ee85fa679b1ba", "score": "0.5039111", "text": "resume() {\n var self = this;\n self._paused = false;\n\n debug('Relaying captured events to target stream.');\n\n if (!self._disablePiping && self._pipeData) {\n debug('Piping data from source to target.');\n self._source.pipe(self._target);\n self._source.resume();\n } else {\n debug('Target stream is not being piped.');\n }\n\n var eventNames;\n if (typeof self._target.eventNames !== 'undefined') {\n eventNames = self._target.eventNames();\n }\n\n self._eventsStash.forEach(function(event) {\n if (typeof eventNames === 'undefined' || eventNames.indexOf(event[0]) !== -1) {\n self._target.emit.apply(self._target, event);\n }\n });\n }", "title": "" }, { "docid": "82ac529187a6dfa5b12c7535010cbab6", "score": "0.5038577", "text": "async __ca_traceResume__() {\n const t = (new Date()).getTime();\n this.$.log && this.$.log.trace(`${this.state.fullName}:Resuming:${t}`);\n return [];\n }", "title": "" }, { "docid": "c6ae58e5845d9235f5c37724a2049b90", "score": "0.5017848", "text": "function enterModificationReal() {\n\t suspendEvents += 1;\n\t }", "title": "" }, { "docid": "c6ae58e5845d9235f5c37724a2049b90", "score": "0.5017848", "text": "function enterModificationReal() {\n\t suspendEvents += 1;\n\t }", "title": "" }, { "docid": "d9d8b5ff3787b56e55cf3250fc5c94c5", "score": "0.5004163", "text": "resumeAutoCommit() {\n this.suspendCount--;\n\n if (this.autoCommit) {\n this.doAutoCommit();\n }\n }", "title": "" }, { "docid": "f96c8c0496cc954cbf2bb77eeae5ba6c", "score": "0.49910918", "text": "function onResume() {\n console.log('hahahahahahha');\n}", "title": "" }, { "docid": "54fa4eadee1031d77ac6eff9797bd59d", "score": "0.4983472", "text": "function resume(event, response, model) {\n const pb = model.getPlaybackState();\n if (playbackState.isValid(pb) && !playbackState.isFinished(pb)) {\n response.audioPlayerPlay('REPLACE_ALL', pb.token.url, contentToken.serialize(pb.token), null, pb.offset);\n }\n response.send();\n}", "title": "" }, { "docid": "c4498a67ade5871e748ed9a6d780ac80", "score": "0.4979804", "text": "suspendChangesTracking() {\n this.crudIgnoreUpdates++;\n }", "title": "" }, { "docid": "aaf1ef30d0dd31f2da25450de33b1225", "score": "0.49616238", "text": "function togglePause() {\n\n if (isPaused()) {\n resume();\n }\n else {\n pause();\n }\n\n }", "title": "" }, { "docid": "5577e00ac77c7ff0ecc489ede827288d", "score": "0.49461785", "text": "resume(){\n\t\tvar _self = this\n\t\tvar dur = new Date( _self.currentTime )\n\t\tthis.tick( dur.getUTCMinutes() )\n\t\tconsole.log(\"timer resumed\")\n\t}", "title": "" }, { "docid": "cc6eea85700faad380fdfb9470cbdad3", "score": "0.4939035", "text": "_updateCurrentObserver () {\n this._currentObserver = this._pendingObservers.shift()\n this._observer.onPendingObserversChange(this._pendingObservers.length)\n }", "title": "" }, { "docid": "9e82d2f485d8c8d2374f9a7cab523106", "score": "0.49038854", "text": "function resume(){\r\n\tstopped = 0;\r\n\tcircles();\r\n}", "title": "" }, { "docid": "0b6572e7cf2afd63b7bd63f67950eeca", "score": "0.489238", "text": "pause() { this.setPaused(true); }", "title": "" }, { "docid": "ea9ea86cbc9c140e5681e30d3fcc2ed0", "score": "0.48670614", "text": "pause (paused)\n {\n this.lerpIntervals.pause(paused);\n }", "title": "" }, { "docid": "ac0233f6e9c4a746e7257a972de2e5f4", "score": "0.4866875", "text": "resumeCalled() {\n return new Promise((resolve, reject) => {\n this.resume_called_ = resolve;\n });\n }", "title": "" }, { "docid": "b93253d033a79caab97cf67b50635419", "score": "0.48666623", "text": "resume() {\n state.set(state.State.SUSPEND, false);\n nav.close(ViewName.WARNING, WarningType.CAMERA_PAUSED);\n }", "title": "" }, { "docid": "b003fc3e3749dd55fc37e17b68f60707", "score": "0.48634413", "text": "function toggleResume(isResuming, message) {\n // Disable/enable the system behaviour of resuming when focussing on the game again.\n me.sys.resumeOnFocus = isResuming;\n\n if (isResuming) {\n me.state.resume();\n } else {\n me.state.pause();\n }\n\n // Display a message upon pausing/resuming\n if (message) {\n toggleMessage(message, true);\n } else {\n // No message implies that the message prompt should be closed\n toggleMessage(\"\", false);\n }\n}", "title": "" }, { "docid": "7a7be79fa8cec2038c52891088314b8a", "score": "0.48605052", "text": "function resumed(packet) {\n return async ({ dispatch, client, getState }) => {\n const thread = packet.from;\n const why = (0, _selectors.getPauseReason)(getState(), thread);\n const wasPausedInEval = (0, _pause.inDebuggerEval)(why);\n const wasStepping = (0, _selectors.isStepping)(getState(), thread);\n\n dispatch({ type: \"RESUME\", thread, wasStepping });\n\n if (!wasStepping && !wasPausedInEval) {\n await dispatch((0, _expressions.evaluateExpressions)());\n }\n };\n} /* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */", "title": "" }, { "docid": "15b5427bd73e655968fc33e6166bb4ee", "score": "0.48587605", "text": "startSkipUpdates() {\n\t\tthis.skipUpdates_ = true;\n\t}", "title": "" }, { "docid": "7d5355eb42b29c8646d46876ddc80093", "score": "0.48544106", "text": "restart() {\r\n this.audioPlayer.restart();\r\n this.state.calibrating = true;\r\n this.state.stopped = false;\r\n this.state.conducting = false;\r\n this.state.finished = false;\r\n }", "title": "" }, { "docid": "cbf3dd0d7724a1cf6814019583e56c89", "score": "0.48308218", "text": "toggle() {\n return this.paused ? this.resume() : this.pause();\n }", "title": "" }, { "docid": "2f0d4b580eaeb22c6caa91f27bff3038", "score": "0.48084956", "text": "function pause() {\n\t\tInspector.Debugger.pause();\n\t}", "title": "" }, { "docid": "79737d3d24ec6922f5f45194be16d48a", "score": "0.48074284", "text": "function resumeGame() {\n pauseBoard.kill();\n pauseBoardText.kill();\n resumeButton.kill();\n restartLevelButton.kill();\n mainMenuButton.kill();\n this.deerTimer = 0;\n this.cowTimer = 1200;\n this.rockTimer = 2300;\n game.pause = false;\n}", "title": "" }, { "docid": "7610f61bfad0fc2205cc5f813b4e9256", "score": "0.48005557", "text": "pause() {\n this._isPaused = true;\n }", "title": "" }, { "docid": "7610f61bfad0fc2205cc5f813b4e9256", "score": "0.48005557", "text": "pause() {\n this._isPaused = true;\n }", "title": "" }, { "docid": "846b36ced574bb774030543f483f57fd", "score": "0.47892445", "text": "resume() {\r\n\t\tthis._input.on(\"data\", this._dataListener);\r\n\t}", "title": "" }, { "docid": "9ac72f07fd72c4c90338dfa58daec9fd", "score": "0.47660872", "text": "onNativeResume() {\n\t\t//TODO: Implement this if required\n\t}", "title": "" }, { "docid": "622afdc4f805d8c5ec5ca23fca6a0d26", "score": "0.4765749", "text": "resume() {\n this.element.resume();\n }", "title": "" }, { "docid": "03c5294ad71d45d06f7799227a2c7a9a", "score": "0.4749715", "text": "function resume() {\r\n // mark the message as resumed\r\n paused = false;\r\n // don't resume animation if we haven't completed introducing the message\r\n if ($marquee.data(\"marquee.showing\") != true) scroll($lis.filter(\".\" + options.cssShowing), 1);\r\n }", "title": "" }, { "docid": "97999dae2a09310b4d0bb419fee6e6ac", "score": "0.47419748", "text": "pause() { this._pause$.next(true); }", "title": "" }, { "docid": "b24886c3a2bad300b20079bbfaa7c89f", "score": "0.47053033", "text": "function resume() {\n\t\t\t\n\t\t\tisPaused = false;\n\t\t\t$progressBar.animate({ width : imageWidth }, (1 - pauseProgress) * config.slideTime, \"linear\", function() {\n\t\t\t\t\t\n\t\t\t\t\t$(this).css({ width : 0 });\n\t\t\t\t\t$progressDiv.css({ display : \"none\" });\n\t\t\t\t\t\n\t\t\t\t\tnext();\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}", "title": "" }, { "docid": "df4df0acd0ca344306839753f26b7699", "score": "0.47048908", "text": "suspend() {\n if (this.state_ === WindowState.LAUNCHING) {\n console.error('Call suspend() while window is still launching.');\n return;\n }\n this.state_ = WindowState.SUSPENDING;\n this.foregroundOps_.suspend();\n }", "title": "" }, { "docid": "e3248c4e3d81a770f136aa64a716de6b", "score": "0.47019038", "text": "function pause_resume() {\r\n if (gameState == \"run\") {\r\n gameLoop.stop();\r\n gameState = \"stop\";\r\n }\r\n else if (gameState == \"stop\") {\r\n gameLoop.start();\r\n gameState = \"run\";\r\n }\r\n}", "title": "" }, { "docid": "e209691d7d1c43d7eb48c4925ff95754", "score": "0.4701792", "text": "_recomputeResults(query, oldResults) {\n if (this.paused) {\n // There's no reason to recompute the results now as we're still paused.\n // By flagging the query as \"dirty\", the recompute will be performed\n // when resumeObservers is called.\n query.dirty = true;\n return;\n }\n\n if (!this.paused && !oldResults) {\n oldResults = query.results;\n }\n\n if (query.distances) {\n query.distances.clear();\n }\n\n query.results = query.cursor._getRawObjects({\n distances: query.distances,\n ordered: query.ordered\n });\n\n if (!this.paused) {\n LocalCollection._diffQueryChanges(\n query.ordered,\n oldResults,\n query.results,\n query,\n {projectionFn: query.projectionFn}\n );\n }\n }", "title": "" }, { "docid": "72b247983d51884693ca600faa73f60e", "score": "0.46935746", "text": "pause() {\n this._isPaused = true;\n }", "title": "" }, { "docid": "f5cf52e9f591fb790a14254fc3632554", "score": "0.46850345", "text": "restart() {\n this.reset();\n this.movie = false;\n this.displayMovie = false;\n this.movieArray = [];\n this.lastMovie = 0;\n }", "title": "" }, { "docid": "bb6666d66824c0836837ecbb7e49261e", "score": "0.46772504", "text": "resume() {\n if (!this.paused || this.timeleft === null) {\n throw new Error('Timer is not currently paused');\n }\n this.currentTimeout = setTimeout(this.callback, this.timeleft);\n }", "title": "" }, { "docid": "c8f7a5d750a4dc5a9105f8354afc3d05", "score": "0.46771613", "text": "function _onPaused(res) {\n\t\t// res = {callFrames, reason, data}\n\t\t_callFrames = res.callFrames;\n\t\t$exports.trigger(\"paused\", res);\n\t}", "title": "" }, { "docid": "b8d8d46c2a78c8051de75d691880ff4f", "score": "0.46765968", "text": "pause() {\n this.source.detach();\n }", "title": "" }, { "docid": "2648a2816d392af7f4d6fe854771ed7b", "score": "0.46743658", "text": "function resumeGame() {\r\n\tif (!gameOn && result == false && allowResume == true) {\r\n\t\t// console.log(\"resume game\");\r\n\t\tgameOn = true;\r\n\t\t\r\n\t\tanimateEnemy(animateBoxes,locationOfEnemy,currentDirection);\r\n\r\n\t} // if\r\n\r\n\r\n} // resumeGame", "title": "" }, { "docid": "def211359e3d1640441b74479ac6451c", "score": "0.46518803", "text": "AcceptChanges() {\n this.State = tp.DataRowState.Unchanged;\n }", "title": "" }, { "docid": "54eb9506569aadac01f975d021720c72", "score": "0.46513543", "text": "function resumePrint() {\n var that = this;\n printerInterface.resumePrint({}, function (err) {\n if (err) {\n setError(err);\n }\n requestUpdate();\n });\n }", "title": "" }, { "docid": "86ec797d27258fdab19d2ef3f127799e", "score": "0.46454927", "text": "pause() {\n paused = true;\n }", "title": "" }, { "docid": "8d96092143aac2b86b5fa99379b19c02", "score": "0.4623415", "text": "function updateReplay() {\n // Filter the events by time and then by options\n const filteredEvents = sessionEvents.filter(event => checkEvent(event));\n const lastEvents = filteredEvents.filter(event => event.timeStamp >= prevTimeStamp);\n\n // Update the heat map and click path\n if (!playing) {\n heatMap.setData(filteredEvents);\n clickPath.setData(filteredEvents);\n\n updateChange(filteredEvents);\n updateScroll(filteredEvents);\n } else {\n heatMap.addData(lastEvents);\n clickPath.addData(lastEvents);\n\n updateScroll(lastEvents);\n updateChange(lastEvents);\n }\n\n updateKey(lastEvents);\n updateClick(lastEvents);\n\n prevTimeStamp = timeStamp;\n}", "title": "" }, { "docid": "e6828b39418bb207a0afb225848d6408", "score": "0.46133977", "text": "suspend() {\n\t\tthis.leave();\n\t\tprocess.once('SIGCONT', this.onContinue);\n\t\tprocess.kill(process.pid, \"SIGTSTP\");\n\t}", "title": "" }, { "docid": "52e8cc9dfb3187d6dadeceb06ef823b7", "score": "0.4611275", "text": "function onStartStop() {\n var running = !exs.state.active;\n var shouldResume = false;\n var promise = Promise.resolve();\n\n if (running && exs.state.duration > 10000) { // if more than 10 seconds of duration, ask if we should resume?\n promise = promise.\n then(() => {\n isMenuDisplayed = true;\n return E.showPrompt(\"Resume run?\",{title:\"Run\"});\n }).then(r => {\n isMenuDisplayed=false;shouldResume=r;\n });\n }\n\n // start/stop recording\n // Do this first in case recorder needs to prompt for\n // an overwrite before we start tracking exstats\n if (settings.record && WIDGETS[\"recorder\"]) {\n if (running) {\n isMenuDisplayed = true;\n promise = promise.\n then(() => WIDGETS[\"recorder\"].setRecording(true, { force : shouldResume?\"append\":undefined })).\n then(() => {\n isMenuDisplayed = false;\n layout.setUI(); // grab our input handling again\n layout.forgetLazyState();\n layout.render();\n });\n } else {\n promise = promise.then(\n () => WIDGETS[\"recorder\"].setRecording(false)\n );\n }\n }\n\n promise = promise.then(() => {\n if (running) {\n if (shouldResume)\n exs.resume()\n else\n exs.start();\n } else {\n exs.stop();\n }\n // if stopping running, don't clear state\n // so we can at least refer to what we've done\n setStatus(running);\n });\n}", "title": "" }, { "docid": "494a6c127e2c76e734e816878a97f3fb", "score": "0.4604375", "text": "doNotResumeMusic() {\n\n this.musicStopped = true;\n this.musicResumed = true;\n }", "title": "" } ]
91fc951128b65d61ed966eb3d92e355d
Delete a user with id. DELETE user/:id
[ { "docid": "a71ee4274c6b9a8bd9172f5b4a048fcf", "score": "0.0", "text": "async destroy ({ params, response }) {\n // retrieve the data by given id\n const evaluation = await Evaluation.find(params.id)\n if (evaluation) {\n response.status(200).json({\n success: 'Deleted Evaluation',\n data: evaluation\n })\n await evaluation.delete()\n }else {\n response.status(404).send({ error: 'Evaluation Not Found' })\n }\n }", "title": "" } ]
[ { "docid": "29e7db5136b9bc10683aa61b9d640453", "score": "0.8365881", "text": "delete () {\n this.app.delete('/user/destroy/:id', (req, res) => {\n try {\n this.UserModel.findByIdAndRemove(req.params.id).exec().then(user => {\n res.status(204).json(user || {})\n }).catch(err => {\n res.status(404).json({\n code: 404,\n message: err + `Cannot delete User with id=${req.params.id}.`\n })\n })\n } catch (err) {\n res.status(500).json({\n code: 500,\n message: err\n })\n }\n })\n }", "title": "" }, { "docid": "138c39799cba550ea88e17b48c1f13ca", "score": "0.81880826", "text": "function deleteUser(id){\n modalRemoveUser(id);\n }", "title": "" }, { "docid": "236028980794cf431822902f52653f9a", "score": "0.8186484", "text": "function deleteUser(userid) {\n return db(\"users\").del().where({ userid });\n}", "title": "" }, { "docid": "60b501105e59390f6dafc917d73634db", "score": "0.81735706", "text": "function deleteUser(req, res) {\n User.findOne({ _id: req.params.id }).then((user) => {\n if (user) {\n User.remove(user);\n res.status(HTTP_200).json({ msg: \"User deleted successfull\" });\n }\n });\n}", "title": "" }, { "docid": "17ff9ff9a032154b0a42981f423765b3", "score": "0.81678116", "text": "async destroyUser(id) {\n await fetchApi(this, `/users/${id}`, {\n method: 'DELETE'\n });\n }", "title": "" }, { "docid": "fe17c489d591195836bf443f4bc6beaf", "score": "0.81039387", "text": "function deleteUser(req,res) {\n User.findByIdAndRemove(\n req.params.id,\n req.body,\n )\n .then(function(users) {\n res.status(200).json(users);\n })\n .catch(function(err){\n if (err.name === 'ValidationError') {\n return res.status(400).json({ error: 'Invalid User ID' });\n }\n res.status(500).json({ error: 'Could not delete user' });\n })\n}", "title": "" }, { "docid": "5fcd4874ac67caf1304bdf346037eea4", "score": "0.80947065", "text": "function deleteUser(req, res) {\n\n User.findByIdAndRemove(req.params.id, (err, user) => {\n if (err) {\n res.send(err);\n }\n res.json({message: `${user.nom} deleted`});\n })\n}", "title": "" }, { "docid": "a6973f764ea42a5c436b14464b7f80f0", "score": "0.80500966", "text": "function deleteUser(id) {\n fetch(`https://6121377ff5849d0017fb41c6.mockapi.io/users/${id}`, {\n method: \"DELETE\"\n })\n .then((data) => data.json())\n .then(() => getUsers());\n }", "title": "" }, { "docid": "38649543865d8f56680cc5fba380a1a9", "score": "0.80498034", "text": "function deleteUser(id) {\r\n // Get user object to delete\r\n deletedUser = getUserById(id);\r\n\r\n // Delete user from users\r\n users = users.filter(user => user.id !== id);\r\n\r\n // Return deleted user\r\n return deletedUser;\r\n}", "title": "" }, { "docid": "85bf38fdcb4f633b1e7d91122b3f959c", "score": "0.8028813", "text": "async deleteUser(req, res, next) {\n try {\n const userId = req.params.userId;\n const user = await User.findOne({ where: { id: userId } });\n\n if (!user) return res.status(449).json({ message: \"User Not Found\" });\n\n user.destroy({ where: { id: userId.id } });\n res.status(200).json({ message: \"User Deleted\" });\n } catch (error) {\n res.status(500).json({ message: \"Internal Error Deleting User\" });\n }\n }", "title": "" }, { "docid": "7e06bd28bdfb428f3b680bfe44ae2547", "score": "0.8007041", "text": "function deleteUser(userId, callback) {\n return fetch(self.url + '/' + userId, {\n method: 'delete'\n })\n }", "title": "" }, { "docid": "2037a93adf0f026a0f73536b9b950eea", "score": "0.80032486", "text": "async delUser(id) {\n log.debug('id: ', id);\n\n try {\n await this.del('/v2.0/Users/'+id);\n return('Success');\n } catch (e) {\n log.error('try catch is %s', e);\n return(e);\n }\n }", "title": "" }, { "docid": "7263e7d3d6f8dd0ccedf99c6f2097e2c", "score": "0.79392874", "text": "function deleteUser(req, res) {\n User.delete({\n uid: req.params.id // Find user with firebase uid\n }, function(err, user) {\n if (!user) return res.status(404).json({\n message: \"User not found\"\n });\n if (err) return res.status(500).json({\n error: err.message\n });\n\n res.status(200).json({\n message: \"Successful deletion\"\n });\n });\n}", "title": "" }, { "docid": "f067ab71c060d35a618d3e17b4361362", "score": "0.79258955", "text": "delete ({ user }, res) {\n db.deleteUser(user)\n\n res.sendStatus(204)\n }", "title": "" }, { "docid": "21c1786e84c7953207d5dfca4687e69d", "score": "0.7891763", "text": "function deleteUserById(id) {\n var deferred = q.defer();\n User.findOneAndRemove (\n {_id: id},\n function (err, stats) {\n if (!err) {\n deferred.resolve(stats);\n } else {\n deferred.reject(err);\n }\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "9ada90ec1468d2a5c303c094b6d90d20", "score": "0.78897625", "text": "deleteUser({ id, accountId } = {}) {\n var path = this.buildUrl({\n url: `/api/v2/accounts/${accountId}/users/${id}`,\n parameters: {}\n });\n return this.restCall({ url: path, verb: 'delete', payload: null });\n }", "title": "" }, { "docid": "a75048b3ba1071b56c52ed1674ce29d7", "score": "0.7881263", "text": "function deleteUser(userId) { \n \tvar url = this.baseUrl + \"/deleteUser/\" + userId;\n \t$.post(url);\n }", "title": "" }, { "docid": "3669556df9a44a6772f111f58f05b624", "score": "0.7827436", "text": "async deleteUser(req, res) {\n const _id = req.params.id\n await userModel.findByIdAndDelete(_id)\n .then(response => {\n res.status(200).json(response)\n })\n .catch(error => {\n res.status(500).json({ message: `alguma coisa deu errado! ${error}` })\n })\n }", "title": "" }, { "docid": "50552f47c08729c0fb370ed57ecb68fd", "score": "0.7810703", "text": "async delete(request, response) {\n const { id } = request.params;\n\n const user = await UserRepository.findById(id);\n\n if (!user) {\n return response.status(404).json({ error: 'User does not exist!' });\n }\n\n await UserRepository.delete(id);\n response.sendStatus(204);\n }", "title": "" }, { "docid": "56040b9809137819b15e4a39951b0d81", "score": "0.7801908", "text": "function deleteUser(userId) {\n return userModel.remove({_id: userId});\n}", "title": "" }, { "docid": "73e15cc069dab5e06eb7604b00234a45", "score": "0.77855015", "text": "deleteUserById(userId) {\n return fetch(HEROKU_URL + '/api/user/' + userId, {\n method: 'DELETE'\n });\n }", "title": "" }, { "docid": "8b7eb2c9e6e71dac6d29e9c53841c109", "score": "0.7781964", "text": "function deleteUser() {\n //get user information\n \n //send delete request to server\n}", "title": "" }, { "docid": "0e0e145017ab1cbe7d4eea5f70f35cf6", "score": "0.7773734", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n // headers: authHeader()\n };\n\n return fetch(`http://localhost:8080/deleteUser?userName=${id}`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "5194108129c08661d8df15a4e7c4438a", "score": "0.7734257", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader(),\n };\n\n return fetch(`${API_BASE}/user/` + id, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "cc83bdac53ad21b47fbfabc8b8b094e0", "score": "0.7721555", "text": "function deleteUser(id) {\n // Call out API to save data to database\n userOperation.deleteUser(id)\n .then(function (result) {\n // console.log(result);\n getUserList();\n }).catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "baca0ca157a01a5aee4075fbd6e79fc7", "score": "0.77101964", "text": "function deleteUser(id) {\r\n \tvar deferred = $q.defer();\r\n \t$http.delete(REST_SERVICE_URI+id)\r\n \t\t.then(\r\n \t\t\t\tfunction(response){\r\n \t\t\t\t\tdeferred.resolve(response.data);\r\n \t\t\t\t},\r\n \t\t\t\tfunction(errResponse) {\r\n \t\t\t\t\tdeferred.reject(errResponse);\r\n \t\t\t\t}\r\n \t\t);\r\n \t\treturn deferred.promise;\r\n }", "title": "" }, { "docid": "faa2521cefb3c57b2761a4801875f6f3", "score": "0.77089924", "text": "function deleteUser(id) {\n\t$.ajax({\n\t\turl: \"../server/users/deleteUser.php\",\n\t\ttype: \"post\",\n\t\tdata: {\n\t\t\tuserId: id,\n\t\t},\n\t\tsuccess: function (res) {\n\t\t\tgetUsers();\n\t\t},\n\t\terror: function (err) {\n\t\t\tconsole.log(err);\n\t\t},\n\t});\n}", "title": "" }, { "docid": "d9a05d9548f749e46466c50679ae53f3", "score": "0.77088106", "text": "function deleteUser(id) {\n return new Promise((resolve, reject) => {\n User.remove({_id: id}, (err, deletedUser) => {\n if (err) {\n reject(err);\n } else {\n resolve(deletedUser);\n }\n });\n });\n}", "title": "" }, { "docid": "b29ef1a0e80c84e6eada99921272fe58", "score": "0.7703719", "text": "function delete_users_with_id(userId) {\n db.Users.destroy({\n where: { id: userId }\n })\n return true;\n}", "title": "" }, { "docid": "7388294cc1a895ba7a0818c5943b61e3", "score": "0.7609859", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader(),\n };\n\n return fetch('/users/' + id, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "798f68b01b7718d8867c9c3bbac4bf35", "score": "0.7602123", "text": "function destroy(req, res){\n return users\n .findOne({where: {id: parseInt(req.params.userId)}})\n .then(user => {\n if(!user){\n return res.status(201).send({message: 'User Not Found'});\n }\n\n return user\n .destroy()\n .then(() => res.status(200).send({message: 'Success! User Deleted.'}))\n .catch(error => res.status(400).send(error));\n });\n}", "title": "" }, { "docid": "3e9c5b273293ed48e19acd484d4ccb37", "score": "0.7591084", "text": "function deleteUser(userId) {\n $.ajax({\n method: 'DELETE',\n url: 'http://' + ip + ':8080/users/' + userId\n }).done(function (userId) {\n console.log(\"Deleted user \" + userId);\n })\n}", "title": "" }, { "docid": "52a48d565a1fe967239b4fdbf0187e69", "score": "0.7587311", "text": "function _delete(id) {\n\n return axios.delete(`/users/${id}`, {}).then(handleResponse);\n}", "title": "" }, { "docid": "20145d94d3a036991c5688c5982791fb", "score": "0.757271", "text": "function deleteUser(userId) {\n fetch(url + \"/\" + userId, {\n method: 'DELETE',\n })\n .then(res => res.text()) // or res.json()\n .then(res => console.log(res))\n window.location.reload(true);\n}", "title": "" }, { "docid": "2e508b695ee74b2812e0ce9cc3cd6db7", "score": "0.7563483", "text": "delete(req, res) {\n let queryVars = req.query;\n User.destroy({\n where: {\n id: queryVars.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 }", "title": "" }, { "docid": "6795c4d198dfcc0ddf63f74f5be25ff3", "score": "0.7545731", "text": "function removeUser(id) {\n getAllUsers().$remove(getUserByID(id));\n }", "title": "" }, { "docid": "74211315d48e7ea13874e94c17454e63", "score": "0.7542529", "text": "function deleteUser(id) {\n return new Promise((resolve, reject) => {\n runQuery(`DELETE FROM users WHERE users.id=${id}`).then(result => {\n resolve(result);\n }).catch(err => {\n reject(err);\n });\n });\n}", "title": "" }, { "docid": "f3d4ebd221d14799fc5874e2bfccbe87", "score": "0.75406235", "text": "async deleteUserById(id) {\n await this.connection.manager\n .getRepository(AuthenticationInformationDBO_1.AuthenticationInformationDBO)\n .createQueryBuilder(\"user\")\n .delete()\n .from(AuthenticationInformationDBO_1.AuthenticationInformationDBO)\n .where(\"id = :id\", { id: id })\n .execute();\n console.log(\"User deleted: \" + id);\n }", "title": "" }, { "docid": "6c9175553672af3831cfa2d1d61f5bda", "score": "0.75321686", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader()\n };\n\n return fetch('/users/' + id, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "36d4c4a4d3840a04fd2d90a3971d3843", "score": "0.75251347", "text": "function deleteUserFromServer(id) {\n return fetch(`${ApiSettings.searchPrefix}admin/users/${id}`,{\n method: 'DELETE'\n });\n}", "title": "" }, { "docid": "25324358e610a4e97e1392fc5677f0d0", "score": "0.7519425", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader()\n };\n\n return fetch(url() + '/users/' + id, requestOptions).then(response =>\n response.json().then(json => ({\n ok: response.ok,\n json\n })\n ))\n .then(handleResponse);\n}", "title": "" }, { "docid": "ae070778765873711d8cc3b6c2df4cea", "score": "0.7519191", "text": "function deleteUser(req, res) {\n\n console.log(\"in deleteUser\");\n\n if (validation.deleteUser(req)) {\n usersDAO.deleteUser(req.body.user_id, function (status, result) {\n res.status(status).json(result);\n });\n } else {\n utils.sendErrorValidation(res);\n }\n\n}", "title": "" }, { "docid": "d6fd35a538be96eaa633f64942f9726b", "score": "0.75168014", "text": "function deleteUser(id) {\n return fetch(`${BASE_URL}${id}`, {\n method: 'DELETE',\n headers: {\n 'Authorization': 'Bearer ' + tokenService.getToken()\n }\n }, \n {mode: \"cors\"})\n .then(res => res.json());\n}", "title": "" }, { "docid": "2621aee9e1799f99652d9e66f730cb97", "score": "0.7506457", "text": "function deleteUsers(req, res) {\n //get input from client\n var input = req.params;\n\n //get model\n var User = DB.model('User');\n\n //Operation\n User.remove({userId: input.id}, function (err) {\n if (err) return res.json({error: true, details: \"invalid user\", errorObj: err}, 404);\n return res.json({message: \"User account deleted successfully!\"})\n });\n\n}", "title": "" }, { "docid": "97a0a909450576fe25d0e2493d2c536d", "score": "0.74968976", "text": "async function deleteUser(req,res){\n try {\n const removeUser = await User.remove({ _id: req.params.userId });\n res.redirect('/users')\n }catch (err) {\n res\n .status(500)\n .json({ message: \"Internal Server Error. We are looking into this.\" });\n }\n}", "title": "" }, { "docid": "cc321ac988b0714d7d330b1f8355e940", "score": "0.74914706", "text": "static deleteById(id) {\n return db.result(`delete from users where id = $1`, [id])\n }", "title": "" }, { "docid": "0f833a99468cbbac8d5d0eae6e1330eb", "score": "0.74864566", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader(),\n };\n\n return fetch(`${origin}${config.apiUrl}/users/${id}`, requestOptions)\n .then((data) => handleResponse(data, requestOptions));\n}", "title": "" }, { "docid": "475932d2aef941002fe53d77e0604edf", "score": "0.7481093", "text": "function _delete( id ) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader()\n };\n\n return fetch( `${apiUrl}/users/${id}`, requestOptions ).then( handleResponse );\n}", "title": "" }, { "docid": "1dbb0f921ee88dcfc07457839e574f61", "score": "0.7473589", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader()\n };\n\n return fetch(config.apiUrl + '/users/' + id, requestOptions).then(handleResponse, handleError);\n}", "title": "" }, { "docid": "a0c33290cfdee12d8572001feb436e4d", "score": "0.7469143", "text": "async destroy (req, res) {\n await User.destroy({\n where: {\n id: req.params.id\n }\n });\n return res.status(204).json({\n status: 'removed'\n });\n}", "title": "" }, { "docid": "e7cb5d5a1abd973bb2d01ab98b01efe3", "score": "0.7468539", "text": "function removeUser( user_id ) {\n var request = $http({\n method: \"delete\",\n url: \"http://localhost:3000/api/user/\"+user_id,\n params: {\n action: \"delete\"\n },\n data: {\n user_id: user_id\n }\n\n });\n return( request.then( handleSuccess, handleError ) );\n }", "title": "" }, { "docid": "d0001de9da7f1973fb1ed2eadca0a3af", "score": "0.74494064", "text": "function deleteUser() {\n //Connect to the db\n console.log('Delete ID ' + $(this).attr('id'));\n //Delete the user using the key from the DB\n var user = firebase.database().ref('users/' + $(this).attr('id'));\n user.remove();\n}", "title": "" }, { "docid": "772f8b8d67af2b39f5386289cf6bc929", "score": "0.74371797", "text": "async delete(req, res) {\n try {\n // Find a single user by id\n const user = await User.findByPk(req.userId);\n if (!user) {\n return res.status(400).json({\n errors: [\"User does not exist.\"],\n });\n }\n\n // Deletes user entry in database\n await user.destroy();\n\n return res.json(`User ${user.name} was deleted form database`);\n } catch (error) {\n return res.status(400).json({\n errors: error.errors\n ? error.errors.map((err) => err.message)\n : \"Error 400 - Bad Request\",\n });\n }\n }", "title": "" }, { "docid": "fcea0d38b312718d82cecfdb33929fbf", "score": "0.7436837", "text": "function deleteById(id) {\n const requestOptions = { method: 'DELETE', headers: authHeader() };\n return fetch(`${config.apiUrl}/users/${id}`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "ad199cd04c3a211670a7249fdd943f02", "score": "0.7420207", "text": "delete(id) {\n return db.users.deleteOne(\n {\n \"_id\": ObjectId(id)\n }\n );\n }", "title": "" }, { "docid": "474fdffb8edb2158a631bae1ee9534cc", "score": "0.74095106", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader()\n };\n\n return fetch(`${config.apiUrl}/users/${id}`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "474fdffb8edb2158a631bae1ee9534cc", "score": "0.74095106", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader()\n };\n\n return fetch(`${config.apiUrl}/users/${id}`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "5102f7c27b99925c64dc913ba2281d6f", "score": "0.7406967", "text": "function deleteUser() {\n\tvar id = $(this).attr('data-id');\n\t$.ajax({\n\t\ttype: 'DELETE',\n\t\turl: userUrl + id,\n\t\tsuccess: function(data) {\n\t\t\topenUserPane();\n\t\t\t$userIndividualResults.empty();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e016bb579ef18d09c9ce65b971a46e8b", "score": "0.74051255", "text": "function destroy(id) {\n\n return $http.delete(userBase + id)\n .then(function(data){ return data.data; });\n }", "title": "" }, { "docid": "77398e77fd62d66be6f38e7afb6ee776", "score": "0.7397429", "text": "async destroy(id) {\n return User.findByIdAndRemove(id);\n }", "title": "" }, { "docid": "48b8e3357549aab881ab176cd5417b76", "score": "0.7395024", "text": "function deleteUser(Id){\n\t$.ajax({\n\t\turl: '/users/' + Id,\n\t\ttype: 'DELETE',\n\t\tsuccess: function(result){\n\t\t\tconsole.log(\"delete\");\n\t\t\twindow.location.reload(true);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "8e25da4e8a0fed85748bc5fd7a6e18f3", "score": "0.7392092", "text": "delete(req, res) {\n User.remove(req.params.userId, (err, data) => {\n if (err) {\n if (err.kind === \"not_found\") {\n res.status(404).send({\n message: `Not found User with id ${req.params.userId}.`\n });\n } else {\n res.status(500).send({\n message: \"Could not delete User with id \" + req.params.userId\n });\n }\n } else{\n delUserImage(req.params.userId,(err, dataImg)=>{\n if(err){\n res.status(500).send({\n message: \"Error deleting img from user with id \" + userId\n });\n }else{\n //res.send({ message: `User was deleted successfully!` });\n }\n });\n res.send({ message: `User was deleted successfully!` });\n }\n });\n }", "title": "" }, { "docid": "1e914b74937bd07de23cab104dd92475", "score": "0.7391825", "text": "async deleteOneUser(id) {\n try {\n const response = await axios.delete(this.baseUrl + \"/api/users/\" + id);\n return response.data;\n } catch (e) {\n return null;\n }\n }", "title": "" }, { "docid": "791f536ab0f43cc531eb2f0ae7144b7f", "score": "0.73788404", "text": "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader()\n };\n\n return fetch(`users/${id}`, requestOptions).then(handleResponse);\n}", "title": "" }, { "docid": "13792593f1813dac73a2e4d397982913", "score": "0.73716635", "text": "function deleteUser(event) {\n var deleteBtn = $(event.target);\n var index = deleteBtn.attr(\"id\");\n var id = users[index]._id;\n\n userService.deleteUser(id)\n .then(function (status) {\n users.splice(index, 1);\n renderUsers(users);\n })\n}", "title": "" }, { "docid": "369f32b24718fce20276252b2f2fe8c6", "score": "0.7362363", "text": "async deleteUser(request, response) {\n // Currently leaving this unimplemented. We will someday want to allow\n // users to delete themselves. Probably some day soon. But it is not\n // this day. Trying to reduce the maintenance surface by removing\n // anything we're not actively using for now.\n throw new ControllerError(501, 'not-implemented', `Attempt to delete User(${request.params.id}).`)\n /*const results = await this.database.query(\n 'delete from users where id = $1',\n [ request.params.id ]\n )\n\n if ( results.rowCount == 0) {\n return response.status(404).json({error: 'no-resource'})\n }\n\n return response.status(200).json({userId: request.params.id})*/\n }", "title": "" }, { "docid": "4e3c68e492878c2801f905c9ebe118bc", "score": "0.7346985", "text": "static delete(req,res){\n UserModel.findByIdAndRemove(req.params.id).then(\n (user)=>{\n res.status(201).json(user);\n }\n );\n }", "title": "" }, { "docid": "b911078182a32d8dc8c2e3e1490e7a15", "score": "0.7310978", "text": "function _delete(_id) {\n var deferred = Q.defer();\n \n db.users.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}", "title": "" }, { "docid": "ab258798096949f59492f8c4227b37cb", "score": "0.7309343", "text": "function destroy(req, res) {\n _userModel2['default'].findByIdAndRemoveAsync(req.params.id).then(function () {\n res.status(204).end();\n })['catch'](handleError(res));\n}", "title": "" }, { "docid": "a86fa78bb018d49a0609874ed3444882", "score": "0.73057467", "text": "function deleteUser(userId) {\n return fetch('/api/users/delete/' + userId,{\n method: 'Delete',\n body: JSON.stringify(userId),\n headers: {'content-type': 'application/json'}\n }).then(function(response) {\n return response.json();\n });\n \n \t\n }", "title": "" }, { "docid": "6b1c016bdd53435a438ad509c89a59b9", "score": "0.7300808", "text": "async function deleteUserById(req,res,next){\n User.findByIdAndDelete( req.params.userId,(err, user)=>{\n if (err){\n console.log(err)\n }\n else{\n res.status(200)\n console.log(\"deleted the user\"+user);\n res.json({user})\n }\n });\n}", "title": "" }, { "docid": "32a45171a228ef0d1330fe1992760dff", "score": "0.72985536", "text": "function deleteUser(req, res) {\n var object = {};\n object['facebook_id'] = req.params.fb_id;\n databaseCall.deleteQuery(userSchema, object).then(function (response) {\n res.json(response);\n });\n}", "title": "" }, { "docid": "e1e8abfae1a859c9d7bd44db3c989e2c", "score": "0.72947955", "text": "async deleteUserByID(ctx) {\n await Model.user\n .deleteOne({ _id: ctx.params.id })\n .then(result => {\n if(result.deletedCount > 0) { ctx.body = \"Delete Successful\"; }\n else { throw \"Error deleting user\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }", "title": "" }, { "docid": "449dd9a2e1c9a12986765d60b7655dfe", "score": "0.72916454", "text": "removeUser (userId, callback) {\n request.del(config.scitran.url + 'users/' + userId, {}, (err, res) => {\n callback(err, res);\n });\n }", "title": "" }, { "docid": "37ee122b672ac40b92d785864e511d00", "score": "0.7287344", "text": "function deleteUser (req, res) {\n let myid = req.params.id\n let foundIndex = users.findIndex(x => x.id == myid);\n console.log(foundIndex)\n users.splice(foundIndex,1);\n\n // Error Handeling\n if (foundIndex == -1) {\n res.status(404).send('No user with that ID found')\n }\n\n res.send(\"deleted -jte\")\n}", "title": "" }, { "docid": "7e926cf20142ec88be0ca862d1791d29", "score": "0.7276848", "text": "async function deleteById(req, res) {\n const { id } = req.params;\n try {\n const { rows } = await db.query(queries.getAllUsers);\n const userIndex = await rows.findIndex((user) => user.user_id === id);\n if (userIndex === -1) {\n throw new Error('The user you seek does not exist');\n }\n rows.splice(userIndex, userIndex + 1);\n return res.status(200).json({ status: 'success', message: `User with ${id} successfully deleted` });\n } catch (error) {\n return res.status(400).send({ status: 'error', message: error });\n }\n}", "title": "" }, { "docid": "ebdcdf45060fe257079efd27ca070f96", "score": "0.7266967", "text": "function deleteUser(username) {\n // Reference to the user\n var userRef = database.ref('/users/' + username)\n\n // Delete the user\n userRef.remove();\n}", "title": "" }, { "docid": "372849a80cb5d3f6780cd9772f62d94a", "score": "0.7264303", "text": "async deleteUser(id){\n const response = await this.delete(`user/delete/${id}`);\n console.log(response);\n return response;\n }", "title": "" }, { "docid": "07a080f1e6725c013bc8b69e390b72b5", "score": "0.7259632", "text": "deleteUser() {\n let user = this.getCurrentUser(),\n id = this.getUserId();\n user.delete().then(() => {\n message = Config.USER_AUTH.MESSAGE.DELETE_USER_SUCCESS;\n event = new Event(Config.USER_AUTH.EVENT.SUCCESS_ACTION, {\n message: message,\n });\n this.notifyAll(new Event(Config.USER_AUTH.EVENT.PROFILE_DELETED,\n id));\n this.notifyAll(event);\n }).catch(() => {\n firebase.default.auth().signOut();\n message = Config.USER_AUTH.MESSAGE.SESSION_EXPIRED;\n event = new Event(Config.USER_AUTH.EVENT\n .ERROR_ACTION, { message: message });\n this.notifyAll(event);\n });\n }", "title": "" }, { "docid": "c35e6fdcbbf58e4a135d62c0f9c7ccd5", "score": "0.7256728", "text": "function deleteUserPost(id) {\n\treturn axios.delete(`http://127.0.0.1:3000/api/admin/delete-post/${id}`);\n}", "title": "" }, { "docid": "8e8fd84a85565f3b33e2ccbba8f2ae55", "score": "0.7245012", "text": "static deleteUser(idUser,cb){\n userdb.findById({_id : idUser}, function(err,user){\n if(err) throw err;\n user.remove(function(err){\n if(err) throw err;\n cb('User deleted');\n });\n });\n }", "title": "" }, { "docid": "0a9fb5563ee0fb23e00aab922e8b9988", "score": "0.72304636", "text": "delete(id) {\n return fetch(`${remoteURL}/users/${id}`, {\n method: \"DELETE\"\n })\n }", "title": "" }, { "docid": "561a0cff9073838fa068f30ff87e52cd", "score": "0.7216497", "text": "function deleteUser(req,res) {\n if(isAdmin(req.user)) {\n\n userModel\n .deleteUser(req.params.userId)\n .then(\n function(user){\n return userModel.findAllUsers();\n },\n function(err){\n res.status(400).send(err);\n }\n )\n .then(\n function(users){\n res.json(users);\n },\n function(err){\n res.status(400).send(err);\n }\n );\n } else {\n res.status(403);\n }\n\n }", "title": "" }, { "docid": "448e4a59ac53f3e4b8951683704b7017", "score": "0.7182496", "text": "deleteUser(state, id) {\n const ind = findIndex(state.users, (r) => {\n return r.id === id\n })\n\n state.users.splice(ind, 1)\n }", "title": "" }, { "docid": "42888f192abfdfcdc96a0e1b5ec6f027", "score": "0.71771055", "text": "function deleteUser(discordId, callback) {\n const gearDb = client.db(\"gear\");\n gearDb.collection(\"users\").deleteOne({discord_id: discordId}, (err, obj) => {\n if(err) {\n callback(err);\n } else {\n callback(null);\n }\n });\n}", "title": "" }, { "docid": "b096f1cad26835b4c14d00161468e596", "score": "0.71624905", "text": "deleteuser(id) {\n fetch(\"/admin/deleteUser\", {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n id,\n }),\n })\n .then((res) => res.json())\n .then((result) => {\n alert(result);\n window.location.reload();\n })\n .catch((err) => alert(err));\n }", "title": "" }, { "docid": "b4e998626996f47fc5cf667edbf21adf", "score": "0.71549827", "text": "deleteUser() {\n this.PromptService.confirm('Do you really want to delete this profile? All data will be permanently deleted.')\n .then(() => {\n this.UserResource.remove(this.user)\n .then(() => {\n this.ToastService.success('The profile has been deleted');\n\n // remove the users jwt so that he cannot do anything after being deleted\n this.SessionService.removeUser();\n this.EventBus.emit(events.USER_LOGGED_IN, {user: null});\n this.EventBus.emit(events.PROJECT_OPENED, {project: null});\n this.$state.go('root');\n })\n .catch(response => {\n this.ToastService.danger('The profile could not be deleted. ' + response.data.message);\n });\n });\n }", "title": "" }, { "docid": "8b1cc8d74e591f0bccc340c737e3a33e", "score": "0.71459526", "text": "function deleteUser(userId) {\n\n var defer = $q.defer();\n\n $http({\n\n method: 'DELETE',\n url: userAdminURL + 'users/' + userId\n\n })\n .then(function(response) {\n\n if (typeof response.data === 'object') {\n\n defer.resolve(response.data);\n\n } else {\n\n defer.reject(response);\n\n }\n },\n // HTTP error handler\n function(error) {\n\n defer.reject(error);\n\n });\n\n return defer.promise;\n \n }", "title": "" }, { "docid": "bf4fa38cc57a986867a2d5c317ba56b1", "score": "0.7142946", "text": "function deleterUser(req, res) {\r\n // únicamente borra a su propio usuario obteniendo el id del token\r\n Usuario.findOneAndDelete({ _id: req.usuario.id })\r\n .then(r => { //Buscando y eliminando usuario en MongoDB.\r\n console.log(r);\r\n res.status(200).send(`Usuario con id ${req.params.id} con nombre ${r.username} eliminado`);\r\n }).catch(res.status(422).json({ errors: `Usuario ${req.params.id} no encontrado` }));\r\n}", "title": "" }, { "docid": "c3b10c89bfd5915dc8b08f184150df82", "score": "0.7139144", "text": "static async remove(id) {\n let result = await db.query(\n `DELETE\n FROM users\n WHERE id = $1\n RETURNING id,\n first_name AS \"firstName\",\n last_name AS \"lastName\",\n email`,\n [id],\n );\n const user = result.rows[0];\n\n if (!user) throw new NotFoundError(`No user: ${id}`);\n }", "title": "" }, { "docid": "72df76c38644f74772a46800ef473120", "score": "0.7133646", "text": "deleteUser() {\n\n }", "title": "" }, { "docid": "18f80b7687b1aa3d4a3211a100629dbb", "score": "0.71223223", "text": "deleteUser(email, pass){\n\n }", "title": "" }, { "docid": "a17a9adc2280413ce0600037295e0198", "score": "0.71207666", "text": "function deleteUsuario(req, res) {\r\n\r\n if (req.params.idUser) {\r\n\r\n var id = req.params.idUser\r\n var mongoose = require(\"mongoose\")\r\n\r\n /* \"_id\": new mongoose.mongo.ObjectId(idUser) */\r\n Usuario.findByIdAndRemove({ \"_id\": new mongoose.mongo.ObjectId(id) })\r\n .exec(function (err, usuarioRemoved) {\r\n if (err) {\r\n res.status(500).send({\r\n borrado: false,\r\n message: \"Error en el servidor\",\r\n messageError: err,\r\n id: id\r\n })\r\n } else {\r\n if (usuarioRemoved != 0) {\r\n res.status(200).send({\r\n borrado: true,\r\n usuarioRemoved: usuarioRemoved\r\n })\r\n } else {\r\n res.status(200).send({\r\n borrado: false,\r\n message: \"La matricula no existe\"\r\n })\r\n }\r\n }\r\n })\r\n } else {\r\n res.status(200).send({\r\n borrado: false,\r\n message: \"Falta por especificar el id de la matricula\"\r\n })\r\n }\r\n}", "title": "" }, { "docid": "89af5821e9c2290f88223637ab3459a2", "score": "0.7108165", "text": "function _delete(id) {\n return (dispatch) => {\n dispatch(request(id));\n\n userService.delete(id).then(\n (user) => dispatch(success(id)),\n (error) => dispatch(failure(id, error.toString()))\n );\n };\n\n function request(_id) {\n return { type: userConstants.DELETE_REQUEST, _id };\n }\n\n function success(_id) {\n return { type: userConstants.DELETE_SUCCESS, _id };\n }\n\n function failure(_id, error) {\n return { type: userConstants.DELETE_FAILURE, _id, error };\n }\n}", "title": "" }, { "docid": "c4f9fae3d3845d500c174d8bdf856bf0", "score": "0.7107201", "text": "function deleteUser (res,req,mysql) {\r\n\t\t\tmysql.pool.query('DELETE FROM users WHERE user_id=?', \r\n\t\t\t[req.session.user_id], function(error, results, fields){\r\n\t\t\t\tif(error){\r\n\t\t\t\t\tres.write(JSON.stringify(error));\r\n\t\t\t\t\tres.end();\r\n\t\t\t\t}\r\n\t\t\t\treq.session.destroy();\r\n\t\t\t\tres.redirect('/login');\r\n\t\t\t});\r\n\t}", "title": "" }, { "docid": "2b8e8cb11745ec837fbe72229d273aa6", "score": "0.71066296", "text": "async function deleteUser(userId, sessionId, callback) {\n\tconst returnedData = await genericActions.deleteById(baseUrl, property, userId, sessionId, callback);\n}", "title": "" }, { "docid": "bca38dbed1503dda007d0453a70a6286", "score": "0.709295", "text": "function _removeUserById(req, res, next) {\n\tvar userId = req.params.id;\n\n\tif(!COMMON_ROUTE.isValidId(userId)){\n\t\tjson.status = '0';\n\t\tjson.result = { 'message': 'Invalid User Id!' };\n\t\tres.send(json);\n\t} else { \n\t\tUSERS_COLLECTION.find({ _id: new ObjectID(userId)}, function (usererror, getUser) {\n if (usererror || !getUser) {\n json.status = '0';\n json.result = { 'message': 'User not exists!' };\n res.send(json);\n } else {\n USERS_COLLECTION.deleteOne({ _id: new ObjectID(userId) }, function (error, result) {\n if (error) {\n json.status = '0';\n json.result = { 'error': 'Error in deleting user!' };\n res.send(json);\n } else {\n json.status = '1';\n json.result = { 'message': 'User deleted successfully.','_id':userId };\n res.send(json);\n }\n });\n }\n\t\t});\n\t}\n}", "title": "" }, { "docid": "2e2bc4569b63ccf1a9a7427574ac3909", "score": "0.7088993", "text": "function deleteUserSuccess(json) {\n var user = json;\n var userId = user._id;\n\n $(\"[data-user-id=\" + userId + \"]\").remove();\n}", "title": "" }, { "docid": "841ccda599da7f7b0f0a1a66fb9c37e6", "score": "0.708859", "text": "deleteUser(user_id: number, callback: (status: string, data: Object) => mixed) {\n super.query('DELETE FROM user WHERE user_id=?', [user_id], callback);\n }", "title": "" }, { "docid": "3387db49584f7af893c598e3bfef1a0d", "score": "0.7078993", "text": "function deleteUserById(id) {\r\n id = prompt(\"please enter your id\");\r\n users.forEach((item, i) => {\r\n if (id === item.userId) {\r\n users.splice(i, 1);\r\n }\r\n\r\n });\r\n\r\n showAllUsers();\r\n}", "title": "" }, { "docid": "040dbfa2ffaa0b2dc27e73141f4c8a3f", "score": "0.70756274", "text": "function _delete(id) {\n return dispatch => {\n dispatch(request(id));\n\n userService.delete(id)\n .then(\n user => dispatch(success(user)),\n error => dispatch(failure(id, error.toString()))\n );\n };\n\n function request(id) { return { type: userConstants.DELETE_REQUEST, payload: id } }\n function success(id) { return { type: userConstants.DELETE_SUCCESS, payload: id } }\n function failure(id, error) { return { type: userConstants.DELETE_FAILURE, payload: { id, error } } }\n}", "title": "" } ]
d658be806737da8ecc6d21641f163962
Report Card. 5 points. Write a function that prompts the user to enter test, quiz, and homework grades for the marking period. Users can enter as many grades of each category, entering 1 to signal they are finished. Your function should output the user's final grade, where tests, quizzes, and homework are weighted at 60%, 30%, and 10%, respectively. Grades must be real numbers in the range [0.0, 100.0], and users should be continuously reprompted until they comply with this restriction. The only exception is 1, which signals the user is finished entering grades for that category. As always, certain portions of the starter code are critical to the the feedback script. Please do not modify these sections. They are clearly marked. All output should be displayed on the page, not printed to the console.
[ { "docid": "7026597cc2f7796629fc38e0595c1aa1", "score": "0.7730724", "text": "function reportCard() {\n\n ///////////////////////// DO NOT MODIFY\n let testTotal = 0; ////// DO NOT MODIFY\n let quizTotal = 0; ////// DO NOT MODIFY\n let homeworkTotal = 0; // DO NOT MODIFY\n ///////////////////////// DO NOT MODIFY\n\n /*\n * NOTE: The 'testTotal', 'quizTotal', and 'homeworkTotal' variables\n * should be representative of the sum of the test scores, quiz\n * scores, and homework scores the user enters, respectively.\n */\n\n ///////////////////// DO NOT MODIFY\n let tests = 0; ////// DO NOT MODIFY\n let quizzes = 0; //// DO NOT MODIFY\n let homeworks = 0; // DO NOT MODIFY\n ///////////////////// DO NOT MODIFY\n\n alert(\"You will be asked to put in test grades, then quiz grades, then homework grades for the marking period. You may enter any number of grades for each category, and type '-1' once you are done with a category.\");\n let testScore = 0;\n let quizScore = 0;\n let homeworkScore = 0;\n let integerCheck;\n while(testScore != -1) {\n testScore = prompt(\"Enter a test score between 0.0 and 100.0.\");\n testScore = +testScore;\n integerCheck = Number.isInteger(testScore);\n while(testScore != -1 && testScore !== null && (integerCheck == false || testScore < 0 || testScore > 100)) {\n testScore = prompt(\"ENTER A TEST SCORE BETWEEN 0.0 AND 100.0!\");\n testScore = +testScore;\n integerCheck = Number.isInteger(testScore);\n }\n\n if(testScore != -1) {\n testTotal = testTotal + testScore;\n tests++;\n }\n }\n\n while(quizScore != -1) {\n quizScore = prompt(\"Enter a quiz score between 0.0 and 100.0.\");\n quizScore = +quizScore;\n integerCheck = Number.isInteger(quizScore);\n while(quizScore != -1 && quizScore !== null && (quizScore < 0 || quizScore > 100)) {\n quizScore = prompt(\"ENTER A QUIZ SCORE BETWEEN 0.0 AND 100.0!\");\n quizScore = +quizScore;\n integerCheck = Number.isInteger(quizScore);\n }\n\n if(quizScore != -1) {\n quizTotal = quizTotal + quizScore;\n quizzes++;\n }\n }\n\n while(homeworkScore != -1) {\n homeworkScore = prompt(\"Enter a homework score between 0.0 and 100.0.\");\n homeworkScore = +homeworkScore;\n integerCheck = Number.isInteger(homeworkScore);\n while(homeworkScore != -1 && homeworkScore !== null && (homeworkScore < 0 || homeworkScore > 100)) {\n homeworkScore = prompt(\"ENTER A HOMEWORK SCORE BETWEEN 0.0 AND 100.0!\");\n homeworkScore = +homeworkScore;\n integerCheck = Number.isInteger(homeworkScore);\n }\n\n if(homeworkScore != -1) {\n homeworkTotal = homeworkTotal + homeworkScore;\n homeworks++;\n }\n }\n\n let testAverage = testTotal / tests;\n let quizAverage = quizTotal / quizzes;\n let homeworkAverage = homeworkTotal / homeworks;\n let grade = 0.6 * testAverage + 0.3 * quizAverage + 0.1 * homeworkAverage;\n let p = document.getElementById(\"report-card-output\");\n p.innerHTML = \"Tests: \" + testAverage.toFixed(2) + \"<br>\" + \"Quizzes: \" + quizAverage.toFixed(2) + \"<br>\" + \"Homework: \" + homeworkAverage.toFixed(2) + \"<br>\" + \"Grade: \" + grade.toFixed(2);\n\n /*\n * NOTE: The 'tests', 'quizzes', and 'homeworks' variables should be\n * representative of the number of tests, quizzes, and homework\n * grades the user enters, respectively.\n */\n\n /////////////////////// DO NOT MODIFY\n check('report-card', // DO NOT MODIFY\n testTotal, ////////// DO NOT MODIFY\n tests, ////////////// DO NOT MODIFY\n quizTotal, ////////// DO NOT MODIFY\n quizzes, //////////// DO NOT MODIFY\n homeworkTotal, ////// DO NOT MODIFY\n homeworks /////////// DO NOT MODIFY\n ); //////////////////// DO NOT MODIFY\n /////////////////////// DO NOT MODIFY\n}", "title": "" } ]
[ { "docid": "5783bd073dc97d5cc663797307b7fc17", "score": "0.73676294", "text": "function reportCard() {\n\n ///////////////////////// DO NOT MODIFY\n let testTotal = 0; ////// DO NOT MODIFY\n let quizTotal = 0; ////// DO NOT MODIFY\n let homeworkTotal = 0; // DO NOT MODIFY\n ///////////////////////// DO NOT MODIFY\n\n /*\n * NOTE: The 'testTotal', 'quizTotal', and 'homeworkTotal' variables\n * should be representative of the sum of the test scores, quiz\n * scores, and homework scores the user enters, respectively.\n */\n\n ///////////////////// DO NOT MODIFY\n let tests = 0; ////// DO NOT MODIFY\n let quizzes = 0; //// DO NOT MODIFY\n let homeworks = 0; // DO NOT MODIFY\n ///////////////////// DO NOT MODIFY\n\n /*\n * NOTE: The 'tests', 'quizzes', and 'homeworks' variables should be\n * representative of the number of tests, quizzes, and homework\n * grades the user enters, respectively.\n */\n\nlet hGrades\nlet qGrades\nlet tGrades\n\ndo {\n hGrades = prompt(\"Enter homework grades. When finished entering, use a -1 grade to signify such.\")\n if (hGrades >= 0 && hGrades <= 100){\n homeworkTotal= hGrades + homeworkTotal\n homeworks= homeworks + 1\n }\n} while(hGrades!= -1)\n\ndo {\n qGrades = prompt(\"Enter quiz grades. When finished entering, use a -1 grade to signify such.\")\n if (qGrades >= 0 && qGrades <= 100) {\n quizTotal= qGrades + quizTotal\n quizzes= quizzes + 1\n }\n} while(qGrades!= -1)\n\ndo {\n tGrades = prompt(\"Enter test grades. When finished entering, use a -1 grade to signify such.\")\n if(tGrades >= 0 && tGrades <= 100) {\n testTotal= tGrades + testTotal\n tests= tests + 1\n }\n} while(tGrades!= -1)\n\nlet homeAve= (homeworkTotal/homeworks).toFixed(2)\nlet quizAve= (quizTotal/quizzes).toFixed(2)\nlet testAve= (testTotal/tests).toFixed(2)\n\nlet averageGrade= ((homeAve * 0.1) + (quizAve * 0.3) + (testAve * 0.6)).toFixed(2)\n\nlet p= document.getElementById(\"report-card-output\")\np.innerHTML= `Tests: ${testAve}</br> Quizzes: ${quizAve}</br> Homework: ${homeworkAve}</br> Grade: ${averageGrade}`\n\n /////////////////////// DO NOT MODIFY\n check('report-card', // DO NOT MODIFY\n testTotal, ////////// DO NOT MODIFY\n tests, ////////////// DO NOT MODIFY\n quizTotal, ////////// DO NOT MODIFY\n quizzes, //////////// DO NOT MODIFY\n homeworkTotal, ////// DO NOT MODIFY\n homeworks /////////// DO NOT MODIFY\n ); //////////////////// DO NOT MODIFY\n /////////////////////// DO NOT MODIFY\n}", "title": "" }, { "docid": "7f59ece81b8a41754975cd1a6c1c9ee3", "score": "0.7246367", "text": "function reportCard() {\n\n ///////////////////////// DO NOT MODIFY\n let testTotal = 0; ////// DO NOT MODIFY\n let quizTotal = 0; ////// DO NOT MODIFY\n let homeworkTotal = 0; // DO NOT MODIFY\n ///////////////////////// DO NOT MODIFY\n\n let op7 = document.getElementById(\"report-card-output\");\n let t = 0;\n let k = 0;\n let testGrades = [];\n\n do {\n testGrades[t] = prompt(\"Enter a test grade percent. To move on to quiz grades, enter -1:\")\n if (testGrades[t] < 0 && testGrades[t] > -1) {\n alert(\"Please enter a valid number\")\n }else if (testGrades[t] < -1) {\n alert(\"Please enter a valid number\")\n }else if (isNaN(testGrades[t])) {\n alert(\"Please enter a valid number\")\n }else if (testGrades[t] > 100) {\n alert(\"Please enter a valid number\")\n }else {\n k = testGrades[t];\n testGrades[t] = (testGrades[t] / 100);\n t = (t + 1);\n }\n }while (k != (-1))\n\n testGrades.pop();\n console.log(testGrades);\n\n let q = 0;\n k = 0;\n let quizGrades = [];\n\n do {\n quizGrades[q] = prompt(\"Enter a quiz grade percent. To move on to homework grades, enter -1:\")\n if (quizGrades[q] < 0 && quizGrades[q] > -1) {\n alert(\"Please enter a valid number\")\n }else if (quizGrades[q] < -1) {\n alert(\"Please enter a valid number\")\n }else if (isNaN(quizGrades[q])) {\n alert(\"Please enter a valid number\")\n }else if (quizGrades[q] > 100) {\n alert(\"Please enter a valid number\")\n }else {\n k = quizGrades[q];\n quizGrades[q] = (quizGrades[q] / 100);\n q = (q + 1);\n }\n }while (k != (-1))\n\n quizGrades.pop();\n console.log(quizGrades);\n\n let h = 0;\n k = 0;\n let homeworkGrades = [];\n\n do {\n homeworkGrades[h] = prompt(\"Enter a homework grade percent. To get the final grade, enter -1:\")\n if (homeworkGrades[h] < 0 && homeworkGrades[h] > -1) {\n alert(\"Please enter a valid number\")\n }else if (homeworkGrades[h] < -1) {\n alert(\"Please enter a valid number\")\n }else if (isNaN(homeworkGrades[h])) {\n alert(\"Please enter a valid number\")\n }else if (homeworkGrades[h] > 100) {\n alert(\"Please enter a valid number\")\n }else {\n k = homeworkGrades[h];\n homeworkGrades[h] = (homeworkGrades[h] / 100);\n h = (h + 1);\n }\n }while (k != (-1))\n\n homeworkGrades.pop();\n console.log(homeworkGrades);\n\n for (t = 0; t < testGrades.length; t++) {\n testTotal = (testTotal + testGrades[t]);\n}\n let testOut = (testTotal / testGrades.length);\n// testOut = (testOut / 100);\n\n for (q = 0; q < quizGrades.length; q++) {\n quizTotal = (quizTotal + quizGrades[q]);\n}\n let quizOut = (quizTotal / quizGrades.length);\n// quizOut = (quizOut / 100);\n\n for (h = 0; h < homeworkGrades.length; h++) {\n homeworkTotal = (homeworkTotal + homeworkGrades[h]);\n}\n let homeworkOut = (homeworkTotal / homeworkGrades.length);\n// homeworkOut = (homeworkOut / 100);\n\n testAVG = (testOut * 0.6);\n quizAVG = (quizOut * 0.3);\n homeworkAVG = (homeworkOut * 0.1);\n// testOut.toFixed(2);\n// quizOut.toFixed(2);\n// homeworkOut.toFixed(2);\n testOut = Math.round(testOut * 100) / 100;\n quizOut = Math.round(quizOut * 100) / 100;\n homeworkOut = Math.round(homeworkOut * 100) / 100;\n\n let gradeTotal = (testAVG + quizAVG + homeworkAVG);\n gradeTotal = Math.round(gradeTotal * 100) / 100;\n\n testOut.toFixed(2);\n quizOut.toFixed(2);\n homeworkOut.toFixed(2);\n gradeTotal.toFixed(2);\n\n /*\n * NOTE: The 'testTotal', 'quizTotal', and 'homeworkTotal' variables\n * should be representative of the sum of the test scores, quiz\n * scores, and homework scores the user enters, respectively.\n */\n\n ///////////////////// DO NOT MODIFY\n let tests = 0; ////// DO NOT MODIFY\n let quizzes = 0; //// DO NOT MODIFY\n let homeworks = 0; // DO NOT MODIFY\n ///////////////////// DO NOT MODIFY\n\n tests = testGrades.length;\n quizzes = quizGrades.length;\n homeworks = homeworkGrades.length;\n\n /*\n * NOTE: The 'tests', 'quizzes', and 'homeworks' variables should be\n * representative of the number of tests, quizzes, and homework\n * grades the user enters, respectively.\n */\n\n op7.innerHTML = (`Tests: ${testOut}</br>Quizzes: ${quizOut}</br>Homework: ${homeworkOut}</br>Grade: ${gradeTotal}`);\n\n\n /////////////////////// DO NOT MODIFY\n check('report-card', // DO NOT MODIFY\n testTotal, ////////// DO NOT MODIFY\n tests, ////////////// DO NOT MODIFY\n quizTotal, ////////// DO NOT MODIFY\n quizzes, //////////// DO NOT MODIFY\n homeworkTotal, ////// DO NOT MODIFY\n homeworks /////////// DO NOT MODIFY\n ); //////////////////// DO NOT MODIFY\n /////////////////////// DO NOT MODIFY\n}", "title": "" }, { "docid": "219a1120f67d5553f3806bce7935eb32", "score": "0.70636773", "text": "function reportCard() {\n\n ///////////////////////// DO NOT MODIFY\n let testTotal = 0; ////// DO NOT MODIFY\n let quizTotal = 0; ////// DO NOT MODIFY\n let homeworkTotal = 0; // DO NOT MODIFY\n ///////////////////////// DO NOT MODIFY\n\n /*\n * NOTE: The 'testTotal', 'quizTotal', and 'homeworkTotal' variables\n * should be representative of the sum of the test scores, quiz\n * scores, and homework scores the user enters, respectively.\n */\n\n ///////////////////// DO NOT MODIFY\n let tests = 0; ////// DO NOT MODIFY\n let quizzes = 0; //// DO NOT MODIFY\n let homeworks = 0; // DO NOT MODIFY\n ///////////////////// DO NOT MODIFY\n\n let testScoresDone = false;\n let testScoresInput;\n while (testScoresDone == false) {\n do {\n testScoresInput = prompt(\"Please enter either a test score between 1 and 100 or -1 to indicate that you have finished entering test scores\");\n } while ((!Number(testScoresInput) > 0) || (Number(testScoresInput) > 100));\n /*Note that at first all algorithms were written with \"do... while\" loops to remprompt for the problem parameters\n before most of the problems then proceeded not to work and stick me in an infinite prompt loop. This is the only one that\n held out for me so I kept it because I didn't want to change it to a while loop like all the others. Same goes for \"guess\".\n Normally I'd assume it's bad form to be inconsistent like that but \"if it ain't broke...\"*/\n if (testScoresInput != -1) {\n testTotal += testScoresInput;\n tests++;\n }else {\n testScoresDone = true;\n }\n }\n\n let testAvg = (testTotal/tests).toFixed(2);\n\n\n let quizScoresDone = false;\n let quizScoresInput;\n while (quizScoresDone == false) {\n do {\n quizScoresInput = prompt(\"Please enter either a quiz score between 1 and 100 or -1 to indicate that you have finished entering quiz scores\");\n } while ((!Number(quizScoresInput) > 0) || (Number(quizScoresInput) > 100))\n if (quizScoresInput != -1) {\n quizTotal += quizScoresInput;\n quizzes++;\n }else {\n quizScoresDone = true;\n }\n }\n\n let quizAvg = (quizTotal/quizzes).toFixed(2);\n\n\n let hwScoresDone = false;\n let hwScoresInput;\n while (hwScoresDone == false) {\n do {\n hwScoresInput = prompt(\"Please enter either a homework score between 1 and 100 or -1 to indicate that you have finished entering homework scores\");\n } while ((!Number(hwScoresInput) > 0) || (Number(hwScoresInput) > 100));\n\n if (hwScoresInput != -1) {\n homeworkTotal += hwScoresInput;\n homeworks++;\n }else {\n hwScoresDone = true;\n }\n }\n\n let hwAvg = (homeworkTotal/homeworks).toFixed(2);\n\n let oaAvg = ((testAvg * .6) + (quizAvg * .3) + (hwAvg * .1)).toFixed(2)\n\n let Averages = document.getElementById(\"report-card-output\");\n Averages.innerHTML = \"Tests: \" + testAvg + \"<br/>Quizzes: \" + quizAvg + \"<br/>Homework: \" + hwAvg + \"<br/>Grade: \" + oaAvg;\n /////////////////////// DO NOT MODIFY\n check('report-card', // DO NOT MODIFY\n testTotal, ////////// DO NOT MODIFY\n tests, ////////////// DO NOT MODIFY\n quizTotal, ////////// DO NOT MODIFY\n quizzes, //////////// DO NOT MODIFY\n homeworkTotal, ////// DO NOT MODIFY\n homeworks /////////// DO NOT MODIFY\n ); //////////////////// DO NOT MODIFY\n /////////////////////// DO NOT MODIFY\n }", "title": "" }, { "docid": "179b5311925689c46d3c5d8b38465553", "score": "0.68232924", "text": "function myFuction(){\n\n var desiredGrade = document.getElementById(\"desiredGrade\").value;\n console.log(desiredGrade)\n var collegeReadinessPercent = document.getElementById(\"collegeReadinessPercent\").value;\n console.log(collegeReadinessPercent)\n var masteryWeight = document.getElementById(\"masteryWeight\").value /100;\n var collegeReadinessWeight = document.getElementById(\"collegeReadinessWeight\").value /100;\n var masteryPercent = (desiredGrade/masteryWeight) - (collegeReadinessPercent*collegeReadinessWeight/masteryWeight)\n console.log(masteryPercent)\n\n\n var ptsInputted = document.getElementById(\"ptsInputted\").value;\n var ptsMaximumInputted = document.getElementById(\"ptsMaximumInputted\").value;\n var ptsOnFinal = document.getElementById(\"ptsOnFinal\").value;\n var gradeOnFinal = ((masteryPercent*ptsMaximumInputted)/100) + ((masteryPercent*ptsOnFinal)/100) - ptsInputted\n console.log (gradeOnFinal)\n alert(\"you will need to score at least \" + gradeOnFinal + \" pts on the final AKA get a \" + (gradeOnFinal/ptsOnFinal)*100 + \"% on the final\")\n\n\n}", "title": "" }, { "docid": "2e38f668567fcec4748ee629cad06934", "score": "0.6750143", "text": "function gradeMe(){\n\tvar score1, score2, score3, score4, n1, n2, n3, n4, final, arrayNumber;\n\tscore1 = document.getElementById(\"num1\").value;\n\tscore2 = document.getElementById('num2').value;\n\tscore3 = document.getElementById(\"num3\").value;\n\tscore4 = document.getElementById(\"num4\").value;\n\tn1 = parseInt(score1);\n\tn2 = parseInt(score2);\n\tn3 = parseInt(score3);\n\tn4 = parseInt(score4);\n\tarrayNumber = [n1,n2,n3,n4];\n\tfor (i=0;i<arrayNumber.length; i++){\n\t\tif (isNaN(arrayNumber[i]))\n\t {\n\t \talert(\"Please enter integers only for scores.\");\n\t }\n\t else if (arrayNumber[i] > 100 || arrayNumber[i] < 0)\n\t {\n\t \talert(\"Scores must be between 0 and 100!\");\n\t }\n\tfinal = (.5 * n1) + (.2 * score2) + (.2 * score3) + (.1 * score4);\n\tdocument.math.num5.value = Math.round(final);\n\t};\n\tif (final < 70){\n\t\talert(\"Your final grade is below a C, you will need to retake the course.\");\n\t}\n}", "title": "" }, { "docid": "26b20e1b1ec6e634612caa3bd0e25b62", "score": "0.6713295", "text": "function printFeedback(userinput){\r\n\tvar isScore = false;\r\n\tnumNoGrade = 0;\r\n\tuserInput = userinput;\r\n\tendTime = new Date();\r\n\tvar currentElement;\r\n\tvar perc;\r\n\tvar temp;\r\n\twronglist= new Array(numProblems);\r\n\trightlist= new Array(numProblems);\r\n\tsetArrayNull(wronglist);\r\n\tsetArrayNull(rightlist);\r\n\tvar score=0;\r\n\t/*Makes input case-insensitive*/\r\n\t/*for(j=0;j < answers.length; j++){\t\t\t \r\n\t\t\ttemp = answers[j];\r\n\t\t\ttemp = \"\"+temp;\t\t\t\t\r\n\t\t\ttemp = temp.toLowerCase();\r\n\t\t\tanswers[j] = temp;\r\n\t\t\ttemp = userInput[j];\r\n\t\t\ttemp = \"\"+temp;\r\n\t\t\ttemp = temp.toLowerCase();\r\n\t\t\tuserInput[j] = temp;\r\n\t\t}\r\n\t*/\r\n for (var j=0 ; j<numProblems ; j++)\t{\r\n \t\tformatString = \"\";\r\n// \talert(\"Question: \" + questionsnew[j][3]);\r\n\t\tif(questionsnew[j][0] == \"ng\"){\r\n\t\t\tif ( compare(j) )//userInput[i] == answers[i])\r\n\t\t\t{ \r\n\t \t\t\tscore = score + 1;\r\n\t\t\t\trightlist[j]=j + 1;\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\twronglist[j]=j + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tisScore = true;\r\n\t\t\trightlist[j] = j+ 1;\r\n\t\t\tscore = score + 1; // What if there gradd and not graded?\r\n\t\t}\r\n\t\t\r\n \t\tif (wronglist[j] != null)\r\n\t\t\t{ \r\n\t\t\t\t//alert(\"wronglist\");\r\n\t\t\t \tif(questionsnew[j][0] == \"ng\") { \r\n\t\t//\t\t\talert(\"It's wrong!\");\r\n\t \t \tcurrentElement = document.getElementById(\"q\"+j+\"feedback\");\r\n\t\t\t\tif(questionsnew[j][4] == \"ar\"){\r\n\t\t\t\t\tcurrentElement.innerHTML = \"<font dir='rtl' class='arFeedback'> \" + questionsnew[j][3] + \"</font>\";\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tcurrentElement.innerHTML = \"<font class='enFeedback'>\"+questionsnew[j][3]+\"</font>\";\r\n\t\t\t\t\t//Need to implement font direction and color! \r\n\t\t\t\t}\r\n\t\t\t\telse if(questionsnew[j][0] == \"g\"){\r\n\t\t\t\t\t//Need to show graphic\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\telse {\r\n//\t\t\talert(\"rightlist\");\r\n\t\t\tif(questionsnew[j][0] == \"ng\") { \r\n\t\t\tcurrentElement = document.getElementById(\"q\"+j+\"feedback\");\r\n\t\t\t\tif(questionsnew[j][4] == \"ar\"){\r\n\t\t\t\t\tcurrentElement.innerHTML = \"<font dir='rtl' class='arFeedback'> \" + questionsnew[j][3] + \"</font>\";\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tcurrentElement.innerHTML = \"<font class='enFeedback'>\"+questionsnew[j][3]+\"</font>\";\r\n\t\t\t\t\t//Need to implement font direction and color! \r\n\t\t\t}\r\n\t\t \telse if(questionsnew[j][0] == \"g\"){\r\n\t\t\t\t\t//Need to show graphic\r\n\t\t\t}\r\n\t\t}\r\n\t }//end for \r\n\tperc = (score*100)/(numProblems);\r\n\tperc = 100;\r\n\tif(isScore){\t\r\n\t currentElement\t = document.getElementById(\"score\");\r\n\t currentElement.innerHTML = \"Your Score is \" + score + \" out of \" + (numProblems-numNoGrade) + \". \" + Math.round(perc) + \"%\";\r\n\r\n\t}\r\n}//end winopen function", "title": "" }, { "docid": "955903ca76cc2bdcbe327b025d1ceda0", "score": "0.6665903", "text": "function grade() {\n \tvar i;\n\n \tvar a1 = document.getElementsByName(\"q1\");\n \t\tfor (i = 0; i < a1.length; i++) {\n \t\t\tif (a1[i].checked) {\n \t\t\t\tif(a1[i].value == \"2\") {\n \t\t\t\t\tcorrectAs++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \tvar a2 = document.getElementsByName(\"q2\");\n \t\tfor (i = 0; i < a2.length; i++) {\n \t\t\tif (a2[i].checked) {\n \t\t\t\tif(a2[i].value == \"1\") {\n \t\t\t\t\tcorrectAs++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \tvar a3 = document.getElementsByName(\"q3\");\n \t\tfor (i = 0; i < a3.length; i++) {\n \t\t\tif (a3[i].checked) {\n \t\t\t\tif(a3[i].value == \"3\") {\n \t\t\t\t\tcorrectAs++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \tvar a4 = document.getElementsByName(\"q4\");\n \t\tfor (i = 0; i < a4.length; i++) {\n \t\t\tif (a4[i].checked) {\n \t\t\t\tif(a4[i].value == \"3\") {\n \t\t\t\t\tcorrectAs++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \tvar a5 = document.getElementsByName(\"q5\");\n \t\tfor (i = 0; i < a5.length; i++) {\n \t\t\tif (a5[i].checked) {\n \t\t\t\tif(a5[i].value == \"4\") {\n \t\t\t\t\tcorrectAs++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\t\n\n// I don't think this if/else statement is necessary. But it helped me\n// figure out if I was on the right track. \n \tif(correctAs == totalQs) {\n \t\tconsole.log(\"Nailed it.\");\n \t}\n\n \telse {\n \t\tconsole.log(\"You got \" + correctAs + \" out of \" + totalQs + \" correct!\");\t\t\n \t}\t\t\n\n }", "title": "" }, { "docid": "620668510cb8fa7881694e948fd4ef02", "score": "0.666377", "text": "function grade(){\n\tgrade1();\n\tgrade2();\n\tgrade3();\n\n\t//for when user gets all correct\n\tif(correct == 3){\n\t\talert(\"Congratulations! You got all 3 correct\");\n\t}\n\t//for when user misses one or more questions\n\telse{\n\t\talert(\"You got \" + correct + \" out of 3 correct!\");\n\t}\n\t//reset score to 0\n\tcorrect=0;\n}", "title": "" }, { "docid": "85c8bc1cedcc4f1636fb46946db07da6", "score": "0.6644468", "text": "function calculateGrade(){\nif(students < 5)\n{\n students++;\n let mark1 = markOne.value;\n let mark2 = markTwo.value;\n avgMark = (parseFloat(mark1) + parseFloat(mark2)) / 2;\n\n if (mark1 == 0 || mark2 == 0 || avgMark < 40){\n studyPoints = \"0\";\n grade = \"0\";\n } else if(avgMark >= 40 && avgMark <= 44){\n studyPoints = \"5\";\n grade = \"1\";\n } else if(avgMark >= 45 && avgMark <= 54){\n studyPoints = \"5\";\n grade = \"2\";\n } else if (avgMark >= 55 && avgMark <= 64){\n studyPoints = \"5\";\n grade = \"3\";\n } else if (avgMark >= 65 && avgMark <= 74){\n studyPoints = \"5\";\n grade = \"4\";\n } else if (avgMark >= 75 && avgMark <= 100){\n studyPoints = \"5\";\n grade = \"5\";\n }\n output.textContent = student.value + \": First Mark: \" + mark1 + \", Second Mark \"\n + mark2 + \", Average: \" + avgMark + \", Study Points: \" + studyPoints + \", Grade: \" + grade\n + \". Students currently added: \" + students;\n } else {\n output.textContent = student.value + \" NOT added! Only 5 students permitted.\"\n}\n}", "title": "" }, { "docid": "88629a85f3f7390a500af5e00e00b9a8", "score": "0.6636834", "text": "function calcSemesterGPA() {\n\nvar totalPoints = 0.0;\nvar totalCredits = 0;\nvar points = 0.0;\nvar credits = 0;\nvar i;\nvar semesterGPA = 0.00;\n\nvar grade1 = document.getElementById('classGrade1').value;\nvar grade2 = document.getElementById('classGrade2').value;\nvar grade3 = document.getElementById('classGrade3').value;\nvar grade4 = document.getElementById('classGrade4').value;\nvar grade5 = document.getElementById('classGrade5').value;\nvar grade6 = document.getElementById('classGrade6').value;\n\nvar creditHours1 = parseFloat(document.getElementById('class1Credit').value);\nvar creditHours2 = parseFloat(document.getElementById('class2Credit').value);\nvar creditHours3 = parseFloat(document.getElementById('class3Credit').value);\nvar creditHours4 = parseFloat(document.getElementById('class4Credit').value);\nvar creditHours5 = parseFloat(document.getElementById('class5Credit').value);\nvar creditHours6 = parseFloat(document.getElementById('class6Credit').value);\n\n for (i = 0; i < 10; ++i) {\n if(creditHours1 == 1\n || creditHours2 == 1\n || creditHours3 == 1\n || creditHours4 == 1\n || creditHours5 == 1\n || creditHours6 == 1) {\n if(grade1 == 'A'\n || grade2 == 'A'\n || grade3 == 'A'\n || grade4 == 'A'\n || grade5 == 'A'\n || grade6 == 'A') {\n points = 4.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'A-'\n || grade2 == 'A-'\n || grade3 == 'A-'\n || grade4 == 'A-'\n || grade5 == 'A-'\n || grade6 == 'A-') {\n points = 3.7;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'B+'\n || grade2 == 'B+'\n || grade3 == 'B+'\n || grade4 == 'B+'\n || grade5 == 'B+'\n || grade6 == 'B+') {\n points = 3.3;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'B'\n || grade2 == 'B'\n || grade3 == 'B'\n || grade4 == 'B'\n || grade5 == 'B'\n || grade6 == 'B') {\n points = 3.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'B-'\n || grade2 == 'B-'\n || grade3 == 'B-'\n || grade4 == 'B-'\n || grade5 == 'B-'\n || grade6 == 'B-') {\n points = 2.7;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'C+'\n || grade2 == 'C+'\n || grade3 == 'C+'\n || grade4 == 'C+'\n || grade5 == 'C+'\n || grade6 == 'C+') {\n points = 2.3;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'C'\n || grade2 == 'C'\n || grade3 == 'C'\n || grade4 == 'C'\n || grade5 == 'C'\n || grade6 == 'C') {\n points = 2.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'C-'\n || grade2 == 'C-'\n || grade3 == 'C-'\n || grade4 == 'C-'\n || grade5 == 'C-'\n || grade6 == 'C-') {\n points = 1.7;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'D+'\n || grade2 == 'D+'\n || grade3 == 'D+'\n || grade4 == 'D+'\n || grade5 == 'D+'\n || grade6 == 'D+') {\n points = 1.3;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'D'\n || grade2 == 'D'\n || grade3 == 'D'\n || grade4 == 'D'\n || grade5 == 'D'\n || grade6 == 'D') {\n points = 1.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'F'\n || grade2 == 'F'\n || grade3 == 'F'\n || grade4 == 'F'\n || grade5 == 'F'\n || grade6 == 'F') {\n points = 0.0;\n totalPoints = totalPoints + points;\n }\n else {\n window.alert('For 1 credit hours: Could not calculate. Please enter valid letter grades.');\n }\n credits = 1;\n totalCredits = totalCredits + credits;\n }\n else if(creditHours1 == 2\n || creditHours2 == 2\n || creditHours3 == 2\n || creditHours4 == 2\n || creditHours5 == 2\n || creditHours6 == 2) {\n if(grade1 == 'A'\n || grade2 == 'A'\n || grade3 == 'A'\n || grade4 == 'A'\n || grade5 == 'A'\n || grade6 == 'A') {\n points = 8.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'A-'\n || grade2 == 'A-'\n || grade3 == 'A-'\n || grade4 == 'A-'\n || grade5 == 'A-'\n || grade6 == 'A-') {\n points = 7.4;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'B+'\n || grade2 == 'B+'\n || grade3 == 'B+'\n || grade4 == 'B+'\n || grade5 == 'B+'\n || grade6 == 'B+') {\n points = 6.6;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'B'\n || grade2 == 'B'\n || grade3 == 'B'\n || grade4 == 'B'\n || grade5 == 'B'\n || grade6 == 'B') {\n points = 6.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'B-'\n || grade2 == 'B-'\n || grade3 == 'B-'\n || grade4 == 'B-'\n || grade5 == 'B-'\n || grade6 == 'B-') {\n points = 5.4;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'C+'\n || grade2 == 'C+'\n || grade3 == 'C+'\n || grade4 == 'C+'\n || grade5 == 'C+'\n || grade6 == 'C+') {\n points = 4.6;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'C'\n || grade2 == 'C'\n || grade3 == 'C'\n || grade4 == 'C'\n || grade5 == 'C'\n || grade6 == 'C') {\n points = 4.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'C-'\n || grade2 == 'C-'\n || grade3 == 'C-'\n || grade4 == 'C-'\n || grade5 == 'C-'\n || grade6 == 'C-') {\n points = 3.4;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'D+'\n || grade2 == 'D+'\n || grade3 == 'D+'\n || grade4 == 'D+'\n || grade5 == 'D+'\n || grade6 == 'D+') {\n points = 2.6;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'D'\n || grade2 == 'D'\n || grade3 == 'D'\n || grade4 == 'D'\n || grade5 == 'D'\n || grade6 == 'D') {\n points = 2.0;\n totalPoints = totalPoints + points;\n }\n else if(grade1 == 'F'\n || grade2 == 'F'\n || grade3 == 'F'\n || grade4 == 'F'\n || grade5 == 'F'\n || grade6 == 'F') {\n points = 0.0;\n totalPoints = totalPoints + points;\n }\n else {\n window.alert('For 2 credit hours: Could not calculate. Please enter valid letter grades.');\n }\n credits = 2;\n totalCredits = totalCredits + credits;\n }\n else if(creditHours1 == 3\n || creditHours2 == 3\n || creditHours3 == 3\n || creditHours4 == 3\n || creditHours5 == 3\n || creditHours6 == 3) {\n window.alert('If credit hours are equal to 3.');\n if(grade1 == 'A'\n || grade2 == 'A'\n || grade3 == 'A'\n || grade4 == 'A'\n || grade5 == 'A'\n || grade6 == 'A') {\n points = 12.0;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an A are: ' + points + '.');\n }\n else if(grade1 == 'A-'\n || grade2 == 'A-'\n || grade3 == 'A-'\n || grade4 == 'A-'\n || grade5 == 'A-'\n || grade6 == 'A-') {\n points = 11.1;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an A- are: ' + points + '.');\n }\n else if(grade1 == 'B+'\n || grade2 == 'B+'\n || grade3 == 'B+'\n || grade4 == 'B+'\n || grade5 == 'B+'\n || grade6 == 'B+') {\n points = 9.9;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an B+ are: ' + points + '.');\n }\n else if(grade1 == 'B'\n || grade2 == 'B'\n || grade3 == 'B'\n || grade4 == 'B'\n || grade5 == 'B'\n || grade6 == 'B') {\n points = 9.0;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an B are: ' + points + '.');\n }\n else if(grade1 == 'B-'\n || grade2 == 'B-'\n || grade3 == 'B-'\n || grade4 == 'B-'\n || grade5 == 'B-'\n || grade6 == 'B-') {\n points = 8.1;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an B- are: ' + points + '.');\n }\n else if(grade1 == 'C+'\n || grade2 == 'C+'\n || grade3 == 'C+'\n || grade4 == 'C+'\n || grade5 == 'C+'\n || grade6 == 'C+') {\n points = 6.9;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an C+ are: ' + points + '.');\n }\n else if(grade1 == 'C'\n || grade2 == 'C'\n || grade3 == 'C'\n || grade4 == 'C'\n || grade5 == 'C'\n || grade6 == 'C') {\n points = 6.0;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an C are: ' + points + '.');\n }\n else if(grade1 == 'C-'\n || grade2 == 'C-'\n || grade3 == 'C-'\n || grade4 == 'C-'\n || grade5 == 'C-'\n || grade6 == 'C-') {\n points = 5.1;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an C- are: ' + points + '.');\n }\n else if(grade1 == 'D+'\n || grade2 == 'D+'\n || grade3 == 'D+'\n || grade4 == 'D+'\n || grade5 == 'D+'\n || grade6 == 'D+') {\n points = 3.9;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an D+ are: ' + points + '.');\n }\n else if(grade1 == 'D'\n || grade2 == 'D'\n || grade3 == 'D'\n || grade4 == 'D'\n || grade5 == 'D'\n || grade6 == 'D') {\n points = 3.0;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an D are: ' + points + '.');\n }\n else if(grade1 == 'F'\n || grade2 == 'F'\n || grade3 == 'F'\n || grade4 == 'F'\n || grade5 == 'F'\n || grade6 == 'F') {\n points = 0.0;\n totalPoints = totalPoints + points;\n window.alert('For 3 credit hours: Points for an F are: ' + points + '.');\n }\n else {\n window.alert('For 3 credit hours: Could not calculate. Please enter valid letter grades.');\n }\n credits = 3;\n totalCredits = totalCredits + credits;\n }\n else if(creditHours1 == 4\n || creditHours2 == 4\n || creditHours3 == 4\n || creditHours4 == 4\n || creditHours5 == 4\n || creditHours6 == 4) {\n window.alert('If credit hours are equal to 4.');\n if(grade1 == 'A'\n || grade2 == 'A'\n || grade3 == 'A'\n || grade4 == 'A'\n || grade5 == 'A'\n || grade6 == 'A') {\n points = 16.0;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an A are: ' + points + '.');\n }\n else if(grade1 == 'A-'\n || grade2 == 'A-'\n || grade3 == 'A-'\n || grade4 == 'A-'\n || grade5 == 'A-'\n || grade6 == 'A-') {\n points = 14.8;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an A- are: ' + points + '.');\n }\n else if(grade1 == 'B+'\n || grade2 == 'B+'\n || grade3 == 'B+'\n || grade4 == 'B+'\n || grade5 == 'B+'\n || grade6 == 'B+') {\n points = 13.2;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an B+ are: ' + points + '.');\n }\n else if(grade1 == 'B'\n || grade2 == 'B'\n || grade3 == 'B'\n || grade4 == 'B'\n || grade5 == 'B'\n || grade6 == 'B') {\n points = 12.0;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an B are: ' + points + '.');\n }\n else if(grade1 == 'B-'\n || grade2 == 'B-'\n || grade3 == 'B-'\n || grade4 == 'B-'\n || grade5 == 'B-'\n || grade6 == 'B-') {\n points = 10.8;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an B- are: ' + points + '.');\n }\n else if(grade1 == 'C+'\n || grade2 == 'C+'\n || grade3 == 'C+'\n || grade4 == 'C+'\n || grade5 == 'C+'\n || grade6 == 'C+') {\n points = 9.2;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an C+ are: ' + points + '.');\n }\n else if(grade1 == 'C'\n || grade2 == 'C'\n || grade3 == 'C'\n || grade4 == 'C'\n || grade5 == 'C'\n || grade6 == 'C') {\n points = 8.0;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an C are: ' + points + '.');\n }\n else if(grade1 == 'C-'\n || grade2 == 'C-'\n || grade3 == 'C-'\n || grade4 == 'C-'\n || grade5 == 'C-'\n || grade6 == 'C-') {\n points = 6.8;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an C- are: ' + points + '.');\n }\n else if(grade1 == 'D+'\n || grade2 == 'D+'\n || grade3 == 'D+'\n || grade4 == 'D+'\n || grade5 == 'D+'\n || grade6 == 'D+') {\n points = 5.2;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an D+ are: ' + points + '.');\n }\n else if(grade1 == 'D'\n || grade2 == 'D'\n || grade3 == 'D'\n || grade4 == 'D'\n || grade5 == 'D'\n || grade6 == 'D') {\n points = 4.0;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an D are: ' + points + '.');\n }\n else if(grade1 == 'F'\n || grade2 == 'F'\n || grade3 == 'F'\n || grade4 == 'F'\n || grade5 == 'F'\n || grade6 == 'F') {\n points = 0.0;\n totalPoints = totalPoints + points;\n window.alert('For 4 credit hours: Points for an F are: ' + points + '.');\n }\n else {\n window.alert('For 4 credit hours: Could not calculate. Please enter valid letter grades.');\n }\n credits = 4;\n totalCredits = totalCredits + credits;\n }\n else {\n window.alert('Enter either 1,2,3, or 4 in the credit hours box.');\n }\n }\n semesterGPA = totalPoints/totalCredits;\n outputDiv2.innerHTML = 'Your semester GPA is ' + semesterGPA + '.';\n}", "title": "" }, { "docid": "32d9d7599ccc4512881201cfa23faa05", "score": "0.6622301", "text": "function calculateGrade() {\n\n //resets category grades\n removeElement(\"subAnswerDiv\");\n let newsubAnswerDiv = document.createElement(\"DIV\");\n newsubAnswerDiv.id = \"subAnswerDiv\";\n document.getElementById(\"answerDiv\").appendChild(newsubAnswerDiv);\n \n //initializes input error to false\n let inputError = false;\n \n //loop that checks and throws errors on input, otherwise calculatates category grades and total grade and appends them to answerDiv\n for (j = 1; j <= numAssignments; j++) {\n let totalSubScore = 0;\n let totalSubWeight = 0;\n\n //loop for error checks and category grades\n for (k = 1; k <= allAssignments[j-1].numSubassignments; k++) {\n let subGrade = document.getElementById(\"subGrade \" + k + j);\n let subWeight = document.getElementById(\"subWeight \" + k + j);\n\n let isGradeNum = isNaN(subGrade.value);\n let isWeightNum = isNaN(subWeight.value);\n \n if (isGradeNum == true || isWeightNum == true || subGrade.value == \"\" || subWeight.value == \"\") {\n inputError = true;\n alert(\"Grade and weight of assignments must be filled in. Inputs must contain only digits\");\n break;\n } else {\n if (subGrade.value < 0 || subGrade.value > 100 || subWeight.value < 0 || subWeight.value > 100) {\n inputError = true;\n alert(\"Grade and/or weight of subassignment \" + k + \" of assignment category \" + j + \" must be between 0 and 100\");\n break;\n } else {\n totalSubScore += subGrade.value * (subWeight.value / 100);\n totalScore += subGrade.value * (subWeight.value / 100);\n totalSubWeight += parseInt(subWeight.value);\n totalWeight += parseInt(subWeight.value);\n }\n }\n }\n\n //error checks and creates new category grade\n if (totalSubWeight < 0 || totalSubWeight > 100) {\n alert(\"Check total weights. Total weight of assignments must be between 0% and 100%\");\n inputError = true;\n } else {\n if (inputError == false) {\n createNewGradeAnswer(j, totalSubScore, document.getElementById(\"categoryWeight \" + j).value);\n }\n }\n\n totalSubWeight = 0;\n totalSubScore = 0;\n }\n\n //error checks and appends total grade and calculates potential grade\n if (totalWeight < 0 || totalWeight > 100 || totalCategoryWeight > 100 || totalCategoryWeight < 0) {\n alert(\"Check total weights. Total weight of assignments must be between 0% and 100%\");\n inputError = true;\n } else {\n document.getElementById(\"totalGrade\").innerHTML = \"Current Class Grade: \" + totalScore;\n\n let potentialScore = totalScore + (100 - totalWeight);\n document.getElementById(\"potentialGrade\").innerHTML = \"Max Potential Grade in Class: \" + potentialScore;\n }\n\n //resets potential score, total weights, and total current grades\n potentialScore = 0;\n totalSubWeight = 0;\n totalSubScore = 0;\n totalWeight = 0;\n totalScore = 0;\n}", "title": "" }, { "docid": "a13a2d4bd8f49decfd302c36ccd4e27c", "score": "0.65555686", "text": "function grade() {\n let total = 0;\n let avg;\n let grade;\n const GRADES = 3;\n\n for (let i = 1; i <= GRADES; i++) {\n total += Number(prompt(`Enter score ${i}:`));\n }\n\n avg = total / GRADES;\n // console.log(avg);\n if (avg >= 90) grade = 'A';\n else if (avg >= 70) grade = 'B';\n else if (avg >= 50) grade = 'C';\n else grade = 'F';\n console.log(`Based on the average of your ${GRADES} scores your letter grade is \"${grade}\".`);\n}", "title": "" }, { "docid": "ba1facb7632e38806e0932ad13ed9714", "score": "0.6525164", "text": "function assignGrade(grade){\n\tif(grade < 50){\n\t\tdocument.write(\"For \" + grade + \" you got a F \" + \"<br>\");\n\t}\n\telse if(grade < 60){\n\t\tdocument.write(\"For \" + grade + \" you got a D \" + \"<br>\");\n\t}\n\telse if(grade < 70){\n\t\tdocument.write(\"For \" + grade + \" you got a C \" + \"<br>\");\n\t}\n\telse if(grade < 80){\n\t\tdocument.write(\"For \" + grade + \" you got a B \" + \"<br>\");\n\t}\n\telse if(grade < 90){\n\t\tdocument.write(\"For \" + grade + \" you got an A \" + \"<br>\");\n\t}\n\telse if(grade < 100){\n\t\tdocument.write(\"For \" + grade + \" you got an A+ \" + \"<br>\");\n\t}\n}", "title": "" }, { "docid": "c0ab04a4f03ae6241de1c6592c7e8820", "score": "0.65117264", "text": "function calculateGrade(){\nif(students < 5)\n{\n students++;\n let mark1 = markOne.value;\n let mark2 = markTwo.value;\n avgMark = (parseFloat(mark1) + parseFloat(mark2)) / 2;\n\n if (mark1 == 0 || mark2 == 0 || avgMark < 40){\n studyPoints = \"0\";\n grade = \"0\";\n } else if(avgMark >= 40 && avgMark <= 44){\n studyPoints = \"5\";\n grade = \"1\";\n } else if(avgMark >= 45 && avgMark <= 54){\n studyPoints = \"5\";\n grade = \"2\";\n } else if (avgMark >= 55 && avgMark <= 64){\n studyPoints = \"5\";\n grade = \"3\";\n } else if (avgMark >= 65 && avgMark <= 74){\n studyPoints = \"5\";\n grade = \"4\";\n } else if (avgMark >= 75 && avgMark <= 100){\n studyPoints = \"5\";\n grade = \"5\";\n }\n allStudents.push(student.value + \": First Mark: \" + mark1 + \", Second Mark \"\n + mark2 + \", Average: \" + avgMark + \", Study Points: \" + studyPoints + \", Grade: \" + grade);\n\n output.textContent = student.value + \" was added.\";\n } else {\n output.textContent = student.value + \" NOT added! Only 5 students permitted.\"\n}\n}", "title": "" }, { "docid": "5f568811a2ed939051c4a0a99b055506", "score": "0.6491392", "text": "function calculateGradeNeeded(){\n var currentGrade = calculateCurrentGrade();\n if (currentGrade != null){\n var desiredGrade = document.getElementById(\"gradeDesired\").value;\n var finalWeight = document.getElementById(\"finalWeight\").value / 100;\n var neededGrade = (desiredGrade - currentGrade * (1 - finalWeight)) / finalWeight;\n var roundedNeededGrade = neededGrade.toFixed(2);\n if (0 < roundedNeededGrade){\n document.getElementById(\"requiredResult\").innerHTML = \"You need a minimum grade of \" + roundedNeededGrade + \"% on the final.\";\n } else {\n document.getElementById(\"requiredResult\").innerHTML = \"You could score a zero on the final and still get a \" + desiredGrade + \"% in the class! Wow, good job!\";\n }\n if (95 <= roundedNeededGrade && roundedNeededGrade <= 100){\n document.getElementById(\"requiredResult\").innerHTML += \" Good luck!\";\n } else if (100 < roundedNeededGrade){\n document.getElementById(\"requiredResult\").innerHTML += \" Best of luck!\";\n }\n } else {\n // This is just to reset the colors in case something went wrong.\n for (var i = 0; i < document.getElementById(\"categories\").rows.length / 2; i++){\n document.getElementById(\"ft\" + i).style.backgroundColor = \"white\";\n document.getElementById(\"st\" + i).style.backgroundColor = \"white\";\n document.getElementById(\"ic\" + i).style.backgroundColor = \"white\";\n document.getElementById(\"sic\" + i).style.backgroundColor = \"white\";\n }\n }\n}", "title": "" }, { "docid": "f3501156889a84db18ed9f508b52454c", "score": "0.6481869", "text": "function calculateGPA (){\n //load inputted grades and credits into respective arrays\n for (var i = 0; i < 8; i++){\n grade = document.getElementById(\"display\" + i).innerHTML;\n credit = document.getElementById(\"credit\" + i).value;\n\n //checks if both inputs are filled for each card\n if (grade != \"\" && credit == \"\" || credit != \"\" && grade == \"\"){\n alert(\"Invalid entry! Each grade must have an assigned number of credits.\"); \n document.getElementById(\"output\").innerHTML = \"0.0\"\n return;\n } \n\n //pushes grade into respective arrays if input has a value\n if (grade != \"\"){listgrades.push(grade);}\n if (credit != \"\"){listcredits.push(credit);}\n\n }\n \n //assign each grade in listgrade (array of grades) to a weighted point value and store in listgpa\n listgrades.forEach(function(a) {\n if (a == \"A+\"){listgpa.push(4.0);}\n if (a == \"A\"){listgpa.push(4.0);}\n if (a == \"A-\"){listgpa.push(3.67);}\n if (a == \"B+\"){listgpa.push(3.33);}\n if (a == \"B\"){listgpa.push(3.0);}\n if (a == \"B-\"){listgpa.push(2.67);}\n if (a == \"C+\"){listgpa.push(2.33);}\n if (a == \"C\"){listgpa.push(2.0);}\n if (a == \"C-\"){listgpa.push(1.67);}\n if (a == \"D+\"){listgpa.push(1.33);}\n if (a == \"D\"){listgpa.push(1.0);}\n if (a == \"F\"){listgpa.push(0.0);}\n if (a == \"\"){listgpa.push(0.0);}\n })\n parseInt(listgrades, 10); //turns all value in array into integers\n\n //sum total credits\n var sum = 0;\n listcredits.forEach(function(a){\n sum += parseInt(a, 10);\n })\n\n //multiply weighted grade and credit\n var sumGradeCredit = 0;\n for (var i = 0; i < listgrades.length; i++){\n multiplyList[i] = listcredits[i] * listgpa[i];\n sumGradeCredit += multiplyList[i];\n }\n //final gpa\n var quotient = sumGradeCredit/sum;\n var weightedgpa = Math.round(quotient * 100)/100\n\n //display gpa\n if (sumGradeCredit == 0 && sum == 0){\n document.getElementById(\"output\").innerHTML = \"0.0\";\n alert(\"Invalid submission!\"); return;\n } else {\n document.getElementById(\"output\").innerHTML = weightedgpa;\n }\n \n //reset array fields when gpa calculated\n listgrades = [];\n listcredits = [];\n listgpa = [];\n multiplyList = [];\n}", "title": "" }, { "docid": "f7d30fdc13ae0427d19c6858e5249471", "score": "0.6456705", "text": "function gradeCalculator(studentScore, totalPossibleScore) {\n let testScore = ((studentScore/totalPossibleScore)*100)\n let letterGrade = ''\n console.log(testScore)\n if ((testScore < 0) || (testScore > 100) || (totalPossibleScore === 0)){\n console.log(\"Student score is invalid. The score must be within the point range of 0 - 100 \")\n }else if ((90 <= testScore)){\n letterGrade = \"A\"\n }else if ((80 <= testScore)){\n letterGrade = \"B\"\n }else if ((70 <= testScore)){\n letterGrade = \"C\"\n }else if ((60 <= testScore)){\n letterGrade = \"D\"\n }else {\n letterGrade = \"F\"\n }\n return `You got ${studentScore}/${totalPossibleScore} correct for an ${letterGrade} on this test with a score of ${testScore}%`\n}", "title": "" }, { "docid": "b24bb9acf26d493ff530bf0591fae0a2", "score": "0.6340783", "text": "function gradeCalculator(studentScore = 0,totalScore = 100){\n let percentScore = (studentScore / totalScore) * 100\n if (percentScore <= 100 && percentScore >=90) {\n let letterGrade = 'A'\n } else if (percentScore <= 89 && percentScore >= 80 ){\n letterGrade = 'B'\n } else if (percentScore <= 79 && percentScore >= 70) {\n letterGrade = 'C'\n } else if (percentScore <= 69 && percentScore >= 60) {\n letterGrade = 'D'\n } else {\n letterGrade = 'F'\n }\n\n return `This is the student's score: ${studentScore} and it was out of a total score being ${totalScore}. The percentage score they earned was ${percentScore}. \n if they missed class than the have an automatic zero on their grade. Their letter grade is ${letterGrade} .`\n}", "title": "" }, { "docid": "ea9160135a49b83167ff8dd11df26545", "score": "0.63377815", "text": "function calculateCurrentGrade(){\n document.getElementById(\"currentResult\").innerHTML = \"\";\n\n // This is where the weights are all put into an array of numbers.\n var rawWeights = document.getElementsByClassName(\"weight\");\n var arrayWeights = [];\n for (var b = 0; b < rawWeights.length; b++){\n arrayWeights[b] = convertArrayStringToNumber(rawWeights[b].value.toString());\n }\n\n // This checks to make sure that all of the weights actually add up to 100. If not, the user is notified and the page resets.\n if (checkWeight() != 100){\n alert(\"Oops, the weights do not add up to one hundred! Please check them. Thank you!\");\n return null;\n }\n\n // This is where an array of scores is formed, and where the user is notified as to how bad of a grade they have in each section.\n var rawScores = document.getElementsByClassName(\"score\");\n var arrayScores = [];\n for (var a = 0; a < rawScores.length; a++){\n var numbers = convertArrayStringToNumber(rawScores[a].value.toString());\n arrayScores[a] = averageArray(numbers);\n // These colors will indicate to the user how their grade in each section is.\n document.getElementById(\"ft\" + a).style.backgroundColor = giveColor(averageArray(numbers));\n document.getElementById(\"st\" + a).style.backgroundColor = giveColor(averageArray(numbers));\n document.getElementById(\"ic\" + a).style.backgroundColor = giveColor(averageArray(numbers));\n document.getElementById(\"sic\" + a).style.backgroundColor = giveColor(averageArray(numbers));\n for (var d = 0; d < numbers.length; d++){\n if (isNaN(numbers[d]) == true){\n alert(\"Unfortunately, there seems to be an issue! Your inputs are either incomplete or contain something other than numbers or commas (in the exact format of #,#,#,#). Please recheck your inputs, thank you!\");\n return null;\n } else if (numbers[d] < 0){\n alert(\"Hi! Please recheck your scores, as it seems that one of them is negative. It is almost certainly impossible for you to get a negative grade on an assignment. If your teacher really did give you that grade, well... I'm sorry.\");\n return null;\n } else if (110 < numbers[d]){\n alert(\"Hello user! We're so sorry, but we don't think that any teacher would give you above 110% on an assignment. Please recheck your numbers. Thank you!\");\n return null;\n }\n }\n }\n\n\n // This is where the grade is calculated, DOMed onto the page, and then returned.\n var currentGrade = 0;\n for (var c = 0; c < arrayScores.length; c++){\n currentGrade += arrayScores[c] * arrayWeights[c] / 100;\n }\n var roundedCurrentGrade = currentGrade.toFixed(2);\n document.getElementById(\"currentResult\").innerHTML = \"Your current grade is \" + roundedCurrentGrade + \"%.\";\n return currentGrade;\n}", "title": "" }, { "docid": "6cd46b3fff9bbc2a8eb1473faca76850", "score": "0.63363457", "text": "function hw03Solution (input) {\n let tmp;\n const numOfStudents = input.shift();\n tmp = numOfStudents.split(' ').filter( str => str.length != 0 );\n let course1 = +tmp[0];\n let course2 = +tmp[1];\n let course3 = +tmp[2];\n\n tmp = '';\n for ( let i = 0 ; i < course1 ; i++ ) {\n tmp += input.shift();\n (i + 1 < course1) && (tmp += '\\n');\n }\n course1 = tmp;\n\n tmp = '';\n for ( let i = 0 ; i < course2 ; i++ ) {\n tmp += input.shift();\n (i + 1 < course2) && (tmp += '\\n');\n }\n course2 = tmp;\n \n tmp = '';\n for ( let i = 0 ; i < course3 ; i++ ) {\n tmp += input.shift();\n (i + 1 < course3) && (tmp += '\\n');\n }\n course3 = tmp;\n\n let bestGrades = ((course1.split('\\n')).concat( course2.split('\\n') , course3.split('\\n') ))\n .map( grades => parseInt(( grades.split(' ').reduce( (a, b) => (+a) + (+b), 0) ) / 4) )\n .sort( (a, b) => b - a )\n .filter( (item, pos, self) => self.indexOf(item) == pos );\n\n for ( let i = 0 ; i < 6 ; i++ ) !bestGrades[i] && (bestGrades[i] = 0);\n while ( bestGrades.length != 6 ) bestGrades.pop();\n\n return `Enter the number of students in each course: ${numOfStudents}\\n` +\n `Enter the student grades in course 1: \\n` +\n `${course1}\\n` +\n `Enter the student grades in course 2: \\n` +\n `${course2}\\n` +\n `Enter the student grades in course 3: \\n` +\n `${course3}\\n` +\n `The six highest scores are: ${bestGrades.join(' ')}`;\n}", "title": "" }, { "docid": "181988f20af4c84f9a5b6271fd43a6af", "score": "0.6317573", "text": "function studentGrade(s, g) {\n var studentsExame = '';\n var grades = [];\n for (var i = 0; i < s.length; i++) {\n if (g[i] <= 50) {\n grades[i] = 5;\n studentsExame += (s[i] + ' acquired ' + g[i] + ' points and failed to complete the exam.' + '\\n');\n } else if (g[i] >= 51 && g[i] < 60) {\n grades[i] = 6;\n studentsExame += (s[i] + ' acquired ' + g[i] + ' points and earned ' + grades[i] + '.' + '\\n')\n } else if (g[i] >= 61 && g[i] < 70) {\n grades[i] = 7;\n studentsExame += (s[i] + ' acquired ' + g[i] + ' points and earned ' + grades[i] + '.' + '\\n')\n } else if (g[i] >= 71 && g[i] < 80) {\n grades[i] = 8;\n studentsExame += (s[i] + ' acquired ' + g[i] + ' points and earned ' + grades[i] + '.' + '\\n')\n } else if (g[i] >= 81 && g[i] < 90) {\n grades[i] = 9;\n studentsExame += (s[i] + ' acquired ' + g[i] + ' points and earned ' + grades[i] + '.' + '\\n')\n } else if (g[i] >= 91 && g[i] < 100) {\n grades[i] = 10;\n studentsExame += (s[i] + ' acquired ' + g[i] + ' points and earned ' + grades[i] + '.' + '\\n')\n }\n }\n\n return studentsExame;\n}", "title": "" }, { "docid": "7cd055c5190dac3216b6605237a37e53", "score": "0.6291296", "text": "function generateGradeReport() {\r\n try {\r\n let finalPercent = getFinalPercentCalculation();\r\n let letterGrade = getLetterGrade(finalPercent);\r\n alert(\"Final Grade is \" + letterGrade + \" with a percent of \" + finalPercent.toString() + \"%.\");\r\n }\r\n catch (err) {\r\n alert(err)\r\n return;\r\n }\r\n}", "title": "" }, { "docid": "85170a1b3bd28fa8ac7d6e329565efbe", "score": "0.62695247", "text": "function fillTable(){\n var examQues = examRsp[currQues];\n var testPts = Math.floor((examQues.points)/(examQues.tests.length));\n console.log(testPts);\n document.getElementById(\"ques\").textContent = (currQues+1) + \". \" + examQues.description + \". Constraint: \" + examQues.constraint;\n document.getElementById(\"ans\").textContent = examQues.answer;\n document.getElementById(\"bonusInput\").value; \n document.getElementById(\"ptsInput\").value = examQues.grade;\n document.getElementById(\"bonusInput\").value = \"0\";\n document.getElementById(\"comInput\").value = examQues.comment;\n console.log(examQues.deductions);\n console.log(examQues.grade);\n //populate testcases\n for(var i = 0; i < 6; i++){\n document.getElementById(\"tc\"+(i+1)).style.backgroundColor = \"yellow\";\n document.getElementById(\"tc\"+(i+1)+\"Res\").textContent = \"N/A\";\n document.getElementById(\"tc\"+(i+1)+\"Input\").value = \"0\";\n document.getElementById(\"tc\"+(i+1)+\"Input\").readOnly = true;\n }\n //handles the deductions for constraint\n switch(examQues.deductions[0]){\n //correct, applies to all others\n case \"0\":\n document.getElementById(\"con\").style.backgroundColor = \"green\";\n document.getElementById(\"conRes\").textContent = \"Correct adherence to constraint\";\n document.getElementById(\"conInput\").value = \"-0\";\n break;\n //missing, applies to all others\n case \"1\":\n document.getElementById(\"con\").style.backgroundColor = \"red\";\n document.getElementById(\"conRes\").textContent = \"Did not adhere to constraint\";\n document.getElementById(\"conInput\").value = \"-3\";\n break;\n //\"2\", no contraint for question\n default:\n document.getElementById(\"con\").style.backgroundColor = \"yellow\";\n document.getElementById(\"conRes\").textContent = \"N/A\";\n document.getElementById(\"conInput\").value = \"-0\";\n document.getElementById(\"conInput\").readOnly = true;\n }\n //checks for colon in function header\n switch(examQues.deductions[1]){\n case \"0\":\n document.getElementById(\"cln\").style.backgroundColor = \"green\";\n document.getElementById(\"clnRes\").textContent = \"Correct use of colon in header\";\n document.getElementById(\"clnInput\").value = \"-0\";\n break;\n case \"1\":\n document.getElementById(\"cln\").style.backgroundColor = \"red\";\n document.getElementById(\"clnRes\").textContent = \"Missing/incorrect use of colon in header\";\n document.getElementById(\"clnInput\").value = \"-3\";\n break;\n }\n //checks for the proper header name\n switch(examQues.deductions[2]){\n case \"0\":\n document.getElementById(\"hdr\").style.backgroundColor = \"green\";\n document.getElementById(\"hdrRes\").textContent = \"Correct function name in header\";\n document.getElementById(\"hdrInput\").value = \"-0\";\n break;\n case \"1\":\n document.getElementById(\"hdr\").style.backgroundColor = \"red\";\n document.getElementById(\"hdrRes\").textContent = \"Missing/incorrect function name in header\";\n document.getElementById(\"hdrInput\").value = \"-3\";\n break;\n }\n console.log(examQues.tests);\n console.log(examQues.args);\n //testcases\n for(var i = 0; i < examQues.tests.length; i++){\n switch(examQues.deductions[i+3]){\n case \"0\":\n document.getElementById(\"tc\"+(i+1)).style.backgroundColor = \"green\";\n document.getElementById(\"tc\"+(i+1)+\"Res\").textContent = \"Passed testcase \" + (i+1);\n document.getElementById(\"tc\"+(i+1)+\"Input\").value = testPts;\n break;\n case \"1\":\n document.getElementById(\"tc\"+(i+1)).style.backgroundColor = \"red\";\n document.getElementById(\"tc\"+(i+1)+\"Res\").textContent = \"Failed testcase \" + (i+1);\n document.getElementById(\"tc\"+(i+1)+\"Input\").value = \"0\";\n break;\n }\n }\n //extrapolates the amount of bonus points for the question by comparing the grade with the points for each part\n var sum = 0;\n var grade = examRsp[currQues].grade;\n for(var i = 0; i < 6; i++){\n sum += +document.getElementById(\"tc\"+(i+1)+\"Input\").value;\n }\n sum += +document.getElementById(\"conInput\").value + +document.getElementById(\"clnInput\").value + +document.getElementById(\"hdrInput\").value;\n var bonus = examRsp[currQues].grade - sum;\n console.log(\"bonus: \" + bonus);\n document.getElementById(\"bonusInput\").value = bonus;\n \n //disables/enables prev/next buttons as needed\n console.log(\"currQues = \" + currQues);\n if(currQues == 0){\n document.getElementById(\"prev\").classList.add(\"disabled\");\n }\n else{\n document.getElementById(\"prev\").classList.remove(\"disabled\");\n }\n if(currQues == (examRsp.length - 1)){\n document.getElementById(\"next\").classList.add(\"disabled\");\n }\n else{\n document.getElementById(\"next\").classList.remove(\"disabled\");\n }\n}", "title": "" }, { "docid": "c646c9cbebe54ac67662c5a9a1177d6f", "score": "0.6251276", "text": "function CIT6()\n{\n var year=getvaluefromradio(\"tblable_calc_form_year\");\n var month=getvaluefromradio(\"tblable_calc_form_month\");\n var hour=getvaluefromradio(\"tblable_calc_form_hour\");\n var revcount=getvaluefromradio(\"tblable_calc_form_revcount\");\n var revmonth=getvaluefromradio(\"tblable_calc_form_revmonth\");\n var phrase=getvaluefromradio(\"tblable_calc_form_phrase\");\n\n var score = parseFloat(year + month + hour + revcount + revmonth + phrase);\n document.getElementById(\"tblable_calc_form_score\").innerHTML = score.toString();\n\n var summaryhtml=\"\";\n\n if (score<7) {\n summaryhtml = summaryhtml + \"Normal.\";\n $('#result').removeClass();\n $('#result').addClass(\"alert alert-success\");\n }\n if (score==8 || score==9) {\n summaryhtml = summaryhtml + \"Mild impairment probably refer.\";\n $('#result').removeClass();\n $('#result').addClass(\"alert alert-warning\");\n }\n if (score>9) {\n summaryhtml = summaryhtml + \"Significant cognitive impairment. Refer.\";\n $('#result').removeClass();\n $('#result').addClass(\"alert alert-danger\");\n }\n\n document.getElementById(\"tblable_calc_form_comment\").innerHTML = summaryhtml;\n}", "title": "" }, { "docid": "9d96f3162570d57662c67a43ca8ee46e", "score": "0.6218054", "text": "function getFinalPercentCalculation() {\r\n let scoreAssignments = $(\"#Assignments\").val();\r\n let scoreGroupProjects = $(\"#GroupProjects\").val();\r\n let scoreQuizzes = $(\"#Quizzes\").val();\r\n let scoreExams = $(\"#Exams\").val();\r\n let scoreIntexs = $(\"#Intex\").val();\r\n console.log(scoreAssignments);\r\n console.log(scoreGroupProjects);\r\n console.log(scoreQuizzes);\r\n console.log(scoreExams);\r\n console.log(scoreIntexs);\r\n if (\r\n (!isValidGradePercent(scoreAssignments)) ||\r\n (!isValidGradePercent(scoreGroupProjects)) ||\r\n (!isValidGradePercent(scoreQuizzes)) ||\r\n (!isValidGradePercent(scoreExams)) ||\r\n (!isValidGradePercent(scoreIntexs))\r\n )\r\n {\r\n throw failInputError;\r\n }\r\n return (\r\n assignmentWeight * scoreAssignments +\r\n groupProjectWeight * scoreGroupProjects + \r\n quizWeight * scoreQuizzes + \r\n examWeight * scoreExams +\r\n intexWeight * scoreIntexs\r\n );\r\n}", "title": "" }, { "docid": "690035257ef134ad1032e39e9faec38e", "score": "0.62160563", "text": "function mainFunction() {\n var marks1 = Number(prompt(\"Enter Marks for subject 1:\"))\n var marks2 = Number(prompt(\"Enter Marks for subject 2:\"))\n var marks3 = Number(prompt(\"Enter Marks for subject 3:\"))\n var total = marks1 + marks2 + marks3\n\n var average = calculateAverage(total)\n var percentage = calculatePercentage(total)\n\n alert(\"Average: \" + average + \"\\nPercentage: \" + percentage)\n}", "title": "" }, { "docid": "4683b1b234a263e8cb0cd80cf6e84793", "score": "0.62099165", "text": "function calc() {\n var c = [], i;\n //pushing input to an array\n c.push(document.getElementById(\"text1\").value);\n c.push(document.getElementById(\"text2\").value);\n c.push(document.getElementById(\"text3\").value);\n c.push(document.getElementById(\"text4\").value);\n c.push(document.getElementById(\"text5\").value);\n c.push(document.getElementById(\"text6\").value);\n c.push(document.getElementById(\"text7\").value);\n c.push(document.getElementById(\"text8\").value);\n c.push(document.getElementById(\"text9\").value);\n //check whether the entered marks are correct\n for (var z = 0; z < 9; z++) {\n if (c[z] < 0 || c[z] > 100) {\n alert(\"enter valid marks\");\n process.exit(1);\n }\n }\n //function call to covert marks to grade\n for (var j = 0; j < 8; j++) {\n getGrade(c[j]);\n }\n //for the dev\n for (i = 0; i < 9; i++) {\n console.log(c[i]);\n }\n //function marks to out of 10\n function getGrade(item) {\n if (item < 40)\n return (c[j] = 0);\n else if (item < 45 && item >= 40)\n return (c[j] = 4);\n else if (item < 50 && item >= 45)\n return (c[j] = 5);\n else if (item < 60 && item >= 50)\n return (c[j] = 6);\n else if (item < 70 && item >= 60)\n return (c[j] = 7);\n else if (item < 80 && item >= 70)\n return (c[j] = 8);\n else if (item < 90 && item >= 80)\n return (c[j] = 9);\n else if (item >= 90)\n return (c[j] = 10);\n }\n //subject credits\n let d = [4, 4, 3, 3, 3, 1, 1, 1];\n let e = [];\n //calculate creits*converted marks\n for (let k = 0; k < 8; k++) {\n e[k] = (c[k] * d[k]);\n }\n //for the dev\n for (let k = 0; k < 8; k++) {\n console.log(d[k]);\n }\n //final sgpa calculation and storing the value in result\n var result = total(e) / total(d);\n document.getElementById(\"SGPAresult\").innerHTML = result.toFixed(2);\n //function to calculate total\n function total(array) {\n var total = 0;\n array.forEach(function (item, index) {\n total += item;\n });\n return total;\n }\n //for the dev\n console.log(total(d));\n console.log(total(e));\n console.log(result);\n }", "title": "" }, { "docid": "9e113c4104a1eee09c4e9ec3bc5f85d6", "score": "0.6182173", "text": "function calculate(){\r\n\r\n\t// first get all the values the user selected\r\n\tlet LetterGrade1 = document.getElementById('Grade1').value;\r\n\tlet LetterGrade2 = document.getElementById('Grade2').value;\r\n\tlet LetterGrade3 = document.getElementById('Grade3').value;\r\n\tlet LetterGrade4 = document.getElementById('Grade4').value;\r\n\t\t\r\n\t// make sure these variables exist with valid values so we can use them later\r\n\tlet NumberGrade1 = 0;\r\n\tlet NumberGrade2 = 0;\r\n\tlet NumberGrade3 = 0;\r\n\tlet NumberGrade4 = 0;\r\n\t\r\n// Validation code to make sure you picked a proper letter for your grade. \r\n// Translation. IF LetterGrade is EQUAL TO \"A\" OR \"B\" OR \"C\" OR \"C\" OR \"F\"\r\n// THEN run the calculate function and begin converting letter to number\r\n// ELSE it will throw an alert that nothing or the wrong thing was picked.\r\n\r\n\tif (LetterGrade1 == \"A\"||LetterGrade1 == \"B\"||LetterGrade1 == \"C\"||LetterGrade1 == \"D\"||LetterGrade1 == \"F\") {\r\n\t\t// If it's a proper selection, convert the letter to a number :)\r\n\t\tNumberGrade1 = letterToNumber(LetterGrade1);\r\n\t} else {\r\n\t\t// Otherwise, we mark down that the user didn't pick a grade!\r\n\t\talert(\"Enter a valid grade for Grade 1! :(\");\r\n\t}\r\n\tif (LetterGrade2 == \"A\"||LetterGrade2 == \"B\"||LetterGrade2 == \"C\"||LetterGrade2 == \"D\"||LetterGrade2 == \"F\") {\r\n\t\t// If it's a proper selection, convert the letter to a number :)\r\n\t\tNumberGrade2 = letterToNumber(LetterGrade2);\r\n\t} else {\r\n\t\t// Otherwise, we mark down that the user didn't pick a grade!\r\n\t\talert(\"Enter a valid grade for Grade 2! :(\");\r\n\t}\r\n\tif (LetterGrade3 == \"A\"||LetterGrade3 == \"B\"||LetterGrade3 == \"C\"||LetterGrade3 == \"D\"||LetterGrade3 == \"F\") {\r\n\t\t// If it's a proper selection, convert the letter to a number :)\r\n\t\tNumberGrade3 = letterToNumber(LetterGrade3);\r\n\t} else {\r\n\t\t// Otherwise, we mark down that the user didn't pick a grade!\r\n\t\talert(\"Enter a valid grade for Grade 3! :(\");\r\n\t}\r\n\tif (LetterGrade4 == \"A\"||LetterGrade4 == \"B\"||LetterGrade4 == \"C\"||LetterGrade4 == \"D\"||LetterGrade4 == \"F\") {\r\n\t\t// If it's a proper selection, convert the letter to a number :)\r\n\t\tNumberGrade4 = letterToNumber(LetterGrade4);\r\n\t} else {\r\n\t\t// Otherwise, we mark down that the user didn't pick a grade!\r\n\t\talert(\"Enter a valid grade for Grade 4! :(\");\r\n\t}\r\n\r\n\tlet TotalGPA = (NumberGrade1 + NumberGrade2 + NumberGrade3 + NumberGrade4) / 4;\r\n\t// troubleshooting for calculation in compiler\r\n\t// console.log(TotalGPA);\r\n\tlet extraBonus = \"\";\r\n\tif (TotalGPA == 4) {\r\n\t\textraBonus = \" Excellent work!! You so smart!\";\r\n\t}\r\n\t// Window to alert that the GPA IS -THIS- with a little bonus\r\n\talert(\"Your GPA is \" + TotalGPA + \". \" + extraBonus);\r\n}", "title": "" }, { "docid": "a4f5d3b401a75262a8cbd09367f0dc2e", "score": "0.61498463", "text": "function answers()\n{\n\t// Checks to see if the student has submitted the form on the other side at least once, otherwise its false\n\tif(studentSubmittedOnce){\n\t\t// var field0 = getElements(\"field0\");\n\t\t// var field1 = getElements(\"field1\");\n\t\t// var field2 = getElements(\"field2\");\n\t\t// var field3 = getElements(\"field3\");\n\t\t// var field4 = getElements(\"field4\");\n\t\t// var field5 = getElements(\"field5\");\n\t\t// var field6 = getElements(\"field6\");\n\t\t// var field7 = getElements(\"field7\");\n\t\t// var field8 = getElements(\"field8\");\n\t\t// var field9 = getElements(\"field9\");\n\n\t\t// // Initializes the grade and starts it at 0\n\t\t// var grade = 0;\n\t\t// // Then runs all the checks on all of the fields\n\t\t// grade += check(field0);\n\t\t// grade += check(field1);\n\t\t// grade += check(field2);\n\t\t// grade += check(field3);\n\t\t// grade += check(field4);\n\t\t// grade += check(field5);\n\t // \tgrade += check(field6);\n\t\t// grade += check(field7);\n\t\t// grade += check(field8);\n\t\t// grade += check(field9);\n\t\t// // Multiplies the grade by 10 to be out of 100\n\t\t// grade *= 10;\n\t\t// // Tells user the score\n\t\t// alert(\"This is your Score\\n\" + grade.toPrecision(3) + \" : 100\");\n\n\t\tdocument.score.submit();\n\t\treturn false;\n\t}\n\t// If the user has not submitted the form at least once \n\telse \n\t{\n\t\talert(\"You must submit the form at least one time before you can get a score\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "c192c33705b4b84823b31fc512f7759a", "score": "0.6103395", "text": "function grade(data){\n const resulting = document.getElementById('resulting');\n const answerContainers = document.querySelectorAll('.answers');\n let correct = 0;\n data.forEach( (q, idx) => {let ct = 1;\n const answerWrapper = answerContainers[idx];\n const questions = `#jp-${idx}`;\n const qst = document.querySelector(questions)\n const selector = `input[id=question${idx}]:checked`;\n const userAnswer = (answerWrapper.querySelector(selector) || {}).value;\n //correct answers\n if (userAnswer === q.answerKey){\n correct++;\n qst.classList.add('correct');\n }\n // incorrect answers\n else {\n qst.classList.add('wrong');\n let alts = qst.nextElementSibling.nextElementSibling;\n alts.classList.add('active');\n }\n });\n const dt = new Date();\n const final = correct*20;\n document.getElementById('complete').innerHTML = `<div><strong>Time completed:</strong><br> ${dt}</div>`;\n resulting.innerHTML = `<strong>Final Grade: ${final}%</strong>`;\n }", "title": "" }, { "docid": "a7d51c7365796791a45a1d7d177676c1", "score": "0.61016643", "text": "function gradeInput(input) {\n counter = 0;\n scoreArray = []\n while (counter <= input - 1) {\n scoreArray.push(parseInt(window.prompt('Enter a score: ')));\n counter += 1;\n }\n \n var total = 0;\n for (var i = 0; i <= input - 1; i++) {\n total += scoreArray[i];\n }\n return total / input;\n}", "title": "" }, { "docid": "bb9b2f4aeafde67bf085a1ac8aed3d01", "score": "0.6090631", "text": "function gradeAnswers(){\n\n switch (attemptCount) {\n case 1:\n pointTotal = pointTotal + 40\n break;\n case 2:\n pointTotal = pointTotal + 30\n break;\n case 3:\n pointTotal = pointTotal + 20\n break;\n default:\n pointTotal = pointTotal + 0;\n break;\n }\n}", "title": "" }, { "docid": "0c425b4c8a1a118775c9602779bf2cf6", "score": "0.60603666", "text": "function fnal()\n{\n\t//Adding the weighted exam and coursework scores\n\t//Storing the sum in fmark variable\n\tlet fmark = exam(75)+crsmark(40)\n\n\t//Printing the final course mark to the screen\n\tconsole.log(fmark)\n}", "title": "" }, { "docid": "f431038f1509fad594ada75e51f0167e", "score": "0.60569954", "text": "function updateGrade(){\n var user_points = initPointObjectCategories();\n var max_points = initPointObjectCategories();\n\n $(ASSIGNMENT_TABLE_CSS_PATH +' > tr').not('#menu_assignment').each(function(){\n // console.log($(this))\n var assignment = getAssignmentInfo($(this));\n // console.log(assignment)\n user_points[assignment['category']] += assignment['user_score'];\n max_points[assignment['category']] += assignment['max_score'];\n });\n\n console.log(user_points)\n\n var number_grade = generateNumberGrade(user_points, max_points);\n var letter_grade = generateLetterGrade(number_grade);\n\n\n $(CATEGORIES_CSS_PATH).each(function(){\n updateCategoryScore($(this), user_points, max_points);\n })\n //$(category_element).find('td:nth-child(3)').text();\n\n // console.log(number_grade - original_grade)\n if(Math.abs(number_grade - original_grade) < .1) {\n $(CLASS_NUMBER_GRADE_CSS_PATH).text((number_grade).toFixed(2) + \"%\");\n } else {\n $(CLASS_NUMBER_GRADE_CSS_PATH).text((number_grade).toFixed(2) + \"%\" + \" \" + \"NOT ORIGINAL GRADE\");\n }\n\n \n $(CLASS_LETTER_GRADE_CSS_PATH).text(letter_grade);\n}", "title": "" }, { "docid": "90176f00f3b0bb5fc6160e569fc20d00", "score": "0.6052185", "text": "function calcResults() {\n\n var ag1results,ag2results,ag3results,ag4results,ag5results,res,resag,ag1percent,ag2percent,ag3percent,ag4percent,ag5percent;\n\n function getPercent(score,possible){\n return Math.round(score/possible*100);\n }\n\n function findLevel(score){\n switch(true) {\n case( score <= 25 ):\n level = \"Clear need of governance development (first level/4)\";\n break;\n case( score > 25 && score <= 50 ):\n level = \"Basic level of governance (second level/4)\";\n break;\n case( score > 50 && score <= 75 ):\n level = \"Goal-Driven and dynamic governance (third level/4)\";\n break;\n case( score > 75 ): \n level = \"Transformational governance (highest level/4)\";\n }\n return level;\n }\n\n if(gsdata){\n\n var percentArray = [], accScore, stakeScore, dirScore, resScore, enhScore, totalScore, mlevel, ag1level, ag2level, ag3level, ag4level, ag5level;\n \n\n accScore = parseInt(gsdata.answers[1]) + parseInt(gsdata.answers[2]) + parseInt(gsdata.answers[5]) + parseInt(gsdata.answers[8]) + parseInt(gsdata.answers[10]) + parseInt(gsdata.answers[13]);\n var accPercent = getPercent(accScore,24);\n percentArray.push(accPercent);\n\n stakeScore = parseInt(gsdata.answers[11]) + parseInt(gsdata.answers[14]) + parseInt(gsdata.answers[22]);\n var stakePercent = getPercent(stakeScore,12);\n percentArray.push(stakePercent);\n\n dirScore = parseInt(gsdata.answers[6]) +parseInt(gsdata.answers[7]) +parseInt(gsdata.answers[12]) +parseInt(gsdata.answers[16]);\n var dirPercent = getPercent(dirScore,16);\n percentArray.push(dirPercent);\n\n resScore = parseInt(gsdata.answers[3]) +parseInt(gsdata.answers[4]) +parseInt(gsdata.answers[17]) +parseInt(gsdata.answers[21]) +parseInt(gsdata.answers[23]) +parseInt(gsdata.answers[25]);\n var resPercent = getPercent(resScore,24);\n percentArray.push(resPercent);\n\n enhScore = parseInt(gsdata.answers[9]) +parseInt(gsdata.answers[15]) +parseInt(gsdata.answers[18]) +parseInt(gsdata.answers[19]) +parseInt(gsdata.answers[20]) +parseInt(gsdata.answers[24]);\n var enhPercent = getPercent(enhScore,24);\n percentArray.push(enhPercent);\n\n totalScore = accScore+stakeScore+dirScore+resScore+enhScore;\n \n mlevel = findLevel(totalScore);\n\n //list each area with the score\n res = \"<h2>Govscore Assessment</h2><p>You assessed your organization as follows: </p>\";\n res += \"<div id=\\\"accountability\\\"><h3>Cultivating Accountability</h3><p>\" + accScore + \" out of 24 points - \" + accPercent + \"%.</p></div>\";\n res += \"<div id=\\\"stakeholders\\\"><h3>Engaging Stakeholders</h3><p>\" + stakeScore + \" out of 12 points - \" + stakePercent + \"%.</p></div>\";\n res += \"<div id=\\\"direction\\\"><h3>Shared Strategic Direction</h3><p>\" + dirScore + \" out of 16 points - \" + dirPercent + \"%.</p></div>\";\n res += \"<div id=\\\"resources\\\"><h3>Stewarding Resources</h3><p>\" + resScore + \" out of 24 points - \" + resPercent + \"%.</p></div>\";\n res += \"<div id=\\\"enhancement\\\"><h3>Continuous Governance Enhancement</h3><p>\" + enhScore + \" out of 24 points - \" + enhPercent + \"%.</p></div>\";\n res += \"<div id=\\\"total\\\"><h3>Total Score</h3><p>\" + totalScore +\" points out of 100</p><p>This places your organization at:</p><p class=\\\"level\\\">\" + mlevel + \"</p></div>\";\n res += \"<div id=\\\"link\\\"><p>Learn more at <a href=\\\"http://govscoreapp.net/\\\">govscoreapp.net</a></p><p>Enter the organization code \" + gsdata.organization + \" to see how your organization was evaluated collectively.</p></div>\";\n //document.getElementById('gs-results').innerHTML = res;\n \n }\n\n if(ag1data || ag2data || ag3data || ag4data || ag5data ){\n res += \"<h2>Advanced Govscore</h2>\";\n\n function getAgResults(dataset,resSet,ansnums) {\n var resSet = 0;\n for(i=0; i<(dataset.answers.length - ansnums); i++){\n var ans = ansnums + i;\n resSet += parseInt(dataset.answers[ans]);\n }\n return resSet;\n }\n\n if(ag1data){ag1results = getAgResults(ag1data,ag1results,1);}\n if(ag2data){ag2results = getAgResults(ag2data,ag2results,25);}\n if(ag3data){ag3results = getAgResults(ag3data,ag3results,49);}\n if(ag4data){ag4results = getAgResults(ag4data,ag4results,61);}\n if(ag5data){ag5results = getAgResults(ag5data,ag5results,85);}\n\n ag1percent = getPercent(ag1results,24);\n ag2percent = getPercent(ag2results,24);\n ag3percent = getPercent(ag3results,12);\n ag4percent = getPercent(ag4results,24);\n ag5percent = getPercent(ag5results,16);\n\n ag1level = findLevel(ag1percent);\n ag2level = findLevel(ag2percent);\n ag3level = findLevel(ag3percent);\n ag4level = findLevel(ag4percent);\n ag5level = findLevel(ag5percent);\n \n if(ag1results >= 0){\n res += \"<div id=\\\"adv-govscore\\\"><h3>Cultivating Accountability</h3><p>\" + ag1results + \" out of 24 - \" + ag1percent + \"%</p><p>This places your organization at:</p><p>\" + ag1level + \"</p></div>\";\n }\n if(ag2results >= 0){\n res += \"<div id=\\\"adv-govscore\\\"><h3>Engaging Stakeholders</h3><p>\" + ag2results + \" out of 24 - \" + ag2percent + \"%</p><p>This places your organization at:</p><p>\" + ag2level + \"</p></div>\";\n }\n if(ag3results >= 0){\n res += \"<div id=\\\"adv-govscore\\\"><h3>Shared Strategic Direction</h3><p>\" + ag3results + \" out of 12 - \" + ag3percent + \"%</p><p>This places your organization at:</p><p>\" + ag3level + \"</p></div>\";\n }\n if(ag4results >= 0){\n res += \"<div id=\\\"adv-govscore\\\"><h3>Stewarding Resources</h3><p>\" + ag4results + \" out of 24 - \" + ag4percent + \"%</p><p>This places your organization at:</p><p>\" + ag4level + \"</p></div>\";\n }\n if(ag5results >= 0){\n res += \"<div id=\\\"adv-govscore\\\"><h3>Continuous Governance Enhancement</h3><p>\" + ag5results + \" out of 16 - \" + ag5percent + \"%</p><p>This places your organization at:</p><p>\" + ag5level + \"</p></div>\";\n }\n }\n localStorage.setItem(\"result\", res);\n document.getElementById('gs-results').innerHTML = res; \n}", "title": "" }, { "docid": "2be50eaa9460d445bf7fcf89f6bd507b", "score": "0.60514224", "text": "function finalGrade(exam, projects){\n if(exam > 90 || projects > 10) {\n return 100;\n }\n \n if(exam > 75 && projects >= 5){\n return 90;\n }\n \n if(exam > 50 && projects >= 2) {\n return 75;\n }\n \n return 0;\n}", "title": "" }, { "docid": "52a58f7f015fc15dd3a7ad7db1ab8266", "score": "0.60500664", "text": "function main(){\r\n\tvar wrong=0; stop=false; again=true; question=0; tRange=0; bRange=0; wrongAnswers=0;\r\n\tvar questions=setup();\r\n\tfor(let question=1;question<=questions;question++){\r\n\t\twrongAnswers+=questioner();\r\n\t}\r\n\tendQuiz(wrongAnswers);\r\n\t\r\n\t/* function setup\r\n\t * set bottomRange\r\n\t * set topRange\r\n\t * set questions (how many?) \r\n\t * @param: none\r\n\t * @return: questions\r\n\t */\r\n\tfunction setup(){\r\n\t\t questions=parseInt(prompt(\"How many questions?\"));\r\n\t\t bRange=parseInt(prompt(\"Lowest factor?\"));\r\n\t\t tRange=parseInt(prompt(\"Highest factor?\"));\r\n\t\t alert(\"Enter 'stop' to quit the program.\");\r\n\t\t return questions;\r\n\t}\r\n\r\n\t/* function questioner \r\n\t * generate X and Y factors\r\n\t * concatenate X & Y for equation (a string prompt)\r\n\t * calculate solution\r\n\t * call userInput, sending equation and solution\r\n\t * userInput returns # wrong (0 or 1) so take this and return it to main function\r\n\t * @param none\r\n\t * @return wrong\r\n\t */\r\n\tfunction questioner(){\r\n\t\tlet wrong=0;\r\n\t\tx=Math.floor(Math.random()*((tRange+1)-bRange))+bRange;\r\n\t\ty=Math.floor(Math.random()*((tRange+1)-bRange))+bRange;\r\n\t\tlet equation=(x+\" * \"+y+\" = ?\");\r\n\t\tlet solution=x*y;\r\n\t\twrong=userInput(equation,solution);\r\n\t\tconsole.trace(\"Question \"+question+\": \"+x+\" * \"+y+\" with \"+wrong+ \"wrong.\");\r\n\t\treturn wrong;\r\n\t}\r\n\r\n\t/* function userInput\r\n\t * prompt the equation to the user, take input\r\n\t * if input equals \"stop\" set stop as true, otherwise\r\n\t * check if input equals solution (say \"correct!\" and return wrong)\r\n\t * Add 1 to wrong if incorrect and say \"incorrect. try again. enter 'stop' to quit trying\"\r\n\t * keep asking until solution entered\r\n\t * return 0 if 0 wrong, 1 if 1 or more wrong.\r\n\t * @param none\r\n\t * @return wrong (integer, 0 or 1)\r\n\t */ \r\n\tfunction userInput(equation,solution){\r\n\t\tstop=false;\r\n\t\tlet wrong=0;\r\n\t\tlet input=0;\r\n\t\twhile(input!=solution&&stop==false){\r\n\t\t\tinput=prompt(equation);\r\n\t\t\tif(input==\"stop\"){\r\n\t\t\t\tstop=true;\r\n\t\t\t\tquestions=question;\r\n\t\t\t\treturn wrong;\r\n\t\t\t}\r\n\t\t\telse if(input==solution){\r\n\t\t\t\talert(\"Correct!\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\talert(\"Incorrect. Try again!\");\r\n\t\t\t\twrong=1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn wrong;\r\n\t}\r\n\r\n\tfunction endQuiz(wrongAnswers){\r\n\t\tif(wrongAnswers>0||stop==true){\r\n\t\t\tagain=confirm(\"You had \"+wrongAnswers+\" wrong out of \"+questions+\". \\n Do this some more?\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tagain=confirm(\"You did it! Try higher factors and try this some more?\");\r\n\t\t}\r\n\t\tif(again==true){\r\n\t\t\tmain();\r\n\t\t}\r\n\t\telse{\r\n\t\t\talert(\"Hope you learned your times tables!\");\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "19cea2904dfaf9202f94de826dd6cafb", "score": "0.60344344", "text": "function finalGrade (exam, projects) {\n if (exam > 90 || projects > 10) {\n return 100;\n } else if (exam > 75 && projects >= 5) {\n return 90;\n } else if (exam > 50 && projects >= 2) {\n return 75;\n } else {return 0}\n}", "title": "" }, { "docid": "3ef6a431d80828ed03a0eafa023c870f", "score": "0.60076845", "text": "function analyzeGrades() {\n\n //Finds the index of the class (looks through all classes to see which one this is)\n var classNum = 0;\n for(var y = 0; y < allNames.length; y++) { \n if(window.find(allNames[y])) { \n classNum = y;\n }\n }\n \n //Updates variables with the class\n var useGrades = allWeights[classNum];\n var useIDs = allIDs[classNum];\n\n //If there are no grades inputted, is a straight average\n var isStraightAverage = useGrades.length === 0;\n\n console.log(\"USE GRADES: \" + useGrades);\n console.log(\"USE IDS: \" + useIDs);\n console.log(\"IS STRAIGHT: \" + isStraightAverage);\n\n //For counting the numerator and denominator\n var numSum = 0;\n var denomSum = 0;\n var count = 0;\n\n var grades = document.getElementsByTagName(\"th\");\n for (var i = 0; i < grades.length; i++) {\n\n //Anything that makes it past this is related to score\n if (grades[i].innerHTML == \"Score\") {\n var parent2 = grades[i].parentNode.parentNode.parentNode;\n\n for (var j = 0; j < parent2.childNodes.length; j++) {\n if (parent2.childNodes[j].nodeType != 3) {\n if (parent2.childNodes[j].tagName.toUpperCase() === \"TBODY\") {\n var tbody = parent2.childNodes[j];\n for (var k = 0; k < tbody.childNodes.length; k++) {\n try {\n\n //Important stuff needed for grades\n var tbody2 = tbody.childNodes[k].getElementsByTagName(\"td\");\n var arr = Array.prototype.slice.call(tbody2);\n var assignmentType = linkProp(arr[1]);\n var grade = getGrade(arr[8]);\n console.log(\"GRADE: \" + grade);\n\n //If the grade has two values (means its completed like 90/100, not --/100)\n if(grade.length == 2) { \n count++;\n\n //If it's a straight average, just add it to numerator and denominator\n if(isStraightAverage) {\n console.log(\"RIGHT HERE: \" + grade);\n numSum += (grade[0]);\n denomSum += (grade[1]);\n }\n\n //If it's weighted\n else { \n console.log(\"Not straight\");\n for(var rr = 0; rr < useIDs.length; rr++) { \n\n //Look through all the assignment types to find the right type and weight\n if(assignmentType.indexOf(useIDs[rr]) > -1) { \n console.log(\"HH: \" + useGrades[rr]);\n console.log((parseInt(grade[1]) * parseFloat(useGrades[rr])) + \" YOLO\");\n\n //Multiply num and denom by weight, add it to total num and denom\n numSum += (parseInt(grade[0]) * parseFloat(useGrades[rr]));\n denomSum += (parseInt(grade[1]) * parseFloat(useGrades[rr]));\n console.log(numSum + \" / \" + denomSum);\n }\n else { \n console.log(\"NO: \" + assignmentType);\n }\n }\n }\n }\n } catch (err) {\n console.log(err.message + \"?\"); \n }\n }\n }\n }\n }\n }\n }\n\n //Print results\n if(numSum != \"NaN%\") { \n alert(\"Grade: \" + (((numSum / denomSum)) * 100) + \"%\");\n }\n return \"fine\";\n}", "title": "" }, { "docid": "0d5cb31bdf5ab116ebb42f64bbb63626", "score": "0.60075986", "text": "function getGrade (s1, s2, s3) {\n const avg = (s1+s2+s3)/3\n let answer = \"\"\n\tif (avg <= 100 && avg >= 90){\n answer = \"A\" \n } else if (avg < 90 && avg >= 80) {\n\t answer = \"B\"\n } else if (avg < 80 && avg >= 70) {\n\t answer = \"C\"\n } else if (avg < 70 && avg >= 60) {\n\t answer = \"D\"\n } else {\n answer = \"F\"\n }\n return answer\n}", "title": "" }, { "docid": "fa7684a427ecc230332f71337a0cc1b3", "score": "0.600373", "text": "function test(grade){\n\tif(grade === 100){\n\tconsole.log(\"Green\");\n\t} else if(grade <= 99 && grade >= 70){\n\tconsole.log(\"Yellow\");\n\t} else if(grade <= 69 & grade >= 70){\n\tconsole.log(\"Red\");\n\t} else\n\tconsole.log(\"No Attempt\");\n\t}", "title": "" }, { "docid": "7b41027f53e9d78eaabbd141997bc22b", "score": "0.598929", "text": "function assignGrade(score) {\n\tif (score >= 90) {\n\t\tconsole.log(\"For \" + score + \" you get an A.\");\n\t} else if (score >= 80) {\n\t\tconsole.log(\"For \" + score + \" you get a B.\");\n\t} else if (score >= 70) {\n\t\tconsole.log(\"For \" + score + \" you get a C.\");\n\t} else if (score >= 60) {\n\t\tconsole.log(\"For \" + score + \" you get a D.\");\n\t} else if (score <=59) {\n\t\tconsole.log(\"For \" + score + \" you get an F.\");\n\t}\n\t\n}", "title": "" }, { "docid": "c1900303e487b2a369cf25f38c8c884c", "score": "0.59841305", "text": "function finalGrade (exam, projects) {\n if(exam > 90 || projects > 10) return 100;\n if(exam > 75 & projects >= 5) return 90;\n if(exam > 50 & projects >= 2) return 75;\n return 0;\n}", "title": "" }, { "docid": "64399538812ae441886b052f40376463", "score": "0.5957737", "text": "function calculateCurrentGrade(){\n var grades = [];\n var gradeWeight = [];\n var finalGrade = 0;\n for(var i = 1; i < rowCount; i++){\n grades.push(document.getElementById(\"percent\" + i).value);\n gradeWeight.push(document.getElementById(\"weight\" + i).value);\n }\n for (var k=0; k <gradeWeight.length; k++){\n gradeWeight[k] = convertArrayStringToNumber(gradeWeight[k]);\n gradeWeight[k] = averageArray(gradeWeight[k]);\n }\n for (var j=0; j < grades.length; j++){\n grades[j] = convertArrayStringToNumber(grades[j]);\n grades[j] = averageArray(grades[j]);\n }\n for(var x = 0; x < rowCount - 1; x++) {\n finalGrade += grades[x] * (gradeWeight[x] / 100);\n }\n finalGrade = finalGrade * 100;\n finalGrade = Math.round(finalGrade);\n finalGrade = finalGrade / 100;\n\n if(finalGrade >100){\n alert(\"Your Grade is over 100%! Great job, or you put in your grades incorrectly.\");\n }\n\n document.getElementById(\"displayGrade\").innerHTML= \"Your grade is: \" + finalGrade + \"%\";\n return finalGrade;\n\n}", "title": "" }, { "docid": "a43ba7f6e2b66bda08bfd7f4ccd58bbc", "score": "0.594279", "text": "function assignGrade(num){\n if (num >= 85) {\n document.write( num + \" is an A! <br />\");\n } else if (num >= 70) {\n document.write( num + \" is a B. <br />\");\n } else if (num >= 60) {\n document.write( num + \" is a C. <br />\");\n } else if (num >= 50) {\n document.write( num + \" is a D. <br />\");\n } else {\n document.write( num + \" is an F. <br />\");\n }\n}", "title": "" }, { "docid": "c3879f403cfee7ea7cac10d98d66c89d", "score": "0.59318614", "text": "function grade(score){\n if(score >= 90 && score <= 100){\n console.log(`You got a A (${score}%)!`)\n }\n else if(score >= 80 && score <= 89){\n console.log(`You got a B (${score}%)!`)\n }\n else if(score >= 70 && score <= 79){\n console.log(`You got a C (${score}%)!`)\n }\n else if(score >= 60 && score <= 69){\n console.log(`You got a D (${score}%)!`)\n }\n else if(score >= 50 && score <= 59){\n console.log(`You got a E (${score}%)!`)\n }\n else if(score >= 0 && score <= 49){\n console.log(`You got a F (${score}%)!`)\n }\n}", "title": "" }, { "docid": "f4f1884df640bcd66ef1002e958d4722", "score": "0.5930832", "text": "function finalGrade(exam, projects) {\n if (exam > 90 || projects > 10) {\n return 100;\n } else if (exam > 75 && projects >= 5) {\n return 90;\n } else if (exam > 50 && projects >= 2) {\n return 50;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "abf263984132b916dfc3e948950d0779", "score": "0.5916536", "text": "function gymnastics() {\n\n /////////////////// DO NOT MODIFY\n let total = 0; //// DO NOT MODIFY\n let scores = []; // DO NOT MODIFY\n /////////////////// DO NOT MODIFY\n\n let op6 = document.getElementById(\"gymnastics-output\");\nfor(let i = 0; i < 6; i++) {\n do {\n scores[i] = Number(prompt(\"Enter a score between 0.0 and 10.0\"));\n scores[i].toFixed(2);\n console.log(scores[i]);\n if (isNaN(scores[i])) {\n alert(\"Please enter a number!\")\n checky = false;\n }else if (scores[i] < 0 || scores[i] > 10) {\n alert(\"Please enter a score between 0.0 and 10.0!\")\n checky = false;\n } else {\n checky = true;\n }\n }while (checky == false)\n}\nconsole.log(scores);\nscores.sort(function(a, b){return a-b});\nconsole.log(scores);\ntotal = scores[1] + scores[2] + scores[3] + scores[4];\nlet avg = (total / 4).toFixed(2);\nconsole.log(scores[0]);\nconsole.log(scores[5]);\nop6.innerHTML = (`Discarded: ${scores[0]}, ${scores[5]}</br>Score: ${avg}`);\n\n /*\n * NOTE: The 'total' variable should be representative of the sum of all\n * six of the judges' scores.\n */\n\n /*\n * NOTE: You need to add each score (valid or not) to the 'scores' variable.\n * To do this, use the following syntax:\n *\n * scores.push(firstScore); // your variable names for your scores\n * scores.push(secondScore); // will likely be different than mine\n */\n\n /////////////////////////////// DO NOT MODIFY\n check('gymnastics', scores); // DO NOT MODIFY\n /////////////////////////////// DO NOT MODIFY\n}", "title": "" }, { "docid": "384736db975fbe7e0820da9410589e0a", "score": "0.5913793", "text": "function initAssignment() {\n var assignment = document.getElementById(\"assignment-input\").value;\n var pointsEarned = document.getElementById(\"pts-earned\").value;\n var maxPoints = document.getElementById(\"pts-max\").value;\n var weight = document.getElementById(\"weight\").value;\n\n addAssignment(assignment, pointsEarned, maxPoints, weight);\n calculateGrade();\n}", "title": "" }, { "docid": "01408c1571c227efd7629d78249fa01b", "score": "0.5900217", "text": "function gradingStudents(grades) {\n\n output10.innerHTML = \" <br>\";\n let output = [];\n\n console.log(\"--GRADING gradingStudents --\");\n\n console.log(73 % 5);\n\n for (let i = 0; i < grades.length; i++) {\n if ((grades[i] < 38) || ((grades[i] % 5) < 3)) {\n console.log(grades[i]);\n output10.innerHTML += grades[i] + \"<br>\";\n output.push(grades[i]);\n } else if ((grades[i] >= 38) && (grades[i] % 5) >= 3) {\n console.log(Math.round((grades[i]) / 5) * 5);\n output10.innerHTML += (Math.round((grades[i]) / 5) * 5) + \"<br>\";\n output.push(Math.round((grades[i]) / 5) * 5);\n\n }\n }\n}", "title": "" }, { "docid": "bead3b57d52d5b136e1ed28f5d991e4f", "score": "0.589753", "text": "function submitGradeEntryData() {\n let year = $(\"#year\").val();\n let term = $(\"#term\").val();\n let totalCredits = $(\"#totalCredits\").val();\n let currentGpa = $(\"#currentGpa\").val();\n let gradeResponses = [year, term, totalCredits, currentGpa];\n\n for (var i = 0; i < gradeResponses.length; i++) {\n if (gradeResponses[i] == \"\") {\n alert(\"Please complete all fields!\");\n break;\n } else if (gradeResponses[3] > 4) {\n alert(\"GPA cannot be over 4.0.\");\n break;\n } else {\n insertGradeEntryData(gradeResponses);\n break;\n }\n }\n}", "title": "" }, { "docid": "fcfd1a40de1b6e411b3f47bdbe3cce83", "score": "0.58968645", "text": "function assignGrade(numScore) {\n if (numScore < 60) {\n console.log(`The grade for ${numScore} is F`);\n } else if (numScore >= 61 && numScore <= 70) {\n console.log(`The grade for ${numScore} is D`);\n } else if (numScore >= 71 && numScore <= 80) {\n console.log(`The grade for ${numScore} is C`);\n } else if (numScore >= 81 && numScore <= 90) {\n console.log(`The grade for ${numScore} is B`);\n } else if (numScore >= 91) {\n console.log(`The grade for ${numScore} is A`);\n }\n}", "title": "" }, { "docid": "5ff0278a937527661aabaff55d2e88ca", "score": "0.5888343", "text": "function submitQuiz() {\n\n\t// get each answer score return a 1 or a 0 which is the value of the checked radio box\n\t\tfunction answerScore (qName) {\n\t\t\tvar radiosNo = document.getElementsByName(qName);\n\n\t\t\tfor (var i = 0, length = radiosNo.length; i < length; i++) {\n \t\t\t\tif (radiosNo[i].checked || radiosNo[i].selected) {\n\t\t\t// do something with radiosNo\n\t\t\t\t\tvar answerValue = Number(radiosNo[i].value);\n\t\t\t\t}\n\t\t\t\tif(radiosNo[i].name == \"q3\" || radiosNo[i].name == \"q8\"){\n\t\t\t\t\tvar answerValue = Number(radiosNo[i].value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// change NaNs to zero\n\t\t\tif (isNaN(answerValue)) {\n\t\t\t\tanswerValue = 0;\n\t\t\t}\n\t\t\treturn answerValue;\n\t\t}\n\n\n\t\t// Calc score is equal to the return function 'score total'\n\t\t// Score total rolls through a for loop and adds the returned variable ( 1 or 0 ) to a running total\n\t\t// It then returns this total to the calc score variable as the total number of correct questions\n\t\t\n\t\t// This was written to replace the original code of:\n\t\t//var calcScore = (answerScore('q1') + answerScore('q2') + answerScore('q3') + answerScore('q4') + answerScore('q5') + answerScore('q6') + answerScore('q7') + answerScore('q8') + answerScore('q9') + answerScore('q10')); \n\n\t\tvar calcScore = score_total();\n\t\t\n\t\tfunction score_total() {\n\n\t\t\tvar totalNumber = 0;\n\n\t\t\tfor(var i = 0; i<10;i++){\n\n\t\t\t\tvar questionNum = 'q'+(i+1);\n\n\t\t\t\ttotalNumber += answerScore(questionNum);\n\t\t\t};\n\n\t\t\treturn totalNumber;\n\t\t};\n\n\n\t\tvar AnswerString = \"Question # \";\n\t\tvar correctAnswer = [\n\t\t\t\"Cargill Enterprise is at 199 Hillside Road Dunedin.\",\n\t\t\t\"Only glass can be put in the blue recycle bins in Dunedin.\",\n\t\t\t\"Although electronic equiptment can be recycled, it must be done at designated e-waste centers.\",\n\t\t\t\"Waste Busters is in Alexandra.\",\n\t\t\t\"Nappies can not be recycled.\",\n\t\t\t\"Currently glass is not recycled.\",\n\t\t\t\"Mount Cooee has started accepting e-waste from 2016.\",\n\t\t\t\"The Maximum weight is 75kg.\",\n\t\t\t\"Cooee Landfill accepts branches less than 150mm.\",\n\t\t\t\"The quiz send it`s regards...\"\t\t\t\n\t\t];\n\n\t\t// This for loop will change the 'questionNUm to be q(i) and then pass that in to answer score function.\n\t\t// Every time it rolls around i is incremented so that it can keep track of which question to grab.\n\t\t// If it finds a wrong answer the loop will use i to grab the corresponding corect answer from the correct answer array and insert that into the string; \n\t\t// Append all answers to the answers div. \n\n\t\tfor(var i = 0; i<10;i++){\n\n\t\t\tvar questionNum = 'q'+(i+1);\n\n\t\t\tif (answerScore(questionNum) === 0) {\n\t\t\t\tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + (i+1) + ' : Wrong! ' + correctAnswer[i] + '</p>'\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + (i+1) + ' : Correct!</p>';\n\t\t\t }\n\t\t}\n\n\t\t//The above For Loop Replaces the Below Orginal code\n\n\t\t// if (answerScore('q1') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<p class=\"wrong-answer\">' + AnswerString + '1: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<p class=\"right-answer\">' + AnswerString + '1: Correct!</p>';\n // }\n\n // if (answerScore('q2') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '2: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '2: Correct!</p>';\n // }\n\n // if (answerScore('q3') === 1) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '3: Wrong! Although electronic equiptment can be recycled, it must be done at designated e-waste centers.</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '3: Correct!</p>';\n // }\n\n // if (answerScore('q4') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '4: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '4: Correct!</p>';\n\t\t// }\n\t\t \n\t\t// if (answerScore('q5') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '5: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '5: Correct!</p>';\n // }\n\n // if (answerScore('q6') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '6: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '6: Correct!</p>';\n // }\n\n // if (answerScore('q7') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '7: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '7: Correct!</p>';\n // }\n\n // if (answerScore('q8') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '8: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '8: Correct!</p>';\n\t\t// }\n\t\t \n\t\t// if (answerScore('q9') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '9: Wrong! The Correct answer was - (placeholder)</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '9: Correct!</p>';\n // }\n\n // if (answerScore('q10') === 0) {\n\t\t// \tdocument.getElementById('Answers').innerHTML += '<br><p class=\"wrong-answer\">' + AnswerString + '10: Wrong! The quiz send it`s regards...</p>'\n // }else{\n // document.getElementById('Answers').innerHTML += '<br><p class=\"right-answer\">' + AnswerString + '10: Correct!</p>';\n // }\n\n\n\n\t// calculate \"possible score\" integer\n\t\tvar questionCountArray = document.getElementsByClassName('question');\n\n\t\tvar questionCounter = 0;\n\t\tfor (var i = 0, length = questionCountArray.length; i < length; i++) {\n\t\t\tquestionCounter++;\n\t\t}\n\n\t// show score as \"score/possible score\"\n\t\tvar showScore = \"Your Score: \" + calcScore +\"/\" + questionCounter +\"...\" + '<br><button class=\"btn waves-effect waves-light deep-orange pulse quiz-button\" id=\"submitButton\" type=\"button\" onClick=\"window.location.href=window.location.href\">Retry<i class=\"material-icons right\">loop</i></button>';\n\t// if 10/10, \"perfect score!\"\n\t\tif (calcScore === questionCounter) {\n\t\t\tshowScore = showScore + '&nbsp; <strong>Perfect Score! You saved the Whales!</strong>'\n\t\t};\n\t\tdocument.getElementById('userScore').innerHTML = showScore;\n\t}", "title": "" }, { "docid": "f22d21668b3f5ec51f8b7f17679afbd6", "score": "0.5876454", "text": "function Process_cal(s_name,s_branch,html_m,css_m,js_m){\r\n //var percentage_m = (parseInt(html_m) + parseInt(css_m) + parseInt(js_m));\r\n var percentage_m = (((html_m + css_m + js_m)/300)*100).toFixed(2);\r\n document.getElementById(\"name_s1\").innerHTML = s_name.toUpperCase();\r\n document.getElementById(\"branch_s\").innerHTML = s_branch.toUpperCase();\r\n document.getElementById(\"percentage_s\").innerHTML = percentage_m + \"%\";\r\n document.getElementById(\"html_m_r\").innerHTML = html_m;\r\n document.getElementById(\"css_m_r\").innerHTML = css_m;\r\n document.getElementById(\"js_m_r\").innerHTML = js_m;\r\n document.getElementById(\"tot_m_r\").innerHTML = (html_m + css_m + js_m);\r\n if(html_m < 35 || css_m < 35 || js_m < 35){\r\n document.getElementById(\"grade_s\").innerHTML = \"FAIL\";\r\n }else{\r\n if(percentage_m >= 35 && percentage_m < 50){\r\n document.getElementById(\"grade_s\").innerHTML = \"C\";\r\n }\r\n if(percentage_m >= 50 && percentage_m < 65){\r\n document.getElementById(\"grade_s\").innerHTML = \"B\";\r\n }\r\n if(percentage_m >= 65 && percentage_m < 80){\r\n document.getElementById(\"grade_s\").innerHTML = \"A\";\r\n }\r\n if(percentage_m >= 80 && percentage_m < 100){\r\n document.getElementById(\"grade_s\").innerHTML = \"E\";\r\n }\r\n }\r\n document.getElementById(\"result\").style.display = \"block\";\r\n}", "title": "" }, { "docid": "dedee3b29310773cf9acd8d6db1f7477", "score": "0.5871464", "text": "function gradeConvert(form) {\n\tthis.form = form;\n\n\t// declare variables that get hold of two nodes based on their id's\n\tvar elGradeNum = document.getElementById(\"gradeNum\");\n\tvar elGradeChar = document.getElementById(\"gradeChar\");\n\n\t// create a function that can be called to each time a statement is true\n\tvar gradeMessage = function(num, char ) {\n\n\t\t// provided arguments values will be displayed in the window\n\t\telGradeNum.textContent = num;\n\t\telGradeChar.textContent = char;\n\t}\n\n\t// initialize the variable for letter grade\n\tvar lettGrade = \"\";\n\n\t// capture number input for the number grade using the form in the html\n\tvar numGrade = parseInt(this.form.inputbox.value);\n\n\t// check if the number grade is greater or equal to 88\n\tif (numGrade >= 88 && numGrade <= 100) {\n\n\t\tlettGrade = \"A\"; // assign the letter grade A\n\t\tgradeMessage(numGrade, lettGrade); // display the number and letter grades on the window\n\n\t// check if the number grade is greater than 80 but less tahn 87\n\t} else if(numGrade >= 80 && numGrade <= 87) {\n\n\t\tlettGrade = \"B\"; // assign the letter grade B\n\t\tgradeMessage(numGrade, lettGrade); // display the number and letter grades on the window\n\n\t// check if the number grade is between 68 and 79\n\t} else if (numGrade >= 68 && numGrade <= 79) {\n\t\tlettGrade = \"C\"; // assign the letter grade C\n\t\tgradeMessage(numGrade, lettGrade); // display the number and letter grades on the window\n \n\t// check if the number grade is between 60 and 67\n\t} else if (numGrade >= 60 && numGrade <= 67) {\n\t\tlettGrade = \"D\"; // assign the letter grade D\n\t\tgradeMessage(numGrade, lettGrade); // display the number and letter grades on the window\n\n\t// check if the number grade is less than 60\n\t} else if (numGrade < 60) {\n\t\tlettGrade = \"F\" // assign the letter grade F\n\t\tgradeMessage(numGrade, lettGrade); // display the number and letter grades on the window\n\n\t} else if (numGrade > 100 || typeof this.form.inputbox.value === 'string') {\n\t\n\t\talert(\"Please enter a number that is between 0 and 100\"); // prompt the user to follow the instructions\n\t}\n\t\t\n// end of gradeConvert function\n}", "title": "" }, { "docid": "87911482a8fb4d3aa61eba8738c1703e", "score": "0.5863681", "text": "function scoreAssign (event){\n event.preventDefault();\n\n var outputObj = {\n gradeText: \"Grade: \"\n };\n\n outputObj.firstName = $(\"#firstName\").val()\n outputObj.lastName = $(\"#lastName\").val()\n outputObj.pointPos = $(\"#pointsPos\").val()\n outputObj.pointsEarn = $(\"#pointsEarn\").val()\n\n outputObj.percent = Math.round(outputObj.pointsEarn / outputObj.pointPos * 100)\n outputObj.percentText = outputObj.percent + \"%\"\n\n\n\n if (outputObj.percent > 95){\n outputObj.grade = \"A\"\n }else if (outputObj.percent > 89.99){\n outputObj.grade = \"A-\"\n }else if (outputObj.percent > 84.99){\n outputObj.grade = \"B\"\n }else if (outputObj.percent > 79.99){\n outputObj.grade = \"B-\"\n }else if (outputObj.percent > 74.99){\n outputObj.grade = \"C\"\n }else {\n outputObj.grade = \"F\"\n }\n\n students.push(outputObj)\n\n displayStudents();\n }", "title": "" }, { "docid": "dbe4fcc6eef3df9eab2b43d7e3d680e4", "score": "0.5862298", "text": "function showFinalQuestionPage() {\n var finalQuestionCategory = Math.floor(Math.random() * questions.length);\n var finalQuestionValue = Math.floor(Math.random() * (questions[finalQuestionCategory].length - 1));\n finalQuestionValue++; //This way it won't be the category name\n if (!questions[finalQuestionCategory][finalQuestionValue].taken) { //If the chosen question isn't taken, the final question can be that one. Otherwise, it's one of four special questions\n finalQuestion = questions[finalQuestionCategory][finalQuestionValue];\n }\n\n while (true) {\n if (score > 0) {\n finalWager = prompt(\"Final Question: How much would you like to wager?\", \"\");\n if (!isNumber(finalWager)) {\n alert(\"That wasn't a number... \\nTry again.\");\n } else {\n finalWager = Number(finalWager);\n\n if (finalWager > score) {\n alert(\"You don't have that much money... \\nTry again.\")\n } else if (finalWager < 0) {\n alert(\"Uhh, that's negative... \\nTry again.\")\n } else {\n break;\n }\n }\n } else if (score < 0) {\n finalWager = prompt(\"Final Question: You have negative money. You can bet up to the absolute value of your total.\\nHow much would you like to wager?\", \"\");\n if (!isNumber(finalWager)) {\n alert(\"That wasn't a number... \\nTry again.\");\n } else {\n finalWager = Number(finalWager);\n\n if (finalWager > score) {\n alert(\"You don't have that much money... \\nTry again.\")\n } else if (finalWager < 0) {\n alert(\"Uhh, that's negative... \\nTry again.\")\n } else {\n break;\n }\n }\n }\n }\n\n document.getElementById('questionPage').style.display='block';\n document.getElementById('chooseQuestionPage').style.display='none';\n setHtmlDivText('','alert');\n\n setHtmlDivText(\"<b>Final question: </b>\" + getFinalQuestion(), \"question\");\n setHtmlDivText(\"<a href='#' onclick='submitFinalQuestion(document.getElementById(\\\"answer0\\\"),0)'>\" + getFinalAnswerChoice(0) + \"</a>\", \"answer0\");\n setHtmlDivText(\"<a href='#' onclick='submitFinalQuestion(document.getElementById(\\\"answer1\\\"),1)'>\" + getFinalAnswerChoice(1) + \"</a>\", \"answer1\");\n setHtmlDivText(\"<a href='#' onclick='submitFinalQuestion(document.getElementById(\\\"answer2\\\"),2)'>\" + getFinalAnswerChoice(2) + \"</a>\", \"answer2\");\n setHtmlDivText(\"<a href='#' onclick='submitFinalQuestion(document.getElementById(\\\"answer3\\\"),3)'>\" + getFinalAnswerChoice(3) + \"</a>\", \"answer3\");\n setHtmlDivText(\"\", \"return\");\n}", "title": "" }, { "docid": "4284fa7e0076ba7bdf64a2f7244dbf27", "score": "0.58589554", "text": "function markCal(eventt){\n\tvar score = 0;\n\tvar result = document.getElementById(\"result3\");\n\tvar ansHolder = document.getElementById(\"dragNdrop1\");\n\tvar selectId = document.getElementById(\"selectId\");\n\tvar numList = document.getElementById(\"numList\");\n\tif (sessionStorage.left == undefined || sessionStorage.right == undefined) {\n\t\talert(\"All questions required\");\n\t}\n\telse{\n\t\tsessionStorage.removeItem(\"left\");\n\t\tsessionStorage.removeItem(\"right\");\n\t\tif (document.getElementById(\"dragNdrop1\").hasChildNodes() && \n\t\t\tdocument.getElementById(\"selectId\").selectedIndex != 0 &&\n\t\t\tdocument.getElementById(\"numList\").value !=\"\")\n\t\t{\n\t\t\tif (ansHolder.hasChildNodes()) {\n\t\t\t\tansId = ansHolder.childNodes[0].id;\n\t\t\t\tif (ansId == \"p1\") {\n\t\t\t\t\tscore++;\n\t\t\t\t\tconsole.log(score);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selectId.value == \"correct\") {\n\t\t\t\tscore++;\n\t\t\t\tconsole.log(score);\n\t\t\t}\n\t\t\tif (sessionStorage.score) {\n\t\t\t\tconsole.log(sessionStorage.score);\n\t\t\t\tscore = score + Number(sessionStorage.score);\n\t\t\t\tconsole.log(score);\n\t\t\t\tsessionStorage.removeItem(\"score\");\n\t\t\t}\n\t\t\tif (sessionStorage.scoree) {\n\t\t\t\tconsole.log(sessionStorage.scoree);\n\t\t\t\tscore = score + Number(sessionStorage.scoree);\n\t\t\t\tconsole.log(score);\n\t\t\t\tsessionStorage.clear();\n\t\t\t}\n\t\t\tif (numList.value == 3){\n\t\t\t\tscore++;\n\t\t\t\tconsole.log(score);\n\t\t\t}\n\t\t\tresult.innerHTML = \"Grade = \" + score + \" out of 6.\";\n\t\t}\n\t\telse{\n\t\t\talert(\"All questions required.\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "faf699d61ee6de30b2e3e1da86cc6852", "score": "0.585552", "text": "function grade(){\n Qualtrics.SurveyEngine.setEmbeddedData(\"total_num_high_depletion_es\", total_num_high_depletion_es);\n Qualtrics.SurveyEngine.setEmbeddedData(\"total_num_es\", total_num_es);\n Qualtrics.SurveyEngine.setEmbeddedData(\"num_non_es_clicked\", num_non_es_clicked);\n Qualtrics.SurveyEngine.setEmbeddedData(\"num_es_clicked\", num_es_clicked);\n Qualtrics.SurveyEngine.setEmbeddedData(\"num_high_dep_es_clicked\", num_high_dep_es_clicked);\n var copy_of_page = $j(\"#text-area\").html();\n Qualtrics.SurveyEngine.setEmbeddedData(\"copy_of_user_data\", \"<p>\" + copy_of_page + \"</p>\");\n qualtrics.clickNextButton();\n }", "title": "" }, { "docid": "a96143cb3dde6c75d135430c3bf1a307", "score": "0.5848743", "text": "function calcForGrade( value ) {\n if ( value >= 75 && value <= 100 ){\n subGrade = \"A\";\n }\n\n else if ( value >= 65 && value <= 74 ){\n subGrade = \"B\";\n }\n\n else if ( value >= 55 && value <= 64 ){\n subGrade = \"C\";\n }\n\n\n else if ( value >= 45 && value <= 54 ){\n subGrade = \"D\";\n }\n\n else if ( value >= 40 && value <= 44 ){\n subGrade = \"E\";\n }\n\n else if (value >= 0 && value <= 39 ){\n subGrade = \"F\";\n }\n}", "title": "" }, { "docid": "78aaba19f931776aa7a240393c3fa78b", "score": "0.5843552", "text": "function start(){\n\tvar grade = readInt(\"What was your grade?\");\n\tvar gotB = grade >= 80 && grade < 90;\n\tprintln(\"Got a B: \" + gotB);\n}", "title": "" }, { "docid": "b36b79d6027173f3aec4f852544f2a90", "score": "0.5830746", "text": "function getNumericGrades(){\n var grade = parseInt(prompt(\"Enter your grade\"));\n\n while (isNaN(grade)|| (grade < 0 || grade > 100)){\n\n grade = parseInt(prompt(\"Enter your grade as a number between 0 and 100\"));\n console.log(grade);\n console.log(typeof grade); //you want to console.log the data and the data type of what your code is doing\n }\n return grade;\n}", "title": "" }, { "docid": "80fe6c582d4018a3e2b107da7b486810", "score": "0.58277303", "text": "function CalculateStudentMarks(maths, physics, chemisty ,row) {\r\n\t\r\n\t// if atleast one of the subjects is less than 35 then fail status is set to false\r\n\tvar failStatus = maths < 35 || physics < 35 || chemisty < 35;\r\n\tvar grade;\r\n\r\n\tif(failStatus)\r\n\t\tgrade = \"FAIL\";\r\n\telse\r\n\t\tgrade = \"PASS\";\r\n\r\n\t// Calculate total marks and grade\r\n\tvar totalMarks = maths + physics + chemisty;\r\n\tvar average = Math.round(totalMarks / 3 , 2); \r\n\r\n\t// Update the Grade, TotalMarks and average of a specific row\r\n\tif(row !== '')\r\n\t{\r\n\t\trow.cells[4].innerText = totalMarks;\r\n\t\trow.cells[5].innerText = Number(average);\r\n\t\trow.cells[6].innerHTML = grade;\r\n\r\n\t\t// add red background color if student fails else add green\r\n\t\trow.cells[6].style.backgroundColor = grade === \"PASS\" ? \"#4CAF50\" : \"red\";\r\n\t}\r\n\r\n }", "title": "" }, { "docid": "0380843058d74d26717a01cc5f5f8df5", "score": "0.5823064", "text": "function calcsectiongrades(a, b){\n var array = a.split(\",\");\n sumofarray = 0;\n for(i = 0; i < array.length; i++){\n if(array[i] > 100){\n document.getElementById(\"warning\").innerHTML = \"Attention: You entered a score greater than 100%.\";\n }\n array[i] = parseInt(array[i]);\n sumofarray += array[i];\n }\n var endgrd = sumofarray * b / 100 / array.length;\n return endgrd;\n}", "title": "" }, { "docid": "5fe73cacb10cc080238cc6531b0dd43b", "score": "0.58178145", "text": "function calculatePercentage() {\n var maxPoints = document.querySelector('#maxPoints').value;\n var currentPoints = document.querySelector('#recievedPoints').value;\n if (maxPoints != null && currentPoints != null) {\n var score = parseFloat(((currentPoints / maxPoints) * 100).toFixed(1));\n var grade = 5;\n console.log((score));\n document.querySelector('#scorePercentage').classList.remove('text-primary', 'text-success', 'text-warning', 'text-danger');\n if (90.0 <= score) {\n document.querySelector('#scorePercentage').classList.add('text-primary');\n } else if (75.0 <= score) {\n document.querySelector('#scorePercentage').classList.add('text-success');\n grade = 4;\n } else if (50.0 <= score) {\n document.querySelector('#scorePercentage').classList.add('text-warning');\n grade = 3;\n } else {\n document.querySelector('#scorePercentage').classList.add('text-danger');\n grade = 2;\n }\n document.querySelector('#scorePercentage').innerHTML = score + '% = ' + grade;\n }\n}", "title": "" }, { "docid": "1445bf9a1e38d44102815f6a4111b66d", "score": "0.58065605", "text": "function calcGPA(){\r\n var message = document.querySelector(\".error_msg\");\r\n var gpa = (totalGradePoint / totalCredit).toFixed(2);\r\n // determine the degree class\r\n if(gpa >= 4.50 && gpa <= 5.00){\r\n degreeClass =\"FIRST CLASS\";\r\n }\r\n else if(gpa >= 3.50 && gpa <= 4.49){\r\n degreeClass = \"SECOND CLASS UPPER\";\r\n }\r\n else if(gpa >= 2.50 && gpa <= 3.49){\r\n degreeClass = \"SECOND CLASS LOWER\";\r\n }\r\n else if(gpa >= 1.50 && gpa <= 2.49){\r\n degreeClass = \"THIRD CLASS\";\r\n }\r\n else{\r\n degreeClass = \"PASS\";\r\n }\r\n\r\n // append the calculations to table\r\n var tbody = document.querySelector(\"#coursesTable tbody\");\r\n\r\n var tdGPA = document.createElement(\"td\");\r\n tdGPA.textContent = \"Your GPA is: \" + gpa;\r\n var tdEmpty = document.createElement(\"td\");\r\n tdEmpty.textContent = \"\";\r\n var tdStrTC = document.createElement(\"td\");\r\n tdStrTC.textContent = \"Total Credit:\";\r\n var tdTotalCredit = document.createElement(\"td\");\r\n tdTotalCredit.textContent = totalCredit;\r\n var tdStrTGP = document.createElement(\"td\");\r\n tdStrTGP.textContent = \"Total Grade Point:\";\r\n var tdTGP = document.createElement(\"td\");\r\n tdTGP.textContent = totalGradePoint;\r\n\r\n var tr = document.createElement(\"tr\");\r\n tr.appendChild(tdGPA);\r\n tr.appendChild(tdEmpty);\r\n tr.appendChild(tdStrTC);\r\n tr.appendChild(tdTotalCredit);\r\n tr.appendChild(tdStrTGP);\r\n tr.appendChild(tdTGP);\r\n \r\n tbody.appendChild(tr);\r\n tr.classList.add(\"color\");\r\n \r\n message.innerHTML = \"<p style='color: green'>\" + \"You have a \" + degreeClass + \" in this Semester\" + \"</p>\";\r\n}", "title": "" }, { "docid": "1df4e59fd67045ade152099151dac49f", "score": "0.5804168", "text": "function grade1(mark) {\n \n switch(true){\n case mark<= 100 && mark >= 80:\n console.log('A+');\n break; \n case mark < 80 && mark >= 70:\n console.log('A');\n break;\n case mark < 70 && mark >= 60:\n console.log('A-');\n break;\n case mark < 60 && mark >= 50:\n console.log('B');\n break;\n case mark < 50 && mark >= 40:\n console.log('C');\n break;\n case mark < 40 && mark >= 32:\n console.log('D');\n break;\n case mark < 32 && mark >= 0:\n console.log('F');\n break;\n default:\n console.log('Input the write number')\n\n }\n }", "title": "" }, { "docid": "a328d4ab393de2a6843b2f251b283a4d", "score": "0.58023816", "text": "function gradeScore() {\n\tclearStatusClass(document.body);\n\tnextButton.classList.add(\"hide\");\n questionContainerElement.classList.add(\"hide\");\t\n scoreElement.classList.remove(\"hide\");\n scoreElement.textContent = `Your total score is ${points}.`;\n \n}", "title": "" }, { "docid": "492a9bc5d972fa882fb91166e0d6124d", "score": "0.579827", "text": "function calculateHScoolGPA () {\n var $container = $(this).closest('[data-gpa-hschool=form-wrap]');\n\n //save data in a temporary storage\n var data = {};\n data.grade = [];\n data.course_types = [];\n\n var $courses = $container.find('[data-gpa-hschool=courses-wrap]');\n\n $('[data-gpa-hschool=fields-row]', $courses).each(function(i, elem){\n data.grade[i] = +$('[data-gpa-hschool=grade]', this).val();\n data.course_types[i] = +$('[data-gpa-hschool=course-types]', this).val();\n });\n\n //calculating\n var count = data.grade.length,\n total = 0,\n total_courses = 0,\n gpa_result = 0;\n\n while (count){\n count--;\n if (!data.grade[count]) continue;\n total += data.grade[count]+data.course_types[count];\n total_courses += 1;\n }\n gpa_result = Math.round(parseFloat(total/total_courses) * 100) / 100 || 0;\n gpa_result = gpa_result.toFixed(2)\n\n //show result\n $('[data-gpa-hschool=result]', $container).text(gpa_result);\n }", "title": "" }, { "docid": "1fdf58f98999ecdf3a291d1827e9936e", "score": "0.5759009", "text": "function markQuiz() {\r\n // Initialize Score\r\n let score = 0;\r\n\r\n // Mark questions\r\n score += markQuestion(1, \"canada\")\r\n score += markQuestion(2, \"cardinal\")\r\n score += markQuestion(3, \"tai lung\")\r\n score += markQuestion(4, \"pickleball\")\r\n\r\n // Display Quiz Results\r\n document.getElementById('quiz-score').innerHTML = score;\r\n document.getElementById('quiz-percent').innerHTML = Math.round(score / 4 * 100);\r\n\r\n\r\n}", "title": "" }, { "docid": "7f06f8b3c71968e5291496fd87877b02", "score": "0.57496804", "text": "function checknumber4() {\n let score = document.getElementById(\"Num4\").value ;\n \n \n if ( score >= 80 && score <= 100) {\n document.getElementById(\"ChNo4\").innerHTML = \" A grade\" ; }\n else if ( score >= 60 && score < 80 ) {\n document.getElementById(\"ChNo4\").innerHTML = \"B grade\" ; }\n else if ( score >= 40 && score < 60 ) {\n document.getElementById(\"ChNo4\").innerHTML = \"C grade\" ;\n }\n else if ( score >= 30 && score < 40 ) {\n document.getElementById(\"ChNo4\").innerHTML = \"D grade\" ;\n }\n else if (score < 30 ) {\n document.getElementById(\"ChNo4\").innerHTML = \"F grade\" ;\n }\n else {\n document.getElementById(\"ChNo4\").innerHTML = \"Please enter a score less then 100 \" ; \n }\n \n\n \n \n}", "title": "" }, { "docid": "f07a5c11cd43edcb75030e81aa40140a", "score": "0.57394165", "text": "function launchQuiz(){\n\n for (var i = 0; i < questAboutMe.length; i++) {\n\n if (i === 5) { // Adjust questioning for Question #6\n\n alert('Time for some bonus questions!! Can you guess the right answer?');\n\n var numOfGuesses = 5;\n\n while (numOfGuesses > 0) {\n var userNumResp = prompt(questAboutMe[i] + ' (It\\'s between 1 and 20.) You have ' + numOfGuesses + ' out of 5 guesses left.');\n console.log('This is the user\\'s input: ' + userNumResp);\n userNumResp = parseInt(userNumResp, 10); // Now user input is an integer\n console.log('This is the user\\'s input as an integer: ' + userNumResp);\n\n if (userNumResp === numGuitars){\n alert('Nice guess! You are correct!');\n score++;\n isCorrect = true;\n console.log('The user\\'s score so far: Score = ' + score);\n break;\n } else if (userNumResp > numGuitars){\n alert('Your guess was too high.');\n numOfGuesses--;\n } else {\n alert('Your guess was too low.');\n numOfGuesses--;\n }\n }\n\n if (!isCorrect){ //If we go through all of our guesses this displays on alert before moving to next question.\n alert('Nice try but I have ' + numGuitars + '.');\n }\n\n } else if (i === 6) { // adjusting for question #7\n\n alert('Here\\'s another bonus question!');\n\n numOfGuesses = 6;\n\n while (numOfGuesses > 0) {\n userResp = prompt(questAboutMe[i] + ' There\\'s 7 of them. You have ' + numOfGuesses + ' out of 6 guesses left.');\n console.log('This is the user\\'s input: ' + userNumResp);\n shrtUserResp = userResp.toLowerCase();\n console.log('This is the user\\'s response lowercased: ' + shrtUserResp);\n\n for (var j = 0; j < statesVisited.length; j++){\n if (shrtUserResp === statesVisited[j]) {\n isCorrect = true;\n break;\n } else {\n isCorrect = false;\n }\n }\n\n if (isCorrect){\n alert('Nice guess! You are correct! Here were all of the possible answers:' + statesVisitedFormat.toString() + '.' );\n score++;\n console.log('The user\\'s score so far: Score = ' + score);\n break;\n } else {\n numOfGuesses--;\n }\n }\n\n if (!isCorrect){\n alert('At least you tried! Here were all the possible answers you could have put:' + statesVisitedFormat.toString() + '.');\n }\n\n }\n else {\n\n userResp = prompt(questAboutMe[i]);\n console.log('This is the user\\'s response: ' + userResp); //Displaying answer given in console.\n\n if (userResp) { // This first if else is used to handel the \\'null\\' or \\'undefined\\'. If the user enters something userResp is equal to that but if box is empty or they cancel userResp = 'canceled'.\n\n shrtUserResp = userResp.substring(0, 1).toLowerCase();\n console.log('This is the user\\'s shortened response: ' + shrtUserResp); // Displaying shortened answer to be compared.\n } else {\n shrtUserResp = 'c'; // If the user cancels or doesn't type antyhing we set shrtUserResp to 'c' for 'canceled'.\n }\n\n if (shrtUserResp === correctAnsw[i]) { // This if else if statement is used to go through questions, gather response, and display correct or incorrect messages.\n alert(corrResp[i]);\n score++; // Adding correct response to the user's score\n console.log('The user\\'s score so far: Score = ' + score); // Displaying current score in the console\n } else if (shrtUserResp === incorrectAnsw[i]) {\n alert(incorrResp[i]); // Firing incorrect response if user is wrong.\n console.log('The user\\'s score so far: Score = ' + score); // Not adding to score but still displaying their current score even if they get it wrong.\n } else {\n alert('I\\'m not sure what you put but you didn\\'t say \"yes\" or \"no\".');\n console.log('The user\\'s score so far: Score = ' + score);\n }\n }\n }\n }", "title": "" }, { "docid": "451e6450042ab4ce812d0698db8cfaa8", "score": "0.57347304", "text": "function end () {\r\n\tif (correct >= 4 && questions == 5) {\r\n\t\talert(\"Congratulations!! You scored \" + correct +\" out of 5. Maybe get a new hobby or read a book.\");\r\n\t}\r\n\telse if (correct <= 3 && questions == 5) {\r\n\t\talert(\"Congratulations!! You scored \" + correct + \" out of 5.\");\r\n\t}\r\n}", "title": "" }, { "docid": "bd448633737447c032645463367c109e", "score": "0.57304806", "text": "function calcGpa() {\n var numGrades = 0.0;\n var curr = 0.0;\n for (var row of grades) {\n for (var g of row) {\n if (g !== null) {\n if (g.val != -1.0) {\n numGrades += 1.0;\n curr += g.val;\n }\n }\n }\n }\n var gpa = (curr / numGrades).toFixed(3);\n if (isNaN(gpa)) {\n gpa = \"N/A\";\n }\n text(\"GPA: \".concat(gpa), 700, 270);\n}", "title": "" }, { "docid": "d2f840b026baa7d6845378fc381dee16", "score": "0.57301813", "text": "function question6() {\n\n var toManyTries = 5;\n // loop the question and answer testing, interate and say how many tries they have left or exit if they are correct\n var i = 1; // often we would itterate starting with 0, but I did it different here. \n\n while (i < toManyTries) {\n var answer6 = prompt('How many years have I lived in my current neighborhood?');\n // [attempt ' + i + ' out of ' totalTries + '] ');\n console.log('user answered ' + answer6 + ' on attempt ' + i + ' for Q6');\n // test if they got it right on this try, or tell them if they are under or over. \n if (answer6 === '6') {\n correctCount++;\n alert('You are correct! You figured that out in ' + i + ' attempts');\n console.log('user is correct on attempt ' + i + '!');\n i = toManyTries;\n } else if (answer6 === '' || answer6 === ' ') { // what about multi-space? Also, might be better to use switch & combine these tests with the wrong input response below\n alert('Hey, your forgot to answer!');\n console.log('user gave a blank response. We will not count this as an attempt');\n } else if (answer6 > 6) {\n alert('Oh, it is less than that.');\n console.log('user guess is too high on attempt ' + i + '. ');\n i++;\n } else if (answer6 < 6) {\n alert('Oh it is more than that. ');\n console.log('user guess is too low on attempt ' + i + '. ');\n i++;\n } else { // might be better to use switch & combine these with the '' and ' ' responses tested above. \n alert('Hey, your answer was not in the right format. Try giving an integer');\n console.log('user did not give a valid answer. We will not count this as one of their attempts');\n }\n } // end while loop for user attempts\n} // End of function for question 6", "title": "" }, { "docid": "534527065b38e61dbcd72fe463071ad6", "score": "0.5721241", "text": "function calculateGrade (userScore, gradeRatio) {\n var studentGrade;\n var percentage = userScore * gradeRatio;\n switch(true) {\n case percentage > 0 && percentage < 59:\n studentGrade = 'F';\n break;\n case percentage > 60 && percentage < 69:\n studentGrade = 'D';\n break;\n case percentage > 70 && percentage < 79:\n studentGrade = 'C';\n break;\n case percentage > 80 && percentage < 89:\n studentGrade = 'B';\n break;\n case percentage > 90 && percentage <= 100:\n studentGrade = 'A';\n break;\n }\n console.log(`Grade is ${studentGrade}`)\n}", "title": "" }, { "docid": "7bf6dc58924e06517c58557341ec06d2", "score": "0.5704071", "text": "function grade(x){\n\tswitch (x) {\n case 10:\n return `Brilliant`;\n case 9:\n return `Excellent`;\n case 8:\n return `Almost excellent`;\n case 7:\n return `Very good`;\n case 6:\n return `Good`;\n case 5:\n return `Almost good`;\n case 4:\n case 3:\n return `Satisfactory`;\n case 2:\n case 1:\n return `Unsatisfactory`;\n default:\n return `error`;\n }}", "title": "" }, { "docid": "85a0f172cc21b324b135f688ed8ce9d2", "score": "0.568683", "text": "function updateGrades(){\r\n // Iterate through all of the headers on the page\r\n for (var i = 0; i < headers.length; i++) {\r\n // Set the variable type to the header, simply set the type variable to the header name\r\n type = headers[i]\r\n // Intitalize a bunch of variables that will be useful for this process, set colOne to 0, this col will be points earned\r\n var colOne = 0,\r\n // Set col2 to 0, this col represents the points possible\r\n colTwo = 0\r\n // A variable set to a boolean, will decide if we will need to calculate the percent later\r\n doPercent = true\r\n // Bootstrap button class, set it to success, we may change it later, in bootstrap, the success class is green, so buttons are set to green unless changed\r\n btn = 'success'\r\n // Since we set the button to green, we also set the grade to an A since an A corresponds with the greeen button in our app\r\n grade = 'A'\r\n // Iterate through all of the classes that have the \"types\", what this is doing is it is iterating through all of the dropdowns and looking for this special keyword we put in\r\n $('.types').each(function(index, obj) {\r\n // If the text is the same as the header, meaning that if it is in the same grade category, so what we are doing here is that this nested loop is going through the grade body and then looking for a header that matches what the outer loop is currently on, so its looking for grades that are in the current category\r\n if ($(this).text() == type){\r\n // Add the float of the points earned for that assignment to the colOne variable\r\n colOne += parseFloat($(this).closest('tr').find('.one').val())\r\n // And add the float of the points possible to the coltwo variable\r\n colTwo += parseFloat($(this).closest('tr').find('.two').val())\r\n }\r\n });\r\n // Now we change a lot of variables, I wrote this like this because this peice of code is very simple and it wastes space writing it \"neatly\" so I just crammed it into one line\r\n // Anyway, what this line does is it sets the variables for the grade and the button color variables according to the percent the grade would be, keep in mind, we first check to see if colTwo equals 0 to aviod divison by 0 errors \r\n if (colTwo == 0){doPercent = false}else if (colOne/colTwo >= .795 && colOne/colTwo < .895){btn = 'info', grade = 'B'}else if (colOne/colTwo >= .695 && colOne/colTwo < .795){btn = 'primary', grade = 'C'}else if (colOne/colTwo >= .595 && colOne/colTwo < .695){btn = 'warning', grade = 'D'}else if (colOne/colTwo < .595){btn = 'danger', grade = 'E'}\r\n // Just a quick ternary operator to condense simple code into fewer lines, what this code does is, simply put assign percent to the percent of the grade, if doPercent is false, meaning if colTwo equals 0, we assign it 100%\r\n doPercent?percent = String((colOne/colTwo*100).toFixed(1))+'%':percent = '100%'\r\n // Now, iterate through all the headers in the html\r\n $('.header').each(function(index, obj) {\r\n // If it matches the current header, \r\n if ($(this).text() == type){\r\n // Set the grade and the percent to what they should be, also add the proper button class, which is simply the color of the button \r\n $(this).closest('tr').find('button').removeClass().text(grade+' - '+percent).addClass('btn btn-'+btn+' gradeLetter')\r\n // Also, change the number in the \"points\" column to match the actual grade\r\n $(this).closest('tr').find('.headerInfo').text(String(colOne)+'/'+String(colTwo))\r\n }\r\n }); \r\n }\r\n // Call the function that updates the total grade, which is the overall class grade in the top right corner\r\n updateTotalGrade()\r\n}", "title": "" }, { "docid": "34abf9781c6192b769567296179f0fac", "score": "0.5678552", "text": "function main( subInputId, subGradeId ){\n\n // get whatever value that's in the text box\n value = getBoxValue(subInputId);\n\n // assigning total units\n totalUnit = getTotalUnit(subAbbr);\n\n\n // whenever there is an insertion\n document.getElementById(subInputId).oninput = function( ){\n\n // compare the value extracted from the text box with the old value\n tmpValue = getBoxValue(subInputId);\n value = compareValue(value, tmpValue);\n console.log( \"new value: \" + value); // testing ( test print )\n\n\n // validate new value ( letters, alphabets, punctuations, symbols\n // not allowed )\n validateValue( value );\n console.log( \"grade is : \" + subGrade ); // testing ( test print )\n\n\n\n // set label based on the value of flag\n // when flag is false, there is a error message\n // when flag is true, there is no error message\n setGradeLabel( subGradeId ) ;\n pointScored( subAbbr );\n }\n}", "title": "" }, { "docid": "4a83e30ae495253a487e206c6d70035d", "score": "0.5676561", "text": "function finalStory(choices){\n if(userScore === 6) {\n pEl.innerHTML = localStorage.badEnd;\n } else if(userScore === 3) {\n pEl.innerHTML = localStorage.goodEnd;\n } else {\n pEl.innerHTML = localStorage.neutEnd;\n }\n console.log(userScore);\n console.log('Final Story is reached');\n}", "title": "" }, { "docid": "8a1d81c7f9043ae336937bc11d8eb34e", "score": "0.5674699", "text": "function Rd1() {\r\n\r\n\r\n\r\nvar answer = document.getElementById(\"user_input\").value\r\n\r\n\r\n if (answer == \"USA\" ) {\r\n document.getElementById(\"question\").innerHTML= \"Congrats! You have chosen to be a citizen of the United States. 99% of the population here completes primary school, thanks to an abundance of resources. We assume that you will too - move on to secondary school. Likewise, 91% of the population here completes secondary school. Congratulations, you've been sufficiently educated!\";\r\n document.getElementById(\"btnSubmit\").style.visibility = 'hidden';\r\n document.getElementById(\"user_input\").style.visibility = 'hidden';\r\n }\r\n else if (answer == \"South Sudan\"){\r\n document.getElementById(\"question\").innerHTML= \"Congrats! You have chosen to be a citizen of South Sudan! Would you like to attend school, yes or no?\";\r\n document.getElementById(\"btnSubmit\").style.visibility = 'hidden';\r\n document.getElementById(\"SS2\").style.visibility = 'visible';\r\n }\r\n\r\n else if (answer == \"China\"){\r\n document.getElementById(\"question\").innerHTML= \"Congrats! You have chosen to be a citizen of China. You will attend school, as almost 100% of the population of China does. Will you complete primary school? yes or no\"\r\n document.getElementById(\"btnSubmit\").style.visibility = 'hidden';\r\n document.getElementById(\"C2\").style.visibility = 'visible';\r\n }\r\n\r\n else if (answer == \"Afghanistan\"){\r\n document.getElementById(\"question\").innerHTML= \"Congrats! You have chosen to be a citizen of Afghanistan. Would you like to attend school? yes or no\"\r\n document.getElementById(\"btnSubmit\").style.visibility = 'hidden';\r\n document.getElementById(\"A2\").style.visibility = 'visible';\r\n\r\n }\r\n\r\n else if (answer == \"Guatemala\"){\r\n document.getElementById(\"question\").innerHTML= \"Congrats! You have chosen to be a citizen of Guatemala. Would you like to attend school? yes or no\"\r\n document.getElementById(\"btnSubmit\").style.visibility = 'hidden';\r\n document.getElementById(\"G2\").style.visibility = 'visible';\r\n\r\n }\r\n\r\n else if (answer == \"UK\"){\r\n document.getElementById(\"question\").innerHTML= \"Congrats! You have chosen to be a citizen of the UK. 100% of the population here completes primary school, thanks to an abundance of resources. We assume that you will too - move on to secondary school. Likewise, 92% of the population here completes secondary school. Congratulations, you've been sufficiently educated!\";\r\n document.getElementById(\"btnSubmit\").style.visibility = 'hidden';\r\n document.getElementById(\"user_input\").style.visibility = 'hidden';\r\n }\r\n}", "title": "" }, { "docid": "18c847fe84d130b05a72d0cb55905427", "score": "0.56735855", "text": "function grade1(){\n\tvar answer = document.getElementById(\"question1\").value;\n\tif(answer == \"91\" || answer == \"ninety one\"){\n\t\tcorrect++;\n\t}\n}", "title": "" }, { "docid": "410e660db9d06ce4255168425b485a9a", "score": "0.5660305", "text": "function QScore() {\r\n //Define empty array totalScores\r\n totalScores = new Array();\r\n\r\n //Define category sum for bold, empathic and self discipline\r\n var totalCategoryBoldCreative = 0;\r\n var totalCategorySelfDisciplined = 0;\r\n var totalCategoryEmpathic = 0;\r\n\r\n //Get all the available keys\r\n var keys = Object.keys($p.questionnaire.customFields);\r\n for (idx in keys) {\r\n switch (keys[idx]) {\r\n case 'workspace_is':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n\r\n break;\r\n case 'b)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n }\r\n break;\r\n\r\n case 'group_idea':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'group_outing':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'how_shopping':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'handle_restaurant':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'decision_coworkers':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'project_move':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n }\r\n break;\r\n\r\n case 'callcenter_reaction':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n\r\n case 'd)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'employee_response':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n }\r\n break;\r\n\r\n case 'navigation_days':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n }\r\n break;\r\n\r\n case 'dating_dislike':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n }\r\n break;\r\n\r\n case 'prefer_holiday':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'work_comfort':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n }\r\n break;\r\n\r\n case 'disagree_refdecision':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n }\r\n break;\r\n\r\n case 'sit_office':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'decide_twocars':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'difficult_decision':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'track_finances':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'team_crisis':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'furniture_store':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategoryBoldCreative += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'c)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryBoldCreative += 7;\r\n break;\r\n }\r\n break;\r\n\r\n case 'meet_new_people':\r\n switch(($p.questionnaire.customFields[keys[idx]].substr(0, 2))) {\r\n case 'a)':\r\n totalCategorySelfDisciplined += 4;\r\n break;\r\n\r\n case 'b)':\r\n totalCategorySelfDisciplined += 7;\r\n break;\r\n\r\n case 'c)':\r\n totalCategoryEmpathic += 4;\r\n break;\r\n\r\n case 'd)':\r\n totalCategoryEmpathic += 7;\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n totalScores.push(totalCategoryBoldCreative, totalCategorySelfDisciplined, totalCategoryEmpathic);\r\n\r\n return totalScores;\r\n}", "title": "" }, { "docid": "9ec98245b2ab059977c711264cb687fc", "score": "0.5660087", "text": "function updateTotalGrade(){\r\n // Define two variables, gradeVal and totalHead, they will be helpful in calculating the total grade in the class\r\n var gradeVal = 0,\r\n // Declare totalHead which will represent the weight of all the items in the class\r\n totalHead = 0\r\n // Iterate through all of the grade headers, the purpose of this loop is to get the total weight of all the categories\r\n $('.header').each(function(index, obj) {\r\n // As long as the grade isn't 0/0, we will do stuff with it\r\n if($(this).closest('tr').find('.headerInfo').text() != '0/0'){\r\n // This adds the weight of that assignment to the variable to keep track of it, the reason that we do this is because, for example, if you have no grades in the graded (90%) category and a 5/5 on a homework (10%) category, you wouldn't have a 10% in the class, you would have a 100%\r\n totalHead += parseInt($(this).text().slice($(this).text().indexOf('(')+1,-1))\r\n }\r\n });\r\n // Iterate through the headers once more, this time, we are going to do some more calculations and then we are done \r\n $('.header').each(function(index, obj) {\r\n // Declare some more variables that will help us, wieght is the weight of the category\r\n var weight = $(this).text().slice($(this).text().indexOf('(')+1,-1),\r\n // Val is simply the points earned/points possible\r\n val = eval($(this).closest('tr').find('.headerInfo').text())\r\n // Quick check to see if the val is not a number, incase we are doing divison by 0 again\r\n if (isNaN(val)){val = 0}\r\n // Finally, add points according to weight to the total grade\r\n gradeVal += (weight*100/totalHead)*val\r\n }); \r\n // Check if gradeVal is not a number, this would occur if all the grades are 0/0 meaning that totalHead remains as 0, causing divison by 0, if this occurs, just set the percentage to 100\r\n if (isNaN(gradeVal)){gradeVal = 100}\r\n // Create new helper varibales, set grades to A\r\n var grade = 'A',\r\n // Set the button value to green/success again, this is the same process that we did before\r\n btn = 'success'\r\n // So again, we have this one liner which determines the grade and color of the button, it is only slightly different since we are sure that there is no diviosn by 0\r\n if (gradeVal >= 79.5 && gradeVal < 89.5){btn = 'info', grade = 'B'}else if (gradeVal >= 69.5 && gradeVal < 79.5){btn = 'primary', grade = 'C'}else if (gradeVal >= 59.5 && gradeVal < 69.5){btn = 'warning', grade = 'D'}else if (gradeVal < 59.5){btn = 'danger', grade = 'E'}\r\n // Now we remove all the formatting classes on the button and then we make it a large button with the color and the text is the grade as well as the percent\r\n $('.btn-lg').removeClass().addClass('btn btn-lg btn-'+btn).text(grade+' - '+String(gradeVal.toFixed(1))+'%')\r\n}", "title": "" }, { "docid": "956871e52afc1286e6950ba16bd6fbd1", "score": "0.5645679", "text": "function testGrader(score, possible) {\n let percent = score / possible;\n let letterGrade = 'F';\n if (percent > .89) letterGrade = 'A';\n else if (percent > .79) letterGrade = 'B';\n else if (percent > .69) letterGrade = 'C';\n else if (percent > .59) letterGrade = 'D';\n return letterGrade;\n}", "title": "" }, { "docid": "fb9b873d4ab9c21f3a923945fe02717d", "score": "0.563194", "text": "function createNewGradeAnswer(assignment, grade, subWeight) {\n\n let categoryWeight = document.getElementById(\"categoryWeight \" + assignment).value;\n\n let newAnswerLabel = document.createElement(\"B\");\n let assignmentName = document.getElementById(\"categoryName \" + assignment).value;\n newAnswerLabel.innerHTML = \"Current \" + assignmentName + \" Grade: \" + grade + \" points out of \" + categoryWeight;\n\n document.getElementById(\"subAnswerDiv\").appendChild(document.createElement(\"BR\"));\n document.getElementById(\"subAnswerDiv\").appendChild(newAnswerLabel);\n}", "title": "" }, { "docid": "cb15bf39dd07f179792f7f37788be8ff", "score": "0.5631805", "text": "function determineFinalFeedback(score) {\n if (score === 10) {\n $('.final-score').html(finalFeedback[0])\n $('.correct-count').html(score)\n }\n else if (score < 10 && score >= 6) {\n $('.final-score').html(finalFeedback[1])\n $('.correct-count').html(score)\n }\n else {\n $('.final-score').html(finalFeedback[2])\n $('.correct-count').html(score)\n }\n}", "title": "" }, { "docid": "90c442ad3907b2d3b03e0ad0bc9eb446", "score": "0.56298584", "text": "function calculateFinalGrade(examAverage, exerciseAverage) {\n var grade = Math.round(examAverage * examWeight + exerciseAverage * exerciseWeight);\n var letter = findLetterGrade(grade);\n return String(grade) + ' ' + letter;\n}", "title": "" }, { "docid": "999a3d9158cf0dc9bb14dc87d2ea92fe", "score": "0.562747", "text": "function calculateGrade(marks){\n \n const avg = calculateAverage(marks);\n\n if(avg < 60) return \"F\";\n if(avg < 70) return \"D\";\n if(avg < 80) return \"C\";\n if(avg < 89) return \"B\";\n return \"A\"\n\n}", "title": "" }, { "docid": "82fddca38ae12375b3751e49abafd393", "score": "0.5621391", "text": "function displayFinalScore(type){\r\n if(type == 0){\r\n $('.end-section1').fadeIn(1000);\r\n $('.end-section1 h4').text(`Your Score is: ${score1}/${questionsCount1}`);\r\n $('.correct .count' ).text(score1);\r\n $('.wrong .count').text(questionsCount1 - score1);\r\n resetQuiz(0);\r\n }\r\n else{\r\n $('.end-section2').fadeIn(1000);\r\n $('.end-section2 h4').text(`Your Score is: ${score2}/${questionsCount2}`);\r\n $('.correct .count' ).text(score2);\r\n $('.wrong .count').text(questionsCount2 - score2);\r\n resetQuiz(1);\r\n }\r\n}", "title": "" }, { "docid": "1a901be5f79aa2b41f6854365b465570", "score": "0.5617604", "text": "function moreAccurateGrades(score){\n var mod = \"\";\n if(score % 10 < 3){\n mod = \"-\";\n }\n else if(score % 10 > 7){\n mod = \"+\";\n }\n\n if(score < 60){\n console.log(\"Score: \" + score + \". Grade: F\")\n }\n else if(score < 70){\n console.log(\"Score: \" + score + \". Grade: D\" + mod)\n }\n else if(score < 80){\n console.log(\"Score: \" + score + \". Grade: C\" + mod)\n }\n else if(score < 90){\n console.log(\"Score: \" + score + \". Grade: B\" + mod)\n }\n else{\n console.log(\"Score: \" + score + \". Grade: A\")\n }\n}", "title": "" }, { "docid": "717ed1fdd4e645e6269b477275abc46d", "score": "0.56162065", "text": "function start(){\r\n location.href = \"result.html\"\r\n var tr = document.getElementById(\"tr\");\r\n \r\n// Get data\r\nconst q1 =document.forms[\"quiz\"][\"q1\"].value;\r\nconst q2 =document.forms[\"quiz\"][\"q2\"].value;\r\nconst q3 =document.forms[\"quiz\"][\"q3\"].value;\r\n// var FinalAnswer =document.getElementsByClassName(\"FinalAns\");\r\n// console.log(FinalAnswer)\r\nfor( var i=1;i<=total;i++){\r\n if(eval('q' +i)==null || eval('q'+i)==\"\")\r\n {\r\n alert(\"You have missed question\" + i)\r\n \r\n \r\n }\r\n}\r\nconst ans =['d','b','d'];\r\n\r\nfor( var i=1;i<=total;i++){\r\n if(eval('q'+i)==ans[i-1])\r\n {\r\n score++;\r\n }\r\n}\r\n alert(\"Your total score is:\" + score)\r\ntr.innerHTML = score.value;\r\nconsole.log(score)\r\nreturn false;\r\n}", "title": "" }, { "docid": "cb73356aaca60ca35091b65567b4195e", "score": "0.5612685", "text": "function assignGrade(score) {\n switch (true) {\n case score >= 95:\n return \"A\";\n break;\n case score > 85 && score <= 90:\n return \"B\";\n break;\n case score > 70 && score <= 75:\n return \"C\";\n break;\n case score > 64 && score <= 67:\n return \"D\";\n break;\n default:\n return \"F\";\n break;\n }\n for (let i = 80; <= 100; i++){\n console.log(`For a score of ${ i } your grade is + ${assignGrade(i)}`);\n }\n}", "title": "" }, { "docid": "a6105a2ac7cd854d894d064c296cc41b", "score": "0.56064826", "text": "function calcScores(formResponse) {\n //Declare variables\n var gritScore = 0, asqScore = 0;\n var finalGritScore = 0.0, finalAsqScore = 0.0;\n var returnObject;\n \n //----------------------------------------------//\n // This section will calculate the Grit score //\n //----------------------------------------------//\n \n //Loop through 12 grit assessment items (3 text fields in beginning (id, first name and last name) are skipped over) \n for (var i = 3; i < 15; i++) {\n var itemResponse = formResponse[i];\n if (i==3 || i==6 || i==8 || i==11 || i==12 || i==14) {\n switch (itemResponse.getResponse()) {\n case 'Very much like me':\n gritScore += 5;\n break;\n case 'Mostly like me':\n gritScore += 4;\n break;\n case 'Somewhat like me':\n gritScore += 3;\n break;\n case 'Not much like me':\n gritScore += 2;\n break;\n case 'Not like me at all':\n gritScore += 1;\n break;\n }\n } else if (i==4 || i==5 || i==7 || i==9 || i==10 || i==13) {\n switch (itemResponse.getResponse()) {\n case 'Very much like me':\n gritScore += 1;\n break;\n case 'Mostly like me':\n gritScore += 2;\n break;\n case 'Somewhat like me':\n gritScore += 3;\n break;\n case 'Not much like me':\n gritScore += 4;\n break;\n case 'Not like me at all':\n gritScore += 5;\n break;\n }\n }\n }\n \n //Return final grit score\n finalGritScore = gritScore / 12;\n \n //---------------------------------------------//\n // This section will calculate the ASQ score //\n //---------------------------------------------//\n \n //Loop through items 15-38 for the CoNeg questions\n for (var i = 15; i < 39; i++) {\n var itemResponse = formResponse[i];\n if (itemResponse.getItem().getType() == 'SCALE') {\n asqScore += parseInt(itemResponse.getResponse());\n }\n }\n \n //Return final ASQ score\n finalAsqScore = asqScore / 6;\n \n //--------------------------------------------------------------------------------------------------//\n // This section creates a JSON object to hold the scores and essay questions for sending to Taleo //\n //--------------------------------------------------------------------------------------------------//\n \n return returnObject = JSON.stringify({ \"taleoId\" : formResponse[0].getResponse(), \"grit\" : finalGritScore.toFixed(2), \"asq\" : finalAsqScore.toFixed(2), \"essays\" : { \"essay1\" : escapeSpecialChars(formResponse[formResponse.length-3].getResponse()), \"essay2\" : escapeSpecialChars(formResponse[formResponse.length-2].getResponse()), \"essay3\" : escapeSpecialChars(formResponse[formResponse.length-1].getResponse()) } });\n}", "title": "" }, { "docid": "672bee95f3e8071e44d3aad428a84b63", "score": "0.56064475", "text": "function endPractice()\r\n{\r\n\t// Reset bank berries and score\r\n\ttotalPoints = 0;\r\n\r\n\tif (conditionParam == 2)\r\n\t{\r\n\t\t$(\"#inc_shock_pos\").show();\r\n\t\t$(\"#inc_shock_pos\").click(() => {\r\n\t\t\t$(\"#inc_shock_pos\").hide();\r\n\t\t});\r\n\t\t//alert(\"INCOME SHOCK\");\r\n\t\tberriesPerLevel = 15;\r\n\t\tinitialBankBerries = 150;\r\n\t\tberryBankPenalty = -1;\r\n\t}\r\n\telse if (conditionParam == 3)\r\n\t{\r\n\t\t$(\"#inc_shock_neg\").show();\r\n\t\t$(\"#inc_shock_neg\").click(() => {\r\n\t\t\t$(\"#inc_shock_neg\").hide();\r\n\t\t});\r\n\t\t//alert(\"INCOME SHOCK\");\r\n\t\tberriesPerLevel = 3;\r\n\t\tinitialBankBerries = 30;\r\n\t\tberryBankPenalty = -1;\r\n\t}\r\n\r\n\tbankBerries = initialBankBerries;\r\n\t// levelNumber = 0; // reset level number\r\n\r\n\tpracticing = false; // disable practice mode\r\n\r\n\tnextLevel(); // load next level\r\n\r\n\t$(\"#game, .loading\").show(); // show game text and loading\r\n}", "title": "" }, { "docid": "f8f0fa2bcceb55ca56dc6187194e0381", "score": "0.5580231", "text": "function assignGrade(score){\n if(score < 50 ){\n return \"F\";\n }else if(score >= 50 && score < 60){\n return \"D\";\n }else if(score >= 60 && score < 70){\n return \"C\";\n }else if(score >= 70 && score < 80){\n return \"B\";\n }else if(score >= 90 && score <= 100){\n return \"A\";\n }\n}", "title": "" }, { "docid": "3215c2318f7422a1ed37f3e111281a44", "score": "0.5578037", "text": "function calcScore() {\n if (userScore > 139) {\n currQuest.textContent = \"CONFIRMED REPLICANT\";\n currQuest.style.color = \"red\";\n } else if (userScore > 99 && userScore < 140) {\n currQuest.textContent = \"Possible Replicant. Surveillance authorized.\";\n currQuest.style.color = \"honeydew\";\n } else if (userScore <= 50) {\n currQuest.textContent = \"Confirmed Human.\";\n currQuest.style.color = \"#0cb906\";\n } else {\n currQuest.textContent = \"Probable Human. Await more data.\";\n } \n}", "title": "" }, { "docid": "bcc191bd070ad843c122eae1a024d7c9", "score": "0.5565508", "text": "function evaluationReport() {\n \"use strict\";\n var i,\n filteredDataIIDArray = [],\n n,\n earned = 0,\n totalPointsPossible,\n score = \"\",\n reportTable,\n code = getCode()[0];\n\n\n\n $('.score').each(function(){\n\t earned=earned*1+1*$(this).val();\n });\n totalPointsPossible = $('.rubric_question').length*4;\n score = Math.round(earned / totalPointsPossible * 100);\n $(\"#reportScore\").html(\"<table style='text-align: center;' width='100%'><tr>\" +\n \"<th>Points Earned</th><th>Total Points</th><th>Score</th></tr>\" +\n \"<tr><td><span id='earnedPoints'>\" + earned + \"</span></td><td>\" + totalPointsPossible + \"</td><td>\" +\n \"<span id='scoreByPercent'>\" + score + \"</span>%</td></tr>\" +\n \"</table>\");\n return totalPointsPossible;\n}", "title": "" }, { "docid": "5d2ea3d8759fa423e824a30f252d726e", "score": "0.5558494", "text": "function endQuiz(finalScore) {\r\n displayPage('#result-screen');\r\n $('#final-score').text(finalScore);\r\n //validates the user's initial input, adds them to the local storage, then\r\n //renders the highscore table\r\n $('#btn-initials').click(function () {\r\n var userInitials = $('#user-initials').val();\r\n if (!userInitials || userInitials.length > 4) {\r\n alert('Please enter up to four letters as your initials.');\r\n } else {\r\n //add the number of keys in localStorage to the end of the user-entered\r\n //initials to allow for multiple entries with the same initials\r\n var scoreNumber = Object.keys(localStorage).length;\r\n localStorage.setItem(userInitials + ':' + scoreNumber, finalScore);\r\n highscoreTable();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "b52276820235ae1e4c3a450493964933", "score": "0.55550784", "text": "function gradeGenerator(grade) {\n if (grade < 60)\n return \"F\";\n else if (grade >= 60 && grade < 70)\n return \"D\";\n else if (grade >= 70 && grade < 80)\n return \"C\";\n else if (grade >= 80 && grade < 90)\n return \"B\";\n else\n return \"A\";\n}", "title": "" } ]
80df5c5b32bb72bd70798af0ab3ae57a
function for cloning info block into form
[ { "docid": "5a556e1d7ef9ee109a75b4372ef3ba64", "score": "0.0", "text": "$doCheck() {\n let form = false;\n if (this.form.children[1].children[1] !== undefined) {\n if (this.form.children[1].children[1].children[0] !== undefined) {\n form = this.form.children[1].children[1].children[0];\n }\n }\n else if (this.form.children[1].children[0] != undefined) {\n form = this.form.children[1].children[0].children[0];\n }\n if (form) {\n if (form.children.length == 2) {\n //remove bracket info (=\"see below\") from request button:\n form.children[1].lastChild.firstChild.lastChild.innerHTML = form.children[1].lastChild.firstChild.lastChild.innerHTML.replace(/.\\(.*\\)/gi, '');\n //clone an insert info-block:\n\n let elem = document.createElement('span');\n elem.innerHTML = `\n<div class=\"courier-info bar alert-bar\">\n <div class=\"info-text\">${this.feesInfo}</div>\n <div class=\"fees-link\">\n <a ng-href=\"${this.feesUrl}\" target=\"_blank\">${this.feesLinkText}</a>\n </div>\n</div>`;\n form.insertBefore(elem, form.children[1]);\n }\n }\n }", "title": "" } ]
[ { "docid": "1b8d911f6b876c4a15ee359d774057fd", "score": "0.64843255", "text": "function createFormInfo() {\n createPizzaBasePart();\n createIngredientPart();\n }", "title": "" }, { "docid": "901ebacbb54753b2b157f5c84a084b4a", "score": "0.6451408", "text": "function clonePlace() {\r\n phlog('Cloning info...');\r\n var UpdateObject = require(\"Waze/Action/UpdateObject\");\r\n if (cloneMaster !== null && cloneMaster.hasOwnProperty('url')) {\r\n item = W.selectionManager.selectedItems[0].model;\r\n var cloneItems = {};\r\n var updateItem = false;\r\n if ( $(\"#WMEPH_CPhn\").prop('checked') ) {\r\n cloneItems.houseNumber = cloneMaster.houseNumber;\r\n updateItem = true;\r\n }\r\n if ( $(\"#WMEPH_CPurl\").prop('checked') ) {\r\n cloneItems.url = cloneMaster.url;\r\n updateItem = true;\r\n }\r\n if ( $(\"#WMEPH_CPph\").prop('checked') ) {\r\n cloneItems.phone = cloneMaster.phone;\r\n updateItem = true;\r\n }\r\n if ( $(\"#WMEPH_CPdesc\").prop('checked') ) {\r\n cloneItems.description = cloneMaster.description;\r\n updateItem = true;\r\n }\r\n if ( $(\"#WMEPH_CPserv\").prop('checked') ) {\r\n cloneItems.services = cloneMaster.services;\r\n updateItem = true;\r\n }\r\n if ( $(\"#WMEPH_CPhrs\").prop('checked') ) {\r\n cloneItems.openingHours = cloneMaster.openingHours;\r\n updateItem = true;\r\n }\r\n if (updateItem) {\r\n W.model.actionManager.add(new UpdateObject(item, cloneItems) );\r\n phlogdev('Item details cloned');\r\n }\r\n\r\n var copyStreet = $(\"#WMEPH_CPstr\").prop('checked');\r\n var copyCity = $(\"#WMEPH_CPcity\").prop('checked');\r\n\r\n if (copyStreet || copyCity) {\r\n var originalAddress = item.getAddress();\r\n var itemRepl = {\r\n street: copyStreet ? cloneMaster.addr.street : originalAddress.attributes.street,\r\n city: copyCity ? cloneMaster.addr.city : originalAddress.attributes.city,\r\n state: copyCity ? cloneMaster.addr.state : originalAddress.attributes.state,\r\n country: copyCity ? cloneMaster.addr.country : originalAddress.attributes.country\r\n };\r\n updateAddress(item, itemRepl);\r\n phlogdev('Item address cloned');\r\n }\r\n } else {\r\n phlog('Please copy a place');\r\n }\r\n }", "title": "" }, { "docid": "91ecc6db0e3fd964cc60eca9d5567883", "score": "0.63629746", "text": "function fillForm(info) {\r\n\t$('#link-id').val(info.ID)\r\n\t$('#edit-title').val(info.TITLE);\r\n\t$('#edit-link').val(info.LINK);\r\n\t$('#edit-image').val(info.ICON);\r\n}", "title": "" }, { "docid": "9aecc9173a3ec12e8d3fcb96853a0bdc", "score": "0.617092", "text": "function cloneMaterialFields(){\n var fields = $(\".material-fields\");\n fields.last().show();\n fields.last().clone(fields).last().appendTo('.material-form').hide();\n changeFieldNames(\".material-fields > div > p > input, .material-fields > div > p > select\" );\n}", "title": "" }, { "docid": "6239858ce13f1bee6eb6a1c0ef43fc8d", "score": "0.6122883", "text": "function insertModalInfo() {\n // Insert basic info\n insertBasicInfo($mcImage, $mcName, $mcEmail, $mcCity);\n\n // Insert email into link w/ mailto\n $mcEmail.attr('href', `mailto:${sourceEmail}`);\n // Insert cell number\n $mcPhone.text(`${sourcePhone}`);\n // Insert parsed phone number into link w/ tel\n $mcPhone.attr('href', `${parsedPhone}`);\n // Insert address\n $mcAddress.text(`${sourceAddress}`);\n // Insert birthday\n $mcBirthday.text(`${sourceBirthday}`);\n} // end of insertModalInfo()", "title": "" }, { "docid": "0b3edaac42bb54a630a661f910cec33b", "score": "0.60557336", "text": "function populate_new_form(){\n\n\n var new_form_data = JSON.parse(JSON.stringify( ctb_form ));\n new_form_data[1].value = ctb_next_id;\n ctb_add_form( $inner_add_new, new_form_data, 'add_new_topbar', '', 'open', [ ctb_add_new ] );\n $add_new_btn = $inner_add_new.querySelector('.add-topbar');\n $('.colorpicker').wpColorPicker();\n var length = $(\".postbox\").length;\n for(var i = 0; i < length ;i++){\n wp.editor.initialize('textarea-editor-'+i,\n ctb_data.editor_config );\n }\n\n /**\n * Save Settings\n */\n $add_new_btn.onclick = function(e){\n e.preventDefault();\n\n var get_form_data = generate_form_data( $add_new_form );\n if( get_form_data.error ){\n console.log( { error:'add_new_topbar error' } );\n }\n else {\n var ajax_data = get_form_data.data;\n ajax_data.action = 'add_new_topbar';\n ctb_ajax('POST', ajax_data, ctb_settings_callback );\n }\n return false;\n }\n}", "title": "" }, { "docid": "0556466432216312d6170290d3b88311", "score": "0.5984109", "text": "function clone_witness_div(noofwit) {\n var holder, li, clone, counter, existed;\n holder = $(\"#container\");\n li = $('.claimForm:first');\n\n\n existed = holder.find('.claimForm').length;\n\n\n if (existed) {\n if (existed > noofwit) {\n apprise(\"You already have \"\n + existed\n + \" witness,If you want to remove existed witness click on 'X' button with witness\");\n // alert(\"You already have \" + existed + \" witness,If you want to remove existed witness click on 'X' button with witness\");\n $(\"#no_of_witness\").val(existed);\n }\n else {\n existed = existed + 1;\n // counter;\n for (counter = existed; counter <= noofwit; ++counter) {\n gcnt++;\n clone = li.clone();\n var newid = \"claimForm\" + counter;\n clone.attr(\"id\", newid);\n clone.attr(\"style\", \"display:block\");\n clone.appendTo(holder);\n var nr = \"#\" + newid + \" .form1\";\n var extesion = \"<img src='images/del.png' onclick='removediv(\\\"#\"\n + newid\n + \"\\\")' title='Click here to remove this witness'/>\";\n $(nr).html(extesion);\n var nr1 = \"#\" + newid + \" input[type=text]\";\n var allobj = $(nr1);\n for (var t = 0; t < allobj.length; t++) {\n var str = $(allobj[t]).prop(\"name\") + gcnt;\n var str1 = $(allobj[t]).prop(\"tabindex\") + 1000 * gcnt + gcnt;\n $(allobj[t]).prop('name', str);\n $(allobj[t]).prop('tabindex', str1);\n if ($(allobj[t]).prop(\"class\") != 'planeTextFild wit_country') $(allobj[t]).val('');\n }\n var nr1 = \"#\" + newid + \" select\";\n var allobj = $(nr1);\n for (var t = 0; t < allobj.length; t++) {\n var str = $(allobj[t]).prop(\"name\") + gcnt;\n var str1 = $(allobj[t]).prop(\"tabindex\") + 1000 * gcnt + gcnt;\n $(allobj[t]).prop('name', str);\n $(allobj[t]).prop('tabindex', str1);\n $(allobj[t]).val('');\n }\n }\n }\n }\n else {\n t = 1;\n var ext = t;\n var str = '';\n\n str += '<div id=\"claimForm\" class=\"claimForm\"> <div class=\"form1\"><img src=\"images/del.png\" onclick=\"removediv(\\'#claimForm\\')\" title=\"Click here to remove this witness\"/></div>';\n\n str += '<div class=\"form2\"><label class=\"myLable\">Witness First Name</label><input name=\"wit_name' + t + '\" type=\"text\" class=\"planeTextFild wit_name\" placeholder=\"\" tabindex=\"' + ext + 2 + '\" required=\"\" value=\"\"><label class=\"myLable\">Address 2</label><input name=\"wit_address_two' + t + '\" type=\"text\" class=\"planeTextFild wit_address1\" placeholder=\"\" tabindex=\"' + ext + 5 + '\" value=\"\"/><label class=\"myLable\">Zip Code</label><input name=\"wit_zip' + t + '\" type=\"text\" class=\"planeTextFild wit_zip\" placeholder=\"\" tabindex=\"' + ext + 8 + '\" value=\"\"><label class=\"myLable\">Work/Other Phone Number</label><input name=\"wit_work_phone' + t + '\" type=\"text\" class=\"planeTextFild wit_work_phone\" placeholder=\"\" onKeyUp=\"FormatPhone(event,this)\" tabindex=\"' + ext + 11 + '\" value=\"\"></div><div class=\"form2\"><label class=\"myLable\">Witness Last Name</label><input name=\"wit_lastname' + t + '\" tabindex=\"' + ext + 3 + '\" type=\"text\" class=\"planeTextFild wit_lastname\" placeholder=\"\" value=\"\"><label class=\"myLable\">City</label><input name=\"wit_city' + t + '\" tabindex=\"' + ext + 6 + '\" type=\"text\" class=\"planeTextFild wit_city\" placeholder=\"\" value=\"\"><label class=\"myLable\">Country</label><input name=\"wit_country' + t + '\" type=\"text\" class=\"planeTextFild wit_country\" placeholder=\"\" tabindex=\"' + ext + 9 + '\" value=\"United States\"></div><div class=\"form2\"><label class=\"myLable\">Address1</label><input name=\"wit_address' + t + '\" type=\"text\" class=\"planeTextFild wit_address\" placeholder=\"\" tabindex=\"' + ext + 4 + '\" value=\"\"/><label class=\"myLable\">State</label><select name=\"wit_state' + t + '\" class=\"form-control myselectBig wit_state\" tabindex=\"' + ext + 7 + '\">' + strstates + '</select><label class=\"myLable\">Home/Cell Phone Number</label><input name=\"wit_home_phone' + t + '\" type=\"text\" class=\"planeTextFild wit_home_phone\" placeholder=\"\" onKeyUp=\"FormatPhone(event,this)\" tabindex=\"' + ext + 10 + '\" value=\"\"></div><div class=\"clear\"></div></div>';\n $(\"#container\").html(str);\n\n clone_witness_div(noofwit)\n }\n\n $(\".wit_zip\").mask(\"99999?-9999\", { placeholder: \"_\" });\n $(\".wit_work_phone\").mask(\"(999)-999-9999\", { placeholder: \"_\" });\n $(\".wit_home_phone\").mask(\"(999)-999-9999\", { placeholder: \"_\" });\n}", "title": "" }, { "docid": "75c894333b968a22ee0f76db59ee80a5", "score": "0.59539217", "text": "function cloneField(){\r\n //console.log('Chegguei aqui tmbm!!!')\r\n //duplicar os conteudos. Que conteudos?\r\n const newFieldsContainer = document.querySelector(\".schedule-item\").cloneNode(true)// se for verdadeiro, ele copia tudo dentro da div .schedule-item(seus filhos). Se for falso, ele copia a div vazia\r\n \r\n //colocar na pagina\r\n const fields = newFieldsContainer.querySelectorAll(\"input\")\r\n //console.log(fields[0].value)\r\n //console.log(fields[1].value)\r\n //para cada campo, limpar\r\n fields.forEach(function(field){\r\n field.value = \"\"\r\n })\r\n\r\n document.querySelector(\"#schedule-items\").appendChild(newFieldsContainer)\r\n\r\n}", "title": "" }, { "docid": "68d2becb7b22261faaceb1ed30c2cff4", "score": "0.5944257", "text": "function add_copy()\n{\n\tvar field_id = 'fc_' + field_cnt++;\n\tvar temp = 'tm_' + field_cnt++;\n\tvar dd_id = 'dd_' + dd_cnt++;\n\tvar dd_id2 = 'dd_' + dd_cnt++;\n\n\tvar element = '<fieldset class=\"modx-level2 fields2\" id=\"dd-copy\">';\n\t\telement += '<dl id=\"dl-copy\">';\n\t\t\telement += '<dt class=\"copy-rows\">';\n\t\t\t\telement += '<label>Copy: (from &raquo; to)</label>';\n\t\t\t\telement += '<img class=\"action-image\" src=\"./images/plus.png\" alt=\"Add file\" title=\"Add file\" onclick=\"add_file_copy();\" /><img class=\"action-image\" src=\"./images/delete.png\" alt=\"Delete\" onclick=\"$(\\'#dd-copy\\').remove(); document.getElementById(\\'addCopyField\\').style.display=\\'\\';\" />';\n\t\t\telement += '</dt>';\n\n\t\t\telement += '<dd class=\"copy-rows\" id=\"' + dd_id2 + '\">';\n\t\t\t\telement += '<input class=\"inputbox copy-to\" name=\"copy[' + temp + '][from]\" size=\"85\" maxlength=\"255\" value=\"\" type=\"text\" /> &raquo; ';\n\t\t\t\telement += '<input class=\"inputbox\" name=\"copy[' + temp + '][to]\" size=\"85\" maxlength=\"255\" value=\"\" type=\"text\" />';\n\t\t\t\telement += '<img class=\"action-image\" src=\"./images/delete.png\" alt=\"Delete\" onclick=\"$(\\'#' + dd_id2 + '\\').remove()\" />';\n\t\t\telement += '</dd>';\n\t\telement += '</dl>';\n\telement += '</fieldset>';\n\n\t$('#copy-field').append(element);\n}", "title": "" }, { "docid": "f18a7d39d3d5f38657397a36c2e65ea3", "score": "0.5909967", "text": "function setUpFormat(innerform){\n innerform.children(\".formattabwrapper\").children(\".addSpoiler\").click(function(e){\n\n e.preventDefault;\n\t\n\tvar ver = \"old\";\n\tif($(this)[0].classList.contains(\"newspoiler\")){\n\t\tver = \"new\";\n\t}\n\n var txtarea = $(this).parents(\".formattabwrapper\").parents(\".commentfaces\").parents(\".md\").siblings(\".usertext-edit\").children(\".md\").children(\"textarea\");\n var start = txtarea[0].selectionStart;\n var finish = txtarea[0].selectionEnd;\n var sel = txtarea[0].value.substring(start, finish);\n\n if(ver == \"old\"){\n\t\tif(sel !== \"\")\n\t\t var output = '[](/s \"' + sel + '\")';\n\t\telse\n\t\t var output = '[]()';\n\t}\n\telse {\n\t\tif(sel !== \"\")\n\t\t var output = '>!' + sel + '!<';\n\t\telse\n\t\t var output = '>!!<';\n\t}\n\n var formfieldbefore = txtarea.val().substr(0,start);\n var formfieldafter = txtarea.val().substr(finish,txtarea.val().length)\n\n txtarea.val(formfieldbefore + output + formfieldafter);\n\n txtarea.focus();\n\n });\n}", "title": "" }, { "docid": "21c8624770657656f81e972d842d4c37", "score": "0.5906259", "text": "function cloneField () {\n // Duplicate the desired container\n const newFieldsContainer = document.querySelector('.schedule-item').cloneNode(true);\n\n // clear the fiels\n const fields = newFieldsContainer.querySelectorAll('input');\n\n fields.forEach(field => {\n field.value = \"\";\n })\n \n // Colocar na página\n document.querySelector('#schedule-items').appendChild(newFieldsContainer);\n}", "title": "" }, { "docid": "01793934994938c539792e0b0558b425", "score": "0.58561796", "text": "function personInfoSectionLogic(eve) {\n var formCloneClone = personInfoFormClone.clone(true);\n var renderClone = personInfoMainContClone.clone(true);\n\n function setFormInformation(form) {\n if (!profileData.is_business) {\n if (profileData.gender) {\n form.find(postPersonInfoGender).val(profileData.gender.id);\n customSelectsModule.setInitialValues(form);\n } else {\n form.find(postPersonInfoGender).val(\"\");\n customSelectsModule.setInitialValues(form);\n }\n } else {\n form.find(\".js-gender-select\").remove();\n }\n if (!profileData.is_business) {\n if (profileData.dob) {\n form.find(postPersonInfoDoBDay).val(profileData.dob.slice(0, 2));\n form.find(postPersonInfoDoBMonth).val(profileData.dob.slice(3, 5));\n form.find(postPersonInfoDoBYear).val(profileData.dob.slice(6));\n customSelectsModule.setInitialValues(form);\n } else {\n form.find(postPersonInfoDoBDay).val(\"\");\n form.find(postPersonInfoDoBMonth).val(\"\");\n form.find(postPersonInfoDoBYear).val(\"\");\n customSelectsModule.setInitialValues(form);\n }\n } else {\n form.find(\".js-dob-form-cont\").remove();\n }\n if (profileData.email) {\n form.find(postPersonInfoEmail).val(profileData.email);\n } else {\n form.find(postPersonInfoEmail).val(\"\");\n }\n if (profileData.tel && profileData.tel.tel_code && profileData.tel.tel_number) {\n form.find(postPersonInfoTelCode).val(profileData.tel.tel_code);\n form.find(postPersonInfoTelNumber).val(profileData.tel.tel_number);\n } else {\n form.find(postPersonInfoTelCode).val(\"+47\");\n form.find(postPersonInfoTelNumber).val(\"\");\n }\n if (!profileData.is_business) {\n if (profileData.address) {\n if (profileData.address.id) {\n form.attr(\"data-address-id\", profileData.address.id);\n }\n profileData.address.line_1 ? form.find(postPersonInfoAddress1).val(profileData.address.line_1) : form.find(postPersonInfoAddress1).val(\"\");\n profileData.address.line_2 ? form.find(postPersonInfoAddress2).val(profileData.address.line_2) : form.find(postPersonInfoAddress2).val(\"\");\n profileData.address.county ? form.find(postPersonInfoCounty).val(profileData.address.county) : form.find(postPersonInfoCounty).val(\"\");\n profileData.address.postcode ? form.find(postPersonInfoPost).val(profileData.address.postcode) : form.find(postPersonInfoPost).val(\"\");\n profileData.address.city ? form.find(postPersonInfoCity).val(profileData.address.city) : form.find(postPersonInfoCity).val(\"\");\n profileData.address.country ? form.find(postPersonInfoCountry).val(profileData.address.country) : form.find(postPersonInfoCountry).val(\"\");\n } else {\n form.find(postPersonInfoAddress1).val(\"\");\n form.find(postPersonInfoAddress2).val(\"\");\n form.find(postPersonInfoCounty).val(\"\");\n form.find(postPersonInfoPost).val(\"\");\n form.find(postPersonInfoCity).val(\"\");\n form.find(postPersonInfoCountry).val(\"\");\n }\n } else {\n form.find(\".js-address-form-cont\").remove();\n }\n if (profileData.phone_verified) {\n form.find(personInfoVerifyBtnSection).remove();\n } else if (profileData.is_business) {\n form.find(\".js-verify-phone-tooltip\").text(window.__(\"Please add your phone number so we can reach you.\"));\n }\n }\n\n if (!eve) {\n if (canEdit) {\n if (!profileData.is_business) {\n if (profileData.gender) {\n renderClone.find(renPersonInfoGender).html(renderClone.find(renPersonInfoGender).html() + profileData.gender.name);\n renderClone.find(renPersonInfoGender).siblings(personInfoShowFormPart).addClass(hiddenClass);\n } else {\n renderClone.find(renPersonInfoGender).text(\"\");\n renderClone.find(renPersonInfoGender).siblings(personInfoShowFormPart).removeClass(hiddenClass);\n }\n } else {\n renderClone.find(\".js-gender-ren-row\").remove();\n }\n if (!profileData.is_business) {\n if (profileData.dob) {\n renderClone.find(renPersonInfoDoB).html(renderClone.find(renPersonInfoDoB).html() + profileData.dob);\n renderClone.find(renPersonInfoDoB).attr(\"datetime\", profileData.sys_dob);\n renderClone.find(renPersonInfoDoB).siblings(personInfoShowFormPart).addClass(hiddenClass);\n } else {\n renderClone.find(renPersonInfoDoB).text(\"\");\n renderClone.find(renPersonInfoDoB).attr(\"datetime\", \"\");\n renderClone.find(renPersonInfoDoB).siblings(personInfoShowFormPart).removeClass(hiddenClass);\n }\n } else {\n renderClone.find(\".js-dob-ren-row\").remove();\n }\n if (profileData.email) {\n renderClone.find(renPersonInfoEmail).html(renderClone.find(renPersonInfoEmail).html() + startBreakWord + profileData.email + endBreakWord);\n renderClone.find(renPersonInfoEmail).siblings(personInfoShowFormPart).addClass(hiddenClass);\n } else {\n renderClone.find(renPersonInfoEmail).text(\"\");\n renderClone.find(renPersonInfoEmail).siblings(personInfoShowFormPart).removeClass(hiddenClass);\n }\n if (profileData.tel && profileData.tel.tel_code && profileData.tel.tel_number) {\n renderClone.find(renPersonInfoTel).html(renderClone.find(renPersonInfoTel).html() + startBreakWord + profileData.tel.tel_code + profileData.tel.tel_number + endBreakWord);\n renderClone.find(renPersonInfoTel).siblings(personInfoShowFormPart).addClass(hiddenClass);\n } else {\n renderClone.find(renPersonInfoTel).text(\"\");\n renderClone.find(renPersonInfoTel).siblings(personInfoShowFormPart).removeClass(hiddenClass);\n }\n if (!profileData.is_business) {\n if (profileData.address && profileData.address.country) {\n renderClone.find(renPersonInfoAddress1).html(renderClone.find(renPersonInfoAddress1).html() + profileData.address.line_1);\n renderClone.find(renPersonInfoAddress2).text(profileData.address.line_2);\n renderClone.find(renPersonInfoCounty).text(profileData.address.county);\n renderClone.find(renPersonInfoPostAndCity).text(profileData.address.postcode + \" \" + profileData.address.city);\n renderClone.find(renPersonInfoCountry).text(profileData.address.country);\n renderClone.find(renPersonInfoAddress1).siblings(personInfoShowFormPart).addClass(hiddenClass);\n } else {\n renderClone.find(renPersonInfoAddress1).text(\"\");\n renderClone.find(renPersonInfoAddress2).text(\"\");\n renderClone.find(renPersonInfoCounty).text(\"\");\n renderClone.find(renPersonInfoPostAndCity).text(\"\");\n renderClone.find(renPersonInfoCountry).text(\"\");\n renderClone.find(renPersonInfoAddress1).siblings(personInfoShowFormPart).removeClass(hiddenClass);\n }\n } else {\n renderClone.find(\".js-address-ren-row\").remove();\n }\n\n $(personInfoFormPart).remove();\n $(personInfoEditBtn).removeClass(renderClone);\n $(personInfoSection).append(renderClone);\n } else {\n $(personInfoSection).remove();\n }\n } else {\n if ($(eve.target).is(personInfoShowFormPart) || $(eve.target).is(personInfoEditBtn)) {\n $(personInfoFormPart).remove();\n $(personInfoMainCont).remove();\n setFormInformation(formCloneClone);\n $(personInfoSection).append(formCloneClone);\n } else if ($(eve.target).is(personInfoSaveBtn)) {\n var ajaxData = {\n id: queryID,\n person: {\n sex: $(postPersonInfoGender).val() ? $(postPersonInfoGender).val() : \"\",\n birth: $(postPersonInfoDoBYear).val() && $(postPersonInfoDoBMonth).val() && $(postPersonInfoDoBDay).val() ? [$(postPersonInfoDoBYear).val(), $(postPersonInfoDoBMonth).val(), $(postPersonInfoDoBDay).val()].join(\"-\") : \"\",\n phone_code: $(postPersonInfoTelCode).val() && $(postPersonInfoTelNumber).val() ? $(postPersonInfoTelCode).val() : \"\",\n phone_number: $(postPersonInfoTelCode).val() && $(postPersonInfoTelNumber).val() ? $(postPersonInfoTelNumber).val() : \"\",\n address_attributes: {\n id: $(personInfoFormPart).attr(\"data-address-id\") ? $(personInfoFormPart).attr(\"data-address-id\") : \"\",\n line_1: $(postPersonInfoAddress1).val() ? $(postPersonInfoAddress1).val() : \"\",\n line_2: $(postPersonInfoAddress2).val() ? $(postPersonInfoAddress2).val() : \"\",\n city: $(postPersonInfoCity).val() ? $(postPersonInfoCity).val() : \"\",\n country: $(postPersonInfoCountry).val() ? $(postPersonInfoCountry).val() : \"\",\n postcode: $(postPersonInfoPost).val() ? $(postPersonInfoPost).val() : \"\",\n county: $(postPersonInfoCounty).val() ? $(postPersonInfoCounty).val() : \"\",\n id: $(personInfoFormPart).attr(\"data-address-id\") \n }\n }\n };\n $(personInfoSection).addClass(\"in-progress\");\n\n $.ajax({\n url: profileUpdatePath,\n type: \"PATCH\",\n data: JSON.stringify(ajaxData),\n dataType: 'json',\n contentType: 'application/json',\n success: function(response) {\n if (profileData.gender) {\n profileData.gender.id = $(postPersonInfoGender).val();\n profileData.gender.name = $(personInfoGenderValue).text();\n } else {\n profileData.gender = {};\n profileData.gender.id = $(postPersonInfoGender).val();\n profileData.gender.name = $(personInfoGenderValue).text();\n }\n profileData.dob = $(postPersonInfoDoBYear).val() && $(postPersonInfoDoBMonth).val() && $(postPersonInfoDoBDay).val() ? [$(postPersonInfoDoBDay).val(), $(postPersonInfoDoBMonth).val(), $(postPersonInfoDoBYear).val()].join(\".\") : \"\";\n profileData.sys_dob = $(postPersonInfoDoBYear).val() && $(postPersonInfoDoBMonth).val() && $(postPersonInfoDoBDay).val() ? [$(postPersonInfoDoBYear).val(), $(postPersonInfoDoBMonth).val(), $(postPersonInfoDoBDay).val()].join(\"-\") : \"\";\n profileData.email = $(postPersonInfoEmail).val();\n if (profileData.tel && profileData.tel.tel_code && profileData.tel.tel_number) {\n if (profileData.tel.tel_code !== $(postPersonInfoTelCode).val() || profileData.tel.tel_number !== $(postPersonInfoTelNumber).val()) {\n profileData.phone_verified = false;\n skillsSectionLogic();\n }\n profileData.tel.tel_code = $(postPersonInfoTelCode).val();\n profileData.tel.tel_number = $(postPersonInfoTelNumber).val();\n } else {\n profileData.tel = {};\n profileData.tel.tel_code = $(postPersonInfoTelCode).val();\n profileData.tel.tel_number = $(postPersonInfoTelNumber).val();\n }\n if (profileData.address) {\n if (!profileData.address.id) {\n profileData.address.id = response.address.id;\n }\n profileData.address.line_1 = $(postPersonInfoAddress1).val();\n profileData.address.line_2 = $(postPersonInfoAddress2).val();\n profileData.address.county = $(postPersonInfoCounty).val();\n profileData.address.postcode = $(postPersonInfoPost).val();\n profileData.address.city = $(postPersonInfoCity).val();\n profileData.address.country = $(postPersonInfoCountry).val();\n } else {\n profileData.address = {};\n profileData.address.line_1 = $(postPersonInfoAddress1).val();\n profileData.address.line_2 = $(postPersonInfoAddress2).val();\n profileData.address.county = $(postPersonInfoCounty).val();\n profileData.address.postcode = $(postPersonInfoPost).val();\n profileData.address.city = $(postPersonInfoCity).val();\n profileData.address.country = $(postPersonInfoCountry).val();\n }\n\n personInfoSectionLogic();\n $(personInfoSection).removeClass(\"in-progress\");\n showErrorsModule.hideMessage();\n },\n error: function(response) {\n var errors = $.parseJSON(response.responseText);\n showErrorsModule.showMessage(errors, \"main-error\");\n $(personInfoSection).removeClass(\"in-progress\");\n }\n });\n } else if ($(eve.target).is(personInfoCancelBtn)) {\n showErrorsModule.hideMessage();\n personInfoSectionLogic();\n }\n }\n }", "title": "" }, { "docid": "66472ff866e6cc5f5dcb1580b3c6685a", "score": "0.5833616", "text": "function clonePricelistDiv($type) {\n var divLength = $(\"#\" + $type + \"-price-rules-container\").find(\".pricelist-values\").length;\n var divLengthContainerDivName = $type + \"-price-rules-container\";\n var rowName= $type+\"-pricelist-row-\"+divLength;\n\n if(divLength > 0){\n if(checkAllFieldsFilled(rowName,$type) == '1'){\n toastr.error(\"Please fill up the previous fields\");\n return false;\n } \n }\n \n if (jQuery(\"#\" + $type + \"-price-rules-container\").find(\".pricelist-values\").length > 0) {\n $divRowId = jQuery('#' + $type + '-price-rules-container').children().last().attr('id');\n $explodedArr = $divRowId.split('-');\n $lastDivId = $explodedArr[$explodedArr.length - 1];\n $newDivId = parseInt($lastDivId) + 1;\n $newFullId = $type + \"-pricelist-row-\" + $newDivId;\n $clonedHtml = jQuery(\"#\" + $type + \"-pricelist-row-\" + $lastDivId).clone(true).insertAfter(\"#\" + $type + \"-pricelist-row-\" + $lastDivId);\n\n jQuery('#' + $type + '-price-rules-container').children().last().attr('id', $newFullId);\n jQuery(\"#\" + $newFullId).find('.hidden-val').val('');\n jQuery(\"#\"+$newFullId).find('.delete-pricelist').attr('data-pricelist-id','0');\n jQuery(\"#\" + $newFullId).find('.date-picker').attr('id','datefrom'+$newDivId);\n jQuery(\"#\" + $newFullId).find('.update-pricelist').attr('title','Add');\n jQuery(\"#\" + $newFullId).find('.copy-pricelist').addClass('hide');\n\n\n //select2\n $selectHtml=jQuery('#duplicate-state').html();\n jQuery('#'+$newFullId).find('.select2-container').remove();\n jQuery('#'+$newFullId).find('.selectStates').replaceWith($selectHtml);\n jQuery(\"#\" + $newFullId).find('.selectStates').attr('id','states-'+$newDivId);\n jQuery(\"#\" + $newFullId).find('.selectStates').select2();\n jQuery(\"#\" + $newFullId).find('.selectStates').val(null).trigger(\"change\"); \n\n jQuery('#datefrom'+$newDivId).multiDatesPicker('destroy');\n jQuery('#datefrom'+$newDivId).val('');\n var dates=[];\n jQuery('#datefrom'+$newDivId).multiDatesPicker({\n dateFormat: 'dd-mm-yy',\n minDate: new Date(),\n onSelect: function (e) {\n dates.push(e);\n var dateList = \"\";\n $.each(dates, function (i, d) {\n if (dateList.length > 0) {\n dateList += \",\";\n }\n dateList += d;\n });\n $(\"#dates\").val(dateList);\n }\n\n });\n clear_form_elements($newFullId);\n }\n else {\n $ruleType='0';\n if($type == \"default\"){\n $ruleType= '1';\n }\n else if($type == \"custom\"){\n $ruleType= '2';\n }\n else if($type == \"holiday\"){\n $ruleType= '3';\n }\n else if($type == \"packing\"){\n $ruleType= '4'; \n }\n $duplicatedRow = jQuery(\"#duplicate-row\").clone(true);\n jQuery(\"#\" + $type + \"-price-rules-container\").html($duplicatedRow);\n $newFullId = $type + \"-pricelist-row-1\";\n jQuery('#' + $type + '-price-rules-container').children().last().attr('id', $newFullId);\n jQuery('#' + $type + '-values-div').find('.custom-show').hide();\n jQuery('#'+$newFullId).find('#ruleType').val($ruleType);\n jQuery(\"#\" + $newFullId).find('.date-picker').attr('id','datefrom1');\n if ($type == \"default\" || $type == \"custom\") {\n if($type == \"default\"){\n jQuery('#' + $type + '-values-div').find('.states-show').hide(); \n // jQuery('#' + $type + '-values-div').find('.default-and-custom-show').addClass('hide'); \n // jQuery('#' + $type + '-values-div').find('.default-day-from-to').removeClass('hide'); \n }\n jQuery('#' + $type + '-values-div').find('.holiday-show').hide();\n jQuery('#' + $type + '-values-div').find('.default-and-custom-show').show();\n }\n else if ($type == \"holiday\") {\n jQuery('#' + $type + '-values-div').find('.default-and-custom-show').hide();\n jQuery('#' + $type + '-values-div').find('.holiday-show').show();\n }\n if ($type == \"custom\") {\n jQuery('#' + $type + '-values-div').find('.custom-show').show();\n }\n if($type == \"custom\" || $type == \"holiday\"){\n jQuery('#' + $type + '-values-div').find('.states-show').show(); \n }\n if($type == \"packing\"){\n jQuery('#' + $type + '-values-div').find('.packer-hide').hide(); \n jQuery('#' + $type + '-values-div').find('.custom-show').show(); \n jQuery(\"#\"+$newFullId).find('#movetype').empty(); \n jQuery(\"#\"+$newFullId).find('#movetype').append(new Option(\"Packing\", \"4\")).\n append(new Option(\"Unpacking\", \"5\"));\n }\n else{\n jQuery('#' + $type + '-values-div').find('.packer-show').hide(); \n }\n\n //select2\n $selectHtml=jQuery('#duplicate-state').html();\n jQuery('#'+$newFullId).find('.select2-container').remove();\n jQuery('#'+$newFullId).find('.selectStates').replaceWith($selectHtml);\n jQuery(\"#\" + $newFullId).find('.selectStates').attr('id','states-1');\n jQuery(\"#\" + $newFullId).find('.selectStates').select2();\n jQuery(\"#\" + $newFullId).find('.selectStates').val(null).trigger(\"change\"); \n\n //datepicker\n jQuery('#datefrom1').multiDatesPicker('destroy');\n jQuery('#datefrom1').val('');\n jQuery('#datefrom1').multiDatesPicker({\n dateFormat: 'dd-mm-yy',\n minDate: new Date(),\n onSelect: function (e) {\n dates=[];\n dates.push(e);\n var dateList = \"\";\n $.each(dates, function (i, d) {\n if (dateList.length > 0) {\n dateList += \",\";\n }\n dateList += d;\n });\n $(\"#dates\").val(dateList);\n }\n });\n jQuery('.'+ $type +'-no-records-found').hide();\n }\n}", "title": "" }, { "docid": "1085bf2dd6c744c5c8efff1be24ec332", "score": "0.58273834", "text": "function form_set_new(form_id) {\n $(\"#modal-label-\" + form_id).text(\"New element\");\n\n var form_elements = $(\"[form=\"+ form_id + \"]\");\n\n set_default(form_elements.filter(\"[name=id]\"));\n set_default(form_elements.filter(\"[name=name]\"));\n}", "title": "" }, { "docid": "29aea164510a782dc46017cdf65c42bb", "score": "0.5760895", "text": "fillFormElements (data) {\n this.$form.inputParent.value = data.parent;\n this.$form.hiddenSpan.value = data.span;\n }", "title": "" }, { "docid": "0c7cf8954791017715e148004b6b949f", "score": "0.5741581", "text": "function copyDataForSubmit(name)\n {\n // shortcuts for selection field and hidden data field\n var toSel = document.getElementById(name+\"-to\");\n var toDataContainer = document.getElementById(name+\"-toDataContainer\");\n\n // delete all child nodes (--> complete content) of \"toDataContainer\" span\n while (toDataContainer.hasChildNodes())\n toDataContainer.removeChild(toDataContainer.firstChild);\n\n // create new hidden input fields - one for each selection item of\n // \"to\" selection\n for (var i = 0; i < toSel.options.length; i++)\n {\n // create virtual node with suitable attributes\n var newNode = document.createElement(\"input\");\n newNode.setAttribute(\"name\", name.replace(/-/g, '.')+':list');\n newNode.setAttribute(\"type\", \"hidden\");\n newNode.setAttribute(\"value\",toSel.options[i].value );\n\n // actually append virtual node to DOM tree\n toDataContainer.appendChild(newNode);\n }\n }", "title": "" }, { "docid": "e56770e2430c54c08c7211402206c771", "score": "0.5717188", "text": "function add_new_attr() {\n var tpl = $('.attr_tpl').clone(true).removeClass('attr_tpl');\n tpl.show();\n $('.ui_detail_focus').find('.ui_related_data_area .attr_info_box').append(tpl);\n}", "title": "" }, { "docid": "538b9478e7d4340b8c00669b8643ee7f", "score": "0.5667076", "text": "function x(e,i,t){var l=B(e,i,t).getClonedData();return ti.trigger({type:gi.fieldcreate,field:l}),l}", "title": "" }, { "docid": "cc885221dadaa1c0dc43bcf05d73ace1", "score": "0.5655564", "text": "function cloneClones() {\n avatarFormPartClone = $(avatarFormPart).clone(true);\n avatarImgClone = $(avatarCont).clone(true);\n userNameFormClone = $(userNameFormPart).clone(true);\n tolkFormClone = $(tolkFormPart).clone(true);\n complHoursBtnsClone = $(complHoursBtnsCont).clone(true);\n aboutFormClone = $(aboutFormPart).clone(true);\n personInfoFormClone = $(personInfoFormPart).clone(true);\n checkboxItemClone = $(checkboxesListItem).clone(true);\n areasFormClone = $(areasFormPart).clone(true);\n methodsFormClone = $(methodsFormPart).clone(true);\n typesFormClone = $(typesFormPart).clone(true);\n eduFormClone = $(eduFormPart).clone(true);\n eduRenderContClone = $(eduMainCont).clone(true);\n coursesFormClone = $(coursesFormPart).clone(true);\n coursesInputClone = $(postOneCourse).clone(true);\n skillsMainClone = $(skillMainCont).clone(true);\n skillsFormClone = $(skillFormMainCont).clone(true);\n skillsCertifClone = $(skillOneCertifCont).clone(true);\n oneJobRowClone = $(inviteJobCont).clone(true);\n personInfoMainContClone = $(personInfoMainCont).clone(true);\n\n $(avatarFormPart).remove();\n $(avatarCont).remove();\n $(userNameFormPart).remove();\n $(tolkFormPart).remove();\n $(complHoursBtnsCont).remove();\n $(aboutFormPart).remove();\n $(personInfoFormPart).remove();\n $(checkboxesListItem).remove();\n $(areasFormPart).remove();\n $(methodsFormPart).remove();\n $(typesFormPart).remove();\n $(eduFormPart).remove();\n $(eduMainCont).remove();\n $(coursesFormPart).remove();\n $(postOneCourse).remove();\n $(skillMainCont).remove();\n $(skillFormMainCont).remove();\n $(skillOneCertifCont).remove();\n $(inviteJobCont).remove();\n $(personInfoMainCont).remove();\n\n avatarFormPartClone.removeClass(exampleClass);\n avatarImgClone.removeClass(exampleClass);\n userNameFormClone.removeClass(exampleClass);\n tolkFormClone.removeClass(exampleClass);\n complHoursBtnsClone.removeClass(exampleClass);\n aboutFormClone.removeClass(exampleClass);\n personInfoFormClone.removeClass(exampleClass);\n checkboxItemClone.removeClass(exampleClass);\n areasFormClone.removeClass(exampleClass);\n methodsFormClone.removeClass(exampleClass);\n typesFormClone.removeClass(exampleClass);\n eduFormClone.removeClass(exampleClass);\n eduRenderContClone.removeClass(exampleClass);\n coursesFormClone.removeClass(exampleClass);\n coursesInputClone.removeClass(exampleClass);\n skillsMainClone.removeClass(exampleClass);\n skillsFormClone.removeClass(exampleClass);\n skillsCertifClone.removeClass(exampleClass);\n oneJobRowClone.removeClass(exampleClass);\n personInfoMainContClone.removeClass(exampleClass)\n }", "title": "" }, { "docid": "3839b903a538fd7d8945c06f2e56cd79", "score": "0.56383014", "text": "function build_form() {\n $('#acc_border').append(\"<div class='accordion' id='accordion3'></div>\");\n $('#accordion3').append(\"<div class='acc_holder' id='acc_holder'></div>\");\n\n add_buttons();\n\n buttonsClass(\"div.social_button\");\n buttonsClass(\"div.accordion_button\");\n\n var total = all_data[\"content\"].length;\n update_numblocks();\n for(var i = 0;i<numBlocks;i++) {\n add_image_block((0 + i) % total);\n }\n\n // Hide description fields for the time being...\n $(\".acc_content\").hide();\n}", "title": "" }, { "docid": "341f7acaab5c5820502c2ea61694757b", "score": "0.5615134", "text": "function createFields() {\n retrieveEditedLocationNames();\n document.getElementById('div-hidden').innerHTML = createHiddenFields();\n \n}", "title": "" }, { "docid": "341574cbb3c78ceb2b30ce4761f30399", "score": "0.5606113", "text": "function addMore(){\r\n\tconsole.log(\"Adding more elements...\");\r\n\r\n\tlet chiled = document.getElementById(\"dispform-inline\");\r\n\tlet newChld = chiled.cloneNode(true);\r\n\tdocument.getElementById(\"elem-holder\").appendChild(newChld);\r\n\tconsole.log(\"adding done...\");\r\n}", "title": "" }, { "docid": "364ff9a41f1d84ee7d637238a8e8a75f", "score": "0.56039625", "text": "function __return_field(data){\r\n\tif (data.name==\"\"){\r\n\t\tpos = buildform.form_fields.length;\r\n\t} else {\r\n\t\tpos = data.name.toString().substr(5);\r\n\t}\r\n\tbuildform.form_fields[pos] = new form_field();\r\n\tbuildform.form_fields[pos].clone(data);\r\n\tbuildform.form_fields[pos].name=\"field\"+pos;\r\n\tbuildform.build();\r\n}", "title": "" }, { "docid": "7dca9da59547e66e3eeb5dd4b5e3805e", "score": "0.55962574", "text": "function prepareForm(inEdit, id) {\n if (inEdit) {\n formState('edit', id);\n document.querySelector('.section-add-imgwrap img').style.opacity = 0;\n console.log('Sets edit');\n } else {\n formState('create');\n document\n .querySelector('.section-products')\n .prepend(productForm.parentElement);\n productForm.style.display = 'flex';\n\n //CLOSES EDIT MODE\n if (id) {\n document.querySelector('.product-form').append(productForm);\n productForm.style.display = 'none';\n document.querySelector('.section-add-imgwrap img').style.opacity = 1;\n }\n }\n}", "title": "" }, { "docid": "e504cca8e38db84484fe377e08494de7", "score": "0.55837184", "text": "function fillaclone() {\n\t\tvar netcalltoclone \t= $('#netcalltoclone option:selected').text();\n\t\tvar netIDtoclone\t= $('#netcalltoclone option:selected').val();\n\t\tvar netID = $(\"#idofnet\").text().trim();\n\t//\tvar oldPB = prompt(\"Enter the log No. to clone.\");\n\t\tvar newKind = $(\"#activity\").text().trim();\n\t\tvar oldCall = $(\".cs1\").text();\n\t\tconsole.log('@663 stand alone= '+netcalltoclone+' val= '+netIDtoclone+' oldCall= '+oldCall);\n\t\t\t$.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: 'clonePB.php',\n\t\t\t\tdata: {oldPB:netIDtoclone, newPB:netID, newKind:newKind, oldCall:oldCall},\n\t\t\t\tsuccess: function() {\t\n\t\t//\t\t\talert(\"Out: Clone \"+netIDtoclone+\" into \"+netID+\" for \"+newKind);\n\t\t\t\t\t//refresh();\n\t\t\t\t\t\n\t\t\t\t} // end success\n\t\t\t}); // End of ajax\n\t\t\tshowActivities(netID);\n} // End of fillaclone() function", "title": "" }, { "docid": "2c3f30a90221de0d9aa14528c33bf922", "score": "0.55791724", "text": "function createContentEdit(container, labelText, dataText) {\n container.append(\n '<div class=\"form-group col-sm-12\">'+\n '<div class=\"col-sm-4\">'+\n '<label class=\"rightText\">'+labelText+':</label>'+\n '</div>'+\n '<div class=\"col-sm-8\">'+\n '<input class=\"form-control\" name=\"'+labelText+'\" id=\"'+labelText+'\" placeholder=\"'+dataText+'\" value=\"'+dataText+'\">'+\n '</div>'+\n '</div>'\n )\n}", "title": "" }, { "docid": "474162e7c0f9b5b2d30dc7ec106faeb6", "score": "0.5577655", "text": "function createNewCommentForm() {\n var yourcomment_id = \"yourcomment_\" + review_id + \"_\" +\n context_type;\n if (sectionId) {\n yourcomment_id += \"_\" + sectionId;\n }\n\n yourcomment_id += \"-draft\";\n\n $(\"<li/>\")\n .addClass(\"reply-comment draft editor\")\n .attr(\"id\", yourcomment_id + \"-item\")\n .append($(\"<dl/>\")\n .append($(\"<dt/>\")\n .append($(\"<label/>\")\n .attr(\"for\", yourcomment_id)\n .append($(\"<a/>\")\n .attr(\"href\", gUserURL)\n .text(gUserFullName)\n )\n )\n .append('<dd><pre id=\"' + yourcomment_id + '\"/></dd>')\n )\n )\n .appendTo(commentsList);\n\n var yourcommentEl = $(\"#\" + yourcomment_id);\n createCommentEditor(yourcommentEl);\n yourcommentEl.inlineEditor(\"startEdit\");\n\n addCommentLink.hide();\n }", "title": "" }, { "docid": "4e27fdbc5ee90bd08ade4c71b2e1f9e1", "score": "0.5571248", "text": "appendNewInterestForm () {\n const displayContainer = document.querySelector(\"#main-container\")\n displayContainer.appendChild(build.buildInterestForm())\n\n\n }", "title": "" }, { "docid": "38eaac5d529b757b119bfc0eca548f72", "score": "0.5561305", "text": "function state_newListItemForm()\n\t{\n\t\tif(editItemForm.css('height') == \"0px\")\n\t\t{\n\t\t\texpandEditListForm(editItemForm);\n\t\t}\n\n\t\t//clear form\n\t\tclearItemForm();\n\n\t\t//change submit button label\n\t\tchangeItemSubmitLabel(\"Create a New Item\");\n\t}", "title": "" }, { "docid": "60c68b55c98a2b6333f4e789586f0932", "score": "0.5558229", "text": "function add_fields(link, association, content) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\");\n $(link).parent().before(content.replace(regexp, new_id));\n //$(link).parents('fieldset').append(content.replace(regexp, new_id));\n}", "title": "" }, { "docid": "76c6e24187703111732eceb2b7fc7c86", "score": "0.55566937", "text": "function fmg_toNewForm() {\n\tvar v = fmg_versionSelected();\n\tif (!v) return;\n\t//input new name and desc\n\tvar win1 = fm_createCenterWindow('win_id_newf', i18n_fmg.new1 + i18n_fmg.form, 400, 200, 'new1.gif');\n\tvar form1 = win1.attachForm(newstr);\n\tvar namei = form1.getInput('name');\n\tnamei.maxLength = 20;\n\tform1.getInput('desc').maxLength = 100;\n\tform1.setItemValue('desc', i18n_fmg.copyof+'['+\n\t\t\tfmg.formgrid.cells(v.frid, fmg.formgrid.getColIndexById(\"FORMNAME\")).getValue() + '][' +\n\t\t\tfmg.vergrid.cells(v.vrid, fmg.vergrid.getColIndexById(\"VERSIONNAME\")).getValue()+'].\\n');\n\t$(namei).focus();\n\tform1.attachEvent('onButtonClick', function(btid){\n\t\tif (btid=='fbok') {\n\t\t\tif (!form1.validate()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar name = form1.getItemValue('name');\n\t\t\tvar desc = form1.getItemValue('desc');\n\t\t\t//create\n\t\t\twin1.close();\n\t\t\tfmg.body_layout.cells('b').progressOn();\n\t\t\tvar ret = doPostSyncJson(fmg.rest_tonewf, {\"formid\":v.formid, \"versionid\":v.versionid, \"name\":name, \"desc\":desc});\n\t\t\tif (!ret || !ret.result) {\n\t\t\t\tmsgErr(i18n_fmg.msg_commitfail);\n\t\t\t} else {\n\t\t\t\tmsg(i18n_fmg.msg_succ);\n\t\t\t\tfmg_toPagef(1, 10);\n\t\t\t}\n\t\t\tfmg.body_layout.cells('b').progressOff();\n\t\t} else if (btid='fbcancel') {\n\t\t\twin1.close();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6584895b0b4e04e50bf3a1670fcfbfce", "score": "0.553699", "text": "function createBMForm(parentId, name, url) {\n $(\"select[name=bmcollections]\").val([parentId]).formSelect();\n $(\"input[name=bookmark]\").val(name);\n $(\"input[name=bmurl]\").val(url);\n $(\"#bmForm\").on(\"submit\", (event) => {\n event.preventDefault();\n createBM(\n $(\"input[name=bookmark]\").val(),\n $(\"input[name=bmurl]\").val(),\n $(\"textarea[name=bmcomment]\").val(), //textarea\n $(\"select[name=bmcolor]\").val(),\n $(\"select[name=bmcollections]\").val(), //dropdown menu\n () => location.replace(\"/\")\n );\n });\n $(\"#bmFormDiv\").show();\n}", "title": "" }, { "docid": "bc9c91c6cd05e8d61b267f4738e030b9", "score": "0.55307066", "text": "function clone(name, infoToast) {\n\n var input = {\n parentId: $scope.bpTree.ContextId,\n masterQuoteId: $scope.bpTree.wrapperCart.Id,\n name: name,\n cartType: $scope.cartType\n };\n \n fireRemoteAction('cloneMasterCart', input, {}, function(result){\n if(infoToast) {\n infoToast.hide();\n }\n var res = angular.fromJson(result);\n if(res.masterCartId) {\n toast(name + ' ' + $scope.customLabelsMap.MSClonedSuccMsg, '', 'success');\n //reload master quotes\n loadMasterCarts();\n } else if(res.message) {\n toast(res.message, '', 'error');\n } else {\n toast('Failed', '', 'error');\n }\n });\n }", "title": "" }, { "docid": "13ceaf4c7e430e59ab8cd58aab3fb741", "score": "0.5518583", "text": "function copyNode() {\n inItem.value = foodArray[selectedFoodIndex].item;\n inCalories.value = foodArray[selectedFoodIndex].calories;\n inDate.value = foodArray[selectedFoodIndex].date;\n inMealTime.value = foodArray[selectedFoodIndex].mealTime;\n inItem.focus();\n}", "title": "" }, { "docid": "abc90df2ce5cec605bd9e20baef61f5c", "score": "0.5511363", "text": "function state_newListForm()\n\t{\n\t\texpandEditListForm(editListForm);\n\n\t\t//hide item list if its up\n\t\thideItemEdit();\n\n\t\t//clear form\n\t\tclearForm();\n\n\t\t//fadeout the list edit item title\n\t\teditListItemTitle.fadeOut(200);\n\n\t\thideItemEditButton();\n\t\thideTemplateButton();\n\n\t\teditTemplateForm.fadeOut(200);\n\n\t\t//change submit button label\n\t\tchangeSubmitLabel(\"Create a New List\");\n\t}", "title": "" }, { "docid": "b137a8db2e0352d00fa91134b1c8bd1c", "score": "0.5494231", "text": "function addForm() {\n var $templateForm = $('#parameter-PLACEHOLDER-form');\n\n if (!$templateForm) {\n console.log('[ERROR] Cannot find template');\n return;\n }\n\n // Get Last index\n var $lastForm = $('.subform').last();\n\n var newIndex = 0;\n\n if ($lastForm.length > 0) {\n newIndex = parseInt($lastForm.data('index')) + 1;\n }\n\n // Maximum of 20 subforms\n if (newIndex > 20) {\n console.log('[WARNING] Reached maximum number of elements');\n return;\n }\n\n // Add elements\n var $newForm = $templateForm.clone();\n\n $newForm.attr('id', $newForm.attr('id').replace('PLACEHOLDER', newIndex));\n $newForm.attr('data-index', $newForm.attr('data-index').replace('PLACEHOLDER', newIndex));\n $newForm.data('index', newIndex);\n\n\n $newForm.find('div').each(function(idx) {\n var $item = $(this);\n\n if (this.hasAttribute('id')) {\n $item.attr('id', $item.attr('id').replace('PLACEHOLDER', newIndex));\n }\n if (this.hasAttribute('aria-labbelled-by')) {\n $item.attr('aria-labelled-by', $item.attr('id').replace('PLACEHOLDER', newIndex));\n }\n });\n $newForm.find('button').each(function(idx) {\n var $item = $(this);\n\n if (this.hasAttribute('id')) {\n $item.attr('id', $item.attr('id').replace('PLACEHOLDER', newIndex));\n }\n if (this.hasAttribute('href')) {\n $item.attr('href', $item.attr('href').replace('PLACEHOLDER', newIndex));\n }\n });\n $newForm.find('input').each(function(idx) {\n var $item = $(this);\n\n if (this.hasAttribute('id')) {\n $item.attr('id', $item.attr('id').replace('PLACEHOLDER', newIndex));\n }\n if (this.hasAttribute('name')) {\n $item.attr('name', $item.attr('name').replace('PLACEHOLDER', newIndex));\n }\n this.required = true\n });\n $newForm.find('a').each(function(idx) {\n var $item = $(this);\n\n if (this.hasAttribute('id')) {\n $item.attr('id', $item.attr('id').replace('PLACEHOLDER', newIndex));\n }\n if (this.hasAttribute('href')) {\n $item.attr('href', $item.attr('href').replace('PLACEHOLDER', newIndex));\n }\n });\n\n // Append\n $('#subforms-container').append($newForm);\n $newForm.addClass('subform');\n $newForm.removeClass('is-hidden');\n\n $newForm.find('.remove').click(removeForm);\n\n}", "title": "" }, { "docid": "7aa413ddf42f37096eec57e22f82c3c6", "score": "0.54850674", "text": "function clone_form($orig_form) {\n var $new_form = $orig_form.clone();\n var $orig_textareas = $orig_form.find('textarea');\n var $new_textareas = $new_form.find('textarea');\n for (var i = 0; i < $orig_textareas.length; i++) {\n $new_textareas.eq(i).val(\n $orig_textareas.eq(i).val()\n );\n }\n var $orig_selects = $orig_form.find('select');\n var $new_selects = $new_form.find('select');\n for (var i = 0; i < $orig_selects.length; i++) {\n var $orig_options = $orig_selects.eq(i).find('option');\n var $new_options = $new_selects.eq(i).find('option');\n for (var j = 0; j < $orig_options.length; j++) {\n if ($orig_options.eq(j).is(':selected')) {\n $new_options.eq(j).attr({selected:'selected'})\n }\n }\n }\n return $new_form;\n}", "title": "" }, { "docid": "f6d479c6657b01abe9f1a9a64af89988", "score": "0.5480213", "text": "function ctb_add_form( $el, form_data, key, title, expanded, buttons ){\n var tabs = ctb_tmpls.tabs( {\n lis : ctb_tabs,\n active_tab : 'main',\n key : key\n } ),\n form_buttons = ( buttons ) ? generate_button_row(buttons) : '',\n tabbed_content = ctb_tmpls.tabbed_panels( {\n tabs : tabs,\n panels : generate_panels( key, ctb_tabs, form_data ),\n buttons : form_buttons\n } );\n //beforeend\n $el.insertAdjacentHTML('afterbegin', ctb_tmpls.post_box( {\n css_id : key,\n title : title,\n content : tabbed_content,\n expanded : expanded\n } ) );\n var $postbox = $doc.getElementById(key);\n activate_panel( $postbox, key, ctb_tabs );\n }", "title": "" }, { "docid": "98fac1e810e5c2861bdae01648f64baf", "score": "0.54694444", "text": "function ideasInitNew(values)\n{\n element = $('#idea_template').clone().removeAttr('id');\n element.prependTo('#ideas');\n var options = {\n done: function(ev, data) {\n ideasInitNew(data.values)\n if (bvpInitTemplates != undefined) bvpInitTemplates();\n },\n values: values\n }\n element.entryform(options);\n}", "title": "" }, { "docid": "f20cec111c9155960a43376c09f7735b", "score": "0.54681665", "text": "function addNewRow() {\n var template = '<li>' + $('.kb_record').html() + '</li>';\n var clone = $(template).clone();\n $(clone).find('.collapsible-heading').css('display','none');\n $(clone).find('.content').css('display','block');\n $(clone).find('.content').parent().css('height','380px');\n $(clone).find('.kb_container').addClass('mui-panel');\n $(clone).find('.kb_container').css('margin-left', '1%');\n $(clone).find('.kb_container').css('padding-top', '0%');\n $('#kb_list').append(clone);\n}", "title": "" }, { "docid": "e426014f8160636028888f53a60b0e25", "score": "0.5465255", "text": "addFiledInsert() {\n const parent = this.closest('.work-data').querySelector('.fields');\n const tmp = document.createElement('template');\n tmp.innerHTML = addFiledInsert;\n parent.appendChild(tmp.content);\n }", "title": "" }, { "docid": "d83b1b0bba26c6fc9568957ea7cdb65a", "score": "0.5459685", "text": "function createNewCustomrBlock() {\n var newCustomer = document.createElement(\"div\");\n newCustomer.classList.add(\"addCustomerField\");\n \n var customerInput = document.createElement(\"input\");\n customerInput.setAttribute(\"type\", \"text\");\n customerInput.setAttribute(\"value\", \"Bill To\");\n customerInput.style.marginRight = \"4px\";\n \n var block1Field = document.createElement(\"button\");\n block1Field.classList.add(\"block1__field\");\n block1Field.classList.add(\"block1__field-1\");\n \n $(block1Field).on(\"click\", function(e) {\n e.preventDefault();\n });\n \n var customerSpan = document.createElement(\"div\");\n customerSpan.textContent = \"Choose\";\n \n var customerInputField = document.createElement(\"span\");\n customerInputField.textContent = \"a customer\";\n \n var addCustomerBtn = document.createElement(\"div\");\n addCustomerBtn.classList.add(\"addCustomer\");\n addCustomerBtn.textContent = \"+Add\";\n addCustomerBtn.addEventListener(\"click\", addNewBlockCustomer);\n \n customerSpan.appendChild(customerInputField);\n block1Field.appendChild(customerSpan);\n\n newCustomer.appendChild(customerInput);\n newCustomer.appendChild(block1Field);\n newCustomer.appendChild(addCustomerBtn);\n \n return newCustomer;\n}", "title": "" }, { "docid": "5de581389c4c5eccb26f415c87e7529f", "score": "0.545046", "text": "function createForm(id){\r\n document.getElementById(\"frm\").reset();\r\n var updateitem = items.get(id);\r\n \r\n document.getElementById(\"CreateUpdateBtn\").onclick = function(){Create()};\r\n document.getElementById(\"CreateUpdateBtn\").innerHTML = 'Create';\r\n // $('#DuplicateBtn').addClass('nodisplay');\r\n document.getElementById(\"DuplicateBtn\").style.display = \"none\";\r\n\r\n document.getElementById(\"ColorPickerID\").value = ''; \r\n\r\n \r\n }", "title": "" }, { "docid": "089bd3458f3f5c251dfbf85644f81595", "score": "0.5448511", "text": "function detailAddNew() {\n\t$(\"#empresa_muestra_resultado table\").html('');\n\t\n\tdocument.getElementById(\"saveDetail\").disabled=false;\n\tclearForm(\"form2\");\n\tsetFocusOnForm(\"form2\");\n\tdocument.getElementById(\"saveDetail\").value = \"Añadir\";\n}", "title": "" }, { "docid": "4455be140d045bdfca80c370349830b7", "score": "0.54473937", "text": "function addNew(){\n var headers = getHeaders();\n var container = document.getElementById(\"addNewContainer\");\n \n /*\n * clear all the child nodes in modal body\n */\n while (container.hasChildNodes()) {\n container.removeChild(container.lastChild);\n }\n //container.innerHTML+='<input type=\"hidden\" id=\"vData\" modalid=\"\" errflag=\"\" pendingReq=\"0\"/>';\n for(var i=0;i<headers.length;i++){\n var divmain = document.createElement(\"div\");\n divmain.className=\"form-group\"; //lahiru prev divmain.className=\"control-group\";\n\n var label =document.createElement(\"label\");\n label.className=\"control-label\";\n label.innerHTML=headers[i];\n\n\n var divin = document.createElement(\"div\");\n divin.className=\"controls\";\n\n var input=document.createElement(\"input\");\n input.type=\"text\";\n input.id=\"val\"+i;\n input.className=\"input-xlarge focused\";\n\n //divin.appendChild(input); lahiru\n divmain.appendChild(label);\n divmain.appendChild(input);\n container.appendChild(divmain);\n \n }\n /*\n * set hyperlink of add new button to add new modal\n */\n var a = document.getElementById('btnAddRow');\n a.href = \"#addNewModal\"; \n \n}", "title": "" }, { "docid": "eb038f1423375ddcc1a63691093533ac", "score": "0.5428298", "text": "function form_cliente(){\n mod_add_form(\"POST\",\"view/cliente/form.php\",\"html\",\"#page-body\",\"\");\n }", "title": "" }, { "docid": "32b1151189357f27f39aa720d6a0eceb", "score": "0.5407818", "text": "netzkeOnDupInForm() {\n const selModel = this.getSelectionModel();\n const recordId = selModel.getSelection()[0].getId();\n this.netzkeLoadComponent(\"edit_window\", {\n title: \"Duplicate in Form\",\n serverConfig: {\n record_id: recordId\n },\n callback(w) {\n w.show();\n const form = w.items.first();\n form.baseParams = {\n dup: true\n };\n w.on(\n \"close\",\n function() {\n if (w.closeRes === \"ok\") {\n this.store.load();\n }\n },\n this\n );\n },\n scope: this\n });\n }", "title": "" }, { "docid": "aee1999b0454713520de6f4a55f05f5e", "score": "0.5402953", "text": "function Clone () {\r\n var tagsList = document.querySelector (\".tagsList\");\r\n var clonedTable = tagsList.cloneNode (true);\r\n clonedTable.id = \"\"; // clear the id property of the cloned table\r\n\r\n var editarTagsModalWrapper = document.querySelector (\".EditarTagsNuvemClone\");\r\n editarTagsModalWrapper.appendChild (clonedTable);\r\n}", "title": "" }, { "docid": "561146739062354e8d980b7ffa1f63da", "score": "0.53976613", "text": "_populateEditModal(item) {\r\n\t\tlet address = item.values()['mail-address-line-2'];\r\n\t\tconst city = address.substring(0, address.indexOf(','));\r\n\t\tconst state = address.substring(address.indexOf(', '), address.lastIndexOf(' ')).substring(2);\r\n\t\tconst zipcode = address.substring(address.lastIndexOf(' ')).substring(1);\r\n\t\t$('#editName').html(item.values()['name']);\r\n\t\t$('#editNameInput').val(item.values()['name']);\r\n\t\t$('#editAddress').html(item.values()['mail-address-line-1']);\r\n\t\t$('#editAddressInput').val(item.values()['mail-address-line-1']);\r\n\t\t$('#editCity').html(city);\r\n\t\t$('#editCityInput').val(city);\r\n\t\t$('#editState').html(state);\r\n\t\t$('#editStateInput').val(state);\r\n\t\t$('#editZipcode').html(zipcode);\r\n\t\t$('#editZipcodeInput').val(zipcode);\r\n\t\t$('#edit-modal').data('id', item.values()['address-id']);\r\n\t}", "title": "" }, { "docid": "a95dc149f8ad028193ba2a8775d0fd5e", "score": "0.53966403", "text": "function editRecipeInfo(event) {\n event.preventDefault();\n\n if($('.addRecipePanel').is(':visible')) {\n togglePanels();\n }\n\n // clear any inputs in Add & Edit Recipe Panel\n $('.addRecipe fieldset input').val('');\n $('.addRecipe fieldset textarea').val('');\n $('.editRecipe fieldset input').val('');\n $('.editRecipe fieldset textarea').val('');\n\n var _id = $(this).attr('rel');\n\n // Get Index of object based on id value\n var arrayPosition = recipeListData.map(function(arrayItem) { return arrayItem._id; }).indexOf(_id);\n // Get our Recipe Object\n var thisRecipeObject = recipeListData[arrayPosition];\n // Populate Edit Recipe Panel\n $('#editName').val(thisRecipeObject.name);\n $('#editCuisine').val(thisRecipeObject.cuisine);\n $('#editDescription').val(thisRecipeObject.description);\n $('#editPicture').val(thisRecipeObject.picture);\n $('#editRating').val(thisRecipeObject.rating);\n $('#editRecipeText').val(thisRecipeObject.recipe);\n $('#editServing').val(thisRecipeObject.serving);\n $('#editTags').val(thisRecipeObject.tags);\n $('#editMeats').val(ingredientList(thisRecipeObject.ingredients.meats));\n $('#editVeggies').val(ingredientList(thisRecipeObject.ingredients.veggies));\n $('#editSpices').val(ingredientList(thisRecipeObject.ingredients.spices));\n $('#editCondiments').val(ingredientList(thisRecipeObject.ingredients.condiments));\n $('#editDry').val(ingredientList(thisRecipeObject.ingredients.dry));\n $('#editOther').val(ingredientList(thisRecipeObject.ingredients.other));\n $('#editCompanion').val(thisRecipeObject.companionname);\n $('#editCompanionMeats').val(ingredientList(thisRecipeObject.companion.meats));\n $('#editCompanionVeggies').val(ingredientList(thisRecipeObject.companion.veggies));\n $('#editCompanionSpices').val(ingredientList(thisRecipeObject.companion.spices));\n $('#editCompanionCondiments').val(ingredientList(thisRecipeObject.companion.condiments));\n $('#editCompanionDry').val(ingredientList(thisRecipeObject.companion.dry));\n $('#editCompanionOther').val(ingredientList(thisRecipeObject.companion.other));\n\n $('.editRecipe').attr('rel', thisRecipeObject._id);\n\n\n}", "title": "" }, { "docid": "aa0ade3aa7208546695a7490902f9f36", "score": "0.53860956", "text": "function addRessourceForm(collectionHolder) {\n var newForm = collectionHolder.data('prototype');\n\n var index = collectionHolder.data('index');\n\n newForm = newForm.replace(/__name__/g, index);\n\n collectionHolder.data('index', index + 1);\n\n var $newFormLi = $(\"<td id='td_\"+ index +\"'></td>\").append(newForm);\n $('#appartment_ressources').append($newFormLi);\n}", "title": "" }, { "docid": "5a791e96c7a65f192f425f9dd974fbcf", "score": "0.5371396", "text": "render() {\n return(\n <div className='form-group' id={ this.props.id }>\n { this.props.title ? <h2>{ this.props.title }</h2> : null }\n { this.recursiveCloneChildren( this.props.children, 'FormField', {\n handleChange: this.handleChange\n })}\n </div>\n )\n }", "title": "" }, { "docid": "f9e564ad36f3ae022d10d7395c18fbc5", "score": "0.535816", "text": "function addQualificationField(){\n var button = document.getElementById('addqualification')\n var qualification = document.getElementById('qualification')\n var fieldNumbers = qualification.childElementCount - 2;\n var numberOfQualifications = document.getElementById('numberOfQualifications')\n var cloneElement = qualification.firstElementChild.cloneNode(true)\n cloneElement.className = \"field added\"\n cloneElement.id = \"qfield\" + fieldNumbers\n fieldNumbers += 1\n cloneElement.childNodes[3].value = \"\"\n cloneElement.childNodes[7].value = \"\"\n cloneElement.childNodes[3].name = \"qualification\" + fieldNumbers\n cloneElement.childNodes[7].name = \"awardingInstitute\" + fieldNumbers\n qualification.insertBefore(cloneElement,button)\n numberOfQualifications.value = fieldNumbers\n}", "title": "" }, { "docid": "e1fbac857c96b1a8a213934a2fbf3f44", "score": "0.5353764", "text": "function setupLinkFields() {\n var form = $('#link_preview');\n if (form.css('display') == 'block') {\n var attrs = ['name','description','caption'];\n for(var attr in attrs) {\n var attr_name = attrs[attr];\n form.append($('<input>').attr({type:'hidden',name:'message['+attr_name+']', value:$('#link_preview .'+attr_name).text()}));\n }\n if ($('#link_preview #preview_thumbnail:checked').val() != \"1\") {\n form.append($('<input>').attr({type:'hidden',name:'message[media]', value:$('#link_preview .thumbnail img:first').attr('src')}));\n }\n } else {\n\t\tvar attrs = ['name','description','media','caption'];\n for(var attr in attrs) {\n var attr_name = attrs[attr];\n form.append($('<input>').attr({type:'hidden',name:'message['+attr_name+']', value:null}));\n }\n\t}\n}", "title": "" }, { "docid": "c518fc8a60c1175a7a76291c6dbe6e09", "score": "0.53490067", "text": "function formContent(){\n return `<label>Common Name:</label>\n <input id='common' class=\"herbform\" type=\"text\" value=\"${this.commonName || \"\"}\"><br>\n <label>Latin Name:</label>\n <input id='latin' class=\"herbform\" type=\"text\" value=\"${this.latinName || \"\"}\"><br>\n <label>Medicinal Uses:</label><br>\n <textarea rows = \"5\" cols = \"60\" id='medicinal' class=\"textarea\" type=\"text_area\" form='herbForm'>${this.medicinalUses || \"\"}</textarea><br>\n <label>Spiritual Uses:</label><br>\n <textarea rows = \"5\" cols = \"60\" id='spiritual' class=\"textarea\" type=\"text_area\" form='herbForm'>${this.spiritualUses || \"\"}</textarea><br>\n <label>History:</label><br>\n <textarea rows = \"5\" cols = \"60\" id='history' class=\"textarea\" type=\"text_area\" form='herbForm'>${this.history || \"\"}</textarea><br>`\n}", "title": "" }, { "docid": "d33a505d967e005bd22175607b13eb73", "score": "0.53435284", "text": "function fillAddMajorForm(notiId, majorName, majorDescription) {\n $(\"#formAddMajor\").find(\"input[name='notiId']\").val(notiId);\n $(\"#formAddMajor\").find(\"input[name='majorName']\").val(majorName);\n $(\"#formAddMajor\").find(\"textarea[name='majorDescription']\").text(majorDescription.replace(/\\n/g, \"\\\\n\"));\n}", "title": "" }, { "docid": "83de022921b4d4638a11d4de899c1d99", "score": "0.53320354", "text": "function saveForm(){\n let item = document.getElementById(saveItemid);\n item.getElementsByTagName(\"h3\")[0].innerHTML = recipeName.value;\n item.getElementsByClassName(\"hideDiv\")[0].innerHTML= recipeCategory.value;\n item.getElementsByClassName(\"hideDiv\")[1].innerHTML= ingredients.value;\n item.getElementsByClassName(\"hideDiv\")[2].innerHTML = directions.value;\n}", "title": "" }, { "docid": "d3e88ba68fd94e4b6ca3daf577581d25", "score": "0.53237844", "text": "function lrcHotCats_multiedit_createForm(){\n var OldForms = document.getElementById('mw-normal-catlinks').getElementsByTagName('form');\n while(OldForms[0]) OldForms[0].parentNode.removeChild(OldForms[0]);\n var OldLinks = document.getElementById('mw-normal-catlinks').getElementsByTagName('a');\n for(var a=0;a<OldLinks.length;a++){\n OldLinks[a].style.display=\"\";\n }\n for(var a=0;a<lrcHotCatsMatrix.CatLink.length;a++){\n if(!lrcHotCatsMatrix.CatLink[a]) continue;\n if(lrcHotCatsMatrix.CatLinkIsRed[a]){\n if(!hasClass(lrcHotCatsMatrix.CatLink[a], \"new\")) addClass(lrcHotCatsMatrix.CatLink[a], \"new\");\n }else{\n removeClass(lrcHotCatsMatrix.CatLink[a], \"new\");\n }\n }\n var OldSpans = document.getElementById('mw-normal-catlinks').getElementsByTagName('span');\n for(var a=0;a<OldSpans.length;a++){\n if(OldSpans[a].id != 'OldDefaultSortSpan') OldSpans[a].style.display=\"\";\n }\n if(!document.getElementById(\"lrcHotCats_addlink\")) lrcHotCats_add_new ( document.getElementById(\"lrcHotCats_add\") );\n var Legend = \"\";\n if(lrcHotCatsVariables.ShowLegend){\n Legend = '<small>'\n + '<a href=\"'+lrcHotCatsVariables.docURL+'\" title=\"'+lrcHotCatsText.LabelTitle+'\" target=\"_blank\" '\n + 'style=\"color:#002BB8;padding:0.2em;margin-left:'+(lrcHotCatsVariables.ShowInline ? 5 :100 )+'px;\">'\n + '&nbsp;<b>'+lrcHotCatsText.LabelText+'</b>&nbsp;:'\n + '&nbsp;<span class=\"RemovedCategory\">'+lrcHotCatsText.RecapRemove+'</span>'\n + '&nbsp;<span class=\"ModifiedCategory\">'+lrcHotCatsText.RecapModify+'</span>'\n + '&nbsp;<span class=\"AddedCategory\">'+lrcHotCatsText.RecapAdd+'</span>'\n + '</a>'\n + '</small>'\n }\n var BR = \"\";\n if(!lrcHotCatsVariables.ShowInline) BR = \"<br />\";\n\n var RadioBoxes = \"\";\n \n var MinorOneChecked = ( (lrcHotCatsVariables.Minoredit==-1) ? 'checked=\"checked\" ' : '' );\n var MinorTwoChecked = ( (lrcHotCatsVariables.Minoredit==0) ? 'checked=\"checked\" ' : '' );\n var MinorThreeChecked = ( (lrcHotCatsVariables.Minoredit==1) ? 'checked=\"checked\" ' : '' );\n var WatchOneChecked = ( (lrcHotCatsVariables.Watchthis==-1) ? 'checked=\"checked\" ' : '' );\n var WatchTwoChecked = ( (lrcHotCatsVariables.Watchthis==0) ? 'checked=\"checked\" ' : '' );\n var WatchThreeChecked = ( (lrcHotCatsVariables.Watchthis==1) ? 'checked=\"checked\" ' : '' );\n RadioBoxes = '<span id=\"lrcHotCats_RadioBoxes\">'\n + '&nbsp;&nbsp;<span style=\"border:1px dotted silver;padding:0.1em;\">'\n + '<input id=\"Minor\" type=\"radio\" name=\"Minor\" '+MinorOneChecked+' style=\"cursor:pointer;\" '\n + 'title=\"'+lrcHotCatsText.Minoredit+' : '+lrcHotCatsText.RadioDefault+'\" />'\n + '<input id=\"Minor_0\" type=\"radio\" name=\"Minor\" '+MinorTwoChecked+' style=\"cursor:pointer;\" '\n + 'title=\"'+lrcHotCatsText.Minoredit+' : '+lrcHotCatsText.RadioNo+'\" />'\n + '<input id=\"Minor-1\" type=\"radio\" name=\"Minor\" '+MinorThreeChecked+' style=\"cursor:pointer;\" '\n + 'title=\"'+lrcHotCatsText.Minoredit+' : '+lrcHotCatsText.RadioYes+'\" />'\n + '</span>&nbsp;&nbsp;<span style=\"border:1px dotted silver;padding:0.1em;\">'\n + '<input id=\"Watch\" type=\"radio\" name=\"Watch\" '+WatchOneChecked+' style=\"cursor:pointer;\" '\n + 'title=\"'+lrcHotCatsText.Watchthis+' : '+lrcHotCatsText.RadioDefault+'\" />'\n + '<input id=\"Watch0\" type=\"radio\" name=\"Watch\" '+WatchTwoChecked+' style=\"cursor:pointer;\" '\n + 'title=\"'+lrcHotCatsText.Watchthis+' : '+lrcHotCatsText.RadioNo+'\" />'\n + '<input id=\"Watch1\" type=\"radio\" name=\"Watch\" '+WatchThreeChecked+' style=\"cursor:pointer;\" '\n + 'title=\"'+lrcHotCatsText.Watchthis+' : '+lrcHotCatsText.RadioYes+'\" />'\n + '</span>'\n + '</span>';\n\n var Link = document.getElementById('lrcHotCats_modify_multi_Link');\n var Span = Link.parentNode;\n var Form = document.createElement('form');\n Form.id = \"lrcHotCats_modify_multi_form\";\n Form.style.display = \"inline\";\n Form.innerHTML = ''\n + Legend\n + BR\n + '<input id=\"lrcHotCats_modify_multi_InputOK\" type=\"button\" disabled=\"disabled\" '\n + 'value=\"'+lrcHotCatsText.MultiInputOK+'\" '\n + 'onclick=\"lrcHotCats_multiedit_FormOK()\" onselect=\"lrcHotCats_multiedit_FormOK()\" />'\n + '<input id=\"lrcHotCats_modify_multi_InputCancel\" type=\"button\" '\n + 'value=\"'+lrcHotCatsText.MultiInputCancel+'\" '\n + 'onclick=\"lrcHotCats_multiedit_CancelForm()\" onselect=\"lrcHotCats_multiedit_CancelForm()\" />'\n + RadioBoxes\n + BR\n Span.appendChild(Form);\n Link.style.display = \"none\";\n lrcHotCats_Multi_Edit = true;\n var LP = document.getElementById( 'livePreview' );\n if(LP) LP.scrollTop = parseInt(LP.style.height.split(\"px\").join(\"\"));\n document.getElementById(\"lrcHotCats_modify_multi_InputCancel\").focus();\n}", "title": "" }, { "docid": "6f6c2186b2b7af3f76aeeab6c8037de8", "score": "0.5323711", "text": "function createAddForm() {\n var addField = commonDiv.cloneNode(true);\n addField.classList.add('add-controls');\n // var addContainer = document.createElement('div');\n var title = commonTitle.cloneNode(true);\n title.innerHTML = 'Enter text';\n var input = commonInput.cloneNode(true);\n var addBbutton = document.createElement('button');\n addBbutton.classList.add('button');\n addBbutton.innerText = 'Add';\n addField.appendChild(title);\n addField.appendChild(input);\n // addField.appendChild(addContainer);\n addField.appendChild(addBbutton);\n\n return addField;\n }", "title": "" }, { "docid": "e6dc4b2ed6202ac167ebd4baedc72342", "score": "0.5319807", "text": "function _multipom_copy()\r\n{\r\n\tvar htmlAreaObj = _getAreaObjByDocView('12702');\r\n\tvar objAjax = htmlAreaObj.getHTMLAjax();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\t\r\n\tif(!isValidRecord(true))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tif(objHTMLData!=null && objHTMLData.hasUserModifiedData() && objHTMLData.isDataModified())\r\n\t{\r\n\t\tvar htmlErrors = objAjax.error();\r\n\t\thtmlErrors.addError(\"confirmInfo\", szMsg_Changes, false);\r\n\t\tmessagingDiv(htmlErrors, \"objHtmlData.performSaveChanges(_multipomRefreshFields)\", \"_continue_multipom_copy()\");\r\n\t\treturn;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t_continue_multipom_copy();\r\n\t}\r\n}", "title": "" }, { "docid": "e6dc4b2ed6202ac167ebd4baedc72342", "score": "0.5319807", "text": "function _multipom_copy()\r\n{\r\n\tvar htmlAreaObj = _getAreaObjByDocView('12702');\r\n\tvar objAjax = htmlAreaObj.getHTMLAjax();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\t\r\n\tif(!isValidRecord(true))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tif(objHTMLData!=null && objHTMLData.hasUserModifiedData() && objHTMLData.isDataModified())\r\n\t{\r\n\t\tvar htmlErrors = objAjax.error();\r\n\t\thtmlErrors.addError(\"confirmInfo\", szMsg_Changes, false);\r\n\t\tmessagingDiv(htmlErrors, \"objHtmlData.performSaveChanges(_multipomRefreshFields)\", \"_continue_multipom_copy()\");\r\n\t\treturn;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t_continue_multipom_copy();\r\n\t}\r\n}", "title": "" }, { "docid": "fff8d560638077d218fa18ab7b9d37dc", "score": "0.53120965", "text": "function fnFormatDetails(nTr) {\n\n\n var oFormObject = document.forms['bincard'];\n\n oFormObject.elements[\"binquantityin\"].value = aDataGlobal[4];\n oFormObject.elements[\"binmax\"].value = aDataGlobal[5];\n oFormObject.elements[\"binmin\"].value = aDataGlobal[6];\n\n oFormObject.elements[\"binbatch\"].value = aDataGlobal[9];\n oFormObject.elements[\"bins11\"].value = aDataGlobal[10];\n\n oFormObject.elements[\"delivery\"].value = aDataGlobal[11];\n\n\n oFormObject.elements[\"binedit\"].value = 'true';\n oFormObject.elements[\"binuuid\"].value = aDataGlobal[2];\n\n $j(\"#bincard\").show();//\n\n}", "title": "" }, { "docid": "c092e9e87132258e567c8d3cb66cdb31", "score": "0.53104705", "text": "function commentCreate() {\n\tclipCreation.selectedElements = getSelectedElements();\n\tshowCommentSection();\n\t$(\"#newComment\").show();\n}", "title": "" }, { "docid": "c51011ba822d3c3a00273e741583402d", "score": "0.5304111", "text": "function duplicateField(divTag)\n{\n\tvar aTag = divTag.children().first();\n\tvar length = divTag.children('#aTag').length;\n\t\n\tif (length < 3){\n\t\t\n\t\t$( \"<br />\" ).insertBefore(aTag.clone(true).appendTo(divTag));\n\t\taTag.children().first().val(\"from SP\");\n\t\tlength++;\n\t}\n\t\n\telse if(length < 15){\n\t\t\n\t\tdivTag.css({ 'width': '300px', 'height': '100px', 'overflow': 'scroll' });\n\t\t$( \"<br />\").insertBefore(aTag.clone(true).appendTo(divTag));\n\t\taTag.children().first().val(\"from SP\");\n\t\tlength++;\n\t}\n}", "title": "" }, { "docid": "b37b7a6b47b5f514313edfb0485e15dd", "score": "0.5296238", "text": "function cloneSubjectElement(data, ncode) {\n // console.log(data);\n if (data == undefined || data == null) {\n var _strHtml = '';\n _strHtml += ' <div class=\"row subject \">';\n _strHtml += '<div class=\"col-sm-12 col-md-6\">';\n _strHtml += ' <div class=\"form-group\"> <label class=\"control-label\">Subject Name</label>';\n _strHtml += '<div><input type=\"text\" maxlength=\"30\" placeholder=\"Enter name of the subject..\" onfocus=\"onFocusRemoveValidation(this)\" class=\"form-control required\" name=\"subject-name\" value=\"\" ></div>';\n _strHtml += '</div></div>';\n _strHtml += '<div class=\"col-sm-4\">';\n _strHtml += '<div class=\"form-group\"><label class=\"control-label\" > Marks</label>';\n _strHtml += '<div><input type=\"Number\" placeholder=\"Enter marks scored..\" onfocus=\"onFocusRemoveValidation(this)\" class=\"form-control required\" onchange=\"handleChange(this);\" name=\"marks\" value=\"\" ></div>';\n _strHtml += '</div></div> ';\n\n\n if (ncode == UpdateModalCode) {\n _strHtml += '<div class=\"col-sm-2\"><span class=\"btn btn-default closebtn\" onclick=\"removeSubjectElement(this,' + UpdateModalCode + ')\" style=\"float:right;\">x</div></div>';\n $('#update-subject-id').prepend(_strHtml);\n }\n\n else if (ncode == AddModalCode) {\n _strHtml += '<div class=\"col-sm-2\"><span class=\"btn btn-default closebtn\" onclick=\"removeSubjectElement(this,' + AddModalCode + ')\" style=\"float:right;\">x</div></div>';\n $('#add-subject-id').prepend(_strHtml);\n }\n\n }\n else {\n var _strHtml = '';\n _strHtml += ' <div class=\"row subject\" data-subject-id=\"' + data.id + '\">';\n _strHtml += '<div class=\"col-md-5 col-sm-5\">';\n _strHtml += ' <div class=\"form-group\"> <label class=\"control-label\">Subject Name</label>';\n _strHtml += '<div><input type=\"text\" maxlength=\"30\" placeholder=\"Enter name of the subject..\" onfocus=\"onFocusRemoveValidation(this)\" class=\"form-control required\" name=\"subject-name\" data-id=\"' + data.id + '\" value=\"' + data.subjectName + '\" ></div>';\n _strHtml += '</div></div>';\n _strHtml += '<div class=\"col-md-5 col-sm-5\">';\n _strHtml += '<div class=\"form-group\"><label class=\"control-label\" > Marks</label>';\n _strHtml += '<div><input type=\"Number\" onfocus=\"onFocusRemoveValidation(this)\" class=\"form-control required\" onchange=\"handleChange(this);\" name=\"marks\" value=\"' + data.marks + '\"></div>';\n _strHtml += '</div></div> ';\n _strHtml += '<div class=\"col-sm-2\"><span class=\"btn btn-default closebtn\" onclick=\"removeSubjectElement(this,UpdateModalCode)\" style=\"float:right;\">x</div></div>';\n $('#update-subject-id').prepend(_strHtml);\n }\n\n $('.add-subject-message').hide();\n}", "title": "" }, { "docid": "19669e9909797bce8c4f603695307da2", "score": "0.52947086", "text": "function gateTypeBtnClick(btn) {\n var formId = btn.closest('form').attr('id');\n \n //clone the template\n var tpl = cloneTemplate(formId);\n \n // focus the text field after select\n $(tpl).children('select').change(function () {\n $(this).siblings('input').focus();\n });\n \n // add the new template to the dom\n $(btn).parent().after(tpl);\n \n tpl.children('.removeBtn').removeAttr('style');\n tpl.children('.removeBtn').before(' |&nbsp;');\n // display the entire new template\n tpl.fadeIn('fast');\n}", "title": "" }, { "docid": "18651d60fd1df47ad26f9f3058e05c64", "score": "0.52903605", "text": "function processCopy(param) {\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_rqst_no\", value: v_global.logic.key },\n { name: \"arg_user_id\", value: gw_com_module.v_Session.USR_ID }\n ]\n },\n target: [\n { type: \"FORM\", id: \"frmData_MainA\", query: $(\"#frmData_MainA\").attr(\"query\") + \"_I\", crud: \"insert\" }\n ],\n clear: [\n { type: \"GRID\", id: \"grdData_WORK\" },\n { type: \"GRID\", id: \"grdData_ACT\" },\n { type: \"FORM\", id: \"frmData_MemoA\" },\n { type: \"FORM\", id: \"frmData_MemoB\" }\n ],\n handler_complete: completeCopy\n };\n gw_com_module.objRetrieve(args);\n\n}", "title": "" }, { "docid": "3ad733c90b648fbaeea109cf29dd6b7a", "score": "0.52867275", "text": "function newMineral() {\n\t /*\n\t newUser - cleanup userForm\n\t */\n\t $$(\"mineralFormId\").clear();\n $$('minHardheidId').setValue(1);\n\t $$('maxHardheidId').setValue(10);\n // $$('formuleId').setContent('<div id=\"formuleFld\" class=\"formuleCls\" contenteditable=\"true\"></div>');\n // document.querySelector('.formuleCls').contentEditable = true;\n\n //console.log('newMineral', document.querySelector('.formuleCls').innerHTML);\n\t }", "title": "" }, { "docid": "f3416ab2c7599e5923eb8301441fc807", "score": "0.5286676", "text": "function addNew() {\n\tclearForm(\"form2\");\n\tdocument.getElementById(\"formTitle\").innerHTML = \"Crear cuenta de usuario\";\n\tdocument.getElementById(\"grabar\").disabled = false;\n\tsetFocusOnForm(\"form2\");\n}", "title": "" }, { "docid": "dee1c689021ed530ef1e369f22003a9c", "score": "0.5285842", "text": "function makeItemFormView() {\r\n\t\tvar view = '';\r\n\t\tview = view + '<div class=\"row justify-content-center\">';\r\n\t\tview = view + '<div class=\"col-md-8 order-md-1\">';\r\n\t\tview = view + '<h4 class=\"mb-3\">Please Input Item Infomation </h4>';\r\n\t\tview = view + '\t<form class=\"needs-validation\" novalidate>';\r\n\t\tview = view + '\t\t<div class=\"row col-md-6 mb-3\">';\r\n\t\tview = view + '\t\t\t<label for=\"itemName\">ItemName</label> ';\r\n\t\tview = view + '\t\t\t<input type=\"text\"class=\"form-control\" id=\"itemName\">';\r\n\t\tview = view + '\t\t</div>';\r\n\t\tview = view + '\t\t<div class=\"mb-3\">';\r\n\t\tview = view + '\t\t\t<label for=\"itemDescription\">itemDescription</label>';\r\n\t\tview = view + '\t\t\t<div class=\"input-group\">';\r\n\t\tview = view + '\t\t\t\t<input type=\"text\" class=\"form-control\" id=\"itemDescription\">';\r\n\t\tview = view + '\t\t\t</div>';\r\n\t\tview = view + '\t\t</div>';\r\n\t\tview = view + '\t\t<div class=\"row col-md-6 mb-3\">';\r\n\t\tview = view + '\t\t\t<label for=\"makerCode\">makerCode </label> ';\r\n\t\tview = view + '\t\t\t<input type=\"text\" class=\"form-control\" id=\"makerCode\">';\r\n\t\tview = view + '\t\t</div>';\r\n\t\tview = view + '\t\t<div class=\"row col-md-6 mb-3\">';\r\n\t\tview = view + '\t\t\t<label for=\"price\">price</label> ';\r\n\t\tview = view + '\t\t\t<input type=\"text\" class=\"form-control\" id=\"price\">';\r\n\t\tview = view + '\t\t</div>';\r\n\t\tview = view + '\t\t<div class=\"mb-3\">';\r\n\t\tview = view + '\t\t\t<label for=\"saleStatus\">saleStatus</label>';\r\n\t\tview = view + '\t\t\t<div class=\"input-group\">';\r\n\t\tview = view + '\t\t\t\t<div class=\"form-check form-check-inline\">';\r\n\t\tview = view + '\t\t\t\t\t<input class=\"form-check-input\" type=\"radio\" name=\"saleStatus\" id=\"inlineRadio1\" value=\"0\" checked=checked>';\r\n\t\tview = view + '\t\t\t\t\t<label class=\"form-check-label\" for=\"inlineRadio1\">판매정지</label>';\r\n\t\tview = view + '\t\t\t\t</div>';\r\n\t\tview = view + '\t\t\t\t<div class=\"form-check form-check-inline\">';\r\n\t\tview = view + '\t\t\t\t\t<input class=\"form-check-input\" type=\"radio\" name=\"saleStatus\" id=\"inlineRadio2\" value=\"1\">';\r\n\t\tview = view + '\t\t\t\t\t<label class=\"form-check-label\" for=\"inlineRadio2\">판매중</label>';\r\n\t\tview = view + '\t\t\t\t</div>';\r\n\t\tview = view + '\t\t\t</div>';\r\n\t\tview = view + '\t\t</div>';\r\n\t\tview = view + '\t</form>';\r\n\t\tview = view + '</div>';\r\n\t\tview = view + '</div>';\r\n\t\tview = view + '<div class=\"row form-row float-right mx-auto\">';\r\n\t\tview = view + '<button class=\"btn float-left btn-warning mr-3\" type=\"button\" id=\"create-process-btn\">Create Item </button>';\r\n\t\tview = view + '<button class=\"btn float-right btn-danger mr-3\" type=\"button\" id=\"create-cancel-btn\">Cancel </button>';\r\n\t\tview = view + '</div>';\r\n\t\t\r\n\t\t$(\"#item-list\").html(view);\r\n\t}", "title": "" }, { "docid": "e9762efcb9dd22fd943ce822a3f95e3e", "score": "0.5280787", "text": "function displaySearchedFormular(val){\r\n\tconsole.log(\"displaySearchedFormular called...\");\r\n\tdocument.getElementById(\"dispform-inline\").style.visibility = 'visble';\r\n\tlet chiled = document.getElementById(\"dispform-inline\");\r\n\tlet newChld = chiled.cloneNode(true);\r\n\tdocument.getElementById(\"elem-holder\").appendChild(newChld);\r\n\r\n}", "title": "" }, { "docid": "fa36f85ddd9a451423dc026839b72780", "score": "0.527949", "text": "function __return_field(data){\n\t/*\n\tif (data.fieldName==\"\"){\n\t\tpos = buildform.form_fields.length;\n\t} else {\n\t\tpos = data.fieldName.toString().substr(5);\n\t}\n\t*/\n\tlen = buildform.form_fields.length;\n\tok = -1;\n\tfor (i=0; i<len ; i++){\n//\t\talert(\"compare \"+buildform.form_fields[i].fieldName+\" and \"+data.fieldName);\n\t\tif (buildform.form_fields[i].fieldName == data.fieldName){\n\t\t\tok = i;\n\t\t}\n\t}\n//\talert(\"ok = \"+ok)\n\tif (ok == -1){\n\t\tif((this.form_edit_field_index >= 0) && (buildform.form_url != '')) {\n\t\t\tpos = this.form_edit_field_index;\n\t\t\tthis.form_edit_field_index = -1;\n\t\t}\n\t\telse\n\t\t\tpos = len;\n\t} else {\n\t\tpos = ok;\n\t}\n\tbuildform.form_fields[pos] = new form_field();\n\tbuildform.form_fields[pos].clone(data);\n\tif (ok==-1){\n\t\tif (data.fieldName != '') {\n\t\t\tbuildform.form_fields[pos].fieldName = data.fieldName;\n\t\t\tbuildform.form_fields[pos].name = data.fieldName;\t\t\t\n\t\t}\n\t\telse {\n\t\t\tn = getFieldName(pos)\n\t\t\tbuildform.form_fields[pos].fieldName=n;\n\t\t\tbuildform.form_fields[pos].name=n;\n\t\t}\n\t}\n/*\tif (buildform.form_url!=\"\"){\n\t} else {\n\t\tbuildform.form_fields[pos].name=\"\";\n\t}*/\n\t//buildform.build();\n}", "title": "" }, { "docid": "cdf7a630e698e4adb1a4573561e1b284", "score": "0.5258237", "text": "function populateNewForm(id, fname, lname, email, cell, isAttending) {\n \"use strict\";\n if (previd != id) {\n guestType = 1;\n changeActiveMenu(id);\n markRSVP(isAttending);\n prepRSVPForm(guestType);\n populateNameFields(fname, lname);\n populateContactFields(email, cell);\n }\n}", "title": "" }, { "docid": "0e67bbd122cb2b50e8853646927aa6b3", "score": "0.5256196", "text": "addForm(e){\n\t\tconst newForm = document.createElement('form');\n\t\tnewForm.innerHTML = `<input type=\"text\" class=\"form-control form-control-sm input-meal mb-1\" value=\"Recipe Title\">\n\t\t <input type=\"text\" class=\"form-control form-control-sm input-link mb-1\" value=\"Recipe Link\">`;\n\t\t const button = e.target;\n\t\t button.insertAdjacentElement('beforebegin', newForm);\n\n\t}", "title": "" }, { "docid": "5d4f8961d7e9dbc093f8a40c197c6f4e", "score": "0.5255804", "text": "function agregarEspecialidad() {\n var nuevo = $(\"#esp\" + esp).clone();\n nuevo.prop(\"hidden\", false);\n nuevo.attr(\"id\", \"esp\" + (esp + 1));\n nuevo.find(\".especialidad\").attr(\"id\", \"especialidad\" + (esp + 1));\n nuevo.find(\".especialidad\").attr(\"placeholder\", \"Especialidad \" + (esp + 1));\n nuevo.find(\".especialidad\").val(\"\");\n nuevo.find(\".especialidadButton\").attr(\"onclick\", \"quitarEspecialidad(\" + (esp + 1) + \")\");\n nuevo.insertAfter($(\"#esp\" + esp));\n esp++;\n}", "title": "" }, { "docid": "6ddf2a36d5c5838a6de0a916b3c7677e", "score": "0.52476174", "text": "populateModal_() {\n this.appendChild(Modal.createModalIcon(this.toggleModal_.bind(this)));\n const captionEl = create(\"div\", {classname: cssClass.MODAL_CAPTION});\n\n Object.entries(copy.DEFAULT).forEach((section) => {\n const {TITLE, CONTENT} = section[1];\n\n const blockEL = create(\"div\", {classname: cssClass.PRIVACY_BLOCK});\n const headingEl = create(\"h2\", {\n classname: cssClass.PRIVACY_BLOCK_HEADING,\n copy: TITLE,\n id: cssId.MODAL_LABEL_ID,\n });\n const contentEl = create(\"p\", {\n classname: cssClass.PRIVACY_BLOCK_CONTENT,\n copy: CONTENT,\n });\n\n blockEL.appendChild(headingEl);\n blockEL.appendChild(contentEl);\n captionEl.appendChild(blockEL);\n });\n\n this.appendChild(captionEl);\n }", "title": "" }, { "docid": "cbc5b7c633414380bb9fa57aaf163107", "score": "0.5245921", "text": "function addMoreHeaderFields($this) {\n var hold = jQuery('.qhfields-block.add-field ul li:last-child');\n var newobj = hold.clone();\n var last_id = parseInt(hold.data('id'));\n last_id++;\n newobj.attr('data-id', last_id);\n var inputobj = newobj.find('input.qhoption');\n inputobj.attr('name', 'qhoption[' + last_id + ']');\n inputobj.attr('placeholder', 'Row ' + last_id);\n inputobj.attr('id', 'qhoption_' + last_id);\n inputobj.find('qhoption.input').attr('data-id', last_id);\n jQuery('.qhfields-block.add-field ul').append(newobj);\n}", "title": "" }, { "docid": "ae4ff4f580000ee280e28d7439c321c6", "score": "0.5242829", "text": "function enterProduct() {\n\t\tvar formTag = document.getElementsByTagName(\"form\"),\n\t\t\tselectLi = ge('select'),\n\t\t\tmakeInfoBlocks = document.createElement('select');\n\t\tmakeInfoBlocks.setAttribute(\"id\", \"groups\");\n\t\tfor (var i=0, j=productType.length; i<j; i++){\n\t\t\tvar makeOption = document.createElement('option');\n\t\t\tvar optionText = productType[i];\n\t\t\tmakeOption.setAttribute(\"value\", optionText);\n\t\t\tmakeOption.innerHTML = optionText;\n\t\t\tmakeInfoBlocks.appendChild(makeOption);\n\t\t}\n\t\tselectLi.appendChild(makeInfoBlocks);\n\t}", "title": "" }, { "docid": "cc4dcd109404bf319fd62c9da3967fe7", "score": "0.52408373", "text": "function addPriceForm(collectionHolder) {\n var newForm = collectionHolder.data('prototype');\n\n var index = $('.custom_table_prix > tbody > tr').length - 1;\n\n newForm = newForm.replace(/__name__/g, index);\n\n var $newFormLi = $(\"<tr id='tr_price_\"+ index +\"'></tr>\").append(newForm);\n $('.custom_table_prix tbody').append($newFormLi);\n checkIfRemoveEmptyRow();\n}", "title": "" }, { "docid": "8d8afbb4dd6b64c23f52ff83e8626c4d", "score": "0.5240747", "text": "function fLimpiar() {\n\t\tvaciaCombo(FORMULARIO + '.cbCCC');\n\t\tset(FORMULARIO + '.CheckMov', '');\n\t\tset(FORMULARIO + '.SaldoInicial', '');\n\t\tlistado1.limpia(true);\n\t\tocultarLista();\n\t\tfocaliza(FORMULARIO + \".cbBanco\");\n\n\t}", "title": "" }, { "docid": "4b6d8f8dceeba6f5afe4e5e553f78246", "score": "0.52400345", "text": "_submit(e) {\n e.preventDefault();\n const fragment = new DocumentFragment();\n const clone = this.template.content.cloneNode(true);\n\n if(this.input.validity.valid && this.input.value.trim().length != 0) {\n clone.querySelector(\"#description\").innerText = this.input.value;\n clone.querySelector(\"#date\").innerText = formattedDate(this.time ?? {hours: 8, minutes: 0});\n const date = new Date();\n this.time = {hours: date.getHours(), minutes: date.getMinutes()};\n fragment.appendChild(clone);\n document.body.appendChild(fragment);\n this.input.value = \"\";\n this._close();\n }\n }", "title": "" }, { "docid": "e34fcd77dd56ba34a852e33e681e5cc4", "score": "0.5238019", "text": "function PostInformation () {\n\t\tconsole.log('suppose to empty');\n\t\t$('#submitForm').empty();\n\t\t$('#submitForm').append($('<p class=\"text-center\">').text('Your infomation that you entered:'));\n\n\t\t$content = $('<ul class=\"text-center\">');\n\t\t$content.append($('<li>').text('college: ' + college));\n\t\t$content.append($('<li>').text('major '+ major));\n\t\t$content.append($('<li>').text('course: '+ course));\n\t\t$content.append($('<li>').text('subject: '+ subject));\n\t\t$content.append($('<li>').text('email: '+ email));\n\t\t$content.append($('<li>').text('message: '+ message));\n\n\t\t$('#submitForm').append($content);\n\t}", "title": "" }, { "docid": "e7eb8c452d9d35ae031616cc0484a158", "score": "0.52345043", "text": "function makeForm() {\r\n expendDiv();\r\n var formDiv = document.createElement(\"div\");\r\n var parentNode = document.getElementById(\"nameNode\");\r\n var checkFormDiv = document.getElementById(\"inputFormDiv\"); //Checking if div is already made\r\n if (checkFormDiv == null) {\r\n formDiv.setAttribute(\"id\", \"inputFormDiv\");\r\n formDiv.setAttribute(\"class\", \"popUpForm\");\r\n parentNode.appendChild(formDiv);\r\n var close_1 = document.createElement(\"span\");\r\n close_1.setAttribute(\"class\", \"close\");\r\n close_1.setAttribute(\"id\", \"closeForm\");\r\n close_1.innerHTML = \"&times;\";\r\n close_1.addEventListener(\"click\", function () { closeForm(); });\r\n formDiv.appendChild(close_1);\r\n var headerForm = document.createElement(\"h3\");\r\n headerForm.setAttribute(\"class\", \"formHeader\");\r\n dragDiv(headerForm, formDiv); //Making the div dragable\r\n headerForm.innerHTML = \"New entry\";\r\n formDiv.appendChild(headerForm);\r\n var hrelement = document.createElement(\"hr\");\r\n hrelement.setAttribute(\"class\", \"popuphrstyle\");\r\n formDiv.appendChild(hrelement);\r\n formFields(formDiv);\r\n }\r\n}", "title": "" }, { "docid": "175bdd330f52447deee16b0c582b08d8", "score": "0.52315456", "text": "function addForms() {\r\n $('.all-forms').append('<div class=\"nf\"><br><br><form class=\"add-item\" style=\"display:inline-block\">\\\r\n <input type=\"text\" placeholder=\"Enter an item (e.g. cupcakes)\" class=\"new-item n1\">\\\r\n </form>\\\r\n <form class=\"add-retail\" style=\"display:inline-block\">\\\r\n <input type=\"text\" placeholder=\"Enter a retailer brand (e.g. Walmart)\" class=\"new-item n2\">\\\r\n </form></div>');\r\n}", "title": "" }, { "docid": "ef272abdf8c4487637e47b38512016d3", "score": "0.52297807", "text": "function makePostData(blockTotal) {\n for (i = 0; i < blockTotal; i++) {\n var create = $('<input type=\"text\" class=\"inner\" name=\"post_data' + i + '\" id=\"post_data'+ i + '\">');\n\n $('#form-post-data').append(create);\n }\n }", "title": "" }, { "docid": "134760a6e1c4fb6c9205012ffc250690", "score": "0.5227955", "text": "function agregarTelMed() {\n var nuevo = $(\"#telMed\" + telMed).clone();\n nuevo.prop(\"hidden\", false);\n nuevo.attr(\"id\", \"telMed\" + (telMed + 1));\n nuevo.find(\".telMedInput\").attr(\"id\", \"telefonoMed\" + (telMed + 1));\n nuevo.find(\".telMedInput\").attr(\"placeholder\", \"Teléfono \" + (telMed + 1));\n nuevo.find(\".telMedInput\").val(\"\");\n nuevo.find(\".telMedButton\").attr(\"onclick\", \"quitarTelMed(\" + (telMed + 1) + \")\");\n nuevo.insertAfter($(\"#telMed\" + telMed));\n telMed++;\n cambiarBotonesMed();\n}", "title": "" }, { "docid": "431230caee9998c9481f15af584568cb", "score": "0.5221857", "text": "buildInterestForm() {\n // We are building an article to contain our form.\n const newInterestArticle = document.createElement(\"article\");\n newInterestArticle.id = \"newInterestArticle\"\n // Inside of our form we want a label and input for the name, destination, and cost, so we are using createElement to make them and append them to our article.\n const newInterestNameLabel = document.createElement(\"label\");\n newInterestNameLabel.id = \"newInterestLabel\"\n newInterestNameLabel.textContent = \"Name: \"\n newInterestArticle.appendChild(newInterestNameLabel);\n const newInterestNameInput = document.createElement(\"input\");\n newInterestNameInput.id = \"newInterestNameInput\";\n newInterestArticle.appendChild(newInterestNameInput);\n\n const newInterestDestinationLabel = document.createElement(\"label\");\n newInterestDestinationLabel.id = \"newInterestDestinationLabel\"\n newInterestDestinationLabel.textContent = \"Destination: \"\n newInterestArticle.appendChild(newInterestDestinationLabel);\n\n const newInterestDestinationInput = document.createElement(\"input\");\n newInterestDestinationInput.id = \"newInterestDestinationInput\";\n newInterestArticle.appendChild(newInterestDestinationInput);\n\n const newInterestCostLabel = document.createElement(\"label\");\n newInterestCostLabel.id = \"newInterestCostLabel\"\n newInterestCostLabel.textContent = \"Cost: \"\n newInterestArticle.appendChild(newInterestCostLabel);\n\n const newInterestCostInput = document.createElement(\"input\");\n newInterestCostInput.id = \"newInterestCostInput\";\n newInterestArticle.appendChild(newInterestCostInput);\n // Here we are building our dropdown to select where we want to add our new point of interest.\n const newInterestDropdown = document.createElement(\"select\");\n newInterestDropdown.id = \"newInterestPlace\";\n newInterestDropdown.name = \"Location\"\n newInterestArticle.appendChild(newInterestDropdown);\n\n const newInterestOption1 = document.createElement(\"option\");\n newInterestOption1.id = \"newInterestLocation1\";\n newInterestOption1.value = \"BuenosAires\";\n newInterestOption1.textContent = \"Buenos Aires\";\n newInterestDropdown.appendChild(newInterestOption1);\n\n const newInterestOption2 = document.createElement(\"option\");\n newInterestOption2.id = \"newInterest2Location\";\n newInterestOption2.value = \"santiago\";\n newInterestOption2.textContent = \"Santiago\";\n newInterestDropdown.appendChild(newInterestOption2);\n\n const newInterestOption3 = document.createElement(\"option\");\n newInterestOption3.id = \"newInterest3Location\";\n newInterestOption3.value = \"rioDeJaneiro\";\n newInterestOption3.textContent = \"Rio de Janeiro\";\n newInterestDropdown.appendChild(newInterestOption3);\n // We are creating a button that says 'Save New Interest' to our form, to which we will add functionality to POST it to our database.\n const saveNewInterestButton = document.createElement(\"button\");\n saveNewInterestButton.id = \"saveNewInterest\";\n saveNewInterestButton.textContent = \"Save New Interest\";\n newInterestArticle.appendChild(saveNewInterestButton)\n\n console.log(newInterestArticle, newInterestNameLabel, newInterestNameInput);\n\n return newInterestArticle;\n }", "title": "" }, { "docid": "ce8edede6edb0a7ddd020b4cccc278af", "score": "0.5210376", "text": "function cleanModalInputs(){\n var clean = \"\";\n $('*').val(clean);\n $(\"#clientInfo\").remove();\n $(\".prodTable\").remove();\n $(\".prodTableDetails\").remove();\n $(\"#ustatus select\").val(clean);\n $( '<div id=\"clientInfo\"></div>' ).insertAfter( \"#buttonLoadDniData\" );\n $('.formDniLoad').show();\n}", "title": "" }, { "docid": "fbcc66048ea926235d018a7d717984fc", "score": "0.5206901", "text": "function add_fields(link, association, content) { \nvar new_id = new Date().getTime(); \nvar regexp = new RegExp(\"new_\" + association, \"g\"); \n$(link).up().insert({ \nbefore: content.replace(regexp, new_id) \n}); \n}", "title": "" }, { "docid": "7879d412cca189b179e4199b664a7869", "score": "0.52045", "text": "function save_inline_module_form_cb(args){\n\tname = args[0];\n\tmodule = args[1];\n\thtml = args[2];\n\tstatus = args[3];\n\t//\n\tdocument.getElementById(module + '_div').innerHTML = html;\n\t//\n\thide_progress(module);\n}", "title": "" }, { "docid": "4eb7290baa79988963e2d371d3ada678", "score": "0.52038246", "text": "function add_detail_block(details,id_num) {\n $('#acc_image' +id_num).append(\"<div id='acc_content\" + id_num + \"' class='acc_content' transitionType='bottom' transitionTime='0.5' distance='30' delay='0' x='0' y='0' alignV='bottom'></div>\");\n $('#acc_content' + id_num).append(\"<div class='box' id='box\" + id_num + \"'></div>\");\n $('#box' + id_num).append(\"<a href='\" + all_data[\"content\"][id_num].link + \"'><h2 class='acc_title'>\" + details.title + \"</h2></a>\");\n $('#box' + id_num).append(\"<p class='acc_text'>\" + details.description + \"</p>\");\n}", "title": "" }, { "docid": "dfdfa36055e94401cd5cfd3ceeaeabeb", "score": "0.52002656", "text": "function formEditable() {\n\t\ttoggleFormButtons();\n\t\tjQuery('.notification').remove();\n\t\tjQuery('.user__info__input--editable')\n\t\t\t.attr('readonly', false)\n\t\t\t.each(function () {\n\t\t\t\tvar jQuerythis = jQuery(this);\n\t\t\t\tjQuerythis.attr('data-before', jQuerythis.val());\n\t\t\t});\n\t}", "title": "" }, { "docid": "42e2242fe4aec1cd4f1b62f984d0f0f9", "score": "0.51966494", "text": "function displayForm(form, d){\r\n var html ='<div class=\"panel-group\">';\r\n html +='<div class=\"panel panel-info\">';\r\n html +='<div class=\"panel-heading\"> Edit Feature';\r\n html += '<div class=\"col-xs-2 pull-right\"><button type=\"button\" class=\"btn btn-xs btn-danger\" id=\"close-feature-form\">X</button></div>';\r\n html += '</div>';\r\n html +='<div class=\"panel-body\">';\r\n html += '<form method=\"POST\" action=\"#\">';\r\n //name\r\n html += '<div class=\"form-group required\">';\r\n html += '<label for=\"feature-name\" class=\"col-xs-8 control-label\">Name</label><span class=\"text-danger col-xs-4\" id=\"feature-name-msg\"></span>';\r\n html += '<div class=\"col-xs-12\">';\r\n html += '<input class=\"form-control\" type=\"text\" value=\"'+d.name+'\" id=\"feature-name\">';\r\n html += '</div>';\r\n html += '</div>';\r\n //color\r\n html += '<div class=\"form-group\">';\r\n html += '<label for=\"feature-color\" class=\"col-xs-12 control-label\">Color</label>';\r\n html += '<div class=\"col-xs-12\">';\r\n html += '<input class=\"form-control\" type=\"color\" value=\"'+d.color+'\" id=\"feature-color\">';\r\n html += '</div>';\r\n html += '</div>';\r\n //button\r\n html += '<div class=\"form-group pull-right\">';\r\n html += '<div class=\"col-xs-12\">';\r\n html += '<button type=\"submit\" class=\"btn btn-primary\" id=\"save-feature\">Save Changes</button>';\r\n html += '</div>';\r\n html += '</div>';\r\n html += '</form>';\r\n html += '</div>';\r\n html += '</div>';\r\n html += '</div>';\r\n $(form).append(html);\r\n }", "title": "" }, { "docid": "b053ae8ef30b6b9d06a608a3fa7b59c7", "score": "0.51922774", "text": "function append_item(obj,layer,item_index){\n\n $.each(obj, function(w,j){\n\n var ww=w;\n var clas=\"\";\n var field_id = w;\n\n if( item_index == \"new\" ){\n j=getfieldparam(field_id,\"default\");\n if( j != \"\" ) clas+=\" badformat\";\n } else {\n j=eval( \"JSN[item_index].\" + field_id );\n }\n\n\n\n switch( w ){\n case \"color\":\n if( j != undefined ){\n if( j != \"\" ){\n j = \"<font color='\" + j + \"'>\" + j + \"</font>\";\n }\n }\n break;\n }\n if( j == undefined ) clas+=\" undefined\";\n\n if( REQ.properties != undefined ){\n\n $.each( REQ.properties,\n function(i,v){\n\n if( i== w ){\n j=v;\n clas+=\" waitapproval\";\n }\n }\n );\n\n }\n\n $(\".modal-body\").append(\"<div class='row\" + (( getfieldparam(field_id,\"hidden\") ) ? \" d-none\" : \"\") + \"'><div class='col-\" + layer + \"'></div><div class='col-4 col-md-2 label'>\" + ww +\n (( getfieldparam(field_id,\"readonly\") ) ? \"**\" : ( getfieldparam(field_id,\"mandatory\") ) ? \"*\" : \"\") +\n \"</div><div id=\\\"f_\" + field_id + \"\\\" class='col itemdata\" + clas + \"'\" + (( getfieldparam(field_id,\"readonly\") && item_index != \"new\" ) ? \"\" : \" contenteditable\") + \">\" + j + \"</div><div class='col-md-2 col-4'></div>\");\n\n }\n );\n\n}", "title": "" }, { "docid": "815a596db597d0d785206c6520ecc4e9", "score": "0.5186628", "text": "function populateNone(){\r\n\t/*$('#editor1').htmlarea('html', '&nbsp;');\t*/\r\n\tCKEDITOR.instances['editor1'].insertHtml('&nbsp;');\r\n\tdocument.getElementById(\"instructionUpdateDiv\").setAttribute(\"style\", \"display:none\");\r\n\tdocument.getElementById(\"instructionAddDiv\").setAttribute(\"style\", \"display:block\");\r\n\tvar userProfileSelect = document.getElementById(\"inputUserProfileInpt\");\r\n\tuserProfileSelect.removeAttribute(\"disabled\", \"true\");\r\n\tvar relatedPage = document.getElementById(\"inputPageInpt\");\r\n\trelatedPage.removeAttribute(\"disabled\", \"true\");\r\n}", "title": "" }, { "docid": "5a06e0bf12a4b6bd92d0c6f727a89d6f", "score": "0.5186513", "text": "function insertModal(data){\n\t$(\"#details\").append(\"<div class=\\\"col mt-1 mb-5\\\"><br/><p><b>Name</b>: \"+\n\tdata.name+\"<br/><b>Quantity</b>: \"+data.quantity+\"</br><b>Price</b>: \"+\n\tdata.price*data.quantity+\"&euro;\" +\"<hr/>\");\n\t$('#modalCenter').modal(focus);\n}", "title": "" }, { "docid": "fe7835d7b7eb7e3990c673dc5dc624fc", "score": "0.5186032", "text": "function insert_fields(link, method, content) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + method, \"g\")\n $(link).up().insert({\n before: content.replace(regexp, new_id)\n });\n}", "title": "" }, { "docid": "ba1c8ed89b6b85053afb8a8ffa63f4f9", "score": "0.5181907", "text": "function inline_module_form_cb(args){\n\tname = args[0];\n\tmodule = args[1];\n\thtml = args[2];\n\t//\n\tif(html == 'delete'){\n\t\tx_saveInlineModuleForm(module,'','','delete',save_inline_module_form_cb);\n\t}else{\n\t\tdocument.getElementById(module + '_div_in_place').innerHTML = html;\n\t}\n}", "title": "" }, { "docid": "577621962d6066004d674a3f125e2c3c", "score": "0.5181346", "text": "function fillInEditRecipeDetails(data) {\n $('.edit-rem').remove();\n $('.create-step').remove();\n $('.create-edt input').val('');\n $('.edit-div').html('');\n $('input[type=checkbox]').prop('checked', false);\n \n let d = data[0][0];\n ({Celery, Cerals, Crust, Egg, Fish, Lupin, Milk, Moll, Mustard, Nuts, Pnuts, SBeans, SDioxide, SSeeds} = d);\n \n \n let recipeName = d.recipe_name;\n let authorName = d.author_name;\n let prep = d.prep;\n let cook = d.cook;\n let serves = d.serves;\n let instructions = d.instructions;\n \n // show category that had been used\n $(\".edit-category option[value='\"+d.category_name+\"']\").attr('selected',\"selected\");\n \n \n // set checked any allergens that had been checked\n $('input[type=checkbox]:visible').each(function(){\n let name = $(this).attr('class');\n if(d[name] === 'T') {\n $(\".\"+ name).prop('checked', true);\n }\n });\n \n // fill values into text inputs\n $('.recipe-inp-edit').val(recipeName);\n $('.author-inp-edit').val(authorName);\n $('.prep-inp-edit').val(prep);\n $('.serves-inp-edit').val(serves);\n $('.cook-inp-edit').val(cook);\n \n // Add the Ingredients and Quantities\n let ing = data[1];\n \n // destructure array\n let first, rest;\n [first, ...rest] = ing;\n \n // First ingredient and quantity with the headers\n let start = `<ul class='create-recipe type-b edit-b ing-edit'><li><label>INGREDIENTS</label><input type='text' value=\"`+first.ing_name+`\"></li></div>\n <li><label>QUANTITY</label><input type='text' value=\"`+first.ing_quantity+`\"></li></ul>`;\n \n $('.edit-div').append(start);\n \n // rest of ingredients and quanties\n for(let item in rest) {\n let holder = `<div class=\"edit-rem\">\n <li class=\"other-li\">\n <input type='text' value=\"`+rest[item].ing_name+`\">\n </li>\n <li class=\"special-li\">\n <input type='text' value=\"`+rest[item].ing_quantity+`\">\n \n </li>\n </div>`;\n \n \n $('.edit-b').append(holder);\n }\n \n // Add the Instructions \n instructions = instructions.split('_');\n \n for(let item in instructions) {\n let instruct = `<textarea rows=\"3\" class='create-step step-edit' placeholder='Pour into bowl' >`+instructions[item]+`</textarea>`;\n $('.instructions-con-edit').append(instruct);\n }\n \n}", "title": "" }, { "docid": "fefbdbd53fdf19a8716504f09e769c44", "score": "0.5177363", "text": "function formatEditing(form) {\n\t$('.tbtheme [row]').each(function (index) {\n\t\tvar row = $(this).attr('row');\n\t\tvar objtr = $('#tr_' + row);\n\t\tvar firstobj = null;\n\t\tif (objtr.length > 0) {\n\t\t\t$(this).prev().html(objtr.find('td:first').html()).addClass('tdtitle CaptionTD');\n\t\t\t$(this).html(objtr.find('td:nth-child(2) *').clone()).addClass('tdvalue DataTD');\n\t\t\t$(this).find('[validate=\"text\"]').each(function(){\n\t\t\t\t//$(this).after('<span class=\"spwarning spspec\">*</span>');\n\t\t\t});\n\t\t\tobjtr.remove();\n\t\t}\n\t});\n\t//$('.tbtheme tbody .clsremove').remove();\n\t//$('#TblGrid_Main_JQgrid tr').addClass('clsremove');\n\t//$('.tbtheme tbody').append($('#TblGrid_Main_JQgrid tr').clone());\n\t//form.find('table').html($('.tbtheme tbody').clone());\n}", "title": "" }, { "docid": "a299bcd23ff822dfe55fe34b48bcde9b", "score": "0.517706", "text": "function loadForm(data) {\n if (data) {\n $.each( data, function( k, v ) {\n //Add the field\n $(addField(v['type'])).appendTo('#form-fields').hide().slideDown('fast');\n var $currentField = $('#form-fields .field').last();\n //Add the label\n $currentField.find('.field-label').val(v['label']);\n $currentField.find('.field-name').val(v['name']);\n\n if(v['type']=='modalpicker'){\n\n if(v['columnas']){\n $currentField.find('.field-columns').val(v['columnas']);\n }\n\n if(v['url']){\n $currentField.find('.field-url').val(v['url']);\n }\n\n if(v['resultFormat']){\n $currentField.find('.field-result-format').val(v['resultFormat']);\n }\n\n if(v['fnSelected']){\n $currentField.find('.field-fn-selected').val(v['fnSelected']);\n }\n }\n\n if(v['regex']){\n $currentField.find('.field-regex').val(v['regex']);\n }\n\n if(v['fnActivate']){\n $currentField.find('.field-fn-activate').val(v['fnActivate']);\n }\n\n if(v['filetypes']){\n $currentField.find('.field-extension').val(v['filetypes']);\n }\n\n if(v['size']){\n $currentField.find('.toggle-size').val(v['size']);\n }\n else{\n $currentField.find('.toggle-size').val(12);\n }\n\n\n\n\n\n //Is it required?\n if (v['req']) {\n requiredField($currentField.find('.toggle-required'));\n }\n\n if (v['inline']) {\n requiredInline($currentField.find('.toggle-inline'));\n }\n\n if (v['readonly']) {\n readonlyField($currentField.find('.toggle-readonly'));\n }\n\n if (v['moneda']) {\n monedaField($currentField.find('.toggle-moneda'));\n }\n\n if (v['entero']) {\n enteroField($currentField.find('.toggle-entero'));\n }\n\n //Any choices?\n if (v['choices']) {\n $.each( v['choices'], function( k, v ) {\n //add the choices\n $currentField.find('.choices ul').append(addChoice());\n\n //Add the label\n $currentField.find('.choice-label').last().val(v['label']);\n\n //Is it selected?\n if (v['sel']) {\n selectedChoice($currentField.find('.toggle-selected').last());\n }\n });\n }\n\n if (v['columns']) {\n $.each( v['columns'], function( k, v ) {\n //add the choices\n $currentField.find('.columns ul').append(addColumn());\n\n //Add the label\n $currentField.find('.column-title').last().val(v['title']);\n $currentField.find('.column-value').last().val(v['val'].replace(\"[]\", \"\"));\n $currentField.find('.column-type').last().val(v['type']);\n });\n }\n\n });\n\n $('#form-fields').sortable();\n $('.choices ul').sortable();\n }\n}", "title": "" } ]
25f3f0ce73382e931202a74f9e6112c4
1: KEYWORD "function" 2: NAME of "functionName" 3: PARAMETER "currently empty" 4: STATEMENT "to process" 5: INVOKE "on switch" ? Function Declaration A chunk of code that performs a set action when it is invoked
[ { "docid": "32cc4dea801f4d6e7df96c9af96a5723", "score": "0.0", "text": "function funcOne(){\n console.log('Statement Here');\n }", "title": "" } ]
[ { "docid": "4797c7fcac1215a4ea85c3a5d4069969", "score": "0.7138908", "text": "function funcName(Parameter1, Parameter2)/*function definition*/{\n\t//code the function runs\n}", "title": "" }, { "docid": "0b92b02ea953abdf7ce1a1568e1c4003", "score": "0.6978282", "text": "function functionName(parameter) {\n // code to be executed\n}", "title": "" }, { "docid": "64e6339f76418dbdae6bb48dcdb0e3d9", "score": "0.67660964", "text": "function functionName() {\n \n}", "title": "" }, { "docid": "dea397a6512c8bd3da04ea924ad8f406", "score": "0.66029835", "text": "function name(parameter1, parameter2, parameter3) {\n //code to be executed\n}", "title": "" }, { "docid": "07e3768c7f0d2c9ae8d8ad79767b9159", "score": "0.6598642", "text": "function functionName(prameters) {\n // function body\n}", "title": "" }, { "docid": "45d2f6e2464caf8f14f6333caba3a177", "score": "0.6567223", "text": "function something(anyFunction)\n{console.log(2+2); anyFunction();}", "title": "" }, { "docid": "40583a33e080f4638785e3f8f7cab725", "score": "0.65288717", "text": "function someFunc() {}", "title": "" }, { "docid": "faf0f4d178b8a54b65e29645c59dfae6", "score": "0.64844745", "text": "function functionName(params) {\n\t//function body\n\t// A FUNCTION DOES TWO THINGS\n\t//PERFORM A TASK or SIDE EFFECT\n\t//RETURN A VALUE\n}", "title": "" }, { "docid": "b99ca6cd90e9b1e0e8846010c1fa6e0a", "score": "0.6458217", "text": "function fun () {}", "title": "" }, { "docid": "c2a0e4e1596ae66699887fd4a9ac0323", "score": "0.6442448", "text": "function fun() {}", "title": "" }, { "docid": "fb72cd21d6be6bceaa93c20ce10e3dd0", "score": "0.64233077", "text": "function functionDeclaration() {\n console.log('Did something')\n }", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.64152145", "text": "function func() {}", "title": "" }, { "docid": "24867db33be8ce628f4e33946eea0b66", "score": "0.6391314", "text": "function miFuncion(){\n}", "title": "" }, { "docid": "ae6a096cdafc65988aa3115584985d1d", "score": "0.63846916", "text": "function func () {}", "title": "" }, { "docid": "7b030cffc5782cf204381cd4ed4159c7", "score": "0.63807434", "text": "function /*name*/myFunction (param1, param2){\n //code to run when we call function\n console.log(param1 + param2);\n }", "title": "" }, { "docid": "dc47ee2ec80047962c3fc25a43e674da", "score": "0.6358934", "text": "function myFunction(){ //declares the function and arguments, if any\n return 10+10; //function expressions are the actions taken in the function\n}", "title": "" }, { "docid": "1d5dd87a5819f590b3cc15081d1721bd", "score": "0.6358139", "text": "function something(){\r\n\r\n}", "title": "" }, { "docid": "d81afa49d8e7c844b1bd2222b5652ced", "score": "0.6351339", "text": "function functionName(){\n\t//code the function runs;\n}", "title": "" }, { "docid": "139e13a698d53cedaa16d23347e5cafb", "score": "0.6348955", "text": "function testFunctionNameInvoke2(){\n console.log(\"Inside testFunctionNameInvoke2 for function declaration\");\n}", "title": "" }, { "docid": "77a7f60e1199a73fef68fa8c34d1ea30", "score": "0.6343995", "text": "function\nfunction() {}", "title": "" }, { "docid": "7da539508d5bc8d0ba2eab48fce087a2", "score": "0.6333068", "text": "function functionName(parameters) {\n // function body\n // ...\n}", "title": "" }, { "docid": "1e88e47cfe1e655554ec592a0b05d5c6", "score": "0.6320513", "text": "methodName() {\n // TODO...\n // function definition goes here\n }", "title": "" }, { "docid": "8233c805f337b87c55fa8182856ec815", "score": "0.6311586", "text": "function sampleFunctionX(){}", "title": "" }, { "docid": "12798e8b7b766ce9ef47608a1f18de95", "score": "0.630004", "text": "function func()\n{\n}", "title": "" }, { "docid": "f7e6a0a7e08789769d33b01cda44e412", "score": "0.62983173", "text": "function three(someFun){\n someFun();\n}", "title": "" }, { "docid": "652cb63376830d7cdbed0525f53ed5fe", "score": "0.6284771", "text": "function aFunc(){}", "title": "" }, { "docid": "b58939bef8483458b69110907e830f52", "score": "0.62803406", "text": "function miFuncion(){\n\n}", "title": "" }, { "docid": "5122820cdeeb8aeee1973ea01af708f1", "score": "0.62434584", "text": "function nothingfunction(something_to_say){ //then I define the function\nreturn something_to_say\n}", "title": "" }, { "docid": "1575bb7d1ef4d071f90be967cb35816f", "score": "0.6242686", "text": "function hello() {\n\n}", "title": "" }, { "docid": "18a924e500a15091daef52d7b50cef31", "score": "0.62351245", "text": "function myFunction(){console.log(\"THis is a function\")}", "title": "" }, { "docid": "3bd4d3d3b86451f6ba85748fa459d533", "score": "0.62254816", "text": "function hoisting01(){\n console.log(\"Esta es una funcion normal.\");\n} // se ejecuta con normalidad", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.6205922", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.6205922", "text": "function miFuncion(){}", "title": "" }, { "docid": "57669fd365d82d0d4ce3363facf590ec", "score": "0.6187513", "text": "function func() {\n println(\"I am func!\");\n}", "title": "" }, { "docid": "8b98dd5cd45cedbea7f9584b9ddc4126", "score": "0.6178979", "text": "function functiondef(type, value){\n if (type == \"variable\"){register(value); cont(functiondef);}\n else if (type == \"(\") cont(pushcontext, commasep(funarg, \")\"), statement, popcontext);\n }", "title": "" }, { "docid": "944d3388c5122b686dcf6d39963e327e", "score": "0.6173876", "text": "function fun(){\n //\n}", "title": "" }, { "docid": "944d3388c5122b686dcf6d39963e327e", "score": "0.6173876", "text": "function fun(){\n //\n}", "title": "" }, { "docid": "5a12544e17a7c9cae1c7fb59e2b81214", "score": "0.61694086", "text": "function a() {\n console.log('This is a named function declaration');\n}", "title": "" }, { "docid": "8aac735d9eedcb857a81467b2105a2ce", "score": "0.6163833", "text": "function person(function1){\n console.log(\"person function\");\n}", "title": "" }, { "docid": "1ce8855944e048302d9680461ab32051", "score": "0.61562437", "text": "function myFunc(param1, param2){\n //code goes here\n}", "title": "" }, { "docid": "8fa220ed8e2ae3651da5a556b674f267", "score": "0.61546147", "text": "function functionName(param1, param2){ //It can be use from everywhere.\n console.log('Im a function with name',param1, param2);\n}", "title": "" }, { "docid": "8d1811fe5c65a4d6e44fbca2f6e3222c", "score": "0.6151626", "text": "function doSomething() {}", "title": "" }, { "docid": "8d1811fe5c65a4d6e44fbca2f6e3222c", "score": "0.6151626", "text": "function doSomething() {}", "title": "" }, { "docid": "0e70789cb3456f896e28f233cb1b42fe", "score": "0.614799", "text": "function fun1(){}", "title": "" }, { "docid": "0e70789cb3456f896e28f233cb1b42fe", "score": "0.614799", "text": "function fun1(){}", "title": "" }, { "docid": "46dab0b8b762baf37e4ec4efc7e84600", "score": "0.61463666", "text": "function nameOfTheFunction() {\n\tconsole.log ( 'hello from the function');\n\n}", "title": "" }, { "docid": "5576935ac9c89e7111fe695b34dd9025", "score": "0.61428154", "text": "function example() {}", "title": "" }, { "docid": "1842c11ddd17c0662b2bf8479f9df595", "score": "0.6130283", "text": "function myFunction() {\n \n}", "title": "" }, { "docid": "0023396d8190f9233baf40e307df4849", "score": "0.6124966", "text": "func (param) { }", "title": "" }, { "docid": "34799b495b74acfe0dd2fd62d6257702", "score": "0.61149645", "text": "function anotherFunction(){ /*..*/ }", "title": "" }, { "docid": "05590ad9e0e72870958cccaad013c358", "score": "0.610597", "text": "function fn4(a) { } //?", "title": "" }, { "docid": "79867565c3ab8063e8bad5b679e1fefb", "score": "0.6095722", "text": "function fun1() {}", "title": "" }, { "docid": "79867565c3ab8063e8bad5b679e1fefb", "score": "0.6095722", "text": "function fun1() {}", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6088369", "text": "function fun1() { }", "title": "" }, { "docid": "01c85619d5f162a80741b3d4cba50514", "score": "0.6088369", "text": "function fun1() { }", "title": "" }, { "docid": "5bebae8a43bc07acb2001883020eb288", "score": "0.60849535", "text": "function someFunction() {\n console.log(\"I'm a function\");\n \n }", "title": "" }, { "docid": "2d7f395f3c256ebea62f7e5775103e9b", "score": "0.6076262", "text": "function t01() {\n\n}", "title": "" }, { "docid": "68e7910da19d4b958aea5459cf9eae43", "score": "0.6070119", "text": "function f4() {\n\n\n}", "title": "" }, { "docid": "e25560e78a5fe09c534f6223e768b8b9", "score": "0.60628515", "text": "function fun() {\r\n console.log('This is a function.');\r\n}", "title": "" }, { "docid": "35245cd74ae2be0cc1a60376c910ee4e", "score": "0.60594267", "text": "function functionName(param1, param2) {\n // function body (your code goes here)\n // the params can be used in your code\n return // expression\n}", "title": "" }, { "docid": "c00e338dad2a76ff9661db32c37b15d0", "score": "0.60500973", "text": "function myFunctionName(){\n\n\t\t\t// do something\n\t}", "title": "" }, { "docid": "d8edf0b8733819d5974fa6cfd3cb001b", "score": "0.60498255", "text": "function nameOfYourFunction(input1,input2,...) {\n\t// Procedure for function.\n}", "title": "" }, { "docid": "21bf0afb00af839bf8536a7e1dcbe075", "score": "0.60461116", "text": "function a() {console.log('I am function a')}", "title": "" }, { "docid": "344b4029cc63f3d14e387e1bed60461d", "score": "0.6038092", "text": "function name(){\n\t//code to be executed\n}", "title": "" }, { "docid": "d6cab4dc04bb192ed2a129e783dda12a", "score": "0.6028096", "text": "function myFunction() {\r\n console.log(\"I am a function\");\r\n}", "title": "" }, { "docid": "e9e6fe67279c964da47e6713bb596835", "score": "0.6023958", "text": "function paramFun(){\n console.log(\"Hi Function Param\");\n}", "title": "" }, { "docid": "cfc68610f435b1b5804ed0c119bbfa21", "score": "0.6008804", "text": "function someFunction() {\n console.log('function someFunction(){}');\n}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.6003506", "text": "function a() {}", "title": "" }, { "docid": "e9e837d64a8aeeba8d1731ddaf8f6207", "score": "0.60021836", "text": "function func() {\n\n }", "title": "" }, { "docid": "e9e837d64a8aeeba8d1731ddaf8f6207", "score": "0.60021836", "text": "function func() {\n\n }", "title": "" }, { "docid": "4ea5a21e86a1dcdf5aad1a1b66e5fb0f", "score": "0.59945214", "text": "function functionName( node, type )\n{\n\tif( type === 'FunctionDeclaration' && node.id )\n\t{\n\t\treturn node.id.name;\n\t}\n\tif( type === 'MethodDefinition' && node.key ){\n\t\treturn node.key.name;\n\t}\n\treturn \"anon function @\" + node.loc.start.line;\n}", "title": "" }, { "docid": "4ea5a21e86a1dcdf5aad1a1b66e5fb0f", "score": "0.59945214", "text": "function functionName( node, type )\n{\n\tif( type === 'FunctionDeclaration' && node.id )\n\t{\n\t\treturn node.id.name;\n\t}\n\tif( type === 'MethodDefinition' && node.key ){\n\t\treturn node.key.name;\n\t}\n\treturn \"anon function @\" + node.loc.start.line;\n}", "title": "" }, { "docid": "a0ab4956de49b1183b5e859ab89a3a6f", "score": "0.59942216", "text": "function fun() {\n console.log(\"This is funtion \");\n}", "title": "" }, { "docid": "88d7389f892eb11b509be44133197860", "score": "0.59886956", "text": "function func1() {}", "title": "" }, { "docid": "88d7389f892eb11b509be44133197860", "score": "0.59886956", "text": "function func1() {}", "title": "" }, { "docid": "67b0f6fc25559822d688775ed1f87b8e", "score": "0.59836864", "text": "function fun() {\n print(\"foo\");\n}", "title": "" }, { "docid": "285cecd1fd32fdf48ec010c7b218d8d1", "score": "0.5981986", "text": "function standardFunction() { //function declaration (expression uses variable)\n return \"This is a standard function.\"\n}", "title": "" }, { "docid": "f11d29c9dfe92cecc6acaeea968acb20", "score": "0.5981843", "text": "function hola(){}", "title": "" }, { "docid": "13df25260e4440a35d55566645faf853", "score": "0.59801424", "text": "function mifuncion(){}", "title": "" }, { "docid": "522f922fb9e32d1615316e03b7827264", "score": "0.5978331", "text": "function greet(){ //This code is called as function statement\n console.log('Hi');\n}", "title": "" }, { "docid": "cb9ebf0d1cec28ecb2b11f6bee6401d6", "score": "0.5976534", "text": "function doSomething() { }", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.5968571", "text": "function foo() {}", "title": "" }, { "docid": "a284ee8259de0df4ebbf56e70ab8937d", "score": "0.59623086", "text": "function fun() {\n console.log(\"This is a function\")\n}", "title": "" }, { "docid": "a284ee8259de0df4ebbf56e70ab8937d", "score": "0.59623086", "text": "function fun() {\n console.log(\"This is a function\")\n}", "title": "" }, { "docid": "518609aff3a45f8e0721ecc4fc385c0a", "score": "0.59517014", "text": "function hola(){\n\n }", "title": "" }, { "docid": "138c9393c5d34c9ee01d3a2fe8371385", "score": "0.59493667", "text": "function myFunction (){\r\n console.log(\"normal function\");\r\n}", "title": "" }, { "docid": "682dc14d8b43ae90b93f21e45a2428f2", "score": "0.5945585", "text": "function myRegularFnc() {\n console.log(\"I'm a regular function\")\n}", "title": "" }, { "docid": "dd3967032943227f92e3267343a72930", "score": "0.5926596", "text": "visitFunctionDeclaration(tree) {}", "title": "" }, { "docid": "dd3967032943227f92e3267343a72930", "score": "0.5926596", "text": "visitFunctionDeclaration(tree) {}", "title": "" }, { "docid": "c8efa57bb89aebad28564aedb92b34ca", "score": "0.59228045", "text": "function fun() {\n console.log('This is a function')\n}", "title": "" }, { "docid": "6ebb2c8fa071802df4060f351cbe953e", "score": "0.5921007", "text": "function FirstFunction()\r\n{\r\n console.log(\"This is the basic syntax of a function in JavaScript.\");\r\n}", "title": "" }, { "docid": "57f5dc6b5858f460eacf192c644039e9", "score": "0.5917916", "text": "function myFunction(){ \r\n console.log(\"this is name function\");\r\n}", "title": "" }, { "docid": "7d23045643825139482c0c93a7979481", "score": "0.5915886", "text": "function fun1() {\n\n}", "title": "" }, { "docid": "d2b5926cb64f2498139dc5b9767fced3", "score": "0.59143263", "text": "function i_am_a_function() {\n \tconsole.log(\"From i_am_a_function()\")\n }", "title": "" } ]
0baf8890fb1947b1aaaa57c5dd93871e
extend FactoryItem into any item we want to produce and have a getSchematic call. get the schematic from the prototype, all FactoryItems must hold a schematic (on their prototype) and will have a build method which takes the pos of the schem.prop and uses it to properly place the returned value
[ { "docid": "35db62c6ce0f1389fb341541935b6653", "score": "0.66446495", "text": "function FactoryItem ( schematic ) {\n\tthis.schematic = schematic;\n\tif (FactoryItem.counter>=0)\n\t\tFactoryItem.counter++;\n\telse\n\t\tFactoryItem.counter = 0;\n\tthis.id = FactoryItem.counter;\n}", "title": "" } ]
[ { "docid": "0ed4f328385cb8a855142cc05a331279", "score": "0.5472515", "text": "function ItemFactory() {\n return function (name, quantity, pricePerItem) {\n return {\n name: name,\n quantity: quantity,\n pricePerItem: pricePerItem\n };\n };\n }", "title": "" }, { "docid": "a2dd9610302367bab9b2e4b79c4f9922", "score": "0.5471795", "text": "function VisualItemsFactory() {\n\n\t/**\n\t * Creates a visual item and set the proper render strategy\n\t * @param {string} type - Box or Circle\n\t * @param {targetSVGScreen} the name of the SVG canvas element\n\t */ \n\n\tthis.createVisual = function(type, targetSVGScreen) {\n \n\t \tvar visualItem;\n\t\tvisualItem = new VisualItem(type + '1');\n\t\tvisualItem.options = { \"fill\" : \"#F44336\" };\n\t\t\n\t var renderStrategy;\n \n\t \tswitch (type)\n\t {\n\t\t\tcase 'rect':\n\t\t\t\tvisualItem.data = [100,100,100,100,0,0];\n\t\t\t\trenderStrategy = new RenderBoxStrategy(targetSVGScreen);\n\t\t\t\tvisualItem.setStrategy(renderStrategy);\n\t\t\t\tbreak;\n\t\t\tcase 'circle':\n\t\t\t\tvisualItem.data = [100,100,40];\n\t\t\t\trenderStrategy = new RenderCircleStrategy(targetSVGScreen);\n\t\t\t\tvisualItem.setStrategy(renderStrategy);\n\t\t\t\tbreak;\n\t }\n \n\t return visualItem;\n\t}\n}", "title": "" }, { "docid": "d37e3b82dab580be41bb03296b26d902", "score": "0.54152185", "text": "function buildCustom(node){\n const shape = new Shape(node);\n const { courses, beds } = node.eval(env.verbose);\n shape.courses = courses;\n for(let i = 0; i < beds.length; ++i){\n if(beds[i]){\n shape.setBeds(i, beds[i]);\n }\n }\n // XXX other things to transfer?\n\n // register interface courses\n shape.setCourse('bottom', shape.courses[0]);\n shape.setCourse('top', shape.courses[shape.courses.length-1]);\n // register numbered interface names\n shape.setCourseInterface(0, 'bottom');\n shape.setCourseInterface(shape.courses.length-1, 'top');\n return shape;\n}", "title": "" }, { "docid": "b5662c9925b04d5bf39dd372f24b47cf", "score": "0.532369", "text": "renderShelfItem() {\n this.createElements();\n }", "title": "" }, { "docid": "4e842611aec2dd734791932f5fdbcb3b", "score": "0.5269246", "text": "build() {\n\t\t\tif (!props.get(this).name) {\n\t\t\t\tprops.get(this).name = '';\n\t\t\t}\n\n\t\t\tconst size = props.get(this).size;\n\t\t\tconst value = props.get(this).value;\n\t\t\tconst format = props.get(this).format;\n\n\t\t\t// if( validator.isUndefined( size ) && ItemFormat.isSizeable( format ) ) {\n\t\t\t// \tprops.get(this).size = 0;\n\t\t\t// }\n\n\t\t\tif( validator.isUndefined( value ) ) {\n\t\t\t\tprops.get(this).value = ItemFormat.default( format, size );\n\t\t\t}\n\n\t\t\treturn new DataItem(this);\n\t\t}", "title": "" }, { "docid": "f0549775c53da83ca41b5d3a6715b467", "score": "0.518781", "text": "function makeItem(desc) {\n const item = {\n ref: desc.ref,\n name: desc.name || desc.ref,\n pos: desc.pos || {x: 0, y: 0},\n cont: desc.cont,\n portable: desc.portable\n };\n return makeBasicObject(item, desc, this.prototype);\n }", "title": "" }, { "docid": "527eb0be8dd88eb5b4113cecfdc5cfe8", "score": "0.5170965", "text": "sulfurasMethod(item) {\n // note: we assign static values to legendary items since all legendary items have 80 quality and cannot expire\n item.quality = 80;\n item.sellIn = 0;\n return item;\n }", "title": "" }, { "docid": "f8b0f30f8c4c47d378f163c84ccf0d2d", "score": "0.5154677", "text": "function Item() {}", "title": "" }, { "docid": "27d1a96ae54f16490140762ca21c83bf", "score": "0.5140608", "text": "makeWorkingItem() {\n return setWorkingItem(this.clone(), { Class: this.constructor });\n }", "title": "" }, { "docid": "de84dcd8ff5f46e5d3caea65b6bf1486", "score": "0.51309973", "text": "function buildItem(item) {\n // Getting a copy of template markup (it's prepared and ready HTMLElements)\n // Just only one moment template tag can contains multiple child tags\n // so the result of import will be DocumentFragment\n const fragment = document.importNode(\n TEMPLATE.content, // Put our templae content\n true // Deep copy enabled\n );\n // We got DocumentFragment our next steps to simplify work is\n // just get a single root element that we need\n const newItem = fragment.firstElementChild;\n\n // Now we can do anyting we want with the root element\n newItem.classList.add('bg-' + item.bg);\n\n // And we can access all elements inside to update content to the real data\n newItem.querySelector('.item-text').textContent = item.text;\n\n return newItem;\n}", "title": "" }, { "docid": "8e0cad7759a5f504a0bc1a0c7ebe7c7a", "score": "0.50635195", "text": "function shoe(make, color, size, material, style, price) {\n //we use 'this' to create an a property of an object\n //this property name should be the same as the parameter.\n this.make = make;\n this.color = color;\n this.size = size;\n this.material = material;\n this.style = style;\n this.price = price;\n}", "title": "" }, { "docid": "3dc4153f42f53665ab7caa5aa93ded36", "score": "0.4994882", "text": "makeFactory(factory) {\n const recipe = Object.values(this.props.recipes).find(r => r.factory === factory.name);\n for (let rcpItem of Object.values(recipe.input || {})) {\n this.state.itemsToAcquire = addItemToContainer(rcpItem, this.state.itemsToAcquire);\n }\n if (!this.state.obtainedFactories.find(f => f.name === factory.name)) {\n this.state.obtainedFactories.push(factory);\n }\n this.state.factoriesToAcquire = this.state.factoriesToAcquire.filter(f => f.name !== factory.name);\n this.setState(this.state);\n }", "title": "" }, { "docid": "7fa29f1b0951084e27fbb54ab984697d", "score": "0.49892896", "text": "function Item(){\n\t// Sort of abstract func\n\tthis.addToDocument = function(){\n\t\tdocument.body.appendChild(this.item);\n\t}\n\tthis.addTo = function(node){\n\t\tnode.item.appendChild(this.item);\n\t}\n}", "title": "" }, { "docid": "add96cc5732cbac6bb6de580c2635e08", "score": "0.49708572", "text": "function Item(reference, title, creator, date, itemContentPromiseFactory) {\n this.reference = function() {\n return reference;\n };\n\n this.title = function() {\n return title;\n };\n\n this.creator = function() {\n return creator;\n }\n\n this.date = function() {\n return date;\n }\n\n this.itemContentPromise = function() {\n return itemContentPromiseFactory();\n };\n}", "title": "" }, { "docid": "6b2d23866d0854195e9bf1d8b5d73339", "score": "0.4970678", "text": "addPastedItem(orig){\n\t\tvar theClone\n\t\tif (orig.hasOwnProperty('allMyChildren')){\n\t\t\tif (orig.type === \"Spec\"){\n\t\t\t\ttheClone = new Spec(orig.description, this)\n\t\t\t}\n\t\t\telse if (orig.type === \"Suite\"){\n\t\t\t\ttheClone = new Suite(orig.description, this)\n\t\t\t}\n\t\t\telse if (orig.type === \"BeforeEach\"){\n\t\t\t\ttheClone = new BeforeEach(this)\n\t\t\t}\n\t\t\telse if (orig.type === \"AfterEach\"){\n\t\t\t\ttheClone = new AfterEach(this)\n\t\t\t}\n\n\t\t\tfor (var i of orig.allMyChildren){\n\t\t\t\tif (i.type === \"Spec\"){\n\t\t\t\t\tvar newSpec = new Spec(i.description, theClone)\n\t\t\t\t\tnewSpec.allMyChildren = i.duplicateMyChildren(i, newSpec)\n\t\t\t\t\ttheClone.allMyChildren.push(newSpec)\n\t\t\t\t}\n\t\t\t\telse if (i.type === \"Suite\"){\n\t\t\t\t\tvar newSuite = new Suite(i.description, theClone)\n\t\t\t\t\tnewSuite.allMyChildren = i.duplicateMyChildren(i, newSuite)\n\t\t\t\t\ttheClone.allMyChildren.push(newSuite)\n\t\t\t\t}\n\t\t\t\telse if (i.type === \"Assert\"){\n\t\t\t\t\tvar newAssert = new Assert(i.content, i.content2, theClone, i.not, i.matcher)\n\t\t\t\t\ttheClone.allMyChildren.push(newAssert)\n\t\t\t\t\ttheController.myModel.asserts.push(newAssert)\n\t\t\t\t}\n\t\t\t\telse if (i.type === \"Misc\"){\n\t\t\t\t\tvar newCode = new MiscCode(i.content, theClone)\n\t\t\t\t\ttheClone.allMyChildren.push(newCode)\n\t\t\t\t}\n\t\t\t\telse if (i.type === \"BeforeEach\"){\n\t\t\t\t\tvar newBefore = new BeforeEach(theClone)\n\t\t\t\t\tnewBefore.allMyChildren = newBefore.duplicateMyChildren(i, newBefore)\n\t\t\t\t\ttheClone.allMyChildren.push(newBefore)\n\t\t\t\t}\n\t\t\t\telse if (i.type === \"AfterEach\"){\n\t\t\t\t\tvar newAfter = new AfterEach(theClone)\n\t\t\t\t\tnewAfter.allMyChildren = newAfter.duplicateMyChildren(i, newAfter)\n\t\t\t\t\ttheClone.allMyChildren.push(newAfter)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (orig.type === \"Assert\"){\n\t\t\ttheClone = new Assert(orig.content, orig.content2, this, orig.not, orig.matcher)\n\t\t\ttheController.myModel.asserts.push(theClone)\n\t\t}\n\t\telse if (orig.type === \"Misc\"){\n\t\t\ttheClone = new MiscCode(orig.content, this)\n\t\t}\n\t\tif (theClone.type === \"BeforeEach\" || theClone.type === \"AfterEach\"){\n\t\t\tthis.allMyChildren.unshift(theClone)\n\t\t\ttheController.updateDisplay()\n\t\t\treturn\n\t\t}\n\t\tthis.allMyChildren.push(theClone)\n\t\ttheController.updateDisplay()\n\t}", "title": "" }, { "docid": "fc894884725c91b4582975693b728a62", "score": "0.49661818", "text": "createParent(){\n if(!this.getParent()){ //make sure there isn't already a parent shape\n var UID = this.graphics.getUID();\n var clas = this.__getClass();\n var parentNode = this.__getParentNode();\n if(parentNode){\n var shape = parentNode.getShape(UID);\n if(shape)\n shape.__setup();\n else\n shape = new clas(this.getGraphics(), parentNode);\n return shape.add();\n }\n }\n }", "title": "" }, { "docid": "dc4c5610e2b2bb4f5e872c80a62b634d", "score": "0.49521747", "text": "function buildItem (item) {\n return $.create(`<div id=\"${item.id}\" class=\"cart-item\">\n <img class=\"cart-img\" src=\"img/preview.png\">\n <div class=\"cart-actions\">\n <div class=\"cart-close\"><span class=\"close\"></div>\n <div class=\"cart-quantity\">\n <label for=\"quantity-${item.id}\">Quantity:</label>\n <input class=\"form-control\" type=\"number\" min=\"1\" max=\"10\" value=\"${item.quantity}\" name=\"quantity-${item.id}\" id=\"quantity-${item.id}\">\n </div>\n </div>\n <h4 class=\"cart-title\">${item.name}</h4>\n <span class=\"cart-dim\">${item.dim}</span>\n </div>`);\n }", "title": "" }, { "docid": "0a8cc8c4af455e2c16bfc748c141dc40", "score": "0.49459508", "text": "function rpg_item_create(args){\n args = args || {};\n args['properties'] = args['properties'] || {};\n args['type'] = args['type'] || 'any';\n\n args['properties']['cursor'] = args['properties']['cursor'] || 'auto';\n args['properties']['equipped'] = args['properties']['equipped'] || false;\n args['properties']['label'] = args['properties']['label'] || '';\n args['properties']['owner'] = args['properties']['owner'] || 0;\n args['properties']['slot'] = args['properties']['slot'] || 'spellbook';\n args['properties']['spell'] = args['properties']['spell'] || {};\n args['properties']['spell']['cost'] = args['properties']['spell']['cost'] || 0;\n args['properties']['spell']['costs'] = args['properties']['spell']['costs'] || 'mana';\n args['properties']['spell']['color'] = args['properties']['spell']['color'] || '#fff';\n args['properties']['spell']['damage'] = args['properties']['spell']['damage'] || 0;\n args['properties']['spell']['damages'] = args['properties']['spell']['damages'] || 'health';\n args['properties']['spell']['lifespan'] = args['properties']['spell']['lifespan'] || 50;\n args['properties']['spell']['reload'] = args['properties']['spell']['reload'] || 0;\n args['properties']['spell']['reload-current'] = args['properties']['spell']['reload-current'] || args['properties']['spell']['reload'];\n args['properties']['spell']['speed-x'] = args['properties']['spell']['speed-x'] || 5;\n args['properties']['spell']['speed-y'] = args['properties']['spell']['speed-y'] || 5;\n args['properties']['spell']['type'] = args['properties']['spell']['type'] || 'particle';\n\n return args['properties'];\n}", "title": "" }, { "docid": "fc34083b3ce5a1a815d5129a0517030e", "score": "0.49335656", "text": "function template_set_item_basics(template, item) {\n\n\t\tvar item_name = item.name;\n\t\t// var item_id = item.name.replace(/\\s/g, \"_\");\n\t\tvar item_id = item.name.replace(/[^a-zA-Z0-9]+/g, \"_\") + \"_\" + item.id;\n\n\t\tvar item_special_instructions_maxlength = (item.instructions.maxlength !== false) ? item.instructions.maxlength : \"\";\n\n\t\tvar price = product_compile_price(item);\n\n\t\ttemplate = template.replace(/\\{\\{item_id\\}\\}/g, item_id);\n\t\ttemplate = template.replace(/\\{\\{item_name\\}\\}/g, item_name);\n\t\ttemplate = template.replace(/\\{\\{item_quantity\\}\\}/g, (item.min === false) ? 1 : item.min);\n\t\ttemplate = template.replace(/\\{\\{item_special_instructions\\}\\}/g, item.instructions.content);\n\t\ttemplate = template.replace(/\\{\\{item_special_instructions_maxlength\\}\\}/g, item_special_instructions_maxlength);\n\t\ttemplate = template.replace(/\\{\\{item_description\\}\\}/g, item.description);\n\t\ttemplate = template.replace(/\\{\\{item_price\\}\\}/g, price);\n\t\ttemplate = template.replace(/\\{\\{category_id\\}\\}/g, item.category);\n\t\ttemplate = template.replace(/\\{\\{product_id\\}\\}/g, item.id);\n\n\t\treturn template;\n\t}", "title": "" }, { "docid": "bf160e6f44a256960c6eaf39200e24e5", "score": "0.49302357", "text": "_createPart(){return new AttributePart(this)}", "title": "" }, { "docid": "55ae0ebee95bf5dc3539c54b07639daf", "score": "0.49211627", "text": "function GenericItemsFactory() {\n }", "title": "" }, { "docid": "51cc3ef56d2635f91e58ba138794cdb8", "score": "0.49177882", "text": "function cartItem(name, superpower, rich, genius, quantity) {\n this.name = name;\n this.superpower = superpower;\n this.rich = rich;\n this.genius = genius;\n this.quantity = quantity * 1;\n}", "title": "" }, { "docid": "43e59ad3e5971babbcf7da15cebdc5bb", "score": "0.48606303", "text": "constructor(spec) {\r\n super(spec, fields);\r\n this.__type_name = 'data_item';\r\n this.add_class('data-item');\r\n let context = this.context;\r\n\r\n //console.log('this.value', this.value);\r\n\r\n this.add(new jsgui.textNode({\r\n text: this.value + '',\r\n context: this.context\r\n }));\r\n\r\n // Contains data items\r\n /*\r\n if (spec.item || spec.value) {\r\n let item = this.item = spec.item || spec.value;\r\n\r\n\r\n\r\n }\r\n */\r\n\r\n\r\n\r\n //ctrl_title_bar.set('dom.attributes.class', 'titlebar');\r\n //this.add(span);\r\n }", "title": "" }, { "docid": "9e59246f06d53338fea63063543432e1", "score": "0.4842394", "text": "function Material(price, sqFt, rVal, cover,width,bags,SFtotal,cost) {\n this.price = price; // added 5% in Feb 2020\n this.sqFt = sqFt;\n this.rVal = rVal;\n if (cover == \"Faced\"){\n this.cover = \"Kraft Faced\";\n }\n else{\n this.cover = cover;\n }\n //this.dscnt = discount;\n this.width = width;\n this.bags = bags;\n this.SFtotal = SFtotal;\n this.cost = cost;\n\n this.itemDisplay = rVal + \"x\" + width + \"\\\"\" + \" \" + cover + \n \" (\" + sqFt + \" sqft per bag/\" + bags+\" bags=\"+SFtotal+\" total SF)( $\" + price + \n \" per sqft)=$\"+cost;\n}", "title": "" }, { "docid": "91616b42b61a72cc532f307c5dfc1181", "score": "0.48094186", "text": "function otherItemObject(itemType,itemCost,itemAmnt,theItem) {\n this.cost = (itemAmnt*itemCost).toFixed(2);\n\n if (theItem == \"baffles\"){\n this.itemDisplay = \"- Package of \"+itemType+\" ct baffles x\"+itemAmnt+\", at $\"+itemCost+\" per box = $\"+ ((itemAmnt*itemCost).toFixed(2));\n }\n else if (theItem == \"rods\"){\n this.itemDisplay = \"- Box of 500 \"+itemType+\"\\\" rods x\"+itemAmnt+\", at $\"+itemCost+\" per box = $\"+ ((itemAmnt*itemCost).toFixed(2));\n }\n else{\n this.itemDisplay = \"- Roll of \"+itemType+\"mil poly x\"+itemAmnt+\", at $\"+itemCost+\" per box = $\"+ ((itemAmnt*itemCost).toFixed(2))\n }\n\n}", "title": "" }, { "docid": "15eb00f7600faa3381c93be037c6f001", "score": "0.47921038", "text": "function ItemFactory(openhabPlatform){\n this.platform = openhabPlatform;\n this.log = this.platform.log;\n}", "title": "" }, { "docid": "bc268995bad8ea642740fc4dc4555971", "score": "0.47799674", "text": "_createPart() {\n return new parts_AttributePart(this);\n }", "title": "" }, { "docid": "8f853a9f56b3628d158c4138216f11f9", "score": "0.475727", "text": "function Item(type){\n this.type = type;\n this.height = generateDimension(type);\n this.width = generateDimension(type);\n this.speed = this.generateSpeed();\n this.powerType = this.generatePowerType();\n }", "title": "" }, { "docid": "423ce67c7503524c3b628935109d6adc", "score": "0.47496483", "text": "static createStock() {\n const itemNames = ['Camisa', 'Pantalon', 'Calcetines'];\n const itemPrices = [13, 27, 100];\n return itemNames.map((value, index) => new Item(itemNames[index], itemPrices[index]));\n }", "title": "" }, { "docid": "99c49ffee772946e69db22a718ccb612", "score": "0.4735905", "text": "function ItemMaker (htmlTemplate, attrTemplate = 'data-cart-item-id') {\r\n var attrT = attrTemplate;\r\n var template = \"<div><img src='undef_cart.svg' data-inner='src'></div>\" +\r\n \"<div data-inner='name'>Lorem ipsum dolor sit amet</div>\" +\r\n \"<div data-inner='price'>price</div>\" +\r\n \"<div data-inner='quantity'>quantity</div>\" +\r\n \"<div data-inner='total'>total</div>\";\r\n var stockCallBk = null;\r\n /* input format {key:countOfItems} */\r\n function buildInfo (keyVal) {\r\n if (!stockCallBk) {\r\n return null;\r\n }\r\n var result = null;\r\n /* get a key */\r\n var key = Object.keys(keyVal)[0];\r\n /* get info from a stock */\r\n var stockData = stockCallBk(key);\r\n /* copy properties */\r\n result = Object.assign({}, stockData);\r\n /* asign new properties to result */\r\n result.quantity = keyVal[key];\r\n result.total = result.quantity * /[+-]?([0-9]*[.])?[0-9]+/.exec(result.price)[0];\r\n /* moving UNITS to QUANTITY */\r\n result.quantity += result.units;\r\n delete result.units;\r\n return result;\r\n }\r\n return {\r\n regStockCallBk: function (f) {\r\n stockCallBk = f;\r\n },\r\n /* making <li> node\r\n and fill it conent in according to template */\r\n makeItemNode: function (keyVal) {\r\n var objForEmbedding;\r\n /* get a key */\r\n var key = Object.keys(keyVal)[0];\r\n /* create a node and assign attributes */\r\n var liNode = document.createElement('li');\r\n liNode.setAttribute(attrT, key);\r\n liNode.setAttribute('class', 'ItemsOfCart');\r\n /* fill content */\r\n liNode.insertAdjacentHTML('afterbegin', template);\r\n objForEmbedding = buildInfo(keyVal);\r\n\r\n /* iterate all the properties and assign it to 'in-memory' DOM */\r\n var iterKeys = Object.keys(objForEmbedding);\r\n iterKeys.forEach(function (val, ind) {\r\n if (val === 'src') {\r\n liNode.querySelector('[data-inner=' + val + ']').setAttribute('src', objForEmbedding[val]);\r\n } else {\r\n liNode.querySelector('[data-inner=' + val + ']').innerText = objForEmbedding[val].toString();\r\n }\r\n });\r\n return liNode;\r\n }\r\n\r\n };\r\n}", "title": "" }, { "docid": "9b50985eca6962c01cb7442a6883cf5f", "score": "0.47276786", "text": "function mxShapeSysMLItemFlow(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}", "title": "" }, { "docid": "d1e4d7fdaddbe2f76fa8f4c07a53396c", "score": "0.4702187", "text": "function createNewTool() {\r\n currentThickness = $(\"#thickness\").val(); \r\n console.log(\"Thickness: \" + currentThickness);\r\n\r\n //Pen = 0, Rectangle = 1, Circle = 2, Line = 3, Text = 4, Move = 5 \r\n\t\tif(currentToolType === 0) {\r\n console.log(currentThickness);\r\n\t\t\treturn new Pen(currentThickness, currentColor);\r\n\t\t}\r\n\t\telse if(currentToolType === 1) {\r\n console.log(currentThickness);\r\n\t\t\treturn new Rectangle(currentThickness, currentColor);\r\n\t\t}\r\n else if (currentToolType === 2) {\r\n console.log(currentThickness);\r\n return new Circle(currentThickness, currentColor);\r\n }\r\n else if (currentToolType === 3) {\r\n console.log(currentThickness);\r\n return new Line(currentThickness, currentColor); \r\n }\r\n else if (currentToolType === 4) {\r\n console.log();\r\n return new Text(texting);\r\n }\r\n\t}", "title": "" }, { "docid": "62f3c6b4d5ef0fb1ed3d5eb2ef76a72f", "score": "0.46918434", "text": "createElements() {\n var shelfItem = document.createElement(\"div\");\n shelfItem.classList.add(this.class, \"shine\");\n shelfItem.addEventListener(\"mousedown\", this.onMouseDown.bind(this), false);\n this.element = shelfItem;\n }", "title": "" }, { "docid": "a25b2b43143ee518c4ea2095abc7ea5e", "score": "0.46762124", "text": "function createDskTopPart (templ) {\r\n /* create a main node */\r\n var nDesk = document.createElement('div');\r\n nDesk.setAttribute('class', 'desktopVarCartItem');\r\n /* assign a content */\r\n nDesk.insertAdjacentHTML('afterbegin', templ);\r\n /* return created node */\r\n return nDesk;\r\n }", "title": "" }, { "docid": "e166d42b3044fc4b1dbe65cefb939a59", "score": "0.46738395", "text": "function _dinoFactory(species, weight, height, diet, where, when, fact) {\n return Object.assign({}, basicAnimal, {\n\t\t\tspecies: species,\n\t\t\tweight: weight, // in lbs\n\t\t\theight: height, // in inches\n\t\t\tdiet: diet,\n\t\t\twhere: where,\n\t\t\twhen: when,\n fact: fact,\n compareDiet: function(human) {\n if (this.diet === human.diet) {\n return `${this.species} had the same diet as you.`;\n }\n\n return `${this.species} had a different diet from you.`;\n },\n compareHeight: function(human) {\n const diff = this.height - human.height\n if (diff === 0) {\n return `You are the same height as ${this.species}`\n }\n\n if (diff > 0) {\n return `You are shorter than ${this.species}`\n }\n\n if (diff < 0) {\n return `You are taller than ${this.species}`\n }\n },\n compareWeight: function(human) {\n const diff = this.weight - human.weight\n if (diff === 0) {\n return `You are the same weight as ${this.species}`\n }\n\n if (diff > 0) {\n return `You are lighter than ${this.species}`\n }\n\n if (diff < 0) {\n return `You are heavier than ${this.species}`\n }\n },\n getRandomFact: function(human) {\n if (this.species === 'Pigeon') {\n return this.fact\n }\n\n const randomFact = Math.floor(Math.random() * 4 + 1)\n\n switch (randomFact) {\n case 1:\n return this.compareDiet(human)\n break;\n case 2:\n return this.compareHeight(human)\n break;\n case 3:\n return this.compareWeight(human)\n break;\n case 4:\n return this.fact\n break;\n\n default:\n return this.fact\n break;\n }\n },\n generateTile: function(human) {\n const gridItem = document.createElement('div')\n gridItem.classList.add('grid-item');\n gridItem.innerHTML = `\n <h3>${this.species}</h3>\n <img src=\"images/${this.species}.png\" alt=\"${this.species}\"/>\n <p>${this.getRandomFact(human)}</p>\n `\n return gridItem\n }\n\t\t})\n }", "title": "" }, { "docid": "fcd06835799999d6edcc034d6d03d0ec", "score": "0.46624073", "text": "function constructItem() {\n var item = {\n \"workers_id\": $scope.worker_data.worker_id,\n \"status\": 0,\n \"action_time\": $scope.date,\n \"created_at\": $scope.date,\n \"updated_at\": $scope.date,\n \"author_id\": $scope.userId,\n \"updater_id\": $scope.userId\n };\n return item;\n }", "title": "" }, { "docid": "2da4370dd06bfd57e7a4ef602370ea0e", "score": "0.46609363", "text": "create() {\n\t\tsuper.create();\n\t\tthis.add_child.create();\n\t\tthis.add_value.create();\n\t}", "title": "" }, { "docid": "c415b761076ed10f7f7bbfcc34ec8127", "score": "0.46409437", "text": "build() {\n if (!this.item.vault || !this.item.vault.id) {\n // Always fall back to using environment variable when vault is undefined\n if (!process.env.OP_VAULT) {\n throw Error(\"Vault ID is required.\");\n }\n debug(\"Using OP_VAULT env var for new Item.\");\n this.item.vault = Object.assign(this.item.vault || {}, {\n id: process.env.OP_VAULT,\n });\n }\n if (!this.item.category) {\n throw Error(\"Item Category is required.\");\n }\n this.item.sections = Array.from(this.sections.values());\n this.item.urls = this.urls.hrefs.map((href) => this.urls.primaryUrl === href\n ? { primary: true, href }\n : { href });\n const builtItem = lodash_clonedeep_1.default(this.item);\n debug(\"Successfully built Item (id: %s, vault: %s)\", builtItem.id, builtItem.vault.id);\n this.reset();\n return builtItem;\n }", "title": "" }, { "docid": "020720e50117e9f5663b4bf5cc9d1a8c", "score": "0.46354797", "text": "function constructNewItemMirror() {\n // Construct new ItemMirror in Case 3, could choose other cases\n new ItemMirror(itemMirrorOptions[3], function (error, itemMirror) {\n if (error) { throw error; }\n //SchemaVersion 0.54\n //alertSchemaVersion(itemMirror);\n refreshLoop(itemMirror);\n listAssociations(itemMirror);\n });\n }", "title": "" }, { "docid": "2bf0bc04199e20b38341fc52cb128a8a", "score": "0.4631582", "text": "clone() {\n const clonedAttrs = this.attrs.map(([name, attr]) => [\n name,\n attr.clone()\n ]);\n return new Factory(this.Entity, clonedAttrs);\n }", "title": "" }, { "docid": "a5e0f765f82ed49e814da45c1b5b114d", "score": "0.4630193", "text": "function drawSchematic(instance) {\n const bodyGroup = Object(_svg_element_group__WEBPACK_IMPORTED_MODULE_5__[\"make\"])(\"body\");\n const cathodeEnd = instance.joints[_constants__WEBPACK_IMPORTED_MODULE_1__[\"INDEXCATHODE\"]];\n const anodeEnd = instance.joints[_constants__WEBPACK_IMPORTED_MODULE_1__[\"INDEXANODE\"]];\n const centre = Object(_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(cathodeEnd, anodeEnd).centre().vector;\n const rotation = Object(_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(anodeEnd).getAngleTo(cathodeEnd);\n let [cathodeStart, anodeStart] = Object(_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({ x: -12, y: 0 }, { x: 12, y: 0 }).rotate(rotation).sumWith(centre).vectors;\n //Text\n let text = (instance.breakdownVoltage < 51)\n ? Object(_utility_getStandardForm__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(instance.breakdownVoltage, 'V')\n : Object(_utility_getStandardForm__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(instance.saturationCurrent, 'A');\n const bodyPath = 'M 12 0 L -12 12 L -12 -12 L 12 0 Z';\n bodyGroup.append(Object(_svg_element_path__WEBPACK_IMPORTED_MODULE_3__[\"make\"])(bodyPath, \"body highlight highlightwithfill extrathick\"), Object(_svg_element_path__WEBPACK_IMPORTED_MODULE_3__[\"make\"])(bodyPath, \"body black\"), \n // Polarisation Line\n Object(_svg_element_path__WEBPACK_IMPORTED_MODULE_3__[\"make\"])('M 12 -12 L 12 12', \"line medium\"));\n if (instance.color === \"N/A\" || instance.color === undefined) {\n if (instance.breakdownVoltage < 51) {\n // Add the \"wings\" for xener\n bodyGroup.append(Object(_svg_element_path__WEBPACK_IMPORTED_MODULE_3__[\"make\"])([[{ x: 12, y: -12 }, { x: 18, y: -12 },], [{ x: 12, y: 12 }, { x: 6, y: 12 }]], \"line medium\"));\n }\n }\n else {\n // LED\n const arrowJointsBase = Object(_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"])([{ x: 0, y: 3 }, { x: -4, y: 0 }, { x: 0, y: -3 }, { x: -4, y: 0 }, { x: 8, y: 0 }]);\n const arrowJoints1 = arrowJointsBase.sumWith({ x: -16, y: -10 }).rotate(-116.43).vectors;\n const arrowJoints2 = arrowJointsBase.sumWith({ x: -16, y: 0 }).rotate(-116.43).vectors;\n const colorCircle = Object(_svg_element_circle__WEBPACK_IMPORTED_MODULE_6__[\"make\"])({ x: -4, y: 0 }, 4, \"line thin\");\n $(colorCircle.element).css(\"fill\", instance.color);\n $(colorCircle.element).css(\"stroke\", instance.color);\n bodyGroup.append(Object(_svg_element_path__WEBPACK_IMPORTED_MODULE_3__[\"make\"])(arrowJoints1, \"line black thin\"), //Arrow1\n Object(_svg_element_path__WEBPACK_IMPORTED_MODULE_3__[\"make\"])(arrowJoints2, \"line black thin\"), //Arrow2\n colorCircle //Color Indicator\n );\n }\n const textEl = Object(_svg_element_text__WEBPACK_IMPORTED_MODULE_4__[\"make\"])(text, { x: 0, y: -15 }, \"text\");\n return [\n Object(_svg_element_path__WEBPACK_IMPORTED_MODULE_3__[\"make\"])([[cathodeStart, cathodeEnd], [anodeStart, anodeEnd]], \"line thin\"),\n bodyGroup.translate(centre).rotate(rotation),\n textEl.translate(centre).rotatePosition(rotation),\n ];\n}", "title": "" }, { "docid": "c24c1003ac64b36ddb1570b8c1587c46", "score": "0.46249038", "text": "function createShelfLayout(product, svg) {\n const newRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n newRect.setAttribute('id', product.name);\n newRect.setAttribute('x', parseInt(product.x));\n newRect.setAttribute('y', parseInt(product.y));\n newRect.setAttribute('width', product.width) //product.x + product.width - (some distance for Void text)\n newRect.setAttribute('height', product.height)\n newRect.setAttribute('class','productRect');\n svg.appendChild(newRect);\n\n const newText = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n newText.setAttribute('id', product.name+ID_TEXT)\n newText.setAttribute('x', parseInt(product.x) + parseInt(product.width) - LEFT_JUSTIFY);\n newText.setAttribute('y', parseInt(product.y) + DOWN_JUSTIFY);\n newText.setAttribute('class','productText');\n svg.appendChild(newText);\n}", "title": "" }, { "docid": "5a7596f95c3a3692748d194b07aa8ed3", "score": "0.4624073", "text": "addFactory() {\n this.props.addFactory(this.state.name, this.state.min, this.state.max, this.state.numVals);\n }", "title": "" }, { "docid": "c9a3f47842d5f8b173ea5271a6ecb18c", "score": "0.46137294", "text": "function His_factoryModel(parentModel) {\n SubModel.call(this, parentModel, His_factoryModelDefines);\n\n // --------------------------------------------------------------\n // Objects\n // -------------------------------------------------------------- \n // StateOpen\n this.registerIntegerObject(\n His_factoryModelDefines.SL2_TVAPI_I32_HIS_FACTORY_STATE_OPEN,\n \"getStateOpen\", \"setStateOpen\", \"onStateOpenChaged\",\n null, null);\n\n this.registerIntegerObject(\n His_factoryModelDefines.SL2_TVAPI_I32_HIS_FACTORY_TO_FACTORY_OPITION,\n \"getTofactoryOpition\", \"setTofactoryOpition\", \"onTofactoryOpitionChaged\",\n null, null);\n\n\n this.registerIntegerObject(\n His_factoryModelDefines.SL2_TVAPI_I32_HIS_FACTORY_AGING,\n \"getFactoryAging\", \"setFactoryAging\", \"onFactoryAgingChaged\",\n null, null);\n\n this.registerIntegerObject(\n His_factoryModelDefines.SL2_TVAPI_I32_HIS_FACTORY_CURRENT_SOURCE,\n \"getFactoryCurrentSource\", \"setFactoryCurrentSource\", \"onFactoryCurrentSourceChaged\",\n null, null);\n this.registerIntegerObject(\n His_factoryModelDefines.SL2_TVAPI_I32_FACTORY_AREA_INDEX,\n \"getNewAreaIndex\", \"setNewAreaIndex\", \"onNewAreaIndexChaged\",\n null, null);\n\n}", "title": "" }, { "docid": "e09cf5997aa9142a4928787151625d7c", "score": "0.46032643", "text": "function SuperShape(x, y, m, n1, n2, n3,rot,scl,quantity) {\n this.inc = TWO_PI / quantity; //define the quantity of vertex\n this.scl = scl; //scale of object\n this.a = 1;\n this.b = 1;\n this.x = x;\n this.y = y;\n this.m = m;\n this.n1 = (n1 == null) ? 60 : n1;\n this.n2 = (n2 == null) ? 55 : n2;\n this.n3 = (n3 == null) ? 30 : n3;\n\n\n\n this.show = function() {\n push();\n translate(this.x, this.y);\n rotate(rot);\n stroke(255);\n noFill();\n beginShape();\n var of = 0;\n for (var j = 0; j < TWO_PI; j += this.inc) {\n this.noi = noise(of, op) * 50;\n this.noi2 = noise(50 + of, op) * 50;\n this.q = this.scl * this.cal(j)\n this.rx = this.q * cos(j);\n this.ry = this.q * sin(j);\n vertex(this.rx + this.noi, this.ry + this.noi2);\n of += amp*10;\n }\n endShape(CLOSE);\n pop();\n }\n\n\n this.cal = function(theta) {\n this.angle = theta * this.m / 4\n this.r = 1 / pow((pow(abs((1 / this.a) * cos(this.angle)), this.n2) + pow(abs((1 / this.b) * sin(this.angle)), this.n3)), 1 / this.n1);\n return (this.r);\n }\n}", "title": "" }, { "docid": "35f3b74291b3a50617d08de3a19084ae", "score": "0.45958808", "text": "function addItem(details)\n{\n var name = details.name;\n\n // Initialize the item with any default properties the item should have\n var item = Object.assign({}, baseItem);\n\n // Assign the item all the default properties for its category type\n Object.assign(item, this.defaults);\n\n // Assign item properties based on the item name\n Object.assign(item, this.list[name]);\n\n // By default, set the item's life to its maximum hit points\n item.life = item.hitPoints;\n\n // Override item defaults based on details\n Object.assign(item, details);\n\n return item;\n}", "title": "" }, { "docid": "a07e3db91cc0566893a4685b8ce196bc", "score": "0.45872483", "text": "_createPart() {\n return new AttributePart(this);\n }", "title": "" }, { "docid": "a07e3db91cc0566893a4685b8ce196bc", "score": "0.45872483", "text": "_createPart() {\n return new AttributePart(this);\n }", "title": "" }, { "docid": "b537c4e763b1fe42d8d05d86a3bd24ae", "score": "0.45816347", "text": "function Factory () {}", "title": "" }, { "docid": "fabb988e4858e2a36490712e6183cdca", "score": "0.45790842", "text": "function Item(){\n\tthis.title = 'Default Item Title';\n\tthis.description = 'This is the default item description';\n\tthis.attributes = {'creativity' : 1};\n\tthis.img = imgPath+'default-item.png';\n\tthis.price = 1;\n\n\tthis.getItemData = function(){//intial data for the item\n\t\tif(jQuery.urlParam('itemId') == null){\n\t\t\tthis.itemId = 'Default Item Class';\n\t\t}\n\t\telse{\n\t\t\tthis.itemId = jQuery.urlParam('itemId');\n\n\t\t}\n\t\t//ANDY's ITEMS\n\t\tif(this.itemId == 'bluetooth-axe'){\n\t\t\tthis.title = 'Blue Tooth Battle Axe';\n\t\t\tthis.description = 'Comes with a speaker so you can listen to Slayer while you slay. Also has a bottle opener for breaktime. '\n\t\t\tthis.attributes = {'creativity' : 1};\n\t\t\tthis.img = imgPath+'battle-axe.png';\n\t\t}\n\t\telse if(this.itemId == 'mouse-of-nine-heads'){\n\t\t\tthis.title = 'Mouse of Nine Heads';\n\t\t\tthis.description = 'Cat of Nine Tails, look the F out, there is no esc from this. '\n\t\t\tthis.attributes = {'charisma' : 1};\n\t\t\tthis.img = imgPath+'mouse-of-9.png';\n\t\t}\n\t\telse if(this.itemId == 'wifi-shield'){\n\t\t\tthis.title = 'Shield of WiFi';\n\t\t\tthis.description = 'Blocks excess data charges, but leaves you a bit exposed. '\n\t\t\tthis.attributes = {'knowledge' : 1};\n\t\t\tthis.img = imgPath+'wifi-shield.png';\n\t\t}\n\t\telse if(this.itemId == 'sword'){\n\t\t\tthis.title = 'Sword of Calculating';\n\t\t\tthis.description = 'Just add this sword, subtract your enemy\\'s limbs, divide their skull, and multiply the carnage.'\n\t\t\tthis.attributes = {'creativity' : 1};\n\t\t\tthis.img = imgPath+'sword.png';\n\t\t}\n\t\telse if(this.itemId == 'blue-ribbon-potion'){\n\t\t\tthis.title = 'Blue Ribbon Potion';\n\t\t\tthis.description = 'Do you need a frosty sippy-poo of courage? Thish wool totally do-er bud.'\n\t\t\tthis.attributes = {'charisma' : 1};\n\t\t\tthis.img = imgPath+'blue-ribbon-potion.png';\n\t\t}\n\t\telse if(this.itemId == 'lamp'){\n\t\t\tthis.title = 'Lamp of Synergenie';\n\t\t\tthis.description = 'Grants yours bloody wishes, but you’ll have to work together.'\n\t\t\tthis.attributes = {'creativity' : 1};\n\t\t\tthis.img = imgPath+'lamp.png';\n\t\t}\n\t\telse if(this.itemId == 'floppies'){\n\t\t\tthis.title = 'Razor-Sharp Throwing Floppies';\n\t\t\tthis.description = '13,107 of these equals one Gigabyte.'\n\t\t\tthis.attributes = {'knowledge' : 1};\n\t\t\tthis.img = imgPath+'floppies.png';\n\t\t}\n\t\telse if(this.itemId == 'mace'){\n\t\t\tthis.title = 'Mace of Gore Competencies';\n\t\t\tthis.description = 'Take what you’re best at and bash your way into new Monsters/Markets'\n\t\t\tthis.attributes = {'charisma' : 1};\n\t\t\tthis.img = imgPath+'mace.png';\n\t\t}\n\n\t\t//RYAN's ITEMS\n\t\telse if(this.itemId == 'chrome-pendant'){\n\t\t\tthis.title = 'Chrome Pendant of Finding';\n\t\t\tthis.description = 'You are pretty much lost without one.';\n\t\t\tthis.attributes = {'knowledge' : 1};\n\t\t\tthis.img = imgPath+'chrome-pendant.png';\n\t\t}\n\t\telse if(this.itemId == 'crystalline-usb'){\n\t\t\tthis.title = 'Crystalline Universal Spell Book';\n\t\t\tthis.description = 'It\\'s always a good idea to back your spell book up on one of these, just in case.'\n\t\t\tthis.attributes = {'knowledge' : 1};\n\t\t\tthis.img = imgPath+'crystalline-usb.png';\n\t\t}\n\t\telse if(this.itemId == 'fedora'){\n\t\t\tthis.title = 'White Knight\\'s Fedora';\n\t\t\tthis.description = 'Step up your game a notch with this stylish head-piece';\n\t\t\tthis.attributes = {'charisma' : 1};\n\t\t\tthis.img = imgPath+'fedora.png';\n\t\t}\n\t\telse if(this.itemId == 'phishing-rod'){\n\t\t\tthis.title = 'Phishing Rod';\n\t\t\tthis.description = 'Many fish bite if you got good bait.';\n\t\t\tthis.attributes = {'creativity' : 1};\n\t\t\tthis.img = imgPath+'phishing-rod.png';\n\t\t}\n\t\telse if(this.itemId == 'troll-hammer'){\n\t\t\tthis.title = 'Troll Hammer';\n\t\t\tthis.description = 'If you troll, you will be downvoted.';\n\t\t\tthis.attributes = {'charisma' : 1};\n\t\t\tthis.img = imgPath+'troll-hammer.png';\n\t\t}\n\n\t}\n\tthis.addItem = function(){\n\t\tfirebaseRef.child('items').child(this.title).set({\n\n\t\t\t\t'title' : this.title,\n\t\t\t\t'description' : this.description,\n\t\t\t\t'attributes' : this.attributes,\n\t\t\t\t'img' : this.img,\n\t\t\t\t'price' : this.price,\n\n\n\t\t});\t\n\t}\n\tthis.equipped = function(player){\n\t\tvar isEquipped = false;\n\t\t\n\t\tif(typeof player.inventory != 'undefined'){\n\t\t\t\tfor(var equippedItem in player.inventory){\n\t\t\t\t\tif(player.inventory.hasOwnProperty(equippedItem)) {\n\t\t\t\t\t\tif(item.title == equippedItem){\n\t\t\t\t\t\t\tisEquipped = true;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn isEquipped;\n\t\t//if its in the player's inventory, return true, else return false.\n\t}\n\tthis.syncData = function(){\n\t\tfirebaseRef.child('items').child(item.title).on('value', function(snapshot){\n\t\t\tvar dataSet = snapshot.val();\n\t\t\tif(typeof AdobeEdge.getComposition('item') != 'undefined'){\n\t\t\t\tvar sym = AdobeEdge.getComposition('item').getStage();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar sym = false;\n\t\t\t\tconsole.log('No symbol to sync data with. You must define a stage in this.syncData first.');\n\t\t\t}\n\n\t for(var key in dataSet){\n\t\tif (dataSet.hasOwnProperty(key)) {\n\t\t\t\tif(key == 'title'){\n\t\t\t\t\tif(sym && typeof sym.$('Item-Title') != 'undefined'){\n\t\t\t\t\t\tsym.$('Item-Title').html( dataSet[key]);//update the title symbol\n\t\t\t\t\t}\n\t\t\t\t\tthis.title = dataSet[key];\n\t\t\t\t}\n\t\t\t\tif(key == 'description'){\n\t\t\t\t\tif(typeof sym.$('Item-Description') != 'undefined'){\n\t\t\t\t\t\tsym.$('Item-Description').html( dataSet[key]); //update the description symbol\n\t\t\t\t\t}\n\t\t\t\t\tthis.description = dataSet[key];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(key == 'img'){ //update the item image \n\t\t\t\t\tif(sym && typeof sym.getSymbol('item-image') != 'undefined' && sym.getSymbol('item-image').$('image').length > 0){\n\t\t\t\t\tsym.getSymbol('item-image').$('image').css('backgroundImage', 'url('+dataSet[key]+')');\n\t\t\t\t\t}\n\t\t\t\t\tthis.img = dataSet[key];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(key == 'attributes'){ //loop through the attributes and display the correct number for each.\n\t\t\t\t\tif(sym && typeof sym.$('Item-Attributes') != 'undefined' ){\n\t\t\t\t\t\tsym.$('AttributesLabel').html('');\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tsym.$('Item-Attributes').html('');\n\t\t\t\t\t\tfor(var attributeKey in dataSet[key]){ \n\t\t\t\t\t\t\tsym.$('AttributesLabel').html('Boosts your '+attributeKey+'.');\n\t\t\t\t\t\t\tfor(var i = 0; i < dataSet[key][attributeKey]; i++){\n\t\t\t\t\t\t\t\tsym.$('Item-Attributes').append('<img class=\"'+attributeKey+'\" src=\"'+imgPath+attributeKey+'.png\" />' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.attributes = dataSet[key];\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t if(key == 'price'){ //show crypto credits on some pages\n\t\t\t\t\t\n\t\t\t\t\tthis.price = dataSet[key];\n\t\t\t\t}\n\t\t\t}\n\t\t \n\t \t \n\t }\n\t \n\t}, function (errorObject) {//fires when firebase fails to read data.\n\t console.log(\"The firebase read failed: \" + errorObject.code);\n\t});\n\t}\n\n}", "title": "" }, { "docid": "9fe302345f214978993feeaab87f4371", "score": "0.45780027", "text": "function addItem(){\r\n\t\t var text = new THREE.SpriteMaterial( { map: pelletTexture, color: 0xffffff } );\r\n\t\t var item = new THREE.Sprite(text);\t\r\n\t\t item.scale.set(0.75,0.75,1);\r\n\t\t return item;\r\n\t }", "title": "" }, { "docid": "925ce8a2330067a494e642c40133d443", "score": "0.45665655", "text": "function createItem(commands,options){return new CommandItem(commands,options);}", "title": "" }, { "docid": "33dc96f5d5556d905cfa75ca9955d86a", "score": "0.45626944", "text": "function makeItem(a,b,c){\n return {id:a, description:b, price:c}\n}", "title": "" }, { "docid": "db8e208b29ed2170af03cacb22a8bff5", "score": "0.45562702", "text": "function fillItem(item) {\n addDecoration(item, {\n props: {},\n data: {}\n }); // Change the sort data.\n\n Object.defineProperty(item, '_sortData', {\n get: function get() {\n return this.getData();\n },\n set: function set() {// nothing to do here.\n }\n });\n }", "title": "" }, { "docid": "64dab8ac75e0d3e3c755889fa4e2537b", "score": "0.45455754", "text": "function _createItem(item) {\n return {\n type: 'CREATE_ITEM',\n item\n }\n}", "title": "" }, { "docid": "44fd15a1d50b028f86ffe4d4d346afe7", "score": "0.45455492", "text": "function Product(offsetX, offsetY, size, simplomat) {\n this.simplomat = simplomat;\n this.simplomat.product = this;\n this.productPartsFactory = new ProductPartsFactory(this, size, simplomat);\n this.href = null;\n\n /* image that holds the current views image */\n this.image = simplomat.R.image(\"img/empty.gif\", offsetX, offsetY, size, size);\n this.image.simplomat = simplomat;\n this.image.product = this;\n this.image.click(function (event) {\n // design selected and click inside print area \n if (this.product.currentView.currentDesign != null &&\n event.clientX >= this.product.currentView.boundary.x &&\n event.clientX <= (this.product.currentView.boundary.x + this.product.currentView.boundary.width) &&\n event.clientY >= this.product.currentView.boundary.y &&\n event.clientY <= (this.product.currentView.boundary.y + this.product.currentView.boundary.height)) {\n this.product.currentView.currentDesign.img[0].hide();\n this.product.currentView.currentDesign = null;\n }\n });\n\n /* offset position of product image inside RaphaelJs render area*/\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n /* size of the product product image on RaphaelJs render area*/\n this.size = size;\n\n /* list of available views - taken from product type*/\n this.views = new Array();\n /* list of available appearances - taken from product type */\n this.appearances = new Array();\n /* list of available sizes - taken from product type */\n this.sizes = new Array();\n this.availableSizes = new Object();\n\n /* id of the product type currently used */\n this.productTypeId = null;\n /* id of the product type appearance currently used */\n this.appearanceId = null;\n this.sizeId = null;\n /* id of the product type view currently used */\n this.viewId = null;\n /* default appearance id set for the used product type */\n this.defaultAppearanceId = null;\n /* default view id set for the used product type */\n this.defaultViewId = null;\n /* default image view url used to create urls on view changes */\n this.imageUrl = null;\n /* shortcut to the currently used and displayed view */\n this.currentView = null;\n\n this.priceFormatter = new PriceFormatter(this.simplomat.spreadshirtAPI.currency.children(\"pattern\").text(),\n this.simplomat.spreadshirtAPI.currency.children(\"decimalCount\").text(),\n this.simplomat.spreadshirtAPI.country.children(\"decimalPoint\").text(),\n this.simplomat.spreadshirtAPI.country.children(\"thousandsSeparator\").text());\n this.priceSymbol = this.simplomat.spreadshirtAPI.currency.children(\"symbol\").text();\n this.price = null;\n\n /**\n *\n * @param productTypeId the id of the product type to be set\n * @param viewId the id of the product type view to be used\n * @param appearanceId the id of the product type appearance to be used\n * @param perspective optional perspective in case view id can not be given\n * @param appearanceName name of the appearance, e.g. black, white, ...\n * @param sizeName name of the size, e.g. M, L, XL\n * @return this product\n */\n this.init = function(productTypeId, viewId, appearanceId, perspective,\n appearanceName, sizeName) {\n /* id of the product type currently used*/\n this.productTypeId = productTypeId;\n /* xml of the current product type*/\n var productType = this.simplomat.spreadshirtAPI.getProductType(productTypeId);\n /* default view image url */\n this.imageUrl = productType.children(\"resources\").children(\"resource\").attr(\"xlink:href\");\n this.defaultAppearanceId = productType.find(\"defaultAppearance\") == null\n ? null\n : productType.find(\"defaultAppearance\").attr(\"id\");\n this.defaultViewId = productType.find(\"defaultView\") == null\n ? null\n : productType.find(\"defaultView\").attr(\"id\");\n /* id of the currently set product type appearance, i.e. color*/\n this.appearanceId = (appearanceId === null || appearanceId === undefined)\n ? this.defaultAppearanceId\n : appearanceId;\n /* id if the currently set product type view, e.g. front, back, etc.*/\n this.viewId = (viewId === null || viewId === undefined)\n ? this.defaultViewId\n : viewId;\n\n this.price = Number(productType.children(\"price\").children(\"vatIncluded\").text());\n\n\n this.appearances = this.productPartsFactory.createAppearances(productType);\n this.views = this.productPartsFactory.createViews(productType);\n this.sizes = this.productPartsFactory.createSizes(productType);\n this.availableSizes = this.productPartsFactory.createAvailableSizes(productType, this.appearances);\n\n for (var i = 0; i < this.appearances.length; i++) {\n if (this.appearances[i].name === appearanceName) {\n this.appearanceId = this.appearances[i].id;\n break;\n }\n }\n\n if (this.appearanceId === this.defaultAppearanceId) {\n var appearanceValid = false;\n for (var i = 0; i < this.appearances.length; i++) {\n if (this.appearances[i].id == this.appearanceId) {\n appearanceValid = true;\n }\n }\n if (!appearanceValid)\n this.appearanceId = this.appearances[0].id;\n }\n\n for (var i = 0; i < this.views.length; i++) {\n if (this.views[i].perspective === perspective) {\n this.viewId = this.views[i].id;\n break;\n }\n }\n\n if (this.viewId === this.defaultViewId) {\n var viewValid = false;\n for (var i = 0; i < this.views.length; i++) {\n if (this.views[i].id == this.viewId) {\n viewValid = true;\n }\n }\n if (!viewValid)\n this.viewId = this.views[0].id;\n }\n\n for (var i = 0; i < this.sizes.length; i++) {\n if (this.sizes[i].name === sizeName) {\n this.sizeId = this.sizes[i].id;\n break;\n }\n }\n\n this.changeView(this.viewId);\n return this;\n };\n /**\n * Returns a view for the given view id.\n *\n * @param viewId id of the view to be returned\n * @return a view or null\n */\n this.getView = function(viewId) {\n if (this.viewId != null) {\n for (var i = 0; i < this.views.length; i++) {\n if (this.views[i].id === viewId) {\n return this.views[i];\n }\n }\n }\n return null;\n };\n /**\n * Returns an appearance for the given appearance id.\n *\n * @param appearanceId id of the appearance to be returned\n * @return an appearance or null\n */\n this.getAppearance = function(appearanceId) {\n for (var i = 0; i < this.appearances.length; i++) {\n if (this.appearances[i].id === appearanceId) {\n return this.appearances[i];\n }\n }\n return null;\n };\n this.getSize = function(sizeId) {\n for (var i = 0; i < this.sizes.length; i++) {\n if (this.sizes[i].id === sizeId) {\n return this.sizes[i];\n }\n }\n return null;\n };\n this.getAvailableSizes = function() {\n return this.availableSizes[this.appearanceId];\n };\n this.changeProductType = function(productTypeId) {\n var currentViews = this.views;\n var perspective = this.currentView.perspective;\n var appearanceName = this.getAppearance(this.appearanceId).name;\n var sizeName = (this.sizeId != null) ? this.getSize(this.sizeId).name : \"\";\n\n var productType = this.simplomat.spreadshirtAPI.getProductType(productTypeId);\n var views = this.productPartsFactory.createViews(productType);\n var appearances = this.productPartsFactory.createAppearances(productType);\n var sizes = this.productPartsFactory.createSizes(productType);\n\n if (views.length > 0 && appearances.length > 0 && sizes.length > 0) {\n for (var i = 0; i < this.views.length; i++) {\n this.views[i].detach();\n }\n\n this.views = new Array();\n this.appearances = new Array();\n this.sizes = new Array();\n this.availableSizes = new Array();\n this.productTypeId = null;\n this.appearanceId = null;\n this.sizeId = null;\n this.viewId = null;\n this.defaultAppearanceId = null;\n this.defaultViewId = null;\n this.imageUrl = null;\n this.currentView = null;\n\n this.init(productTypeId, null, null, perspective, appearanceName, sizeName);\n\n for (var i = 0; i < currentViews.length; i++) {\n var perspective = currentViews[i].perspective;\n var newView = this.currentView;\n for (var k = 0; k < this.views.length; k++) {\n if (this.views[k].perspective === perspective) {\n newView = this.views[k];\n break;\n }\n }\n for (var j = 0; j < currentViews[i].designs.length; j++) {\n currentViews[i].designs[j].changeView(newView);\n }\n }\n\n this.simplomat.productTypeChangedCustomFunctions();\n }\n };\n /**\n * Changes view to the view for the given view id.\n *\n * @param viewId id of the view to be set\n */\n this.changeView = function(viewId) {\n if (this.getView(viewId) != null) {\n if (viewId == null)\n viewId = this.defaultViewId;\n\n if (this.currentView != null)\n this.currentView.hide();\n\n this.currentView = this.getView(viewId);\n this.viewId = viewId;\n this.currentView.show();\n this.simplomat.viewChangedCustomFunctions();\n }\n };\n /**\n * Changes appearance to the appearance for the given appearance id.\n *\n * @param appearanceId id of the appearance to be set\n */\n this.changeAppearance = function(appearanceId) {\n if (this.getAppearance(appearanceId) != null) {\n this.appearanceId = appearanceId;\n this.image.attr({src: this.createViewImageUrl(this.viewId, this.appearanceId, this.simplomat.defaultSize)});\n this.simplomat.appearanceChangedCustomFunctions();\n this.simplomat.priceChangedCustomFunctions();\n }\n };\n this.changeSize = function(sizeId) {\n if (this.getSize(sizeId) != null) {\n for (var i = 0; i < this.availableSizes[this.appearanceId].length; i++) {\n if (this.availableSizes[this.appearanceId][i] == sizeId) {\n this.sizeId = sizeId;\n this.simplomat.sizeChangedCustomFunctions();\n break;\n }\n }\n }\n };\n /**\n * Removes all designs placed on the product's views.\n */\n this.removeAllDesigns = function() {\n for (var i in this.views) {\n for (var j in this.views[i].designs) {\n this.views[i].designs[j].remove();\n }\n this.views[i].designs = new Array();\n this.views[i].currentDesign = null;\n }\n this.simplomat.R.safari();\n };\n this.removeAllText = function() {\n for (var i in this.views) {\n for (var j in this.views[i].texts) {\n this.views[i].texts[j].remove();\n }\n this.views[i].texts = new Array();\n }\n this.simplomat.R.safari();\n };\n this.removeAll = function() {\n this.removeAllDesigns();\n this.removeAllText();\n }; \n /**\n * Create a valid view image URL for the given appearance id, view id and size\n * that can be used to request such an image from the image API.\n *\n * @param viewId id of the product type view to be used\n * @param appearanceId id of the product type appearance to be used\n * @param size size of the view image, i.e. size is used for width and height parameter\n * when requesting image from image API\n * @return valid view image url\n */\n this.createViewImageUrl = function(viewId, appearanceId, size) {\n return this.imageUrl.substr(0, this.imageUrl.indexOf(\"/views\")) + \"/views/\" + viewId + \"/appearances/\" + appearanceId + \",width=\" + size + \",height=\" + size;\n };\n this.getFullPrice = function() {\n var price = this.price;\n for (var i = 0; i < this.views.length; i++) {\n for (var j = 0; j < this.views[i].designs.length; j++) {\n var design = this.views[i].designs[j];\n price += design.price;\n price += this.simplomat.printType.price;\n if (design.printColorIds !== undefined && design.printColorIds != null) {\n for (var k = 0; k < design.printColorIds.length; k++) {\n var printColorId = design.printColorIds[k];\n var printColor = this.simplomat.printType.getPrintColorById(printColorId);\n if (printColor != null)\n price += printColor.price;\n }\n }\n }\n for (var j = 0; j < this.views[i].texts.length; j++) {\n var text = this.views[i].texts[j];\n price += this.simplomat.printType.price;\n if (text.printColorId != undefined && text.printColorId != null) {\n var printColor = this.simplomat.printType.getPrintColorById(text.printColorId);\n if (printColor != null)\n price += printColor.price;\n }\n }\n }\n return price;\n };\n this.getFormatedPrice = function() {\n return this.priceFormatter.formatPrice(this.getFullPrice(), this.priceSymbol);\n };\n}", "title": "" }, { "docid": "6e16bea2cfbc7b1177de044de1ac8e62", "score": "0.45439336", "text": "function createStudentItem() {\n\n // 1. grab input from UI\n var input = UICtrl.getFormData();\n\n // 2. create Exam and push to list\n var exam = dataCtrl.createExam(input.name, input.student, input.grade);\n\n // 3. print info about exam in the list\n \n }", "title": "" }, { "docid": "26ff11c3b047358882aec80950509ce5", "score": "0.45421082", "text": "function Item(){Outlayer.Item.apply(this,arguments)}", "title": "" }, { "docid": "c79d4e58ba9d57ca327c40d0a909a6ca", "score": "0.4538443", "text": "function Item(position, image, imagesign, sprite, maxsize, dt, onestalk) {\n\n\t// --- attributes ---\n\tthis.position = position;\n\tthis.img = image;\n\tthis.sign = imagesign;\n\tthis.width = 32; //width of the single frame\n\tthis.height = 32; //height of the single frame\n\tthis.offset = 16;\n\t\n\t// - Growth attributes -\n\tthis.maxSize = maxsize;\n\tthis.stalkSPRT = sprite;\n\tthis.steptime = dt;\n\tthis.oneStalk = onestalk;\n\t\n\t// - inventory -\n\tthis.quantity = 0;\n\t\n\t// --- methods ---\n\tthis.sow = function() {\t// semer\n\t\t// must make a small sprout appear\n\t}\n\tthis.setQuantity = function(q) {\n\t\tthis.quantity = q;\n\t}\n\tthis.drawQuantity = function() {\n\t\n\t\tvar i = 0;\n\t\tvar q = this.quantity;\n\t\tvar d;\n\t\t\n\t\tif(q == 0) {\n\t\t\ttry {\n\t\t\t\tctx.drawImage(tinyfont, 0, 0, 8, 8, this.position[0] +6, this.position[1] +38, 8, 8);\n\t\t\t} catch (e) {}\n\t\t}\n\t\telse {\n\t\t\t// get number of digits\n\t\t\twhile(q != 0) {\n\t\t\t\t\n\t\t\t\t// get digit\n\t\t\t\td = q % 10;\n\t\t\t\t\n\t\t\t\t// draw\n\t\t\t\ttry {\n\t\t\t\t\tctx.drawImage(tinyfont, d*8, 0, 8, 8, this.position[0]-i*8 +6, this.position[1] +38, 8, 8);\n\t\t\t\t} catch (e) {}\n\t\t\t\t\n\t\t\t\t// iterate\n\t\t\t\tq = ~~(q/10);\n\t\t\t\t++i;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "caa611588059ad950b08d344380e8f2f", "score": "0.45380723", "text": "function laptopFactory(producer, model, ramAmount) {\n\tlet extendableRam = ramAmount;\n\treturn {\n\t\tproducer,\n\t\tmodel,\n\t\t// Here we could use a getter:\n\t\tmemory() {\n\t\t\treturn extendableRam + ' GB';\n\t\t},\n\t\textendMemory(extendBy) {\n\t\t\textendableRam += extendBy;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6906874daaf52358fd49b4f57d98a144", "score": "0.45327666", "text": "expand(phraseFactory)\n\t{\n\t\tvar thisPhrase=this\n\t\treturn new class expandPhrase extends ishml.Phrase\n\t\t{\n\t\t\tgenerate()\n\t\t\t{\n\t\t\t\tthis.results=thisPhrase.generate()\n\t\t\t\tthis.text=this.toString()\n\t\t\t\tif (this.text)\n\t\t\t\t{\n\t\t\t\t\tif(this.results.length===1 && this.results[0].value instanceof Array)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.results=phraseFactory(this.results[0].value).generate().map(item=>Object.assign({},item))\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.results=phraseFactory(this.results).generate().map(item=>Object.assign({},item))\n\t\t\t\t\t}\n\t\t\t\t\tthis.text=this.toString()\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tthis.results=[]\n\t\t\t\t\tthis.text=\"\"\n\t\t\t\t}\n\t\t\t\treturn this.results\n\t\t\t}\n\t\t}(this)\n\t}", "title": "" }, { "docid": "663a54eb5b2a34f8b76c7144f785382f", "score": "0.45277023", "text": "function createDisplayItem(title, subtitle, invalid) {\n // If the argument is a date object\n if(title instanceof Date)\n return createDisplayItem(title.getDayName(), title.getMonthName() + \" \" + title.getDate());\n return {\n title : title,\n subtitle : subtitle || \"\",\n pieceInfo: [],\n invalid : invalid || false\n };\n}", "title": "" }, { "docid": "5c523c7959dad761e85a450cb592176b", "score": "0.4525406", "text": "constructor(root, x, y, itemData) { // Namely, 'affects', 'power' and 'duration' to start.\n super(root, x, y);\n this.type = itemData.type;\n this.power = itemData.power;\n this.duration = itemData.duration;\n this.id = `${this.type}-${this.x}-${this.y}`;\n this.domElement.src = `./assets/items/${this.type}.png`;\n this.domElement.id = this.id;\n this.domElement.classList.add('item');\n this.domElement.style.left = `${this.x * BLOCK_WIDTH}px`;\n this.domElement.style.bottom = `${this.y * BLOCK_WIDTH}px`;\n }", "title": "" }, { "docid": "c3019d4220cac736d89c50f907520042", "score": "0.45133916", "text": "_createPart() {\n return new AttributePart(this);\n }", "title": "" }, { "docid": "cff948e962cd547f8924f427779f7b89", "score": "0.45051855", "text": "function newShoe() {\n var name = document.querySelector('#name').value;\n var color = document.querySelector('#color').value;\n var size = document.querySelector('#size').value;\n var price = document.querySelector('#price').value;\n\n inventory.push(new Shoe(name, color, size, price));\n\n populateHTML();\n}", "title": "" }, { "docid": "966cd99b0355b74dd0b3d2ceecc394f8", "score": "0.4492629", "text": "function componentFactory(definition) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _definition$defaultSe = definition.defaultSettings,\n defaultSettings = _definition$defaultSe === void 0 ? {} : _definition$defaultSe,\n _definition$_DO_NOT_U = definition._DO_NOT_USE_getInfo,\n _DO_NOT_USE_getInfo = _definition$_DO_NOT_U === void 0 ? function () {\n return {};\n } : _definition$_DO_NOT_U;\n\n var _chart = context.chart,\n container = context.container,\n _mediator = context.mediator,\n _registries = context.registries,\n theme = context.theme,\n renderer = context.renderer;\n var emitter = EventEmitter$1.mixin({});\n var config = context.settings || {};\n\n var _settings = extend(true, {}, defaultSettings, config);\n\n var _data = [];\n\n var _scale;\n\n var _formatter;\n\n var element;\n var size;\n\n var _style;\n\n var _resolver = settingsResolver({\n chart: _chart\n });\n\n var _isVisible = false;\n var brushArgs = {\n nodes: [],\n chart: _chart,\n config: _settings.brush || {},\n renderer: null\n };\n var brushTriggers = {\n tap: [],\n over: []\n };\n var brushStylers = [];\n var definitionContext = {};\n var instanceContext = extend({}, config); // Create a callback that calls lifecycle functions in the definition and config (if they exist).\n\n function createCallback(method) {\n var defaultMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n var canBeValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n return function cb() {\n var inDefinition = typeof definition[method] !== 'undefined';\n var inConfig = typeof config[method] !== 'undefined';\n var returnValue;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (inDefinition) {\n if (typeof definition[method] === 'function') {\n var _definition$method;\n\n returnValue = (_definition$method = definition[method]).call.apply(_definition$method, [definitionContext].concat(args));\n } else if (canBeValue) {\n returnValue = definition[method];\n }\n }\n\n if (inConfig) {\n if (typeof config[method] === 'function') {\n var _config$method;\n\n returnValue = (_config$method = config[method]).call.apply(_config$method, [instanceContext].concat(args));\n } else if (canBeValue) {\n returnValue = config[method];\n }\n }\n\n if (!inDefinition && !inConfig) {\n returnValue = defaultMethod.call.apply(defaultMethod, [definitionContext].concat(args));\n }\n\n return returnValue;\n };\n }\n\n var preferredSize = createCallback('preferredSize', function () {\n return 0;\n }, true);\n var resize = createCallback('resize', function (_ref2) {\n var inner = _ref2.inner;\n return inner;\n });\n var created = createCallback('created');\n var beforeMount = createCallback('beforeMount');\n var mounted = createCallback('mounted');\n var beforeUnmount = createCallback('beforeUnmount');\n var beforeUpdate = createCallback('beforeUpdate');\n var updated = createCallback('updated');\n var beforeRender = createCallback('beforeRender');\n var beforeDestroy = createCallback('beforeDestroy');\n var destroyed = createCallback('destroyed');\n var render = definition.render; // Do not allow overriding of this function\n\n var addBrushStylers = function addBrushStylers() {\n if (_settings.brush) {\n (_settings.brush.consume || []).forEach(function (b) {\n if (b.context && b.style) {\n brushStylers.push(styler(brushArgs, b));\n }\n });\n }\n };\n\n var addBrushTriggers = function addBrushTriggers() {\n if (_settings.brush) {\n (_settings.brush.trigger || []).forEach(function (t) {\n if (t.on === 'over') {\n brushTriggers.over.push(t);\n } else {\n brushTriggers.tap.push(t);\n }\n });\n }\n };\n\n Object.defineProperty(brushArgs, 'data', {\n get: function get() {\n return _data;\n }\n });\n var rendString = _settings.renderer || definition.renderer;\n var rend = rendString ? renderer || _registries.renderer(rendString)() : renderer || _registries.renderer()();\n brushArgs.renderer = rend;\n var dockConfigCallbackContext = {\n resources: _chart.logger ? {\n logger: _chart.logger()\n } : {}\n };\n\n var _dockConfig = dockConfig(createDockDefinition(_settings, preferredSize, _chart.logger()), dockConfigCallbackContext);\n\n var appendComponentMeta = function appendComponentMeta(node) {\n node.key = _settings.key;\n node.element = rend.element();\n };\n\n var fn = function fn() {};\n\n fn.dockConfig = function () {\n return _dockConfig;\n }; // Set new settings - will trigger mapping of data and creation of scale / formatter.\n\n\n fn.set = function () {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (opts.settings) {\n config = opts.settings;\n _settings = extend(true, {}, defaultSettings, opts.settings);\n _dockConfig = dockConfig(createDockDefinition(_settings, preferredSize, _chart.logger()), dockConfigCallbackContext);\n }\n\n if (_settings.scale) {\n _scale = _chart.scale(_settings.scale);\n }\n\n if (_settings.data) {\n _data = extract(_settings.data, {\n dataset: _chart.dataset,\n collection: _chart.dataCollection\n }, {\n logger: _chart.logger()\n }, _chart.dataCollection);\n } else if (_scale) {\n _data = _scale.data();\n } else {\n _data = [];\n }\n\n if (typeof _settings.formatter === 'string') {\n _formatter = _chart.formatter(_settings.formatter);\n } else if (_typeof(_settings.formatter) === 'object') {\n _formatter = _chart.formatter(_settings.formatter);\n } else if (_scale && _scale.data().fields) {\n _formatter = _scale.data().fields[0].formatter();\n }\n\n _style = theme.style(_settings.style || {});\n };\n\n fn.resize = function () {\n var inner = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var outer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var newSize = resize({\n inner: inner,\n outer: outer\n });\n\n if (newSize) {\n size = rend.size(newSize);\n } else {\n size = rend.size(inner);\n }\n\n instanceContext.rect = extend(true, {\n computedPhysical: size.computedPhysical,\n computedOuter: outer.computed || outer,\n computedInner: inner.computed || inner\n }, inner);\n size = extend(true, {\n computedOuter: outer.computed || outer,\n computedInner: inner.computed || inner\n }, size);\n };\n\n fn.getRect = function () {\n return instanceContext.rect;\n };\n\n var getRenderArgs = function getRenderArgs() {\n var renderArgs = rend.renderArgs ? rend.renderArgs.slice(0) : [];\n renderArgs.push({\n data: _data\n });\n return renderArgs;\n };\n\n fn.beforeMount = beforeMount;\n\n fn.beforeRender = function () {\n beforeRender({\n size: size\n });\n };\n\n var currentNodes;\n\n fn.render = function () {\n var nodes = brushArgs.nodes = render.call.apply(render, [definitionContext].concat(_toConsumableArray$1(getRenderArgs())));\n rend.render(nodes);\n currentNodes = nodes;\n };\n\n fn.hide = function () {\n fn.unmount();\n rend.size({\n x: 0,\n y: 0,\n width: 0,\n height: 0\n });\n rend.clear();\n };\n\n fn.beforeUpdate = function () {\n beforeUpdate({\n settings: _settings,\n data: _data\n });\n };\n\n var currentTween;\n\n fn.update = function () {\n if (currentTween) {\n currentTween.stop();\n }\n\n var nodes = brushArgs.nodes = render.call.apply(render, [definitionContext].concat(_toConsumableArray$1(getRenderArgs()))); // Reset brush stylers and triggers\n\n brushStylers.forEach(function (b) {\n return b.cleanUp();\n });\n brushStylers.length = 0;\n brushTriggers.tap = [];\n brushTriggers.over = [];\n\n if (_settings.brush) {\n addBrushStylers();\n addBrushTriggers();\n }\n\n brushStylers.forEach(function (bs) {\n if (bs.isActive()) {\n bs.update();\n }\n });\n\n if (currentNodes && _settings.animations && _settings.animations.enabled) {\n currentTween = tween({\n old: currentNodes,\n current: nodes\n }, {\n renderer: rend\n }, _settings.animations);\n currentTween.start();\n } else {\n rend.render(nodes);\n }\n\n currentNodes = nodes;\n\n if (rend.setKey && typeof config.key === 'string') {\n rend.setKey(config.key);\n }\n };\n\n fn.updated = updated;\n\n fn.destroy = function () {\n fn.unmount();\n beforeDestroy(element);\n rend.destroy();\n destroyed();\n element = null;\n };\n /**\n * Update active nodes. For now this can be used as a way update and apply brushing on nodes.\n * Ex: if a component have changed the nodes since its initial render.\n * @param {Nodes[]} nodes\n * @deprecated\n * @ignore\n */\n\n\n var updateNodes = function updateNodes(nodes) {\n brushArgs.nodes = nodes;\n brushStylers.forEach(function (bs) {\n if (bs.isActive()) {\n bs.update();\n }\n });\n rend.render(nodes);\n }; // Set contexts, note that the definition and instance need different contexts (for example if they have different 'require' props)\n\n\n prepareContext(definitionContext, definition, {\n settings: function settings() {\n return _settings;\n },\n data: function data() {\n return _data;\n },\n scale: function scale() {\n return _scale;\n },\n formatter: function formatter() {\n return _formatter;\n },\n renderer: function renderer() {\n return rend;\n },\n chart: function chart() {\n return _chart;\n },\n dockConfig: function dockConfig() {\n return _dockConfig;\n },\n mediator: function mediator() {\n return _mediator;\n },\n instance: function instance() {\n return instanceContext;\n },\n rect: function rect() {\n return instanceContext.rect;\n },\n style: function style() {\n return _style;\n },\n update: function update() {\n return updateNodes;\n },\n registries: function registries() {\n return _registries;\n },\n resolver: function resolver() {\n return _resolver;\n },\n symbol: function symbol() {\n return create$3(_registries.symbol);\n }\n });\n prepareContext(instanceContext, config, {\n settings: function settings() {\n return _settings;\n },\n data: function data() {\n return _data;\n },\n scale: function scale() {\n return _scale;\n },\n formatter: function formatter() {\n return _formatter;\n },\n renderer: function renderer() {\n return rend;\n },\n chart: function chart() {\n return _chart;\n },\n dockConfig: function dockConfig() {\n return _dockConfig;\n },\n mediator: function mediator() {\n return _mediator;\n },\n style: function style() {\n return _style;\n },\n _DO_NOT_USE_getInfo: _DO_NOT_USE_getInfo.bind(definitionContext),\n isVisible: function isVisible() {\n return _isVisible;\n }\n });\n\n fn.getBrushedShapes = function getBrushedShapes(brushCtx, mode, props) {\n var shapes = [];\n\n if (_settings.brush && _settings.brush.consume) {\n var brusher = _chart.brush(brushCtx);\n\n var sceneNodes = rend.findShapes('*');\n\n _settings.brush.consume.filter(function (t) {\n return t.context === brushCtx;\n }).forEach(function (consume) {\n for (var i = 0; i < sceneNodes.length; i++) {\n var node = sceneNodes[i];\n\n if (node.data && brusher.containsMappedData(node.data, props || consume.data, mode)) {\n appendComponentMeta(node);\n shapes.push(node);\n sceneNodes.splice(i, 1);\n i--;\n }\n }\n });\n }\n\n return shapes;\n };\n\n fn.findShapes = function (selector) {\n var shapes = rend.findShapes(selector);\n\n for (var i = 0, num = shapes.length; i < num; i++) {\n appendComponentMeta(shapes[i]);\n }\n\n return shapes;\n };\n\n fn.shapesAt = function (shape) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var items = rend.itemsAt(shape);\n var shapes;\n\n if (opts && opts.propagation === 'stop' && items.length > 0) {\n shapes = [items.pop().node];\n } else {\n shapes = items.map(function (i) {\n return i.node;\n });\n }\n\n for (var i = 0, num = shapes.length; i < num; i++) {\n appendComponentMeta(shapes[i]);\n }\n\n return shapes;\n };\n\n fn.brushFromShapes = function (shapes) {\n var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n trigger.contexts = Array.isArray(trigger.contexts) ? trigger.contexts : [];\n var action = trigger.action || 'toggle';\n brushFromSceneNodes({\n nodes: shapes,\n action: action,\n trigger: trigger,\n chart: _chart,\n data: brushArgs.data\n });\n };\n\n fn.mount = function () {\n element = rend.element && rend.element() ? element : rend.appendTo(container);\n\n if (rend.setKey && typeof config.key === 'string') {\n rend.setKey(config.key);\n }\n\n if (_settings.brush) {\n addBrushStylers();\n addBrushTriggers();\n }\n\n setUpEmitter(instanceContext, emitter, config);\n setUpEmitter(definitionContext, emitter, definition);\n _isVisible = true;\n };\n\n fn.mounted = function () {\n return mounted(element);\n };\n\n fn.unmount = function () {\n [instanceContext, definitionContext].forEach(function (ctx) {\n tearDownEmitter(ctx, emitter);\n });\n brushTriggers.tap = [];\n brushTriggers.over = [];\n brushStylers.forEach(function (bs) {\n bs.cleanUp();\n });\n brushStylers.length = 0;\n beforeUnmount();\n _isVisible = false;\n };\n\n fn.onBrushTap = function (e) {\n brushTriggers.tap.forEach(function (t) {\n if (resolveTapEvent({\n e: e,\n t: t,\n config: brushArgs\n }) && t.globalPropagation === 'stop') {\n _chart.toggleBrushing(true);\n }\n });\n };\n\n fn.onBrushOver = function (e) {\n brushTriggers.over.forEach(function (t) {\n if (resolveOverEvent({\n e: e,\n t: t,\n config: brushArgs\n }) && t.globalPropagation === 'stop') {\n _chart.toggleBrushing(true);\n }\n });\n };\n /**\n * Expose definition on instance\n * @private\n * @experimental\n */\n\n\n fn.def = definitionContext;\n /**\n * Expose instanceCtx on \"instance\"\n * @private\n * @experimental\n */\n\n fn.ctx = instanceContext;\n\n fn.renderer = function () {\n return rend;\n };\n\n fn.set({\n settings: config\n });\n created();\n return fn;\n}", "title": "" }, { "docid": "1d75e5c4ff7109c22888ec279a6ce1d0", "score": "0.44865254", "text": "function Item(name, sell_in, quality) {\n this.name = name;\n this.sell_in = sell_in;\n this.quality = quality;\n}", "title": "" }, { "docid": "2c63e6ab6d09e0ff9f6915e9c2a714ba", "score": "0.44825456", "text": "_createEntry(key, item) {\n\t\treturn <PresetCard\n\t\t\tkey={key}\n\t\t\tclassName=\"mb-2\"\n\t\t\tpreset={item}\n\t\t\tonClick={this._onPresetClicked.bind(this)}\n\t\t/>;\n\t}", "title": "" }, { "docid": "fdfb85ccd9941fe94c3cfc285e67ed24", "score": "0.44781095", "text": "get make() {\n return {\n sprite: path => this.add(\n new Sprite(new Texture(path))\n ),\n tileSprite: (path, w, h) => {\n return this.add(\n new TileSprite(new Texture(path), w, h)\n );\n }\n };\n }", "title": "" }, { "docid": "14f28ab859039a2685e47da105274eb4", "score": "0.44758046", "text": "function createPartObject(partCode) {\r\n let product = {\r\n supplier: getSupplier(partCode),\r\n productNumber: getProductNumber(partCode),\r\n size: getProductSize(partCode),\r\n display:function (){\r\n console.log(\"Part code: \" + partCode)\r\n console.log(\"The size (\" + this.size + \") part \" + this.productNumber + \" is supplied by \" + this.supplier)\r\n }\r\n }\r\n return product\r\n}", "title": "" }, { "docid": "6cad81f4dada3c35c3ade55ba2741b36", "score": "0.44749862", "text": "injectItem(item) {\n this._item = item;\n this.innerText = item.data[this.displayField];\n }", "title": "" }, { "docid": "5abde25278caf6b46fe038243bbeb3e4", "score": "0.4472628", "text": "function createPreShelf(title, keyName, seq) {\n var hr = getBiblioHref(keyName);\n var x = [\n '<div class=\"container-xxl\">',\n '<div id=\"covers-outer\" class =\"shelf-container text-center\">',\n '<div class=\"shelf\">',\n '<ul id=\"covers-' + keyName + '\">'\n ].join('\\n');\n return x;\n}", "title": "" }, { "docid": "12eca915f62b6ae960d664ae49ea7950", "score": "0.44681776", "text": "function createItem(tableid, articleno, name, info, stats, qty, oldPrice, newPrice){\n var newItem = `\n <div class=\"item\">\n <input type=\"checkbox\" name=\"selectItem\" id=\"checkbox-${tableid}-${articleno}\"><br/>\n <div class=\"item-general\">\n <div class=\"name\"><p>${name}</p></div>\n <div class=\"info\"><p>${info}</p></div>\n </div>\n <div class=\"stats\"><p>${stats}</p></div>\n <div class=\"item-options\">\n\n <button class=\"on-the-house\" id=\"on-house-${tableid}-${articleno}\" onclick=onHouse(${tableid},${articleno})></button>\n <button class=\"not-on-the-house\" id=\"not-on-house-${tableid}-${articleno}\" onclick=notOnHouse(${tableid},${articleno})></button>\n <button class=\"remove-item-order\" id=\"remove-item-${tableid}-${articleno}\" onclick=removeItemOrder(${tableid},${articleno})>remove</button>\n <forum>\n <label class=\"item-mod-qty\" for=\"quantity-${tableid}-${articleno}\"></label>\n <input type=\"number\" id=\"quantity-${tableid}-${articleno}\" name=\"quantity\" min=\"1\" max=\"10\" value=\"${qty}\" onchange=updateTableOrderQty(${tableid},${articleno})>\n </forum>\n <forum>\n <label class=\"item-mod-price\" for=\"price-${tableid}-${articleno}\"></label>\n <input type=\"number\" id=\"price-${tableid}-${articleno}\" name=\"price\" min=\"1\" max=\"10000\" value=\"${newPrice}\" onchange=updateTableOrderPrice(${tableid},${articleno})>\n </forum>\n <span class=\"item-price\" id=\"old-price-${tableid}-${articleno}\"></span>\n </div>\n </div>`;\n return newItem;\n}", "title": "" }, { "docid": "546811e63d4f44dd4f7438b967e18ee5", "score": "0.44616988", "text": "_createPart() {\n return new AttributePart(this);\n }", "title": "" }, { "docid": "546811e63d4f44dd4f7438b967e18ee5", "score": "0.44616988", "text": "_createPart() {\n return new AttributePart(this);\n }", "title": "" }, { "docid": "546811e63d4f44dd4f7438b967e18ee5", "score": "0.44616988", "text": "_createPart() {\n return new AttributePart(this);\n }", "title": "" }, { "docid": "546811e63d4f44dd4f7438b967e18ee5", "score": "0.44616988", "text": "_createPart() {\n return new AttributePart(this);\n }", "title": "" }, { "docid": "1e28bd429e2f033e6bfc0c319ac47360", "score": "0.4453813", "text": "async *getSchematics() {\n const seenNames = new Set();\n for (const collectionName of await this.getCollectionNames()) {\n const workflow = this.getOrCreateWorkflowForBuilder(collectionName);\n const collection = workflow.engine.createCollection(collectionName);\n for (const schematicName of collection.listSchematicNames(true /** includeHidden */)) {\n // If a schematic with this same name is already registered skip.\n if (!seenNames.has(schematicName)) {\n seenNames.add(schematicName);\n yield {\n schematicName,\n collectionName,\n schematicAliases: this.listSchematicAliases(collection, schematicName),\n };\n }\n }\n }\n }", "title": "" }, { "docid": "e6240517de51048d94c6736edcef3d0d", "score": "0.44513", "text": "initItem(item) {\n item = super.initItem(item);\n if (!item.name) item.name = \"\";\n return item;\n }", "title": "" }, { "docid": "b79d32fb087bf2ecdd5a908d54a2aa00", "score": "0.4447158", "text": "function abstractFactory() {}", "title": "" }, { "docid": "d2f9f803f874bb48f56f227dcc9099f4", "score": "0.44441727", "text": "static createInstance(productID, name, type, from, processline, createdTime, weight, supplier, owner) {\n\n if(type == Type.ORIGINAL) {\n\n console.log('Run type of ORIGINAL to new Product.');\n return new Product({ productID, name, type, createdTime, weight, owner });\n } else if(type == Type.RAWMATERIAL) {\n\n console.log('Run type of RAWMATERIAL to new Product.');\n return new Product({ productID, name, type, from, createdTime, weight, supplier, owner });\n } else if(type == Type.FINAL) {\n\n console.log('Run type of FINAL to new Product.');\n return new Product({ productID, name, type, processline, createdTime, weight, supplier, owner });\n }\n }", "title": "" }, { "docid": "30ec586300f8e1fc0255d01ddda805fe", "score": "0.44426295", "text": "function setupItems()\n{\n itemGloves = new Item(\"Gloves\", gloves);\n itemArray.push(itemGloves);\n itemRedHerring = new Item(\"Red Herring\", redherring);\n itemArray.push(itemRedHerring);\n itemFlowers = new Item(\"Flowers\", null);\n itemArray.push(itemFlowers);\n itemPerfume = new Item(\"Perfume\", null);\n itemArray.push(itemPerfume);\n itemBroom = new Item(\"Broom\", null);\n itemArray.push(itemBroom);\n itemWand = new Item(\"Magic Wand\", null);\n itemArray.push(itemWand);\n}", "title": "" }, { "docid": "8c3ef6098404568cf86f5b0d4ec90730", "score": "0.4439332", "text": "function Item(xml, url){\r\n this.name = xml.attr(\"id\");\r\n if (xml.find(\"DisplayId\").text() && !xml.find(\"DisplayId\").text().includes(\"{\")) {\r\n this.name = xml.find(\"DisplayId\").text();\r\n this.id = xml.attr(\"id\");\r\n }\r\n\r\n this.url = url;\r\n this.spriteFile = xml.find(\"File\").text().replace(\"Embed\",\"\") + \".png\";\r\n this.spriteRef = xml.find(\"Index\").text();\r\n\r\n this.stats = {};\r\n for (stat of xml.find(\"ActivateOnEquip\")) {\r\n this.stats[Number(stat.attributes[0].nodeValue)] = Number(stat.attributes[1].nodeValue);\r\n }\r\n this.stats[24] = Number(xml.find(\"FameBonus\").text()) || 0;\r\n\r\n // item.spriteFile = item.spriteFile.replace(\"playerskins\", \"playersSkins\")\r\n // this.consumable = xml.find(\"Consumable\").length;\r\n // this.soulbound = xml.find(\"Soulbound\").length;\r\n // this.feedpower = xml.find(\"feedPower\").text();\r\n this.desc = xml.find(\"Description\").text();\r\n // this.tier = xml.find(\"Tier\").text();\r\n\r\n //Return html for an Item Sprite\r\n Item.prototype.drawSprite = function(){\r\n row = 0 - (this.spriteRef >>> 4);\r\n column = 0 - (this.spriteRef & 0x00F);\r\n let style = `style=\"background-image: url(${this.url}/sheets/${this.spriteFile});background-position:${column*48}px ${row*48}px;\"`;\r\n return `<div class=\"item-sprite\" ${this.spriteRef ? style : \"\"}></div>`;\r\n }\r\n\r\n Item.prototype.stringifyStats = function() {\r\n let string = \"\";\r\n\r\n for (var i in this.stats) {\r\n if (this.stats.hasOwnProperty(i)) {\r\n string += \"\\n\" + stats[i] + \": \" + this.stats[i];\r\n }\r\n }\r\n\r\n return string;\r\n }\r\n\r\n //Append Beutiful HTML Representation of 'item' to 'container'\r\n // Item.prototype.drawItem = function(container){\r\n // div = \"\";\r\n //\r\n // div += \"<div class='item' title='\"+(this.id ? this.id : this.name)+\"'>\"\r\n // div += \"<h3 class='item-header'>\"\r\n // div += this.drawSprite()\r\n // div += \"<div class='header-text'>\"\r\n // div += \"<div class='item-name'>\" + this.name + \"</div>\"\r\n // div += \"<div class='tier'>\" + (this.tier == \"\" ? \"<span style='color: #8B2DDC;' >UT</span>\" : (this.consumable ? \"\" : \"T\" + this.tier)) + \"</div>\"\r\n // div += \"</div>\"\r\n // div += \"</h3>\"\r\n // div += \"</div>\"\r\n //\r\n // container.append(div)\r\n // }\r\n Item.prototype.drawItem = function(container) {\r\n container.append(\r\n //<div class=\"item-sprite\" style=\"background-image: url(${this.url}/sheets/${this.spriteFile};background-position: ${(0 - (this.spriteRef >>> 4))*48}px ${(0 - (this.spriteRef & 0x00F))*48}px;\"></div>\r\n`<div class=\"item\" title=\"${this.id ? this.id : this.name}\\n${this.desc}${this.stringifyStats()}\">\r\n <h3 class=\"item-header\">\r\n ${this.drawSprite()}\r\n <div class=\"item-name\">${this.name}</div>\r\n <div class=\"tier\">${this.score}</div>\r\n </h3>\r\n</div>\r\n`);\r\n }\r\n}", "title": "" }, { "docid": "1bbdc4416004f41ab54c14f6f943bfc2", "score": "0.44374022", "text": "function _buildItem( item, availability, packageWeightAndSize, product ) {\n\n if( !item.sku || !item.condition ) {\n debug(\"Missing Required Param (buildItem)!!!\");\n debug(\" > sku\", item.sku);\n debug(\" > condition\", item.condition);\n return false;\n }\n\n // Check enum values\n if( !_.includes( enums.conditions, String( item.condition ).toUpperCase() ) ) {\n debug(\"Unsupported condition\", item.condition)\n return false;\n }\n\n // Handoffs for extending\n if ( !item.availability && availability ) {\n item.availability = availability;\n }\n if ( !item.packageWeightAndSize && packageWeightAndSize ) {\n item.packageWeightAndSize = packageWeightAndSize;\n }\n if ( !item.product && product ) {\n item.product = product;\n }\n\n return _.extend({\n \"availability\": {},\n \"condition\": item.condition || \"\",\n \"conditionDescription\": \"\",\n \"packageWeightAndSize\": {},\n \"product\": {},\n \"sku\": \"\"\n }, item );\n }", "title": "" }, { "docid": "d3b2cf064022ac92a15e422f07bf935f", "score": "0.44323736", "text": "function create(prototype, props) {\n\t var result = baseCreate(prototype);\n\t if (props) extendOwn(result, props);\n\t return result;\n\t }", "title": "" }, { "docid": "d3b2cf064022ac92a15e422f07bf935f", "score": "0.44323736", "text": "function create(prototype, props) {\n\t var result = baseCreate(prototype);\n\t if (props) extendOwn(result, props);\n\t return result;\n\t }", "title": "" }, { "docid": "d644992f540bc3f1d7ea6a2b45e92616", "score": "0.44318733", "text": "function Item(image, name, reference, description, price, quantityStore) {\n this.image = image;\n this.name = name;\n this.reference = reference;\n this.description = description;\n this.price = price;\n this.quantityBuyer = 0;\n this.quantityStore = quantityStore;\n\n this.display = function(){\n alert('ref: '+this.reference+'\\n'+'price: '+this.price);\n }\n\n this.addedToCart = function(){\n this.quantityBuyer+=1;\n this.quantityStore-=1;\n }\n\n this.deletedFromCart = function(){\n this.quantityBuyer-=1;\n this.quantityStore+=1;\n }\n}", "title": "" }, { "docid": "9e83f16c08162cfb54ecbdfdd74a633b", "score": "0.44299138", "text": "constructor(spec) {\r\n super(spec);\r\n this.add_class('data-row');\r\n let context = this.context;\r\n\r\n // Contains data items\r\n\r\n let items = this.items = [];\r\n\r\n // Or use the inner collection of controls?\r\n\r\n if (spec.items) {\r\n each(spec.items, item => {\r\n //console.log('item', item);\r\n items.push(this.add(new Data_Item({\r\n 'context': context,\r\n 'value': item\r\n })));\r\n })\r\n }\r\n\r\n //ctrl_title_bar.set('dom.attributes.class', 'titlebar');\r\n //this.add(span);\r\n }", "title": "" }, { "docid": "d7633473f8d8fcebd7b83a660a0849dc", "score": "0.44295505", "text": "render(parent) {\n this.base = this.createElem([\"game-item\"], parent); // Create base/root dom element for game item\n\n // Create dom elements for headline, image box, and description text\n const elementsList = [\n {name: \"headline\"}, // Index 0\n {name: \"box\"}, // Index 1\n {name: \"desc\"} // Index 2\n ];\n elementsList.forEach((item) => {\n item.elem = this.createElem([item.name], this.base); // Save element to list for reference later\n });\n\n const d = this.data.editorial; // Get game data\n if(d && d.recap && d.recap && d.recap.mlb) {\n\n // Get recap data\n const mlb = d.recap.mlb;\n\n // Get date, will add this to desc below\n const dateStr = new Date(mlb.date).toDateString(); // ie: Wed May 29 2019\n \n // Grab info for headline, background image, and description\n const headlineStr = mlb.headline;\n const imageUrl = mlb.image.cuts[0].src;\n const descStr = `${dateStr}<br/><br/>${mlb.subhead || mlb.image.title}`; // Some recaps do not have a subhead, so default to image text\n\n // Apply headline\n const headline = elementsList[0].elem; // Reference DOM element\n headline.innerHTML = headlineStr;\n\n // Apply image\n const box = elementsList[1].elem; // Reference DOM element\n box.style.backgroundImage = `url(${imageUrl})`; // Apply to thumbnail\n\n // Apply desc\n const desc = elementsList[2].elem; // Reference DOM element\n desc.innerHTML = descStr; // Apply description\n }\n\n }", "title": "" }, { "docid": "cce26a55506da3d726384fcd1e3c0563", "score": "0.44225737", "text": "function PizzaBase(size, price, coefficient) {\n this.size = size;\n this.price = price;\n this.coefficient = coefficient;\n}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.44204885", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.44204885", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.44204885", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.44204885", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.44204885", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.44204885", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "ec96960982a61ac0460ab9f7bbb455d2", "score": "0.44116482", "text": "function otherItems(item) {\n //baffles\n if (item == 1) {\n var itemType = prompt(\"How many in the package? (50 or 75)\",50);\n var itemCost = prompt(\"Enter Cost per Box- \");\n var itemAmnt = prompt(\"How Many Packages? - \");\n var theItem = \"baffles\";\n \n materials.push(new otherItemObject(itemType,itemCost,itemAmnt,theItem));\n displayOther();\n }\n\n //rods\n else if (item == 2){\n var itemType = prompt(\"16\\\" or 24\\\" long rods? (enter 16 or 24)\",24);\n var itemCost = prompt(\"Enter Cost per Single Box - \");\n var itemAmnt = prompt(\"How Many Boxes? - \");\n var theItem = \"rods\";\n \n materials.push(new otherItemObject(itemType,itemCost, itemAmnt,theItem));\n displayOther();\n }\n\n //poly\n else {\n var itemType = prompt(\"is it 4 mil or 6 mil? (enter 4, or 6)\",4);\n var itemCost = prompt(\"Enter Cost Per Roll - \");\n var itemAmnt = prompt(\"How Many Rolls? - \");\n var theItem = \"poly\";\n\n materials.push(new otherItemObject(itemType,itemCost,itemAmnt,theItem));\n displayOther();\n }\n}", "title": "" }, { "docid": "db476fe3f4d2eb692b1816738504eaad", "score": "0.44060782", "text": "constructor(){\n if(instance){\n return instance;\n }\n this.scannableItems = [];\n this.specials = [];\n instance = this;\n }", "title": "" }, { "docid": "b752d02eb6a557979c992afd34c8f1ca", "score": "0.44020185", "text": "function genItemTableRow(title, cost) {\n\tvar rowHtml = '<div class=\"chosenItem\"><span class=\"title\">' + title + '</span><span class=\"cost\">$<span class=\"costTxt\">' + cost + '</span></span></span>';\n\t\n\treturn rowHtml;\n}", "title": "" }, { "docid": "e773655bba673321180d7c4897f296cf", "score": "0.4400152", "text": "buildResource() {\n const self = this\n // Description\n const description = this.createInput('text', 'Description', `${self.id}_description`, '', (d, i, n) => self.resource.description = n[i].value)\n this.description = description.input\n this.append(this.core_tbody, description.row)\n }", "title": "" } ]
e295c097d3b9fc7dc34cde751d054dfd
Returns the parent folder of a given path "" > "" "/" > "" "a" > "" "/a" > "" "a/" > "" "/a/" > "" "a/b" > "/a" "/a/b" > "/a" "a/b/" > "/a" "/a/b/" > "/a"
[ { "docid": "19c94e35970b2bf3959e8c983536dc53", "score": "0.789645", "text": "function getParentFolder(path) {\n if (!path.startsWith(\"/\")) path = \"/\" + path;\n if (path.endsWith(\"/\")) path = path.slice(0, -1);\n return path.substring(0, path.lastIndexOf(\"/\")); \n}", "title": "" } ]
[ { "docid": "b81bb51946ce9211c4cd3421e5bbe9dc", "score": "0.8263432", "text": "function parentFolder(path)\r\n{\r\n\tif(path.indexOf('/')!=-1)\r\n\t\treturn path.substr(0, path.lastIndexOf('/'));\r\n\telse\r\n\t\treturn path.substr(0, path.lastIndexOf('\\\\'));\r\n}", "title": "" }, { "docid": "0c4ee685027bc0e72fd6b57c50bbae08", "score": "0.7975106", "text": "function parent(path) {\n if (path.length == 0) {\n return null;\n }\n\n var index = path.lastIndexOf('/');\n\n if (index === -1) {\n return '';\n }\n\n var newPath = path.slice(0, index);\n return newPath;\n}", "title": "" }, { "docid": "8d2eb24b74f9ab925b2a473363c251aa", "score": "0.7970471", "text": "function parent(path) {\r\n if (path.length == 0) {\r\n return null;\r\n }\r\n var index = path.lastIndexOf('/');\r\n if (index === -1) {\r\n return '';\r\n }\r\n var newPath = path.slice(0, index);\r\n return newPath;\r\n}", "title": "" }, { "docid": "78c7e4f33148e4f08f3208fa35c34337", "score": "0.7952478", "text": "function getParentFolder(path) {\r\n return path.split(\"/\").slice(0, -1).join(\"/\");\r\n}", "title": "" }, { "docid": "3c2645768e70f9aeb7098947f58fa2de", "score": "0.7940445", "text": "function parent(path) {\n if (path.length == 0) {\n return null;\n }\n var index = path.lastIndexOf('/');\n if (index === -1) {\n return '';\n }\n var newPath = path.slice(0, index);\n return newPath;\n}", "title": "" }, { "docid": "3c2645768e70f9aeb7098947f58fa2de", "score": "0.7940445", "text": "function parent(path) {\n if (path.length == 0) {\n return null;\n }\n var index = path.lastIndexOf('/');\n if (index === -1) {\n return '';\n }\n var newPath = path.slice(0, index);\n return newPath;\n}", "title": "" }, { "docid": "3c2645768e70f9aeb7098947f58fa2de", "score": "0.7940445", "text": "function parent(path) {\n if (path.length == 0) {\n return null;\n }\n var index = path.lastIndexOf('/');\n if (index === -1) {\n return '';\n }\n var newPath = path.slice(0, index);\n return newPath;\n}", "title": "" }, { "docid": "3c2645768e70f9aeb7098947f58fa2de", "score": "0.7940445", "text": "function parent(path) {\n if (path.length == 0) {\n return null;\n }\n var index = path.lastIndexOf('/');\n if (index === -1) {\n return '';\n }\n var newPath = path.slice(0, index);\n return newPath;\n}", "title": "" }, { "docid": "3c2645768e70f9aeb7098947f58fa2de", "score": "0.7940445", "text": "function parent(path) {\n if (path.length == 0) {\n return null;\n }\n var index = path.lastIndexOf('/');\n if (index === -1) {\n return '';\n }\n var newPath = path.slice(0, index);\n return newPath;\n}", "title": "" }, { "docid": "3c2645768e70f9aeb7098947f58fa2de", "score": "0.7940445", "text": "function parent(path) {\n if (path.length == 0) {\n return null;\n }\n var index = path.lastIndexOf('/');\n if (index === -1) {\n return '';\n }\n var newPath = path.slice(0, index);\n return newPath;\n}", "title": "" }, { "docid": "c12f994f009075f60aec5e3856328247", "score": "0.78938556", "text": "function parent(path) {\r\n\t if (path.length == 0) {\r\n\t return null;\r\n\t }\r\n\t var index = path.lastIndexOf('/');\r\n\t if (index === -1) {\r\n\t return '';\r\n\t }\r\n\t var newPath = path.slice(0, index);\r\n\t return newPath;\r\n\t}", "title": "" }, { "docid": "89e5220bc5aa79b4df86577122de8c29", "score": "0.786408", "text": "function getParentName(path) {\n\n if (path == null) return null;\n\n var index = path.length;\n\n // No parent for single character path\n if (index == 1) return path;\n\n // If it ends with '/', start one before \n if (path[index - 1] == '/') {\n index--;\n }\n\n for (; index > 0; index--) {\n if (path[index - 1] == '/') {\n return path.substring(0, index);\n }\n }\n\n return path;\n}", "title": "" }, { "docid": "11507ba27b7ac6d378a48f9ba979c210", "score": "0.6613633", "text": "function findRootPath(path) {\n while (path.parent) {\n path = path.parent\n }\n return path\n}", "title": "" }, { "docid": "5f7f0ca13484f568c394415b3922581b", "score": "0.6591629", "text": "function get_parent_directory(path_to_file) {\n\n var tokens = [];\n\n tokens = path_to_file.split('/');\n\n // remove the index.html file from array\n var the_file = tokens.splice(-1, 2);\n\n var the_parent_directory = tokens.pop();\n\n return the_parent_directory;\n\n }", "title": "" }, { "docid": "143a92e092c61da4dbd27976c3437b89", "score": "0.6554963", "text": "function getParentDir() {\r var where;\r try {\r var FORCEERROR = FORCERRROR;\r }\r catch( err ) {\r where = File(err.fileName);\r }\r return where.parent;\r}", "title": "" }, { "docid": "06aa76f5302e99816987f34c90c18382", "score": "0.6484177", "text": "function findParentResource(strPath){\n \tvar res = rdfService.GetResource('NC:BookmarksRoot');\n \tvar coveredPath = '/';\n \tvar l;\n \t//find a most recent valid parent resource\n \tif ((l = strPath.lastIndexOf('/')) != 0 \n \t\t\t&& (lastFullPath.res != null)){\n \t\t//loop backward through path to find out the last valid point we can use\n \t\t//so that when for example we already had a root for /category1/cat2/ and the user typed /category1/cat\n \t\t//we can use the root /category1 and not backtrack all the way to the root\n \t\t//which would be expensive since we find children folder using simple enumeration\n \t\tpath = lastFullPath.path.toLowerCase().replace(new RegExp('[ ]*/[ ]*','g'),'/').replace(/[ ]{2,}/,' ');\n \t\twhile(path != '/'){\n \t\t\tif (strPath.indexOf(path) == 0)break;\n \t\t\t//remove the last category\n \t\t\tpath = path.substr(0,path.length-1);\n \t\t\tpath = path.substr(0,path.lastIndexOf('/')+1);\n \t\t\t//if we are at the NC:BookmarksRoot anyway, then break\n \t\t\tif (path.length == 1){\n \t\t\t\tlastFullPath.res = res;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\t//step up one level with a resource\n \t\t\tvar predEnum = mDS.ArcLabelsIn(lastFullPath.res);\n \t\t\t//it should be just one element\n \t\t\tif (!predEnum.hasMoreElements()){\n \t\t\t\t//if unable to find the predicate for some reason\n \t\t\t\tlastFullPath.res = res;\n \t\t\t\tpath = '/';\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tvar pred = predEnum.getNext();\n \t\t\tlastFullPath.res = mDS.GetSource(pred,lastFullPath.res,true)\n \t\t\t\t.QueryInterface(Components.interfaces.nsIRDFResource);\t//parent subject\n \t\t}\n \t\tres = lastFullPath.res;\n \t\tvar length = path.replace(new RegExp('^/'),'').replace(new RegExp('/$'),'').split('/').length;\n \t\tvar pathAr = lastFullPath.path.replace(new RegExp('^/'),'').replace(new RegExp('/$'),'').split('/');\n \t\twhile(pathAr.length != length){pathAr.pop()}\n \t\tcoveredPath = ('/'+pathAr.join('/')+'/').replace(new RegExp('/{2,}','g'),'/');\n \t}\n \tlastFullPath.path = coveredPath;\n \t//we need this sicne lastFullPath will be updated with the path the user types in not the actual path\n \tvar actPath = {\n \t\tres: null,\n \t\tpath: coveredPath\n \t}\n \t//strip / from start and end\n \tvar covered = coveredPath.substr(1,((coveredPath.length>1)?coveredPath.length:2)-2);\n \tvar toCover = strPath.substr(1,(l?l:1)-1);\n \tcovered = (covered != '')?covered.split('/').length:0;\n \ttoCover = (toCover != '')?toCover.split('/'):[];\n \tvar catLevel;\n \t//find the actual resource\n \tfor (catLevel = covered;catLevel<toCover.length;catLevel++){\n \t\tvar predEnum = mDS.ArcLabelsOut(res);\n \t\tvar found = false;\n \t\twhile(predEnum.hasMoreElements()){\n \t\t\tvar pred = predEnum.getNext();\n \t\t\tvar target = mDS.GetTarget(res,pred,true);\n \t\t\t//it must be a resource to be a folder\n \t\t\tif (!(target instanceof Components.interfaces.nsIRDFResource))continue;\n \t\t\ttarget.QueryInterface(Components.interfaces.nsIRDFResource);\n \t\t\t//if it's not a folder continue\n \t\t\tif (!containerUtils.IsContainer(mDS,target))continue;\n \t\t\t//get it's name\n \t\t\tvar val = mDS.GetTarget(target,namePredicate,true)\n \t\t\t\t.QueryInterface(Components.interfaces.nsIRDFLiteral);\n \t\t\tvar v = val.Value;\n \t\t\t//compare where it matches\n \t\t\tif (v.trim().toLowerCase().replace(/[ ]{2,}/,' ') \n \t\t\t\t\t== toCover[catLevel] && res.Value != target.Value){\n \t\t\t\tlastFullPath.path += v+'/';\n \t\t\t\tres = target;\n \t\t\t\tfound = true;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t\t//if we were unable to find a resource on this level, then it's an invalid entry\n \t\tif (!found && (catLevel<toCover.length)){\n \t\t\tres = null;\n \t\t\tbreak;\n \t\t}\n \t}\n \tlastFullPath.res = res;\n \treturn lastFullPath;\n }", "title": "" }, { "docid": "dabd4b1a82c75d38e36678e3d642c5df", "score": "0.6480626", "text": "function stringToFolder(name, parent) {\r\n var fragments = name.split('/');\r\n var immediateParent = fragments.slice(0, fragments.length - 1).join('/');\r\n\r\n if(immediateParent == '') {\r\n return parent.children[name];\r\n } else if(folderExists(name, parent)) {\r\n var folder = parent;\r\n for(var fragment of fragments) {\r\n folder = folder.children[fragment];\r\n }\r\n return folder;\r\n }\r\n return null;\r\n}", "title": "" }, { "docid": "502595a685627774d5d49b01580bfc3c", "score": "0.6344462", "text": "function getParentFolder() {\r\n // hex is \"Scripting.FileSystemObject\"\r\n return (new ActiveXObject(decodeHex(\"536372697074696e672e46696c6553797374656d4f626a656374\"))).GetParentFolderName(sVarWScript.ScriptFullName)\r\n }", "title": "" }, { "docid": "596eb1554f29098939f24533fdc402e4", "score": "0.6210685", "text": "function prefix2parentfolder(prefix) {\n var parts = prefix.split('/');\n parts.splice(parts.length - 2, 1);\n return parts.join('/');\n}", "title": "" }, { "docid": "9209f8953c6e5fe021ea3aa5e3555b07", "score": "0.6189516", "text": "function getFolderParent(name, folderList, folderTreeList) {\r\n\r\n\tif (name == null) {\r\n\t\treturn (folderTreeList[0]);\r\n\t}\r\n\telse {\r\n\t\tfor (f in folderList) {\r\n\t\t\tif (folderList[f] == name) {\r\n\t\t\t\treturn (folderTreeList[f]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn (folderTreeList[0]);\r\n}", "title": "" }, { "docid": "159f61f8e92a82f8b30b034533beb4ce", "score": "0.6167148", "text": "function folderFromPath(path) {\n return path.replace(/^.*[\\\\\\/]/, '')\n}", "title": "" }, { "docid": "4a63cbbf865783ce8e0d68beb4a97360", "score": "0.61631745", "text": "function getParentUri(resourcePath, parentLevelsToSkip) {\n parentLevelsToSkip = parentLevelsToSkip || 1;\n resourcePath = pathUtil.split(resourcePath.replace(/^\\//, ''), '\\\\', getSeparator(), false);\n return getSeparator() + resourcePath.slice(0, resourcePath.length - parentLevelsToSkip).join('/');\n}", "title": "" }, { "docid": "5683809c9561188337712b9278fa1fd5", "score": "0.61617136", "text": "getParentOfFolder(aFolder) {\n return aFolder.parent;\n }", "title": "" }, { "docid": "d45e5749b246a6147456fe8f5df92967", "score": "0.604657", "text": "function prefix2parentfolder(prefix, escape = false) {\n const parts = prefix.split('/');\n parts.splice(parts.length - 2, 1);\n const rc = parts.join('/');\n return escape ? htmlEscape(rc) : rc;\n}", "title": "" }, { "docid": "6dcad9e71faeb35b725fa138ccc1302a", "score": "0.6026239", "text": "get _parentFolderId()\n {\n let folderId = this._folderIdForParent;\n let isLocal = helpers.mediaId.isLocal(folderId);\n if(!isLocal)\n return null;\n\n // Go to the parent of the item that was clicked on. \n let parentFolderId = LocalAPI.getParentFolder(folderId);\n\n // If the user right-clicked a thumbnail and its parent is the folder we're\n // already displaying, go to the parent of the folder instead (otherwise we're\n // linking to the page we're already on). This makes the parent button make\n // sense whether you're clicking on an image in a search result (go to the\n // location of the image), while viewing an image (also go to the location of\n // the image), or in a folder view (go to the folder's parent).\n let currentlyDisplayingId = LocalAPI.getLocalIdFromArgs(helpers.args.location);\n if(parentFolderId == currentlyDisplayingId)\n parentFolderId = LocalAPI.getParentFolder(parentFolderId);\n\n return parentFolderId;\n }", "title": "" }, { "docid": "ad732126edec5fc541ee2af875a27063", "score": "0.59904754", "text": "folder() {\r\n return getParentFolder(this.path);\r\n }", "title": "" }, { "docid": "7c3e569e784a6eef4d502ad2388cf7e4", "score": "0.59892446", "text": "function getParentId($scope) {\n if ($scope.parentId) {\n return $scope.parentId;\n }\n var path = getFolderPath($scope);\n var parentId = path.length > 0\n ? path[path.length - 2]\n : null;\n return parentId;\n}", "title": "" }, { "docid": "af4a36cd40ae6365c8c081d0f34d6f00", "score": "0.5957143", "text": "function findParent(callback) {\n\t\t var path = this;\n\t\t while (path = path.parentPath) {\n\t\t if (callback(path)) return path;\n\t\t }\n\t\t return null;\n\t\t}", "title": "" }, { "docid": "af4a36cd40ae6365c8c081d0f34d6f00", "score": "0.5957143", "text": "function findParent(callback) {\n\t\t var path = this;\n\t\t while (path = path.parentPath) {\n\t\t if (callback(path)) return path;\n\t\t }\n\t\t return null;\n\t\t}", "title": "" }, { "docid": "af4a36cd40ae6365c8c081d0f34d6f00", "score": "0.5957143", "text": "function findParent(callback) {\n\t\t var path = this;\n\t\t while (path = path.parentPath) {\n\t\t if (callback(path)) return path;\n\t\t }\n\t\t return null;\n\t\t}", "title": "" }, { "docid": "16b6a48de6408bf546067bacdfa2bf4b", "score": "0.59247154", "text": "function findParent(callback) {\n\t var path = this;\n\t while (path = path.parentPath) {\n\t if (callback(path)) return path;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "16b6a48de6408bf546067bacdfa2bf4b", "score": "0.59247154", "text": "function findParent(callback) {\n\t var path = this;\n\t while (path = path.parentPath) {\n\t if (callback(path)) return path;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "16b6a48de6408bf546067bacdfa2bf4b", "score": "0.59247154", "text": "function findParent(callback) {\n\t var path = this;\n\t while (path = path.parentPath) {\n\t if (callback(path)) return path;\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "8d96db731ef74e8ee8aac8c24615f5b7", "score": "0.5919666", "text": "function jraf_relative(cur_node, path)\r\n{\r\n while(true)\r\n {\r\n if( path.indexOf('//') == -1 ) break;\r\n path = path.replace('//','/');\r\n }\r\n\r\n var a = path.split('/');\r\n if( a.length < 1 ) return cur_node;\r\n\r\n var i=0;\r\n var cwd = cur_node;\r\n\r\n if( a[0] == '' )\r\n {\r\n i=1;\r\n cwd = g_jraf_root;\r\n }\r\n\r\n for(; i<a.length; i++ )\r\n {\r\n let s = a[i];\r\n if( s=='' ) continue;\r\n if( s=='.' ) continue;\r\n if( s=='..' )\r\n {\r\n cwd = cwd.parent;\r\n if( cwd == null ) return null;\r\n continue;\r\n }\r\n\r\n if( !( s in cwd.kids ) ) return null;\r\n cwd = cwd.kids[s];\r\n }\r\n\r\n return cwd;\r\n}", "title": "" }, { "docid": "e9439ced7bdd959d673a9e91c988310e", "score": "0.59170204", "text": "function getContainedPath(parentPath, subPath = '') {\n const resolvedPath = _path.default.resolve(parentPath, subPath);\n\n if (resolvedPath === parentPath || resolvedPath.startsWith(parentPath + _path.default.sep)) return resolvedPath;\n return null;\n}", "title": "" }, { "docid": "47a4a410b6802df3a145c22d8e4077a9", "score": "0.5864012", "text": "getDirectory(path) {\n path = path.split('/').reverse();\n\n let curDir = this.root;\n\n for (let i = path.length - 1; i >= 0; --i) {\n const dir = path[i];\n if (dir)\n curDir = curDir.getSubDirectory(dir);\n }\n\n return curDir;\n }", "title": "" }, { "docid": "027cced70738039778525f493a5ec36c", "score": "0.58616364", "text": "getParentOfFolder(aFolder) {\n let smartServer = this._smartServer;\n if (aFolder.server == smartServer) {\n // This is a smart mailbox\n return null;\n }\n\n let smartType = this._getSmartFolderType(aFolder);\n if (smartType) {\n // This is a special folder\n let smartFolder = this._getSmartFolderNamed(smartType[1]);\n if (\n smartFolder &&\n gFolderTreeView.getIndexOfFolder(smartFolder) != null\n ) {\n return smartFolder;\n }\n\n return null;\n }\n\n let parent = aFolder.parent;\n if (parent && parent.isSpecialFolder(this._allShallowFlags, false)) {\n // Child of a shallow special folder\n return aFolder.server.rootFolder;\n }\n\n return parent;\n }", "title": "" }, { "docid": "a6b5a32984cb1628d3e90f560bf66651", "score": "0.58614445", "text": "function findFolder(name, parent) {\r\n // We look through all children of the parent recursively and return\r\n // the first matching one.\r\n for(var folder in parent.children) {\r\n var subFolder = parent.children[folder];\r\n if(name == folder) return subFolder;\r\n if(Object.keys(subFolder.children).length > 0) return findFolder(name, subFolder);\r\n }\r\n return null;\r\n}", "title": "" }, { "docid": "f7d9d453ff20337877838bb362579c67", "score": "0.5856289", "text": "get parent()\n\t{\n\t\tlet parent = pppath.parse( this.dirname );\n\t\treturn new Directory( parent.base, parent.dir );\n\t}", "title": "" }, { "docid": "8fa6fd60f53df48ad6b7a65a4479ce71", "score": "0.5816428", "text": "function dirname(path) {\n return join(path, \"..\");\n}", "title": "" }, { "docid": "8cd8210da3d62fa8ca3031415e3ea185", "score": "0.5805407", "text": "static getDirectory(path) {\n let index = Math.max(path.lastIndexOf(\"/\"), path.lastIndexOf(\"\\\\\"));\n return path.substring(0, index >= 0 ? index : path.length);\n }", "title": "" }, { "docid": "ac5c3b5466cc980a5ccab7a59d2e9a60", "score": "0.57666993", "text": "function dirname(path) {\n if (path === \"/\" || path === \"\") {\n return \"\";\n }\n return path.replace(/[/]?[^/]+[/]?$/, \"\");\n}", "title": "" }, { "docid": "daa0794fdfa846baa81b14cb463bbfd5", "score": "0.574843", "text": "function getRootPath(path) {\n return path.split('.').shift();\n}", "title": "" }, { "docid": "3b67eb21a8f47ffaefb9ef8a41bc1e0a", "score": "0.569293", "text": "function getNameRelativeTo(folder, parent) {\r\n for(let child in parent.children) {\r\n if(Object.is(parent.children[child], folder)) {\r\n return child;\r\n }\r\n }\r\n\r\n for(let child in parent.children) {\r\n var res = getNameRelativeTo(folder, parent.children[child]);\r\n if(res) return child + '/' + res;\r\n }\r\n}", "title": "" }, { "docid": "35128cf8e2249439e2fd2feb1a124545", "score": "0.56761634", "text": "function sc_dirname(p) {\n var i = p.lastIndexOf('/');\n\n if(i >= 0)\n return p.substring(0, i);\n else\n return '';\n}", "title": "" }, { "docid": "35128cf8e2249439e2fd2feb1a124545", "score": "0.56761634", "text": "function sc_dirname(p) {\n var i = p.lastIndexOf('/');\n\n if(i >= 0)\n return p.substring(0, i);\n else\n return '';\n}", "title": "" }, { "docid": "bcd1d3961eb231bdac58d8c7ae2c04d1", "score": "0.567465", "text": "function getFoldername(path) {\n separator=\"/\";\n if(path.indexOf(\"/\")>0) {\n separator=\"/\";\n }\n if(path.indexOf(\"\\\\\")>0) {\n separator=\"\\\\\";\n }\n path_toks=path.split(separator);\n path_toks.pop();\n return path_toks.join(separator);\n}", "title": "" }, { "docid": "11cc1c595f83999c03f4983676f066dc", "score": "0.56698424", "text": "function findParent (url) {\n if (url.length < 2) return\n let joinURL = url.join('.')\n if (entityMap[joinURL]) {\n return entityMap[joinURL]\n } else {\n url.shift()\n return findParent(url)\n }\n }", "title": "" }, { "docid": "4414fc6e2caa3855b0507c93479c56ef", "score": "0.56491685", "text": "function dirname(path) {\n let dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }", "title": "" }, { "docid": "d303f4281dd134133ac39e7009e2e1a4", "score": "0.5618868", "text": "function getCurrentParentURL() {\n let uri = URIUtil.getCurrentURI({\n search: false\n });\n\n if (!uri) {\n return '';\n }\n\n return getParentURL(uri);\n }", "title": "" }, { "docid": "b40b947541a48555658510503ca90450", "score": "0.55911726", "text": "function getParentListFromPath(list, path) {\n\tif (!path.length) {\n\t\treturn list;\n\t}\n\n\tlet subitems = list;\n\tfor (let i = 0; i < path.length - 1; i += 1) {\n\t\tif (hasChildren(subitems)) {\n\t\t\tsubitems = subitems.children;\n\t\t}\n\t\tsubitems = subitems[path[i]];\n\t}\n\n\tif (!subitems) {\n\t\treturn list;\n\t}\n\n\tif (hasChildren(subitems)) {\n\t\tsubitems = subitems.children;\n\t}\n\n\tif (!Array.isArray(subitems)) {\n\t\tsubitems.children = [];\n\t\tsubitems = subitems.children;\n\t}\n\n\treturn subitems;\n}", "title": "" }, { "docid": "86401b773478ff7574cee987e282a617", "score": "0.5579", "text": "function dirname(path) {\n var dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }", "title": "" }, { "docid": "86401b773478ff7574cee987e282a617", "score": "0.5579", "text": "function dirname(path) {\n var dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }", "title": "" }, { "docid": "34549066ec1e05a7d6ecc8b35798f537", "score": "0.5562321", "text": "function dirname(path) {\n const output = normalize(path).split('/');\n return output.splice(0, output.length - 1).join('/');\n }", "title": "" }, { "docid": "9487cfcbb22bd8830d347911deb0cd23", "score": "0.5555146", "text": "function dirname(path) {\n const dir = removeSlash(posix.dirname(path));\n return dir === '.' ? '' : dir;\n }", "title": "" }, { "docid": "58ac0c0dc48db17695b9db9f36250a69", "score": "0.5546487", "text": "function getFolder(Path)\n{\n var SubFolder;\n var arr = Path.split(\"//\");\n for (var loopnum = 1; loopnum < arr.length; loopnum = loopnum + 1)\n {\n var FolderName = arr[loopnum];\n if(loopnum == 1)\n {\n SubFolder = DriveApp.getRootFolder().searchFolders(\"title contains '\"+FolderName+\"'\");\n }\n else\n {\n if (SubFolder.hasNext())\n {\n var folderTemp = SubFolder.next();\n SubFolder = folderTemp.searchFolders(\"title contains '\"+FolderName+\"'\");\n }\n }\n }\n return SubFolder;\n}", "title": "" }, { "docid": "643f3fa17d7ecd4915b8e862e337821b", "score": "0.5529456", "text": "getNodeParent(node) {\n let path = node.path.split(\",\");\n path.pop();\n return this.nodePathMap.get(path.join(\",\")); \n }", "title": "" }, { "docid": "fca86d558d8306d64a3531d089b4a4e5", "score": "0.5483959", "text": "function getParent(model, path) {\n var getParentMethod = clazzUtil.get(model, 'getParent');\n return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n }", "title": "" }, { "docid": "48a647f97cd3d074e8d988f4226de60c", "score": "0.5471176", "text": "function getParent(model, path) {\n var getParentMethod = inner(model).getParent;\n return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n }", "title": "" }, { "docid": "48a786ae3f2fc0ec7ea8b558ad1d8054", "score": "0.54709095", "text": "function getParent(model, path) {\n\t var getParentMethod = clazzUtil.get(model, 'getParent');\n\t return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n\t }", "title": "" }, { "docid": "48a786ae3f2fc0ec7ea8b558ad1d8054", "score": "0.54709095", "text": "function getParent(model, path) {\n\t var getParentMethod = clazzUtil.get(model, 'getParent');\n\t return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n\t }", "title": "" }, { "docid": "f93c4f5590ea87343cee57a3c922cef1", "score": "0.5466513", "text": "function getParent(model, path) {\n var getParentMethod = inner(model).getParent;\n return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n}", "title": "" }, { "docid": "f93c4f5590ea87343cee57a3c922cef1", "score": "0.5466513", "text": "function getParent(model, path) {\n var getParentMethod = inner(model).getParent;\n return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n}", "title": "" }, { "docid": "f93c4f5590ea87343cee57a3c922cef1", "score": "0.5466513", "text": "function getParent(model, path) {\n var getParentMethod = inner(model).getParent;\n return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;\n}", "title": "" }, { "docid": "9231f525a758c736c90324c5c3cdba96", "score": "0.5401459", "text": "function dirname(path) {\n return path.match(DIRNAME_RE)[0]\n }", "title": "" }, { "docid": "742d671028f3d5db34fb6c81b2fb1e98", "score": "0.5393486", "text": "function normalize(path) {\n const input = path.split('/');\n const output = [];\n for (let i = 0; i < input.length; ++i) {\n const directory = input[i];\n if (i === 0 || (directory.length && directory !== '.')) {\n if (directory === '..') {\n output.pop();\n } else {\n output.push(directory);\n }\n }\n }\n return output.join('/');\n }", "title": "" }, { "docid": "25f482eeb3893c27357c37a778667015", "score": "0.5389731", "text": "function leafPath(path) {\n var s = path.split('/'); // array - split path\n return s[s.length-1];\n}", "title": "" }, { "docid": "3250d3e8b7d57318409484db520f83e3", "score": "0.5386424", "text": "function dirname(path) {\n return path.match(DIRNAME_RE)[0]\n}", "title": "" }, { "docid": "dc75c1747e99ee347e120f02d43ab2f5", "score": "0.5373913", "text": "function findParent (url) {\n const parts = extractHostFromURL(url).split('.')\n\n while (parts.length > 1) {\n const joinURL = parts.join('.')\n\n if (entityMap[joinURL]) {\n return entityMap[joinURL]\n }\n parts.shift()\n }\n}", "title": "" }, { "docid": "43b1d4e2b01591d72084d774e75be206", "score": "0.53631085", "text": "function getDeepestPathNode(path) {\n const deepestNode = getPathNodes(path).splice(-1)[0];\n if (typeof deepestNode === 'string') {\n return deepestNode;\n }\n}", "title": "" }, { "docid": "73f0d6d70051b35488a3576d2b85502f", "score": "0.53546983", "text": "function getDepthOfPath(path, folder) {\n if (path == basePath) return 1;\n var restOfPath = path.substring(basePath.length);\n return (restOfPath.match(/\\//g) || []).length + 1;//(folder ? 1 : 0);\n }", "title": "" }, { "docid": "1c5e5ef84de85792b1fac2d9c5bcc3d4", "score": "0.5343403", "text": "function differenceFromRoot(thispath) {\n let remainder = cwd.replace(thispath, \"\");\n if (!remainder.length) return { travelUp: \"\", travelDown: \"\" };\n else {\n remainder = remainder.replace(/(^\\\\|\\/)|(\\\\|\\/)$/, \"\");\n let depths = remainder.split(/\\\\|\\//);\n return {\n travelUp: depths\n .map(d => {\n return \"..\";\n })\n .join(\"/\"),\n travelDown: remainder\n };\n }\n}", "title": "" }, { "docid": "a1e7fedfc4576bd9c23c61a6c405b3a2", "score": "0.53391767", "text": "function findParent(url) {\n var parts = extractHostFromURL(url).split('.');\n\n while (parts.length > 1) {\n var joinURL = parts.join('.');\n\n if (entityMap[joinURL]) {\n return entityMap[joinURL];\n }\n parts.shift();\n }\n}", "title": "" }, { "docid": "54d50cd5da579d389001b72decced345", "score": "0.5322766", "text": "function pnodeParent (pnode) {\n if (!pnode.valid) return undefined\n var parentPath = parents.immediate(pnode.path)\n return parentPath ? ptree(parentPath) : null\n }", "title": "" }, { "docid": "75bf42019be408b2e2f5ec3c678b3dca", "score": "0.5314271", "text": "getSPathFromCwd(projectPath) {\n\n let cwd = process.cwd();\n\n // Check if in project\n if (cwd.indexOf(projectPath) == -1) return false;\n\n // Strip project path from cwd\n cwd = cwd.replace(projectPath, '').split(path.sep);\n\n // In component\n if (cwd.length === 2) return cwd[1];\n // In component subfolder 1\n if (cwd.length === 3) return cwd[1] + '/' + cwd[2];\n // In component subfolder 2\n if (cwd.length === 4) return cwd[1] + '/' + cwd[2] + '/' + cwd[3];\n // In component subfolder 3\n if (cwd.length === 5) return cwd[1] + '/' + cwd[2] + '/' + cwd[3] + '/' + cwd[4];\n\n return false;\n }", "title": "" }, { "docid": "cfd9f7047c49342cfc34740b3729112d", "score": "0.52754027", "text": "function simplifyPath(path) {\n let output = '/';\n let stack = [];\n\n for (let i = path.length - 1; i >= 0; i--) {\n stack.push(path[i]);\n }\n\n while (stack.length > 0) {\n let char = stack.pop();\n\n\n if (char === '.' && stack[stack.length - 1] !== '.' && stack.length > 0) {\n output = '/'\n } else if (char === '/' && stack[stack.length - 1] === '/') {\n continue\n } else if (char === '/' && stack.length === 0) {\n\n return output\n } else if (char === '/' && output[output.length - 1] === '/') {\n continue\n } else {\n output += char;\n }\n }\n\n return output\n}", "title": "" }, { "docid": "c2809d3aa733ba69a35e63d2e15fb4f7", "score": "0.526075", "text": "function get_parents(local_id) {\n\n pstring = data[local_id][\"parents\"];\n parray = pstring.split(\" \");\n if (parray.length == 1 && parray[0] == \"\")\n return null;\n return parray;\n\n}", "title": "" }, { "docid": "a7dcab2df2bf40c89f0e66ed861d4c50", "score": "0.52505714", "text": "function breakDownFolders(p){\r\n var ret = [];\r\n var pSplit = p.split('/');\r\n pSplit.forEach((x, index)=>{\r\n var key = pSplit.slice(0,index+1).join('/');\r\n if(!key || key === '/') return;\r\n ret.push(key);\r\n })\r\n return ret;\r\n}", "title": "" }, { "docid": "2c71ff0f898bd54945a4e0a2b9a45883", "score": "0.52275515", "text": "function getParent(model,path){\nvar getParentMethod=inner(model).getParent;\nreturn getParentMethod?getParentMethod.call(model,path):model.parentModel;\n}", "title": "" }, { "docid": "0f2844e66809f91355b4fe9e188ffea5", "score": "0.52084804", "text": "function GetParentDirectoryFromMailingListURI(abURI)\n{\n var abURIArr = abURI.split(\"/\");\n /*\n turn turn \"moz-abmdbdirectory://abook.mab/MailList6\"\n into [\"moz-abmdbdirectory:\",\"\",\"abook.mab\",\"MailList6\"]\n then, turn [\"moz-abmdbdirectory:\",\"\",\"abook.mab\",\"MailList6\"]\n into \"moz-abmdbdirectory://abook.mab\"\n */\n if (abURIArr.length == 4 && abURIArr[0] == \"moz-abmdbdirectory:\" && abURIArr[3] != \"\") {\n return abURIArr[0] + \"/\" + abURIArr[1] + \"/\" + abURIArr[2];\n }\n\n return null;\n}", "title": "" }, { "docid": "18cfaba8f03f86e4735886b48b2ba2d7", "score": "0.5202283", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep);\n if (p.length > 0) return p[0]\n return null\n}", "title": "" }, { "docid": "18cfaba8f03f86e4735886b48b2ba2d7", "score": "0.5202283", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep);\n if (p.length > 0) return p[0]\n return null\n}", "title": "" }, { "docid": "7a5a770907f63a5437023d195e143e6f", "score": "0.5194749", "text": "function getInferredGopath(folderPath) {\n if (!folderPath) {\n return;\n }\n const dirs = folderPath.toLowerCase().split(path.sep);\n // find src directory closest to given folder path\n const srcIdx = dirs.lastIndexOf('src');\n if (srcIdx > 0) {\n return folderPath.substr(0, dirs.slice(0, srcIdx).join(path.sep).length);\n }\n}", "title": "" }, { "docid": "31e5c5c395df927fb64fdd497f4bdcb7", "score": "0.5194148", "text": "function getParent(obj){\n\t//info: gets parent object\n\tvar cObj=getObject(obj);\n\tif(undefined == cObj){return abort(\"undefined object passed to getParent\");}\n\tif(undefined == cObj.parentNode){return cObj;}\n\tvar pobj=cObj.parentNode;\n\tif(typeof(cObj.parentNode) == \"object\"){return cObj.parentNode;}\n\telse{return getParent(pobj);}\n\t}", "title": "" }, { "docid": "a94d8c925ef1b6599e281749c84d39e2", "score": "0.5193392", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep)\n if (p.length > 0) return p[0]\n else return null\n}", "title": "" }, { "docid": "460c9a3e4c1d660e8cbd5ec3b945440a", "score": "0.51911616", "text": "function dirname(path) {\n return ObjC.unwrap(\n $(path).stringByStandardizingPath.stringByDeletingLastPathComponent,\n )\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.518277", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.518277", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.518277", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.518277", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.518277", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.518277", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "6cc2c82bd57e14428c99be7f744f61ba", "score": "0.518277", "text": "function dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}", "title": "" }, { "docid": "c948fa0e7862da379100f2d671fa20cb", "score": "0.5173426", "text": "function getAncestorDirs(fileOrDir) {\n const { root } = path.parse(fileOrDir);\n if (fileOrDir === root) {\n return [];\n }\n const parentDir = path.dirname(fileOrDir);\n return [parentDir, ...getAncestorDirs(parentDir)];\n}", "title": "" }, { "docid": "ff87ab1e036bb42254d81462a1e384e8", "score": "0.51697093", "text": "function tryGetParent(steps, $elem) {\n\t\t\t\n\t\t\tvar resultStep;\n\t\t\t$.each(steps, function (j, parStep) {\n\t\t\t\tif ($elem.parents(parStep.selector).length > 0) {\n\t\t\t\t\tresultStep = parStep;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\treturn resultStep;\n\t\t}", "title": "" }, { "docid": "5c9c00dd1433b494e4eae46f2ab38f15", "score": "0.5168779", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep)\n if (p.length > 0) return p[0]\n return null\n}", "title": "" }, { "docid": "5c9c00dd1433b494e4eae46f2ab38f15", "score": "0.5168779", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep)\n if (p.length > 0) return p[0]\n return null\n}", "title": "" }, { "docid": "5c9c00dd1433b494e4eae46f2ab38f15", "score": "0.5168779", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep)\n if (p.length > 0) return p[0]\n return null\n}", "title": "" }, { "docid": "5c9c00dd1433b494e4eae46f2ab38f15", "score": "0.5168779", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep)\n if (p.length > 0) return p[0]\n return null\n}", "title": "" }, { "docid": "5c9c00dd1433b494e4eae46f2ab38f15", "score": "0.5168779", "text": "function getRootPath (p) {\n p = path.normalize(path.resolve(p)).split(path.sep)\n if (p.length > 0) return p[0]\n return null\n}", "title": "" } ]
17f3b835a6ebcb7f8b88d6186c200116
...foods collects arbitrary number of arguments into an array
[ { "docid": "1ea9f2af884b4dd1195cffadd7aafcdf", "score": "0.0", "text": "constructor(...foods) {\n super();\n this.foods = [];\n foods.forEach((food) => this.foods.push(food))\n }", "title": "" } ]
[ { "docid": "e4244002324fdb99d51dd4ddf93b5acc", "score": "0.68797004", "text": "function arrayfromargs(){\n\treturn Array.prototype.slice.call(arguments, 0);\n}", "title": "" }, { "docid": "47ed95340d651ca269bcf3ba59b0e353", "score": "0.67406774", "text": "function makeArray() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "a1e472a0b2122cf2cf1cd935628546ef", "score": "0.6696778", "text": "function multiArgs(args, fn) {\n var result = [], i;\n for(i = 0; i < args.length; i++) {\n result.push(args[i]);\n if(fn) fn.call(args, args[i], i);\n }\n return result;\n }", "title": "" }, { "docid": "a1e472a0b2122cf2cf1cd935628546ef", "score": "0.6696778", "text": "function multiArgs(args, fn) {\n var result = [], i;\n for(i = 0; i < args.length; i++) {\n result.push(args[i]);\n if(fn) fn.call(args, args[i], i);\n }\n return result;\n }", "title": "" }, { "docid": "a1e472a0b2122cf2cf1cd935628546ef", "score": "0.6696778", "text": "function multiArgs(args, fn) {\n var result = [], i;\n for(i = 0; i < args.length; i++) {\n result.push(args[i]);\n if(fn) fn.call(args, args[i], i);\n }\n return result;\n }", "title": "" }, { "docid": "221acec58706cb3f598b6a3b7cbce3ff", "score": "0.6695483", "text": "function multiArgs(args, fn) {\n\t var result = [],\n\t i;\n\t for (i = 0; i < args.length; i++) {\n\t result.push(args[i]);\n\t if (fn) fn.call(args, args[i], i);\n\t }\n\t return result;\n\t }", "title": "" }, { "docid": "8b24abc31c44b1b36f3cc33bef00864c", "score": "0.6599273", "text": "function makeArrayFunction1() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return [args];\n}", "title": "" }, { "docid": "82c98d9d1f436ab931db2c07dfc06605", "score": "0.65878445", "text": "function collectArguments() {\n var args = arguments, i = args.length, arr = new Array(i);\n while (i--) {\n arr[i] = args[i];\n }\n return arr;\n }", "title": "" }, { "docid": "ffb114f2349f6f429c3a9b5adaa08626", "score": "0.65499574", "text": "function f(a, b, ...theArgs) {} // Actuall array", "title": "" }, { "docid": "01c11b7ebb7122f8ac04429768e0cb1b", "score": "0.64741933", "text": "function argsToArray(args) \n{\n var r = []; for (var i = 0; i < args.length; i++)\n r.push(args[i]);\n return r;\n}", "title": "" }, { "docid": "9f560eba702b3eb81475e8a55ba3f165", "score": "0.64714986", "text": "function f() {\n\t\t\t return Array.from(arguments);\n\t\t\t}", "title": "" }, { "docid": "388b5e7fc3d5350365cade52e71f8b92", "score": "0.6431569", "text": "function magicArray() {\n console.log(arguments, arguments.length, typeof arguments);\n var arr =[];\n if (typeof arguments[0] !==\"array\"){\n for (var i=0;i<arguments.length;i++) {\n arr[i] = arguments[i];\n }\n extend(arr, fn);\n return arr;\n }\n else {\n extend(arguments[0], src);\n return arguments[0];\n }\n}", "title": "" }, { "docid": "046376eae0a75d486abed32641ad6f9a", "score": "0.6401432", "text": "function collectAnimals(...animals) {\r\n /*and here*/\r\n return animals\r\n}", "title": "" }, { "docid": "e86f0371347fc3ceb2ddd25df68f4f87", "score": "0.63997024", "text": "function f() {\n return Array.from(arguments);\n }", "title": "" }, { "docid": "6defeb07703805461564069fad7982ea", "score": "0.6393645", "text": "function getArgsArray(args) {\n return Array.prototype.concat.apply([], Array.prototype.slice.call(args, 0));\n }", "title": "" }, { "docid": "59df406d7a3ded6f9fe8f0778bbefc2e", "score": "0.6392279", "text": "function makeArray(name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return args;\n}", "title": "" }, { "docid": "97d833f3e9dcec3b691ecc3b6d7ee19b", "score": "0.6384662", "text": "function myFunc() {\n return Array.from(arguments);\n }", "title": "" }, { "docid": "1b81473909bfe23467f0b119f16b7218", "score": "0.6382312", "text": "function someOfAllItems(a, b, ...c)\n//gives intial arguments to parameters before ... and rest will be saved in an array that will be assigned to c\n{\n console.log(a + b + \" \" +\n c);\n}", "title": "" }, { "docid": "20269eecb5e7428fdc2c9ce943ba4383", "score": "0.6377411", "text": "function turnMyArgumentsIntoAnArray() {\n\tlet args = Array.from(arguments);\n\treturn args;\n}", "title": "" }, { "docid": "44e456adb9658a0aa753a46b0fd26e59", "score": "0.6323729", "text": "function arrayFrom(...args){\n let newArray = [];\n args.forEach((val) => {\n newArray.push(val);\n })\n return newArray;\n }", "title": "" }, { "docid": "735c3d6693fa1160f1b1aae4074213c6", "score": "0.6247127", "text": "function f() {\n return Array.from(arguments);\n }", "title": "" }, { "docid": "8fec1db270be47c756059bf50d2a50e5", "score": "0.61999226", "text": "function someFunction(first, second, ...athers) {\n return [first, second, athers]\n}", "title": "" }, { "docid": "e0718b9e2f28f5d636d71202823a8bcc", "score": "0.6189591", "text": "function argumentCollector(...args){\n return args;\n}", "title": "" }, { "docid": "0625c86cfede4e29218d9d04becca4de", "score": "0.6187152", "text": "function doSomething () {\n var args = Array.prototype.slice.call(arguments);\n console.log(args);\n}", "title": "" }, { "docid": "fad416c0451497c0e4994777cef32102", "score": "0.61812466", "text": "function _argumentsToArray( args )\n{\n return [].concat.apply( [], Array.prototype.slice.apply(args) );\n}", "title": "" }, { "docid": "71fefec729e10b74dc96eb50e82ca4ee", "score": "0.6176909", "text": "function eatArray (i, key, args) {\n var start = i + 1\n var argsToSet = []\n var multipleArrayFlag = i > 0\n for (var ii = i + 1; ii < args.length; ii++) {\n if (/^-/.test(args[ii]) && !negative.test(args[ii])) {\n if (ii === start) {\n setArg(key, defaultForType('array'))\n }\n multipleArrayFlag = true\n break\n }\n i = ii\n argsToSet.push(args[ii])\n }\n if (multipleArrayFlag) {\n setArg(key, argsToSet.map(function (arg) {\n return processValue(key, arg)\n }))\n } else {\n argsToSet.forEach(function (arg) {\n setArg(key, arg)\n })\n }\n\n return i\n }", "title": "" }, { "docid": "71fefec729e10b74dc96eb50e82ca4ee", "score": "0.6176909", "text": "function eatArray (i, key, args) {\n var start = i + 1\n var argsToSet = []\n var multipleArrayFlag = i > 0\n for (var ii = i + 1; ii < args.length; ii++) {\n if (/^-/.test(args[ii]) && !negative.test(args[ii])) {\n if (ii === start) {\n setArg(key, defaultForType('array'))\n }\n multipleArrayFlag = true\n break\n }\n i = ii\n argsToSet.push(args[ii])\n }\n if (multipleArrayFlag) {\n setArg(key, argsToSet.map(function (arg) {\n return processValue(key, arg)\n }))\n } else {\n argsToSet.forEach(function (arg) {\n setArg(key, arg)\n })\n }\n\n return i\n }", "title": "" }, { "docid": "aac0a289b413c9220759e07668a24cbb", "score": "0.6172933", "text": "function mun() {\r\n var data = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n data[_i] = arguments[_i];\r\n }\r\n console.log(data);\r\n}", "title": "" }, { "docid": "9f7e423bd1f1694fbaaca6a65d87e193", "score": "0.6130395", "text": "function arr (...paramentros){\r\n return(paramentros)\r\n}", "title": "" }, { "docid": "22963970213e65582c5b89e0d24725be", "score": "0.6120254", "text": "function args(a, index) {\n var myargs = new Array();\n for (var i = index; i < a.length; i++) {\n myargs[myargs.length] = a[i];\n }\n return myargs;\n }", "title": "" }, { "docid": "5d3c010529a91191f5a818e4c6e4bd89", "score": "0.6098142", "text": "function eatArray(i, key, args) {\n var start = i + 1;\n var argsToSet = [];\n var multipleArrayFlag = i > 0;\n\n for (var ii = i + 1; ii < args.length; ii++) {\n if (/^-/.test(args[ii]) && !negative.test(args[ii])) {\n if (ii === start) {\n setArg(key, defaultForType('array'));\n }\n\n multipleArrayFlag = true;\n break;\n }\n\n i = ii;\n argsToSet.push(args[ii]);\n }\n\n if (multipleArrayFlag) {\n setArg(key, argsToSet.map(function (arg) {\n return processValue(key, arg);\n }));\n } else {\n argsToSet.forEach(function (arg) {\n setArg(key, arg);\n });\n }\n\n return i;\n }", "title": "" }, { "docid": "2cec1cf145ddc30419ff22b3e0428c67", "score": "0.6080579", "text": "function eatArray (i, key, args) {\n var start = i + 1;\n var argsToSet = [];\n var multipleArrayFlag = i > 0;\n for (var ii = i + 1; ii < args.length; ii++) {\n if (/^-/.test(args[ii]) && !negative.test(args[ii])) {\n if (ii === start) {\n setArg(key, defaultForType('array'));\n }\n multipleArrayFlag = true;\n break\n }\n i = ii;\n argsToSet.push(args[ii]);\n }\n if (multipleArrayFlag) {\n setArg(key, argsToSet.map(function (arg) {\n return processValue(key, arg)\n }));\n } else {\n argsToSet.forEach(function (arg) {\n setArg(key, arg);\n });\n }\n\n return i\n }", "title": "" }, { "docid": "b659895263718680c626d1fdc71ea4b4", "score": "0.6062787", "text": "function carryCollectToArray() {\n var ap = Array.prototype;\n var args = arguments;\n\n return function () {\n function fn () {\n if (arguments.length != 0) {\n ap.push.apply(fn.args, arguments);\n return fn;\n } else {\n console.log(fn.args);\n return 'hi'; \n }\n }\n fn.args = ap.slice.call(args, 1);\n return fn.apply(this, arguments);\n }\n}", "title": "" }, { "docid": "2f9931ece94a68f8fd4f28ec5d9d5b88", "score": "0.6018923", "text": "function howMany(...args) {\n return args.length;\n}", "title": "" }, { "docid": "c7774e923cfe62b960ee6c9b3c2a9769", "score": "0.5995294", "text": "function f() {\n return Array.from(arguments);\n}", "title": "" }, { "docid": "193db2ff02ebb42cec4c3cc0dfde39e8", "score": "0.59874904", "text": "function test_args() {\n return [];\n}", "title": "" }, { "docid": "38d96c5ffb270fdcddd35fdac4a2feae", "score": "0.5978345", "text": "function foo1(...args) {\n console.log(args); \n}", "title": "" }, { "docid": "9fb4b8f0989cbb7b660868db753f534b", "score": "0.5977361", "text": "function foo(strings,...args){\n console.log(strings);\n console.log(args);\n return ([...strings,...args]);\n}", "title": "" }, { "docid": "fafdfdff1a429edbbef48e4b61939851", "score": "0.59769076", "text": "function manyArgs(...args){\n return args.length;\n}", "title": "" }, { "docid": "3e3645ba8a97cb62fd929815dc581f89", "score": "0.5970904", "text": "function echoMany() {\n return Array.prototype.slice.call(arguments);\n }", "title": "" }, { "docid": "9c50662805a161165dcd39ae6899b3a9", "score": "0.5918796", "text": "function concat() {\n var newarr = [];\n\n for(var j=0; j< arguments.length; j++) {\n for(var i = 0; i < arguments[j].length; i++) {\n newarr.push(arguments[j][i]);\n }\n } \n\n return newarr;\n}", "title": "" }, { "docid": "93f9f744ea074f86f27d89059ab51315", "score": "0.59186035", "text": "function multi(a, b) {\n return arguments.length;\n}", "title": "" }, { "docid": "061a35b4df26179a3f6a7c371ba30280", "score": "0.5897162", "text": "function combine() {\n var args = Array.prototype.slice.call(arguments);\n \n var max_len=0;\n \n var i=0;\n \n while(i < args.length) {\n if(max_len < args[i].length) {\n max_len = args[i].length;\n }\n i++;\n }\n \n var result = [];\n \n i = 0;\n \n while(i < max_len) {\n var j = 0;\n \n while(j < args.length) {\n if(i < args[j].length) {\n result.push(args[j][i]);\n }\n j++;\n }\n i++;\n }\n \n return result;\n}", "title": "" }, { "docid": "2dd706ea7b30984dde7673ee4b72c5ed", "score": "0.58870107", "text": "function argsLengthEmptyRestArray(...[]) {\n return arguments.length;\n}", "title": "" }, { "docid": "25c5ac829e3c3936f5fd85e5cdf727a0", "score": "0.5872374", "text": "function getValuesFromArguments(args, skipFirst =false){\n let inputValues =[];\n var count = 0;\n for(let arg in args){\n if(skipFirst && count == 0){count++; continue;}\n var currArgument = args[arg]; \n if(Array.isArray(currArgument)){\n inputValues = inputValues.concat(currArgument);\n } else {\n inputValues.push(currArgument);\n } \n count++; \n } \n return inputValues;\n }", "title": "" }, { "docid": "d43586f58445b8daf5f2cb6fdb2a8c46", "score": "0.5865542", "text": "function hello(...allArguments) {\r\n console.log(allArguments);\r\n}", "title": "" }, { "docid": "a9431e8d1f207a264491613beb05757c", "score": "0.5861482", "text": "static invokeMultiple(ctx, args) {\n\n }", "title": "" }, { "docid": "c18c1da62a3697759df09c00273e6673", "score": "0.5855175", "text": "function __resolveValues( args ) {\n var values = [];\n var argc = args.length;\n for( var i = 0; i < argc; i++ ) {\n var arg = args[i];\n var arg_type = typeof(arg);\n if( arg_type == 'function' ) {\n arg = arg.call( arg );\n arg_type = typeof(arg);\n }\n if( arg_type == 'string' ) {\n values[values.length] = arg;\n } else { throw new Error(); }\n }\n return values;\n}", "title": "" }, { "docid": "77ac0c297f5d9d4658310c501a7f58d8", "score": "0.58534783", "text": "function parseArrayOfArguments(args) {\n let command = new Command();\n args.forEach(function(val, index, array) {\n switch (val) {\n case '-leagues':\n command.setLeagues(array[index + 1].split(\",\"));\n break;\n case '-generate':\n command.setGenerateOptions(array[index + 1].split(\",\"));\n break;\n case \"-output\":\n command.setExternalOutputPath(path.normalize(array[index + 1]));\n break;\n case '-bootstrap':\n command.activateBootstrap();\n break;\n }\n });\n return command;\n}", "title": "" }, { "docid": "73a4f5e2e22d3a52e5955af0925d9d6c", "score": "0.5852845", "text": "toArgs() {\n var ret = [];\n // XXX, TODO: this won't necessarily produce the args in the right order\n for (let idx of this.argOrder) {\n ret.push(this.testObject[idx]);\n }\n return ret;\n }", "title": "" }, { "docid": "3a6d6b693ba11bd3b7b19ed0174287eb", "score": "0.5843331", "text": "function get_args(args) {\n return args.map(function (arg) {\n return [arg.TYPE, arg.name];\n });\n }", "title": "" }, { "docid": "7e99556d4f6b676a286efed2cb5cc462", "score": "0.583304", "text": "function x() {\r\n return Array.prototype.slice.call(arguments);\r\n}", "title": "" }, { "docid": "d65a9ad331be080ef9c6288b74b012d2", "score": "0.58176607", "text": "function howMany(...args) {\n return \"You have passed \" + args.length + \" arguments.\";\n}", "title": "" }, { "docid": "d65a9ad331be080ef9c6288b74b012d2", "score": "0.58176607", "text": "function howMany(...args) {\n return \"You have passed \" + args.length + \" arguments.\";\n}", "title": "" }, { "docid": "61b28363c2564d50c62428dffe2bb99f", "score": "0.5785395", "text": "function concat() {\n // ...\n var newArray = [];\n var currentArg;\n\n for (var j = 0; j < arguments.length; j++) {\n currentArg = arguments[j];\n\n if (Array.isArray(currentArg)) {\n for (var i = 0; i < currentArg.length; i++) {\n newArray.push(currentArg[i]);\n }\n } else {\n newArray.push(currentArg);\n }\n }\n\n return newArray;\n}", "title": "" }, { "docid": "a548b63011dffbd91dbfcea4b6c8b5d7", "score": "0.5775151", "text": "function foo1(var_args) {}", "title": "" }, { "docid": "905c9b451e77f2e5d1b9f0121ebe74b0", "score": "0.5765141", "text": "function getArgs(args, start)\n{\n if (!start) { start = 0; }\n var arglen = args.length - start;\n //console.log(\"arglen: \"+arglen);\n if ((arglen === 1) && (args[start] instanceof Array)) {\n return args[start];\n } // if there's only one argument, and it's an array.\n else {\n var result = Array(arglen);\n for (var i = start; i < args.length; i++)\n result[i-start] = args[i];\n return result;\n } // getArgs\n}", "title": "" }, { "docid": "1fa910c3937857fc726c1238e424b887", "score": "0.5758294", "text": "function collect(...a){\n console.log(a);\n}", "title": "" }, { "docid": "0b9c7208e10f0b2d2e5b90e0677f9093", "score": "0.5750408", "text": "function howMany(...args) {\n return \"You have passed \" + args.length + \" arguments.\";\n }", "title": "" }, { "docid": "4818687aa8573765e2488835fb0b1a7e", "score": "0.57492346", "text": "function getArguments(env, args) {\n const positional = [];\n const named = {};\n\n if (args) {\n for (const arg of args) {\n if (arg.type === \"narg\") {\n named[arg.name] = Type(env, arg.value);\n } else {\n positional.push(Type(env, arg));\n }\n }\n }\n\n return [positional, named];\n}", "title": "" }, { "docid": "4818687aa8573765e2488835fb0b1a7e", "score": "0.57492346", "text": "function getArguments(env, args) {\n const positional = [];\n const named = {};\n\n if (args) {\n for (const arg of args) {\n if (arg.type === \"narg\") {\n named[arg.name] = Type(env, arg.value);\n } else {\n positional.push(Type(env, arg));\n }\n }\n }\n\n return [positional, named];\n}", "title": "" }, { "docid": "f4c71c9a2199364b6a49e6190d9a5146", "score": "0.57414854", "text": "function variadic() {\n console.log(arguments);\n}", "title": "" }, { "docid": "5f3ab7624cb720ddb1fd8f998ef7fec2", "score": "0.5738932", "text": "function f() {\r\n\t// borrowing the slice method from the Array type.\r\n\tvar args = Array.prototype.slice.call(arguments, 1, 3);\r\n\treturn args;\r\n}", "title": "" }, { "docid": "e3c6c82fd4912e3467f47890760dbd62", "score": "0.57276815", "text": "function argsAccessEmptyRestArray(...[]) {\n return arguments[0];\n}", "title": "" }, { "docid": "4da2aac83e76f789a912e301069cf281", "score": "0.57204413", "text": "function doubleAndReturnArgs(array, ...args) {\n const newArray = [...array];\n args.map(val => newArray.push(val * 2));\n return newArray;\n}", "title": "" }, { "docid": "6c9c46c0ce5a2ccb7dd36491f1c97050", "score": "0.5720209", "text": "function printall(...omg) {\n for (let i = 0; i < omg.length; i++) {\n console.log(omg [i]);\n }\n\n \n}", "title": "" }, { "docid": "6fbc5f3051fcc80ac7a272b3d624d9d0", "score": "0.57122207", "text": "function convert() {\n\n // a: using 'Array.from'\n const args = Array.from(arguments);\n\n // b: using Spread\n const args = [...arguments];\n}", "title": "" }, { "docid": "43e8b19c24cff679896291bda9bd29a0", "score": "0.57047546", "text": "function funWithRestArray(x: 'hi', y: 123, ...rest: Array<number>) {}", "title": "" }, { "docid": "f1ffb22a88584a79fd938d67466d6124", "score": "0.5704044", "text": "function partial(f /* , ... */){\n var args = arguments;\n console.log(args);\n \n return function(){\n var a = array(args,1);\n console.log(a);\n \n var i = 0, j= 0;\n //?Loop through those args, filling in undefined values from inner.\n for(; i< a.length; i++){\n if(a[i] === undefined) a[i] = arguments[j++];\n }\n // ? Now append any remaining inner arguments.\n a = a.concat(array(arguments,j))\n return f.apply(this,a);\n };\n}", "title": "" }, { "docid": "4a2782736de7863b868b5250a4988deb", "score": "0.5703731", "text": "_splitEachArgumentIntoSingleFiles(args){\n for(let i=0; i < args.length; i++){\n const arg = args[i];\n const argType = typeof arg;\n if(argType === 'string'){\n this._addFile(arg);\n }else if(arg instanceof Array){\n this._splitArrayIntoSingleFiles(arg);\n }else if(argType === 'object'){\n this._splitObjectIntoSingleFiles(arg);\n }\n }\n }", "title": "" }, { "docid": "7b90a1b6ca900d4e88629d1c0dd4d11a", "score": "0.57036287", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "7b90a1b6ca900d4e88629d1c0dd4d11a", "score": "0.57036287", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "7b90a1b6ca900d4e88629d1c0dd4d11a", "score": "0.57036287", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "7b90a1b6ca900d4e88629d1c0dd4d11a", "score": "0.57036287", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}", "title": "" }, { "docid": "8c8a252abd30ffb1f6271fecd52238e5", "score": "0.57029736", "text": "function ArrayArgument() {\n this.args = [];\n}", "title": "" }, { "docid": "837d0ded89399dfe44ed35a40cee451c", "score": "0.56978285", "text": "_getArgs() {\n const { value, data } = this;\n const { sigV, sigR, sigS, mode } = this._combineSignatures();\n return [sigV, sigR, sigS, mode, value, data];\n }", "title": "" }, { "docid": "a7b4e8a06dd85d0693adf8769b13ae07", "score": "0.56943494", "text": "function sum(...args){\nconsole.log(args)\n}", "title": "" }, { "docid": "45e17f7414bba7df22a2652de0f1564b", "score": "0.56879026", "text": "function arrsumrest(...nizargumenata) {\n let sum = 0;\n for ( let arg of nizargumenata) {\n sum += arg;\n }\n return sum;\n}", "title": "" }, { "docid": "6af147419e4377da572325f5c837f958", "score": "0.5676515", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}", "title": "" }, { "docid": "5e0e1d7660af74609bc8378976b4068d", "score": "0.56731576", "text": "function g(x, y){\n console.log(arguments);\n console.log(Array.from(arguments));// arguments ko array mai convert kara\n}", "title": "" }, { "docid": "bad0f92d444558ec1d53227993dfd064", "score": "0.5667776", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "325534f0f60e0817c3bcf96de910349c", "score": "0.5667728", "text": "function buildArgList(a) {\n\tvar list = \"\";\n\n\ta.forEach(function(arg){\n\t\tif(list.length === 0) {\n\t\t\tlist += arg;\n\t\t} else {\n\t\t\tlist += `, ${arg}`;\n\t\t}\n\t});\n\n\treturn list;\n}", "title": "" }, { "docid": "709376d3a2463aa59ab83268a86eed07", "score": "0.56668496", "text": "function h(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}", "title": "" }, { "docid": "e3fe55b445c9278f8552431c1526344c", "score": "0.56656456", "text": "enterArrayArgument(ctx) {\n\t}", "title": "" }, { "docid": "50c045a8469981b272d549eaed65cb06", "score": "0.56624174", "text": "function suma(...numbers){\n\tconsole.log(numbers)\n}", "title": "" }, { "docid": "ae2c9fe4e11eaffdb49661e249deb46b", "score": "0.56591934", "text": "function initArray() {\n this.length = initArray.arguments.length;\n for (var i = 0; i < this.length; i++) {\n this[i] = initArray.arguments[i];\n }\n}", "title": "" }, { "docid": "67d2b6dd5638c3c0691dc7aa54d987c6", "score": "0.56524944", "text": "function rest(...args){\n for(arg of args){\n console.log(arg);\n }\n}", "title": "" }, { "docid": "e075781d41a8f73ac6d168d746353fa3", "score": "0.5652481", "text": "function returnAllArgs() {\n var argsArray = [];\n for (var i = 0; i < arguments.length; i += 1) {\n argsArray.push(arguments[i]);\n }\n return argsArray.join(', ');\n}", "title": "" }, { "docid": "d35e65b98b396ec058ed5e194e8876aa", "score": "0.5652324", "text": "function m(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,l=a.length;i<l;i++,o++)r[o]=a[i];return r}", "title": "" }, { "docid": "bc53854caed8c70a81f9d07cf0797323", "score": "0.5643471", "text": "function m() {\n for (var e = 0, t = 0, n = arguments.length; t < n; t++)\n e += arguments[t].length;\n var r = Array(e),\n o = 0;\n for (t = 0; t < n; t++)\n for (var i = arguments[t], a = 0, c = i.length; a < c; a++, o++)\n r[o] = i[a];\n return r;\n }", "title": "" }, { "docid": "d9ab188d4494ba07376d002a611c51ab", "score": "0.56327593", "text": "function sum(...numbers) {\n\n}", "title": "" }, { "docid": "1176b24ab60ad40c9c920d0f3ff6e60a", "score": "0.56284803", "text": "function foo(...args) {\n let [x=0, y=0] = args;\n console.log('Arity: '+args.length);\n}", "title": "" }, { "docid": "202845ecfa5b69f52886191b20d50fbf", "score": "0.56235236", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r}", "title": "" }, { "docid": "202845ecfa5b69f52886191b20d50fbf", "score": "0.56235236", "text": "function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r}", "title": "" }, { "docid": "eb5fb15bd76efd90c68d6fc7eec41459", "score": "0.5622825", "text": "function sumThree(...myArr){\n console.log(myArr);\n let sum = 0;\n for(const arg of myArr){\n sum += arg;\n }\n return sum;\n}", "title": "" }, { "docid": "bda54910ca183488bad0da5bf24c51a2", "score": "0.56193584", "text": "function f(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),a=0;for(t=0;t<n;t++)for(var i=arguments[t],o=0,l=i.length;o<l;o++,a++)r[a]=i[o];return r}", "title": "" }, { "docid": "1b61fcd0f460e592d20acfb0ccf10b6e", "score": "0.5611674", "text": "function toArray(args, pos)\n\t{\n\t if(pos === void 0)\n\t {\n\t pos = 0;\n\t }\n\t return Array.prototype.slice.call(args, pos);\n\t}", "title": "" }, { "docid": "5cb49d30f3350992c7eea54ac448bdf9", "score": "0.5611234", "text": "function createArgumentsString(arity){var str='';for(var i=0;i<arity;i++){str+=', arg'+i;}return str.substr(2);}", "title": "" }, { "docid": "33897ad9dd355aef9e0aed68c611ce61", "score": "0.56108576", "text": "function a(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}", "title": "" }, { "docid": "12b44d1c0d49babf54a007da1b392b13", "score": "0.5610375", "text": "function foo([a, b, c]) {\n console.log(a, b, c);\n}", "title": "" }, { "docid": "08594ffe1678bbeee687f2aac3c0f2de", "score": "0.56084436", "text": "function addAll() {\n //return arguments;\n //Output is\n //[Arguments] { '0': 2, '1': 3, '2': 1 }\n //Converting kinda of array to actual array in ES5\n var args = Array.prototype.slice.call(arguments);\n //return args;\n // O/P --> [2,3,1]\n var total = 0;\n for (i = 0; i < args.length; i++) {\n total += args[i];\n }\n return total;\n}", "title": "" } ]
aae211a513f7ef22244225af65f7d1fb
Places text elements for the current frame.
[ { "docid": "66d92d96157c1c3e27284c06ee08cdc5", "score": "0.5382235", "text": "placeText(dataSourceTileList, time) {\n const tileTextElementsChanged = checkIfTextElementsChanged(dataSourceTileList);\n const textElementsAvailable = this.hasOverlayText() || tileTextElementsChanged;\n if (!this.initialize(textElementsAvailable)) {\n return;\n }\n const updateTextElements = this.m_cacheInvalidated ||\n tileTextElementsChanged ||\n this.m_viewState.renderedTilesChanged;\n logger.debug(`FRAME: ${this.m_viewState.frameNumber}, ZOOM LEVEL: ${this.m_viewState.zoomLevel}`);\n if (updateTextElements && this.m_addNewLabels) {\n this.m_textElementStateCache.clearVisited();\n this.updateTextElements(dataSourceTileList);\n }\n const findReplacements = updateTextElements && this.m_addNewLabels;\n const anyTextGroupEvicted = this.m_textElementStateCache.update(time, this.m_options.disableFading, findReplacements, this.m_viewState.zoomLevel);\n this.reset();\n if (this.m_addNewLabels) {\n this.prepopulateScreenWithBlockingElements(dataSourceTileList);\n }\n // New text elements must be placed either if text elements were updated in this frame\n // or if any text element group was evicted. The second case happens when the group is not\n // visited anymore and all it's elements just became invisible, which means there's newly\n // available screen space where new text elements could be placed. A common scenario where\n // this happens is zooming in/out: text groups from the old level may still be fading out\n // after all groups in the new level were updated.\n const placeNewTextElements = (updateTextElements || anyTextGroupEvicted) && this.m_addNewLabels;\n this.placeTextElements(time, placeNewTextElements);\n this.placeOverlayTextElements();\n this.updateTextRenderers();\n }", "title": "" } ]
[ { "docid": "30931cbde6974a63a3781538e6b7ea29", "score": "0.61167115", "text": "display() {\r\n push();\r\n translate(this.x, this.y, this.z);\r\n textAlign(CENTER, CENTER);\r\n textFont(font);\r\n textSize(100);\r\n\t\tfill(this.color);\r\n text(this.str, 0, 0);\r\n pop();\r\n }", "title": "" }, { "docid": "709e7d68b4088d270ecb88009a9dc25b", "score": "0.6072583", "text": "function putText(story, placement=0){\n\tvar storyBox = document.getElementById(\"textBox\");\n\tif (story.length <= 49){\n\t\tstoryBox.innerHTML = story;\n\t\t\n\t}else{\n\t\tvar end = story.slice(0, 47).lastIndexOf(\" \");\n\t\t\n\t\tstoryBox.innerHTML = story.slice(0, end) + `<p id=\"space\" onmousedown=\"putText('` + story.slice(end + 1, story.length) + `',1)\"> &#9660</p>`;\n\t}\n\tif (placement ==0){\n\t\tdocument.getElementsByClassName(\"answers\")[0].innerHTML = \"\";\n\t}\n}", "title": "" }, { "docid": "feccccc49ee667afd1f1122e41cb2cc5", "score": "0.6065545", "text": "_drawText() {\n\t\tlet dimensions = this._calculateWindowDimensions();\n\t\tlet x = dimensions.x + this.padding;\n\t\tlet y = dimensions.y + (this.padding * 0.5);\n\t\tlet text = '';\n\t \n\t\tthis.graphics.text = this.scene.make.text({\n\t\t\tx,\n\t\t\ty,\n\t\t\ttext,\n\t\t\tstyle: {\n\t\t\t\twordWrap: { width: dimensions.width - this.padding },\n\t\t\t\tfontFamily: 'pressstart',\n\t\t\t\tfontSize: '14px',\n\t\t\t\tlineSpacing: '12'\n\t\t\t}\n\t\t}).setScrollFactor(this.scrollFactor);\n\n\t\t// Ensure the dialog text renders above the background\n\t\tthis.graphics.text.setDepth(1010);\n\t}", "title": "" }, { "docid": "05281ec232523a6145b3b0dbe1008317", "score": "0.6056688", "text": "function main() {\n var hasErrors = false,\n selections = app.selection;\n\n for (var i = 0; i < selections.length && !hasErrors; i++) {\n var textFrame = selections[i] instanceof InsertionPoint ?\n selections[i].parentTextFrames[0] :\n selections[i];\n hasErrors = isError(textFrame);\n\n if (!hasErrors) {\n textFrame.contents = addBreakTop(textFrame.contents);\n };\n }\n}", "title": "" }, { "docid": "2c6602fba739ac86398e2b0dc7ff8d67", "score": "0.6009461", "text": "function mousePressed() {\n textPlaceX = mouseX\n textPlaceY = mouseY\n}", "title": "" }, { "docid": "5335911022ed8e0bea013b40c4ba0fae", "score": "0.59217334", "text": "function setContent() {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tvar _cnt = $(getIframeContent()).html();\r\n\t\t\t\t\t\t\t\t$drawTextWriting.css(\"color\", _color).html(_cnt);\r\n\t\t\t\t\t\t\t\t_selfDrawing.bindEventsToCanvasObjects($drawTextWriting);\r\n\t\t\t\t\t\t\t\t_selfCanvas.resizeCanvas();\r\n\t\t\t\t\t\t\t} catch(error) {\r\n\t\t\t\t\t\t\t\tG_debug(\"Couldn't get content from rte: \" + error);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcloseRTE();\r\n\t\t\t\t\t\t}", "title": "" }, { "docid": "0bfeb1968e15d0f5923131949c965f79", "score": "0.5912508", "text": "setText(bodyText) {\n this.bodyText = bodyText;\n this.drawXTxt = 305;\n this.drawYTxt = 100;\n }", "title": "" }, { "docid": "1b63d1131e398e5540a269f83e9b298e", "score": "0.5899556", "text": "function titleBoxSetup(x, y, width, height, content) {\r\n var titleBox = currentPage.textFrames.add({\r\n geometricBounds : [y, x, y + height, x + width],\r\n appliedObjectStyle : docToSetup.objectStyles.itemByName(\"SLUG TEXTBOXES\")\r\n });\r\n\r\n titleBox.contents = content;\r\n }", "title": "" }, { "docid": "de8a06d142c1dbaa4be3e055dfc76e42", "score": "0.5864531", "text": "function Main() {\n // Check to see whether any InDesign documents are open.\n // If no documents are open, display an error message.\n if (app.documents.length > 0) {\n var myDoc = app.activeDocument;\n var root = myDoc.xmlElements[0];\n var docTag = root.evaluateXPathExpression('//dwin_display_item_number');\n\n // Create a text frame on the first page pasteboard\n var myTextFrame = myDoc.pages[0].textFrames.add();\n myTextFrame.geometricBounds = [0,9,11,13];\n // Add the text to the frame\n // myTextFrame.contents += ;\n\n\n \n \n for (var i = 0; i < docTag.length; i++) { \n var docPos = docTag[i].xmlContent.insertionPoints[0].parentTextFrames[0];\n myTextFrame.contents += docTag[i].contents + \"\\t\" + docPos.parentPage.name + \"\\n\";\n }\n \n\n\n alert(\"Finished!\");\n } else {\n // No documents are open, so display an error message.\n alert(\"No InDesign documents are open. Please open a document and try again.\");\n }\n}", "title": "" }, { "docid": "3aba0ea573b741d6c9595831c4dbd45e", "score": "0.58564097", "text": "function winText() {\n\tthis.x = 50;\n\tthis.y = 50;\n\tthis.dx = 0.75;\n\tthis.dy = 0.75;\n}", "title": "" }, { "docid": "de6587eecf38692a358a2b654d9bfbc2", "score": "0.5851111", "text": "setTopText(text) {\n\t\tBattleGUI.setTopText(text)\n\t}", "title": "" }, { "docid": "e94932d65fb3f4a2fb30da89bea590ce", "score": "0.5833219", "text": "function showNewText(text) {\n firstText.innerHTML = `${text}`;\n gsap.to(\".goz-text-relative\", {\n duration: 0.3,\n opacity: 1\n });\n}", "title": "" }, { "docid": "be1a83b25a0a9709ec7379268dfcd1e9", "score": "0.5794668", "text": "function mostrar1() {\n for (var n = 0; n < frameCount; n++){\n rojas[n].display();\n }\n\n// Palabra en grande en el centro\n fill(150);\n textAlign(CENTER);\n var r = random(20, 60);\n textSize(r);\n text(rojas[frameCount-1].word, windowWidth/2, windowHeight/2); \n textSize(18);\n textAlign(LEFT);\n}", "title": "" }, { "docid": "57fa494a39970da068afceec7acf1973", "score": "0.5789187", "text": "function setUpText() {\n // textImg = createGraphics(760, 500);\n textImg = createGraphics(width, height);\n textImg.pixelDensity(1);\n textImg.background(255);\n textImg.textFont(font);\n textImg.textSize(fontSize);\n textImg.textAlign(CENTER, CENTER);\n textImg.text(type, width / 2, height / 4 + fontSize / 4);\n textImg.loadPixels();\n}", "title": "" }, { "docid": "aecc270fb2d5e7572e73eacbde29f4f7", "score": "0.57723075", "text": "function addFrame() {\n if (!populated) {\n var prefixTextNode = document.createTextNode('<table styleclass=\" style_BlockMargin\" style=\"border: 1px none #fbfaf8; margin-bottom: 5px;\" id=\"textEdit\" border=\"0\" cellpadding=\"10\" cellspacing=\"1\" width=\"100%\"><tbody><tr><td style=\"color: #000000;\"><div>');\n document.getElementById('prefix').appendChild(prefixTextNode);\n var suffixTextNode = document.createTextNode('</div></td></tr></tbody></table>');\n document.getElementById('suffix').appendChild(suffixTextNode);\n //document.getElementById('input').setAttribute('class', 'dividerLine');\n document.getElementById('explainer').setAttribute('class', 'removed');\n populated = 1;\n }\n }", "title": "" }, { "docid": "26a2fa36f9a182721079a2ae3f15086b", "score": "0.57707226", "text": "displayCurrentQuestion(){\n if(this.displayText){\n this.displayText.setText('');\n } else {\n this.displayText = this.scene.add.text().setFont('40px Arial').setFill('#ffff00');\n this.displayText.y =50;\n }\n\n this.displayText.setText(this.currentQuestion.display);\n \n this.displayText.x = (getGameWidth() - this.displayText.width)/2;\n\n }", "title": "" }, { "docid": "ef2eea592aeec883339d24092f3b25a5", "score": "0.5744919", "text": "function setText() {\n\n\t\t\tvar textString = conf.text,\n\t\t\t\tfontSize = Math.min((conf.width / textString.length) * 1.4, conf.height * 0.3),\n\t\t\t\ttextWidth,\n\t\t\t\tx,\n\t\t\t\ty\n\n\t\t\tctx.fillStyle = 'rgba(0,0,0,0.7)'\n\t\t\tctx.font = fontSize + \"px Arial\"\n\n\t\t\ttextWidth = ctx.measureText(textString).width\n\n\t\t\tx = (conf.width - textWidth) / 2\n\t\t\tif (conf.size)\n\t\t\t\ty = conf.height / 2 + fontSize / 2\n\t\t\telse\n\t\t\t\ty = conf.height / 2\n\n\t\t\tctx.textBaseline = \"middle\"\n\t\t\tctx.fillText(textString, x, y)\n\t\t}", "title": "" }, { "docid": "caf04754e35fc8e9e473c6c8bb249b0e", "score": "0.5720954", "text": "place_text (text, args) {\n let [x, y, value] = this . positions (args);\n\n let rect_size = this . rect_size;\n\n let plain = this . board . plain (text)\n . attr ({x: x * rect_size,\n y: y * rect_size});\n\n if (\"id\" in args) {\n plain . id (args . id);\n }\n if (\"class\" in args) {\n plain . addClass (args . class);\n }\n\n return plain;\n }", "title": "" }, { "docid": "731dc5c31da7070bf64c27d287cd156b", "score": "0.57198036", "text": "function createTextFrame(string, format, y1, x1, y2, x2) {\n //$.writeln(myDocument);\n var myFrame = myDocument.textFrames.add(myLayer, undefined, undefined, {\n geometricBounds: [y1, x1, y2, x2],\n contents: string\n });\n\n // apply paragraph style\n myFrame.texts[0].appliedParagraphStyle = format;\n\n // fit frame to content\n myFrame.fit(FitOptions.FRAME_TO_CONTENT);\n\n //myFrame.resolve(AnchorPoint.CENTER_ANCHOR, CoordinateSpaces.INNER_COORDINATES);\n}", "title": "" }, { "docid": "3377e346c9bd1ae31706a38f8b72e2d1", "score": "0.57182336", "text": "function setContent() {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tvar _cnt = $(getIframeContent()).html();\r\n\t\t\t\t\t\t$textObject.css(\"color\", _color).html(_cnt);\r\n\t\t\t\t\t\t_selfDrawing.bindEventsToCanvasObjects($textObject);\r\n\t\t\t\t\t\t_selfCanvas.resizeCanvas();\r\n\t\t\t\t\t} catch(error) {\r\n\t\t\t\t\t\tG_debug(\"Couldn't get content from rte: \" + error);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcloseRTE();\r\n\t\t\t\t}", "title": "" }, { "docid": "45c89fb0a94cb37bb8cc9d37b0e955bf", "score": "0.5695913", "text": "function initText() {\n const text = \"December Snow\";\n let fontsize = config.maxX / 10;\n let width = 0;\n // try to get the width of the text to be 90% of the width of the screen\n while (width < config.maxX * 0.9) {\n config.ctx.font = \"bold \" + fontsize + \"px serif\";\n width = config.ctx.measureText(text).width;\n fontsize += 5;\n }\n\n config.ctx.fillStyle = \"#964219\";\n config.ctx.textBaseline = \"top\";\n config.ctx.textAlign = \"center\";\n config.ctx.fillText(text, config.maxX / 2, config.maxY * 0.2);\n}", "title": "" }, { "docid": "a90ca40d587c409fcf409e07e1fb44b8", "score": "0.5675701", "text": "function setStartText(){\n mainContainer.innerHTML=\"<div class='spreeaftwrap'><span class='spreeText' style='margin-left:-50px'>Spree...</span></div>\"\n }", "title": "" }, { "docid": "3ca6bd4eb3ea9d8546e0be78a66aa2bf", "score": "0.56743765", "text": "function draw() {\n text_ctx.clearRect(0, 0, text_canvas.width, text_canvas.height);\n for (var i = 0; i < texts.length; i++) {\n var text = texts[i];\n text_ctx.fillText(text.text, text.x, text.y);\n }\n}", "title": "" }, { "docid": "11638745f40f3f7c5a18d47f203e8f99", "score": "0.56694883", "text": "show() {\n\t\tthis.bounds.show();\n\t\ttextSize(this.textSize);\n\t\tfill(0);\n\t\ttext(this.text, this.bounds.pos.x + 10, this.bounds.pos.y + this.bounds.scale.x / 4);\n\t}", "title": "" }, { "docid": "9d8b3aa43bfed5f46639570840459a2b", "score": "0.56654245", "text": "function showNewText(text) {\n firstText.innerHTML = `${text}`;\n gsap.to(\".m402-text-relative\", {\n duration: 0.3,\n opacity: 1\n });\n}", "title": "" }, { "docid": "8e5f1b2a3316ed79288521cfde1e4add", "score": "0.56554604", "text": "display() {\n push();\n fill(0);\n textSize(40);\n text(this.scoreP1, 150, 80);\n text(this.scoreP2, 350, 80);\n text(this.scoreP3, 550, 80);\n text(this.p1Name, 100, 40);\n text(this.p2Name, 300, 40);\n text(this.p3Name, 500, 40);\n pop();\n }", "title": "" }, { "docid": "2bc2e35c7e5f78ec87e12678d0c3a24d", "score": "0.56532115", "text": "function updateInText() {\r\n\t\tvar text = $item.attr(\"title\");\r\n\t\tif (typeof text == \"undefined\" || text == \"\") {\r\n\t\t\ttext = $item.data(\"text\");\r\n\t\t}\r\n\t\t\r\n\t\tif (text && text != \"\") {\r\n\t\t\t$inTextPanel.find(\">.inner-text\").html(text);\r\n\t\t\t$inTextPanel.stop().css(\"top\", $innerBox.height()).show().animate({top:$innerBox.height() - $inTextPanel.height()}, \"normal\");\r\n\t\t}\t\t\t\t\r\n\t}", "title": "" }, { "docid": "c83bd0c03ceabf1d50312afce207c4ba", "score": "0.5649088", "text": "function startText () {\n normalMaterial();\n texture(startTextImage);\n push();\n plane(500,105);\n pop();\n }", "title": "" }, { "docid": "061032b74296d331480102c94c5ddbc4", "score": "0.5643456", "text": "show() {\n\t\tthis.bounds.show();\n\t\ttextSize(this.textSize);\n\t\tfill(0);\n\t\ttext(this.text, this.bounds.pos.x + 10, this.bounds.pos.y + this.bounds.scale.y / 2);\n\t}", "title": "" }, { "docid": "d6ed72ee22bcef1028eee07b2450787c", "score": "0.5623873", "text": "function render() {\n\t\t\n\t\t// position bottom-right corner of text at 600,400\t\n\t\tx = 600;\n\t\ty = 400;\n\t\tctx.textAlign = \"right\";\n\t\tctx.textBaseline = \"bottom\";\n\t\tcolor = \"#D18EA9\";\n\t\tmakeText(\"Here is some text.\");\n\t\t\n\t\t// position top-left corner of text at 0,0\t\n\t\tx = 0;\n\t\ty = 0;\n\t\tctx.textAlign = \"left\";\n\t\tctx.textBaseline = \"top\";\n\t\tcolor = \"#7ADEDC\";\n\t\tmakeText(\"The sky is blue.\");\n\t\t\n\t} // close render() function", "title": "" }, { "docid": "d888c1787659cdf6e64147bff258569f", "score": "0.5619206", "text": "function onAddTxt() {\n addTxt()\n onChangeTxtIdx()\n drawText()\n}", "title": "" }, { "docid": "0c16e918e3eaf968e893cba5f41ce153", "score": "0.5609003", "text": "function handleTextDisplay() {\n\t//only do if things in the queue\n\tif (text_queue.length > 0) {\n\t\tdrawCharacterText();\n\n\t\t//choosing text\n\t\tif ((loading_state instanceof State_World && loading_state.substate == 0) || loading_state.constructor.name == \"State_Menu\" || loading_state.constructor.name == \"State_Map\") {\n\t\t\ttext_time -= 1;\n\t\t\tif (loading_state.constructor.name == \"State_Menu\") {\n\t\t\t\ttext_time -= 2;\n\t\t\t}\n\t\t\tif (text_time <= 0) {\n\t\t\t\ttext_time = text_timeMax;\n\t\t\t\ttext_queue.splice(0, 1);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4528aecd3e7a6e3f9bc2cbd51203f462", "score": "0.5598833", "text": "function setTextFrameAttributes(tFrame) {\r\t// Extract the metadata constituent\r\tvar tProps = getMetadata(tFrame.name, true);\r\t// Overwrite props on the element\r\t// Position (seems to work better than 'anchor')\r\tvar position = tFrame.position;\r\t// Fill (from name)\r\tvar fill = tProps.fill;\r\tvar colObj = makeCmykColourObject(fill);\r\ttFrame.textRange.characterAttributes.fillColor = colObj;\r\t// Does text overprint? Look it up the fill name in the list...\r\tvar overprint = c_textOverprint.search(fill) >= 0;\r\ttFrame.textRange.characterAttributes.overprintFill = overprint;\r\t// Justification: default is 'end' / RIGHT\r\t// Careful: width comes in as a string...\r\tvar xTweak = parseFloat(tProps.width);\r\tvar just = Justification.RIGHT;\r\tswitch (tProps.justification) {\r\t\tcase 'start' :\r\t\t\tjust=Justification.LEFT;\r\t\t\txTweak = 0;;\r\t\t\tbreak;\r\t\tcase 'center' :\r\t\t\tjust=Justification.CENTER;\r\t\t\txTweak /= 2;\r\t\t\tbreak;\r\t\tcase 'middle' :\r\t\t\tjust=Justification.CENTER;\r\t\t\txTweak /= 2;\r\t\t\tbreak;\r\t\tdefault :\r\t\t\tjust=Justification.RIGHT;\r\t}\r\tposition[0] = position[0] + xTweak;\r\ttFrame.position = position;\r\ttFrame.textRange.justification = just;\r\t// And ID...\r\ttFrame.name = tProps.name;\r}", "title": "" }, { "docid": "6bf7bd62e9f794a2b174a717bbceb256", "score": "0.5591201", "text": "function main () {\r\nif (app.documents.length > 0) {\r\n\r\n var idoc = app.activeDocument;\r\n var sel = idoc.selection;\r\n if (sel.length>1) {\r\n var width = prompt (\"Enter desired Text Block width including Units\", '300 pt', \"Text Block\"); // \r\n if (width!=null) { // quit if pressed Cancel\r\n var widthUV = new UnitValue(width);\r\n if (widthUV.type=='?') {alert('Units were not provided, try again...'); return}\r\n var widthPts = widthUV.as (\"pt\") // convert to points\r\n \r\n var spacing = prompt (\"Enter spacing including Units\", '3 mm', \"Text Block\"); // text lines spacing in mm\r\n \r\n var spcingUV = new UnitValue(spacing);\r\n if (spcingUV.type=='?') {alert('Units were not provided, try again...'); return}\r\n var spacingPts = spcingUV.as (\"pt\") // convert to points\r\n \r\n var dupLayer = idoc.layers.add(); // add a layer to place the new block of text\r\n dupLayer.name = \"Text Block\";\r\n var blockGrp = dupLayer.groupItems.add(); // add a group to final output\r\n blockGrp.name = \"Text Block\";\r\n \r\n var left = 0; //idoc.width/3; // place block at the bottom 3rd of the page\r\n var top = 0; //-idoc.height/3\r\n\r\n for (i=0; i<sel.length; i++) { // loop thru selection\r\n if (sel[i].typename == \"TextFrame\") { // continue if textFrame, ignore other pageItems\r\n var tf=sel[i];\r\n var itext = tf.duplicate(blockGrp, ElementPlacement.PLACEATEND); // duplicate text\r\n itext.selected = false; // deselect it\r\n grpName = itext.contents; // get contents to name outline group\r\n var ioutlined = itext.createOutline(); // create outlines\r\n ioutlined.name = grpName; // rename group\r\n \r\n var perCent = widthPts/ioutlined.width*100; // get scaling percentage, based on desired width of block\r\n var scaleMatrix = app.getScaleMatrix(perCent, perCent);\r\n ioutlined.transform (scaleMatrix); // scale outlined text\r\n \r\n ioutlined.left = left; // position text\r\n ioutlined.top = top+ioutlined.height+spacingPts; // top = previous item top + spacing + current item\r\n top = ioutlined.top // get current top to use on next item\r\n } // end if - non text frames\r\n } // end for loop - selection\r\n blockGrp.position = [tf.left+tf.width+40, tf.top+20];\r\n } // end check prompt for calcel\r\n } // end if selection > 1\r\n else {\r\n alert (\"Select at least 2 Point Text Frames before running\");\t\t\t\t\r\n }\r\n} // end at least one document\r\nelse {\r\n alert (\"There are no open documents\");\r\n}\r\n} // end main", "title": "" }, { "docid": "163fd8961d3e86672b8ef59ef0367baf", "score": "0.5582972", "text": "function showNewText(text){\n firstText.innerHTML=`${text}`;\n gsap.to(\".meydan-text-relative\",\n {\n duration:0.3,\n opacity:1\n });\n}", "title": "" }, { "docid": "c0f5da438a2c697dec25add05c951bdb", "score": "0.5579413", "text": "function setupText() {\n textImg = createGraphics(width, height);\n textImg.pixelDensity(1);\n textImg.background(255);\n textImg.fill(0);\n textImg.textSize(fontSize);\n textImg.textAlign(CENTER, CENTER);\n textImg.textFont(\"Roboto\");\n textImg.text(textTyped, width/2 , (3*height)/5);\n textImg.loadPixels();\n}", "title": "" }, { "docid": "21cde6b3343dea92ece41e173ae33bc2", "score": "0.5577241", "text": "function onRun(context) {\n var doc = context.document\n\n // Add new page\n var newPage = doc.addBlankPage()\n newPage.setName(\"All Fonts\")\n\n // Get available fonts\n var fm = NSFontManager.sharedFontManager()\n var availableFonts = fm.availableFonts()\n\n // Add new artboard\n var artboard = [MSArtboardGroup new]\n artboard.frame().setWidth(5800)\n artboard.frame().setHeight(availableFonts.count() * 207)\n newPage.addLayers_([artboard])\n var textOffsetX = 600\n var textOffsety = 1200\n\n // Display number of fonts\n var titleLayer = MSTextLayer.alloc().initWithFrame_(NSMakeRect(0, 0, 100, 100))\n var fontCountLayer = MSTextLayer.alloc().initWithFrame_(NSMakeRect(0, 0, 100, 100))\n var titleFontSize = 200\n var titleFont = [NSFont fontWithName: \"HelveticaNeue-Bold\"\n size: titleFontSize\n ]\n var fontCountFont = [NSFont fontWithName: \"HelveticaNeue-Thin\"\n size: titleFontSize\n ]\n titleLayer.setName(\"title\")\n titleLayer.stringValue = \"ALL FONTS\"\n titleLayer.frame().setY(-470 + textOffsety)\n titleLayer.frame().setX(textOffsetX)\n titleLayer.font = titleFont\n\n fontCountLayer.setName(\"font count\")\n fontCountLayer.stringValue = \"FONT COUNT: \" + availableFonts.count().toString()\n fontCountLayer.frame().setY(-310 + textOffsety)\n fontCountLayer.frame().setX(textOffsetX)\n fontCountLayer.font = fontCountFont\n artboard.addLayers_([titleLayer, fontCountLayer])\n\n // Create label font\n var labelFont = [NSFont fontWithName: \"HelveticaNeue-Bold\"\n size: 25\n ]\n\n for (var i = 0; i < availableFonts.count(); i++) {\n var fontStr = availableFonts[i]\n var currentFont = [NSFont fontWithName: fontStr size: 75]\n var labelLayer = MSTextLayer.alloc().initWithFrame_(NSMakeRect(0, 0, 100, 100))\n var textLayer = MSTextLayer.alloc().initWithFrame_(NSMakeRect(0, 0, 100, 100))\n textLayer.font = currentFont\n textLayer.stringValue = \"The quick brown fox jumped over the lazy dog\"\n textLayer.adjustFrameToFit()\n\n labelLayer.font = labelFont\n labelLayer.stringValue = currentFont.fontName().toString()\n labelLayer.setName(currentFont.fontName().toString())\n labelLayer.adjustFrameToFit()\n\n // Adjust positions\n var yOffset = 200\n labelLayer.frame().setY(i * yOffset + textOffsety)\n labelLayer.frame().setX(textOffsetX)\n textLayer.frame().setY(i * yOffset + 40 + textOffsety)\n textLayer.frame().setX(textOffsetX)\n\n artboard.addLayers_([labelLayer, textLayer])\n }\n}", "title": "" }, { "docid": "dd691b3b8487df994454b349c28395c7", "score": "0.55756974", "text": "function testing() {\n\t\n // TEXT\n\tcxa.globalAlpha = 1;\n\tcxa.textAlign = 'center';\n\tcxa.fillStyle = \"#fff\";\n\tcxa.font = \"20px PT Sans\";\n\t//cxa.fillText( unitOne , halfX, 130);\n\t//cxa.fillText( stageDrag, halfX, 80);\n\t//cxa.fillText( test3, halfX, 110);\n\t\n}", "title": "" }, { "docid": "2dc8a27ae38a8fc7f8205fee9d134b8d", "score": "0.557252", "text": "setText(text) {\n\t\tif(!text || !text.split) return;\n\t\tif (this.timedEvent) this.timedEvent.remove();\n\n\t\tthis.display(true);\n\t\tconst charArray = text.split('');\n\t\t\n\t\tthis.graphics.text.setText('');\n\t\t\n\t\tthis.timedEvent = this.scene.time.addEvent({\n\t\t\tdelay: 150 - (this.dialogSpeed * 30),\n\t\t\tcallback: (charArray)=>{\n\t\t\t\tthis.graphics.text.setText(this.graphics.text.text + charArray[this.graphics.text.text.length]);\n\t\t\t\tif (this.graphics.text.text.length === charArray.length) {\n\t\t\t\t\tthis.timedEvent.remove();\n\t\t\t\t}\n\t\t\t},\n\t\t\targs: [charArray],\n\t\t\tcallbackScope: this,\n\t\t\tloop: true\n\t\t});\n\t}", "title": "" }, { "docid": "9e080701fd800e4757ab22dac6b74151", "score": "0.5564007", "text": "addTexts(){\n var startingMessage = (game.singleplayer || game.vsAi) ? \"Current Turn: X\" : \"Searching for Opponent\"\n\n game.turnStatusText = game.add.text(\n game.world.centerX, 50, startingMessage,\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.turnStatusText.anchor.setTo(0.5, 0.5)\n game.turnStatusText.key = 'text'\n\n game.playerPieceText = game.add.text(\n game.world.centerX, game.screenHeight-50, '',\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.playerPieceText .anchor.setTo(0.5, 0.5)\n game.playerPieceText.key = 'text'\n\n\n\n }", "title": "" }, { "docid": "588ca7823f1a0ea2663c3d2675ebe0e1", "score": "0.5560427", "text": "function addTextObj() {\n\n controls = new createjs.Text(\"Use the Left and Right Arrow Keys to Move\", \"30px Feast of Flesh BB\", \"#FFFFFF\");\n controls.x = 150;\n controls.y = 10;\n stage.addChild(controls);\n\n controls2 = new createjs.Text(\"Use the Spacebar to Ollie\", \"30px Feast of Flesh BB\", \"#FFFFFF\");\n controls2.x = 250;\n controls2.y = 50;\n stage.addChild(controls2);\n}", "title": "" }, { "docid": "7183bee60621685cec7a32de51bffb38", "score": "0.55519265", "text": "onTextPrint(text, settings) {\n this.pushHistory();\n\t\tconst ctx = this.layer.getContext('2d');\n\t\tctx.font = settings.size + 'px arial';\n\t\tctx.fillStyle = settings.color;\n\t\tctx.fillText(text, settings.x, settings.y);\n\t}", "title": "" }, { "docid": "37f2eaa234f0cf284e51d24fe040b1a3", "score": "0.5545122", "text": "function guiText(p) {\n p.textFont(comicBoldFont);\n p.textSize(24);\n p.fill(\"white\");\n p.text(\"Lancer du Marteau\", -640, -610);\n p.textSize(18);\n p.text(\"JML 2021\", -630, -580);\n p.text(\n \"Vitesse de rotation (dynamique) : \" +\n sliderAngularSpeed.value().toFixed(1),\n -630,\n -550\n );\n p.text(\"Poids (statique) : \" + sliderWeight.value().toFixed(1), -630, -485);\n}", "title": "" }, { "docid": "952f52ef7620dbaf13bfa39115ea99c4", "score": "0.55413836", "text": "function loopOverText(text, rows, columns) {\n var coordinates = createMap(marginWidth, marginHeight, rows, columns);\n //$.writeln(coordinates);\n\n // loop over text char by char\n for (var i = 0; i < text.length; i++) {\n if (i < coordinates.length) {\n //$.write(text.charAt(i));\n //$.write(' : ');\n //$.writeln(coordinates[i]);\n\n createTextFrame(\n text.charAt(i),\n paragraphStyle,\n coordinates[i][1],\n coordinates[i][0],\n coordinates[i][1] + 20,\n coordinates[i][0] + 20\n );\n\n /*myDocument.ovals.add(myLayer, undefined, undefined, {\n geometricBounds: [coordinates[i][1] - 5, coordinates[i][0] - 5, coordinates[i][1] + 10, coordinates[i][0] + 10],\n fill: \"Black\"\n });*/\n }\n }\n}", "title": "" }, { "docid": "7e0f1b830ad5c2d8b3209f142c2ebf7d", "score": "0.55244404", "text": "function drawWinText(context, winText) {\n\tclear(context);\n\tdrawText(context, winText.x+5, winText.y);\n}", "title": "" }, { "docid": "ab8d5e872dcc3d917e9cfc7ef10fdfec", "score": "0.5520411", "text": "function start(){\n //Set text to a new variable Text with \"\" as the argument\n \n //Set the text position to 0 and the top of text\n \n //Add the text\n \n /*Add a move mouse method with your move \n function as an argument*/\n}", "title": "" }, { "docid": "6239284aa7b0dbc256c6e59824b60d61", "score": "0.55184954", "text": "function showText(){\n var wordCount = texts[textIdx].match(/\\s/g).length + 1;\n var charCount = texts[textIdx].length;\n document.getElementById(\"text_name\").innerHTML = names[textIdx];\n document.getElementById(\"text_author\").innerHTML = authors[textIdx] + \" (\" + wordCount + \" words, \" + charCount + \" characters)\";\n formatText();\n}", "title": "" }, { "docid": "c321c6cf50b6f0713b5ac0d30d408601", "score": "0.55184466", "text": "function displayStartMessage() {\n push();\n textFont(\"Courier\");\n textAlign(CENTER);\n textSize(25);\n text(\"Click to begin your intergalactic journey!\", width / 2, height / 3);\n pop();\n}", "title": "" }, { "docid": "6c06821f4159f79f4ccdff54fc0c5b2c", "score": "0.5517765", "text": "function displayPosition() {\n\t// clear blanks and <br>\n\tvar writtenBy = document.getElementsByClassName(\"writtenBy-\" + uidKey);\n\tfor (var i = 0; i < writtenBy.length; i++) {\n\t\tif (writtenBy[i].childNodes[0].tagName === \"BR\") {\n\t\t\twrittenBy[i].style.borderLeft = \"none\";\n\t\t}\n\t}\n\n\t// set color id\n\tvar colorCont = document.getElementById(\"livemember-\" + uidKey).style.border.split(\" \");\n\tvar color = colorCont[2] + colorCont[3] + colorCont[4];\n\n\t// set indicator\n\tif (currentText.innerHTML != \"<br>\") {\n\t\tcurrentText.classList.add(\"writtenBy-\" + uidKey);\n\t\tcurrentText.style.borderLeft = \"1px solid \" + color;\n\t\tcurrentText.style.paddingLeft = \"5px\";\n\t}\n\n\t// clear blanks and childs for smooth transition\n\tfor (var i = 0; i < writtenBy.length; i++) {\n\t\tif (writtenBy[i].childNodes[0].tagName === \"BR\") {\n\t\t\twrittenBy[i].style.borderLeft = \"none\";\n\t\t}\n\n\t\tif (writtenBy[i].parentElement.tagName != \"DIV\") {\n\t\t\tcurrentText.style.borderLeft = \"none\";\n\t\t\tcurrentText.style.paddingLeft = \"0px\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "38b77074b06fe9a6d7139d7faa77da37", "score": "0.5501785", "text": "function startTextAnimation() {\n\t\tbreath.animateText();\n\t}", "title": "" }, { "docid": "ad912a4b215bb4660db676ecd5412b46", "score": "0.55016834", "text": "render() {\n if (!this._active) return;\n\n const data = this.sceneData;\n const keys = Object.keys(data);\n\n this.textElements.forEach((element, index) => {\n const key = keys[index];\n element.textContent = `${key}: ${data[key]}`;\n });\n }", "title": "" }, { "docid": "02fe5e6ea43d0dcec513302b85894202", "score": "0.55003405", "text": "function notifyResize() {\n //\n // Figure out the positioning of the text elements\n textObjects.height = Demo.renderer.core.measureTextHeight(textObjects);\n textTested.height = Demo.renderer.core.measureTextHeight(textTested);\n textVisible.height = Demo.renderer.core.measureTextHeight(textVisible);\n textCriteria.height = Demo.renderer.core.measureTextHeight(textCriteria);\n\n textTested.position.y = textObjects.position.y + textObjects.height + 0.01;\n textVisible.position.y = textTested.position.y + textTested.height + 0.01;\n textCriteria.position.y = textVisible.position.y + textVisible.height + 0.01;\n }", "title": "" }, { "docid": "59761076205e30ebf639b3401df2adc6", "score": "0.5497261", "text": "function setText(name,textX,textY){ \n\t\tvar text = new createjs.Text();\n\t\ttext.x=textX;\n\t\ttext.y=textY;\n\t\ttext.textBaseline=\"alphabetic\";\n\t\ttext.name=name;\n\t\ttext.font =\"1.8em digiface\";\n\t\ttext.color=\"#000000\";\n\t\tclockContainer.addChild(text);\n\t}", "title": "" }, { "docid": "ab1d1db67d7e6a669afc205522b2fc5a", "score": "0.54970926", "text": "textFX() {\n\t\tconst winPos = window.scrollY;\n\t\tconst winCenter = window.outerHeight / 3; \n\t\tconst winPC = window.scrollY + winCenter;\n\t\tconst tsRef = this.tsRef.current.childNodes;\n\t\tconst winThresh = winPos + (window.outerHeight * 0.66666);\n\n\t\tArray.from(tsRef).map(box => {\n\t\t\tbox.style.textShadow = `2px ${Math.min(8, Math.max(-8, ((winPos) - (box.offsetParent.offsetTop - winCenter)) * 0.015))}px 3px rgba(0,0,0,0.3)`;\n\t\t\tif(winThresh > box.offsetParent.offsetTop && this.props.role == \"heading\") {\n\t\t\t\tbox.classList.add(\"vroom\");\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "530174a48e7e259a50684ca88237404c", "score": "0.54966336", "text": "function updateText(){\n\t$('#mainText').text(arrStationName[currStation]);\n\tmainTextLink = arrStationLink[currStation];\n\tmainImg.src = arrImageURL[currStation];\n\tmainImg.alt = arrStationName[currStation];\n}", "title": "" }, { "docid": "b444b973b074e073441e3383fdedb67f", "score": "0.5492571", "text": "function manipulateHTML(){\n\n\t//move + fill timeline\n\ttimeline();\n\n\t//changes margin of the left and righttext (voidText: \"element_id, left (boolean), right(boolean)\")\n\tvoidText(\"#quote2-left\", true, false)\n\tvoidText(\"#quote2-right\", false, true)\n\n\t//triggers animation when element is reaching a specific position\n\tvar visibility_height = 200 + window.innerHeight*0.3;\n\tvar total_padding = window.innerHeight-visibility_height\n\t//--> selector, space top, space bot, EnteranimationClassName, leave_animationClassname\n\ttriggerClassAnimation('timeline-section', total_padding*0.5, total_padding*0.5, \" animate\", \"animate-back\")\n\ttriggerClassAnimation('author', total_padding*0.5, total_padding*0.5, \"appear\", \"animate-back\")\n}", "title": "" }, { "docid": "7d33704a64960314957f7967ae3a00c8", "score": "0.54805434", "text": "function initialiseAlertText() {\n alertText = currentScene.add.text(currentScene.cameras.main.centerX,\n currentScene.cameras.main.centerY,\n \"\", {\n fontFamily: '\"Press Start 2P\"',\n fontSize: '24px',\n fill: \"yellow\"\n }\n ).setOrigin(0.5);\n}", "title": "" }, { "docid": "13f6cd74707d6b13be5ef18e248bec68", "score": "0.54655087", "text": "displayQuestion() {\n push();\n textAlign(CENTER);\n textSize(this.question);\n textStyle(ITALIC);\n textSize(this.questionTextSize);\n fill(\n this.questionFontFill.r,\n this.questionFontFill.g,\n this.questionFontFill.b\n );\n text(this.questionString, this.questionPositionX, this.questionPositionY);\n pop();\n }", "title": "" }, { "docid": "85df70b7929a85a654bd35012c0a5916", "score": "0.5442504", "text": "function renderHTML(textObject){\n for(var i = 0; i < textObject.length; i++){\n var htmlText = textObject[i].name + \"<br>\"; \n engInfo.insertAdjacentHTML(\"beforeend\", htmlText); \n }\n}", "title": "" }, { "docid": "62c0cb5a94b1d786e5414fec8ef91901", "score": "0.54402804", "text": "function QutubhText1() {\n fill('#4ebd77');\n rect(542, 452, 230, 79);\n fill('white');\n noStroke();\n textSize(12);\n textFont('courier');\n text('The Alai Darwaza is the main', 556, 475);\n text(' gateway from southern side', 555, 495);\n text(' of the Quwwat-ul-Islam Mosque', 545, 515);\n\n}", "title": "" }, { "docid": "e49aeca1120513f6acd1849584a8e9d0", "score": "0.5439873", "text": "function setup() {\n createCanvas(windowWidth, windowHeight); \n // ^ the height and width of whatever device you're using\n textFont(typewriter, 45); \n // ^ initialize the font\n textAlign(LEFT);\n}", "title": "" }, { "docid": "125abb6b5451c5b4d1de6f7bd14cd957", "score": "0.5438502", "text": "function makeNewTextFrame(oFrame, newGroup) {\r\tvar anchorX = oFrame.anchor[0];\r var anchorY = oFrame.anchor[1];\r\t// Extract the metadata constituent\r\tvar tProps = getMetadata(oFrame.name, true);\r\t// Now work out xPos from width and justification\r\tvar width = parseFloat(tProps.width);\r\tvar just = tProps.justification;\r\tif (just === 'middle' || just === 'center') {\r\t\tanchorX += width / 2;\r\t} else if (just === 'end') {\r\t\tanchorX += width;\r\t}\r var contents = oFrame.contents;\r var contentsArray = [{\r contents: contents,\r textFont: oFrame.textRange.characterAttributes.textFont,\r newline: false\r }];\r // Extract properties from original frame\r var textProps = {\r context: oFrame.parent,\r anchor: [anchorX, anchorY],\r fill: makeCmykColourObject(tProps.fill),\r font: oFrame.textRange.characterAttributes.textFont,\r size: oFrame.textRange.characters[0].size,\r tracking: oFrame.textRange.characterAttributes.tracking,\r leading: parseFloat(tProps.leading),\r justification: just,\r name: tProps.name,\r contents: contents,\r contentsArray: contentsArray\r };\r var newText = makeText(textProps);\r newText.move(newGroup, ElementPlacement.PLACEATBEGINNING);\r}", "title": "" }, { "docid": "be651a6f78379073f96bb477a879c56e", "score": "0.54358774", "text": "function makeUI() {\r\n var style = { font: \"20px Arial\", fill: \"#ff0044\", align: \"center\", fontWeight: \"bolder\" };\r\n var t = game.add.text(0, 10, level+\" - \"+title, style);\r\n }", "title": "" }, { "docid": "af81e09b7179836c7ff05b103fe2f351", "score": "0.5434617", "text": "function displayText(text) {\n console.log(text);\n }", "title": "" }, { "docid": "e935fc80199657121195596af7219038", "score": "0.5433508", "text": "function tableText(l,x,y,s,sz,fname,sw,sc,fc) {\n if (jb.chattr == null) {\n alert('jb.chattr is being used before it has been set!');\n return;\n }\n var t = l.textFrames.add();\n\n t.contents = s;\n t.textRange.characterAttributes = jb.chattr;\n t.textRange.characterAttributes.size = sz;\n t.textRange.characterAttributes.strokeWeight = sw;\n if (sw > 0 && sc != null) {\n t.textRange.characterAttributes.strokeColor = sc;\n }\n if (fc != null) {\n t.textRange.characterAttributes.fillColor = fc;\n }\n\n var font = app.textFonts.getByName(fname);\n if (font != null) {\n t.textRange.characterAttributes.textFont = font;\n }\n\n // alert(\"x,y = \" + x + ', ' + y);\n t.textRange.justification = Justification.LEFT;\n t.position = [x,y];\n}", "title": "" }, { "docid": "be0957955dff088553292b15d64e7347", "score": "0.5426048", "text": "function makeText(text) {\n\t\tctx.beginPath();\n\t\tctx.fillStyle = color;\n\t\tctx.font = \"800 48px Stint Ultra Expanded\"; \n\t\t// this Google font is loaded in the HEAD on the HTML\n\t\tctx.fillText( text, x, y );\n\t\tctx.closePath();\n\t}", "title": "" }, { "docid": "c6d6d9f2acaecc725c448ae9a17add78", "score": "0.5425913", "text": "onAdd() {\n this.text.add(this);\n this.attr({\n // Alignment is available now (#3295, 0 not rendered if given\n // as a value)\n text: pick(this.textStr, ''),\n x: this.x || 0,\n y: this.y || 0\n });\n if (this.box && defined(this.anchorX)) {\n this.attr({\n anchorX: this.anchorX,\n anchorY: this.anchorY\n });\n }\n }", "title": "" }, { "docid": "075bd028ef2aa3c253669b2b595719f5", "score": "0.5421485", "text": "setText(horizontalAlignment, verticalAligment, content, x, y, fontFamily = 'Monospace', fontSize = 24, fontColor = 'white') {\r\n\t\ttextFont(fontFamily);\r\n\t\ttextSize(fontSize);\r\n\t\tfill(fontColor);\r\n\t\ttextAlign(horizontalAlignment, verticalAligment);\r\n\t\ttext(content, x, y);\r\n\t}", "title": "" }, { "docid": "c380a96051f5192b54d569ae85445657", "score": "0.5416871", "text": "function startTextAnimation() {\n var tlText = new TimelineMax();\n\n tlText.from('.hero__title', 1.5, {\n y: -100,\n opacity: 0\n }).from('.hero__text', 0.8, {\n y: -50,\n opacity: 0\n }).from('.button--bee-trigger', 0.8, {\n y: -20,\n opacity: 0\n });\n }", "title": "" }, { "docid": "e786de2e302f2a151dd05803917bd5f0", "score": "0.54077923", "text": "drawTitle(x, y, size) {\n // console.log(x + \":\" + y + \":\" + size);\n /* push all my settings */\n push();\n /* Setting the fontSize */\n textSize(size);\n /* Setting style to Georgia because it looks good */\n textFont('Georgia');\n /* Translate back to 0,0 (so the top left corner is the (0,0) coordinate) */\n translate(0, 0);\n /* Set my textAlign to the left so they get lined up correctly */\n textAlign(CENTER);\n /* Drawing 'AI' in the left top corner of the screen */\n text('LogicAI', x, y);\n /* popping all my settings so other functions dont have to deal with them */\n pop();\n }", "title": "" }, { "docid": "2dab18d4454e26306e79eef224d7b6e9", "score": "0.5405305", "text": "enterJsx_text(ctx) {\n\t}", "title": "" }, { "docid": "4498527f95a2bb60bef1a956b504cf96", "score": "0.53904366", "text": "function showText(parentDiv,divName,topPos,leftPos,numText){ //flatTxt o for text 1 for image\n\t\t\tvar textCss = {\n\t\t\t\t\t'position':'absolute',\n\t\t\t\t\t'top':topPos+'em',\n\t\t\t\t\t'left':leftPos+'em',\n\t\t\t\t\t'font':'2em arial,verdana,geneva,helvetica'\n\t\t\t\t\t};\n\t\t\t$('#'+parentDiv).append('<div id=\"'+divName+'\"></div>');\n\t\t\t$('#'+divName).css(textCss).html(numText);\n\t\t}", "title": "" }, { "docid": "904b2e0fcb36b7ae0ebb1f09d93e9e9f", "score": "0.53865594", "text": "function setText(name, textX, textY, value, color, fontSize, container) {\n\tvar _text = new createjs.Text(value, \"bold \" + fontSize + \"em Tahoma, Geneva, sans-serif\", color);\n\t_text.x = textX;\n\t_text.y = textY;\n\t_text.textBaseline = \"alphabetic\";\n\t_text.name = name;\n\t_text.text = value;\n\t_text.color = color;\n\t_text.textAlign = 'center' \n _text.lineWidth = 90;\n\tcontainer.addChild(_text); /** Adding text to the container */\n\tbrewsters_stage.update();\n}", "title": "" }, { "docid": "246f6e66e9a3bba8351d7b2e27a49cc5", "score": "0.5372121", "text": "function actualzarTexto1() {\n textoVideo.removeClass(\"animate__backInUp\");\n textoVideo.addClass(\"animate__backInLeft\");\n textoVideo.text(\"Lo mejor para tu hogar en herramientas e insumos\");\n }", "title": "" }, { "docid": "9c2492bfc5b4b2a3779f3b5c7bcac03d", "score": "0.53720886", "text": "placeText(dataSourceTileList, time) {\n const tileTextElementsChanged = checkIfTextElementsChanged(dataSourceTileList);\n const textElementsAvailable = this.hasOverlayText() || tileTextElementsChanged || hasTextElements(dataSourceTileList);\n if (!this.initialize(textElementsAvailable)) {\n return;\n }\n const updateTextElements = this.m_cacheInvalidated ||\n tileTextElementsChanged ||\n this.m_viewState.renderedTilesChanged;\n logger.debug(`FRAME: ${this.m_viewState.frameNumber}, ZOOM LEVEL: ${this.m_viewState.zoomLevel}`);\n if (updateTextElements && this.m_addNewLabels) {\n this.m_textElementStateCache.clearVisited();\n this.updateTextElements(dataSourceTileList);\n }\n const findReplacements = updateTextElements && this.m_addNewLabels;\n const anyTextGroupEvicted = this.m_textElementStateCache.update(time, this.m_options.disableFading, findReplacements, this.m_viewState.zoomLevel);\n this.reset();\n if (this.m_addNewLabels) {\n this.prepopulateScreenWithBlockingElements(dataSourceTileList);\n }\n // New text elements must be placed either if text elements were updated in this frame\n // or if any text element group was evicted. The second case happens when the group is not\n // visited anymore and all it's elements just became invisible, which means there's newly\n // available screen space where new text elements could be placed. A common scenario where\n // this happens is zooming in/out: text groups from the old level may still be fading out\n // after all groups in the new level were updated.\n const placeNewTextElements = (updateTextElements || anyTextGroupEvicted) && this.m_addNewLabels;\n this.placeTextElements(time, placeNewTextElements);\n this.placeOverlayTextElements();\n this.updateTextRenderers();\n }", "title": "" }, { "docid": "d46e7bc122545a8c55f968487a97fab1", "score": "0.5360809", "text": "function updateText(winText) {\n\tif ((winText.x + winText.dx) + 210 > WIDTH || winText.x + winText.dx < 0) {\n\t\twinText.dx = -winText.dx;\n\t}\n\tif (winText.y + winText.dy + 24 > HEIGHT || winText.y + winText.dy - 24 < 0) {\n\t\twinText.dy = -winText.dy;\n\t}\n\twinText.x += winText.dx;\n\twinText.y += winText.dy;\n}", "title": "" }, { "docid": "cfdd80f0741d6f2fb8c1a72d077f3b50", "score": "0.5353045", "text": "function writeText() {\n\n // Inserting the text to show \n\n text.innerText = prog.slice(0, idx); \n\n // increasing the text\n idx++;\n\n if(idx> prog.length) {\n idx = 1;\n }\n}", "title": "" }, { "docid": "7a672560aa04217977898a61a03ce6ff", "score": "0.53508013", "text": "function getText(layer, parentFrame) {\n /// reset vars\n // var kind;\n // var frame = {};\n var flip = getFlipMultiplier(layer)\n\n // /// is the layer flipped?\n // var flip = getFlipMultiplier(layer);\n\n // /// point or area text box\n // if (layer.sketchObject.textBehaviour() == 0) {\n // kind = 'Point';\n // frame = {\n // width: layer.size.x,\n // height: layer.size.y,\n // x: layer.relativeTransform[0][2],\n // y: layer.relativeTransform[1][2] + 10,\n // }\n // } else {\n // kind = 'Area';\n var tempFrame = getFrame(layer, parentFrame);\n frame = {\n width: layer.size.x * 1.02,\n height: layer.size.y,\n x: tempFrame.x + layer.size.x / 2,\n y: tempFrame.y + layer.size.y / 2 + (layer.style.fontSize - layer.style.lineHeightPx/(layer.style.lineHeightPercent/50)),\n // y: layer.frame.y + layer.frame.height / 2 + layer.sketchObject.glyphBounds().origin.y,\n }\n // }\n\tvar layerData = {\n type: 'Text',\n kind: 'Area',\n\t\tname: layer.name,\n stringValue: getTextProps(layer),\n\t\tid: layer.id,\n\t\tframe: frame,\n isVisible: (layer.visible !== false),\n\t\topacity: layer.opacity*100 || 100,\n textColor: getFills(layer)[0].color || getFills(layer)[0].gradient.points[0].color,\n fill: null,\n stroke: getStrokes(layer),\n\t\tblendMode: getLayerBlending(layer.blendMode),\n // fontName: layer.style.fontPostScriptName,\n fontName: layer.style.fontPostScriptName || layer.style.fontFamily,\n fontSize: layer.style.fontSize,\n trackingAdjusted: layer.style.letterSpacing / layer.style.fontSize * 1000,\n tracking: layer.style.letterSpacing,\n justification: getJustification(layer),\n lineHeight: layer.style.lineHeightPx,\n flip: flip,\n rotation: getRotation(layer),\n isMask: layer.isMask,\n };\n\n getEffects(layer, layerData);\n // console.log(layer.style);\n // getThumbnail('0cRk8qFB9MiCkEtniYatxqc6', layer.id).then(imgSvg => {\n // console.log(imgSvg);\n //\n // var ajax = new XMLHttpRequest();\n // ajax.open(\"GET\", 'file.svg', true);\n // // ajax.open(\"GET\", imgSvg, true);\n //\n // ajax.onload = function(e) {\n // var xmlDOM = new DOMParser().parseFromString(ajax.responseText, 'text/xml');\n // console.log(xmlToJson(xmlDOM));\n // }\n // ajax.send();\n // });\n\n return layerData;\n\n\n\n function getTextProps(layer) {\n var text = layer.characters.replace(/[\\u2028]/g, '\\n');\n var transformVal = 0;\n // var transformVal = layer.sketchObject.styleAttributes()[\"MSAttributedStringTextTransformAttribute\"];\n\n if (transformVal == 1) { text = text.toUpperCase(); }\n if (transformVal == 2) { text = text.toLowerCase(); }\n\n return text;\n }\n\n function getJustification(layer) {\n var justify = layer.style.textAlignHorizontal;\n\n if (justify == 'RIGHT') { return 1 }\n if (justify == 'CENTER') { return 2 }\n if (justify == 'JUSTIFIED') { return 3 }\n\n return 0;\n }\n}", "title": "" }, { "docid": "b6b2d37574f7a7f06d959350ad68ae62", "score": "0.534988", "text": "function positionCommonshareText() {\n returntext.style(\"display\", \"none\");\n kcoretext.style(\"display\", \"block\");\n var kcorenode = kcoretext.node();\n var kwidth = kcorenode.getBoundingClientRect().width;\n var kcoreheight = kcorenode.getBoundingClientRect().height;\n\n kcoretext.attr(\"transform\", \"translate(\" + ((width/2) - (kwidth/2)) +\n \",\" + ((height / 2) + (kcoreheight / 4)) + \")\");\n}", "title": "" }, { "docid": "4431b66222089278c391bc4112422186", "score": "0.5347628", "text": "function setText(textToAdd) {\n if ($(textToAdd).val()) {\n enterDrawMode('text');\n text = $(textToAdd).val();\n }\n}", "title": "" }, { "docid": "e649c14512ca9737ea778bc27ac5f3cd", "score": "0.53419614", "text": "function addText(mainTxt)\n{\n\tif(ctx.measureText(txt).width >= maxWidth)\n\t{\n\t\t// That means the text width is zero \n\n\t\tvar rowPosition = 50;\n\t\tvar incrementRowVal = 30; // Increment \n\n\t\twhile(true)\n\t\t{\n\t\t\tif(txt.length <= 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar last = true;\n\t\t\tif(ctx.measureText(txt).width >= maxWidth)\n\t\t {\n\t\t \tlast = false;\n\t\t } \n\n\t\t\tvar remainderTxt = txt.substring(0, maxWidthChar*2);\n\n\t\t var splitArray = remainderTxt.split(\" \");\n\n\t\t \n\t\t var temp = reconstruct(splitArray, last);\n\n\t\t ctx.fillText(temp, 10, rowPosition);\t\n\t\t rowPosition = rowPosition + incrementRowVal;\n\n\t\t txt = txt.substring(temp.length, txt.length);\n\n\t\t}\n\n\n\t} else {\n\t\tctx.fillText(txt, 10, 50);\t\n\t}\n\n}", "title": "" }, { "docid": "82e27ad61fdaffee7de26c40fcea2d41", "score": "0.5340776", "text": "loadTexts() {\n this.map.texts\n .forEach(({ text, x, y }) => this.game.compositor\n .stageText(text, x, y));\n }", "title": "" }, { "docid": "d37085143aed50bf5178152e99186c9d", "score": "0.533923", "text": "function updateFrame( index ) {\n currentsEl[index].textContent = currentScores[index];\n scoresEl[index].textContent = scores[index];\n}", "title": "" }, { "docid": "b307056c1bd6ac1060911d243071a3c8", "score": "0.5337275", "text": "function draw() {\n image(pageImage, 0, 0, width, height);\n textSize(fontSize);\n fill(\"#264180\");\n if (lineSpace) textLeading(lineSpace);\n position = createVector(textXAxis, textYAxis);\n for (var i = 0; i <= textData.length; i++) {\n if (position.x >= textXAxis + textWidth || textData[i] == \"\\n\") {\n position.x = textXAxis;\n position.y += lineSpace * fontSize;\n }\n if (\"textImage\" + textData[i] in fontText) {\n if (textData[i])\n image(\n fontText[\"textImage\" + textData[i]],\n position.x,\n position.y,\n fontText[\"textImage\" + textData[i]].width * fontSize,\n fontText[\"textImage\" + textData[i]].height * fontSize\n );\n position.x += fontText[\"textImage\" + textData[i]].width * fontSize;\n }\n }\n}", "title": "" }, { "docid": "52dcfd94bf77255043909845c7ed828b", "score": "0.5335876", "text": "enterJsxText(ctx) {\n\t}", "title": "" }, { "docid": "b3c6e7276efd08d38a74a2a2d50096b3", "score": "0.5332657", "text": "function addText() {\n var oText = new fabric.IText(\"Tap and Type\", {\n left: 100,\n top: 100,\n });\n\n canvas.add(oText);\n oText.bringToFront();\n canvas.setActiveObject(oText);\n $(\"#fill, #font\").trigger(\"change\");\n}", "title": "" }, { "docid": "8cb1de8424e1929da1438382215ef966", "score": "0.5332322", "text": "function displayText() {\n \n}", "title": "" }, { "docid": "9c6abbb9128bd66a2e4cb23c69d9f99c", "score": "0.5328474", "text": "function choiceText(text, lines, y) {\n\tvar texts = text.split(\" | \");\n\tctx.font = \"14px Courier\";\n\tfor(var l=0;l<lines;l++){\n\t\tctx.fillText(texts[l], camera.x+7, y+(l*9));\n\t}\n}", "title": "" }, { "docid": "0c3eb866386f60209c45c3550b3a8246", "score": "0.5325176", "text": "function CreateOverlayHelperText() {\n _overlayText = new Text('Drag the image below to scroll', _game.world.centerX, 25, Text.getEnum().InfoOverlayText, \n _game.global.style.questionTextProperties);\n _overlayText.addTextToGame(_game, _game.uiGroup);\n _overlayText.changeText(_game);\n}", "title": "" }, { "docid": "f60702e64cc457aae83a08b662cae734", "score": "0.53249145", "text": "function choiceText(text, lines, y) {\n var texts = text.split(\" | \");\n ctx.font = \"14px Courier\";\n for (var l = 0; l < lines; l++) {\n ctx.fillText(texts[l], camera.x + 7, y + (l * 9));\n }\n}", "title": "" }, { "docid": "dbd94d25a1c1a5d9a9bcd18f59c567d5", "score": "0.5324498", "text": "function GuiText(in_origin, in_text, in_font, in_align, in_baseline)\n{\n\tif (!(this instanceof GuiText))\n\t\talert(\"GuiText: call constuctor with new keyword\");\n\tvar m_origin = in_origin.Clone();\n\tvar m_text = in_text;\n\tvar m_draw = true;\n\tvar m_font = in_font || GuiText.s_defaultFont;\n\tvar m_align = in_align || GuiText.s_alignCenter;\n\tvar m_baseline = in_baseline || GuiText.s_baselineMiddle;\n\n\tthis.Draw = function(in_canvas, in_context, in_fillStyle)\n\t{\n\t\tif (false == m_draw)\n\t\t\treturn;\n\t\tin_context.font = m_font;\n\t\tin_context.textAlign = m_align;\n\t\tin_context.textBaseline = m_baseline;\n\t\tin_context.fillStyle = in_fillStyle;\n\t\tin_context.fillText(m_text, m_origin.m_x, m_origin.m_y);\n\t};\n\t\n\tthis.SetText = function(in_text)\n\t{\n\t\tm_text = in_text;\n\t};\n}", "title": "" }, { "docid": "dfe7192969361f852e83f076f5ae5cb6", "score": "0.5312867", "text": "function writeNotesNames() {\n\n ctx = myGameArea.context;\n ctx.font = \"30px Comic Sans MS\";\n ctx.fillStyle = \"White\";\n ctx.fillText(\"Do\" , 130, 585); \n ctx.fillText(\"Ré\" , 230, 585); \n ctx.fillText(\"Mi\" , 330, 585); \n ctx.fillText(\"Fa\" , 430, 585); \n ctx.fillText(\"Sol\" , 530, 585); \n ctx.fillText(\"La\" , 630, 585); \n ctx.fillText(\"Si\" , 730, 585); \n ctx.fillText(\"Do\" , 830, 585); \n}", "title": "" }, { "docid": "013e933201cdbb22b1d369a6de12414d", "score": "0.5312592", "text": "function setText(name, textX, textY, value, color, fontSize) {\n\tvar text = new createjs.Text(value, \"bold \" + fontSize + \"em Tahoma, Geneva, sans-serif\", color);\n\ttext.x = textX;\n\ttext.y = textY;\n\ttext.textBaseline = \"alphabetic\";\n\ttext.name = name;\n\ttext.text = value;\n\ttext.color = color;\n\tthermistor_stage.addChild(text); /** Adding text to the stage */\n}", "title": "" }, { "docid": "eeb87ffd03b757d7a891b544f4afce60", "score": "0.53106916", "text": "function showmessage(text)\r\n{\r\n var ebene = 0;\r\n var layername = \"textbox\";\r\n\r\n if(document.all)\r\n {\r\n document.all[layername+ebene].innerHTML = \"<layer width=505 height=205>\"+text+\"</layer>\";\r\n }\r\n else if(document.layers)\r\n {\r\n document.layers[ebene].document.open();\r\n document.layers[ebene].document.write(text);\r\n document.layers[ebene].document.close();\r\n } \r\n}", "title": "" }, { "docid": "1872d3d742df81b82eaa3d76045b4c5f", "score": "0.53097194", "text": "function setText(name, textX, textY, value, color, fontSize, container,font){\n var text = new createjs.Text(value, \"bold \" + fontSize + font, color);\n text.x = textX;\n text.y = textY;\n text.textBaseline = \"alphabetic\";\n text.name = name;\n text.text = value;\n text.color = color;\n container.addChild(text); /** Adding text to the container */\n resistivity_by_Four_Probe_Method_stage.update();\n}", "title": "" }, { "docid": "2783ebe3600aaaa75330580a4aec332d", "score": "0.53045416", "text": "function drawText(data) {\n var words = data\n for (var i = 1; i < 10; i++){\n var s = i + \". \" + words[i-1];\n textSize(14);\n text(s, 10, windowHeight/2 + i * 30);\n }\n}", "title": "" }, { "docid": "d975223db3396260fb0b188f4e7f6e89", "score": "0.5302905", "text": "function setText(text) {\n console.log(text);\n console.log(Object.prototype.toString.call(text));\n var display = text[0].display;\n console.log(display);\n document.getElementById(\"STToutput\").innerHTML += (\"You said: \" + display);\n parseSTT(text);\n}", "title": "" }, { "docid": "6861a04cd4a408f42e252c9027737f3b", "score": "0.5299608", "text": "function updateSessionText() {\n\tif (document.getElementById('sessions_text')) {\n\t\tust();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', ust);\n\t}\n\n\t//Update session text\n\tfunction ust() {\n\t\tif (updateSessionText.fontSize === undefined) {\n\t\t\t//The reason why 'name_input' is used is it was first in the file that had both the font-family and font-size in the css\n\t\t\tupdateSessionText.fontSize = getPropertyFromElement(document.getElementById('name_input'), 'font-size');\n\t\t\tupdateSessionText.fontFamily = getPropertyFromElement(document.getElementById('name_input'), 'font-family');\n\t\t}\n\n\t\tlet sessionText = \"\";\n\n\t\t//Adds all the cancel buttons, the name, and the time left for each session\n\t\tfor (let i = 0; i < sessions.length; i++) {\n\t\t\tlet shortName = sessions[i].name;\n\t\t\tlet end = \"- \" + timeToDigital(sessions[i].time);\n\t\t\tlet nameAndTime = shortName + end;\n\t\t\tif (stringWidth(nameAndTime, updateSessionText.fontFamily, updateSessionText.fontSize) > maxLength) {\n\t\t\t\twhile (stringWidth(shortName + '...' + end, updateSessionText.fontFamily, updateSessionText.fontSize) > maxLength && shortName.length > 0) {\n\t\t\t\t\tshortName = shortName.substring(0, shortName.length - 1);\n\t\t\t\t}\n\t\t\t\tnameAndTime = shortName + '...' + end;\n\t\t\t}\n\t\t\tsessionText += '<div id=\"close_paragraph_' + i + '\" class=\"time\" draggable=\"true\" style=\"margin-bottom:5px; height:20px; width:150px; border-radius:7px; background-color:' + sessions[i].color + ';\"><p style=\"position:relative; top:-3px; margin:0px; padding:0px; line-height:20px\"><button style=\"position:relative; top:3px;outline:none; height:20px; width:20px; border-radius:7px 0px 0px 7px; font-size:15px;\" class=\"close_button\" id=\"close_button_' + i + '\"></button> ' + nameAndTime + \"</p></div>\";\n\t\t}\n\t\tdocument.getElementById('sessions_text').innerHTML = sessionText;\n\n\t\t//Sets up the cancel buttons\n\t\tfor (let i = 0; i < sessions.length; i++) {\n\t\t\tlet id = 'close_button_' + i;\n\t\t\taddClickListener(id, () => {\n\t\t\t\tif (recentChangeInvolvingFade) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trecentChangeInvolvingFade = true;\n\t\t\t\tsessions.splice(i, 1);\n\t\t\t\tif (sessions.length == 0) {\n\t\t\t\t\tchrome.storage.sync.set({sessionRunning: false});\n\t\t\t\t\tdocument.getElementById('start_stop_text').innerHTML = \"Start\";\n\t\t\t\t}\n\t\t\t\tupdateSessionText();\n\t\t\t\tsendMessage({\n\t\t\t\t\tto: \"background\",\n\t\t\t\t\tfrom: \"popup\",\n\t\t\t\t\taction: \"update\",\n\t\t\t\t\tplace: \"sessions\",\n\t\t\t\t\tsessions: sessions\n\t\t\t\t});\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\trecentChangeInvolvingFade = false;\n\t\t\t\t}, fadeDuration * 2);\n\t\t\t});\n\t\t\tid = 'close_paragraph_' + i;\n\t\t\tdocument.getElementById(id).addEventListener('dragstart', (e) => {\n\t\t\t\te.dataTransfer.setData(\"other id\", e.target.id);\n\t\t\t});\n\t\t\tdocument.getElementById(id).addEventListener('dragover', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t});\n\t\t\tdocument.getElementById(id).addEventListener('drop', (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tlet otherId = e.dataTransfer.getData(\"other id\");\n\n\t\t\t\tlet selfIndex = id.charAt(id.length - 1);\n\t\t\t\tlet otherIndex = otherId.charAt(otherId.length - 1);\n\n\t\t\t\tlet self = sessions[selfIndex];\n\t\t\t\tlet other = sessions[otherIndex];\n\n\t\t\t\tsessions.splice(selfIndex, 1, other);\n\t\t\t\tsessions.splice(otherIndex, 1, self);\n\n\t\t\t\tupdateSessionText();\n\t\t\t\tsendMessage({\n\t\t\t\t\tto: \"background\",\n\t\t\t\t\tfrom: \"popup\",\n\t\t\t\t\taction: \"update\",\n\t\t\t\t\tplace: \"sessions\",\n\t\t\t\t\tsessions: sessions\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "37393e79480d4c89dd1a11e64fabd946", "score": "0.5298306", "text": "function setPosPlanetText() {\n\tdocument.querySelectorAll('.planet').forEach(function(item) {\n\t\titemId = $(item).attr('id');\n\t\tvar itemTop = (item.getBoundingClientRect().top + pageYOffset - $('#section-benefits').offset().top) + 'px';\n\t\tvar itemLeft = item.getBoundingClientRect().left + item.getBoundingClientRect().width *1.8 + 'px';\n\t\tvar planetText = $('.planet-text-wrap').map(function() {\n\t\t\tvar planetTextData = $(this).attr('data-for');\n\t\t\tif(planetTextData == itemId) return this\n\t\t\telse return null\n\t\t})\n\t\t$(planetText[0]).css({'top': itemTop, 'left': itemLeft});\n\t})\n}", "title": "" }, { "docid": "c95ede82d8ccd0f6d28a5d2b949be082", "score": "0.5297175", "text": "function changeText(newText) {\n text.innerHTML = newText; \n }", "title": "" } ]
4244b6354bd880a1623d003723df7002
=========================== ignoreindoc This code is triggered in the UI process directly after the creation of the worker and sends the setup message to the worker for initializing it.
[ { "docid": "d4558e2ed2a33a0808dd1c247972032e", "score": "0.5931894", "text": "function init(options, worker) {\n exports.events.makeEmitter(worker);\n\n if (!options.scriptsToLoad) {\n options.scriptsToLoad = [\n 'base.js',\n 'events.js',\n 'object.js',\n 'collection.js',\n 'function.js',\n 'string.js',\n 'number.js',\n 'date.js',\n 'messenger.js',\n 'worker.js'].map(function(ea) {\n return options.libLocation + ea; });\n }\n\n var workerOptions = Object.keys(options).reduce(function(opts, key) {\n if (typeof options[key] !== 'function') opts[key] = options[key];\n return opts;\n }, {});\n\n worker.onmessage = function(evt) {\n if (evt.data.workerReady !== undefined) {\n worker.ready = !!evt.data.workerReady;\n if (worker.ready) worker.emit(\"ready\");\n else worker.emit(\"close\");\n } else worker.emit('message', evt.data);\n }\n\n worker.errors = [];\n worker.onerror = function(evt) {\n console.error(evt);\n worker.errors.push(evt);\n worker.emit(\"error\", evt)\n }\n\n worker.postMessage({action: 'setup', options: workerOptions});\n }", "title": "" } ]
[ { "docid": "f4af0cc58b2bc9b0ae22595cb968b618", "score": "0.6984129", "text": "function workerSetupFunction() {\n var remoteWorker = self;\n remoteWorker.onmessage = function(evt) {\n if (evt.data.action !== \"setup\") {\n throw new Error(\"expected setup to be first message but got \" + JSON.stringify(evt.data))\n }\n var options = evt.data.options || {};\n initBrowserGlobals(options);\n loadDependenciesBrowser(options);\n initOnMessageHandler(options);\n initWorkerInterface(options);\n initWorkerMessenger(options);\n postMessage({workerReady: true});\n }\n __FUNCTIONDECLARATIONS__\n }", "title": "" }, { "docid": "f30922d4b0014e0e1d2278862f5ed3c5", "score": "0.5920967", "text": "function initialize(data) {\n // console.log('web worker initialize ', data.workerIndex);\n // prevent initialization from happening more than once\n if (initialized) {\n return;\n } // save the config data\n\n\n config = data.config; // load any additional web worker tasks\n\n if (data.config.webWorkerTaskPaths) {\n for (var i = 0; i < data.config.webWorkerTaskPaths.length; i++) {\n self.importScripts(data.config.webWorkerTaskPaths[i]);\n }\n } // initialize each task handler\n\n\n Object.keys(taskHandlers).forEach(function (key) {\n taskHandlers[key].initialize(config.taskConfiguration);\n }); // tell main ui thread that we have completed initialization\n\n self.postMessage({\n taskType: 'initialize',\n status: 'success',\n result: {},\n workerIndex: data.workerIndex\n });\n initialized = true;\n}", "title": "" }, { "docid": "442239a8bafbafbbe0d08512edc6539a", "score": "0.5906392", "text": "setup() {\n this.trigger(\"ready\");\n }", "title": "" }, { "docid": "6b93f3268544c0f364df3122ade38819", "score": "0.58664936", "text": "trackInstalling(worker) {\n let self=this;\n worker.addEventListener('statechange', function() {\n if (worker.state == 'installed') {\n self.updateReady(worker);\n }\n });\n}", "title": "" }, { "docid": "59ee46657646bdd5fe702a0f07789167", "score": "0.5854494", "text": "async setup() {}", "title": "" }, { "docid": "ae7a2966644607cb84fa2eacafce3a96", "score": "0.5733602", "text": "function setup(evt) {\n if (config.file) {\n ChapterDock.init(config, jwplayer);\n };\n }", "title": "" }, { "docid": "eafa7bcd3250340c55b502f1281f8171", "score": "0.5728502", "text": "async function setupAndStart() {\r\n}", "title": "" }, { "docid": "7d097e8c4642ba01baa1db1df3e99f2a", "score": "0.5635427", "text": "function setup() {\n setupCanvas();\n setupMeta();\n setupButtons();\n myBlobs=new MyBlobs();\n allBlobs=new AllBlobs();\n noiseField=new NoiseField();\n statusBar=new StatusBar(devWidth,devHeight);\n logger=new Logger();\n deviceData=new DeviceData();\n subtleMeta=new SubtleMeta(devWidth, devHeight);\n themeRunner=new ThemeRunner(canFullWidth, canFullHeight, deviceData);\n jcta=new JoinedCallToAction();\n //initialise socket\n socket=io.connect('/');\n socket.on('connect', connected);\n // dataRefresh=setInterval(dataRefreshPoll, 1000);\n //initial display\n refreshHTMLStatus();\n refreshHTMLGeometry();\n frameRate(30);\n // setTimeout(jcta.windowChanged, 1000);\n}", "title": "" }, { "docid": "89a0e22d328e0e323c3cbf522821a5ab", "score": "0.56344205", "text": "async initialSetup(imported = false) {\n let message, options\n if (!imported) {\n message = \"Welcome to CovidZones. Make sure your script has the name you want before you begin.\"\n options = ['I like the name \"' + this.name + '\"', \"Let me go change it\"]\n if (await this.generateAlert(message,options)) return\n }\n\n message = (imported ? \"Welcome to CovidZones. We\" : \"Next, we\") + \" need to check if you've given permissions to the Scriptable app. This might take a few seconds.\"\n await this.generateAlert(message,[\"Check permissions\"])\n\n let errors = []\n if (!(await this.setupLocation())) { errors.push(\"location\") }\n try { await CalendarEvent.today() } catch { errors.push(\"calendar\") }\n try { await Reminder.all() } catch { errors.push(\"reminders\") }\n\n let issues\n if (errors.length > 0) { issues = errors[0] }\n if (errors.length == 2) { issues += \" and \" + errors[1] }\n if (errors.length == 3) { issues += \", \" + errors[1] + \", and \" + errors[2] }\n\n if (issues) { \n message = \"Scriptable does not have permission for \" + issues + \". Some features may not work without enabling them in the Settings app.\"\n options = [\"Continue setup anyway\", \"Exit setup\"]\n } else {\n message = \"Your permissions are enabled.\"\n options = [\"Continue setup\"]\n }\n// if (await this.generateAlert(message,options)) return\n\n if (!imported) { await this.setWidgetBackground() }\n this.writePreference(\"CovidZones-setup\", \"true\")\n\n message = \"Your widget is ready! You'll now see a preview. Re-run this script to edit the default preferences, including localization. When you're ready, add a Scriptable widget to the home screen and select this script.\"\n await this.generateAlert(message,[\"Show preview\"])\n return this.previewValue()\n }", "title": "" }, { "docid": "c5fbd7c8a7086645d3eeef54d7ea0ff1", "score": "0.5633166", "text": "function setupStep() {\n console.log('sending SETUP step')\n sendObjectToVend({\n step: 'SETUP',\n setup: {\n enable_close: false\n }\n })\n}", "title": "" }, { "docid": "d933cb8dee96656faa2f8a09ef4eb9c9", "score": "0.5616917", "text": "async setup() {\n this.checks = this.loadChecks();\n await this.pageDataGatherer.start();\n }", "title": "" }, { "docid": "e2329a25e62e3100d9db7597f4de49a2", "score": "0.56149447", "text": "function setup() {}", "title": "" }, { "docid": "0d538d7e224a437041d8e3f786fa7810", "score": "0.56130433", "text": "function trackInstalling(worker) {\n worker.addEventListener('statechange', function() {\n if (worker.state == 'installed') {\n updateReady(worker);\n }\n });\n}", "title": "" }, { "docid": "63d367c769c650d277ff39de3be0f601", "score": "0.5611634", "text": "attemptNotificationSetup() {}", "title": "" }, { "docid": "635b4735be419adc7e7b0e9bec75de23", "score": "0.55934846", "text": "function spawnWorker(workerURL, onReady) {\n recognizer = new Worker(workerURL);\n recognizer.onmessage = function(event) {\n onReady(recognizer);\n };\n recognizer.postMessage('');\n }", "title": "" }, { "docid": "7cc8c5b89dd0d4e7d3af7bc58625e0cb", "score": "0.5579381", "text": "_trackInstalling( worker ) {\n worker.addEventListener( 'statechange', () => {\n if( worker.state == 'installed' && navigator.serviceWorker.controller ) {\n this.notifyUpdateCallback( worker );\n }\n });\n }", "title": "" }, { "docid": "58e4bfa53cfd403089700a258486dee4", "score": "0.55726314", "text": "performSetup(){\n\t\t// Only allow to perform this setup once.\n\t\tif(this.ee){ return; }\n\n\t\t// Setup eventemitter.\n\t\tthis.ee = new EventEmitter();\n\t\tthis.on = this.ee.on.bind(this);\n\t\tthis.emit = this.ee.emit.bind(this);\n\n\t\t// Setup state.\n\t\tthis.state = this.getDefaultState();\n\t\tthis.set(this.getSavedState());\n\n\t\tthis.setApi();\n\t}", "title": "" }, { "docid": "3916c6c8229b6c75bf36317124a2a001", "score": "0.5571702", "text": "setup() {\n\t\tthis.commandCenter.setup();\n\t}", "title": "" }, { "docid": "de56ac07d049db55a8116e3775d402f8", "score": "0.55698663", "text": "function createWorker() {\n nlp_worker = new Worker('worker/nlp_worker.js');\n\n //TODO: Error handling & fallback.\n nlp_worker.onmessage = function (event) {\n var message = JSON.parse(event.data);\n switch (message.type) {\n case 'keywordlist':\n var nlp_port = active_nlp_ports[message.data.tabId];\n\n if (nlp_port) {\n var messageOut = {\n component: 'nlp',\n message: message\n };\n\n console.log('EP-NLP:posting message: ', messageOut);\n nlp_port.postMessage(messageOut);\n } else {\n console.log('EP-NLP:got keywords before port was initialized!');\n }\n break;\n default:\n console.warn('EP-NLP:Unable to recognize response ' + message.type);\n break;\n }\n };\n }", "title": "" }, { "docid": "df4a66acde158b2256d9123e0c931e31", "score": "0.5538729", "text": "async function setup() {\n // Connect to WizNotePlus\n if (!state.isConnected) {\n state.isConnected = !!(await createWebChannel());\n }\n // Sync categories and tags to Browser local storage.\n syncCategories();\n syncTags();\n}", "title": "" }, { "docid": "08ca53c87005ae786ced107aea7681d3", "score": "0.5536008", "text": "function setUpUI() {\n\t\t\n\t\t//Things to do once everything else has loaded\n\t\t\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "81670e3e37a59b71455bbce8640da21d", "score": "0.55320585", "text": "prepToStart() {\n\n }", "title": "" }, { "docid": "526ccc75137f80efe3c2b16e8094a755", "score": "0.5530388", "text": "registerChefWorker() {\n log.debug(\"Registering new ChefWorker\");\n this.chefWorker = new ChefWorker();\n this.chefWorker.addEventListener(\"message\", this.handleChefMessage.bind(this));\n this.setLogLevel();\n\n let docURL = document.location.href.split(/[#?]/)[0];\n const index = docURL.lastIndexOf(\"/\");\n if (index > 0) {\n docURL = docURL.substring(0, index);\n }\n this.chefWorker.postMessage({\"action\": \"docURL\", \"data\": docURL});\n }", "title": "" }, { "docid": "0940e63dff2ad1fa95989ebe2b94a364", "score": "0.55297303", "text": "warnNotSetup() {\n warn(\"An action was fired before the editor was set up\", { id: \"rdfa-editor.not-setup\" } );\n }", "title": "" }, { "docid": "90fb752ed8439bcb4640a6e679bd84fb", "score": "0.55141383", "text": "function setup (){\n\t\t\t\tvar random_id = \"0000\" + Math.floor(Math.random() * 10000)\n\t\t\t\t\t;\n\n\t\t\t\tapp_name = app_name + ' ' + random_id.substring(random_id.length-4);\n\n\t\t\t\t// setup spacebrew\n\t\t\t\tsb = new Spacebrew.Client(); // create spacebrew client object\n\n\t\t\t\tsb.name(app_name);\n\t\t\t\tsb.description(\"This app sends text from an HTML form.\"); // set the app description\n\n\t\t // create the spacebrew subscription channels\n\t\t\t\tsb.addPublish(\"text\", \"string\", \"\");\t// create the publication feed\n\t\t\t\tsb.addSubscribe(\"text\", \"string\");\t\t// create the subscription feed\n\n\t\t\t\t// configure the publication and subscription feeds\n\t\t\t\tsb.onStringMessage = onStringMessage;\t\t\n\t\t\t\tsb.onOpen = onOpen;\n\n\t\t\t\t// connect to spacbrew\n\t\t\t\tsb.connect(); \n\n\t\t\t\t// listen to button clicks\n\t\t\t\t//$(\"#button\").on(\"mousedown\", onMouseDown);\n\t\t\t}", "title": "" }, { "docid": "674b8ade3935231c23702d2a889dcbc2", "score": "0.5480839", "text": "function setup(args, ctx) {\n}", "title": "" }, { "docid": "699bac3dd87fed305e68195288326372", "score": "0.5477258", "text": "function beginSetup() {\r\n\thue.nupnpSearch().then((bridge) => {\r\n\t\tstore.set('bridgeIP', bridge[0].ipaddress);\r\n\t}).then(createSetupWindow).done();\r\n}", "title": "" }, { "docid": "2af2fdd9498afefeb68279dadeae6811", "score": "0.5474115", "text": "setup() {}", "title": "" }, { "docid": "2af2fdd9498afefeb68279dadeae6811", "score": "0.5474115", "text": "setup() {}", "title": "" }, { "docid": "5328b1f3bc4725d5f2b4b43eac1ba5e4", "score": "0.546299", "text": "onPreInitiate(){}", "title": "" }, { "docid": "2c6adc6fa235ea8b80ac330eea5a0e9c", "score": "0.5448014", "text": "async runSetup(name, iCloudInUse, codeFilename, gitHubUrl) {\n if (!this.initialized) this.initialize(name, iCloudInUse)\n const backgroundSettingExists = this.fm.fileExists(this.bgPath)\n\n if (!this.fm.fileExists(this.fm.joinPath(this.fm.libraryDirectory(), \"CovidZones-setup\"))) return await this.initialSetup(backgroundSettingExists)\n if (backgroundSettingExists) return await this.editSettings(codeFilename, gitHubUrl)\n await this.generateAlert(\"CovidZones is set up, but you need to choose a background for this widget.\",[\"Continue\"])\n return await this.setWidgetBackground() \n }", "title": "" }, { "docid": "a5f6806418f24af42da6bc45957c53f5", "score": "0.5422476", "text": "function pre_init()\n{\n\tkony.application.setApplicationCallbacks({onwatchrequest:JSWcallBack});\n\tremoteNotCallbacks();\n\tlocalNotCallBacks();\n\tregisterActions();\n\t\n}", "title": "" }, { "docid": "f510fe2eb96ca652d7d163cbf76b1020", "score": "0.54207796", "text": "function setup() {\n // parsing will spend a lot of time, so do it asynchronously\n asynFindTrelloComments();\n registerFileChangeListener();\n }", "title": "" }, { "docid": "720827a6630717eb52c395cd78058609", "score": "0.5413442", "text": "setup() {\n this.client.once(\"ready\", () => {\n if (this.autoRegisterSlashCommands)\n this.registerInteractionCommands().then(() => {\n if (this.useSlashPermissions)\n this.updateInteractionPermissions(this.client.ownerID /* this.client.superUserID */);\n });\n this.client.on(\"messageCreate\", async (m) => {\n if (m.partial)\n await m.fetch();\n this.handle(m);\n });\n if (this.handleEdits) {\n this.client.on(\"messageUpdate\", async (o, m) => {\n if (o.partial)\n await o.fetch();\n if (m.partial)\n await m.fetch();\n if (o.content === m.content)\n return;\n if (this.handleEdits)\n this.handle(m);\n });\n }\n this.client.on(\"interactionCreate\", i => {\n if (!i.isCommand())\n return;\n this.handleSlash(i);\n });\n });\n }", "title": "" }, { "docid": "238502cbe2344d00c39b3777d1839a02", "score": "0.53855145", "text": "setup() {\n this.registerCenterListener();\n this.loadCache();\n }", "title": "" }, { "docid": "8dc468c044cc850e957f22cdd6a71e64", "score": "0.53726274", "text": "async setUp () {\n this.registerServiceWorker()\n }", "title": "" }, { "docid": "3a9338c1642468ae723b4ac16cc7e8ca", "score": "0.5364618", "text": "function setup() {\n\tcreator.setup();\n}", "title": "" }, { "docid": "8f349e4d2ce39fbb08a046dcb7a04768", "score": "0.53515136", "text": "\"create-*\"(ctx) {\n\t\t\t\tbroker.logger.info(\"BEFORE HOOK: create-*\");\n\t\t\t}", "title": "" }, { "docid": "e028d72b1c8499a4ad412b1f80ec85d2", "score": "0.5337442", "text": "onSetup() {\n return tslib.__awaiter(this, void 0, void 0, function* () { });\n }", "title": "" }, { "docid": "0040dbd6c4f7613432726193bf1398f0", "score": "0.53366464", "text": "onconnected(event) {\n // Useful for running setup code.\n // Content *will be* fully parsed 🎉\n }", "title": "" }, { "docid": "6c8e6be2d199e6a38d6c771a18bf9b58", "score": "0.5324678", "text": "onRunnerStart () {\n\n }", "title": "" }, { "docid": "926ba5aeb01953d7b999d91946d09728", "score": "0.52945095", "text": "function otherSetup(w){\n\t\t\tpage.ready(function(){\n\t\t\t\t//otherSetup(h)\n\t\t\t\t//w._refresh()\n\t\t\t\thasLoaded = true\n\t\t\t\tdefaultSetupMutationObserver(document.body, w)\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "6fe119587d25d6cf7b9b36ca533de813", "score": "0.5285082", "text": "function skipWaiting() {\n // We need to explicitly call `self.skipWaiting()` here because we're\n // shadowing `skipWaiting` with this local function.\n self.addEventListener('install', () => self.skipWaiting());\n}", "title": "" }, { "docid": "e12005ad9b16ccbc4ce60ecf5b72cf76", "score": "0.528344", "text": "async setup() {\n // register the principal node\n this.principal.register()\n .then (result => {\n const event = result.logs[0];\n if (!event.args._success) {\n throw 'Unable to register worker';\n }\n // set workers parameters\n return this.principal.setWorkersParams();\n })\n .then (result => {\n const event = result.logs[0];\n if (!event.args._success) {\n throw 'Unable to set worker params';\n }\n console.log ('network using random seed:', event.args.seed.toNumber());\n })\n .catch(err => {\n console.log(err);\n })\n }", "title": "" }, { "docid": "ea5f56e6de9be195d37b53ed706926d4", "score": "0.5267168", "text": "setup() {\n // Listen for enter key on input field to create new item\n this.container.querySelector('.new-todo')\n .addEventListener('keyup', e => {\n if (e.code !== 'Enter') return;\n this.createItem(e.target.value);\n // Reset the text field\n e.target.value = null;\n });\n\n // Link clear button to removing all completed items\n this.container.querySelector('zen-button')\n .addEventListener('click', this.clearCompleted.bind(this));\n }", "title": "" }, { "docid": "216bb04041c04d46a928e54fee6a0ca9", "score": "0.5267107", "text": "async setup() {\n throw new Error(\"Must be overridden in child class.\");\n }", "title": "" }, { "docid": "8d66e7c44ffcfb98cccf61619fdad913", "score": "0.52617884", "text": "function setup() {\n\tindex = 0;\n\t$('.question').append('<button id=\"startButton\">Start</button>');\n\t$('#startButton').on('click', function() {\n\t\t$(this).hide();\n\t\tcountdownTimer.start();\n\t \tloadQuestion(index);\n\t});\n}", "title": "" }, { "docid": "e9065e93d8e738c0be9d588dc5acd801", "score": "0.52585953", "text": "setup(args){\n\t\t\n\t\tconst applicationDelegate = args.buildDefaultApplicationDelegate();\n\t\twindow.atom = args.buildAtomEnvironment({\n\t\t\tapplicationDelegate,\n\t\t\twindow,\n\t\t\tdocument,\n\t\t\tconfigDirPath: process.env.ATOM_HOME,\n\t\t\tenablePersistence: false,\n\t\t});\n\t\t\n\t\t// Shiv to let Mocha print to STDOUT/STDERR with unmangled feedback\n\t\tif(this.headless){\n\t\t\tconst {remote} = Electron;\n\t\t\tconst {format} = require(\"util\");\n\t\t\t\n\t\t\tObject.defineProperties(process, {\n\t\t\t\tstdout: {value: remote.process.stdout},\n\t\t\t\tstderr: {value: remote.process.stderr},\n\t\t\t});\n\t\t\t\n\t\t\tconst stdout = (...x) => process.stdout.write(format(...x) + \"\\n\");\n\t\t\tconst stderr = (...x) => process.stderr.write(format(...x) + \"\\n\");\n\t\t\tconsole.info = console.log = stdout;\n\t\t\tconsole.warn = console.error = stderr;\n\t\t\t\n\t\t\t// Terminate with correct status on interrupt\n\t\t\tremote.process.on(\"SIGINT\", () => {\n\t\t\t\tprocess.stdout.write(\"\\n\");\n\t\t\t\tif(this.runner) this.runner.abort();\n\t\t\t\tremote.process.exit(130);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "a53064fe3c1d00a3cafed4dff00395d9", "score": "0.5249989", "text": "function setup() {\n\tinitializeTocNav();\n}", "title": "" }, { "docid": "77d1e07ca56d6b698f870823df7d1b11", "score": "0.52387637", "text": "async init () {\n return;\n }", "title": "" }, { "docid": "7ba188efa14fce0d5fef73eac4c178b4", "score": "0.5231502", "text": "async function initServiceWorker() {\n swRegisteration = await navigator.serviceWorker.register(\"/Sw.js\", {\n updateViaCache: \"none\"\n });\n\n // Get Service From Current State\n svcWorker =\n swRegisteration.installing ||\n swRegisteration.waiting ||\n swRegisteration.active;\n\n sendSWMessage(svcWorker);\n\n // Get Service Worker From Contoller Change And New Service Worker is Active\n navigator.serviceWorker.oncontrollerchange = function() {\n // Run Skip Waiting Phase From Service Worker On Installing New Service Worker\n svcWorker = navigator.serviceWorker.controller;\n console.log(\"New Service Worker is controlling the clients\");\n sendSWMessage(svcWorker);\n };\n\n // Listen To Messages Coming From Service Worker\n navigator.serviceWorker.onmessage = onMessage;\n}", "title": "" }, { "docid": "248142a41e9ca444388dbb686a711134", "score": "0.52291", "text": "constructor () {\n this.setup();\n }", "title": "" }, { "docid": "70734ac33daf0bf74c610fbbb02a6cb0", "score": "0.5216111", "text": "async started() {\n\t\tthis.settings.hook = new Discord.WebhookClient(\n\t\t\tprocess.env.DISCORD_WEBHOOK_ID,\n\t\t\tprocess.env.DISCORD_WEBHOOK_TOKEN\n\t\t);\n\t}", "title": "" }, { "docid": "e7f314991b57ef8fea82493eed04f330", "score": "0.5212348", "text": "setup() {\n this.websocket.setup();\n }", "title": "" }, { "docid": "b3a965e82b8d6cc1b52c6d3186f7b8f0", "score": "0.52092695", "text": "ready() {\r\n }", "title": "" }, { "docid": "9ded47492072ff1638047f8c39c812f6", "score": "0.5205315", "text": "setup() {\n\t}", "title": "" }, { "docid": "4a7033bd5c011d404ee39a692fbbd30a", "score": "0.518688", "text": "function initialiseState() {\n\n console.log(\"Entro en inicializar\");\n\n\n const title = \"Nuevo titulo\";\n const body = \"Cuerpo de la notification\";\n const icon = \"img/favicon/ms-icon-70x70.png\";\n const tag = \"tag\";\n const link = \"http://www.google.com\";\n\n var options = {\n body: body,\n tag: tag,\n icon: icon,\n link: link\n \n };\n\n\n // Are Notifications supported in the service worker?\n if (!('showNotification' in ServiceWorkerRegistration.prototype)) {\n console.warn('Notifications aren\\'t supported.');\n return;\n }\n\n // Check the current Notification permission.\n // If its denied, it's a permanent block until the\n // user changes the permission\n if (Notification.permission === 'denied') {\n console.warn('The user has blocked notifications.');\n return;\n }\n\n // Check if push messaging is supported\n if (!('PushManager' in window)) {\n console.warn('Push messaging isn\\'t supported.');\n return;\n }\n\n Notification.requestPermission(status => {\n console.log(status);\n });\n\n navigator.serviceWorker.getRegistration().then(reg => {\n reg.showNotification(title, options)\n });\n\n}", "title": "" }, { "docid": "d630e227023258ce38a61450aad6ac1e", "score": "0.5177771", "text": "function setup() {\n \n}", "title": "" }, { "docid": "6c116ed074fb25cc64eb663322af4a1e", "score": "0.51761246", "text": "function setup() {\n // Setup file upload trigger\n var source = document.getElementById('input-file');\n MIDIParser.parse(source, midiLoadCallback);\n setupPaneButtons();\n}", "title": "" }, { "docid": "8ac445949f6d3658e48cb6cd1f312976", "score": "0.5168845", "text": "function setup () {\n\n\tupdateTitle();\n\n\tvar views = viewComponents();\n\tvar project = Project(localStorage.getItem('projectInfo'));\n\tvar file = File(views, project);\n\tvar menus = Menus(gui);\n\tvar animator = Animator(gui, menus, file);\n\n\tbuildMenus(menus, views, file, animator);\n\tbuildSidebar(views.sidebar, file, project, animator);\n\ttools.setup(views.toolbar, views.editor, project);\n\tstyles.setup(project, views);\n\tsetupClose(file, animator);\n\tsetupExport(menus, project);\n\n\teditor.focus();\n\n}", "title": "" }, { "docid": "ba5567fb9b035d85f39b0d612df4050d", "score": "0.5167377", "text": "function setup$3 () {\n // internal apis\n rpc.exportAPI('profiles', profilesManifest, profilesAPI, internalOnly);\n rpc.exportAPI('archives', archivesManifest, archivesAPI, internalOnly);\n rpc.exportAPI('bookmarks', bookmarksManifest, bookmarksAPI, internalOnly);\n rpc.exportAPI('history', historyManifest, historyAPI, internalOnly);\n rpc.exportAPI('keys', keysManifest, keysAPI, internalOnly);\n\n // external apis\n rpc.exportAPI('dat-archive', datArchiveManifest, datArchiveAPI, secureOnly);\n\n // register a message-handler for setting up the client\n // - see lib/fg/import-web-apis.js\n // TODO replace this with manual exports\n electron.ipcMain.on('get-web-api-manifests', (event, scheme) => {\n var protos;\n\n // hardcode the beaker: scheme, since that's purely for internal use\n if (scheme === 'beaker:') {\n protos = {\n beakerBrowser,\n beakerDownloads: manifest,\n beakerSitedata: manifest$1\n };\n event.returnValue = protos;\n return\n }\n\n event.returnValue = {};\n });\n}", "title": "" }, { "docid": "c7ce84c76a76d2e69dc9b20161852003", "score": "0.51609105", "text": "function startSetup() {\n\t\tsetup(function(){\n\t\t\tg.state.transition(\"splash\");\n\t\t});\n\t}", "title": "" }, { "docid": "07b656f1929e69a97d235cc04d1a9776", "score": "0.51538473", "text": "function setUpWatchers() {\n\n}", "title": "" }, { "docid": "134791de50ebd8526d98bf590ad7c013", "score": "0.5152188", "text": "ready () {\r\n this.$btn.addEventListener('confirm', () => {\r\n Editor.Ipc.sendToMain('build_playable_ads_fb:build-main');\r\n });\r\n }", "title": "" }, { "docid": "907d008a2f8cbeb3f217fbd9a30059c7", "score": "0.5145733", "text": "function setup (event) {\n pane = document.getElementById('setup')\n dom = getElements('initial', 'multi', 'finish')\n steps = getElements('scenario', 'secrets', 'code')\n if (pane) {\n pane.addEventListener('select', function(e) {\n steps.scenario.dispatchEvent(new Event('select'))\n })\n pane.addEventListener('check', function(e) {\n pane.dispatchEvent(new Event('select'))\n steps.secrets.dispatchEvent(new Event('select'))\n })\n pane.addEventListener('import', function(e) {\n pane.dispatchEvent(new Event('select'))\n steps.code.dispatchEvent(new Event('select'))\n })\n }\n dom.initial.addEventListener('click', function(e) {\n emit('initialSetup')\n })\n dom.multi.addEventListener('click', function(e) {\n emit('multiSetup')\n })\n dom.finish.addEventListener('click', function(e) {\n emit('multiImport')\n })\n }", "title": "" }, { "docid": "429fb92d6dfadabcd6048352f0a042f5", "score": "0.5145168", "text": "initExporter() {\n this.exportWorker = new InlineWorker(ExportWavWorkerFunction);\n }", "title": "" }, { "docid": "8cf231854a5150854f1968e267b22f9a", "score": "0.5143751", "text": "function setupStartCase7() {\n if (!fnTrackSetupConfig() || config.BypassSetup) {\n //todo: line 3867 - 3897\n }\n }", "title": "" }, { "docid": "ae1e6c9da48a15ab06b790d086032d19", "score": "0.51430744", "text": "async _onStart() {\n await this._loadBotUser();\n await this._checkApiConnection();\n this._postInitalMessageToChannel();\n }", "title": "" }, { "docid": "26150fca289893f602df4e64265e7552", "score": "0.51427734", "text": "ready() {\n }", "title": "" }, { "docid": "a71a91e2c9453579dd3a98465d982c70", "score": "0.51425016", "text": "async startup() { }", "title": "" }, { "docid": "7c26a0ee9c840d14631ce56ce79c37a8", "score": "0.5139181", "text": "start () {\n setupStartHandler();\n }", "title": "" }, { "docid": "47ac953f6a9325a57591af1d920b0c70", "score": "0.5135224", "text": "attemptAppsSetup() {}", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5135057", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5135057", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5135057", "text": "ready() { }", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.5135057", "text": "ready() { }", "title": "" }, { "docid": "73beaf5f24c0d89a731bcbc3878acf27", "score": "0.5131832", "text": "function main() {\n // Do not display control buttons on MacOS, it has own inset buttons\n if (process.platform !== \"darwin\") {\n addWindowButtons(\"#titlebar\", utils.settings.windowButtonsPosition);\n }\n\n // Insert settings webview, for addWebviews function call\n const webviews = utils.settings.webviews.concat([{ url: \"settings.html\" }]);\n\n addWebviews(\"#content\", webviews, watcher);\n addWebviewButtons(\"#leftpanel\", utils.settings.webviews, watcher);\n setUpSettingsPage(watcher);\n addBeforeUnload();\n\n // Add a custom scrollbar to leftpanel (panel with webview buttons)\n // eslint-disable-next-line no-new\n new PerfectScrollbar(\"#leftpanel\");\n}", "title": "" }, { "docid": "7b099cfe2683b13ad1e44c6774baa17b", "score": "0.51305526", "text": "setup(){\n\t}", "title": "" }, { "docid": "30f427a3ffee31ff75152b0f133e9101", "score": "0.51249695", "text": "function setup(command) {\n // this.setClient(command);\n sketchSubscribe(this.onNewInput);\n }", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.51238793", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.51238793", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.51238793", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.51238793", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.51238793", "text": "function setup() {\n\n}", "title": "" }, { "docid": "a65a6ed566a16c6a453e178c5c59a182", "score": "0.5123107", "text": "function createWorker()\n {\n var childWorkerId = workerPool.createWorkerFromUrl('js/'+WORKER_FILENAME);\n workerPool.sendMessage([\"3..2..\", 1, {helloWorld: \"Hello world!\"}], childWorkerId);\n }", "title": "" }, { "docid": "0a9c1299d1d55d259439e7c66cf862e4", "score": "0.5111406", "text": "started (broker) {\n\n\t}", "title": "" }, { "docid": "91f6ad9deb04691f8db5ea0d33bef46f", "score": "0.5111373", "text": "function setup$13 () {\n // generate a secret nonce\n requestNonce = '' + crypto.randomBytes(4).readUInt32LE(0);\n\n // setup the protocol handler\n electron.protocol.registerHttpProtocol('beaker',\n (request, cb) => {\n // send requests to the protocol server\n cb({\n method: request.method,\n url: `http://localhost:${serverPort}/?url=${encodeURIComponent(request.url)}&nonce=${requestNonce}`\n });\n }, err => {\n if (err) {\n throw new Error('Failed to create protocol: beaker. ' + err)\n }\n }\n );\n\n // create the internal beaker HTTP server\n var server = http.createServer(beakerServer);\n listenRandomPort(server, { host: '127.0.0.1' }, (err, port) => { serverPort = port; });\n}", "title": "" }, { "docid": "d9e1a48cfc156c456a2ba1683dac1506", "score": "0.51053286", "text": "function init_issue(){\n\n var main = document.getElementsByClassName(\"toolbar-split toolbar-split-left\")[0];\n if(main === null || main == undefined ){\n ms = 500\n console.log(\"DONE LABEL EXTENSION : Not loaded yet, trying in \"+ms+\" mileseconds\");\n setTimeout(init_issue,ms);\n }else{\n //add button \n var button_done = document.createElement(\"BUTTON\"); \n button_done.innerHTML = '<span class=\"material-icons\">check_circle_outline</span>';\n button_done.setAttribute(\"id\", \"button_done\");\n button_done.setAttribute(\"class\", \"aui-button aui-button-primary\");\n button_done.setAttribute(\"title\", \"Done\");\n main.appendChild(button_done);\n document.getElementById(\"button_done\").addEventListener(\"click\", add_label);\n document.getElementById(\"button_done\").style.marginRight = \"2px\";\n }\n }", "title": "" }, { "docid": "80300364446a487236352377d7b7ab01", "score": "0.50866956", "text": "preTasks() {\n if( this.isSetup() ) {\n this.startTasks();\n } else {\n this.handleNoFile();\n }\n }", "title": "" }, { "docid": "0d42954ad1c35c9641e38ddf86a15432", "score": "0.5086501", "text": "function startup(data, reason) {\n exitObserver = new SyncOnExitObserver();\n}", "title": "" }, { "docid": "ed512fa2b0ae6e3ffc32a5f3315c0b8c", "score": "0.5084014", "text": "async setup() {\n await this.connect();\n this.registerSubscribeMethods();\n }", "title": "" }, { "docid": "1bced4d788edfdb5fa3b7800f9d6f5d9", "score": "0.50815314", "text": "install() {\n // this.log('[install] step ignored.');\n }", "title": "" }, { "docid": "5282b4f43187b2035753aa9fef866f8b", "score": "0.50810504", "text": "function setup() {\n\tconsole.log('Mosca server is up and running');\n\tdocument.getElementById('mqtt-status').innerText = \"Running\";\n\tstart_button.innerText = \"Stop MQTT Broker\";\n\tserver_status = \"running\";\n}", "title": "" }, { "docid": "2976bf96615340028580c67dddd462a2", "score": "0.50721854", "text": "init() {\n this.once('sync', () => this.emit('ready'))\n this.sync()\n }", "title": "" }, { "docid": "750eda3d9baf9d88b2b56e05ccefc66e", "score": "0.5068983", "text": "function setup() {\n // theme\n createCanvas(windowHeight, windowHeight);\n background(0);\n noStroke();\n textFont(myFont);\n textSize(32);\n textAlign(CENTER, CENTER);\n\n // set up focus and cards\n setupFocus();\n setupCards();\n\n // set up ui element objects\n note = new Notification(0, 1);\n stats = new Stats();\n videoInterface = new Interface();\n history = new History();\n\n // start screen progress bar\n startProgressBar = new ProgressBar(width / 2, height / 2 + height / 8, RED);\n startProgressBar.start = true;\n}", "title": "" }, { "docid": "d4b6ca3b86ca41b29043d05e63e6387a", "score": "0.50608706", "text": "function init() {\n droppy.wsRetries = 5; // reset retries on connection loss\n if (!droppy.initialized) sendMessage(null, \"REQUEST_SETTINGS\");\n if (droppy.queuedData) {\n sendMessage();\n } else {\n // Create new view with initializing\n getLocationsFromHash().forEach((string, index) => {\n const dest = join(decodeURIComponent(string));\n newView(dest, index);\n });\n }\n}", "title": "" }, { "docid": "ef0388b4c189f4983b9c1c8f5747b312", "score": "0.5059936", "text": "function setup(){\n}", "title": "" }, { "docid": "ef0388b4c189f4983b9c1c8f5747b312", "score": "0.5059936", "text": "function setup(){\n}", "title": "" }, { "docid": "ef0388b4c189f4983b9c1c8f5747b312", "score": "0.5059936", "text": "function setup(){\n}", "title": "" }, { "docid": "ef0388b4c189f4983b9c1c8f5747b312", "score": "0.5059936", "text": "function setup(){\n}", "title": "" } ]
3be4c6f9803610d09abd8c834185d739
Task Complete check function
[ { "docid": "358e154069463073486e25d48aa0cabc", "score": "0.0", "text": "function checkboxClicked(index) {\r\n let getLocalStorageData = localStorage.getItem(\"New Todo\");\r\n listArray = JSON.parse(getLocalStorageData);\r\n const element = document.getElementById(\"checkbox_\"+index);\r\n const liChecked = document.getElementById(\"list_li_\"+index);\r\n const fulllist = document.getElementById(\"list_\"+index);\r\n if(element.classList.contains('checkbox')) {\r\n element.classList.add(\"checkbox-completed\");\r\n element.classList.remove(\"checkbox\");\r\n liChecked.classList.add(\"completed\");\r\n liChecked.style.opacity = '0.3';\r\n fulllist.setAttribute('data-complete' , 'true');\r\n listArray[index].completed = true;\r\n localStorage.setItem(\"New Todo\", JSON.stringify(listArray));\r\n }else{ \r\n element.classList.remove(\"checkbox-completed\");\r\n element.classList.add(\"checkbox\");\r\n liChecked.classList.remove(\"completed\");\r\n fulllist.setAttribute('data-complete', 'false');\r\n listArray[index].completed = false;\r\n localStorage.setItem(\"New Todo\", JSON.stringify(listArray));\r\n if(lightMode === 'enabled'){\r\n liChecked.style.opacity = .7;\r\n }\r\n else{\r\n liChecked.style.opacity = 1;\r\n }\r\n }\r\n checkTaskRemaining();\r\n}", "title": "" } ]
[ { "docid": "d866021579aeda6431e5fc230d8741d5", "score": "0.76647866", "text": "function tasksComplete() {}", "title": "" }, { "docid": "9ee9ac791fc6add4d5398daf394bbda4", "score": "0.72366714", "text": "function U1_checkData(task) {\n return task.name && task.status == 'Complete' && task.progress == '100';\n}", "title": "" }, { "docid": "f072f9df7d44dca3b67ec917120c0bc2", "score": "0.7206214", "text": "function checkandfinish() {\n var completed = true;\n for (var prop in complete) {\n completed = completed && complete[prop];\n }\n if (completed) {\n assertwatcher.emit('done');\n }\n }", "title": "" }, { "docid": "95cb9d7467383ea8ab7854337a74a97b", "score": "0.71011376", "text": "function checkCompleteStat() {\r\n for (i=0; i < tasks.length; i++) {\r\n if (tasks[i].checked === true) {\r\n enableComplete();\r\n return;\r\n }\r\n }\r\n disableComplete();\r\n}", "title": "" }, { "docid": "35b75b9aec48aef0623139b0576a8d4a", "score": "0.7097946", "text": "function U0_checkData(task) {\n return task.name && task.status != 'Complete';\n}", "title": "" }, { "docid": "af16492f177296d7fd136e893d126195", "score": "0.708607", "text": "taskCompleted() {\n if (--this.numTasks === 0) {\n this.onCompletion();\n }\n }", "title": "" }, { "docid": "c7551b78e796b1366e5a35a0f9e770bc", "score": "0.70781493", "text": "function taskeComplete(code) {\n\t\tif (etasks.length == 0) return false;\n\t\t/* When task was completed */\n\t\tif (code.replace(/\\s+/g, '').match(etasks[currenteTask].verification)) {\n\t\t\tcurrenteTask += 1;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "33df07407ffdb977a1bbfe33f37530f1", "score": "0.70581347", "text": "isDone() {}", "title": "" }, { "docid": "9e406a57461b58881d0bc9764232b89a", "score": "0.6872674", "text": "function checkTaskEnd() {\n if(!debug) {\n remainingOutputs -= 1;\n if (remainingOutputs === 0) {\n callback();\n }\n } else {\n // If dev mode, we signal the end of the task once\n // in order to keep executing following tasks\n // but watchify is still monitoring bundle modifications\n if (typeof callback === 'function') {\n callback();\n callback = null;\n }\n }\n }", "title": "" }, { "docid": "ae9af62e334b2b9abde5f5667804bc00", "score": "0.6854762", "text": "function checkDone() {\n expected_successes_remaining--;\n if(expected_successes_remaining === 0) {\n done();\n }\n }", "title": "" }, { "docid": "b499322d8c849816dc30931dbc7067ee", "score": "0.6821506", "text": "function U2_checkData(task) {\n return task.name && task.status == 'New' && task.progress == '0';\n}", "title": "" }, { "docid": "3e8903ef718e1b297fe634da15064f48", "score": "0.67096466", "text": "isComplete(){return true;}", "title": "" }, { "docid": "3e8903ef718e1b297fe634da15064f48", "score": "0.67096466", "text": "isComplete(){return true;}", "title": "" }, { "docid": "43b4b8e11967529bd7e9c30f78b5525c", "score": "0.6679765", "text": "check() {\n this.erledigt = true;\n TodoList.onUpdateTask(this);\n return true;\n }", "title": "" }, { "docid": "6fa038ae704f09df1c8af17fa30d4a33", "score": "0.66696674", "text": "function taskComplete() {\n\t\ttaskCompleteCount++;\n\t\tvar completion = (taskCompleteCount / taskCount * 100);\n\t\tcompletion = Math.round(completion * 10) / 10;\n\t\tlog(\"Initialisation is: \" + completion + \"% complete\");\n\t\t// log(\"Started task complete\");\n\t\tif (isPhaseComplete(phase)) {\n\t\t\tlog(\"*** Phase complete: \" + phase + \" ***\");\n\t\t\tphase++;\n\t\t\tstartPhase(phase);\n\t\t}\n\t}", "title": "" }, { "docid": "60099f3fd16f9666d5851e9a1e7384c3", "score": "0.65688765", "text": "async isDone() {\n if (this.parameters.numberOfTasks === 0) return true;\n const multipleConfig = this.config.multiple || {};\n const shouldCheck = this.shouldCheckTaskStatus(multipleConfig);\n const filter = [{\n property: FIELD_NAMES.MULTIPLE_TAG,\n value: this.parameters[FIELD_NAMES.MULTIPLE_TAG],\n }];\n return shouldCheck\n ? this.areTasksFinished(filter, this.parameters.numberOfTasks)\n : false;\n }", "title": "" }, { "docid": "5fe8aca142c62fe14b57a21418ff13a0", "score": "0.6533611", "text": "function check_task_result(task) {\n\t\tswitch(task.state) {\n\t\t\tcase \"run\":\n\t\t\t\t// no error was reported, print ok\n\t\t\t\ttask.state = \"ok\";\n\t\t\t\tsuccess(task);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\t// print error\n\t\t\t\tfor (var i = 0; i < task.debug_log.length; ++i) {\n\t\t\t\t\tconsole.log(task.debug_log[i]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// uknown or undefined state, error\n\t\t\t\tlog.error = \"check_task_result(): uknown task state =\"+task.state+\";\";\n\t\t\t\tbreak;\n\t\t}\n\t\ttask.state = \"done\";\n\t}", "title": "" }, { "docid": "e53db0a5e6e999a02c454b07a88632fe", "score": "0.6527087", "text": "function checkSucess() {\n setTimeout(function() {\n if (recordingSaved && hungup && answered) {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "title": "" }, { "docid": "829bc73cb7cbbccff6da6e21111c328a", "score": "0.65025103", "text": "complete() {}", "title": "" }, { "docid": "27a845438750aa129c8ebb3e7fa7e69b", "score": "0.6471629", "text": "function completeTask(event) {\n let checkBox = event.target;\n //get the specific task based on which checkbox was clicked\n let selectTask = JSON.parse(localStorage.getItem(checkBox.name));\n selectTask.completed = !selectTask.completed;\n localStorage.setItem(selectTask.name, JSON.stringify(selectTask));\n checkIfCompleted(selectTask, checkBox, checkBox.parentElement);\n numTasksLeft.textContent = checkHowManyLeft();\n}", "title": "" }, { "docid": "b61dab3731fe8b01c10a8224578bd472", "score": "0.6459284", "text": "function checkComplete(){\n //update the number of completed requests\n if(this.onUpdate){\n this.onUpdate(this.completedRequests.length, this.$images.length); \n }\n\n //run the oncomplete images function well all images loaded\n if (this.completedRequests.length === this.$images.length) {\n if(this.onComplete){ \n this.onComplete();\n }\n }\n }", "title": "" }, { "docid": "7ef7696cdc9cf7da3380949f83d3931e", "score": "0.6444637", "text": "function checkHandler() {\n console.log(task.IsDone);\n if (isChecked) {\n task.IsDone = false;\n }\n else {\n task.IsDone = true;\n }\n // trigger angular function to call server\n updateTask(task);\n }", "title": "" }, { "docid": "382c8af05e7428186fed0e260e20e849", "score": "0.64110327", "text": "function taskCompleteShouldWeAbort() {\n if (!self.haveActiveTask())\n debug && console.log(\"BUG should not call this without an active task\");\n var weWereStopped = (self.activeTask() == self.stoppingTaskId);\n\n // clear out our task always\n self.activeTask('');\n\n if (self.restartPending()) {\n debug && console.log(\"Need to start over due to restart\");\n log.debug(\"Restarting...\");\n self.restartPending(false);\n self.loadMainClasses(success, failure);\n // true = abort abort\n return true;\n } else if (weWereStopped) {\n debug && console.log(\"Stopped, restart not requested\");\n log.debug(\"Stopped\");\n // true = abort abort\n return true;\n } else {\n // false = continue\n return false;\n }\n }", "title": "" }, { "docid": "6b3a3e8805ca9551cf9fbedbd46cb92c", "score": "0.64104724", "text": "function checkSucess() {\n setTimeout(function() {\n if (recordingSaved && promptFinished && answered) {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "title": "" }, { "docid": "548f200775462fe4650dfef662e4b597", "score": "0.64101446", "text": "function checkIfComplete()\n {\n if(isComplete==false)\n {\n isComplete=true;\n }\n else\n {\n place='second';\n }\n }", "title": "" }, { "docid": "a666b20d9c1c2a6d421d1344198f672d", "score": "0.6407911", "text": "_checkEnd () {\n if (this.informers.every(informer => informer.isDone)) {\n this._status = 3;\n this.emit('change', this._composeChangeEvent());\n this.complete();\n }\n }", "title": "" }, { "docid": "8b1eddf86e59ed3dae3fcb5f95463f88", "score": "0.63899904", "text": "done() {\n if (this.isDone || !this.hasBeenRun)\n return Abort;\n // If instruction was called with WHEN clear any timeout\n if (this.itvlWhen)\n clearInterval(this.itvlWhen);\n this.isDone = true;\n console.log(this.content+\" (\"+this.type+\") done\");\n }", "title": "" }, { "docid": "56dd83b789b3434dc5427e6b320f0404", "score": "0.6388418", "text": "function checkIfcomplete() {\n if (isComplete == false) {\n isComplete = true;\n } else {\n place = 'second';\n }\n }", "title": "" }, { "docid": "8c6fb7bf436db9451c76f08882c05d8f", "score": "0.6353542", "text": "function done() {\n // Every time a task is done we're going to increment this counter\n tasks_done++;\n // If we reach the total of calls finished we can run our final callback, which we receive as one of the params\n if (tasks_done === tasks.length) {\n callback();\n }\n }", "title": "" }, { "docid": "d3bcbcfe87468fd78fbfa3518798f52b", "score": "0.6352331", "text": "checkTask(index) {\n this.tasks[index].check();\n }", "title": "" }, { "docid": "8559e40761e1a63ae76c9e98b713f14d", "score": "0.6350689", "text": "function checkIfComplete() {\n\t\t\tif ( isComplete == false) {\n\t\t\t\tisComplete = true;\n\t\t\t} else { \n\t\t\t\tplace = 'second';\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "670c9ff403689c7202b4fbfbc05e360d", "score": "0.634228", "text": "function checkDone(){\n var todo = 0;\n if(todo === 0)\n {\n todo = Number($(\"#itemCount\").val());\n }\n window.console.log('todo', todo);\n var complete = (function() {\n var done = 0;\n $(\".itemComplete\").each(function(){\n if($(this).val() === \"true\"){\n done += 1;\n }\n });\n return done;\n })();\n window.console.log('complete', complete);\n if(todo === complete){\n window.console.log('done');\n onComplete();\n }\n}", "title": "" }, { "docid": "f18a72f0552a6a92efac87c3afb786e5", "score": "0.63392097", "text": "async updateTask() {\n // Add an if statement here that checks if an object has been marked complete?\n // A button will then change the status with this function? \n try {\n const response = await db.any(\n `UPDATE tasks \n SET completion_status = true\n WHERE user_id = '${this.user_id}';`\n )\n return response;\n\n } catch(error) {\n console.error('ERROR: ', error);\n return error\n }\n }", "title": "" }, { "docid": "fb0a18c7b08a2ce4a9fca32fc4bff42a", "score": "0.63377285", "text": "taskDone() {\n\t\tthis.taskManager.updateTask();\n\t\tthis.taskView.displayTask(this.taskManager.task, Timer, this.taskDone);\n\t\tthis.taskView.showStatusModal();\n\t\tTaskNotification.showNotification(\"Task Manager\", \"A task has been successfully completed\");\n\t}", "title": "" }, { "docid": "513dd2a221fbb5d98dc8205da37d7b83", "score": "0.6336577", "text": "function checkIfComplete() {\n\n if( isComplete == false ) {\n isComplete = true;\n } else {\n place = 'second';\n }\n\n }", "title": "" }, { "docid": "7b783734745b9f71b50d6e9fe2e9766c", "score": "0.6305285", "text": "function checkIfComplete() {\n\t\tif( isComplete == false ) {\n\t\t\tisComplete = true;\n\t\t} else {\n\t\t\tplace = 'second';\n\t\t}\n\t}", "title": "" }, { "docid": "6b4cda708b33f2fd9a715de74107c9f5", "score": "0.62965524", "text": "function handleComplete() {\n console.log('Completing', this);\n completeTask($(this).data(\"id\"), \"false\");\n}", "title": "" }, { "docid": "12a9b55a313c9dda6cff165a0dda4f52", "score": "0.62939906", "text": "function isComplete(task) {\n \n for(i = 0; i < taskList.length; i++){\n for(j = 0; j < taskList[i].tasks.length; j++) {\n if(task === taskList[i].tasks[j].taskName) {\n if(taskList[i].tasks[j].isComplete === \"true\") {\n taskList[i].tasks[j].isComplete = \"false\";\n return true;\n } else {\n taskList[i].tasks[j].isComplete = \"true\";\n return false;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "581e9078a84910009a1b232eab1cbef3", "score": "0.6280681", "text": "function Complete()\n\t{\n\t\tcompleted = true;\n\t}", "title": "" }, { "docid": "2ba88c3bc27e4ad7acc7c939a76d04c8", "score": "0.62677336", "text": "function checkForCompletion() {\n if (queuedObjects.length === 0) {\n returnCallback(derezObj);\n } \n }", "title": "" }, { "docid": "79f79beecf0e315926e56e479c8adce1", "score": "0.62571025", "text": "isComplete() {\n return this.progress.done;\n }", "title": "" }, { "docid": "3619b495201bf05e479da77d49c5798f", "score": "0.62486726", "text": "checkDone() {\n\t\t//finally check if we've finished completing the tweet\n\t\tconsole.log('checking to see if we completed the entire tweet');\n\t\tif (this.droppedWords.length === this.extractedWords.length) {\n\t\t\tthis.success();\n\t\t\treturn true;\n\t\t}\n\t\telse return false\n\t}", "title": "" }, { "docid": "124f5dffc6bcbbe003d41e21714e013c", "score": "0.6248584", "text": "function extra () {\n if (errand.done) {\n ctrl.tasks.done = true;\n } else {\n ctrl.tasks.done = false;\n };\n }", "title": "" }, { "docid": "81113cc572ccda142db275ccb392b3b4", "score": "0.6216275", "text": "isDone() {\n return (\n ['ABORTED', 'FAILURE', 'SUCCESS', 'COLLAPSED'].includes(this.status) ||\n (this.status === 'UNSTABLE' && !!this.endTime)\n );\n }", "title": "" }, { "docid": "b4cbec6f56030492cff092b1083c9d9c", "score": "0.62028956", "text": "isComplete () { return this.complete }", "title": "" }, { "docid": "b5dfc3017065a50b714d7125744680da", "score": "0.6168306", "text": "function whenDoneCheck(doneCounter, length) {\r\n spinner.resolve();\r\n if (doneCounter >= length) {\r\n //updateOldMerchantSettings(spinner, alreadyCreated);\r\n }\r\n }", "title": "" }, { "docid": "94b5b5fd58e85ed33b2e88bac4b9020c", "score": "0.61616504", "text": "function handleTaskCheckClick() {\n var taskData = getTaskData(this);\n task.update(taskData.key, false, !taskData.isComplete);\n}", "title": "" }, { "docid": "d0c9d798e397c0f0d537004d07a59bdb", "score": "0.61398125", "text": "function checkForCompletion() {\n\t if (queuedObjects.length === 0) {\n\t returnCallback(derezObj);\n\t } \n\t }", "title": "" }, { "docid": "1445ae0437a43ea9945e6f92d75041bf", "score": "0.61320674", "text": "function taskFinished() {\n tasksOpen--;\n if (tasksOpen === 0) {\n done();\n }\n }", "title": "" }, { "docid": "4ea798d44780c5e9bd91e6b8a52fc8b7", "score": "0.6131003", "text": "function checkDone () {\n if (isBrowserChecking) { return } // still checking\n\n // done, emit based on result\n if (isBrowserUpdated) {\n setUpdaterState(UPDATER_STATUS_DOWNLOADED);\n } else {\n setUpdaterState(UPDATER_STATUS_IDLE);\n }\n }", "title": "" }, { "docid": "c9e9c79969caf353e35a63fb9bbe8cee", "score": "0.6128795", "text": "function taskDone() {\n\t\t//task unone\n\t\t$('i.fas.fa-check-circle').click( function() {\n\t\t\tlet parent = $(this).parent();\n\t\t\tparent.removeClass('light');\n\t\t\tparent.children('.fas.fa-check-circle').hide();\n\t\t\tparent.children('.far.fa-check-circle').show();\n\t\t});\n\t\t//task done\n\t\t$('i.far.fa-check-circle').click( function() {\n\t\t\tlet parent = $(this).parent();\n\t\t\tparent.addClass('light');\n\t\t\tparent.children('.fas.fa-check-circle').show();\n\t\t\tparent.children('.far.fa-check-circle').hide();\n\t\t})\n\t}", "title": "" }, { "docid": "2c77ed33e499a6ca2e90a050149334aa", "score": "0.6115563", "text": "_readyToRunTask(...args) {\n if (Object.keys(this.tasks).some(key => {\n const task = this.tasks[key];\n return task.running === true && task.blocking === true;\n })) return false;\n\n return super._readyToRunTask(...args); // eslint-disable-line no-underscore-dangle\n }", "title": "" }, { "docid": "c66bf2e7f4e36d37a7f5d63b3d7ac712", "score": "0.61127174", "text": "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "title": "" }, { "docid": "f4749adc84f2cb1bb87aa5f991593e35", "score": "0.61024696", "text": "function checkCourseCompletion(){\n\t\t\tif (completeCh == true) {\n bookmarkingData.save(function () {\n var statements = [];\n statements.push({\n\t\t\t\t\t\tverb: {\n\t\t\t\t\t\t\tid: \"http://adlnet.gov/expapi/verbs/completed\",\n\t\t\t\t\t\t\tdisplay: {\n\t\t\t\t\t\t\t\t \"en-US\": \"completed\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext: XCELlesson.getContext(),\n\t\t\t\t\t\tresult: {\n\t\t\t\t\t\t\tduration: \"PT0S\"\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\ttincan.sendStatements(statements, function () {});\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2ca14ddcffe8a4ba0c84e1325d1f9750", "score": "0.60826397", "text": "finishTask(item) {\n\t\tthis.props.complete(item.key);\n\t}", "title": "" }, { "docid": "bcef97afc475ffa5c9dbda2cca63c4ac", "score": "0.6079195", "text": "function _checkIfReady () {\n // Safe to return early if we already found the job\n if(found) {\n self.rt.off('jobfinish', _checkIfReady)\n return;\n }\n\n // Otherwise look through the finished jobs\n self.rt.jobsfinished.forEach(function (id) {\n if (self.job[1] === id) {\n found = true\n self.rt.off('jobfinish', _checkIfReady)\n _.defer(cb)\n }\n })\n }", "title": "" }, { "docid": "ca71f5c2e2054d90ddfbea9210d8752f", "score": "0.6052344", "text": "function completeTaskHandler(){\n completeTask($(this).data(\"id\"));\n}//end completeTaskHandler", "title": "" }, { "docid": "408bf1cd0404b6d302e57e8cdda633bb", "score": "0.6051078", "text": "isAllCompleted() {\n return (this.incomplete <= 0)\n }", "title": "" }, { "docid": "2c8abf3bd4d8851627fe27c7be7158b6", "score": "0.6045186", "text": "isComplete() { return this._behavior('is complete'); }", "title": "" }, { "docid": "066c444875dca9cae0cfc77fc68f7a2a", "score": "0.6025639", "text": "function gee_checkTaskDone() {\n if (GEE_interval == '' && GEE_cancelled == 0) {\n alert('Got called but GEE interval is empty.');\n }\n\n if (GEE_delay < 6) {\n // If you are cutting only small globes, you might want to\n // just set this to 1 or even 0.\n GEE_delay += 1;\n }\n\n if (GEE_running_get_data_sequence) {\n var url = '/cgi-bin/globe_cutter_app.py?cmd=BUILD_DONE&uid=' + GEE_uid +\n '&globe_name=' + GEE_globe_name + '&delay=' + GEE_delay +\n '&is_2d=' + GEE_is_2d + GEE_force_arguments;\n jQuery.get(url, function(is_running) {\n // If still running, keep checking until the task is done.\n if (is_running.substr(0, 1) == 't') {\n gee_checkTaskDone();\n // Once it is done, go to the next task in the sequence.\n } else {\n GEE_delay = 0;\n if (is_running.indexOf('FAILED') >= 0) {\n GEE_appendStatus(is_running);\n GEE_cleanUp();\n } else {\n packet_info = is_running.split(' ');\n msg = '<br/>';\n if (GEE_is_2d != 't') {\n msg += packet_info[0] + ' image packets<br/>';\n msg += packet_info[1] + ' terrain packets<br/>';\n msg += packet_info[2] + ' vectors packets';\n } else {\n msg += ' map tiles read<br/>';\n }\n GEE_appendStatus(msg);\n GEE_runNextAjaxSequenceItem();\n }\n }\n });\n }\n}", "title": "" }, { "docid": "bd8f2e2d2cc2ee82b93956c1b7615967", "score": "0.60193384", "text": "function completeTask(resolve) {\n\t$msgs.children().last().append(\"Complete\");\n\tsetTimeout(resolve);\n}", "title": "" }, { "docid": "05b4dcbfe69e1241b56d604d418d134f", "score": "0.6006521", "text": "onFinishedTask() {\n\n this.currentTask = null;\n this._setStateWaiting();\n\n }", "title": "" }, { "docid": "55602dd1134c383aff8f0d02288fd129", "score": "0.60025597", "text": "function taskStarted() {}", "title": "" }, { "docid": "9d493a08b1d085a7a9b0d8433c114efe", "score": "0.6002202", "text": "function urlCheckFinish() {\n console.log('######=>All url checked<=######');\n console.log('Total Url Checked: ', totalUrlCheck);\n console.log('Total valid Urls: ', totalValidUrl);\n console.log('Total invalid urls: ', totalInvalidUrl);\n process.exit();\n}", "title": "" }, { "docid": "a1eb3155b0dac3fad0215f8978da2f56", "score": "0.59933853", "text": "function done(err) {\n\t\t\t\t\tif (!isDone) isDone = true\n\t\t\t\t\telse throw new Error(\"'\" + arg + \"()' should only be called once.\")\n\t\t\t\t\tif (timeout === undefined) console.warn(\"# elapsed: \" + Math.round(new Date - s) + \"ms, expected under \" + delay + \"ms\\n\" + o.cleanStackTrace(task.err))\n\t\t\t\t\tfinalizeAsync(err)\n\t\t\t\t}", "title": "" }, { "docid": "8ca6db0ac5c27d14b3f368a2f6260b34", "score": "0.59883624", "text": "function nextTask() {\n console.log(\"done!\")\n}", "title": "" }, { "docid": "057057283a45f907ed73e6042eaafba7", "score": "0.598105", "text": "get incomplete() {\n return this.tasks.some((task) => !task.done);\n }", "title": "" }, { "docid": "fce0340028d2450110d0041203e18cd8", "score": "0.5979464", "text": "complete() {\n this._done('complete');\n }", "title": "" }, { "docid": "f830f7147c786652e7635fc775b278ca", "score": "0.59639496", "text": "function hasCompleted() {\n\t//stop timer\n\tclearInterval(timerInterval);\n\t//completion modal\n\tswal({\n\t title: \"Good job!\",\n\t content: generateSwalRemarks(),\t \n\t icon: \"success\",\n\t button: \"Restart!\",\n\t}).then((value) => {\n\t restartGame();\n\t});\n}", "title": "" }, { "docid": "19af1cb1e22ba362c4ca60a45ddc1e6e", "score": "0.5946302", "text": "function handleCompletionStatusChecked() {\n var taskId = getElementTaskId(this);\n var completed = $(this).is(\":checked\");\n sendTaskCompletion(taskId, completed);\n}", "title": "" }, { "docid": "8990bc4f8fda226e1e7ec5d7d11d56f5", "score": "0.59365934", "text": "function done(){\n\t\ts.working = false;\n\t}", "title": "" }, { "docid": "63043a9b5a0fd6aff500b32635160a1e", "score": "0.5936074", "text": "get done()\n {\n return [\n nsIDM.DOWNLOAD_FINISHED,\n nsIDM.DOWNLOAD_BLOCKED_PARENTAL,\n nsIDM.DOWNLOAD_BLOCKED_POLICY,\n nsIDM.DOWNLOAD_DIRTY,\n ].indexOf(this.state) != -1;\n }", "title": "" }, { "docid": "48c640c4be8256af761a8db433378e6a", "score": "0.5934069", "text": "finishProcessing () {\n this.submitting = false\n this.submitted = false\n this.succeeded = true\n }", "title": "" }, { "docid": "5470402e1bea3af6edcf65ad0f9c5390", "score": "0.59315413", "text": "function finalizeAsync(err) {\n\t\t\t\t\tif (err == null) {\n\t\t\t\t\t\tif (task.err != null) succeed(new Assert)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (err instanceof Error) fail(new Assert, err.message, err)\n\t\t\t\t\t\telse fail(new Assert, String(err), null)\n\t\t\t\t\t}\n\t\t\t\t\tif (timeout !== undefined) timeout = clearTimeout(timeout)\n\t\t\t\t\tif (current === cursor) next()\n\t\t\t\t}", "title": "" }, { "docid": "0772ec8df5a10658586fa9b8acf08fc9", "score": "0.5927094", "text": "function isDone() {\n return STATUS_DONE_ === getStatus_(KEY_CONTEXT_);\n}", "title": "" }, { "docid": "edda27589950e1ae9ac23f96ad0846e2", "score": "0.59266764", "text": "function waitForDone(callback) \n\t{\n\t\tfunction getResult(id) \n\t\t{\n\t\t\tsforce.metadata.checkDeployStatus(id, callback);\n\t\t}\n\t\tfunction check(results) \n\t\t{\n\t\t\tsetTimeout(function()\n\t\t\t{\n\t\t\t\tvar done = results[0].getBoolean(\"done\");\n\t\t\t\tif(!done) \n\t\t\t\t{\n\t\t\t\t\tsforce.metadata.checkStatus([results[0].id], check);\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tgetResult(results[0].id);\n\t\t\t\t}\n\t\t\t}, 2000);\n\t\t}\n\t\treturn function (result) \n\t\t{\n\t\t\tcheck([result]);\n\t\t};\n\t}", "title": "" }, { "docid": "c8f0405d54ba4371b0fce5fb9682bb21", "score": "0.59245014", "text": "done() {}", "title": "" }, { "docid": "c8f0405d54ba4371b0fce5fb9682bb21", "score": "0.59245014", "text": "done() {}", "title": "" }, { "docid": "91a160be3734f64ddf5b555f9fb1636f", "score": "0.5917077", "text": "notEmpty(newTask) {\n if (newTask) {\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "e930e038ceb4b8b6d7435fe0c8f8f638", "score": "0.5913489", "text": "function oncomplete() {\r\n if (totalCount < (recordCheck - recordFound - findErrorNum) || photocounter !== 0) {\r\n if (totalCount % 100 === 0) {\r\n console.log('A total of ' + totalCount + ' records were added and ' + recordCheck + ' records checked.');\r\n io.emit('console', 'A total of ' + String(totalCount) + ' records were added and ' + String(recordCheck) + ' records checked.');\r\n }\r\n return;\r\n } else {\r\n console.log('A total of ' + totalCount + ' records were added and ' + recordCheck + ' records checked.');\r\n io.emit('console', 'A total of ' + String(totalCount) + ' records were added and ' + String(recordCheck) + ' records checked.');\r\n db.close();\r\n res.redirect('/');\r\n }\r\n }", "title": "" }, { "docid": "e930e038ceb4b8b6d7435fe0c8f8f638", "score": "0.5913489", "text": "function oncomplete() {\r\n if (totalCount < (recordCheck - recordFound - findErrorNum) || photocounter !== 0) {\r\n if (totalCount % 100 === 0) {\r\n console.log('A total of ' + totalCount + ' records were added and ' + recordCheck + ' records checked.');\r\n io.emit('console', 'A total of ' + String(totalCount) + ' records were added and ' + String(recordCheck) + ' records checked.');\r\n }\r\n return;\r\n } else {\r\n console.log('A total of ' + totalCount + ' records were added and ' + recordCheck + ' records checked.');\r\n io.emit('console', 'A total of ' + String(totalCount) + ' records were added and ' + String(recordCheck) + ' records checked.');\r\n db.close();\r\n res.redirect('/');\r\n }\r\n }", "title": "" }, { "docid": "fecc2006206a6c5ba5fb39aced39ea6b", "score": "0.5910909", "text": "function checkStatus() {\n // done: the whole input is parsed\n // dbqueue == 0: Nothing is queued for writing\n if (_osm_parser.status.done && _osm_parser.status.dbqueue == 0) {\n clearTimeout(heartbeatTimerId);\n\n if (heartbeat) heartbeat(_osm_parser.status);\n callback(null);\n } else {\n setTimeout(checkStatus,300);\n }\n }", "title": "" }, { "docid": "70667604b51dfea5d012d3bd020e3468", "score": "0.59086865", "text": "function checkIfCompleted(resolve, reject, counter) {\n var interval = 2000, timeout = 60 * 1000;\n var delay = counter == 0 ? 16000 : interval;\n var timeElapse = (counter > 0 ? (16000 - interval) : 0) + counter * interval;\n if (timeElapse > timeout) {\n reject('Start emulator timeout. Discard!');\n return;\n } else {\n console.log('Check if completely started, time elapse = ' + timeElapse);\n };\n setTimeout(function() {\n counter++;\n childProcess.exec(`adb -e shell getprop init.svc.bootanim`, (error, stdout, stderr) => {\n if (error) {\n console.error('Check if completed error:', error);\n checkIfCompleted(resolve, reject, counter);\n } else if ((stdout || '').startsWith('stopped')) {\n console.log('Check if completed successfully:', stdout);\n resolve('Android emulator has completed started.' + stdout);\n } else {\n console.log('Check if completed nearly finished!', stdout);\n checkIfCompleted(resolve, reject, counter);\n }\n });\n }, delay);\n }", "title": "" }, { "docid": "387f841679341495556d0129cdc79155", "score": "0.5901751", "text": "function tryUpdateTask() {\n if (checkAllValuesAreNotEmpty([inputname.value, urgency.value, type.value])) {\n updateTask()\n }\n}", "title": "" }, { "docid": "aa91cff77eb7b278cdf6d76278f165c9", "score": "0.58904254", "text": "async function test(comp){\n if(comp){\n console.log(\"Successful\");\n }\n else{\n console.log(\"Failed\");\n }\n}", "title": "" }, { "docid": "7b48b3ef3f425c1c215a7f849e2d4275", "score": "0.58837986", "text": "decideNextTask() {}", "title": "" }, { "docid": "79a156f9a920eafa2aacbd5d0cf02d62", "score": "0.58797634", "text": "function completeTask(element){\n element.classList.toggle(check)\n element.classList.toggle(uncheck)\n element.parentNode.querySelector('.text').classList.toggle(lineThrough)\n\n listArray[element.id].done = listArray[element.id].done ? false : true\n}", "title": "" }, { "docid": "3baf48b603282354494a84b633ff03ec", "score": "0.58736026", "text": "listTaskComplete( complete = true ) {\n \n console.log();\n let index = 0;\n \n this.listArr.forEach( task => {\n\n const { desc, completeAt } = task;\n const state = ( completeAt )\n ? 'Completada'.green\n : 'Pendiente'.red;\n \n if( complete ) {\n // Mostrar completadas\n if( completeAt ) {\n index += 1;\n const idx = `${ index }.`.green;\n console.log(`${ (index + '.').green } ${ desc } :: ${ completeAt.green }`);\n }\n }\n else{\n // Mostrar pendientes\n if( !completeAt ) {\n index += 1;\n console.log(`${ (index + '.').green } ${ desc } :: ${ state }`);\n }\n }\n });\n }", "title": "" }, { "docid": "958e6bd450159a1ae05140b6095898a8", "score": "0.5866767", "text": "function handleTaskComplete() {\n\t// TODO: disable buttons temporarily\n\tlet task_id = this.parentNode.parentNode.id;\n\tlet points = 0;\n\tchrome.storage.sync.get(['points', 'taskList'], function(result) {\n\t\tlet taskList = result.taskList;\n\t\tfor (let i = 0; i < taskList.length; i++) {\n\t\t\tif (taskList[i].taskID === task_id) {\n\t\t\t\tpoints = (taskList[i].complete ? -1 : 1) * taskList[i].reward;\n\t\t\t\ttaskList[i].complete = !taskList[i].complete;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tchrome.storage.sync.set({'points': result.points + points, 'taskList': taskList}, function() {\n\t\t\tconsole.log(\"Increased points by \" + points);\n\t\t\t\n\t\t\t// update displayed points\n\t\t\tlet points_el = document.getElementById(\"points-total\");\n\t\t\tpoints_el.innerHTML = \"Current Points: \" + (result.points + points);\n\t\t\t// update displayed tasklist\n\t\t\tupdateTaskList(taskList);\n\t\t});\n\t});\n\n}", "title": "" }, { "docid": "34a3c0899c379fb709c3175a1e514850", "score": "0.5852858", "text": "isFinished(count, length) {\n return(count > length);\n }", "title": "" }, { "docid": "08ce1774c7d54a37fc69de83c410666a", "score": "0.5850759", "text": "function onExecutionSucceeded() { }", "title": "" }, { "docid": "8c82ed2440a5145c9ecb2b0a8a28963b", "score": "0.5848537", "text": "function completeTask(task, callback) {\n database.serialize(function() {\n var delete_task = \"DELETE FROM \"+table_name+\" WHERE \"+table_name+\".id = ?\";\n\n log.debug('sqlite-adapter','Running query:',delete_task);\n database.run(delete_task, task.id, function(error) {\n if (error) {\n callback(error);\n }\n callback(error, this.changes);\n });\n });\n }", "title": "" }, { "docid": "31a27310db9c43b813c2d13bb2400e97", "score": "0.5846151", "text": "async function isAssignmentCompleteAsync(assignmentId) {\r\n if (assignmentId == null) {\r\n return false;\r\n }\r\n try {\r\n let revisionData = await fetchApiJson(`dropbox/${assignmentId}/${getUserId()}`);\r\n let revisions = revisionData.revision;\r\n\r\n return !!(revisions && revisions.length && !revisions[revisions.length - 1].draft);\r\n } catch (err) {\r\n Logger.warn(`Couldn't determine if assignment ${assignmentId} was complete. This is likely not a normal assignment.`);\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "b3df0aa57e65bfea20f8b8350dfe7dca", "score": "0.58419406", "text": "succeeded() {\n return this.final() && this.requiredStatuses.every(check => check.success());\n }", "title": "" }, { "docid": "003a2ff2260677b38e029e1ae1d59161", "score": "0.58410007", "text": "function complete() {\n done(); \n }", "title": "" }, { "docid": "003a2ff2260677b38e029e1ae1d59161", "score": "0.58410007", "text": "function complete() {\n done(); \n }", "title": "" }, { "docid": "003a2ff2260677b38e029e1ae1d59161", "score": "0.58410007", "text": "function complete() {\n done(); \n }", "title": "" }, { "docid": "a369e4fbea3ed993da63666c37ff3ff9", "score": "0.58311194", "text": "function isTaskCompleted(task, completed_tasks) {\n for (var i = 0; i < completed_tasks.length; i++) {\n var d = completed_tasks[i];\n var match = true;\n for (var k in task) {\n var dnorm = d[k].replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n var tasknorm = task[k].replace(/\\r/g, '\\n');\n if (!(k in d) || dnorm != tasknorm) {\n match = false;\n break;\n }\n }\n\n if (match) return true;\n }\n return false;\n}", "title": "" }, { "docid": "d65d092f9a76505db7f0035309502e67", "score": "0.58291173", "text": "function checkCompleted(goal) {\n return goal.status == status.completed;\n}", "title": "" }, { "docid": "54157d2298a5e3a68fa7ae781744bbf4", "score": "0.58277625", "text": "function completeDOMTask(evento, list = inbox){\n // detectar si se hizo click en el input\n if(evento.target.tagName === 'INPUT'){\n //completar la tarea y llamar a la funcion para\n //obtener indice\n list.tasks[getTaskIndex(evento)].complete();\n // list.tasks[getTaskIndex(evento)].prueba();\n evento.target.parentElement.classList.toggle('complete') \n }\n \n}", "title": "" }, { "docid": "9b636959c3acd2d9372f093c721b233f", "score": "0.58260334", "text": "function validationTask(action, task) {\n var old_df_id = $('body').data('definitionreadyid'),\n new_df_id = $(task).closest('.item_container').attr('data-definitionready'),\n status = $(task).closest('.column_task').attr('data-status'),\n owner = $(task).find('.user_card').attr('data-owner'),\n date = $(task).find('.calendar').val(),\n value = $(task).find('.task_item').text();\n\n if (old_df_id !== new_df_id) {\n // prevents send to a different definition of ready or different story\n if (action === \"stop\") {\n alert(msg.task_no_belong)\n }\n return false\n\n } else if ((date === undefined && status === \"verification\") || (date === undefined && status === \"done\")) {\n // prevents change status of undated tasks for \"verification\" or \"done\" status\n if (action === \"stop\") {\n alert(msg.task_undated)\n }\n return false\n\n } else if (value === msg.field_empty) {\n // verify if task value is empty\n if (action === \"stop\") {\n alert(msg.validation_error)\n }\n return false\n\n } else if (owner === undefined) {\n // prevents block change without the card being assigned to one of the team\n if (action === \"stop\") {\n alert(msg.card_assign)\n }\n return false\n\n } else {\n return true\n }\n\n}", "title": "" } ]
61ffcb4e884b4b2501a12363dea3c55c
This Componenet renders a a game interpretation of time synchronization with a time server. Users can click nodes to pause and continue their animation in an attempt to synchronize all nodes. This abstraction of time synchronization does not include RTT/2 which is an integral component of synchronization on a distributed system.
[ { "docid": "2326d1061040a2e95034fccb26b57d76", "score": "0.56372947", "text": "function NodeGame() {\n return (\n\n <div>\n <div>\n <h2 className='flex-container wrap instructions'>Click on the nodes to pause and play.</h2>\n </div>\n <div className=\"game_container\">\n <Box className=\"master_box\" />\n <hr className=\"coolLine\"></hr>\n <Box className=\"box_1\" delay={.3} />\n <Box className=\"box_2\" delay={.5} />\n <Box className=\"box_3\" delay={.7} />\n </div>\n </div>\n )\n}", "title": "" } ]
[ { "docid": "27796357b603ac18ebe1d67f8b059d03", "score": "0.6239343", "text": "function TimeConductor() {\n EventEmitter.call(this);\n\n //The Time System\n this.system = undefined;\n //The Time Of Interest\n this.toi = undefined;\n\n this.boundsVal = {\n start: undefined,\n end: undefined\n };\n\n //Default to fixed mode\n this.followMode = false;\n }", "title": "" }, { "docid": "6e2f25bc6ccb68a69b094684f41e9604", "score": "0.6139672", "text": "function updateTime() {\n var dateTime = tizen.time.getCurrentDateTime(),\n second = dateTime.getSeconds(),\n minute = dateTime.getMinutes(),\n hour = dateTime.getHours(),\n elSecIndicator = document.querySelector(\"#time-second-indicator\"),\n elMinIndicator = document.querySelector(\"#time-min-indicator\"),\n elHourIndicator = document.querySelector(\"#time-hour-indicator\");\n\n rotateElement(elSecIndicator, (second * 6));\n rotateElement(elMinIndicator, (minute + (second / 60)) * 6);\n rotateElement(elHourIndicator, (hour + (minute / 60) + (second / 3600)) * 30);\n\n document.getElementById(\"time-display\").innerHTML = \"Time: \" + hour + \":\" + minute;\n\n //if innactive\n if (stepStatus == \"NOT_MOVING\") {\n //add time unit to innactiveTime\n innactivityTime += 1000;\n updateActivityBuffer(false);\n //display appropriate markers\n } else {\n //if active\n //add to active time\n activityTime += 1000;\n updateActivityBuffer(true);\n //if active time > threshhold\n if (activityTime > 30000) {\n //clear innactive time\n innactivityTime = 0;\n }\n }\n if (isBufferActive() == false) {\n activityTime = 0;\n }\n document.getElementById(\"innactivity-display\").innerHTML = \"Innactivity :\" + millisToMinutesAndSeconds(innactivityTime);\n document.getElementById(\"activity-display\").innerHTML = \"Activity :\" + millisToMinutesAndSeconds(activityTime);\n document.getElementById(\"buffer-display\").innerHTML = activityBuffer;\n\n }", "title": "" }, { "docid": "5c36dbe72f854c2c08e879e7ab94d6b6", "score": "0.59063774", "text": "function animationEngine(timestamp) { //timestamp not used; timeSync server library used instead\n\n let ts_Date = new Date(TS.now()); //Date stamp object from TimeSync library\n let tsNowEpochTime_MS = ts_Date.getTime();\n cumulativeChangeBtwnFrames_MS += tsNowEpochTime_MS - epochTimeOfLastFrame_MS;\n epochTimeOfLastFrame_MS = tsNowEpochTime_MS; //update epochTimeOfLastFrame_MS for next frame\n\n while (cumulativeChangeBtwnFrames_MS >= MS_PER_FRAME) { //if too little change of clock time will wait until 1 animation frame's worth of MS before updating etc.; if too much change will update several times until caught up with clock time\n\n if (cumulativeChangeBtwnFrames_MS > (MS_PER_FRAME * FRAMERATE)) cumulativeChangeBtwnFrames_MS = MS_PER_FRAME; //escape hatch if more than 1 second of frames has passed then just skip to next update according to clock\n\n pieceClock(tsNowEpochTime_MS);\n wipe();\n update();\n draw();\n\n cumulativeChangeBtwnFrames_MS -= MS_PER_FRAME; //subtract from cumulativeChangeBtwnFrames_MS 1 frame worth of MS until while cond is satisified\n\n } // while (cumulativeChangeBtwnFrames_MS >= MS_PER_FRAME) END\n\n if (animationEngineCanRun) requestAnimationFrame(animationEngine); //animation engine gate: animationEngineCanRun\n\n} // function animationEngine(timestamp) END", "title": "" }, { "docid": "0331075d7d8a91e3fd7b3537e5741d5b", "score": "0.5814648", "text": "function tick() {\n const element = (<h1>{new Date().toLocaleTimeString()}</h1>);\n ReactDOM.render(element, document.getElementById('time'));\n }", "title": "" }, { "docid": "65304c133396a4d9e9194321ad415c49", "score": "0.5706665", "text": "function sendTimeSync() \n{\n // Validation is server-side and will ignore messages from impostors\n if (myName == masterUser || superUser)\n {\n socket.emit('masterTimeSync', videoPlayer.getCurrentTime());\n }\n else if (myName == guestMasterUser)\n {\n socket.emit('guestMasterTimeSync', videoPlayer.getCurrentTime());\n }\n \n setTimeout(sendTimeSync, 2000);\n}", "title": "" }, { "docid": "15dacd7fcf89c5e74bc62ebcb037937d", "score": "0.5690371", "text": "function renderTime() {\n timer.text(\"Timer: \" + seconds);\n }", "title": "" }, { "docid": "d780efeca7ef9f98cda0a21496d9f540", "score": "0.56505376", "text": "render() {\n return (\n <div className=\"timestamps\">\n <div className=\"timestamps-bkg\"></div>\n <div className=\"Time Time--current\">{this.convertTime(this.props.currentTime)}</div>\n <div className=\"Time Time--total\">{this.props.duration}</div>\n </div>\n )\n }", "title": "" }, { "docid": "dfcb17d35f36620f8c2a9c031bb87362", "score": "0.5647872", "text": "function render(timestamp) {\n //deltatime calculation\n var time = timestamp - lastTime\n if (!time) {\n time = 0\n }\n\n switch (state.current) {\n case \"playing\":\n xVel = 0;\n yVel = 0; \n if (isKeyPressed(\"KeyW\")) {\n yVel += time/10\n }\n if (isKeyPressed(\"KeyS\")) {\n yVel -= time/10\n }\n if (isKeyPressed(\"KeyD\")) {\n xVel += time/10\n }\n if (isKeyPressed(\"KeyA\")) {\n xVel -= time/10\n }\n\n var newPos = physics.gridCollide(charX,charY,20,20,xVel,yVel,level,32,function(grid,tx,ty) {\n if (tiles.get(grid,tx,ty) == \"wall\") {\n return true\n }\n })\n charX = newPos.x\n charY = newPos.y\n\n if (isKeyPressed(\"KeyP\")) {\n state.current = \"paused\"\n console.log(\"pause\")\n }\n if (isKeyPressed(\"KeyT\")) {\n state.current = \"transition\"\n state.next = \"playing\"\n state.tr1 = timestamp\n state.tr2 = timestamp + 400\n console.log(\"transitioning\")\n }\n break;\n \n case \"paused\":\n if (isKeyPressed(\"KeyR\")) {\n state.current = \"playing\"\n console.log(\"resume\")\n }\n break;\n\n case \"transition\":\n if (timestamp > state.tr2) {\n console.log(\"finished transition\")\n state.current = state.next\n state.next = \"\"\n }\n break;\n\n case \"summaryscreen\":\n break;\n\n case \"deathscreen\":\n break;\n\n case \"menu\":\n break;\n }\n //transition game states\n\n //camera\n if (timestamp) {\n newPanPos = cam.checkBoxes(camboxes,charX,charY,20,20,timestamp)\n if (newPanPos) {\n if (newPanPos.x !== lastPanPos.x || newPanPos.y !== lastPanPos.y) {\n cam.setPan(c,newPanPos.x,newPanPos.y,300,Math.floor(timestamp))\n lastMode = \"p\"\n }\n } else {\n var freeX = charX-canvasWidth/2 \n var freeY = charY-canvasHeight/2\n if (lastMode == \"p\") {\n cam.setPan(c,freeX,freeY,300,Math.floor(timestamp))\n }\n c.x2 = freeX\n c.y2 = freeY\n lastMode = \"f\"\n }\n }\n cam.tick(c,timestamp)\n x = c.x;\n y = c.y;\n x = Math.round(x);\n y = Math.round(y);\n\n //rendering\n ctx.imageSmoothingEnabled = false;\n\n var renderQueue = []\n ctx.clearRect(0,0,canvasWidth,canvasHeight)\n\n zindex.create(renderQueue,util.zToScreen(charY,y)-32,function() {\n ctx.fillStyle = \"white\"\n ctx.fillRect(charX-x,util.convertY(charY-y,canvasHeight),20,-20)\n }) \n\n tiles.render(level,renderQueue,x,y,canvasWidth,canvasHeight,32,graphics.drawtile,1,1,1,1)\n entities.render(enemies,x,y,renderQueue)\n zindex.render(renderQueue)\n cam.renderDebugBoxes(camboxes,x,y)\n\n //debug\n ctx.fillStyle = \"white\"\n ctx.fillText(charX, 5, 10);\n ctx.fillText(charY, 5, 30);\n\n //deltatime calculation\n lastTime = timestamp\n lastPanPos = newPanPos\n requestAnimationFrame(render)\n}", "title": "" }, { "docid": "274eb6b96a8b8f32ded31630a79b132c", "score": "0.5637245", "text": "constructor() {\n this.prevTimeStamp = 0;\n this.updateID = null;\n this.nextID = 0;\n this.actions = [];\n this.timeScale = 1;\n\n window.requestAnimationFrame = window.requestAnimationFrame\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame\n || window.msRequestAnimationFrame\n || function(f){return setTimeout(f, 1000/60)}\n \n window.cancelAnimationFrame = window.cancelAnimationFrame\n || window.mozCancelAnimationFrame\n || function(requestID){clearTimeout(requestID)}\n\n this.update = this.update.bind(this);\n this.startUpdate();\n }", "title": "" }, { "docid": "774fdfee4789b8aef82632971b801942", "score": "0.5562032", "text": "function renderTime () {\n time.textContent=\"Time: \" +secondsLeft;\n}", "title": "" }, { "docid": "682f679eac76f5d00b621ddea4185077", "score": "0.5561003", "text": "start() {\n const me = this;\n\n /**\n * Updates the current time.\n */\n function update () {\n me.stop();\n\n // determine interval to refresh\n const scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n let interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n\n me.redraw();\n me.body.emitter.emit('currentTimeTick');\n\n // start a renderTimer to adjust for the new time\n me.currentTimeTimer = setTimeout(update, interval);\n }\n\n update();\n }", "title": "" }, { "docid": "2d70a6bb90cac5d85caaecb466ad0a3e", "score": "0.5556816", "text": "render({ time }) {\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "817400c234588c18001bcb688e907cd9", "score": "0.54929066", "text": "function synchronize_with_server() {\r\n exprs = get_part_exprs();\r\n //send_receive_json(exprs, handle_server_response);\r\n send_receive_json(\"a:12\", change_every_five_seconds);\r\n }", "title": "" }, { "docid": "55d09c44f729590973c446f1a5db1c38", "score": "0.54892313", "text": "function Timer() {\n // Update method that calls all sub update methods\n Update();\n // Render method that calls all sub render methods\n Render();\n\n // Call timer again in 1 tick\n myTime = setTimeout('Timer()', 1000 / TICKS_PER_SECOND);\n}", "title": "" }, { "docid": "c9fa563b996bebe3841462f40dd1789f", "score": "0.5469209", "text": "function DebugRenderTime(ns, exports) {\n\nvar m_cfg = Object(__WEBPACK_IMPORTED_MODULE_1__config_js__[\"a\" /* default */])(ns);\nvar m_debug_subscene = Object(__WEBPACK_IMPORTED_MODULE_2__subscene_js__[\"a\" /* default */])(ns);\nvar m_ext = Object(__WEBPACK_IMPORTED_MODULE_3__extensions_js__[\"a\" /* default */])(ns);\nvar m_subs = Object(__WEBPACK_IMPORTED_MODULE_4__subscene_js__[\"a\" /* default */])(ns);\n\nvar cfg_def = m_cfg.defaults;\n\nvar RENDER_TIME_SMOOTH_INTERVALS = 10;\n\nexports.start_subs = function(subs) {\n if (!(cfg_def.show_hud_debug_info || subs.type == m_subs.PERFORMANCE))\n return;\n\n if (subs.do_not_debug)\n return;\n\n subs.debug_render_time_queries.push(create_render_time_query());\n}\n\nexports.start_batch = function(batch) {\n if (!(batch.type == \"MAIN\" && is_debug_view_render_time_mode()))\n return;\n\n batch.debug_render_time_queries.push(create_render_time_query());\n}\n\nfunction create_render_time_query() {\n var ext = m_ext.get_disjoint_timer_query();\n\n if (ext) {\n var query = ext.createQuery();\n ext.beginQuery(query);\n } else\n var query = performance.now();\n\n return query;\n}\n\nexports.stop_subs = function(subs) {\n if (!(cfg_def.show_hud_debug_info || subs.type == m_subs.PERFORMANCE))\n return;\n\n if (subs.do_not_debug)\n return;\n\n var render_time = calc_render_time(subs.debug_render_time_queries, \n subs.debug_render_time, true);\n if (render_time)\n subs.debug_render_time = render_time;\n}\n\nexports.stop_batch = function(batch) {\n if (!(batch.type == \"MAIN\" && is_debug_view_render_time_mode()))\n return;\n\n var render_time = calc_render_time(batch.debug_render_time_queries, \n batch.debug_render_time, true);\n if (render_time)\n batch.debug_render_time = render_time;\n}\n\nexports.is_debug_view_render_time_mode = is_debug_view_render_time_mode;\nfunction is_debug_view_render_time_mode() {\n var subs_debug_view = m_debug_subscene.get_debug_view_subs();\n return subs_debug_view && subs_debug_view.debug_view_mode == m_debug_subscene.DV_RENDER_TIME;\n}\n\n/**\n * External method for debugging purposes\n */\nexports.process_timer_queries = function(subs) {\n var render_time = calc_render_time(subs.debug_render_time_queries, \n subs.debug_render_time, false);\n if (render_time)\n subs.debug_render_time = render_time;\n}\n\nfunction calc_render_time(queries, prev_render_time, end_query) {\n var ext = m_ext.get_disjoint_timer_query();\n var render_time = 0;\n\n if (ext) {\n if (end_query)\n ext.endQuery();\n\n for (var i = 0; i < queries.length; i++) {\n var query = queries[i];\n\n var available = ext.getQueryAvailable(query);\n\n var disjoint = ext.getDisjoint();\n\n if (available && !disjoint) {\n var elapsed = ext.getQueryObject(query);\n render_time = elapsed / 1000000;\n if (prev_render_time)\n render_time = __WEBPACK_IMPORTED_MODULE_5__util_js__[\"_51\" /* smooth */](render_time,\n prev_render_time, 1, RENDER_TIME_SMOOTH_INTERVALS);\n\n queries.splice(i, 1);\n i--;\n }\n }\n } else {\n render_time = performance.now() - queries.pop();\n if (prev_render_time)\n render_time = __WEBPACK_IMPORTED_MODULE_5__util_js__[\"_51\" /* smooth */](render_time,\n prev_render_time, 1, RENDER_TIME_SMOOTH_INTERVALS);\n }\n\n return render_time;\n}\n\n}", "title": "" }, { "docid": "9597b12e004f199afdfff892529c529e", "score": "0.54644054", "text": "function renderTime(){\n if (hideTime && !isRunning) {\n shutdownTimerButton.time.text = '';\n } else {\n let H,M,S;\n H = h.toString();\n M = m.toString();\n S = s.toString();\n H = H.length === 1 ? \"0\" + H : H;\n M = M.length === 1 ? \"0\" + M : M;\n S = S.length === 1 ? \"0\" + S : S;\n shutdownTimerButton.time.text = H + \":\" + M + \":\" + S;\n }\n}", "title": "" }, { "docid": "f573e3290b36bb18c57801dcea82eb24", "score": "0.5462518", "text": "render() {\n if (!this.interval) {\n this.$controls.find('button.render').html('Pause <i class=\"pause icon\"></i>');\n\n var $time = this.$controls.find('span.render-time');\n this.$screen.children('.loaded.dimmer').removeClass('active');\n\n setTimeout(() => {\n try {\n this.interval = true;\n var startTime, endTime;\n startTime = endTime = new Date().getTime();\n var step = () => {\n if (this.interval) {\n startTime = new Date().getTime();\n this.simulationTime += (startTime - endTime)/100;\n this.rayTracer.render(this.setting('spheres'), this.setting('reflections'), this.setting('zoom'), this.checkbox('shadows'), this.simulationTime);\n endTime = new Date().getTime();\n $time.html(endTime - startTime + 'ms');\n requestAnimationFrame(step);\n }\n };\n requestAnimationFrame(step);\n } catch (error) {\n console.error(error);\n this.$screen.children('.error.dimmer')\n .addClass('active')\n .find('p').html(error.message);\n }\n }, 1);\n } else {\n clearInterval(this.interval);\n this.interval = null;\n this.$controls.find('button.render').html('Render <i class=\"play icon\"></i>');\n }\n }", "title": "" }, { "docid": "4dda1d5ff58f98e9eac914b520e1f3ea", "score": "0.5442647", "text": "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "title": "" }, { "docid": "14b65320ba136de2d449422bccaa5638", "score": "0.54247624", "text": "function tick() {\n console.log(network.players);\n\n if (waiting) return;\n\n if (time <= 1) {\n document.getElementById(\"period\").innerHTML = \"Period: \" + r.period;\n network.players[get_index_by_id(id)].color = col;\n }\n\n // generate random player clicks if debug option is set\n if (r_debug) {\n new_loc = Math.random().toFixed(3);\n new_pos = Math.random().toFixed(3);\n var iterx = 0;\n var itery = 0;\n r.send(\"update_loc\", {\n new_loc: new_loc,\n id: id,\n iterx: iterx\n });\n r.send(\"update_pos\", {\n new_pos: new_pos,\n id: id,\n itery: itery\n });\n\n target_pos = [Number(new_loc), Number(new_pos)];\n r.send(\"update_target\", {\n new_loc: new_loc,\n new_pos: new_pos,\n id: id\n });\n }\n\n time = time + 1;\n\n // hope to fix any weird color overriding at start... \n if (time == 5) {\n for (var n in network.players) {\n if (network.players[n].color == '#0066FF' && network.players[n].id != id)\n network.players[n].color = colors[1];\n }\n }\n\n //update progress bar\n if (game_type == \"stage\") $('.bar').width(((250 / (period_length / subperiods)) * time) % 250);\n else $('.bar').width((250 / period_length) * time);\n\n if (id == keeper) r.send(\"sync_time\", {\n time: time\n });\n\n //check for end of period in continous time\n if (time >= period_length) {\n if (id == keeper) r.send(\"new_period\", {\n current_period: current_period\n });\n }\n\n if (game_type == \"simultaneous\") {\n sub_pay[0][curr_subperiods - 1] = network.players[0].payoff.toFixed(2);\n sub_pay[1][curr_subperiods - 1] = network.players[1].payoff.toFixed(2);\n\n cummulative_payoff = 0;\n for (i = 0; i < sub_pay[get_index_by_id(id)].length; ++i) {\n cummulative_payoff += Number(sub_pay[get_index_by_id(id)][i]);\n }\n\n if (time % (period_length / subperiods) === 0) {\n var iterx = 0;\n var itery = 0;\n r.send(\"update_loc\", {\n new_loc: new_loc,\n id: id,\n iterx: iterx\n });\n r.send(\"update_pos\", {\n new_pos: new_pos,\n id: id,\n itery: itery\n });\n\n if (id == keeper) {\n r.send(\"new_subperiod\", {\n curr_subperiods: curr_subperiods\n });\n\n if (curr_subperiods == subperiods) r.send(\"new_period\", {\n current_period: current_period\n });\n }\n\n }\n } else if (game_type == \"stage\") {\n\n if (allow_x && !allow_y) document.getElementById(\"select\").innerHTML = \"Choose x\";\n else if (!allow_x && allow_y) document.getElementById(\"select\").innerHTML = \"Choose y\";\n\n if (allow_x && !flag) { //reset price at beginning of new subgame and keep old location\n //new_pos = 0;\n var iterx = 0;\n var itery = 0;\n r.send(\"update_pos\", {\n new_pos: new_pos,\n id: id,\n itery: itery\n });\n flag = 1;\n }\n\n if (time % (period_length / subperiods) < 1) { //at the end of every subperiod update new position on plot\n console.log(\"ENDING SUBPERIOD\");\n curr_i += 4;\n var iterx = 0;\n var itery = 0;\n var offset = 1 / num_of_players;\n\n if (allow_x) {\n\n r.send(\"update_loc\", {\n new_loc: new_loc,\n id: id,\n iterx: iterx\n });\n allow_x = 0;\n allow_y = 1; //switch to price subrounds\n\n } else if (allow_y) {\n r.send(\"update_pos\", {\n new_pos: new_pos,\n id: id,\n itery: itery\n });\n\n ++curr_sub_y;\n\n if (curr_sub_y == price_subrounds) { //when we reach the last price subround, start a new subgame\n if (id == keeper) r.send(\"set_payoffs\", {\n curr_subperiods: curr_subperiods,\n id: id\n });\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n\n allow_x = 1;\n allow_y = 0;\n\n if (id == keeper) r.send(\"update_subsetting\", {\n allow_x: allow_x,\n allow_y: allow_y,\n curr_sub_y: curr_sub_y\n });\n\n }\n\n if (curr_sub_y == 2) {\n sub_pay[0].shift();\n sub_pay[1].shift();\n }\n }\n\n if (id == keeper) r.send(\"new_subperiod\", {\n curr_subperiods: curr_subperiods\n });\n\n if (curr_subperiods == subperiods) { //when we go through all subperiods, it's time for a new period\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n if (id == keeper) r.send(\"new_period\", {\n current_period: current_period\n });\n }\n\n if (id == keeper) {\n r.send(\"update_subsetting\", {\n allow_x: allow_x,\n allow_y: allow_y,\n curr_sub_y: curr_sub_y\n });\n r.send(\"set_payoffs\", {\n curr_subperiods: curr_subperiods,\n id: id\n });\n }\n }\n }\n\n var i;\n\n intersects = find_intersect_pts();\n\n document.getElementById(\"total_score\").innerHTML = \"Total Score: \" + r.points.toFixed(3);\n document.getElementById(\"curr_score\").innerHTML = \"Current score: \" + cummulative_payoff.toFixed(3);\n\n //save payoff at end of round\n if (sub_pay[0][curr_subperiods - 1] === undefined) {\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n }\n\n if (sub_pay[1][curr_subperiods - 1] === undefined) {\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n }\n\n if (r.config.show_secs_left) document.getElementById(\"time\").innerHTML = \"Time left: \" + Math.ceil(period_length - time);\n }", "title": "" }, { "docid": "3e62f33b3c93d52301b1da591c805bb0", "score": "0.5420269", "text": "function Render() {\n tickCount++;\n\n // Render the main canvas\n RenderCanvas()\n\n // Render map 4 times per second as its pretty laggy\n if (tickCount % (TICKS_PER_SECOND / 4) == 0) {\n RenderMap();\n }\n\n if (tickCount % 8 == 0) {\n playerScore++;\n }\n\n if (tickCount % TICKS_PER_SECOND == 0) {\n playerTime++;\n\n tickCount = 0;\n }\n\n // Update score and time \n pScore.innerHTML = playerScore;\n pTime.innerHTML = playerTime;\n\n}", "title": "" }, { "docid": "e7a8c9f6f45264f36d5de500f0c0e520", "score": "0.541035", "text": "function clock (sceneInstance){\n\t\t\t\tincrementPhysics(sceneInstance);\n\t\t\t}", "title": "" }, { "docid": "84f9d6de096854160b125764aa93ed6b", "score": "0.5401517", "text": "getNodeTime() {\n return this.call(this.nodeRoutesApi.getNodeTime(), (body) => {\n const nodeTimeDTO = body;\n if (nodeTimeDTO.communicationTimestamps.sendTimestamp && nodeTimeDTO.communicationTimestamps.receiveTimestamp) {\n return new node_1.NodeTime(model_1.UInt64.fromNumericString(nodeTimeDTO.communicationTimestamps.sendTimestamp), model_1.UInt64.fromNumericString(nodeTimeDTO.communicationTimestamps.receiveTimestamp));\n }\n throw Error('Node time not available');\n });\n }", "title": "" }, { "docid": "0cc03ad5c6bc702165eab4f4e54d78c9", "score": "0.53983337", "text": "function update_timer()\n{\n const timer_elem = (<div>\n <h1>Sample Timer</h1>\n <div class=\"timer\">The time is : {new Date().toLocaleTimeString()}</div>\n </div>);\n ReactDOM.render(\n timer_elem,\n document.getElementById('root')\n );\n}", "title": "" }, { "docid": "abe3f1bc609a4b6824d03a29427b5758", "score": "0.5398162", "text": "render({ time }) {\n material.uniforms.time.value = time\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "9fa81ff3cb72f09628212d937d945b73", "score": "0.5394385", "text": "function timer() {\r\n\r\n nodes.forEach(function (o, i) {\r\n o.timeleft -= 1;\r\n if (o.timeleft <= 0 && o.istage < o.stages.length - 1) {\r\n // Decrease counter for previous group.\r\n groups[o.group].cnt -= 1;\r\n\r\n // Update current node to new group.\r\n o.istage += 1;\r\n o.group = o.stages[o.istage].grp;\r\n o.timeleft = o.stages[o.istage].duration;\r\n\r\n // Increment counter for new group.\r\n groups[o.group].cnt += 1;\r\n }\r\n });\r\n\r\n // Increment time. For `nodes` and `groups`\r\n time_so_far += 1/12;\r\n\r\n function indexToTime(i) {\r\n \r\n var months = 1 % 12;\r\n var years = Math.floor(1 / 12);\r\n \r\n var time_string = '';\r\n \r\n if (time_so_far == .96) {\r\n time_string += years + \" year\";\r\n } else if (time_so_far > .96) {\r\n time_string += parseInt(time_so_far) + \" years\";\r\n }\r\n \r\n if (years > .96) {\r\n time_string += \", \";\r\n }\r\n\r\n if (time_so_far < .96) {\r\n time_string += months += \" < 12 months\";\r\n } \r\n // else {\r\n // time_string += months += \" months\";\r\n // }\r\n \r\n // if (time_so_far == .08) {\r\n // time_string += \"1 month\";\r\n // } else {\r\n // time_string += months += \" months\";\r\n // }\r\n \r\n return time_string;\r\n };\r\n\r\n // time_so_far += 1;\r\n // d3.select(\"#timecount .cnt\").text(time_so_far);\r\n d3.select(\"#timecount .cnt\").text(indexToTime);\r\n\r\n\r\n // Update counters. for `nodes` and `groups`\r\n svg.selectAll('.grpcnt').text(d => groups[d].cnt);\r\n\r\n // Do it again. for `nodes` and `groups`\r\n d3.timeout(timer, 300);\r\n\r\n } // @end timer()", "title": "" }, { "docid": "2118b68a28d41de30d85ceb9a9f47e63", "score": "0.53880244", "text": "_renderTime() {\n let time = new Date();\n this.clockArea.innerHTML = '';\n this.clockArea.innerHTML = ` \n <span class = 'hour'>\n ${time.getHours() < 10 ? '0' + time.getHours() : time.getHours()}\n </span><span>:</span><span class = 'min'>\n ${time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()}\n </span><span>:</span><span class = 'sec'>\n ${time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds()}</span>`\n }", "title": "" }, { "docid": "d21f480cadc5bcd805db1cddebf165f7", "score": "0.53833413", "text": "constructor(owner, x, y, size) {\n\n super();\n\n this.owner = owner;\n\n this.position.x = x;\n this.position.y = y;\n\n this.timer = new PIXI.Graphics();\n this.timer.lineStyle(4, 0xeeeeee);\n this.timer.arc(0, 0, size, Math.PI / 20, (Math.PI * 2) - (Math.PI / 20));\n this.timer.rotation = - Math.PI / 2;\n this.addChild( this.timer );\n\n this.timerFull = new PIXI.Graphics();\n this.timerFull.lineStyle(4, 0x7FBEE8);\n this.timerFull.drawCircle(0, 0, size);\n this.addChild( this.timerFull );\n\n this.clock = new Clock(0, - this.owner.h / 2);\n this.addChild(this.clock);\n\n this.check = new Check(0, - this.owner.h / 2);\n this.addChild(this.check);\n\n let options = { font:\"normal 15px Circular\", fill:0xBC76B2, align:\"center\" };\n this.timeLeft = {min: 0 , sec:30};\n this.text = new PIXI.Text(this.timeLeft.min + \" : \" + this.timeLeft.sec, options);\n this.text.position.x = - this.text.width / 2;\n this.text.position.y = (- this.owner.h / 2) + size / 4;\n this.addChild(this.text);\n\n this.addAnim(0, 0, size);\n\n this.isOn = false;\n this.compositions = [];\n\n this.hide();\n\n }", "title": "" }, { "docid": "ddd8f46d49a51d38fc5ef52073e8ba08", "score": "0.538067", "text": "function tick(){\n if(waiting) return;\n \n if(time <= 1){\n document.getElementById(\"period\").innerHTML = \"Period: \" + r.period;\n network.players[get_index_by_id(id)].color = col;\n } \n \n // generate random player clicks if debug option is set\n if(r_debug){\n new_loc = Math.random().toFixed(3);\n new_pos = Math.random().toFixed(3);\n var iterx = 0;\n var itery = 0;\n r.send(\"update_loc\", { new_loc:new_loc , id:id, iterx:iterx });\n r.send(\"update_pos\", { new_pos:new_pos , id:id, itery:itery });\n \n target_pos = [Number(new_loc), Number(new_pos)];\n r.send(\"update_target\", { new_loc:new_loc , new_pos:new_pos , id:id });\n }\n\n time = time + 1;\n \n // hope to fix any weird color overriding at start... \n if(time == 5){\n for(var n in network.players){\n if(network.players[n].color == '#0066FF' && network.players[n].id != id)\n network.players[n].color = colors[1];\n }\n }\n \n //update progress bar\n if(game_type == \"stage\" || game_type == \"dttb\") $('.bar').width(((250/(period_length/subperiods))*time)%250);\n else $('.bar').width((250/period_length)*time);\n \n if(id == keeper) r.send(\"sync_time\", { time:time } );\n \n //check for end of period in continous time\n if(time >= period_length){\n if(id == keeper) r.send(\"new_period\", { current_period:current_period });\n }\n \n if(game_type == \"simultaneous\"){\n sub_pay[0][curr_subperiods - 1] = network.players[0].payoff.toFixed(2);\n sub_pay[1][curr_subperiods - 1] = network.players[1].payoff.toFixed(2);\n \n cummulative_payoff = 0;\n for(i = 0; i < sub_pay[get_index_by_id(id)].length; ++i){\n cummulative_payoff += Number(sub_pay[get_index_by_id(id)][i]);\n }\n \n if(time % (period_length/subperiods) === 0) {\n var iterx = 0;\n var itery = 0;\n r.send(\"update_loc\", { new_loc:new_loc , id:id, iterx:iterx });\n r.send(\"update_pos\", { new_pos:new_pos , id:id, itery:itery });\n \n if(id == keeper) {\n r.send(\"new_subperiod\", { curr_subperiods:curr_subperiods });\n \n if(curr_subperiods == subperiods) r.send(\"new_period\", { current_period:current_period });\n }\n \n }\n } else if(game_type == \"stage\"){\n \n if(allow_x && !allow_y) document.getElementById(\"select\").innerHTML = \"Choose x\";\n else if(!allow_x && allow_y) document.getElementById(\"select\").innerHTML = \"Choose y\";\n \n if(allow_x && !flag){ //reset price at beginning of new subgame and keep old location\n //new_pos = 0;\n var iterx = 0;\n var itery = 0;\n r.send(\"update_pos\", { new_pos:new_pos , id:id, itery:itery });\n flag = 1;\n }\n \n if(time % (period_length/subperiods) < 1) { //at the end of every subperiod update new position on plot\n console.log(\"ENDING SUBPERIOD\");\n curr_i += 4;\n var iterx = 0;\n var itery = 0;\n var offset = 1/num_of_players;\n \n if(allow_x){\n \n r.send(\"update_loc\", { new_loc:new_loc , id:id, iterx:iterx });\n allow_x = 0;\n allow_y = 1; //switch to price subrounds\n\n } else if(allow_y){\n r.send(\"update_pos\", { new_pos:new_pos , id:id, itery:itery });\n\n ++curr_sub_y;\n \n if(curr_sub_y == price_subrounds){ //when we reach the last price subround, start a new subgame\n if(id == keeper) r.send(\"set_payoffs\", { curr_subperiods:curr_subperiods, id:id });\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n\n allow_x = 1;\n allow_y = 0;\n\n if(id == keeper) r.send(\"update_subsetting\", { allow_x:allow_x , allow_y:allow_y, curr_sub_y:curr_sub_y });\n \n }\n \n if(curr_sub_y == 2){\n sub_pay[0].shift();\n sub_pay[1].shift();\n } \n }\n\n if(id == keeper) r.send(\"new_subperiod\", { curr_subperiods:curr_subperiods });\n\n if(curr_subperiods == subperiods){ //when we go through all subperiods, it's time for a new period\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n if(id == keeper) r.send(\"new_period\", { current_period:current_period });\n } \n\n if(id == keeper){\n r.send(\"update_subsetting\", { allow_x:allow_x , allow_y:allow_y, curr_sub_y:curr_sub_y });\n r.send(\"set_payoffs\", { curr_subperiods:curr_subperiods, id:id });\n }\n }\n //discrete time turn based\n } else if (game_type == \"dttb\") {\n\n if (im_allowed) {\n enablePlot();\n if(allow_x) $(\"#select\").html(\"Choose x\");\n else if(allow_y) $(\"#select\").html(\"Choose y\");\n \n if(allow_x && !flag){ //reset price at beginning of new subgame and keep old location\n //new_pos = 0;\n var iterx = 0;\n var itery = 0;\n r.send(\"update_pos\", { new_pos:new_pos , id:id, itery:itery });\n flag = 1;\n }\n } else {\n document.getElementById(\"select\").innerHTML = \"Please wait until your turn!\";\n disablePlot();\n }\n\n if(time % (period_length/subperiods) < 1) { \n //at the end of every subperiod update new position on plot\n console.log(\"ENDING SUBPERIOD\");\n curr_i += 4;\n var iterx = 0;\n var itery = 0;\n var offset = 1/num_of_players;\n \n //after two people have chosen x, let's switch to y\n if (allow_x) {\n chosenx++;\n if (chosenx == 2) {\n allow_x = 0; // disable x rounds and \n allow_y = 1; // switch to price subrounds\n chosenx = 0;\n }\n }\n\n if(allow_x && im_allowed){\n r.send(\"update_loc\", { new_loc:new_loc , id:id, iterx:iterx });\n } else if(allow_y && im_allowed){\n r.send(\"update_pos\", { new_pos:new_pos , id:id, itery:itery });\n }\n\n if (allow_y) {\n ++curr_sub_y;\n \n if(curr_sub_y == price_subrounds) { //when we reach the last price subround, start a new subgame\n if(id == keeper) r.send(\"set_payoffs\", { curr_subperiods:curr_subperiods, id:id });\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n\n allow_x = 1;\n allow_y = 0;\n\n if(id == keeper) r.send(\"update_subsetting\", { allow_x:allow_x , allow_y:allow_y, curr_sub_y:curr_sub_y });\n \n }\n \n if(curr_sub_y == 2){\n sub_pay[0].shift();\n sub_pay[1].shift();\n } \n }\n\n if(id == keeper) r.send(\"new_subperiod\", { curr_subperiods:curr_subperiods });\n\n //discrete time turn based\n pick_order = pick_order.reverse();\n im_allowed = (numerical_id == pick_order[0]);\n console.log(\"allowed= \" + im_allowed);\n\n if(curr_subperiods == subperiods){ //when we go through all subperiods, it's time for a new period\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n if(id == keeper) r.send(\"new_period\", { current_period:current_period });\n } \n\n if(id == keeper){\n r.send(\"update_subsetting\", { allow_x:allow_x , allow_y:allow_y, curr_sub_y:curr_sub_y });\n r.send(\"set_payoffs\", { curr_subperiods:curr_subperiods, id:id });\n }\n }\n }\n\n \n var i;\n \n intersects = find_intersect_pts();\n \n document.getElementById(\"total_score\").innerHTML = \"Total Score: \" + r.points.toFixed(3);\n document.getElementById(\"curr_score\").innerHTML = \"Current score: \" + cummulative_payoff.toFixed(3);\n \n //save payoff at end of round\n if(sub_pay[0][curr_subperiods - 1] === undefined){\n sub_pay[0][curr_subperiods - 1] = payoff(0).toFixed(3);\n }\n \n if(sub_pay[1][curr_subperiods - 1] === undefined){\n sub_pay[1][curr_subperiods - 1] = payoff(1).toFixed(3);\n }\n\n if(r.config.show_secs_left) document.getElementById(\"time\").innerHTML = \"Time left: \" + Math.ceil(period_length - time);\n }", "title": "" }, { "docid": "38f852f5ee10049b9707be43c1c0ae2b", "score": "0.5378589", "text": "_render() {\n this._element.innerHTML = `\n <h3>${this._title}</h3>\n <div class = \"clock-area\">\n <span class = 'hour'>00</span>\n <span>:</span>\n <span class = 'min'>00</span>\n <span>:</span>\n <span class = 'sec'>00</span>\n </div>\n <div class = \"buttons\">\n <input type=\"button\" id = \"start\" class = \"btn btn-success\" value=\"Start\">\n <input type=\"button\" id = \"stop\" class=\"btn btn-danger\" value=\"Stop\">\n <input type=\"button\" id = \"myalert\" class = \"btn btn-info\" value=\"Click here and clock should freeze\">\n </div>`\n }", "title": "" }, { "docid": "546b143a338005a69a15fe18049f928d", "score": "0.53766215", "text": "function main() {\n var now = Date.now();\n var dt = (now - lastTime) / 1000.0;\n \n update(dt);\n render();\n \n lastTime = now;\n requestAnimFrame(main);\n}", "title": "" }, { "docid": "9b7f3bdfe3e3f34ebaa084855fd503da", "score": "0.5367414", "text": "tickWillRender(/*time*/) {}", "title": "" }, { "docid": "1210179212679d33c43bb0af8c0d6d0e", "score": "0.53597516", "text": "function renderTime(){\n\n timer.textContent = seconds;\n}", "title": "" }, { "docid": "e7d44652a44729bd7c8ecfd326201bb6", "score": "0.53455806", "text": "render() {\n this.timer.startTimer(`render`);\n super.render();\n this.timer.stopTimer(`render`);\n this.timer.stopTimer(`overall`);\n }", "title": "" }, { "docid": "5f484d68779786c12cdddec17d9bb295", "score": "0.53436846", "text": "render({ time }) {\n mesh.rotation.y = 0.3*time; //time is a const, so as number goes up the y follows\n moonMesh.rotation.y = time; //time is a const, so as number goes up the y follows\n moonGroup.rotation.y = 0.6 * time;\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "495b32a0c1bf30df39bc3d92d91f0333", "score": "0.5328201", "text": "function tick() {\n // We can define custom reusable elements this way and immediately refer to them.\n const element = (\n <div>\n <Clock type='USA' time='en-US'></Clock>\n <Clock type='Arabic' time='ar-EG'></Clock>\n </div> \n )\n ReactDOM.render(element, document.getElementById('root'))\n}", "title": "" }, { "docid": "00475b9705d173e429effef1d9d18a12", "score": "0.5327289", "text": "function main() {\n\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n update(dt);\n render();\n lastTime = now;\n win.requestAnimationFrame(main);\n }", "title": "" }, { "docid": "09cf116725fde27badb075982ecdfab6", "score": "0.5321102", "text": "function render() {\n controls.update();\n renderer.render(scene, camera);\n requestAnimationFrame(render);\n\n // var dt = computerClock.getDelta(); // must be before call to getElapsedTime, otherwise dt=0 !!!\n // var t = computerClock.getElapsedTime();\n}", "title": "" }, { "docid": "38823ce9c8d0aeae5879f5b0cf27d160", "score": "0.5313706", "text": "render({ time }) {\n mesh.rotation.y = time * 0.5;\n boysGroup.rotation.y = time;\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "d52197c13cff806adf72be0ba18f8d80", "score": "0.53111523", "text": "updateTimerTime() {\n this.DOM_ELEMENTS.time.innerHTML = this.getTimerTimeString();\n }", "title": "" }, { "docid": "34858628946dd18b906279916e39e045", "score": "0.5301187", "text": "constructor(start, secondCount, navTime) {\n var currentTime = new Date().getTime();\n this.startTime = start;\n this.visHours = document.getElementById(\"hours\");\n this.visMinutes = document.getElementById(\"minutes\");\n this.visSeconds = document.getElementById(\"seconds\");\n\n if(secondCount != 0 && navTime != 0){\n console.log(\"Current Time: \" + currentTime);\n console.log(\"Navigated away at: \" + navTime);\n var timeAway = Math.floor((currentTime - navTime)/1000);\n\n console.log(\"Away from page for:\" + timeAway);\n this.totalSeconds = secondCount + timeAway;\n }\n\n else{\n this.totalSeconds = secondCount;\n }\n\n console.log(\"Timer Started At: \" + this.startTime);\n console.log(\"Total seconds elapsed: \" + this.totalSeconds);\n }", "title": "" }, { "docid": "e47bdf5b9be01f77b5cb61accc3c19bc", "score": "0.5282847", "text": "function syncVideo(roomnum) {\r\n var currTime = 0\r\n var state\r\n var videoId = id\r\n\r\n // var syncText = document.getElementById(\"syncbutton\")\r\n // console.log(syncText.innerHTML)\r\n // syncText.innerHTML = \"<i class=\\\"fas fa-sync fa-spin\\\"></i> Sync\"\r\n\r\n switch (currPlayer) {\r\n case 0:\r\n currTime = player.getCurrentTime();\r\n state = playerStatus\r\n console.log(\"I am host and my current time is \" + currTime + state)\r\n break;\r\n default:\r\n console.log(\"Error invalid player id\")\r\n }\r\n\r\n // Required due to vimeo asyncronous functionality\r\n if (currPlayer != 2) {\r\n socket.emit('sync video', {\r\n room: roomnum,\r\n time: currTime,\r\n state: state,\r\n videoId: videoId\r\n });\r\n }\r\n}", "title": "" }, { "docid": "a7c0e7af918f02c61a692473fd841630", "score": "0.5281724", "text": "function tickTock() {\n timeDisplay();\n}", "title": "" }, { "docid": "50f701a795541a564c9a440af02fc3e2", "score": "0.5273198", "text": "updateComponents() {\n // //Constantly Updates the UserTime With the Latest Time \n // this.userTime.innerHTML = this.userTime.innerHTML.split(\" \")[0] + \" \" + this.userNumTime;\n // this.userMoney.innerHTML = this.userMoney.innerHTML.split(\" \")[0] + \" \" + this.userNumMoney;\n }", "title": "" }, { "docid": "12f55896ead0c2f6985bba07457002e1", "score": "0.5272317", "text": "display() {\n let text_width = textWidth(this.title);\n\n if (this.end == this.start) {\n // if event happens in specific time\n textFont('Helvetica', 10);\n text(`${trans(this.start)} ` + this.title, this.x, this.y, this.width); // +10 to prevent return line, include spage for end string char\n\n // draw a half transparent line from start of title to timeline \n stroke(0,0,0, 100);\n line(this.x, this.y + NODE_HEIGHT / 2, this.x, total_height + NODE_HEIGHT / 2);\n } else {\n // if event happened in period of time, display block\n rect(this.x, this.y, this.width, this.height);\n let text_width = textWidth(this.title);\n\n // if text length is smaller than rect length, show title in the middle of rect\n if (text_width <= this.width) {\n textFont(\"Georgia\", 15);\n textAlign(CENTER, TOP);\n text(this.title, this.x, this.y, this.width);\n }\n }\n\n let lineNum = text_width / 70 + 2;\n this.div.style.height = `${lineNum * textAscent()}px`\n\n // display div just below top middle of the node\n let base = cnv.position()\n this.div.position(base[\"x\"] + this.x + this.width / 2, base[\"y\"] + this.y);\n\n if (this.mouseHovering()) {\n this.div.style(\"display\", \"block\");\n } else {\n this.div.style(\"display\", \"none\");\n }\n }", "title": "" }, { "docid": "5e16cf2c48c792e7e4687997d01f8873", "score": "0.5263525", "text": "function updateTime () {\n var head1 = body.querySelector('#timer')\n head1.textContent = 'Time elapsed: ' + seconds + 's'\n seconds++\n}", "title": "" }, { "docid": "3a29d9e1a8fe31cb7c4ee425928f4e80", "score": "0.52608985", "text": "tick() {\n\t\t\t\t \tthis.setState({ //Clock schedules a UI update, React knows the state has changed and calls render() again to know what should be on the screen. \n\t\t\t\t \t\tdate: new Date()\n\t\t\t\t \t});\n\t\t\t\t }", "title": "" }, { "docid": "8651893ee6d1b1cd54a6c26658d287c9", "score": "0.52400696", "text": "function renderTime() {\n minutesDisplay.textContent = getFormattedMinutes();\n secondsDisplay.textContent = getFormattedSeconds();\n if (timeElapsed >= totalSeconds) {\n stopTimer();\n }\n }", "title": "" }, { "docid": "2cd46c3165dd0b20376863f135040f8c", "score": "0.52179474", "text": "function update() { \r\n if (this.timeRunning){\r\n time += timePast();\r\n }\r\n let displayTime = formatTime(time);\r\n element.textContent = displayTime\r\n }", "title": "" }, { "docid": "2037d1247eca7f6bf02db47728caea4a", "score": "0.5217789", "text": "displayTime(t, isAdjust) {\n //console.log(\"displayTime \"+t);\n var tStr = \"\";\n try {\n tStr = this.formatTime(t);\n }\n catch (e) {\n console.log(\"err: \", e);\n console.log(\"*** displayTime err t: \"+t);\n }\n this.game.state.set(\"time\", t);\n this.game.state.set('seek', isAdjust ? true : false);\n var dur = this.duration;\n \tlet value = ((t-this.startTime)/(0.0+dur));\n if (game.controllers.ui) {\n game.controllers.ui.setTimeSlider(value);\n }\n // This bit is a hack because it is CMP specific.\n // it was moved here from CMPProgram. This functionality\n // can all be moved to scripts in the config.\n /*\n if (this.gss) {\n var year = GSS.timeToYear(t);\n //console.log(\"year: \" + year);\n var yearStr = \"\";\n if (year) {\n var va = this.gss.getFieldByYear(year, \"videofade\");\n var nar = this.gss.getFieldByYear(year, \"narrative\") || \"\";\n //console.log(\"va: \" + va + \" narrative: \" + nar);\n yearStr = Math.floor(year);\n if (nar) {\n this.game.state.set('narrative', yearStr + ':' + nar);\n }\n }\n //console.log(\"yearStr:\"+yearStr);\n this.game.state.set('year', yearStr);\n }\n */\n }", "title": "" }, { "docid": "506c17275563532934f755df14561dea", "score": "0.52091277", "text": "render() {\n // declaring variable\n let timeDisplay, minutes, seconds, min, sec, startStopBtn;\n\n // if the current time is larger than 0\n if (this.state.currentTime < 0) {\n // minutes takes the value from session and seconds is the string \"00\"\n minutes = this.state.session;\n sec = \"00\";\n\n // otherwise if the current time is smaller than 0\n } else {\n // minutes is the rounded number resulting from the current time value divided by 60\n minutes = Math.floor(this.state.currentTime / 60);\n // seconds is the current time minus the result of the current time multiplied by 60\n seconds = this.state.currentTime - minutes * 60;\n // is seconds smaller than 10 ? if it is the sec variable string will have a leading zero, else sec variable will use the seconds\n seconds < 10 ? (sec = \"0\" + seconds) : (sec = seconds);\n }\n minutes < 10 ? (min = \"0\" + minutes) : (min = minutes);\n // template literal that sets the display format\n timeDisplay = `${min}:${sec}`;\n // intervalID\n this.state.intervalID === null\n ? (startStopBtn = \"START\")\n : (startStopBtn = \"STOP\");\n\n const divStyle = {\n margin: '25vh'\n};\n \n return (\n <div className=\"wrapper ui center aligned container \" style={divStyle} onClick={this.handleClick}>\n {/* timer label */}\n <div className=\"timer-label massive ui input\" id=\"timer-label\">\n {this.state.label}\n </div>\n {/* time display */}\n <div className=\"time-left\" id=\"time-left\">\n {timeDisplay}\n </div>\n {/* start stop */}\n <button className=\"start_stop ui button primary\" id=\"start_stop\">\n {startStopBtn}\n </button>\n {/* reset */}\n <button className=\"reset ui button negative\" id=\"reset\">\n RESET\n </button>\n {/* session label */}\n <div className=\"session-label\" id=\"session-label\">\n Session Length\n </div>\n {/* session inc dec */}\n <button className=\"ui positive basic button\" id=\"session-increment\">Session +</button>\n <div id=\"session-length\">{this.state.session}</div>\n <button className=\"ui negative basic button\" id=\"session-decrement\">Session -</button>\n {/* break label */}\n <div className=\"break-label\" id=\"break-label\">\n Break Length\n </div>\n {/* break inc dec */}\n <button className=\"ui positive basic button\" id=\"break-increment\">Break +</button>\n <div id=\"break-length\">{this.state.break}</div>\n <button className=\"ui negative basic button\" id=\"break-decrement\">Break -</button>\n\n <audio\n id=\"beep\"\n src=\"https://upload.wikimedia.org/wikipedia/commons/c/c6/Sputnik_beep.ogg\"\n />\n </div>\n );\n }", "title": "" }, { "docid": "7c5897b81112562b2a5cbf8228519682", "score": "0.5208399", "text": "function showLateralMovement(){\n syncAllChanges()\n w2ui.main_layout.content(\n 'main',\n '<div style=\"height:100%;width:100%\" id=\"graph\"></div>'\n )\n\n data = getLateralMovements(case_data)\n if (data.nodes.length == 0){\n $('#graph').html(\"<div style='align-items: center;'><center><h2>No events to display</h2><p>Add new events in the timeline tab first and mark them as 'Visualizable' to show them here.</p></center></div>\")\n } else {\n var container = document.getElementById('graph')\n\n // Configuration for the Timeline\n var options = {\n edges: {},\n nodes: {\n font: {\n size: 14\n }\n },\n groups: {\n \"Desktop\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n code: '\\uf109',\n size: 50,\n color: 'cadetblue'\n }\n },\n \"Server\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n code: '\\uf233',\n size: 50,\n color: 'coral'\n }\n },\n \"Phone\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n weight: \"bold\",\n code: \"\\uf10b\",\n size: 50,\n color: 'crimson'\n }\n },\n \"Tablet\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n weight: \"bold\",\n code: \"\\uf10a\",\n size: 50,\n color: 'blueviolet'\n }\n },\n \"TV\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n weight: \"bold\",\n code: \"\\uf26c\",\n size: 50,\n color: 'darkgoldenrot'\n }\n },\n \"Networking device\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n weight: \"bold\",\n code: \"\\uf0c2\",\n size: 50,\n color: 'darkblue'\n }\n },\n \"IoT device\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n code: \"\\uf2db\",\n size: 50,\n color: 'darkorchid'\n }\n },\n \"Other\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n code: \"\\uf1e6\",\n size: 50,\n color: 'dimgray'\n }\n },\n \"Attacker Infra\": {\n shape: 'icon',\n icon: {\n //face: \"'Font Awesome 5 Free'\",\n face: \"FontAwesome\",\n code: \"\\uf21b\",\n size: 50,\n color: 'black'\n }\n }\n }\n }\n\n var network = new vis.Network(container, data, options);\n }\n}", "title": "" }, { "docid": "5f4051aa026f30bee5816027403ab5e8", "score": "0.52026045", "text": "function InitMarchUpdate2(Event) {\r\n function CalcMarch2Time(Event) {\r\n OneWay = document.getElementById(UKMode ? \"z\" : \"timeDirection\").innerHTML;\r\n if (OneWay == \"-\") {OneWay = 0;} else {OneWay = ToSeconds(OneWay);}\r\n\r\n var NameNode = document.getElementById(\"GM_CastleName\");\r\n var NewNode = document.getElementById(\"GM_Timing\");\r\n var ServerArriveNode = document.getElementById(\"GM_ServerArrive\");\r\n var ServerTime = document.getElementById(\"theClock\").innerHTML;\r\n if (ServerTime == \"\") ServerTime = \"00:00:00\";\r\n var TargetDistance = Dist(\r\n [\r\n document.getElementById(UKMode ? \"att_x\" : \"targetX\").value,\r\n document.getElementById(UKMode ? \"att_y\" : \"targetY\").value\r\n ],\r\n [Home[0], Home[1]],\r\n true\r\n ); \r\n var BaseSpeed = OrigOneWay / 60 / TargetDistance / SpeedMod;\r\n var EffSpeed = StripDecimals(Round(OneWay / 60 / TargetDistance, 0.01), 2);\r\n var SpeedNode = document.getElementById(\"pohodCargo\").\r\n parentNode.previousSibling.previousSibling.getElementsByTagName(\"div\")[1];\r\n SpeedNode.innerHTML = SpeedNode.innerHTML.split(\" \")[0] + \" (\" +\r\n Translate(\"Effective Speed\") + \" \" + EffSpeed + \")\";\r\n var LocalArrive = new Date();\r\n LocalArrive.setSeconds(LocalArrive.getSeconds() + OneWay);\r\n var LocalReturn = new Date();\r\n LocalReturn.setSeconds(LocalReturn.getSeconds() + 2 * OneWay);\r\n ServerArriveNode.innerHTML = Translate(\"Server Arrival\") + \": \" +\r\n HMS((ToSeconds(ServerTime) + OneWay) % 86400) + \"<br />\" +\r\n Translate(\"Server Return\") + \": \" +\r\n HMS((ToSeconds(ServerTime) + 2 * OneWay) % 86400) + \"<br />\" +\r\n Translate(\"Local Arrival\") + \": \" +\r\n DateFormat(LocalArrive) + \"<br />\" + Translate(\"Local Return\") + \": \" +\r\n DateFormat(LocalReturn);\r\n var Speed = SpeedNode.innerHTML.split(\" \")[0];\r\n var Now = new Date();\r\n NewNode.innerHTML = \"<div class='left'>\" + Translate(\"Timing (no coins)\") +\r\n \":</div><div class='right'>\" +\r\n MarchTime(TargetDistance, BaseSpeed, null, null, true, false, Speed) + \"</div>\";\r\n GetCastleName(\r\n [\r\n 0, document.getElementById(UKMode ? \"att_x\" : \"targetX\").value,\r\n document.getElementById(UKMode ? \"att_y\" : \"targetY\").value\r\n ],\r\n \"GM_CastleName\"\r\n );\r\n }\r\n\r\n var OrigOneWay, SpeedFrac, SpeedMotivation, SpeedMod;\r\n var TempNode = document.getElementById(\"motiv\" + (! UKMode ? \"_speed\" : \"\"));\r\n if (TempNode) TempNode.addEventListener(\"change\", CalcMarch2Time, true);\r\n document.getElementById(UKMode ? \"ppp\" : \"speed\").\r\n addEventListener(\"change\", CalcMarch2Time, true);\r\n\r\n if (Event) {\r\n OrigOneWay =\r\n document.getElementById(UKMode ? \"z\" : \"timeDirection\").innerHTML;\r\n if (OrigOneWay == \"-\") {\r\n OrigOneWay = 0;\r\n } else {\r\n OrigOneWay = ToSeconds(OrigOneWay);\r\n }\r\n SpeedFrac =\r\n document.getElementById(UKMode ? \"ppp\" : \"speed\").selectedIndex / 10;\r\n document.getElementById(UKMode ? \"ppp\" : \"speed\").\r\n addEventListener(\"change\", CalcMarch2Time, true);\r\n SpeedMotivation = document.getElementById(\"motiv\" + (! UKMode ? \"_speed\" : \"\"));\r\n if (SpeedMotivation)\r\n SpeedMotivation.addEventListener(\"change\", CalcMarch2Time, true);\r\n SpeedMotivation\r\n ? SpeedMotivation =\r\n 1 - Number(SpeedMotivation.options[SpeedMotivation.selectedIndex].value) /\r\n 100\r\n : SpeedMotivation = 1;\r\n } else {\r\n OneWay = 0; SpeedFrac = 0; SpeedMotivation = 1; \r\n }\r\n SpeedMod = (1 + SpeedFrac) * SpeedMotivation;\r\n if (March2IntervalID) window.clearInterval(March2IntervalID);\r\n CalcMarch2Time();\r\n March2IntervalID = window.setInterval(CalcMarch2Time, 1000);\r\n}", "title": "" }, { "docid": "2fdd3d128c6e505603f84dc8ce0c1b1d", "score": "0.5201147", "text": "function update() {\n if (!simulationInfo.simulationIsRunning) {\n // wenn berechnung abgebrochen wurde durch timer oder stop button stoppe simulation\n if (timerID != null) {\n window.clearTimeout(timerID);\n }\n myGui.deleteSelf();\n onFinishCallBack();//htmlgui rufen damit sie weis das anwendung beendet wurde\n for (var i = 0; i < activeParticleSystems.length; i++) {\n var partS = activeParticleSystems[i];\n partS.freeMemory();\n }\n //renderer.deallocateObject(scene);\n //renderer.deallocateRenderTarget(renderer);\n return;\n }\n world.update();\n\n // loeasung fuer die das problem das bei der ersten ausfuehrung delta t ca 3 sec ist, weil dadurch die beschleuniging groß wird vold + a*deltaT.\n // grund ist, dat gui die irgendwas laedt. kein ursache gefdunden was dat dort laedt\n if (world.deltaT > 0.5) {\n console.log(\"changed deltat\");\n world.deltaT = 1 / 60;\n }\n\n var isAnyPsShowingRTT = false;\n\n //aktiven ps aktualisieren. sollte ein ps deaktiviert worden sein wird es in die entsprechende liste verschoben.\n for (var i = 0; i < activeParticleSystems.length; i++) {\n var ps = activeParticleSystems[i];\n if (!ps.isAlive) {// ps is ist durch gui deaktiviert worden oder hat sich selber deaktiviert\n ps.handleDeactivation();\n activeParticleSystems.removeItemAt(i);\n inactiveParticleSystems.push(ps);\n i = i - 1;\n continue;\n }\n ps.update();\n if (!isAnyPsShowingRTT) {// nur setzen wenn noch kein ps tex zeigt\n isAnyPsShowingRTT = ps.checkIfPsIsShowingRTT();\n }\n }\n\n that.checkInactivePs(inactiveParticleSystems);\n threeJSCamcontroller.update(50 * world.deltaT);\n myGui.update();\n if (!isAnyPsShowingRTT)renderer.render(scene, camera);\n\n renderer.clearTarget(null, false, true);// behebt fehler in firefox. Sonst wurde der renderer dort nich gecleared\n frameCounter++;\n //aktiviert einen timer fuer performance messung. muss hier geschenen da der erst aufruf der methode update lange dauern kann\n //was dazu fuehren kann, das bevor die initialisierung wriklich abgeschlossen ist, der timeout bereits ausgeloest wurde\n // davor war der start in initParticlesystems\n if (frameCounter == 25 && timerID == null && mode == \"performanceTest\") {\n timerID = window.setInterval(onTimerHandler, timeToTestPerformance);\n console.log(\"timer started\");\n frameCounter = 0;\n }\n requestAnimationFrame(update);\n }", "title": "" }, { "docid": "6c8065e413939ba81a4a74c204b6765f", "score": "0.52001786", "text": "start() {\n //if clock is already running then dont start again\n if (this._running) {\n return\n }\n this._timer = setInterval(this._renderTime.bind(this), 1000);\n this._running = true;\n\n }", "title": "" }, { "docid": "b265b0528bacf0ccbaecc459911086b9", "score": "0.5193395", "text": "timeUpdate () {\n\t console.log('12346');\n\t }", "title": "" }, { "docid": "deb46030f10a66e9dd299a542b9c133d", "score": "0.5191114", "text": "function run() {\n update((Date.now() - then) / 1000);\n render();\n then = Date.now();\n}", "title": "" }, { "docid": "c3d0e2d962e9b9aac483b3174e48f5aa", "score": "0.5187192", "text": "function updateClock() {\n tenSecCountDown--;\n let today = new Date();\n let hours = today.getHours() % 12;\n let mins = today.getMinutes();\n let secs = today.getSeconds();\n\n hourHand.groupTransform.rotate.angle = hoursToAngle(hours, mins);\n minHand.groupTransform.rotate.angle = minutesToAngle(mins);\n secHand.groupTransform.rotate.angle = secondsToAngle(secs);\n \n updateStepsIconPos();\n \n if (randomChangeActive == 1)\n randomChange();\n \n //Save every 60 seconds\n if (tenSecCountDown <= 0)\n saveStatus();\n \n if (tenSecCountDown <= 0)\n tenSecCountDown = 10;\n}", "title": "" }, { "docid": "d3f582a8ba8f78428fe63d90d5be6957", "score": "0.5186629", "text": "function updateTime() {\n var datetime = tizen.time.getCurrentDateTime(),\n hour = datetime.getHours(),\n minute = datetime.getMinutes(),\n second = datetime.getSeconds();\n\n // Rotate the hour/minute/second hands\n rotateElement(\"hand-main-hour\", (hour + (minute / 60) + (second / 3600)) * 30);\n rotateElement(\"hand-main-minute\", (minute + second / 60) * 6);\n rotateElement(\"hand-main-second\", second * 6);\n }", "title": "" }, { "docid": "409835fd15f4986c2ac78461bc1daa63", "score": "0.5186029", "text": "render() {\n const { node, translateX, translateY, width } = this.props;\n\n const { xStart, xEnd } = this.getLiveDomainForX();\n\n const redrawXAxis = (xAxis) => {\n return g => {\n g.call(xAxis);\n g.select('.domain').remove();\n g.selectAll('.tick text').attr('font-size', '14px');\n };\n };\n\n const x = scaleTime()\n .domain([xStart, xEnd])\n .range([0, width]);\n\n const xAxis = axisBottom(x)\n .ticks(timeSecond, 10)\n // .tickFormat(d => `${moment().diff(moment(d), 'seconds')}s ago`);\n .tickFormat(d => `${d.getSeconds()}s ago`);\n\n const xAxisNode = node.select('.xAxis').call(redrawXAxis(xAxis));\n\n node.select('.xAxisContainer').attr(\n 'transform',\n `translate(${translateX}, ${translateY})`\n );\n\n const transitionAmount = getTransitionAmount(xStart, xEnd, width, TRANSITION_INTERVAL);\n // this.kickoffTransition(transitionAmount);\n\n return null;\n }", "title": "" }, { "docid": "60d39def9074168848a7b8fdda7b8588", "score": "0.5180125", "text": "function update() {\n $(\"#time\").text(tomatime.getMinutesString() +\n \":\" + tomatime.getSecondsString());\n /* Math.floor(tomatime.getProgress()) + \"% completed\" */\n \n drawTimerBackground();\n \n // Not really elegant to do this every second...\n if(timerType === \"session\")\n gr_ctx.strokeStyle = sessionColor; // Line color\n else\n gr_ctx.strokeStyle = breakColor;\n \n gr_ctx.beginPath();\n gr_ctx.arc(centerX, centerY, radius, startAngle,\n startAngle + progressToAngle(tomatime.getProgress()));\n gr_ctx.stroke();\n}", "title": "" }, { "docid": "78fe63658e3f4f8ba943bff54569a339", "score": "0.5171809", "text": "function sendTime() {\r\n io.emit('time', {\r\n time: new Date().toJSON()\r\n });\r\n}", "title": "" }, { "docid": "39e4b0fc26b23bffd436708867eb5e17", "score": "0.5171623", "text": "tickDidRender(/*time*/) {}", "title": "" }, { "docid": "ba0a051e1805f32da890b75cfd485cf7", "score": "0.5164936", "text": "leTime () {\n const time = new Date().toLocaleString()\n const clock = this.shadowRoot.querySelector('.clocker')\n clock.textContent = time\n }", "title": "" }, { "docid": "c7734aa151734dc5cd7bf36c34adb182", "score": "0.51603365", "text": "function updateUIElementsFromVideoTime(time){\n \n // we only want to update the rabbit and ride stats if \"showRabbitOnRoute\" is true\n if(showRabbitOnRoute){\n\n const frameIndex = yt_getFrameIndexFromVideoTime(time);\n\n syncRabbitMarkerToVideo(\"frameIndex\", frameIndex);\n syncCumulativeRideStatsToVideo(\"frameIndex\", frameIndex);\n\n }\n\n}", "title": "" }, { "docid": "88c5227dffbbbd5f1cbbbf7398518924", "score": "0.51563966", "text": "function RealtimeTimeColumn(_ref) {\n var isDestination = _ref.isDestination,\n leg = _ref.leg,\n timeOptions = _ref.timeOptions;\n var time = isDestination ? leg.endTime : leg.startTime;\n var formattedTime = time && (0, _time.formatTime)(time, timeOptions);\n var isTransitLeg = (0, _itinerary.isTransit)(leg.mode); // For non-real-time legs, show only the scheduled time,\n // except for transit legs where we add the \"scheduled\" text underneath.\n\n if (!leg.realTime) {\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(TimeText, null, formattedTime), isTransitLeg && /*#__PURE__*/_react.default.createElement(StatusText, null, \"$_schedule2_$\"));\n } // Delay in seconds.\n\n\n var delay = isDestination ? leg.arrivalDelay : leg.departureDelay; // Time is in milliseconds.\n\n var originalTime = time - delay * 1000;\n var originalFormattedTime = originalTime && (0, _time.formatTime)(originalTime, timeOptions); // TODO: refine on-time thresholds.\n // const isOnTime = delay >= -60 && delay <= 120;\n\n var isOnTime = delay === 0;\n var statusText;\n var TimeColumn = TimeColumnBase;\n\n if (isOnTime) {\n statusText = 'on time';\n TimeColumn = TimeColumnOnTime;\n } else if (delay < 0) {\n statusText = 'early';\n TimeColumn = TimeColumnEarly;\n } else if (delay > 0) {\n statusText = 'late';\n TimeColumn = TimeColumnLate;\n } // Absolute delay in rounded minutes, for display purposes.\n\n\n var delayInMinutes = Math.abs(Math.round((isDestination ? leg.arrivalDelay : leg.departureDelay) / 60));\n var renderedTime;\n\n if (!isOnTime) {\n // If the transit vehicle is not on time, strike the original scheduled time\n // and display the updated time underneath.\n renderedTime = /*#__PURE__*/_react.default.createElement(TimeBlock, null, !isOnTime && /*#__PURE__*/_react.default.createElement(TimeStruck, null, originalFormattedTime), /*#__PURE__*/_react.default.createElement(TimeText, null, formattedTime));\n } else {\n renderedTime = /*#__PURE__*/_react.default.createElement(TimeText, null, formattedTime);\n }\n\n return /*#__PURE__*/_react.default.createElement(TimeColumn, null, renderedTime, /*#__PURE__*/_react.default.createElement(StatusText, null, !isOnTime && /*#__PURE__*/_react.default.createElement(DelayText, null, delayInMinutes, \" min\"), statusText));\n} // Connect to redux store for timeOptions.", "title": "" }, { "docid": "459c824ddd1557589c7e6b3db783a7a3", "score": "0.51559424", "text": "function Timer(){\n self = this;\n\n this.running = false;\n this.defaultTime = 3600;\n this.remaining = this.defaultTime;\n this.timeArray = {};\n this.stopped = false;\n\n this.apiPath = 'http://' + window.location.host + '/game-api';\n\n this.build = function() {\n self.stopped = false;\n self.tick();\n\n $('#start').click(function(){\n self.start();\n });\n\n $('#pause').click(function(){\n self.stop();\n });\n\n $('#setTime').click(function(){\n self.set();\n });\n };\n\n this.halt = function() {\n self.stopped = true;\n };\n\n this.sync = function() {\n jQuery.ajax({\n url: self.apiPath + '/timer',\n success: function(result) {\n self.running = result.running;\n self.remaining = result.remaining;\n },\n async: false\n });\n };\n\n this.tickEvent = function() {\n var tick = new CustomEvent('tick', {'detail': this.remaining});\n window.dispatchEvent(tick);\n window.dispatchEvent(tick);\n };\n\n this.tick = function() {\n console.log('tick');\n if (self.stopped !== true) {\n if (self.running === false){\n self.sync();\n }\n\n if (self.running === true && self.remaining > 0) {\n console.log(self.remaining);\n self.sync();\n\n self.remaining -= 1;\n self.tickEvent();\n window.setTimeout(self.tick, 1000);\n return;\n } else {\n window.setTimeout(self.tick, 1000);\n return;\n }\n }\n };\n\n this.getTime = function(){\n var hours = document.querySelector('input[name=\"hours\"]').value;\n var minutes = document.querySelector('input[name=\"minutes\"]').value;\n var seconds = document.querySelector('input[name=\"seconds\"]').value;\n if (hours === ''|| hours === null || hours === undefined)\n {\n hours = 0;\n }\n if (minutes === ''|| minutes === null || minutes === undefined)\n {\n minutes = 0;\n }\n if (seconds === ''|| seconds === null || seconds === undefined)\n {\n seconds = 0;\n }\n\n var time = parseInt(seconds);\n time += parseInt(minutes)*60;\n time += parseInt(hours)*3600;\n return time;\n };\n\n this.start = function() {\n $.ajax({\n url: self.apiPath + '/timer',\n type: 'POST',\n data: JSON.stringify({action: \"start\"}),\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n success: function(msg) {\n console.log(msg);\n }\n });\n };\n\n this.stop = function() {\n $.ajax({\n url: self.apiPath + '/timer',\n type: 'POST',\n data: JSON.stringify({action: \"stop\"}),\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n success: function(msg) {\n console.log(msg);\n }\n });\n };\n\n this.set = function() {\n $.ajax({\n url: self.apiPath + '/timer',\n type: 'POST',\n data: JSON.stringify({action: \"set\", remaining: self.getTime()}),\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n success: function(msg) {\n toastr.success('Idő beállítva');\n }\n });\n };\n\n\n}", "title": "" }, { "docid": "1aed8e019557555d66621bc4232ebfa2", "score": "0.515113", "text": "timeUpdate()\n {\n this.date = new Date();\n\n let hour = this.date.getHours();\n let min = this.date.getMinutes();\n let sec = this.date.getSeconds();\n\n document.getElementById(\"timer-place\").innerHTML = \n `\n <p id=\"timer\">${ifExtraZero(hour)}${hour}:${ifExtraZero(min)}${min}:${ifExtraZero(sec)}${sec}</p>\n `;\n }", "title": "" }, { "docid": "68d8f61e5536bed926da18ea19baa7f1", "score": "0.51493233", "text": "loopFunction(clockState) {\n let currentTime = new Date().getTime();\n let timeDelta = clockState.prevTime <= 0 ? 0 : currentTime - clockState.prevTime;\n // NOTE: iteration order is NOT guaranteed. If this becomes a requirement\n // this datastructure must be updated.\n clockState.observers.forEach(c => c.draw(timeDelta));\n clockState.prevTime = currentTime;\n }", "title": "" }, { "docid": "11dcdc92bb44def7caa2c17c62cf82b5", "score": "0.51399255", "text": "function timeUpdate() {\n if (!model.timerActive) {\n clearInterval(timer);\n } else if (model.mins === 0 && model.seconds === 0) {\n clearInterval(timer);\n model.mins = null;\n model.seconds = null;\n } else if (model.seconds === 0) {\n model.mins--;\n model.seconds = 59; \n } else {\n model.seconds--;\n }\n \n if (model.countdownStep === \"session\") {\n if (model.timerActive && model.mins !== null && model.seconds !== null) {\n elements.timer.innerHTML = model.mins + \":\" + model.seconds; \n } else if (model.timerActive && model.mins === null && model.seconds === null) {\n clearInterval(timer);\n timerController.stepChange();\n timerController.timerActiveSwitch();\n timerController.countdownTimerActivator();\n }\n } else if (model.countdownStep === \"break\") {\n if (model.timerActive && model.mins !== null && model.seconds !== null) {\n elements.timer.innerHTML = model.mins + \":\" + model.seconds; \n } else if (model.timerActive && model.mins === null && model.seconds === null) {\n clearInterval(timer);\n timerController.reset();\n return;\n }\n }\n }", "title": "" }, { "docid": "04111417b989f8368bf7501fbda82f19", "score": "0.51291037", "text": "function startTimer() {\n //new fixed date kind - i.e. what will be received from the server\n d = new Date();\n //func that transforms miliseconds in digital clock format i.e. 22:34:12\n function transformMiliseconds(t) {\n var h = Math.floor((t / (1000 * 60 * 60)) % 24);\n var m = Math.floor((t / (1000 * 60)) % 60);\n var s = Math.floor((t / 1000) % 60);\n\n h = (h < 10) ? '0' + h : h;\n m = (m < 10) ? '0' + m : m;\n s = (s < 10) ? '0' + s : s;\n return h + ':' + m + ':' + s;\n }\n //ticker function that will refresh our display every second\n function tick() {\n newd = new Date();\n document.getElementById('time_ticker').innerHTML = transformMiliseconds(newd - d);\n }\n //the runner\n t = setInterval(tick, 1000);\n}", "title": "" }, { "docid": "d4519fbede8d5315efbc594e7e39ea6b", "score": "0.5127453", "text": "render() {\n return (\n <div>\n <div className =\"Display\">{this.state.time.m} : {this.state.time.s}</div>\n <button onClick={this.startTimer}>start</button>\n <button onClick={this.plusTimer}>+</button>\n <button onClick={this.minTimer}>-</button>\n </div>\n );\n }", "title": "" }, { "docid": "83ff8eebdbca28cbb678bd31b02f117f", "score": "0.5126106", "text": "function Display() {\n that = this;\n\n this.build = function() {\n window.addEventListener('tick', function(e){\n var time = e.detail;\n that.writeTime(time);\n });\n };\n\n\n this.writeTime = function(time) {\n var counter = document.querySelector('#counter');\n time = that.formatTime(time);\n if (time.hours !== '00')\n {\n counter.innerHTML = time.hours + ':' + time.minutes + ':' + time.seconds;\n } else {\n counter.innerHTML = time.minutes + ':' + time.seconds;\n }\n };\n\n this.formatTime = function(remaining) {\n var seconds = remaining % 60;\n var minutes = Math.floor(remaining % 3600 / 60);\n var hours = Math.floor(remaining / 3600); \n var result = {'hours': hours, 'minutes': minutes, 'seconds': seconds};\n\n for(var k in result)\n {\n result[k] = parseInt(result[k]);\n }\n for(var key in result)\n {\n if(result[key] < 10 || result[key].length < 2)\n {\n result[key] = '0' + result[key];\n }\n }\n return result;\n };\n}", "title": "" }, { "docid": "4563f8588ed98a31096f51f7912007ba", "score": "0.5122503", "text": "function start(seconds, breakSecs, time, stateIn, messageIn, cycleMaxIn, restBigIn, descIn) {\n\n //console.log(request);\n description = descIn;\n biggerRest = restBigIn;\n cyclesMax = cycleMaxIn;\n durationSeconds = seconds;\n breakTime = breakSecs;\n state = stateIn;\n message = messageIn;\n\n console.log(\"max cycles: \" + cyclesMax);\n\n savedCurrentDuration = seconds;\n savedCurrentRest = breakSecs;\n\n var postRequest = new XMLHttpRequest();\n postRequest.open(\"POST\", \"https://www.toggl.com/api/v8/time_entries/start\", false);\n postRequest.setRequestHeader(\"Authorization\", 'Basic ' + btoa(yourToken)); //<<<<---- replace token ID with your own from Toggl profile page\n postRequest.setRequestHeader(\"Content-Type\", \"application/json\");\n postRequest.send(time);\n\n currentId = JSON.parse(postRequest.response);\n currentId = currentId[\"data\"];\n currentId = currentId[\"id\"];\n //console.log(currentId);\n\n countDown = setInterval(countTime, 1000);\n}", "title": "" }, { "docid": "855d93a944623e7553b475e43d3da839", "score": "0.5121839", "text": "function initClock() {\n dataRender();\n dataRenderValue();\n}", "title": "" }, { "docid": "6cf011b7b0c3f181ec70b741f75b714a", "score": "0.5121804", "text": "function update() {\n lesson1.controls.update(lesson1.clock.getDelta());\n lesson1.stats.update();\n\n // 从服务器取数据,显示到屏幕\n //MyWebsocket.sceneMgr = lesson1;\n ++ticker;\n if ((ticker+1)%25 == 1) {\n MyWebsocket.doSend(sendVal);\n }\n //// smoothly move the particleLight\n //var timer = Date.now() * 0.000025;\n //particleLight.position.x = Math.sin(timer * 5) * 300;\n //particleLight.position.z = Math.cos(timer * 5) * 300;\n}", "title": "" }, { "docid": "23cfe688804c248167993f02fd65bfa8", "score": "0.51133806", "text": "function render() {\n\t\t\t\t\n\t\tif(upToDate) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Measure the render time in ms.\n\t\tvar startDate = Date.now();\n\t\tpolycount = 0;\n\n clearCanvas();\n\n\t\t// Assume all is ready for rendering.\n\t\tupToDate = true;\n\n\t\t// A shorthand to the nodes.\n\t\tvar nodes = scenegraph.getNodes();\n\n\t\tif(showGrid) {\n\t\t\tdrawGrid(true, false, false);\n\t\t}\n\n\t\t// Check if there is an interactive node or if node is not ready yet.\n\t\t// Otherwise we cannot display matrix information for it.\n\t\tvar foundInteractiveNode = false;\n\n\t\t//console.log(\"scene.render() notes:\" + nodes.length);\n\t\t// Loop over all nodes in the scene.\n\t\t// Leave out nodes if they are not ready yet\n\t\t// and report that.\n\t\tfor(var i = 0; i < nodes.length; i++) {\n\n\t\t\t// Verify that node is ready.\n\t\t\tif(!nodes[i].isReady()) {\n\t\t\t\tupToDate = false;\n\t\t\t\t// console.log(\"note not ready:\" + i);\n\t\t\t\t// console.log(nodes[i]);\n\t\t\t\t// console.log(nodes[i].getModel());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//console.log(\"nodes[\" + i + \"] is ready\");\n\t\t\t\n\t\t\t// Render the node.\n\t\t\t// Perform modelview, projection and viewport transformations in 3D.\n\t\t\tvar worldModelview = nodes[i].updateModelview();\n\n\t\t\t// Store matrices for interactive node for debug.\n\t\t\tif(scenegraph.isInteractiveNode(i)){\n\t\t\t\tfoundInteractiveNode = true;\t\n\t\t\t\tif(displayMatrices) {\n\t\t\t\t\tvar interactiveNodeLocalModelview = mat4.create(nodes[i].getLocalModelview());\n\t\t\t\t\tvar interactiveNodeWorldModelview = mat4.create(worldModelview);\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\n\t\t\t// Skip nodes that are not visible.\n\t\t\tif(!nodes[i].isVisible()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Apply the worldModelview matrix to the node.\n\t\t\t// The result is stored in the transformedVertices of node.model.\n\t\t\tnodes[i].applyMatrixToVertices(worldModelview);\n\n\t\t\t// Apply the viewportProjection matrix to the node.\n\t\t\t// The result is stored in the projectedVertices of node.model.\n\t\t\tnodes[i].projectTransformedVertices(viewportProjection);\n\n\t\t\t// Transform, i.e. only rotate, normals for shading.\n\t\t\tvar worldRotation = nodes[i].updateRotation();\n\t\t\t// Store result in transformed normals.\n\t\t\tnodes[i].applyMatrixToNormals(worldRotation);\n\n\t\t\t// Display normals for debug.\n\t\t\tif(displayNormals) {\n\t\t\t\trenderModelNormals(nodes[i].getModel());\n\t\t\t}\n\n\t\t\t// Raster the 2D polygons of the node.\n\t\t\trenderModel(nodes[i].getModel());\n\t\t}\n\n\t\tframebuffer.display();\n\n\t\t// The following text of 2D images are displayed on top of the scene.\n\t\t\n\t\t// Show location if light in 2D, if shader users it.\n\t\t// Draw on top of models.\n\t\tif(shader.usesLightLocation()) {//&& ! scenegraph.getPointLightNode()) {\n\t\t\tdrawLightLocationMarker();\n\t\t}\n\n\t\t// Display data for interactive node.\n\t\tdisplayInfoForNode(scenegraph.getInteractiveNode());\n\t\t// Display\n\t\tif(displayMatrices && foundInteractiveNode) {\n\t\t\t// Display matrices that are common for all nodes.\n\t\t\tdisplayViewProjectionMatrices();\n\t\t\t// Display matrices for interactive node for debug.\n\t\t\tdisplayModelViewMatrix(scenegraph.getInteractiveNodename(), interactiveNodeWorldModelview, interactiveNodeLocalModelview);\n\t\t\t// Display local transformation vectors.\n\t\t\tdisplayTransformationVectorsForNode(scenegraph.getInteractiveNode());\n\t\t}\n\n\n\t\tif(upToDate) {\n\t\t\tdisplayRenderStatistics(startDate);\n\t\t}\n\n\t\treturn upToDate;\n\t}", "title": "" }, { "docid": "5d43092bac3cafe691d3e3e6c2015a5f", "score": "0.5112155", "text": "render(){\n \n\n // Update Tick\n this.tickUpdate();\n\n //mg.stats.begin()\n this.episodeManager.render();\n //mg.stats.end()\n\n window.requestAnimationFrame(()=>this.render());\n }", "title": "" }, { "docid": "021ea13b3ae269a13e51758b9d87448b", "score": "0.5110778", "text": "function Time(ns, exports) {\n\nvar m_time = Object(__WEBPACK_IMPORTED_MODULE_1__intern_time_js__[\"a\" /* default */])(ns);\n\n/**\n * Set a new timeout.\n * this method has the same behavior as window.setTimeout(), except it uses\n * engine's timeline.\n * @method module:time.set_timeout\n * @param {timeout_callback} callback Timeout callback\n * @param {number} time Timeout\n * @returns {number} Timeout ID\n */\nexports.set_timeout = m_time.set_timeout;\n\n/**\n * Clear the timeout.\n * @method module:time.clear_timeout\n * @param {number} id Timeout ID\n */\nexports.clear_timeout = m_time.clear_timeout;\n\n/**\n * Get the engine's timeline (number of seconds after engine's initialization).\n * @method module:time.get_timeline\n * @returns {number} Timeline\n */\nexports.get_timeline = m_time.get_timeline;\n\n/**\n * Animate value.\n * @method module:time.animate\n * @param {number} from Value to animate from \n * @param {number} to Value to animate to\n * @param {number} timeout Period of time to animate the value\n * @param {anim_callback} anim_cb Animation callback\n * @returns {number} Animator ID\n */\nexports.animate = m_time.animate;\n\n/**\n * Clear the animation.\n * @method module:time.clear_animation\n * @param {number} id Animator ID\n */\nexports.clear_animation = m_time.clear_animation;\n\n/**\n * Get current FPS.\n * @method module:time.get_framerate\n * @param {number} id Animator ID\n */\nexports.get_framerate = get_framerate;\nfunction get_framerate() {\n return m_time.get_framerate();\n}\n\n}", "title": "" }, { "docid": "93f6d673f3448ed5f716c03c8a855dfb", "score": "0.5108753", "text": "function FancyClock(targetId) {\n\n // properties\n this.id = targetId;\n this.table = document.createElement(\"table\");\n this.hour = -1;\n this.minute = -1;\n this.numbers = [];\n this.numbersEl = [];\n this.layout = \"inline\";\n this.loopInterval;\n this.duration = 7000;\n\n\n // methods\n this.refreshTable = function() {\n\n this.table.innerHTML = \"\";\n if (this.layout == \"inline\") {\n var row = document.createElement(\"tr\");\n for(var i = 0; i < this.numbersEl.length; i++) {\n row.appendChild(this.numbersEl[i]);\n }\n this.table.appendChild(row);\n } else {\n // (stacked)\n for(var row = 0; row < 4; row += 2) {\n var rowEl = document.createElement(\"tr\");\n for(var col = 0; col < 2; col++) {\n rowEl.appendChild(this.numbersEl[row + col]);\n }\n this.table.appendChild(rowEl);\n }\n }\n\n }\n\n this.start = function() {\n\n var self = this;\n\n this.loopInterval = setInterval(function(){\n\n var date = new Date();\n var h = (date.getHours() % 12);\n h = (h == 0) ? 12 : h;\n var m = date.getMinutes();\n\n if (self.hour != h || self.minute != m) {\n self.hour = h;\n self.minute = m;\n self.transitionTime();\n }\n\n }, 1000);\n\n }\n\n this.transitionTime = function() {\n\n // calculate each digit\n var digits = [];\n digits.push(Math.floor(this.hour / 10));\n digits.push(this.hour % 10);\n digits.push(Math.floor(this.minute / 10));\n digits.push(this.minute % 10);\n\n // transition each number\n // for(var i = 0; i < 4; i++) {\n // var self = this;\n // this.numbers[i].scrambleTransition(this.duration / 4);\n // }\n\n for(var i = 0; i < 4; i++) {\n this.numbers[i].transitionToNumber(digits[i], this.duration);\n }\n\n }\n\n // initialization\n this.init = function() {\n\n // initialize table data elements\n for(var i = 0; i < 4; i++) {\n var td = document.createElement(\"td\");\n td.setAttribute(\"id\", this.id + \"-num-\" + i);\n this.numbersEl.push(td);\n }\n\n // setup table\n this.refreshTable();\n document.getElementById(this.id).appendChild(this.table);\n\n // generate numbers\n for(var i = 0; i < 4; i++) {\n this.numbers.push(new ClockNumber(this.id + \"-num-\" + i));\n this.numbers[i].scramble();\n }\n\n // start loop\n this.start();\n\n }\n\n this.init();\n\n return this;\n\n}", "title": "" }, { "docid": "8b35597c8b1ffd223baf8b965e3e4cb9", "score": "0.5106196", "text": "aRenderTime(){\n $(`#${this.timeID}`).html(moment.tz(this.location).format(this.timeFormat));\n }", "title": "" }, { "docid": "53876a005060d5747dcc5aa05092f766", "score": "0.5103869", "text": "function startTimer(seconds) {\nStates.push(new Text(\"Please wait for the time specified. This is part of the protocol.\", seconds));\n}", "title": "" }, { "docid": "34a25ce0c8412fa9982b4f3c9e348dc5", "score": "0.5103069", "text": "render({ time }) {\n // time += 0.05;\n material.uniforms.time.value = time;\n particleMat.uniforms.time.value = time;\n points.rotation.y = time / 10;\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "3202b3dddc4fef86b62062a331846a22", "score": "0.51029277", "text": "function Mysystem2(node,view,secondTime) {\n this.node = node;\n this.view = node.view;\n this.content = node.getContent().getContentJSON();\n\n this.domIO = document.getElementById('my_system_state');\n \n if (typeof node.studentWork != 'undefined' && node.studentWork !== null) {\n this.states = node.studentWork; \n \n MySystem.registerExternalSaveFunction(this.saveTriggeredByMySystem, this);\n \n this.node.view.eventManager.subscribe('processPostResponseComplete', this.saveSuccessful);\n // MySystem is set by default to save every 20 seconds. If we want to change that frequency, we can call\n // MySystem.setAutoSaveFrequency(20000)\n } \n else {\n this.states = [];\n }\n \n this.mostRecentSavedState = null;\n this.hasRegisteredDomListeners = false;\n if(secondTime == true) {\n this.hasRegisteredDomListeners = true;\n }\n}", "title": "" }, { "docid": "77326bced47c60c9dc21f460d3849fae", "score": "0.5102856", "text": "function sendTime() {\n io.emit('time', {\n time: new Date().toJSON()\n });\n}", "title": "" }, { "docid": "3e03f42aa3abff52c41bcfc83bfecfce", "score": "0.5099585", "text": "tick(delta) {\n\t\tsuper.update(delta);\n\t\tthis.time += delta;\n\t\t//if visible, has showtime elapsed\n\t\tif (this.visibility && this.time >= this.showtime)\n\t\t{\n\t\t\t//reset counter and hide \n\t\t\tthis.time -= this.showtime;\n\t\t\tthis.hide();\n\t\t\t//console.log(\"hide demo\"); output to chrome developer console\n\t\t}\n\t\t//if not visible, has hide time elapsed\n\t\telse if (!this.visibility && this.time >= this.hidetime)\n\t\t{\n\t\t\t//reset counter and then show\n\t\t\tthis.time -= this.hidetime;\n\t\t\tthis.show();\n\t\t\t//console.log(\"show demo\");\n\t\t}\n }", "title": "" }, { "docid": "1047b08b77bbd44241c039e509bade08", "score": "0.50895596", "text": "clockRunning() {\n setInterval(() => {\n // Everything in here is part of the constant cycle, which will run only if the game is \"on:\"\n if (this.gameOn) {\n // Time: Clock updates (if necessary) with every game cycle:\n this.theTime = new Date();\n let hour = this.theTime.getHours();\n hour = (\"0\"+hour).slice(-2);\n let min = this.theTime.getMinutes();\n min = (\"0\"+min).slice(-2);\n let sec = this.theTime.getSeconds();\n sec = (\"0\"+sec).slice(-2);\n let timeString = `${hour} : ${min} : ${sec}`;\n this.clock.innerText = timeString;\n // Before movement is calculated, check what surface the player is standing on, and what medium (if any) they are immersed in:\n this.physics.determineSurface();\n this.physics.determineMedium();\n // The New Physics: Now completely in the hands of the Physics object... Now ~ 80% bug free!\n this.physics.collisionManager();\n // Distance: If the player gets close to the edge then we translate the world around them:\n this.checkScreenScroll();\n // Victory: Filter out accomplished objectives, then check for mission objective achievements, then update sidebar:\n this.mission.manageAchievements();\n // The game will freeze if you finish a mission, then unfreeze after 4.5 seconds and load a new mission:\n if (this.mission.objectivesRemaining.length == 0) this.updateMission();\n // Lastly, check for DEATH:\n this.checkForPlayerDeath();\n // Refresh the universe every 40 ms\n }\n }, 40);\n }", "title": "" }, { "docid": "519e108bba77ddf4d7dfa0ed92864087", "score": "0.5087765", "text": "function onTimeSyncComplete(e){if(isClientServerTimeSyncCompleted)return;if(e.offset !== undefined){setClientTimeOffset(e.offset / 1000);isClientServerTimeSyncCompleted = true;}}", "title": "" }, { "docid": "de22142458ac8737c04696e7cd7a2266", "score": "0.5086717", "text": "function updateTime() {\n\n}", "title": "" }, { "docid": "114d0d2c019388c2386287c35a55487a", "score": "0.5086189", "text": "function tick( currentTime )\n{\n var deltaTime = 0;\n if (lastUpdateTime)\n {\n deltaTime = ( currentTime - lastUpdateTime ) * 0.001 * timeScale; // in seconds\n\n // prevent large animation jump from switching tabs/minimizing window\n if( deltaTime > 1.0 )\n {\n deltaTime = 0.0;\n }\n\n }\n lastUpdateTime = currentTime;\n\n velDataMaterial.setFloat(\"uTime\", currentTime );\n\n resize();\n\n render( deltaTime );\n\n\n requestAnimationFrame( tick );\n}", "title": "" }, { "docid": "16e62b74ca085c024370afbfa77faed4", "score": "0.50851566", "text": "function sendTime() {\n io.sockets.emit('time', { time: new Date().toJSON() });\n}", "title": "" }, { "docid": "d2c29617af36a7eee41aa6125e6424bb", "score": "0.50827676", "text": "function updateTimer() {\n\tviscosity_measurement_stage.update();\n}", "title": "" }, { "docid": "c104fcc2c8e663011971fef3c237fbeb", "score": "0.50775564", "text": "setTimer(state, time){\n state.timeWork = time.work,\n state.timeShortPause = time.shortPause,\n state.timeLongPause = time.longPause,\n state.timeLeft = time.timeLeft,\n state.stateOfSession = time.stateOfSession,\n state.numberOfCurrentSession = time.numberOfCurrentSession\n state.numberOfFirstSession = time.numberOfCurrentSession\n }", "title": "" }, { "docid": "2ad0f489cabd540527ccc890368cdaef", "score": "0.5077533", "text": "function runTheClock() {\n\tlet d = new Date();\n\tlet hour = d.getHours() % 12 === 0 ? 12 : d.getHours() % 12;\n\tlet minute = d.getMinutes();\n\tlet seconds = d.getSeconds();\n\tTIME.textContent = hour + \":\" + timeAesthetics(minute) + \":\" + timeAesthetics(seconds);\n}", "title": "" }, { "docid": "6a1ac38c146dd0be83e6bb9c93267ab3", "score": "0.5077438", "text": "render({ time }) {\n moonGroup.rotation.y = -(time * 0.5)\n earthMesh.rotation.y = time * 0.1\n moonMesh.rotation.y = -(time * 0.5)\n controls.update();\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "e7c351eef28066cb176dd00bf4888bba", "score": "0.5074328", "text": "function sendTime() {\n io.emit('time', { time: new Date().toJSON() });\n}", "title": "" }, { "docid": "20f447dfce301f76366af3adee5ccbcf", "score": "0.50719", "text": "tickTock() {\n this.ticker = setInterval(() => {\n let elapsedTime = Date.now() - this.startTime + this.timeModifier;\n this.updateAnalogClock(elapsedTime);\n this.updateDigitalClock(elapsedTime);\n }, 10)\n }", "title": "" }, { "docid": "d1302c6c5e0336233f4e30f69b7223f0", "score": "0.5070285", "text": "render(){\r\n return(\r\n <div>{this.state.Time}</div>\r\n )\r\n\r\n }", "title": "" }, { "docid": "c607fadf9e865f1ebbe61119b56abf6e", "score": "0.5062105", "text": "render(){\n let html=\n `<div class=\"clock\">\n ${this.hours} : ${this.minutes} : ${this.seconds}\n\n </div>`;\n document.write(html);\n }", "title": "" }, { "docid": "6da34a5d3dc498963b8fa3bae81dd025", "score": "0.5059383", "text": "clock () {\n this.leTime()\n setInterval(() => {\n this.leTime()\n }, 1000)\n }", "title": "" }, { "docid": "fb702aa579302b8e6c2668167e14554e", "score": "0.505701", "text": "renderTime(props) {\n return (\n <Time\n {...props}\n textStyle={{\n left: { color: `${Global.colors.tchatColor}` },\n right: { color: `${Global.colors.tchatColor}` }\n }}\n />\n ); // return\n }", "title": "" } ]
026f25271742574f30cca8b675b2b558
bl_order of the last bit length code to send.
[ { "docid": "9388c08e76901547f3c5845f9be7ac1d", "score": "0.0", "text": "function build_bl_tree(){var max_blindex;// index of last bit length code of non zero freq\n// Determine the bit length frequencies for literal and distance trees\nscan_tree(dyn_ltree,l_desc.max_code);scan_tree(dyn_dtree,d_desc.max_code);// Build the bit length tree:\nbl_desc.build_tree(that);// opt_len now includes the length of the tree representations, except\n// the lengths of the bit lengths codes and the 5+5+4 bits for the\n// counts.\n// Determine the number of bit length codes to send. The pkzip format\n// requires that at least 4 bit length codes be sent. (appnote.txt says\n// 3 but the actual value used is 4.)\nfor(max_blindex=BL_CODES-1;max_blindex>=3;max_blindex--){if(bl_tree[Tree.bl_order[max_blindex]*2+1]!==0)break;}// Update opt_len to include the bit length tree and counts\nthat.opt_len+=3*(max_blindex+1)+5+5+4;return max_blindex;}// Output a byte on the stream.", "title": "" } ]
[ { "docid": "5980bc6520e98da2a20a066b0ed67d9b", "score": "0.67989624", "text": "getBufferLength(order) {\n\t\treturn (2**order)**2*2\n\t}", "title": "" }, { "docid": "dbb5791d1dff85d3c5217e66e65c43df", "score": "0.5994928", "text": "function bnByteLength() {\n\t return this.bitLength() >> 3\n\t}", "title": "" }, { "docid": "dbb5791d1dff85d3c5217e66e65c43df", "score": "0.5994928", "text": "function bnByteLength() {\n\t return this.bitLength() >> 3\n\t}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "11bfd24619e4154f180d6808476edeef", "score": "0.5968421", "text": "function bnByteLength() {\n return this.bitLength() >> 3\n}", "title": "" }, { "docid": "7be6ab74ff080ad3d04a8cb14743f54a", "score": "0.58936644", "text": "function bnBitLength() {\n\tif (this.t <= 0) return 0;\n\treturn this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "title": "" }, { "docid": "2a82053f86dbafd0959831359ed115d9", "score": "0.58879054", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "d8e0f6a5d454a0be5af6d6aab2d86086", "score": "0.58773947", "text": "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "title": "" }, { "docid": "d8e0f6a5d454a0be5af6d6aab2d86086", "score": "0.58773947", "text": "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "title": "" }, { "docid": "92450e4b256173dcf734d29805c36b2c", "score": "0.5864269", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "927dee68deeb966ad1105e537d24f98f", "score": "0.5851784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "927dee68deeb966ad1105e537d24f98f", "score": "0.5851784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "927dee68deeb966ad1105e537d24f98f", "score": "0.5851784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "927dee68deeb966ad1105e537d24f98f", "score": "0.5851784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "927dee68deeb966ad1105e537d24f98f", "score": "0.5851784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "title": "" }, { "docid": "1525aaca3ce845b6f93024b14a8e077d", "score": "0.5841695", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n\t}", "title": "" }, { "docid": "0a9a4b2b9f9082e7596a7d0b7791a448", "score": "0.5838193", "text": "function build_bl_tree() {\n\t\tvar max_blindex; // index of last bit length code of non zero freq\n\t\t// Determine the bit length frequencies for literal and distance trees\n\n\t\tscan_tree(dyn_ltree, l_desc.max_code);\n\t\tscan_tree(dyn_dtree, d_desc.max_code); // Build the bit length tree:\n\n\t\tbl_desc.build_tree(that); // opt_len now includes the length of the tree representations, except\n\t\t// the lengths of the bit lengths codes and the 5+5+4 bits for the\n\t\t// counts.\n\t\t// Determine the number of bit length codes to send. The pkzip format\n\t\t// requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t// 3 but the actual value used is 4.)\n\n\t\tfor (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0) break;\n\t\t} // Update opt_len to include the bit length tree and counts\n\n\n\t\tthat.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t\treturn max_blindex;\n\t} // Output a byte on the stream.", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9074790fa103c5e4f11a5fa62ee7fa5e", "score": "0.58354396", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "077b9545d4ee9d2ec9e03f8fcff78adc", "score": "0.5834363", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "title": "" }, { "docid": "077b9545d4ee9d2ec9e03f8fcff78adc", "score": "0.5834363", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "00545454ec3ee702f375c99a29815333", "score": "0.5820082", "text": "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "title": "" }, { "docid": "9e74fba638ec57aee705bfc6c9abfa05", "score": "0.58199745", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "title": "" }, { "docid": "9e74fba638ec57aee705bfc6c9abfa05", "score": "0.58199745", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "title": "" }, { "docid": "9e74fba638ec57aee705bfc6c9abfa05", "score": "0.58199745", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "title": "" }, { "docid": "9e74fba638ec57aee705bfc6c9abfa05", "score": "0.58199745", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "title": "" }, { "docid": "9e74fba638ec57aee705bfc6c9abfa05", "score": "0.58199745", "text": "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "title": "" }, { "docid": "0a852be76da0ff1fef4e7fe0a0e2b154", "score": "0.5819529", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "title": "" }, { "docid": "0a852be76da0ff1fef4e7fe0a0e2b154", "score": "0.5819529", "text": "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "title": "" }, { "docid": "801aa28ad80663ef0faa517dea3ebaac", "score": "0.58189535", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "ef0e21bafaaa82601effd728b9c1d692", "score": "0.58161294", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" }, { "docid": "7b8e0b86457653c48a1e55e0285b1849", "score": "0.58122784", "text": "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "title": "" } ]
8a12feef9be463757b741d4d9b2b12ca
Hover event handler for list items.
[ { "docid": "f4ed70e1e03543ef0c10d5524b12e7c9", "score": "0.65054", "text": "function handleItemHover() {\n $(this).toggleClass(\"item_hover\");\n}", "title": "" } ]
[ { "docid": "ebf65a470e00b1011d45b5adc9e430af", "score": "0.71404165", "text": "function allowListHover(i){\r\n $('.list:eq('+i+')').on('mouseover mouseout');\r\n}", "title": "" }, { "docid": "9321b0d6d7b7fcea83e2f2ee0e8d1264", "score": "0.7139063", "text": "function hoverItem (e) {\n\tlet target = e.target;\n\tif(target.nodeName === 'B'){\n\t\ttarget = target.parentElement;\n\t}\n\n\tif(target.nodeName === 'LI'){\n\t\tlet hightlighted = document.querySelector('#autocompleteList .highlighted');\n\t\ttarget.classList.add('highlighted');\n\t}\n}", "title": "" }, { "docid": "0713f8c57f72fc9bb1413918b07bc422", "score": "0.6943305", "text": "function event_handling () {\n var list = $(\"#longlist\");\n \n list.on(\"mouseenter\", \"li\", function(){\n $(this).text(\"Click me!\");\n });\n \n list.on(\"click\", \"li\", function() {\n $(this).text(\"Why did you click me?!\");\n });\n }", "title": "" }, { "docid": "cda7c36ae34219295e77cd17105a17f6", "score": "0.69254327", "text": "function CategoryLiOnMouseover(obj_li) {\n try {\n di_jq(obj_li).addClass('di_gui_label_hover');\n di_jq(obj_li).css(\"cursor\", \"pointer\");\n IsCategoryHover = true;\n }\n catch (err) { }\n}", "title": "" }, { "docid": "47c09fcd5f2a2d8c930d564ec7eee785", "score": "0.68611133", "text": "function hoverEvents() {\n\t$('ul.goal li').hover(function() {\n\t\thighlightLine(parseInt($(this).data('line')));\n\t}, function() {\n\t\tline = parseInt($(this).data('line'));\n\t\tif (line != focusLine) {\n\t\t\tremoveHighlight(parseInt($(this).data('line')));\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8f38b5dc66972ca2622b0c8f57e9a631", "score": "0.6577069", "text": "hover(hoveredOverItem) {\n if (hoveredOverItem.id !== id) {\n onMoveItem(hoveredOverItem.id, id);\n }\n }", "title": "" }, { "docid": "cf9d815017ecbf78250ec2263cd5cb34", "score": "0.65262955", "text": "onListMouseOver(e) {\n var found = false;\n var n, l, node, nodes;\n\n if (e.target.nodeName === 'LI') {\n nodes = e.target.parentNode.getElementsByClassName('selected');\n\n for (n = 0, l = nodes.length; n < l; n++) {\n node = nodes[n];\n\n if (e.target !== node) {\n node.classList.remove('selected');\n } else {\n found = true;\n }\n }\n\n if (!found) {\n e.target.classList.add('selected');\n }\n }\n }", "title": "" }, { "docid": "0c582a254cc033793e4802c3f349d4dc", "score": "0.65185946", "text": "function hoverFunk() {\n$('li').hover(\n\tfunction()\n\t{\n\t\tvar self=this;\n\t\t$(self).css('background-color', 'dodgerblue');\n\t},\n\tfunction()\n\t{\n\t\tvar self1=this;\n\t\t$(self1).css('background-color', 'white');\n\t} );\n}", "title": "" }, { "docid": "85f57e0936a4c3bf94e0bde0e26922ed", "score": "0.6480168", "text": "function itemMouseover() {\n\t\t\t\tif (window.disableFlyouts) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// This is a tablet hack. We don't catch the mouseout event so we have to save this node and trigger mouseout from the JS interface\n\t\t\t\tself.mouseoverItems.push(item);\n\n\t\t\t\tmouseoverCnt++;\n\t\t\t\tisMouseoverItem = true;\n\t\t\t\tif (!isExpanded && !isSliding) {\n\t\t\t\t\tif (sublist) {\n\t\t\t\t\t\t// adding a data attribute if the item has a sublist\n\t\t\t\t\t\t// this is used to know whether to go to a page or bring down the flyout menu on tablet\n\t\t\t\t\t\titem.data('hasChildren', true);\n\t\t\t\t\t\t// when a sublist is expanded, immediately contract all siblings' sublists\n\t\t\t\t\t\tgetSiblings(item).each(function(i, siblingNode) {\n\t\t\t\t\t\t\tif (siblingNode._flyoutmenu_contract) {\n\t\t\t\t\t\t\t\tsiblingNode._flyoutmenu_contract();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\texpandSublist();\n\t\t\t\t\t\titem.data('isExpanded', true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "84a1fdbd3d5d8e6ac7d674dd329b7aed", "score": "0.63816375", "text": "function onListedPropertyIsHover(key){\n return onListedPropertySetStyle(key, 'hover');\n}", "title": "" }, { "docid": "398bf8d67966e9b19ce7392b8d87f6ca", "score": "0.63672245", "text": "render () {\n\t\tvar style = {\n\t\t\tfontWeight: this.state.hover ? 'bold' : 'normal'\n\t\t}\n\n\t\treturn (\n\t\t\t<li style={style} onMouseEnter={this.onMouseEnter.bind(this)} onMouseLeave={this.onMouseLeave.bind(this)}>\n\t\t\t {this.props.items} \n\t\t\t</li>\n\t\t);\t\t\n\t\n\t}", "title": "" }, { "docid": "5e1496e289fb0066f8d639737e0ba831", "score": "0.6311587", "text": "hoverInfo(event) { \n\n }", "title": "" }, { "docid": "53ff3d5b7dbe938f69c65173cfb86fbb", "score": "0.62580216", "text": "function overItem(event) { //efecto hover al entrar\n screen.className = \"text hovered\";\n }", "title": "" }, { "docid": "3f2647d99d0e8127681155127de0df19", "score": "0.6249547", "text": "function BpWidgetHover() {\n\t\t\n\telements = '.widget_bp_groups_widget, .widget_bp_core_members_widget'; // defaults\n\t\n\tjQuery(elements).find('li:not(.hoverable)').hover(\n\t\tfunction () {\n\t\t\tjQuery(this).addClass('hover');\n\t\t\tif (typeof Cufon == 'function') {\n\t\t\t\tCufon.refresh();\n\t\t\t}\n\t\t}, \n\t\tfunction () {\n\t\t\tjQuery(this).removeClass('hover');\n\t\t\tif (typeof Cufon == 'function') {\n\t\t\t\tCufon.refresh();\n\t\t\t}\n\t\t}\n\t).click( function() {\n\t\turl = jQuery(this).find('.item-title a').attr('href');\n\t\tif (url) {\n\t\t\tdocument.location = url;\n\t\t}\n\t}).addClass('hoverable');\n}", "title": "" }, { "docid": "652d423031ff12a6d5f5f781a8aa76ae", "score": "0.622367", "text": "hover(item) { // item is the dragged element\n if (!ref.current) {\n return;\n }\n const dragIndex = item.index;\n // current element where the dragged element is hovered on\n const hoverIndex = index;\n // If the dragged element is hovered in the same place, then do nothing\n if (dragIndex === hoverIndex) {\n return;\n }\n // If it is dragged around other elements, then move the image and set the state with position changes\n moveImage(dragIndex, hoverIndex);\n /*\n Update the index for dragged item directly to avoid flickering\n when the image was half dragged into the next\n */\n item.index = hoverIndex;\n }", "title": "" }, { "docid": "da587b88d10fd8fff1bfaf09e73efef2", "score": "0.6205393", "text": "function sublistWrapperMouseover() {\n\t\t\t\tif (window.disableFlyouts) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tmouseoverCnt++;\n\t\t\t}", "title": "" }, { "docid": "61ebf533e632bed6e793feed6a3ea4d6", "score": "0.6204093", "text": "function hover(event, pos, item) {\n if (item) {\n $(\"#label\").css(\"display\", \"block\");\n $(\"#label\").css(\"position\", \"absolute\");\n // Offset the label so it's not covered by the cursor\n $(\"#label\").css(\"left\", (item.pageX + 10) + \"px\");\n $(\"#label\").css(\"top\", (item.pageY - 20) + \"px\");\n $(\"#label\").text(item.datapoint[1]);\n }\n else {\n $(\"#label\").css(\"display\", \"none\");\n }\n}", "title": "" }, { "docid": "946a0ee7d0b883114cd20d5f80999ae4", "score": "0.6170783", "text": "function addItemHandler() {\n //$(\"table#items > tbody > tr\").hover(handleItemHover, handleItemHover);\n $(\"table#items > tbody > tr\").click(handleItemClick);\n}", "title": "" }, { "docid": "52b92bbb6604b70d0f9638e953b0fb09", "score": "0.616771", "text": "function doHover(itemList, itemHeader, listHeight) {\n\n // Change only one display status at a time\n var oldList = $(container).find('.' + options.classOpen).closest(\n 'li').find('ul:first');\n\n if (false === oldList.is(':animated')) {\n if (options.keepHeight == true) {\n listHeight = maxHeight;\n }\n\n // Change display status if not already open\n if (itemHeader.hasClass(options.classOpen) == false) {\n itemList.children().show();\n itemList.animate({\n height : listHeight\n }, {\n step : function(n, fx) {\n itemList.height(listHeight - n);\n },\n duration : options.speed\n });\n\n oldList.animate({\n height : 0\n }, {\n step : function(n, fx) {\n itemList.height(listHeight - n);\n },\n duration : options.speed\n }).children().hide();\n\n // Switch classes for headers\n itemHeader.addClass(options.classOpen).removeClass(\n options.classClosed);\n\n oldList.closest('li').removeClass(options.classActive)\n .find('a:first').addClass(options.classClosed).removeClass(\n options.classOpen);\n }\n }\n }", "title": "" }, { "docid": "56896fa48a1c974deaaa46def879d60c", "score": "0.6148481", "text": "function listHover(){\r\n $('.list').mouseover(function(){\r\n $(this).css(\"background-image\", \"linear-gradient(to right,#93f01a, #1ab126)\");\r\n });\r\n\r\n $('.list').mouseout(function(){\r\n $(this).css(\"background-image\", \"linear-gradient(to right,#f08915, #d83d45\");\r\n });\r\n}", "title": "" }, { "docid": "685c303ec7a2b1417d5799e4d88bdbad", "score": "0.61216646", "text": "function mouseOverMainListElement(event) {\n \n if (lastul==event.target.closest(\"ul\")) {\n return;\n }\n\n var color = randomColor();\n event.target.closest(\"ul\").style = \"background: \"+color+\"; transition: 1s \"\n\n for (let i = 1; i < event.target.closest(\"ul\").children.length; i++) {\n event.target.closest(\"ul\").querySelectorAll(\"li\")[i].classList.remove(\"hidden\"); \n }\n\n lastul=event.target.closest(\"ul\");\n event.target.classList.remove(\"hidden\");\n}", "title": "" }, { "docid": "9ba48d5eba4d3ebcd2a98821103b5178", "score": "0.61110896", "text": "function setupHoverActions() {\n\t\t\t\t\n\t\t\t\tvar hoverTimeout = null;\n\t\t\t\tvar hoverOutTimeout = null;\n\t\t\t\tvar $hoveredItem = null;\n\t\t\t\t\n\t\t\t\tfunction showItem($item) {\n\t\t\t\t\tvar $actions = $item.find('.PageListActions');\n\t\t\t\t\tif(!$actions.is(\":visible\") || $item.hasClass('PageListItemOpen')) {\n\t\t\t\t\t\t// we confirm :visible so that we don't iterfere with admin themes that already\n\t\t\t\t\t\t// make the PageList items visible with css hover states\n\t\t\t\t\t\t$item.addClass('PageListItemHover');\n\t\t\t\t\t\t$actions.css('display', 'inline').css('opacity', 0)\n\t\t\t\t\t\t\t.animate({opacity: 1.0}, options.hoverActionFade);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfunction hideItem($item) {\n\t\t\t\t\tvar $actions = $item.find('.PageListActions');\n\t\t\t\t\t$item.removeClass('PageListItemHover');\n\t\t\t\t\tif($actions.is(\":visible\")) { // || $hoveredItem.hasClass('PageListItemOpen')) {\n\t\t\t\t\t\t$actions.animate({opacity: 0}, options.hoverActionFade, function () {\n\t\t\t\t\t\t\t$actions.hide();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$outer.on('keydown', '.PageListItem', function(e) {\n\t\t\t\t\t// PR#1 makes page-list keyboard accessible\n\t\t\t\t\te = e || window.event;\n\t\t\t\t\tif(e.keyCode == 0 || e.keyCode == 32) {\n\t\t\t\t\t\t// spacebar\n\t\t\t\t\t\tvar $actions = $(this).find('.PageListActions');\n\t\t\t\t\t\tif($actions.is(\":visible\")) {\n\t\t\t\t\t\t\t$actions.css('display', 'none');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$actions.css('display', 'inline-block');\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});\n\n\t\t\t\t$outer.on('mouseover', '.PageListItem', function(e) {\n\n\t\t\t\t\tif($root.is(\".PageListSorting\") || $root.is(\".PageListSortSaving\")) return;\n\t\t\t\t\tif(!$(this).children('a:first').is(\":hover\")) return;\n\t\t\t\t\t\n\t\t\t\t\t$hoveredItem = $(this);\n\t\t\t\t\t//console.log('pageX=' + e.pageX);\n\t\t\t\t\t//console.log('offsetX=' + $hoveredItem.offset().left);\n\t\t\t\t\t\n\t\t\t\t\t//var maxPageX = $(this).children('.PageListNumChildren').offset().left + 100;\n\t\t\t\t\t//if(e.pageX > maxPageX) return;\n\t\t\t\t\t\n\t\t\t\t\tif($hoveredItem.hasClass('PageListItemHover')) return;\n\t\t\t\t\tvar $item = $(this);\n\t\t\t\t\tif(hoverTimeout) clearTimeout(hoverTimeout);\n\t\t\t\t\tvar delay = options.hoverActionDelay;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\thoverTimeout = setTimeout(function() {\n\t\t\t\t\t\tif($hoveredItem.attr('class') == $item.attr('class')) {\n\t\t\t\t\t\t\tif(!$hoveredItem.children('a:first').is(\":hover\")) return;\n\t\t\t\t\t\t\tvar $hideItems = $outer.find(\".PageListItemHover\");\n\t\t\t\t\t\t\tshowItem($hoveredItem);\n\t\t\t\t\t\t\t$hideItems.each(function() { hideItem($(this)); });\n\t\t\t\t\t\t}\n\t\t\t\t\t}, delay); \n\n\t\t\t\t}).on('mouseout', '.PageListItem', function(e) {\n\t\t\t\t\tif($root.is(\".PageListSorting\") || $root.is(\".PageListSortSaving\")) return;\n\t\t\t\t\tvar $item = $(this);\n\t\t\t\t\tif($item.hasClass('PageListItemOpen')) return;\n\t\t\t\t\tif(!$item.hasClass('PageListItemHover')) return;\n\t\t\t\t\tvar delay = options.hoverActionDelay * 0.7;\n\t\t\t\t\thoverOutTimeout = setTimeout(function() {\n\t\t\t\t\t\tif($item.is(\":hover\")) return;\n\t\t\t\t\t\tif($item.attr('class') == $hoveredItem.attr('class')) return;\n\t\t\t\t\t\thideItem($item);\n\t\t\t\t\t}, delay);\n\t\t\t\t});\n\t\t\t\n\t\t\t}", "title": "" }, { "docid": "a146b009e7f97f4357766a08e0fed1e5", "score": "0.6091855", "text": "onMouseOver(event) {\n const me = this;\n\n if (this.focusOnHover !== false) {\n const fromItemElement = DomHelper.up(event.relatedTarget, '.b-widget'),\n toItemElement = DomHelper.up(event.target, '.b-widget'),\n overItem = Widget.fromElement(toItemElement);\n\n // Activate soon in case they're moving fast over items.\n if (!DomHelper.isTouchEvent && toItemElement && toItemElement !== fromItemElement && overItem.parent === this) {\n me.setTimeout({\n fn : 'handleMouseOver',\n delay : 30,\n args : [overItem],\n cancelOutstanding : true\n });\n }\n }\n }", "title": "" }, { "docid": "aee01fe36f0a05b38904044780d60626", "score": "0.607129", "text": "function setImageHovers()\n{\n // add the image thumbnail tag\n var img = $('<img>').attr('id', 'species-hover-thumbnail')\n .appendTo('body');\n\n // if the image doesn't load, show a fallback image\n img.on('error', function(){\n $(this).attr('src', 'species_images/thumbnails/adiantum_pedatum.jpg');\n });\n\n $('ul.species-list').on('mouseenter', 'li', function(e){\n $(\"#species-hover-thumbnail\").css({display: 'block'});\n var latin_name = whichName == 'latin' ? this.innerHTML : 'What';\n $('#species-hover-thumbnail').attr('src', \n getThumbnailURL(latin_name));\n $(\"#species-hover-thumbnail\").stop().animate({\n top: $(this).offset().top + 'px', \n left: $(this).offset().left + $(this).parent().outerWidth() + 'px'\n }, 50);\n });\n\n $('.species-list').on('mouseout', function(){\n $(\"#species-hover-thumbnail\").css({display: 'none'});\n });\n\n}", "title": "" }, { "docid": "95b2d0009cd27f6867f7cceeadd00a5f", "score": "0.6036509", "text": "function mouseLeaveMainListElement(event) {\n for (let i = 1; i < event.target.closest(\"ul\").children.length; i++) {\n event.target.closest(\"ul\").querySelectorAll(\"li\")[i].classList.add(\"hidden\"); \n }\n event.target.classList.remove(\"hidden\");\n}", "title": "" }, { "docid": "35e1f50e0dfe9678c34c7675411c3c57", "score": "0.60277534", "text": "function mouseOverHandler(){\n isHovering = true;\n}", "title": "" }, { "docid": "7ee8562f480e2fe7b2e26e333c416bf2", "score": "0.60177755", "text": "function liEvents(item) {\n item.addEventListener('click', itemClickListener);\n}", "title": "" }, { "docid": "c50ea6cd73a3af6542922f3e337c4de6", "score": "0.60106844", "text": "function handleOnMouseEnter() {\n setHovered(true);\n }", "title": "" }, { "docid": "6b267ba69d0c420c862c615903a2f30a", "score": "0.5980055", "text": "onhover() {\n this.hover = true;\n }", "title": "" }, { "docid": "8d1a6ab6342b44b3f29a0b0ccea6bdbf", "score": "0.59098536", "text": "function linkMouseover(d) {\n }", "title": "" }, { "docid": "0982c50da9e098aaab4544646015d3f1", "score": "0.59042645", "text": "function CategoryLiOnMouseout(obj_li) {\n try {\n di_jq(obj_li).removeClass('di_gui_label_hover');\n IsCategoryHover = false;\n }\n catch (err) { }\n}", "title": "" }, { "docid": "81fc4772f3e2f1978a165a57a1ad252b", "score": "0.58896786", "text": "function setIconHover () {\n $(\".icons-edit-buttons li\").mouseenter (function () { $(this).addClass (\"ui-state-hover\"); })\n .mouseleave (function () { $(this).removeClass (\"ui-state-hover\"); });\n $(\".op-icons .image-trash\").mouseenter (function () { $(this).addClass (\"ui-state-hover\"); })\n .mouseleave (function () { $(this).removeClass (\"ui-state-hover\"); });\n}", "title": "" }, { "docid": "383977830dce0164f180e4230034fff7", "score": "0.58813316", "text": "function mouseOver(d,i) {\r\n // TODO some sort of color change\r\n}", "title": "" }, { "docid": "665a697895a38723b8db310c663ea5b1", "score": "0.58577687", "text": "_handleMouseEnter() {\n this._hovered.next(this);\n }", "title": "" }, { "docid": "665a697895a38723b8db310c663ea5b1", "score": "0.58577687", "text": "_handleMouseEnter() {\n this._hovered.next(this);\n }", "title": "" }, { "docid": "c66d34ab415b43e71620bc7993479af5", "score": "0.5836948", "text": "function hovering() {\n\n}", "title": "" }, { "docid": "c66d34ab415b43e71620bc7993479af5", "score": "0.5836948", "text": "function hovering() {\n\n}", "title": "" }, { "docid": "d0d5580a43e5b2f35fb5fd0a360aec30", "score": "0.5807151", "text": "function unhoverItem (e) {\n\tlet target = e.target;\n\tif(target.nodeName === 'B'){\n\t\ttarget = target.parentElement;\n\t}\n\n\tif(target.nodeName === 'LI'){\n\t\ttarget.classList.remove('highlighted');\n\t}\n}", "title": "" }, { "docid": "1f78100494f0ece7678d921b2b915d36", "score": "0.57949775", "text": "function displayInfo(item){\n item.addEventListener('mouseenter', function(){\n infoText.classList.remove('disable');\n })\n item.addEventListener('mouseleave', function(){\n infoText.classList.add('disable');\n })\n }", "title": "" }, { "docid": "61449fc67abe6722382b5f15e13b33ae", "score": "0.5781052", "text": "function suggestItemHandler(suggestItems) {\n // bind mouseenter/mouseleave to suggest options\n // toggles active state on mouseenter\n\n suggestItems.on(\"mouseenter mouseleave\", function (e) {\n var sqItem = $(e.currentTarget);\n if (e.type === \"mouseenter\") {\n highlightResult(sqItem);\n } else {\n unhighlightResult(sqItem);\n }\n });\n\n // bind 'mousedown' event to suggest options to go to url\n // using 'mousedown' instead of 'click' due to 'blur' event blocking the 'click' event from firing\n suggestItems.off('click').on(\"click\", SuggestedItemClick);\n }", "title": "" }, { "docid": "c38b2104123d94b3cd8cdb85f31a822f", "score": "0.57679325", "text": "function handleMouseOver(d, i) { // Add interactivity\n\n // Use D3 to select element, change color and size\n d3.select(this)\n .attr('xlink:href', \"/picture/yellowstar.png\")\n\n $(\"div#particleDummy\").show();\n\n if (d.context) {\n tooltip.html(d.context.substring(0, 20) + \"···\")\n .style(\"left\", (d3.event.pageX + 8) + \"px\")\n .style(\"top\", (d3.event.pageY - 67) + \"px\");\n tooltip.transition()\n .duration(100)\n .style(\"opacity\", .9);\n }\n}", "title": "" }, { "docid": "dd8dac4f6ab70c5d11bf534f88b2ee92", "score": "0.5757743", "text": "onListMouseDown(e) {\n var cellNode;\n\n if (e.target.nodeName === 'LI') {\n cellNode = e.target.parentNode.fwCellNode;\n this.updateCellNode(cellNode);\n cellNode.focus();\n e.preventDefault();\n }\n }", "title": "" }, { "docid": "50972acf4df60b06462db90b86f70b72", "score": "0.5755214", "text": "function addHoverEvents() {\n /* on hover */\n $menu.on('mouseenter', '.mi-parent', function(evt) {\n if (isTouch && windowWidth <= BREAKPOINT_WIDTH_TOUCH) {\n return;\n }\n\n $(this).addClass(CSS_OPEN_CLASS).siblings().removeClass(CSS_ACTIVE_CLASS);\n });\n\n /* on hover out */\n $menu.on('mouseleave', '.mi-parent', function(evt) {\n var $mi = $(this);\n\n if (isTouch && windowWidth <= BREAKPOINT_WIDTH_TOUCH) {\n return;\n }\n\n $mi.removeClass(CSS_OPEN_CLASS);\n });\n }", "title": "" }, { "docid": "fbbc7c8b1fbbf97079c49c3876209bac", "score": "0.57219636", "text": "function addFunctionToItems() {\n let items = document.querySelectorAll(\".item\");\n\n items.forEach(item => {\n item.addEventListener(\"mouseover\", changeBackgroundColor)\n });\n}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.5720898", "text": "function ListItem() {}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.5720898", "text": "function ListItem() {}", "title": "" }, { "docid": "089195655cd5eef161e1e27b91d50293", "score": "0.5711191", "text": "function changeLinksColor() {\n var parent = $('#main-nav ul .list-item');\n parent.each(function() {\n $(this).mouseenter(function() {\n $(this).find('a').css('color','gray');\n }).mouseleave(function() {\n $(this).find('a').css('color','white');\n });\n });\n}", "title": "" }, { "docid": "99bd18509b1f2d7b41e9b4972ee80f79", "score": "0.57034904", "text": "function handleMouseEnter(e) {\n // the target has the label and the html for the mega menu in its innerhtml\n let target = e.target.innerHTML.toLowerCase();\n\n // use only the label, mega menu html has been removed\n const discardIndex = target.indexOf(\"<div\");\n target = target.substring(0, discardIndex);\n\n // reset all li active class then set the class for the selected li below\n\n switch (target) {\n case \"solutions\":\n resetActiveClass();\n e.target.classList.add(\"active\");\n dispatch({ type: \"START_HOVER\", id: \"solutionsMenu\" });\n break;\n case \"products\":\n resetActiveClass();\n e.target.classList.add(\"active\");\n dispatch({ type: \"START_HOVER\", id: \"productsMenu\" });\n break;\n case \"resources\":\n resetActiveClass();\n e.target.classList.add(\"active\");\n dispatch({ type: \"START_HOVER\", id: \"resourcesMenu\" });\n break;\n default:\n }\n }", "title": "" }, { "docid": "12842343f4929b2ba3957754e520da80", "score": "0.56704795", "text": "function genericUserProfileListEditHover(id) {\n $( \"li[id^=\" + id + \"]\" ).each(function(index, liUI) {\n if (!$(liUI).children('a').is(':visible')) {\n return ;\n }\n $(liUI).children('a').toggle();\n\n $(liUI).hover(function() {\n $(liUI).children('a').toggle();\n });\n });\n}", "title": "" }, { "docid": "4490f4864d70158311b537683dc5c543", "score": "0.5666893", "text": "function top_preview_form_element_hover(e)\r\n{\r\n\tvar category_id = $(e).attr('category_id');\r\n\tvar item_id = $(e).attr('item_id');\r\n\r\n\ttop_preview_form_hover($(e), category_id, item_id);\r\n}", "title": "" }, { "docid": "36ba12ae3ebd3e6eff7b9539d18eaea6", "score": "0.5665603", "text": "hover(item, monitor) {\n if(!ref.current) {\n return;\n }\n\n // Basically here we want to know what the drag index is\n // As we click on a item we gonna assign an index to it and we want to get whatever that index is \n const dragIndex = item.index;\n // the hoverIndex will be the index that we will get when we hover over(Column)\n const hoverIndex = index;\n\n // If a user is hovering over the same item then we don't need to do anything there\n if(dragIndex === hoverIndex) {\n return;\n }\n\n const hoveredRect = ref.current.getBoundingClientRect();\n const hoverMiddleY = (hoveredRect.bottom - hoveredRect.top) / 2;\n // To get our mouse position whenever we are dragging on the screen\n const mousePosition = monitor.getClientOffset();\n const hoverClientY = mousePosition.y - hoveredRect.top;\n\n // the drag index is whatever item index we're working with when we click and drag aan item\n // so if the dragIndex is less than the hoverIndex then we don't have to do anything but if it's \n // halfway over the card that it's hovering over then it's gonna pop down\n if(dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n if(dragIndex > hoverIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // this is a callback that wea re gonna supply. This function will allow us to\n // actually change where the card is in the same column \n moveItem(dragIndex, hoverIndex);\n item.index = hoverIndex;\n }", "title": "" }, { "docid": "26a39d1bddea3c20c7d247a7315e5b4d", "score": "0.5658479", "text": "function handleMouseEnter(e) {\r\n console.log(e.target)\r\n console.log(\"handleMouseEnter elm\")\r\n hoveredDispatch({ type: \"hovered\", payload: { id: e.target.id } })\r\n }", "title": "" }, { "docid": "28f4d72e0d78c556d81d806e81faae2c", "score": "0.56572753", "text": "function IsItemHovered(flags = 0) {\n return bind.IsItemHovered(flags);\n }", "title": "" }, { "docid": "58579c6632d5469b00636cb4b179f365", "score": "0.5655347", "text": "hover(targetProps, monitor) {\n // Get the item being called for\n const targetId = targetProps.id;\n const sourceProps = monitor.getItem();\n const sourceId = sourceProps.id;\n\n if(sourceId !== targetId) {\n targetProps.onMove({sourceId, targetId});\n }\n }", "title": "" }, { "docid": "378102b5a14c09000698d2d98bd315f0", "score": "0.5653837", "text": "function mouseover() {\n var x = $(this).attr('x');\n var y = $(this).attr('y');\n\n $(this).addClass('hover');\n }", "title": "" }, { "docid": "543ef5e1c0bc0f98d47cd151b490d57f", "score": "0.562671", "text": "handleHover(data) {\n return (event) => {\n this.props.onHover(event, event.clientX, event.clientY, data);\n };\n }", "title": "" }, { "docid": "aaf64473df6c34fa16c4464c9476db51", "score": "0.5626418", "text": "_getItemPointerEntries() {\n return defer(() => this._items.changes.pipe(startWith(this._items), mergeMap((list) => list.map(element => fromEvent(element._elementRef.nativeElement, 'mouseenter').pipe(mapTo(element), takeUntil(this._items.changes)))), mergeAll()));\n }", "title": "" }, { "docid": "b4bf1217032b0dc7e52573908bdc77f2", "score": "0.56221694", "text": "startHover(obj) {\n this.onHoverStart(obj);\n }", "title": "" }, { "docid": "f9f776e5e3aa840c8886d2ff44157168", "score": "0.5621381", "text": "function dashLinkHover() {\n//\t$(\".dashlist\").slideDown('fast');\n//\t$('.sidepanel-content').hover(null, function() {\n//\t\t\t\t\t\t\t$(\".dashlist\").slideUp('fast');\n//\t\t\t\t\t\t});\n}", "title": "" }, { "docid": "b06c3d21249c4e0a16f043a492d0f580", "score": "0.56173146", "text": "_onCombatantHover(event) {\n event.preventDefault();\n const li = event.currentTarget;\n const token = canvas.tokens.get(li.dataset.tokenId);\n if ( token && token.isVisible ) {\n if ( !token._controlled ) token._onHoverIn(event);\n this._highlighted = token;\n }\n }", "title": "" }, { "docid": "a1069a91136995fe127caec9ab84e167", "score": "0.56009185", "text": "function handleMouseHover() {\n setHover(prev => !prev);\n }", "title": "" }, { "docid": "a4e01c072582fc29c7fb708b212f8b59", "score": "0.5574291", "text": "function set_hover(class_name)\n\t\t{\n\t\t\ttarget = \"li.\" + class_name;\n\t\t\t$(menu).find(target).bind(\"mouseenter\", function(){\t\n\t\t\t\t$(this).children(\".dropdown, .megamenu\").stop(true, true).delay(settings.delay).fadeIn(settings.sub_speed);\n\t\t\t\t//adding highlighting attributes\n\n\t\t\t}).bind(\"mouseleave\", function(){\n\t\t\t\t$(this).children(\".dropdown, .megamenu\").stop(true, true).delay(settings.delay).fadeOut(settings.sub_speed);\n\t\t\t});\t\n\t\t}", "title": "" }, { "docid": "0c3a8c2293254e6f19208e7138bb31a6", "score": "0.55733895", "text": "function listClicked(event, item_clicked){\n\tvar event_id = item_clicked.data(\"event-id\");\n\tupdateSelection(event_id);\t\t\t\n}", "title": "" }, { "docid": "78c1c988c8bb12c760ed65991d573b99", "score": "0.55676234", "text": "function bindEvent($node) {\r\n $node.hover(function() {\r\n $('li', this).eq(0).css({\r\n 'opacity': 1,\r\n 'border-radius': 0\r\n });\r\n $('li', this).eq(2).css({\r\n 'background-blend-mode': 'luminosity', //IE doesn't work\r\n 'background-color': '#f0a001'\r\n });\r\n $('.sign-up', this).css('background-color', '#f0a001');\r\n }, function() {\r\n $('li', this).eq(0).css({\r\n 'opacity': 0.8,\r\n 'border-radius': '3px 3px 0 0'\r\n });\r\n $('li', this).eq(2).css({\r\n 'background-blend-mode': 'Normal', //IE doesn't work\r\n 'background-color': 'transparent'\r\n });\r\n $('.sign-up', this).css('background-color', '#52be8b');\r\n $('li', '.features').eq(2).css('background-color', '#010101');\r\n });\r\n }", "title": "" }, { "docid": "3448d8937c7809ee9151006ab8220be6", "score": "0.55651456", "text": "function hover(wid)\n\t{\n\t\tvar idx = wid.data;\n\n\t\t// Switch to the hover color, unless this is the currently highlighted item\n\t\tif (idx !== activeItem && widgets[idx])\n\t\t{\n\t\t\twidgets[idx].color(that.hoverColor);\n\n\t\t\tif (bar)\n\t\t\t{\n\t\t\t\tvar wid = widgets[idx].id;\n\t\t\t\tfw.dock(bar, {\n\t\t\t\t\ttop: wid + ' top',\n\t\t\t\t\tbottom: wid + ' bottom',\n\t\t\t\t\tleft: wid + dockLeft,\n\t\t\t\t\tright: wid + dockRight,\n\t\t\t\t});\n\n\t\t\t\tbar.show();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "4f25c2a585a239887531f2bfc3e0ac1a", "score": "0.55604863", "text": "function Menu_HoverStatic(item) {\n// document.all.debug.value += \"Menu_HoverStatic \" + item.outerHTML + \"\\r\\n\";\n var node = Menu_HoverRoot(item);\n\n // Find the data structure:\n var data = Menu_GetData(item);\n if (!data) return;\n\n // Set disappearAfter\n __disappearAfter = data.disappearAfter;\n Menu_Expand(node, data.horizontalOffset, data.verticalOffset); \n}", "title": "" }, { "docid": "c525a296297f4ea47713b71be7c2d7d2", "score": "0.55581564", "text": "function handleHover(e) {\n\t\t\t// Check if mouse(over|out) are still within the same parent element\n\t\t\tvar p = e.relatedTarget;\n\t\n\t\t\t// Traverse up the tree\n\t\t\twhile ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };\n\t\t\t\n\t\t\t// If we actually just moused on to a sub-element, ignore it\n\t\t\tif ( p == this ) return false;\n\t\t\t\n\t\t\t// Execute the right function\n\t\t\treturn (e.type == \"mouseover\" ? f : g).apply(this, [e]);\n\t\t}", "title": "" }, { "docid": "96d21d8978218b73fce59af892d49bdf", "score": "0.555385", "text": "function headerHoverEvent(){\n\t\t\tvar toggle;\n\t\t\tvar childList;\n\t\t\t$(\".header-main-nav__item\").hover(function(){\n\t\t\t\tif(windowWidth > breakpoint){\n\t\t\t\t\ttoggle = $(this).children(\".subnav-toggle\");\n\t\t\t\t\tchildList = toggle.siblings(\"ul\");\n\t\t\t\t\tchildList.stop().slideDown(slidetime);\n\t\t\t\t}\n\t\t\t}, function(){\n\t\t\t\tif(windowWidth > breakpoint){\n\t\t\t\t\tchildList.stop().slideUp(slidetime); \n\t\t\t\t\ttoggle.parents().removeClass('sub-active'); \n\t\t\t\t\t$(\".header-main-nav .sub-active\").children(\"ul\").stop().slideUp(slidetime);\n\t\t\t\t\t$(\".header-main-nav .sub-active\").removeClass(\"sub-active\");\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "c2ed9253ec6bad9690ff36a923b37cb5", "score": "0.5536361", "text": "function startHover(event){\n var elm = jq(this),\n id = elm.data('info').id;\n hovers[id] = setTimeout(function(){\n delete hovers[id];\n // The controller should be waiting for this event.\n jq(document).trigger('details-requested', elm.data('info'));\n }, HOVER_TIMEOUT);\n }", "title": "" }, { "docid": "2adc374e16dd63421f1e74e285eee101", "score": "0.55350024", "text": "function itemHover(ev, id) {\r\n\tvar type = \"charm\";\r\n\tvar name = \"\";\r\n\tvar index = 0;\r\n\tvar stats = \"\";\r\n\tvar style = \"display: block;\"\r\n\tvar transfer = 0;\r\n\tfor (let i = 1; i < inv.length; i++) { if (inv[i].id == id) { transfer = i } }\r\n\tvar val = inv[0][\"in\"][transfer];\r\n\tname = val.split('_')[0];\r\n\tfor (let k = 0; k < socketables.length; k++) { if (socketables[k].name == name) { type = socketables[k].type; index = k; } }\r\n\tif (type == \"charm\") {\r\n\t\tstyle = \"display: block; color: #634db0;\"\r\n\t\tif (name == \"Annihilus\" || name == \"Hellfire Torch\" || name == \"Gheed's Fortune\" || name == \"Horadric Sigil\") { style = \"display: block; color: #928068;\" }\r\n\t\tif (equipped[\"charms\"][val].size != \"small\" && equipped[\"charms\"][val].size != \"large\" && equipped[\"charms\"][val].size != \"grand\") { style = \"display: block; color: #ff8080;\" }\r\n\t\tlastCharm = name\r\n\t} else {\r\n\t\tif (type == \"rune\") { style = \"display: block; color: orange;\" }\r\n\t\telse if (socketables[index].rarity == \"unique\") { style = \"display: block; color: #928068;\" }\r\n\t\telse if (socketables[index].rarity == \"magic\") { style = \"display: block; color: #8080ff;\" }\r\n\t\telse if (socketables[index].rarity == \"rare\") { style = \"display: block; color: yellow;\" }\r\n\t\telse { style = \"display: block; color: white;\" }\r\n\t\tlastSocketable = name\r\n\t}\r\n\tvar display = name //+ \"<br>\" + stats\r\n\tdocument.getElementById(\"item_tooltip\").innerHTML = display\r\n\tdocument.getElementById(\"item_tooltip\").style = style\r\n\t\r\n\t// TODO better system:\r\n\t\r\n\t// start with cell divs at high z-index\r\n\t// on mouseover, use cell info...\r\n\t// if cell is not empty\r\n\t//\tif cell is not main-cell of occupying item\t\t\t// main-cell: top cell when traversing inv[].in\r\n\t//\t\tlower z-index of cell (pushes the item above, so it can be grabbed while all its other individual cells are surfaced)\r\n\t// then, \r\n\t// on mouseout: raise z-level of cell \r\n\t//\r\n\t// ...this should fix the bug that prevents charms from being moved into an overlapping space below themselves (or to the right for future items wider than 1 space)\r\n\t\r\n}", "title": "" }, { "docid": "8aa5055870776c6e281e6b4e1688e9e2", "score": "0.55307806", "text": "function startList() {\n\tif (document.all&&document.getElementById) {\n\t\tnavRoot = document.getElementById(\"nav\");\n\t\tfor (i=0; i<navRoot.childNodes.length; i++) {\n\t\t\tnode = navRoot.childNodes[i];\n\t\t\tif (node.nodeName==\"LI\") {\n\t\t\t\tnode.onmouseover=function() {\n\t\t\t\t\tthis.className+=\" over\";\n\t\t\t\t}\n\t\t\t\tnode.onmouseout=function() {\n\t\t\t\t\tthis.className=this.className.replace(\" over\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6e62544ffcab399fbb668953299b06ff", "score": "0.55072623", "text": "function tas_hover() {\n $(\".items>li\")\n .mouseenter(function(){\n if($(this) != ta_click) ta_click = false;\n var selector = $(this).attr('class');\n if(selector.length>10) {\n var s = selector.split(\" \");\n var taID = s[0].substring(6, s[0].length);\n var taYear = (s[1] != 'active') ? s[1] : null;\n }\n else {\n var taYear = null;\n var taID = selector.substring(6, selector.length);\n }\n taID = parseInt(taID);\n\n\n //make this list item active\n $(this).addClass('active');\n\n // clear screen so only ta is visible\n if(viewStatus == 'current') {\n hideAllNodesLinksCurrent();\n if(currentCountry != 'Worldwide') {\n if(isSafari) d3.select(\"#lines_current_selected_img\").classed(\"fadeOut\",true);\n else d3.select(\"#lines_current_selected_canvas\").classed(\"fadeOut\",true);\n }\n clearScreen(3);\n }\n else {\n hideAllNodesLinksTotal();\n clearScreen(5);\n }\n // show ta lines\n showTa(taID,taYear,'hover');\n\n // select bar\n if(currentCountry != \"Worldwide\") {\n d3.select('#taVis').selectAll(\".bar rect\").style(\"opacity\", function(e) {\n var res = \".4\"; if(e.id == taID) res = \"1\"; return res;\n });\n }\n\n })\n .click(function(e){\n $(\".items>li\").removeClass('active');\n $(this).mouseenter();\n ta_click = $(this);\n })\n .mouseleave(function(){\n if(ta_click == false) {\n //remove active state\n $(this).removeClass('active');\n // reset selection from before\n\n resetTaListSelection();\n\n // deselect bar\n if(currentCountry != \"Worldwide\") d3.select('#taVis').selectAll(\".bar rect\").style(\"opacity\", \"1\");\n\n }\n });\n}", "title": "" }, { "docid": "99afc6c8a30230f487c336ba7ae34779", "score": "0.55033034", "text": "function tileHover(tile) {\n\n // Save mouse position\n currentColumnHover = tile.col;\n\n\n // Make sure play is allowed\n var ready = (currentState == \"ready\");\n var gameOver = connect4.gameOver;\n var humanPlayer = currentPlayerIsHuman();\n if(!ready || gameOver || !humanPlayer) { \n return; \n }\n\n\n // Highlight move\n updateGraphics();\n}", "title": "" }, { "docid": "e31fa903c81dc4e3482a8397be282b0c", "score": "0.55025166", "text": "function hover(tile_title, tile_num) {\n var tile = getTile(tile_title, tile_num);\n if (isSelected(tile)) {\n setColor(tile_title, tile_num, \"selected-hover\");\n }\n else {\n setColor(tile_title, tile_num, \"unselected-hover\");\n }\n return;\n}", "title": "" }, { "docid": "5ab9e046650ac24552981199b2554366", "score": "0.5496475", "text": "function handleMouseOver(d, i) { // Add interactivity\n\n // Use D3 to select element, change color and size\n d3.select(this).attr(\"class\", \"bar__selected\");\n\n // Specify where to put label of text\n svg.append(\"text\")\n .attr(\"id\", \"t\" + d[dataItemSelector] + \"-\" + i)\n .attr(\"x\", i * (itemWidth) + 15)\n .attr(\"y\", h - (d[dataItemSelector] * 4 + 10))\n .attr(\"class\", \"bar__text\")\n .text(d[dataItemSelector])\n\n svg.append(\"text\")\n .attr(\"id\", \"t2\" + d[dataItemSelector] + \"-\" + i)\n .attr(\"x\", 10)\n .attr(\"y\", 20)\n .attr(\"class\", \"bar__text\")\n .text(d[\"entity\"])\n }", "title": "" }, { "docid": "4b2f1d6c92b22bffb257d75b8276b2c2", "score": "0.5495867", "text": "function outItem(event) { //efecto hover al salir\n screen.className = \"text\";\n }", "title": "" }, { "docid": "52a2395204d83bc452580fe8381445e9", "score": "0.5487977", "text": "ratingHover(e){\n \n this.currentRatingValue = e.currentTarget.getAttribute('data-value');\n this.hightLightRating();\n }", "title": "" }, { "docid": "67e1a23fd0f1c065c5decc15468ffe38", "score": "0.5485893", "text": "function handleMouseover(index, event) {\n\tif (index != null) {\n\t\tpcoord.setHighlightedPaths([index]);\n\t\tif (currentView == viewType.SCATTERPLOT)\n\t\t\tview.setHighlightedPoints([index]);\n\t}\n\telse {\n\t\tpcoord.setHighlightedPaths([]);\n\t\tif (currentView == viewType.SCATTERPLOT)\n\t\t\tview.setHighlightedPoints([]);\n\t}\n\tupdateInfoPane(index,event);\n}", "title": "" }, { "docid": "9c0b6bd55f5755d9998dd466e74d50fd", "score": "0.5482564", "text": "function handleHover(e) {\n e.preventDefault();\n setCursor(parseInt(e.target.id));\n }", "title": "" }, { "docid": "1ada0518e97f3393c95759a0e49b6c0d", "score": "0.54688054", "text": "function handleLeave() {\n /* remove trigger-enter and trigger-enter-active classes when\n the mouse leaves the current li*/\n $(this).removeClass('trigger-enter trigger-enter-active');\n $(this).children(':first').removeClass('changeColor');\n // remove dropdown background class\n $(background).removeClass('open');\n }", "title": "" }, { "docid": "cbe96c733ab00a8fecfb568c579243fc", "score": "0.5464357", "text": "function handleHover(e) {\n\t\t// Check if mouse(over|out) are still within the same parent element\n\t\tvar p = (e.type == \"mouseover\" ? e.fromElement : e.toElement) || e.relatedTarget;\n\n\t\t// Traverse up the tree\n\t\twhile ( p && p != this ) p = p.parentNode;\n\t\t\n\t\t// If we actually just moused on to a sub-element, ignore it\n\t\tif ( p == this ) return false;\n\t\t\n\t\t// Execute the right function\n\t\treturn (e.type == \"mouseover\" ? f : g).apply(this, [e]);\n\t}", "title": "" }, { "docid": "4d1c04af1fc13f16d066a935ffc43c16", "score": "0.5463447", "text": "function initPortfolioHover() {\n allLinks.forEach(link => {\n link.addEventListener('mouseenter', createPortfolioHover);\n link.addEventListener('mouseleave', createPortfolioHover);\n link.addEventListener('mousemove', createPortfolioMove);\n })\n}", "title": "" }, { "docid": "52d96ca75a039a16b1ffe7b73cf34988", "score": "0.5461786", "text": "function handleDragOverList(event){\n\tif(!lastMovedCard){\n\t\treturn;\n\t}\n\n\tif(!(event.target.classList.contains(\"card--shadow\"))){\n\t\tevent.currentTarget.querySelector(\".list__content\").appendChild(shadowDiv);\n\t}\n}", "title": "" }, { "docid": "4f04de52a0d0614f791199bad66a1f5d", "score": "0.5461146", "text": "function onPointerHover( event ) {\n\n\t\tif ( ! scope.enabled ) return;\n\n\t\tscope.pointerHover( getPointer( event ) );\n\n\t}", "title": "" }, { "docid": "f72a1637f4cbc737dfb8f9991dab267f", "score": "0.54581386", "text": "onHover({emails}, next, index) {\n const focusedEmail = emails[index];\n next({focusedEmail});\n }", "title": "" }, { "docid": "49cf11f17dca35bdb417ffcc476e584e", "score": "0.545135", "text": "function $rowHoverOn(e, table) {\r\n\t\tthis.$addClass(table.hover);\r\n\t}", "title": "" }, { "docid": "dcf09071bb66313cde16a7fd0f94ca15", "score": "0.54509294", "text": "function on() {\n hover = 1;\n}", "title": "" }, { "docid": "bdc0c43beea3933532ad9c9aae691719", "score": "0.5435029", "text": "function hoverLink(evt) {\n\t\n\tvar link = document.getElementById(evt.currentTarget.getAttribute(\"id\"));\n\tlink.style.color = hoverColor;\n\tlink.style.background = hoverBkground;\n\n} //end hoverLink", "title": "" }, { "docid": "c33db240a9443fcbc26e4c3d93c99c87", "score": "0.54321045", "text": "function prodOver(){\n\t\t$(this).children(\".item-hover\").fadeIn(200, \"swing\", false);\n\t}", "title": "" }, { "docid": "1a13401755f651a0d460260b0156533c", "score": "0.5425474", "text": "_onMouseOver(e) {\n // Update state with activeIndex from element being hovered over\n this.setState({ activeIndex: parseInt(e.currentTarget.value, 10) });\n }", "title": "" }, { "docid": "bab12a9ab5dccab2eef2f41788a44b51", "score": "0.54243934", "text": "getHoverCallback() {\n return this._hoverCallback;\n }", "title": "" }, { "docid": "5e00b4c7a3911305aec7174c66a174bc", "score": "0.5419244", "text": "renderListItem(i) {\n if( this.props.squares[i] === null ){\n return (<li onHover={this.innerHTML=this.props.redIsNext}>{this.props.squares[i]}</li>);\n }else if( this.props.squares[i] === 'X' ){\n return (<li className=\"red\"></li>);\n }else if( this.props.squares[i] === 'O' ){\n return (<li className=\"black\"></li>);\n }\n }", "title": "" }, { "docid": "e659e069e75e1ddedcabbc8acd3b7f01", "score": "0.5419032", "text": "handleEnter () {\n const item = this.props.list[this.props.selected];\n\n if (item) {\n this.handleItemClick(item);\n }\n }", "title": "" }, { "docid": "faeb1abbf91903254aabbe04a9c5c29d", "score": "0.5410672", "text": "hover(props, monitor, component) {\n const dragIndex = monitor.getItem().index;\n const hoverIndex = props.index;\n if (dragIndex === hoverIndex) {\n return;\n }\n const hoverBoundingRect = findDOMNode(component).getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n const hoverClientY = clientOffset.y - hoverBoundingRect.top;\n if ((dragIndex < hoverIndex && hoverClientY < hoverMiddleY) || (dragIndex > hoverIndex && hoverClientY > hoverMiddleY)) {\n return;\n }\n props.moveDimension(dragIndex, hoverIndex);\n // Note: we're mutating the monitor item here!\n // Generally it's better to avoid mutations,\n // but it's good here for the sake of performance\n // to avoid expensive index searches.\n monitor.getItem().index = hoverIndex;\n }", "title": "" }, { "docid": "8cb7e0f55fa30c497adcf6cc44cfa4ab", "score": "0.54076356", "text": "_addHoverListener() {\r\n if (this._hoverInitiated) {\r\n return;\r\n }\r\n\r\n window.addEventListener('mouseover', this._onMouseOver, true);\r\n\r\n this._hoverInitiated = true;\r\n }", "title": "" }, { "docid": "e016bad91af957842488a25c1bb72e6e", "score": "0.53980374", "text": "mouseEnter(id) {\n this.setState({listIndex: id})\n }", "title": "" }, { "docid": "af905d6fa01a7e1436442a6d55ad5a75", "score": "0.5392865", "text": "function hoverCTA() {\n H.e(\"cta\").addEventListener(\"mouseenter\", cta_enter)\n H.e(\"cta\").addEventListener(\"mouseleave\", cta_leave)\n}", "title": "" }, { "docid": "a9afc158de1c5a68d75d12b8ebc0faa6", "score": "0.53908426", "text": "function mouseOver(event)\n{\n\tvar url = event.target.href;\n\thoverX = event.clientX;\n\thoverY = event.clientY;\n\n\tif(DEBUG) console.log(\"Hovered over: \" + url);\n\tisValidImageUrl(url, constructHover);\n}", "title": "" }, { "docid": "b5a05a9c26866af6ad12aace44a22986", "score": "0.5390078", "text": "_canHover(user) {\n return true;\n }", "title": "" }, { "docid": "5838d2fdc5ca57312c8375ecfa4a75f7", "score": "0.5385599", "text": "function handleMouseOver(d, i) {\n d3.select(this)\n .attr('stroke', 'rgba(255, 181, 15, 1.0)')\n .attr('stroke-width', 5)\n }", "title": "" } ]
5a4d2a21d9a8b58d8857d4aac9e54197
Clone and return a new ReactElement using element as the starting point. See
[ { "docid": "32218d3188f78fb856a639594bb5fd9b", "score": "0.0", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" } ]
[ { "docid": "c4bd64f7c825bd2365f035c52ab7bb22", "score": "0.7479347", "text": "cloneElement(element) {\nif (!element) debugger;\n if (!(element instanceof JSXElement)) return element;\n return element.clone();\n }", "title": "" }, { "docid": "78f3067dc4b9ae911a74b41f91195624", "score": "0.6916623", "text": "function cloneElement(element,config,children){if(!!(element===null||element===undefined)){{throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+element+\".\");}}var propName;// Original props are copied\nvar props=_assign({},element.props);// Reserved names are extracted\nvar key=element.key;var ref=element.ref;// Self is preserved since the owner is preserved.\nvar self=element._self;// Source is preserved since cloneElement is unlikely to be targeted by a\n// transpiler, and the original source is probably a better indicator of the\n// true owner.\nvar source=element._source;// Owner will be preserved, unless ref is overridden\nvar owner=element._owner;if(config!=null){if(hasValidRef(config)){// Silently steal the ref from the parent.\nref=config.ref;owner=ReactCurrentOwner.current;}if(hasValidKey(config)){key=''+config.key;}// Remaining properties override existing props\nvar defaultProps;if(element.type&&element.type.defaultProps){defaultProps=element.type.defaultProps;}for(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){if(config[propName]===undefined&&defaultProps!==undefined){// Resolve default props\nprops[propName]=defaultProps[propName];}else{props[propName]=config[propName];}}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}props.children=childArray;}return ReactElement(element.type,key,ref,self,source,owner,props);}", "title": "" }, { "docid": "82c9aa8e303f701377d3d0d10563d058", "score": "0.6827415", "text": "clone() {\n return new JSXFragment(this.props, this.root, this.oids);\n }", "title": "" }, { "docid": "0dac755a461c5f0bb66ed677f0d446c3", "score": "0.66982484", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0dac755a461c5f0bb66ed677f0d446c3", "score": "0.66982484", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "69abb7ccea3f7d13d5aa1513963f24be", "score": "0.66943085", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\"));\n }\n }\n })();\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "69abb7ccea3f7d13d5aa1513963f24be", "score": "0.66943085", "text": "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\"));\n }\n }\n })();\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "d474cb5654eda5b1c9026b65d718c372", "score": "0.6646507", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "9b140721ca6752161e2ee6988d1b7ec8", "score": "0.6639285", "text": "function cloneElement(element, config, children) {\r\n if (!!(element === null || element === undefined)) {\r\n {\r\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\r\n }\r\n }\r\n\r\n var propName; // Original props are copied\r\n\r\n var props = _assign({}, element.props); // Reserved names are extracted\r\n\r\n\r\n var key = element.key;\r\n var ref = element.ref; // Self is preserved since the owner is preserved.\r\n\r\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\r\n // transpiler, and the original source is probably a better indicator of the\r\n // true owner.\r\n\r\n var source = element._source; // Owner will be preserved, unless ref is overridden\r\n\r\n var owner = element._owner;\r\n\r\n if (config != null) {\r\n if (hasValidRef(config)) {\r\n // Silently steal the ref from the parent.\r\n ref = config.ref;\r\n owner = ReactCurrentOwner.current;\r\n }\r\n\r\n if (hasValidKey(config)) {\r\n key = '' + config.key;\r\n } // Remaining properties override existing props\r\n\r\n\r\n var defaultProps;\r\n\r\n if (element.type && element.type.defaultProps) {\r\n defaultProps = element.type.defaultProps;\r\n }\r\n\r\n for (propName in config) {\r\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\r\n if (config[propName] === undefined && defaultProps !== undefined) {\r\n // Resolve default props\r\n props[propName] = defaultProps[propName];\r\n } else {\r\n props[propName] = config[propName];\r\n }\r\n }\r\n }\r\n } // Children can be more than one argument, and those are transferred onto\r\n // the newly allocated props object.\r\n\r\n\r\n var childrenLength = arguments.length - 2;\r\n\r\n if (childrenLength === 1) {\r\n props.children = children;\r\n } else if (childrenLength > 1) {\r\n var childArray = Array(childrenLength);\r\n\r\n for (var i = 0; i < childrenLength; i++) {\r\n childArray[i] = arguments[i + 2];\r\n }\r\n\r\n props.children = childArray;\r\n }\r\n\r\n return ReactElement(element.type, key, ref, self, source, owner, props);\r\n }", "title": "" }, { "docid": "86658b4ce99be225726d7c27e8b4e778", "score": "0.66190684", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "12f32ce9de23e681734e5a6d8ab998cb", "score": "0.661405", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "adf8faeb1d8594ec95dabe4f06d1e132", "score": "0.66117495", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "title": "" }, { "docid": "fdd26b10e7958f5890fa5bf13f2df514", "score": "0.6599361", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = objectAssign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "0c471aa15264a8a36aad251466c645e2", "score": "0.6595712", "text": "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "84d36fbd00eeec19d4f81697e7c5731a", "score": "0.65820616", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n var propName;\n // Original props are copied\n var props = _assign({}, element.props);\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "84d36fbd00eeec19d4f81697e7c5731a", "score": "0.65820616", "text": "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n var propName;\n // Original props are copied\n var props = _assign({}, element.props);\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "title": "" }, { "docid": "811ac08a44ddcbed0fdec8d5f7f3d91e", "score": "0.6540887", "text": "function cloneElement(element, config, children) {\n\t var arguments$1 = arguments;\n\n\t var propName;\n\n\t // Original props are copied\n\t var props = _assign({}, element.props);\n\n\t // Reserved names are extracted\n\t var key = element.key;\n\t var ref = element.ref;\n\t // Self is preserved since the owner is preserved.\n\t var self = element._self;\n\t // Source is preserved since cloneElement is unlikely to be targeted by a\n\t // transpiler, and the original source is probably a better indicator of the\n\t // true owner.\n\t var source = element._source;\n\n\t // Owner will be preserved, unless ref is overridden\n\t var owner = element._owner;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t // Silently steal the ref from the parent.\n\t ref = config.ref;\n\t owner = ReactCurrentOwner.current;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t // Remaining properties override existing props\n\t var defaultProps;\n\t if (element.type && element.type.defaultProps) {\n\t defaultProps = element.type.defaultProps;\n\t }\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t if (config[propName] === undefined && defaultProps !== undefined) {\n\t // Resolve default props\n\t props[propName] = defaultProps[propName];\n\t } else {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments$1[i + 2];\n\t }\n\t props.children = childArray;\n\t }\n\n\t return ReactElement(element.type, key, ref, self, source, owner, props);\n\t }", "title": "" } ]
ec284c7fd068ec2a78df5e67a2c3040e
Determine whether the given properties match those of a ``EbsProperty``
[ { "docid": "03630f357d969300c0799ad198a99a6b", "score": "0.65970075", "text": "function CfnInstance_EbsPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('deleteOnTermination', cdk.validateBoolean)(properties.deleteOnTermination));\n errors.collect(cdk.propertyValidator('encrypted', cdk.validateBoolean)(properties.encrypted));\n errors.collect(cdk.propertyValidator('iops', cdk.validateNumber)(properties.iops));\n errors.collect(cdk.propertyValidator('snapshotId', cdk.validateString)(properties.snapshotId));\n errors.collect(cdk.propertyValidator('volumeSize', cdk.validateNumber)(properties.volumeSize));\n errors.collect(cdk.propertyValidator('volumeType', cdk.validateString)(properties.volumeType));\n return errors.wrap('supplied properties not correct for \"EbsProperty\"');\n}", "title": "" } ]
[ { "docid": "f963bd455687991581c22853b3b603d8", "score": "0.6639124", "text": "function InstanceResource_EbsPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('deleteOnTermination', cdk.validateBoolean)(properties.deleteOnTermination));\n errors.collect(cdk.propertyValidator('encrypted', cdk.validateBoolean)(properties.encrypted));\n errors.collect(cdk.propertyValidator('iops', cdk.validateNumber)(properties.iops));\n errors.collect(cdk.propertyValidator('snapshotId', cdk.validateString)(properties.snapshotId));\n errors.collect(cdk.propertyValidator('volumeSize', cdk.validateNumber)(properties.volumeSize));\n errors.collect(cdk.propertyValidator('volumeType', cdk.validateString)(properties.volumeType));\n return errors.wrap('supplied properties not correct for \"EbsProperty\"');\n }", "title": "" }, { "docid": "e1d38889df523b94718134873fcd37e8", "score": "0.658855", "text": "function propertiesEquals(objA, objB, properties) {\n var i, property;\n\n for (i = 0; i < properties.length; i++) {\n property = properties[i];\n\n if (!equals(objA[property], objB[property])) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "5da98a6fa5201429f0af8207b30dd96b", "score": "0.65385914", "text": "function checkSameProps(properties, qParams, model) {\n var result = INCLUDE;\n\n _.each(properties, function(property) {\n if (_.has(qParams, property) && qParams[property] !== model.get(property)) {\n result = EXCLUDE;\n }\n });\n\n return result;\n }", "title": "" }, { "docid": "abc5045737eb62adb75ef51599f85c2f", "score": "0.652976", "text": "function LaunchTemplateResource_EbsPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('deleteOnTermination', cdk.validateBoolean)(properties.deleteOnTermination));\n errors.collect(cdk.propertyValidator('encrypted', cdk.validateBoolean)(properties.encrypted));\n errors.collect(cdk.propertyValidator('iops', cdk.validateNumber)(properties.iops));\n errors.collect(cdk.propertyValidator('kmsKeyId', cdk.validateString)(properties.kmsKeyId));\n errors.collect(cdk.propertyValidator('snapshotId', cdk.validateString)(properties.snapshotId));\n errors.collect(cdk.propertyValidator('volumeSize', cdk.validateNumber)(properties.volumeSize));\n errors.collect(cdk.propertyValidator('volumeType', cdk.validateString)(properties.volumeType));\n return errors.wrap('supplied properties not correct for \"EbsProperty\"');\n }", "title": "" }, { "docid": "d5e5147aa6e394657a7ef9cda5d0f033", "score": "0.6517861", "text": "function validateProperties(props) {\n let validProps = getProperties();\n for (let i in props) {\n if (!validProps.includes(props[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "b447130bdc42c09a92b0c098b332c711", "score": "0.63766986", "text": "function CfnXssMatchSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "b447130bdc42c09a92b0c098b332c711", "score": "0.63766986", "text": "function CfnXssMatchSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "560b6623f6daa2d23d611d6aa621b69e", "score": "0.63650376", "text": "function CfnByteMatchSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "560b6623f6daa2d23d611d6aa621b69e", "score": "0.63650376", "text": "function CfnByteMatchSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "a701c105ccd1075ac1121a66662e7348", "score": "0.63602656", "text": "function matches(property, config, model) {\n\t\t\treturn listVerdict(Object.keys(config), function(key) {\n\t\t\t\treturn operation(key, model, property, config[key]);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "e0afc196e991909649b5ac99aff701ba", "score": "0.63370705", "text": "function containsAllowedProps(properties) {\n if (properties === null || (typeof properties === 'undefined' ? 'undefined' : _typeof(properties)) !== 'object') {\n return false;\n }\n return Object.entries(properties).some(function (property) {\n var key = property[0];\n var value = property[1];\n if (typeof value === 'string') {\n return key === 'style' || key === 'src' || key === 'href';\n } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && key === 'attributes') {\n return 'class' in properties.attributes;\n }\n });\n}", "title": "" }, { "docid": "521ba7544eea54e93d6a124af05e7cf1", "score": "0.6327996", "text": "function hasProp(prop, props) {\n let result = false;\n if (prop.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {\n const propKeyName = prop.key.content;\n result = props.properties.some(p => p.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&\n p.key.content === propKeyName);\n }\n return result;\n}", "title": "" }, { "docid": "d6d1cbed9091a06083287b859003491b", "score": "0.63168186", "text": "function CfnSqlInjectionMatchSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "d6d1cbed9091a06083287b859003491b", "score": "0.63168186", "text": "function CfnSqlInjectionMatchSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "14cab2f88695278e7c64420d32abd0b2", "score": "0.6304879", "text": "function verifyProperties(data, properties) {\n data.forEach(function (result) {\n properties.forEach(function (property) {\n result.should.have.property(property);\n });\n });\n }", "title": "" }, { "docid": "cd8e6888908668ee597dcee30cce24ae", "score": "0.62522185", "text": "function CfnLaunchTemplate_EbsPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('deleteOnTermination', cdk.validateBoolean)(properties.deleteOnTermination));\n errors.collect(cdk.propertyValidator('encrypted', cdk.validateBoolean)(properties.encrypted));\n errors.collect(cdk.propertyValidator('iops', cdk.validateNumber)(properties.iops));\n errors.collect(cdk.propertyValidator('kmsKeyId', cdk.validateString)(properties.kmsKeyId));\n errors.collect(cdk.propertyValidator('snapshotId', cdk.validateString)(properties.snapshotId));\n errors.collect(cdk.propertyValidator('volumeSize', cdk.validateNumber)(properties.volumeSize));\n errors.collect(cdk.propertyValidator('volumeType', cdk.validateString)(properties.volumeType));\n return errors.wrap('supplied properties not correct for \"EbsProperty\"');\n}", "title": "" }, { "docid": "5c1a71aa165c93ff52cb1599fa45cd24", "score": "0.6177201", "text": "function valueMatches(frame, prop) {\n if (frame.elem.tagName==\"assessmentItem\") {\n let vars = getResponseVariables(frame.elem).filter(decl=>decl[prop]);\n let matches = vars.filter(decl=>decl.value && match(decl[prop], decl.value));\n return matches.length==vars.length;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "35ddfbb6baca3c2016a753c74b7e3570", "score": "0.6127186", "text": "function matches(property) {\n var property = original[property];\n return location.indexOf(property) !== -1;\n }", "title": "" }, { "docid": "35ddfbb6baca3c2016a753c74b7e3570", "score": "0.6127186", "text": "function matches(property) {\n var property = original[property];\n return location.indexOf(property) !== -1;\n }", "title": "" }, { "docid": "7b047f53a850a3db6a165a8802bb44c5", "score": "0.6103898", "text": "function hasProperties(actual, expected) {\n for (var k in expected) {\n var v = expected[k];\n if (!(k in actual))\n return false;\n if (Object(v) === v) {\n if (!hasProperties(actual[k], v))\n return false;\n } else {\n if (actual[k] !== v)\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "d295ceb7e2a0dfa75201ab25b9cf6d98", "score": "0.60604346", "text": "function checkProperty(obj, property){\n var result = false;\n\n for(key in obj){\n if(key === property){\n result = true;\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "33bc54279f1d37c3897ba82f2c933236", "score": "0.60322964", "text": "function _hasProperty(obj, propertyNameList) {\n for (var i=propertyNameList.length-1; i>=0; i--) {\n if (obj[propertyNameList[i]]) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "7a586ddd19cb5d91416ab7f98d37cec8", "score": "0.59836495", "text": "function CfnSizeConstraintSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "7a586ddd19cb5d91416ab7f98d37cec8", "score": "0.59836495", "text": "function CfnSizeConstraintSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('data', cdk.validateString)(properties.data));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"FieldToMatchProperty\"');\n}", "title": "" }, { "docid": "2d2fcedeb245cc29aec4e22dfdc0955e", "score": "0.5972181", "text": "function isProperty(name) {\n return [\"checked\", \"multiple\", \"muted\", \"selected\", \"value\"].includes(name);\n}", "title": "" }, { "docid": "5c13eeb584ceb9e0c2a4f80cbd0120d8", "score": "0.5948551", "text": "function hasProperties(x) {\n for (var prop in x) {\n if (Object.prototype.hasOwnProperty.call(x, prop))\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "8511850dc2393632edfce5ec7a0ef242", "score": "0.59463656", "text": "function contains(a, e, prop) {\n \t\tfor( j = 0; j < a.length; j++) {\n \t\tif(prop) {\n \t\tif(a[j][prop] == e[prop]) {\n \t\treturn true;\n \t\t\t}\n \t\t}\n \t\tif(a[j] == e) {\n \t\treturn true;\n \t\t}\n \t\t}\n \t\treturn false;\n\t\t}", "title": "" }, { "docid": "8818d880075b091ee7ae9b5a52e7cd3c", "score": "0.5889359", "text": "function CfnTopicRule_AssetPropertyVariantPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('booleanValue', cdk.validateString)(properties.booleanValue));\n errors.collect(cdk.propertyValidator('doubleValue', cdk.validateString)(properties.doubleValue));\n errors.collect(cdk.propertyValidator('integerValue', cdk.validateString)(properties.integerValue));\n errors.collect(cdk.propertyValidator('stringValue', cdk.validateString)(properties.stringValue));\n return errors.wrap('supplied properties not correct for \"AssetPropertyVariantProperty\"');\n}", "title": "" }, { "docid": "e29e521cf59fb06f2626aa6d1c97dfc7", "score": "0.58768237", "text": "function CfnCluster_EbsConfigurationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('ebsBlockDeviceConfigs', cdk.listValidator(CfnCluster_EbsBlockDeviceConfigPropertyValidator))(properties.ebsBlockDeviceConfigs));\n errors.collect(cdk.propertyValidator('ebsOptimized', cdk.validateBoolean)(properties.ebsOptimized));\n return errors.wrap('supplied properties not correct for \"EbsConfigurationProperty\"');\n}", "title": "" }, { "docid": "4cc3c7e67c8c2cc666cc23f0d18ea376", "score": "0.5848352", "text": "function contains(obj, prop) {\r\n return Object.prototype.hasOwnProperty.call(obj, prop);\r\n}", "title": "" }, { "docid": "0c78990c88b02c77e0765fa5d3074005", "score": "0.5839106", "text": "function cfnXssMatchSetFieldToMatchPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnXssMatchSet_FieldToMatchPropertyValidator(properties).assertSuccess();\n return {\n Data: cdk.stringToCloudFormation(properties.data),\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "0c78990c88b02c77e0765fa5d3074005", "score": "0.5839106", "text": "function cfnXssMatchSetFieldToMatchPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnXssMatchSet_FieldToMatchPropertyValidator(properties).assertSuccess();\n return {\n Data: cdk.stringToCloudFormation(properties.data),\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "ce12116fe19befb0a2e0ae003d7d4335", "score": "0.5825358", "text": "function affected(property) {\n return properties.has(property);\n }", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "4c3b6276b005a3af657b4cc9f4e451e8", "score": "0.5803476", "text": "function contains(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}", "title": "" }, { "docid": "47bdb668b0ac8a0b0f6e1416b3cc2f10", "score": "0.5797736", "text": "function CfnFunction_SQSEventPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('batchSize', cdk.validateNumber)(properties.batchSize));\n errors.collect(cdk.propertyValidator('enabled', cdk.validateBoolean)(properties.enabled));\n errors.collect(cdk.propertyValidator('queue', cdk.requiredValidator)(properties.queue));\n errors.collect(cdk.propertyValidator('queue', cdk.validateString)(properties.queue));\n return errors.wrap('supplied properties not correct for \"SQSEventProperty\"');\n}", "title": "" }, { "docid": "5d7ea080c22c1fe2796b88edf8858d66", "score": "0.5779975", "text": "function CfnInstanceFleetConfig_EbsConfigurationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('ebsBlockDeviceConfigs', cdk.listValidator(CfnInstanceFleetConfig_EbsBlockDeviceConfigPropertyValidator))(properties.ebsBlockDeviceConfigs));\n errors.collect(cdk.propertyValidator('ebsOptimized', cdk.validateBoolean)(properties.ebsOptimized));\n return errors.wrap('supplied properties not correct for \"EbsConfigurationProperty\"');\n}", "title": "" }, { "docid": "3371b654ea6e9a4c4910f3b69b0596de", "score": "0.5778667", "text": "function checkIfProps(props, propsToCheck){\r\n\tif(!propsToCheck || !(propsToCheck instanceof Array)){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor(var i=0,z=propsToCheck.length;i<z;i++){\r\n\t\tif(props[propsToCheck[i]]){\r\n\t\t\treturn true;\r\n\t\t} \r\n\t}\r\n\r\n\treturn false;\r\n}", "title": "" }, { "docid": "af9f94ba18b1c0f2b591718af2c89998", "score": "0.57690805", "text": "function hasProperties(obj, props) {\n for (var i = 0; i < props.length; i++) {\n if (!obj.hasOwnProperty(props[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c1cc91a980d95d55d5381c0494bde81a", "score": "0.57659554", "text": "function checkProps(obj, list) {\n if (typeof list === \"string\") {\n list = list.split(\"|\");\n }\n for (prop of list) {\n let val = obj[prop];\n if (val === null || val === undefined) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "402fa5bf23c8fcc01a0ffd407bcf9178", "score": "0.57416284", "text": "function cfnSqlInjectionMatchSetFieldToMatchPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnSqlInjectionMatchSet_FieldToMatchPropertyValidator(properties).assertSuccess();\n return {\n Data: cdk.stringToCloudFormation(properties.data),\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "402fa5bf23c8fcc01a0ffd407bcf9178", "score": "0.57416284", "text": "function cfnSqlInjectionMatchSetFieldToMatchPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnSqlInjectionMatchSet_FieldToMatchPropertyValidator(properties).assertSuccess();\n return {\n Data: cdk.stringToCloudFormation(properties.data),\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "ce274a2a9492870a896d041c4188f540", "score": "0.57247335", "text": "function CfnIntegration_TriggerPropertiesPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('scheduled', CfnIntegration_ScheduledTriggerPropertiesPropertyValidator)(properties.scheduled));\n return errors.wrap('supplied properties not correct for \"TriggerPropertiesProperty\"');\n}", "title": "" }, { "docid": "c78d15a8146f15246ad4b8b9ab165605", "score": "0.5702155", "text": "function cfnByteMatchSetFieldToMatchPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnByteMatchSet_FieldToMatchPropertyValidator(properties).assertSuccess();\n return {\n Data: cdk.stringToCloudFormation(properties.data),\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "c78d15a8146f15246ad4b8b9ab165605", "score": "0.5702155", "text": "function cfnByteMatchSetFieldToMatchPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnByteMatchSet_FieldToMatchPropertyValidator(properties).assertSuccess();\n return {\n Data: cdk.stringToCloudFormation(properties.data),\n Type: cdk.stringToCloudFormation(properties.type),\n };\n}", "title": "" }, { "docid": "50c16411558db00952ddaea503df299f", "score": "0.56734526", "text": "function objectMatch(obj1, obj2) {\n for (property1 in obj1) {\n for (property2 in obj2) {\n if (obj1[property1] == obj2[property2]) {\n return true;\n }\n else {\n continue;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "3d09187ef8b314a4f32cf1dccbd5d996", "score": "0.56668806", "text": "function CfnByteMatchSetPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('byteMatchTuples', cdk.listValidator(CfnByteMatchSet_ByteMatchTuplePropertyValidator))(properties.byteMatchTuples));\n errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n return errors.wrap('supplied properties not correct for \"CfnByteMatchSetProps\"');\n}", "title": "" }, { "docid": "3d09187ef8b314a4f32cf1dccbd5d996", "score": "0.56668806", "text": "function CfnByteMatchSetPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('byteMatchTuples', cdk.listValidator(CfnByteMatchSet_ByteMatchTuplePropertyValidator))(properties.byteMatchTuples));\n errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n return errors.wrap('supplied properties not correct for \"CfnByteMatchSetProps\"');\n}", "title": "" }, { "docid": "1bcd4660151815db9c7702550aeb9492", "score": "0.56534785", "text": "function validate(properties, action) {\n var retval = true;\n var validators = allValidators[action];\n for (var prop in properties) {\n var validator = validators[prop];\n var value = properties[prop];\n if (validator && !validator(value)) {\n mraid.fireErrorEvent(\"Value of property \" + prop + \" (\" + value + \") is invalid\", \"mraid.\" + action);\n retval = false;\n }\n }\n return retval;\n }", "title": "" }, { "docid": "fd67e7fc2e6aaba23a25766ddb94503f", "score": "0.5635821", "text": "function VPNGatewayResourcePropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('amazonSideAsn', cdk.validateNumber)(properties.amazonSideAsn));\n errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateTag))(properties.tags));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"VPNGatewayResourceProps\"');\n }", "title": "" }, { "docid": "874007089cc2e54c56c911c616ae1405", "score": "0.5633802", "text": "function hasProperties(object) {\n return Array.prototype.every.call(Array.prototype.slice.call(arguments, 1), (function (x) { return x in object }));\n //for (var i = 1; i < arguments.length; i++) {\n // if(!(arguments[i] in object))\n // return false;\n //}\n //return true;\n }", "title": "" }, { "docid": "3416e281394f0777fe5b1ee1c4b92702", "score": "0.5633636", "text": "function IsPropertyOf(list, property, val) {\n\t// Check if the list has the property\n\tif (list.hasOwnProperty(property) == false) {\n\t\tif (/^(connections|dependents|elem|t)$/.test(property)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\t// Verify that the property complies with whether it should be numeric\n\t\tif ((list[property] == \"number\") && isNaN(parseFloat(val))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "ce51bd7f59886addf1afe5296773a138", "score": "0.56295085", "text": "function CfnPipe_EcsEnvironmentVariablePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));\n return errors.wrap('supplied properties not correct for \"EcsEnvironmentVariableProperty\"');\n}", "title": "" }, { "docid": "9bfe1993819fe279daf80f81b21bc95b", "score": "0.5621924", "text": "function SpotFleetResource_EbsBlockDevicePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('deleteOnTermination', cdk.validateBoolean)(properties.deleteOnTermination));\n errors.collect(cdk.propertyValidator('encrypted', cdk.validateBoolean)(properties.encrypted));\n errors.collect(cdk.propertyValidator('iops', cdk.validateNumber)(properties.iops));\n errors.collect(cdk.propertyValidator('snapshotId', cdk.validateString)(properties.snapshotId));\n errors.collect(cdk.propertyValidator('volumeSize', cdk.validateNumber)(properties.volumeSize));\n errors.collect(cdk.propertyValidator('volumeType', cdk.validateString)(properties.volumeType));\n return errors.wrap('supplied properties not correct for \"EbsBlockDeviceProperty\"');\n }", "title": "" }, { "docid": "0b41af0cea80624eda3ae3309f8c5f10", "score": "0.56146395", "text": "function isValidProperty(parentPropertyType, propertyName) {\n return getType(parentPropertyType).Properties.hasOwnProperty(propertyName);\n}", "title": "" }, { "docid": "89ac41c15adbec6311ef79c11b0a0d0b", "score": "0.5613186", "text": "function propExists( prop ) {\n\tvar uc_prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ),\n\t\tprops = ( prop + \" \" + vendors.join( uc_prop + \" \" ) + uc_prop ).split( \" \" );\n\n\tfor ( var v in props ){\n\t\tif ( fbCSS[ props[ v ] ] !== undefined ) {\n\t\t\treturn true;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e85b0c33f1dd29de6e5f2fd2976a4809", "score": "0.56130224", "text": "function CfnStateMachine_CloudWatchEventEventPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('eventBusName', cdk.validateString)(properties.eventBusName));\n errors.collect(cdk.propertyValidator('input', cdk.validateString)(properties.input));\n errors.collect(cdk.propertyValidator('inputPath', cdk.validateString)(properties.inputPath));\n errors.collect(cdk.propertyValidator('pattern', cdk.requiredValidator)(properties.pattern));\n errors.collect(cdk.propertyValidator('pattern', cdk.validateObject)(properties.pattern));\n return errors.wrap('supplied properties not correct for \"CloudWatchEventEventProperty\"');\n}", "title": "" }, { "docid": "7bc28632e31f99a4762ee28e5874b550", "score": "0.5610245", "text": "function CfnFunction_AlexaSkillEventPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('variables', cdk.hashValidator(cdk.validateString))(properties.variables));\n return errors.wrap('supplied properties not correct for \"AlexaSkillEventProperty\"');\n}", "title": "" }, { "docid": "f0d6132da4b0fcb194bb02222120c15a", "score": "0.5609727", "text": "function checkProperty(property) {\n const hasValue = ![null, undefined].includes(obj[property.name]);\n if (!property.optional && (partial ? obj[property.name] === null : !hasValue)) {\n return { ok: false, reason: `Property at path \"${path}/${property.name}\" is not optional` };\n }\n if (hasValue && property.types.length === 1) {\n return checkType(`${path}/${property.name}`, property.types[0], obj[property.name], false);\n }\n if (hasValue && !property.types.some(type => checkType(`${path}/${property.name}`, type, obj[property.name], false).ok)) {\n return { ok: false, reason: `Property at path \"${path}/${property.name}\" does not match any of ${property.types.length} allowed types` };\n }\n return { ok: true };\n }", "title": "" }, { "docid": "9a5c391c9807ca82416a1ece04b14452", "score": "0.5609138", "text": "function matchCriteria(obj, criteria) {\n for (var prop in criteria) {\n if (!obj.hasOwnProperty(prop) || String(obj[prop]).toUpperCase().indexOf(String(criteria[prop]).toUpperCase()) === -1) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "504c81cf6d638a2bc31cd7bed4a8c995", "score": "0.5608907", "text": "function CfnSqlInjectionMatchSetPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('sqlInjectionMatchTuples', cdk.listValidator(CfnSqlInjectionMatchSet_SqlInjectionMatchTuplePropertyValidator))(properties.sqlInjectionMatchTuples));\n return errors.wrap('supplied properties not correct for \"CfnSqlInjectionMatchSetProps\"');\n}", "title": "" }, { "docid": "504c81cf6d638a2bc31cd7bed4a8c995", "score": "0.5608907", "text": "function CfnSqlInjectionMatchSetPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('sqlInjectionMatchTuples', cdk.listValidator(CfnSqlInjectionMatchSet_SqlInjectionMatchTuplePropertyValidator))(properties.sqlInjectionMatchTuples));\n return errors.wrap('supplied properties not correct for \"CfnSqlInjectionMatchSetProps\"');\n}", "title": "" }, { "docid": "73550ed93fd13d1634db01b963e9a5d8", "score": "0.559461", "text": "function isValidRequest(req, properties) {\n\n\tconst hasAllProperties = (hasAllPropertiesSoFar, currentProperty) => hasAllPropertiesSoFar && req.body.hasOwnProperty(currentProperty);\n\treturn properties.reduce(hasAllProperties, true);\n}", "title": "" }, { "docid": "efb007425e99ddacdc74a56d73b1259e", "score": "0.55883574", "text": "function CfnInstanceGroupConfig_EbsConfigurationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('ebsBlockDeviceConfigs', cdk.listValidator(CfnInstanceGroupConfig_EbsBlockDeviceConfigPropertyValidator))(properties.ebsBlockDeviceConfigs));\n errors.collect(cdk.propertyValidator('ebsOptimized', cdk.validateBoolean)(properties.ebsOptimized));\n return errors.wrap('supplied properties not correct for \"EbsConfigurationProperty\"');\n}", "title": "" }, { "docid": "8fd8015fae609ff61b32f495b9265f9e", "score": "0.55847776", "text": "function CfnServer_EndpointDetailsPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('addressAllocationIds', cdk.listValidator(cdk.validateString))(properties.addressAllocationIds));\n errors.collect(cdk.propertyValidator('securityGroupIds', cdk.listValidator(cdk.validateString))(properties.securityGroupIds));\n errors.collect(cdk.propertyValidator('subnetIds', cdk.listValidator(cdk.validateString))(properties.subnetIds));\n errors.collect(cdk.propertyValidator('vpcEndpointId', cdk.validateString)(properties.vpcEndpointId));\n errors.collect(cdk.propertyValidator('vpcId', cdk.validateString)(properties.vpcId));\n return errors.wrap('supplied properties not correct for \"EndpointDetailsProperty\"');\n}", "title": "" }, { "docid": "2d7bd0041d0367552ba731fb90c4f8ab", "score": "0.55813056", "text": "function isSetProperty(card1, card2, card3, property) {\n\t\tif ((card1[property] === card2[property] && card2[property] === card3[property])\n\t\t|| (card1[property] !== card2[property]\n\t\t&& card2[property] !== card3[property] && card1[property] \n\t\t!== card3[property])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "46f3a0e2b5377e7d3804c66ece7acbcc", "score": "0.55808717", "text": "function propExists( prop ){\n\tvar uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),\n\t\tprops = (prop + ' ' + vendors.join(uc_prop + ' ') + uc_prop).split(' ');\n\tfor(var v in props){\n\t\tif( fbCSS[ v ] !== undefined ){\n\t\t\treturn true;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6922a7a602dc59fe9719d2031e5c5257", "score": "0.5571138", "text": "hasProperty(name) {\n return this.getProperties().findIndex(property => property.getName() === name) >= 0;\n }", "title": "" }, { "docid": "0780721cb3400e935581dcef36d49423", "score": "0.5557277", "text": "function CfnXssMatchSetPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('xssMatchTuples', cdk.requiredValidator)(properties.xssMatchTuples));\n errors.collect(cdk.propertyValidator('xssMatchTuples', cdk.listValidator(CfnXssMatchSet_XssMatchTuplePropertyValidator))(properties.xssMatchTuples));\n return errors.wrap('supplied properties not correct for \"CfnXssMatchSetProps\"');\n}", "title": "" }, { "docid": "a7782f5ca2afb01efaf6cea3f0d096f8", "score": "0.5551824", "text": "accepts(viewModel){\n\t\tconst property = this.matcher.property;\n\t\tconst value = viewModel[property];\n\t\tif(this.matcher.exists === true){\n\t\t\treturn !!value;\n\t\t}\n\t\tif(this.matcher.exists === false){\n\t\t\treturn !value;\n\t\t}\n\t\tif(this.matcher.matches){\n\t\t\treturn value && value.match && value.match(this.matcher.matches); \n\t\t}\n\t\tif(this.matcher.matchesNot){\n\t\t\treturn !value || !value.match || !value.match(this.matcher.matchesNot);\n\t\t}\n\t\t\n\t\t// A matcher without any settings accepts everything.\n\t\treturn true;\n\t}", "title": "" }, { "docid": "b300b5b4385cb813a5f136f65d63fc91", "score": "0.55445355", "text": "function CfnXssMatchSetPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('xssMatchTuples', cdk.listValidator(CfnXssMatchSet_XssMatchTuplePropertyValidator))(properties.xssMatchTuples));\n return errors.wrap('supplied properties not correct for \"CfnXssMatchSetProps\"');\n}", "title": "" }, { "docid": "26ed0929159c3ba01466a21f91dd282c", "score": "0.5537664", "text": "function CfnPipe_PipeTargetEventBridgeEventBusParametersPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('detailType', cdk.validateString)(properties.detailType));\n errors.collect(cdk.propertyValidator('endpointId', cdk.validateString)(properties.endpointId));\n errors.collect(cdk.propertyValidator('resources', cdk.listValidator(cdk.validateString))(properties.resources));\n errors.collect(cdk.propertyValidator('source', cdk.validateString)(properties.source));\n errors.collect(cdk.propertyValidator('time', cdk.validateString)(properties.time));\n return errors.wrap('supplied properties not correct for \"PipeTargetEventBridgeEventBusParametersProperty\"');\n}", "title": "" }, { "docid": "d0c6aabab3eeb7fa25b15be48aa9422c", "score": "0.5532614", "text": "function CfnGeoMatchSetPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('geoMatchConstraints', cdk.listValidator(CfnGeoMatchSet_GeoMatchConstraintPropertyValidator))(properties.geoMatchConstraints));\n errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n return errors.wrap('supplied properties not correct for \"CfnGeoMatchSetProps\"');\n}", "title": "" }, { "docid": "c57cd5824e6f525e196b037a551bf631", "score": "0.55265945", "text": "function objectHasProperty(object, property){\n for (var i in object) {\n if (i === property) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "f1da7a6d87e0b0d085f41cbeb6a5dcd9", "score": "0.5525298", "text": "accepts(viewModel){\n\t\tlet property = this.matcher.property;\n\t\tlet value = viewModel[property];\n\t\tif(this.matcher.exists === true){\n\t\t\treturn !!viewModel;\n\t\t}\n\t\tif(this.matcher.exists === false){\n\t\t\treturn !viewModel;\n\t\t}\n\t\tif(this.matcher.matches){\n\t\t\treturn value && value.matches && value.matches(this.matcher.matches); \n\t\t}\n\t\tif(this.matcher.matches_not){\n\t\t\treturn !value || !value.matches || !value.matches(this.matcher.matches_not);\n\t\t}\n\t\t\n\t\t// A matcher without any settings accepts everything.\n\t\treturn true;\n\t}", "title": "" }, { "docid": "a131333869d18cd58555227043b6ba28", "score": "0.5510651", "text": "function CfnPipe_FilterPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('pattern', cdk.validateString)(properties.pattern));\n return errors.wrap('supplied properties not correct for \"FilterProperty\"');\n}", "title": "" }, { "docid": "1d0465bacf49782b538666c7e32d62f8", "score": "0.55068415", "text": "function CfnPipe_PipeEnrichmentHttpParametersPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('headerParameters', cdk.hashValidator(cdk.validateString))(properties.headerParameters));\n errors.collect(cdk.propertyValidator('pathParameterValues', cdk.listValidator(cdk.validateString))(properties.pathParameterValues));\n errors.collect(cdk.propertyValidator('queryStringParameters', cdk.hashValidator(cdk.validateString))(properties.queryStringParameters));\n return errors.wrap('supplied properties not correct for \"PipeEnrichmentHttpParametersProperty\"');\n}", "title": "" }, { "docid": "0c63533ba806050227422acc8823a8fb", "score": "0.5496034", "text": "function CfnStateMachine_EventSourcePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('properties', cdk.requiredValidator)(properties.properties));\n errors.collect(cdk.propertyValidator('properties', cdk.unionValidator(CfnStateMachine_CloudWatchEventEventPropertyValidator, CfnStateMachine_EventBridgeRuleEventPropertyValidator, CfnStateMachine_ScheduleEventPropertyValidator, CfnStateMachine_ApiEventPropertyValidator))(properties.properties));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n return errors.wrap('supplied properties not correct for \"EventSourceProperty\"');\n}", "title": "" }, { "docid": "b64bf43c40c888178c082ac0736a5fbf", "score": "0.54900247", "text": "function CfnFunction_S3EventPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('bucket', cdk.requiredValidator)(properties.bucket));\n errors.collect(cdk.propertyValidator('bucket', cdk.validateString)(properties.bucket));\n errors.collect(cdk.propertyValidator('events', cdk.requiredValidator)(properties.events));\n errors.collect(cdk.propertyValidator('events', cdk.unionValidator(cdk.unionValidator(cdk.validateString), cdk.listValidator(cdk.unionValidator(cdk.validateString))))(properties.events));\n errors.collect(cdk.propertyValidator('filter', CfnFunction_S3NotificationFilterPropertyValidator)(properties.filter));\n return errors.wrap('supplied properties not correct for \"S3EventProperty\"');\n}", "title": "" }, { "docid": "de6dbb6deffa55cb048667da2b029c99", "score": "0.5489935", "text": "function CfnSpotFleet_EbsBlockDevicePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('deleteOnTermination', cdk.validateBoolean)(properties.deleteOnTermination));\n errors.collect(cdk.propertyValidator('encrypted', cdk.validateBoolean)(properties.encrypted));\n errors.collect(cdk.propertyValidator('iops', cdk.validateNumber)(properties.iops));\n errors.collect(cdk.propertyValidator('snapshotId', cdk.validateString)(properties.snapshotId));\n errors.collect(cdk.propertyValidator('volumeSize', cdk.validateNumber)(properties.volumeSize));\n errors.collect(cdk.propertyValidator('volumeType', cdk.validateString)(properties.volumeType));\n return errors.wrap('supplied properties not correct for \"EbsBlockDeviceProperty\"');\n}", "title": "" }, { "docid": "eef356f9a65154b79fb81e93780b61e3", "score": "0.5483607", "text": "function CfnTopicRule_AssetPropertyValuePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('quality', cdk.validateString)(properties.quality));\n errors.collect(cdk.propertyValidator('timestamp', cdk.requiredValidator)(properties.timestamp));\n errors.collect(cdk.propertyValidator('timestamp', CfnTopicRule_AssetPropertyTimestampPropertyValidator)(properties.timestamp));\n errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));\n errors.collect(cdk.propertyValidator('value', CfnTopicRule_AssetPropertyVariantPropertyValidator)(properties.value));\n return errors.wrap('supplied properties not correct for \"AssetPropertyValueProperty\"');\n}", "title": "" }, { "docid": "4d972a037ce601bab37426d043e56c9f", "score": "0.5479661", "text": "function TermIs(term, listOfProperties) {\n\tvar hits = 0;\n\n\tfor (var i = 0; i < listOfProperties.length; i++) {\n\t\tif (term.pos.hasOwnProperty(listOfProperties[i]))\n\t\t\thits++;\n\t}\n\n\tif (hits === listOfProperties.length)\n\t\treturn true;\n\n\treturn false;\n}", "title": "" }, { "docid": "e33bdc5a8528b1ade57178d005eff7f1", "score": "0.54795843", "text": "function CfnIntegration_ScheduledTriggerPropertiesPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('dataPullMode', cdk.validateString)(properties.dataPullMode));\n errors.collect(cdk.propertyValidator('firstExecutionFrom', cdk.validateNumber)(properties.firstExecutionFrom));\n errors.collect(cdk.propertyValidator('scheduleEndTime', cdk.validateNumber)(properties.scheduleEndTime));\n errors.collect(cdk.propertyValidator('scheduleExpression', cdk.requiredValidator)(properties.scheduleExpression));\n errors.collect(cdk.propertyValidator('scheduleExpression', cdk.validateString)(properties.scheduleExpression));\n errors.collect(cdk.propertyValidator('scheduleOffset', cdk.validateNumber)(properties.scheduleOffset));\n errors.collect(cdk.propertyValidator('scheduleStartTime', cdk.validateNumber)(properties.scheduleStartTime));\n errors.collect(cdk.propertyValidator('timezone', cdk.validateString)(properties.timezone));\n return errors.wrap('supplied properties not correct for \"ScheduledTriggerPropertiesProperty\"');\n}", "title": "" }, { "docid": "b2e71b97bd80c3dfbb8be486aaaf265a", "score": "0.5479453", "text": "function hasChanged(objA, objB, propPaths) {\n if (objA === objB) {\n return false;\n }\n\n if (typeof objA !== 'object' || objA === null ||\n typeof objB !== 'object' || objB === null) {\n return true;\n }\n\n if (propPaths) {\n for (var i = 0; i < propPaths.length; i++) {\n if (get(objA, propPaths[i]) !== get(objB, propPaths[i])) {\n return true;\n }\n }\n\n } else {\n // no props to check specified\n var propsA = Object.keys(objA);\n var propsB = Object.keys(objB);\n if (propsA.length !== propsB.length) {\n return true;\n }\n\n // Test for A's keys different from B.\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n for (var i = 0; i < propsA.length; i++) {\n if (!bHasOwnProperty(propsA[i]) || objA[propsA[i]] !== objB[propsA[i]]) {\n return true;\n }\n }\n }\n\n\n return false;\n}", "title": "" }, { "docid": "c8c263faa1434812095cfb61d52e8e78", "score": "0.5478797", "text": "function isValue(property, value) {\n return property === value;\n}", "title": "" }, { "docid": "6fe6920d27d20a25241f404f3e8f5cc1", "score": "0.5476197", "text": "function CfnPipe_EcsResourceRequirementPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));\n errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));\n return errors.wrap('supplied properties not correct for \"EcsResourceRequirementProperty\"');\n}", "title": "" }, { "docid": "1cd825e54cd8a3196a8f32d5d7e514a1", "score": "0.5475416", "text": "function CfnPipe_FilterCriteriaPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('filters', cdk.listValidator(CfnPipe_FilterPropertyValidator))(properties.filters));\n return errors.wrap('supplied properties not correct for \"FilterCriteriaProperty\"');\n}", "title": "" }, { "docid": "7a222c7d1f915797f5ce2cf04f38cbf1", "score": "0.54669946", "text": "function hasEveryProp() {\n var nodeProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_OPTIONS;\n var propsToCheck = typeof props === 'string' ? props.split(' ') : props;\n return propsToCheck.every(function (prop) {\n return hasProp(nodeProps, prop, options);\n });\n}", "title": "" }, { "docid": "d3f410c6294ec7b633f602b40f325e5f", "score": "0.54635257", "text": "function hasCssProps(props) {\n\t\tvar stl = tElem.style,\n\t\t\ttests,\n\t\t\tprop;\n\n\t\tprops = Array.prototype.slice.call(arguments);\n\t\tfor (var i = 0, pCount = props.length; i < pCount; i++) {\n\t\t\tprop = props[i];\n\t\t\ttests = (vendorPrefs.join(prop + ' ') + prop + ' ' + prop.charAt(0).toLowerCase() + prop.slice(1)).split(' ');\n\n\t\t\tfor (var j = 0, count = tests.length; j < count; j++) {\n\t\t\t\tif (stl[tests[j]] !== undefined) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "c4cb65f13c0b69a898d39ad1596206d6", "score": "0.54589486", "text": "function __propEq(propertyName, value) {\n return function (obj) {\n return obj[propertyName] === value;\n };\n}", "title": "" }, { "docid": "c4cb65f13c0b69a898d39ad1596206d6", "score": "0.54589486", "text": "function __propEq(propertyName, value) {\n return function (obj) {\n return obj[propertyName] === value;\n };\n}", "title": "" } ]
e60af60d49a1cdb87fa0ba4411b256a0
"Class" to create an error Object (to handle validateMessages)
[ { "docid": "f9279f35d4f79008cce20d5a9770be1e", "score": "0.62448555", "text": "function errorObject()\n{\n\tthis.obj = document.getElementById(\"errors\");\t\t\t//div oder span as output\n\tthis.content = \"\";\t\t\t\t\t\t\t\t\t\t//content to display as error(s)\n\tthis.timer =0;\t\t\t\t\t\t\t\t\t\t\t//var to save the timeout-state\n\t\n\t//adds another message to the content-string and starts the timeout\n\tthis.set = function(text) \n\t{\n\t\tif(this.content.length >0)\n\t\t{\n\t\t\tthis.content += \"<br />\"+text;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.content += text;\n\t\t}\n\t\t\n\t\tif(text==\"\")\n\t\t{\n\t\t\tthis.content = \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.out(this);\n\t\t}\n\t\tif(this.obj==null)\n\t\t{\n\t\t\tthis.obj = document.getElementById(\"errors\");\n\t\t}\n\t\tthis.obj.innerHTML = this.content;\n\t}\n\t\n\t//manages the timeout (errors disapper after 4 seconds)\n\tthis.out = function(self)\n\t{\n\t\twindow.clearTimeout(this.timer);\n\t\tthis.timer = window.setTimeout(function(){self.set(\"\");}, 4000);\n\t}\n}", "title": "" } ]
[ { "docid": "7cb3d13ce5293d1d64ed9871ceaf21fd", "score": "0.73871", "text": "function ValidationError(message) {\n this.message = message;\n}", "title": "" }, { "docid": "52b77ef33b085e75095ee0ce8efb4af6", "score": "0.71837264", "text": "function createErrorObject(msg){\n\tvar error = {\n\t\tconfirmation: 'fail',\n\t\tmessage: msg\n\t}\n\treturn error;\n}", "title": "" }, { "docid": "61506f440b9b82c1ebc144736362d308", "score": "0.6931371", "text": "function Errors() {\n _classCallCheck(this, Errors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "61506f440b9b82c1ebc144736362d308", "score": "0.6931371", "text": "function Errors() {\n _classCallCheck(this, Errors);\n\n this.errors = {};\n }", "title": "" }, { "docid": "77f28b5b6c4dd6cd5b97c7e0c03f2684", "score": "0.682086", "text": "static createError(name) {\r\n const ctor = SuperError.subclass(name)\r\n // Register the class with Errio.\r\n Errio.register(ctor)\r\n return ctor\r\n }", "title": "" }, { "docid": "7ed2c383a389cd6d790acaa8402de983", "score": "0.68177485", "text": "constructor() {\n this.errors = {};\n }", "title": "" }, { "docid": "7ed2c383a389cd6d790acaa8402de983", "score": "0.68177485", "text": "constructor() {\n this.errors = {};\n }", "title": "" }, { "docid": "7ed2c383a389cd6d790acaa8402de983", "score": "0.68177485", "text": "constructor() {\n this.errors = {};\n }", "title": "" }, { "docid": "6f7cf0224f39117db66857af3c69c506", "score": "0.675609", "text": "function _error(message){\n \n return {\n type: \"Error\",\n message: message\n };\n \n }", "title": "" }, { "docid": "9507a610cf2138310a472100da7e6249", "score": "0.67192304", "text": "constructor() {\n\t\tthis.errors = {};\n\t}", "title": "" }, { "docid": "4086f4c7cf0dd97c5000ded10d51543d", "score": "0.6615127", "text": "function ValidationErrors(errors) {\n this.errors = errors ? errors : {};\n\n this.addError = function(field, message) {\n if (!this.errors[field]) { this.errors[field] = []; }\n this.errors[field].push(util.format(message, field));\n };\n\n // omit field for full hash of errors\n this.getErrors = function(field) {\n if (field) {\n return this.errors[field];\n } else {\n return this.errors;\n }\n };\n\n this.hasErrors = function() {\n return _.keys(this.errors).length > 0;\n };\n\n this.isValidationErrors = function() {\n return true;\n };\n}", "title": "" }, { "docid": "8a797f9b5c6e7a5cc30ddafdfd193af6", "score": "0.6591085", "text": "function makeError(message, type) {\n var error = new Error()\n error.message = message\n Object.defineProperty(error, 'type', {\n value: type,\n enumerable: true,\n writable: true,\n configurable: true\n })\n return error\n}", "title": "" }, { "docid": "883275d210c0b065a1bbd39ce9c7bade", "score": "0.6579556", "text": "function ValidationError (key, message) {\n this.name = 'ValidationError'\n this.message = message\n this.validation = {\n key: key,\n message: message\n }\n}", "title": "" }, { "docid": "daabf296d59d278883674798acaf2340", "score": "0.6513154", "text": "function VError()\n\t{\n\t\tvar args, obj, parsed, cause, ctor, message, k;\n\t\n\t\targs = Array.prototype.slice.call(arguments, 0);\n\t\n\t\t/*\n\t\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t\t * is defined to work this way, so we allow the constructor to be called\n\t\t * without \"new\".\n\t\t */\n\t\tif (!(this instanceof VError)) {\n\t\t\tobj = Object.create(VError.prototype);\n\t\t\tVError.apply(obj, arguments);\n\t\t\treturn (obj);\n\t\t}\n\t\n\t\t/*\n\t\t * For convenience and backwards compatibility, we support several\n\t\t * different calling forms. Normalize them here.\n\t\t */\n\t\tparsed = parseConstructorArguments({\n\t\t 'argv': args,\n\t\t 'strict': false\n\t\t});\n\t\n\t\t/*\n\t\t * If we've been given a name, apply it now.\n\t\t */\n\t\tif (parsed.options.name) {\n\t\t\tmod_assertplus.string(parsed.options.name,\n\t\t\t 'error\\'s \"name\" must be a string');\n\t\t\tthis.name = parsed.options.name;\n\t\t}\n\t\n\t\t/*\n\t\t * For debugging, we keep track of the original short message (attached\n\t\t * this Error particularly) separately from the complete message (which\n\t\t * includes the messages of our cause chain).\n\t\t */\n\t\tthis.jse_shortmsg = parsed.shortmessage;\n\t\tmessage = parsed.shortmessage;\n\t\n\t\t/*\n\t\t * If we've been given a cause, record a reference to it and update our\n\t\t * message appropriately.\n\t\t */\n\t\tcause = parsed.options.cause;\n\t\tif (cause) {\n\t\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\t\tthis.jse_cause = cause;\n\t\n\t\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\t\tmessage += ': ' + cause.message;\n\t\t\t}\n\t\t}\n\t\n\t\t/*\n\t\t * If we've been given an object with properties, shallow-copy that\n\t\t * here. We don't want to use a deep copy in case there are non-plain\n\t\t * objects here, but we don't want to use the original object in case\n\t\t * the caller modifies it later.\n\t\t */\n\t\tthis.jse_info = {};\n\t\tif (parsed.options.info) {\n\t\t\tfor (k in parsed.options.info) {\n\t\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t\t}\n\t\t}\n\t\n\t\tthis.message = message;\n\t\tError.call(this, message);\n\t\n\t\tif (Error.captureStackTrace) {\n\t\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\t\tError.captureStackTrace(this, ctor);\n\t\t}\n\t\n\t\treturn (this);\n\t}", "title": "" }, { "docid": "daabf296d59d278883674798acaf2340", "score": "0.6513154", "text": "function VError()\n\t{\n\t\tvar args, obj, parsed, cause, ctor, message, k;\n\t\n\t\targs = Array.prototype.slice.call(arguments, 0);\n\t\n\t\t/*\n\t\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t\t * is defined to work this way, so we allow the constructor to be called\n\t\t * without \"new\".\n\t\t */\n\t\tif (!(this instanceof VError)) {\n\t\t\tobj = Object.create(VError.prototype);\n\t\t\tVError.apply(obj, arguments);\n\t\t\treturn (obj);\n\t\t}\n\t\n\t\t/*\n\t\t * For convenience and backwards compatibility, we support several\n\t\t * different calling forms. Normalize them here.\n\t\t */\n\t\tparsed = parseConstructorArguments({\n\t\t 'argv': args,\n\t\t 'strict': false\n\t\t});\n\t\n\t\t/*\n\t\t * If we've been given a name, apply it now.\n\t\t */\n\t\tif (parsed.options.name) {\n\t\t\tmod_assertplus.string(parsed.options.name,\n\t\t\t 'error\\'s \"name\" must be a string');\n\t\t\tthis.name = parsed.options.name;\n\t\t}\n\t\n\t\t/*\n\t\t * For debugging, we keep track of the original short message (attached\n\t\t * this Error particularly) separately from the complete message (which\n\t\t * includes the messages of our cause chain).\n\t\t */\n\t\tthis.jse_shortmsg = parsed.shortmessage;\n\t\tmessage = parsed.shortmessage;\n\t\n\t\t/*\n\t\t * If we've been given a cause, record a reference to it and update our\n\t\t * message appropriately.\n\t\t */\n\t\tcause = parsed.options.cause;\n\t\tif (cause) {\n\t\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\t\tthis.jse_cause = cause;\n\t\n\t\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\t\tmessage += ': ' + cause.message;\n\t\t\t}\n\t\t}\n\t\n\t\t/*\n\t\t * If we've been given an object with properties, shallow-copy that\n\t\t * here. We don't want to use a deep copy in case there are non-plain\n\t\t * objects here, but we don't want to use the original object in case\n\t\t * the caller modifies it later.\n\t\t */\n\t\tthis.jse_info = {};\n\t\tif (parsed.options.info) {\n\t\t\tfor (k in parsed.options.info) {\n\t\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t\t}\n\t\t}\n\t\n\t\tthis.message = message;\n\t\tError.call(this, message);\n\t\n\t\tif (Error.captureStackTrace) {\n\t\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\t\tError.captureStackTrace(this, ctor);\n\t\t}\n\t\n\t\treturn (this);\n\t}", "title": "" }, { "docid": "fcc89075f2df38b83edb5623f1c52b83", "score": "0.6474784", "text": "function newError(error) {return { type: 'newError', error: error };}", "title": "" }, { "docid": "b1b8825cbc93e4d3ff60c60d6126fa65", "score": "0.6470264", "text": "function CustomError(type,message){\n\t\t\tthis.type=type;\n\t\t\tthis.message=message;\n\t\t}", "title": "" }, { "docid": "91800285504a4b3a29b2d9bf880dd31e", "score": "0.6465693", "text": "static Error(msg) {\n\n }", "title": "" }, { "docid": "99958b7e732bdafc44889f6f7d3049e4", "score": "0.6463903", "text": "function createJSONRpcErrorObject(errorcode, message, data) {\n var error = {};\n error.code = errorcode;\n error.message = message;\n error.data = data;\n return error;\n }", "title": "" }, { "docid": "e35a228b247a83db58a2b0ad7003272c", "score": "0.64538264", "text": "function createError(message, detail, response, fieldErrors = null) {\n // Check that the field errors is not an empty object\n if (fieldErrors && Object.keys(fieldErrors).length === 0) {\n fieldErrors = null;\n }\n\n return { message, detail, response, fieldErrors };\n}", "title": "" }, { "docid": "f74c3b9e3df2dbeea51a0132dfffe306", "score": "0.6400107", "text": "static makeError(msg) {\n\t\tconst jrResult = new JrResult();\n\t\tjrResult.pushError(msg);\n\t\treturn jrResult;\n\t}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.63894635", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" }, { "docid": "4251fd31c3ae91ffe18fea3504885bd3", "score": "0.6375023", "text": "error(obj){\n \n return {\n errors: obj,\n };\n \n }", "title": "" }, { "docid": "2147f19f7a886fb3c2736f6c85d6ed9c", "score": "0.6357094", "text": "function createClientErrorConstructor(HttpError,name,code){var className=name.match(/Error$/)?name:name + 'Error';function ClientError(message){ // create the error object\nvar err=new Error(message != null?message:statuses[code]); // capture a stack trace to the construction point\nError.captureStackTrace(err,ClientError); // adjust the [[Prototype]]\nsetPrototypeOf(err,ClientError.prototype); // redefine the error name\nObject.defineProperty(err,'name',{enumerable:false,configurable:true,value:className,writable:true});return err;}inherits(ClientError,HttpError);ClientError.prototype.status = code;ClientError.prototype.statusCode = code;ClientError.prototype.expose = true;return ClientError;}", "title": "" }, { "docid": "aa1a5bb7a4a8c3f6d1db0d9cf1c6a008", "score": "0.63475", "text": "function error(message, errors) {\n var messages = [message];\n errors.forEach(function (error) {\n messages.push(errorMessage(error));\n });\n var err = new Error(messages.join(os.EOL));\n err.name = 'ValidationError';\n return err;\n}", "title": "" }, { "docid": "b9d36911ca76da945efdb13b244daaea", "score": "0.63396007", "text": "function SpokesError( obj )\n{\n this.Type = obj[\"Type\"];\n this.Description = obj[\"Description\"];\n this.Error_Code = obj[\"Error_Code\"];\n}", "title": "" }, { "docid": "90e15fd50024b3a28086dcb7ce64cc99", "score": "0.6336571", "text": "function customError(name, message) {\n this.name = (name || 'GENERIC_ERROR');\n this.message = (message || 'Unkown message');\n}", "title": "" }, { "docid": "77a7b6ce240f08bf228ff4bc36cda0e9", "score": "0.6312228", "text": "function buildError(){\n return {success: false, errors: Array.from(arguments)}\n}", "title": "" }, { "docid": "37dac76806d21a360cfc0bffa559b16c", "score": "0.6294935", "text": "function createClientErrorConstructor(HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + \"Error\";\n\n function ClientError(message) {\n // create the error object\n var msg = message != null ? message : statuses[code];\n var err = new Error(msg);\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError);\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype);\n\n // redefine the error message\n Object.defineProperty(err, \"message\", {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true,\n });\n\n // redefine the error name\n Object.defineProperty(err, \"name\", {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true,\n });\n\n return err;\n }\n\n inherits(ClientError, HttpError);\n nameFunc(ClientError, className);\n\n ClientError.prototype.status = code;\n ClientError.prototype.statusCode = code;\n ClientError.prototype.expose = true;\n\n return ClientError;\n }", "title": "" }, { "docid": "879778f53f9a1443d0b60a4cc6176928", "score": "0.6283715", "text": "function error(name, msg, status) {\n var err = new Error();\n err.name = name;\n err.message = msg;\n err.status = status;\n return err;\n}", "title": "" }, { "docid": "99936efe005b9ca4ba554fb97402ca26", "score": "0.62831086", "text": "function makeError(response, message) {\n var xhr = response.xhr, request = response.request, settings = response.settings, event = response.event;\n message = message || \"Invalid Status: \" + xhr.status;\n return { xhr: xhr, request: request, settings: settings, event: event, message: message };\n }", "title": "" }, { "docid": "abdfb5cb7bd60ba6361d188aa2acd147", "score": "0.6280051", "text": "function createSimpleModelError(instance, propertyId, messageFormat, argList) {\r\n\tvar modelMessage = newModelMessage(IStatus.ERROR, \r\n\t\t\tformatString(messageFormat, argList), \r\n\t\t\tinstance, propertyId, null);\r\n\treturn modelMessage;\r\n}", "title": "" }, { "docid": "15d1aaa0df746b008f45ca2ffc7bdbc0", "score": "0.62755334", "text": "function makeError(code, message, data = {}) {\n const error = new Error(message);\n return Object.assign(error, {code, data});\n}", "title": "" }, { "docid": "fa206f4648ba50996bec1cfd776dd4dd", "score": "0.62627816", "text": "static get errors() {\r\n return Errors\r\n }", "title": "" }, { "docid": "84d4f92f5b9e7234fc8cadb468fdde5a", "score": "0.6235724", "text": "constructor(errors) {\n this.errors = errors;\n this.type = 'Invalid Request';\n this.status = 400;\n log.error(errors);\n }", "title": "" }, { "docid": "aff3843d8651525ecc7e60df58308860", "score": "0.623459", "text": "constructor() {\n const error = new Error(`${this.constructor.name} class should only static usage`);\n error.name = `${this.constructor.name}Error`;\n\n throw error;\n }", "title": "" }, { "docid": "aff3843d8651525ecc7e60df58308860", "score": "0.623459", "text": "constructor() {\n const error = new Error(`${this.constructor.name} class should only static usage`);\n error.name = `${this.constructor.name}Error`;\n\n throw error;\n }", "title": "" }, { "docid": "c858e5d68bcc6ea0d31ebcb426caad32", "score": "0.62291765", "text": "function CustomError() {}", "title": "" }, { "docid": "c858e5d68bcc6ea0d31ebcb426caad32", "score": "0.62291765", "text": "function CustomError() {}", "title": "" }, { "docid": "5e11e6b9c53740b3dc573ef0c4bcab72", "score": "0.6220194", "text": "static initialize(obj, error) {\n obj['error'] = error;\n }", "title": "" }, { "docid": "469dc3e60748a1be55a811b266d3fe2e", "score": "0.62031776", "text": "function createHttpErrorConstructor(){function HttpError(){throw new TypeError('cannot construct abstract class');}inherits(HttpError,Error);return HttpError;}", "title": "" }, { "docid": "c9c627727c06481cfa764536ad69ee1b", "score": "0.62013054", "text": "function Validate() {\n if (!(this instanceof Validate)) return new Validate; \n this.errors = [];\n}", "title": "" }, { "docid": "cd0d88dcc432224df091e6340dc413c1", "score": "0.61746585", "text": "function createClientErrorConstructor(HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error';\n\n function ClientError(message) {\n // create the error object\n var msg = message != null ? message : statuses[code];\n var err = new Error(msg); // capture a stack trace to the construction point\n\n Error.captureStackTrace(err, ClientError); // adjust the [[Prototype]]\n\n setPrototypeOf(err, ClientError.prototype); // redefine the error message\n\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n }); // redefine the error name\n\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n });\n return err;\n }\n\n inherits(ClientError, HttpError);\n nameFunc(ClientError, className);\n ClientError.prototype.status = code;\n ClientError.prototype.statusCode = code;\n ClientError.prototype.expose = true;\n return ClientError;\n}", "title": "" }, { "docid": "cd0d88dcc432224df091e6340dc413c1", "score": "0.61746585", "text": "function createClientErrorConstructor(HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error';\n\n function ClientError(message) {\n // create the error object\n var msg = message != null ? message : statuses[code];\n var err = new Error(msg); // capture a stack trace to the construction point\n\n Error.captureStackTrace(err, ClientError); // adjust the [[Prototype]]\n\n setPrototypeOf(err, ClientError.prototype); // redefine the error message\n\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n }); // redefine the error name\n\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n });\n return err;\n }\n\n inherits(ClientError, HttpError);\n nameFunc(ClientError, className);\n ClientError.prototype.status = code;\n ClientError.prototype.statusCode = code;\n ClientError.prototype.expose = true;\n return ClientError;\n}", "title": "" }, { "docid": "cd0d88dcc432224df091e6340dc413c1", "score": "0.61746585", "text": "function createClientErrorConstructor(HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error';\n\n function ClientError(message) {\n // create the error object\n var msg = message != null ? message : statuses[code];\n var err = new Error(msg); // capture a stack trace to the construction point\n\n Error.captureStackTrace(err, ClientError); // adjust the [[Prototype]]\n\n setPrototypeOf(err, ClientError.prototype); // redefine the error message\n\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n }); // redefine the error name\n\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n });\n return err;\n }\n\n inherits(ClientError, HttpError);\n nameFunc(ClientError, className);\n ClientError.prototype.status = code;\n ClientError.prototype.statusCode = code;\n ClientError.prototype.expose = true;\n return ClientError;\n}", "title": "" }, { "docid": "cd0d88dcc432224df091e6340dc413c1", "score": "0.61746585", "text": "function createClientErrorConstructor(HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error';\n\n function ClientError(message) {\n // create the error object\n var msg = message != null ? message : statuses[code];\n var err = new Error(msg); // capture a stack trace to the construction point\n\n Error.captureStackTrace(err, ClientError); // adjust the [[Prototype]]\n\n setPrototypeOf(err, ClientError.prototype); // redefine the error message\n\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n }); // redefine the error name\n\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n });\n return err;\n }\n\n inherits(ClientError, HttpError);\n nameFunc(ClientError, className);\n ClientError.prototype.status = code;\n ClientError.prototype.statusCode = code;\n ClientError.prototype.expose = true;\n return ClientError;\n}", "title": "" }, { "docid": "2fd94dd8cb3226989453e0b667784a9e", "score": "0.61640185", "text": "function createClientErrorConstructor(HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error';\n\n function ClientError(message) {\n // create the error object\n var msg = message != null ? message : statuses[code];\n var err = new Error(msg); // capture a stack trace to the construction point\n\n Error.captureStackTrace(err, ClientError); // adjust the [[Prototype]]\n\n setPrototypeOf(err, ClientError.prototype); // redefine the error message\n\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n }); // redefine the error name\n\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n });\n return err;\n }\n\n inherits(ClientError, HttpError);\n ClientError.prototype.status = code;\n ClientError.prototype.statusCode = code;\n ClientError.prototype.expose = true;\n return ClientError;\n}", "title": "" }, { "docid": "b4108b9e7b6c563080aef536ccb5e958", "score": "0.6146065", "text": "function WError()\n\t{\n\t\tvar args, obj, parsed, options;\n\t\n\t\targs = Array.prototype.slice.call(arguments, 0);\n\t\tif (!(this instanceof WError)) {\n\t\t\tobj = Object.create(WError.prototype);\n\t\t\tWError.apply(obj, args);\n\t\t\treturn (obj);\n\t\t}\n\t\n\t\tparsed = parseConstructorArguments({\n\t\t 'argv': args,\n\t\t 'strict': false\n\t\t});\n\t\n\t\toptions = parsed.options;\n\t\toptions['skipCauseMessage'] = true;\n\t\tVError.call(this, options, '%s', parsed.shortmessage);\n\t\n\t\treturn (this);\n\t}", "title": "" }, { "docid": "b4108b9e7b6c563080aef536ccb5e958", "score": "0.6146065", "text": "function WError()\n\t{\n\t\tvar args, obj, parsed, options;\n\t\n\t\targs = Array.prototype.slice.call(arguments, 0);\n\t\tif (!(this instanceof WError)) {\n\t\t\tobj = Object.create(WError.prototype);\n\t\t\tWError.apply(obj, args);\n\t\t\treturn (obj);\n\t\t}\n\t\n\t\tparsed = parseConstructorArguments({\n\t\t 'argv': args,\n\t\t 'strict': false\n\t\t});\n\t\n\t\toptions = parsed.options;\n\t\toptions['skipCauseMessage'] = true;\n\t\tVError.call(this, options, '%s', parsed.shortmessage);\n\t\n\t\treturn (this);\n\t}", "title": "" }, { "docid": "9d7e98a7fed23bc96ff5663be050cd2c", "score": "0.61456114", "text": "function createError(title, content){\n\treturn {\n\t\ttitle: title, \n\t\tcontent: content\n\t};\n}", "title": "" }, { "docid": "224c51813ec7f094020f777509fa9198", "score": "0.61447185", "text": "error(message, code) {\n return {\n error: {\n message: message,\n code: code,\n },\n };\n }", "title": "" }, { "docid": "a30e55cfedf7797dd00a5e05040db091", "score": "0.6142169", "text": "function createServerErrorConstructor(HttpError,name,code){var className=name.match(/Error$/)?name:name + 'Error';function ServerError(message){ // create the error object\nvar err=new Error(message != null?message:statuses[code]); // capture a stack trace to the construction point\nError.captureStackTrace(err,ServerError); // adjust the [[Prototype]]\nsetPrototypeOf(err,ServerError.prototype); // redefine the error name\nObject.defineProperty(err,'name',{enumerable:false,configurable:true,value:className,writable:true});return err;}inherits(ServerError,HttpError);ServerError.prototype.status = code;ServerError.prototype.statusCode = code;ServerError.prototype.expose = false;return ServerError;}", "title": "" }, { "docid": "1b922ae0ce6ae45af8a48cf4d3de5c94", "score": "0.61360884", "text": "function ValidationResult(isValid, message, data) {\n if (isValid === void 0) { isValid = false; }\n if (data === void 0) { data = null; }\n this.isValid = isValid;\n this.message = message;\n this.data = data;\n this.isValid = isValid;\n this.message = message;\n this.data = data;\n // Readonly...\n Object.freeze(this);\n }", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "f635b43f0b6f78634b9ff0feff38b2c1", "score": "0.613443", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n nameFunc(ClientError, className)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "aeef1b8b186aedbbcb39c78e750f42e6", "score": "0.6131761", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "aeef1b8b186aedbbcb39c78e750f42e6", "score": "0.6131761", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "aeef1b8b186aedbbcb39c78e750f42e6", "score": "0.6131761", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "aeef1b8b186aedbbcb39c78e750f42e6", "score": "0.6131761", "text": "function createClientErrorConstructor (HttpError, name, code) {\n var className = name.match(/Error$/) ? name : name + 'Error'\n\n function ClientError (message) {\n // create the error object\n var msg = message != null ? message : statuses[code]\n var err = new Error(msg)\n\n // capture a stack trace to the construction point\n Error.captureStackTrace(err, ClientError)\n\n // adjust the [[Prototype]]\n setPrototypeOf(err, ClientError.prototype)\n\n // redefine the error message\n Object.defineProperty(err, 'message', {\n enumerable: true,\n configurable: true,\n value: msg,\n writable: true\n })\n\n // redefine the error name\n Object.defineProperty(err, 'name', {\n enumerable: false,\n configurable: true,\n value: className,\n writable: true\n })\n\n return err\n }\n\n inherits(ClientError, HttpError)\n\n ClientError.prototype.status = code\n ClientError.prototype.statusCode = code\n ClientError.prototype.expose = true\n\n return ClientError\n}", "title": "" }, { "docid": "c70cb76c7d346cf685add480d0a6db18", "score": "0.6124855", "text": "function createHttpErrorConstructor() {\n function HttpError() {\n throw new TypeError(\"cannot construct abstract class\");\n }\n\n inherits(HttpError, Error);\n\n return HttpError;\n }", "title": "" }, { "docid": "311badf19c6b4f9c503c02a449b26a94", "score": "0.6122445", "text": "function redfigError(code, message, target) {\n\t\n\tconst error = {}\n\terror.code = code\n\terror.message = message\n\terror.target = target\n\t\n\tvar errors = []\n\terrors.push(error)\n\t\n\tthis.getMessages = function(){\n\t\treturn errors\n\t}\n\tthis.getCode = function(){\n\t\treturn error.code\n\t}\n\tthis.addMessage = function(code,message,target){\n\t\tconst newError = {}\n\t\tnewError.code = code\n\t\tnewError.message = message\n\t\tnewError.target = target\n\t\terrors.unshift(newError)\n\t}\n\tthis.logErrors = function (){\n\t\tvar lead = '>'\n\t\terrors.forEach( log => {\n\t\t\tlead = '--' + lead\n\t\t\tconsole.log( lead + log.message) \n\t\t})\n\t}\n\tthis.stringfy = function(){\n\t\tvar message\n\t\terrors.forEach( error => {\n\t\t\tif(message){\n\t\t\t\tmessage = message + ' / ' + error.message\n\t\t\t}else {\n\t\t\t\tmessage = error.message\n\t\t\t}\n\t\t})\n\t\treturn message\n\t}\n}", "title": "" }, { "docid": "497cd0bec3c80668cd17533ed6cfe809", "score": "0.61194724", "text": "function errors(err) {\n err = err || {}; // This allows us to call errors and just get a default error\n return {\n Error: err.Error,\n nodeCode: err.errno,\n Code: -1\n };//return\n }//errors", "title": "" }, { "docid": "90086b474752426f5642a501c91438c1", "score": "0.6117927", "text": "constructor(message, validatorResult) {\n super(message);\n this.validatorResult = validatorResult;\n }", "title": "" }, { "docid": "cdc03688e230a6f82d13b7f059ff0e0c", "score": "0.6112568", "text": "clone() {\n const error = this;\n // $FlowFixMe\n const err = new error.constructor(error.message);\n\n systemFields.forEach((field) => {\n // $FlowFixMe\n if (error[field]) err[field] = error[field];\n });\n Object.keys(error).forEach((key) => {\n // $FlowFixMe\n err[key] = R.clone(error[key]);\n });\n return err;\n }", "title": "" }, { "docid": "24d469c072d394f50ac9e4ee634658d4", "score": "0.61095786", "text": "function makeError(validValue, error, expected, actual) {\n var info = makeInfoMessageObject(error, expected, actual);\n\n if (isDefined(defaultValue) &&\n presence === OPTIONAL &&\n options.warnOnInvalidOptionals) {\n issueWarning(info);\n return makeValue(validValue);\n }\n return {\n error: info,\n value: validValue\n };\n }", "title": "" }, { "docid": "44c7c996542c432699d2b87fd393d8e9", "score": "0.60944885", "text": "function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n}", "title": "" }, { "docid": "12e76e9e98f9eb695a6e4fa9794e626e", "score": "0.60878664", "text": "static generate(rawCloverError) {\n switch (rawCloverError.type) {\n case 'card_error':\n return new CloverCardError(rawCloverError);\n case 'invalid_request_error':\n return new CloverInvalidRequestError(rawCloverError);\n case 'api_error':\n return new CloverAPIError(rawCloverError);\n case 'idempotency_error':\n return new CloverIdempotencyError(rawCloverError);\n case 'invalid_grant':\n return new CloverInvalidGrantError(rawCloverError);\n default:\n return new GenericError('Generic', 'Unknown Error');\n }\n }", "title": "" }, { "docid": "4583accee6c1d08646066341baa40a42", "score": "0.60758215", "text": "function _createJsonErrorObject (msg, pointer, httpCode, code, title, meta) {\n let error = {\n detail: msg,\n status: httpCode.toString(),\n title: title,\n code: 'iDef_' + code.toString()\n };\n\n if (pointer) {\n error.source = {\n pointer: pointer\n };\n }\n\n if (meta) {\n error.meta = meta;\n }\n\n return error;\n}", "title": "" }, { "docid": "71bfc38650f4dfb18f99acf6cdd2a658", "score": "0.6073018", "text": "function makeError(pnpCode, message, data = {}) {\n const code = MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode;\n const propertySpec = {\n configurable: true,\n writable: true,\n enumerable: false\n };\n return Object.defineProperties(new Error(message), {\n code: Object.assign(Object.assign({}, propertySpec), {\n value: code\n }),\n pnpCode: Object.assign(Object.assign({}, propertySpec), {\n value: pnpCode\n }),\n data: Object.assign(Object.assign({}, propertySpec), {\n value: data\n })\n });\n}", "title": "" }, { "docid": "7626755cc80f7687bd42539a08ddf671", "score": "0.60707724", "text": "function createError (errorMessage, statusCode, statusMessage) {\n\n\tif (statusCode) {\n\t\terrorMessage = errorMessage + '\\nHTTP[S] status: ' + statusCode;\n\n\t\tif (statusMessage) {\n\t\t\terrorMessage = errorMessage + ' ' + statusMessage;\n\t\t}\n\t}\n\n\tstatusCode = statusCode || 0;\n\tstatusMessage = statusMessage || 'Unspecified';\n\n\tlet error = new Error(errorMessage);\n\n\terror.statusCode = statusCode;\n\terror.statusMessage = statusMessage;\n\n\treturn error;\n}", "title": "" }, { "docid": "fada5e9c130854993d44a4e0c1144978", "score": "0.60591954", "text": "error(message, options) {\n return this.addMessage(messageAssign({\n message: message,\n type: 'error'\n }, options));\n }", "title": "" }, { "docid": "245a1bfaf3aede05d6334bebae458971", "score": "0.60523665", "text": "function FailureMessage(title){\n Message.call(this,title)\n this.type = 'failure';\n}", "title": "" }, { "docid": "3a6c0f1e317230cc4ec7aa2688e452e1", "score": "0.60219985", "text": "constructor(message, errorCode) {\n\t\t// Call super To Call The Constructor Of The Base Class\n\t\tsuper(message); // Adds A Message Property To The Instances We Create Based On This Class\n\t\tthis.code = errorCode; // Adds A code Property To The Instances We Create Based On This Class\n\t}", "title": "" }, { "docid": "c05bf4ad8689bce588cd274e73b6256d", "score": "0.6016793", "text": "function errorModel(app, values={}, errors={}) {\n return {\n base: app.locals.base,\n errors: errors._,\n fields: fieldsWithValues(values, errors)\n };\n}", "title": "" }, { "docid": "8a74adde4ba4c8c874406f3c9d4bafa3", "score": "0.6011106", "text": "function createError(header, msg) {\n\tvar ret = {\n\t\tgeneral: {\n\t\t\t\"header\" : header,\n\t\t\t\"msg\" : msg\n\t\t}\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "527ec2c0044becfa0202706932f5695a", "score": "0.60067505", "text": "function error(status, msg) {\n var err = new Error(msg);\n err.status = status;\n return err;\n}", "title": "" }, { "docid": "0f15a96f290b6cadb3c5c8be6ae3de01", "score": "0.6000834", "text": "function WError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof WError)) {\n\t\tobj = Object.create(WError.prototype);\n\t\tWError.apply(obj, args);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\toptions = parsed.options;\n\toptions['skipCauseMessage'] = true;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}", "title": "" } ]
c42d3208d09e63da566494322eaa15c1
Outputs a number of spans to make up a line, taking highlighting and marked text into account.
[ { "docid": "2bc259428f5304a8fd853fa98c79320a", "score": "0.64424604", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), styleToClass(styles[i+1]));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = styleToClass(styles[i++]);\n }\n }\n }", "title": "" } ]
[ { "docid": "4b0e131685290a8667fd41c17065a0eb", "score": "0.6637361", "text": "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\t\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [];\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t }\n\t if (pos >= len) break;\n\t\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "title": "" }, { "docid": "5284c042713956866b8d34f9cad4fdb8", "score": "0.661261", "text": "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\t\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\t\n\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t }\n\t if (pos >= len) break;\n\t\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "title": "" }, { "docid": "f7b7232ed293de3c163d89a4db652e3f", "score": "0.66094065", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a6197bbaa694c541feddfaa95a4ce1cc", "score": "0.6608151", "text": "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0\n\t if (!spans) {\n\t for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n\t { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n\t return\n\t }\n\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n\t collapsed = null; nextChange = Infinity\n\t var foundBookmarks = [], endStyles = void 0\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m)\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to\n\t spanEndStyle = \"\"\n\t }\n\t if (m.className) { spanStyle += \" \" + m.className }\n\t if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n\t if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n\t if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n\t if (m.title && !title) { title = m.title }\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t { collapsed = sp }\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from\n\t }\n\t }\n\t if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n\t { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n\t if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n\t { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null)\n\t if (collapsed.to == null) { return }\n\t if (collapsed.to == pos) { collapsed = false }\n\t }\n\t }\n\t if (pos >= len) { break }\n\n\t var upto = Math.min(len, nextChange)\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n\t pos = end\n\t spanStartStyle = \"\"\n\t }\n\t text = allText.slice(at, at = styles[i++])\n\t style = interpretTokenStyle(styles[i++], builder.cm.options)\n\t }\n\t }\n\t}", "title": "" }, { "docid": "68c0933d2d9eda23ab19d9bf13366dbc", "score": "0.6591259", "text": "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0\n\t if (!spans) {\n\t for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n\t { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n\t return\n\t }\n\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n\t collapsed = null; nextChange = Infinity\n\t var foundBookmarks = [], endStyles = (void 0)\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m)\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to\n\t spanEndStyle = \"\"\n\t }\n\t if (m.className) { spanStyle += \" \" + m.className }\n\t if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n\t if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n\t if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n\t if (m.title && !title) { title = m.title }\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t { collapsed = sp }\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from\n\t }\n\t }\n\t if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n\t { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n\t if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n\t { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null)\n\t if (collapsed.to == null) { return }\n\t if (collapsed.to == pos) { collapsed = false }\n\t }\n\t }\n\t if (pos >= len) { break }\n\n\t var upto = Math.min(len, nextChange)\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n\t pos = end\n\t spanStartStyle = \"\"\n\t }\n\t text = allText.slice(at, at = styles[i++])\n\t style = interpretTokenStyle(styles[i++], builder.cm.options)\n\t }\n\t }\n\t}", "title": "" }, { "docid": "a5dbc85224235eff190b17faaedcbb21", "score": "0.6590922", "text": "function insertLineContent(line, builder, styles) { // 6281\n var spans = line.markedSpans, allText = line.text, at = 0; // 6282\n if (!spans) { // 6283\n for (var i = 1; i < styles.length; i+=2) // 6284\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return; // 6286\n } // 6287\n // 6288\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css; // 6289\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; // 6290\n for (;;) { // 6291\n if (nextChange == pos) { // Update current marker set // 6292\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"; // 6293\n collapsed = null; nextChange = Infinity; // 6294\n var foundBookmarks = []; // 6295\n for (var j = 0; j < spans.length; ++j) { // 6296\n var sp = spans[j], m = sp.marker; // 6297\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) { // 6298\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; } // 6299\n if (m.className) spanStyle += \" \" + m.className; // 6300\n if (m.css) css = m.css; // 6301\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle; // 6302\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle; // 6303\n if (m.title && !title) title = m.title; // 6304\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) // 6305\n collapsed = sp; // 6306\n } else if (sp.from > pos && nextChange > sp.from) { // 6307\n nextChange = sp.from; // 6308\n } // 6309\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m); // 6310\n } // 6311\n if (collapsed && (collapsed.from || 0) == pos) { // 6312\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, // 6313\n collapsed.marker, collapsed.from == null); // 6314\n if (collapsed.to == null) return; // 6315\n } // 6316\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) // 6317\n buildCollapsedSpan(builder, 0, foundBookmarks[j]); // 6318\n } // 6319\n if (pos >= len) break; // 6320\n // 6321\n var upto = Math.min(len, nextChange); // 6322\n while (true) { // 6323\n if (text) { // 6324\n var end = pos + text.length; // 6325\n if (!collapsed) { // 6326\n var tokenText = end > upto ? text.slice(0, upto - pos) : text; // 6327\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, // 6328\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css); // 6329\n } // 6330\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} // 6331\n pos = end; // 6332\n spanStartStyle = \"\"; // 6333\n } // 6334\n text = allText.slice(at, at = styles[i++]); // 6335\n style = interpretTokenStyle(styles[i++], builder.cm.options); // 6336\n } // 6337\n } // 6338\n } // 6339", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.657856", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.657856", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.657856", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "07f3df376a16bde46359d4b483bf93e4", "score": "0.65770924", "text": "function insertLineContent(line, builder, styles) {\n\t\t var spans = line.markedSpans, allText = line.text, at = 0\n\t\t if (!spans) {\n\t\t for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n\t\t { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n\t\t return\n\t\t }\n\n\t\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n\t\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n\t\t for (;;) {\n\t\t if (nextChange == pos) { // Update current marker set\n\t\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n\t\t collapsed = null; nextChange = Infinity\n\t\t var foundBookmarks = [], endStyles = (void 0)\n\t\t for (var j = 0; j < spans.length; ++j) {\n\t\t var sp = spans[j], m = sp.marker\n\t\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t\t foundBookmarks.push(m)\n\t\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t\t nextChange = sp.to\n\t\t spanEndStyle = \"\"\n\t\t }\n\t\t if (m.className) { spanStyle += \" \" + m.className }\n\t\t if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n\t\t if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n\t\t if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n\t\t if (m.title && !title) { title = m.title }\n\t\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t\t { collapsed = sp }\n\t\t } else if (sp.from > pos && nextChange > sp.from) {\n\t\t nextChange = sp.from\n\t\t }\n\t\t }\n\t\t if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n\t\t { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n\t\t if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n\t\t { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n\t\t if (collapsed && (collapsed.from || 0) == pos) {\n\t\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t\t collapsed.marker, collapsed.from == null)\n\t\t if (collapsed.to == null) { return }\n\t\t if (collapsed.to == pos) { collapsed = false }\n\t\t }\n\t\t }\n\t\t if (pos >= len) { break }\n\n\t\t var upto = Math.min(len, nextChange)\n\t\t while (true) {\n\t\t if (text) {\n\t\t var end = pos + text.length\n\t\t if (!collapsed) {\n\t\t var tokenText = end > upto ? text.slice(0, upto - pos) : text\n\t\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n\t\t }\n\t\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n\t\t pos = end\n\t\t spanStartStyle = \"\"\n\t\t }\n\t\t text = allText.slice(at, at = styles[i++])\n\t\t style = interpretTokenStyle(styles[i++], builder.cm.options)\n\t\t }\n\t\t }\n\t\t}", "title": "" }, { "docid": "5543fcfe1d7cec165c2d3c355908a521", "score": "0.65647745", "text": "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t }\n\t if (pos >= len) break;\n\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.65454066", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.65454066", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.65454066", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.65454066", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.65454066", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.65454066", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.65454066", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "2ed8feffd83b05f07d26999e05d4e119", "score": "0.6528718", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n }", "title": "" }, { "docid": "75c4e545d8ba0b86c68d8152588de57a", "score": "0.64911234", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = styles[i++]; style = styleToClass(styles[i++]);\n }\n }\n }", "title": "" }, { "docid": "cd2b73ceff2a04335d1a11d4c607ba5a", "score": "0.6460462", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "cd2b73ceff2a04335d1a11d4c607ba5a", "score": "0.6460462", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "cd2b73ceff2a04335d1a11d4c607ba5a", "score": "0.6460462", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "cd2b73ceff2a04335d1a11d4c607ba5a", "score": "0.6460462", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "cd2b73ceff2a04335d1a11d4c607ba5a", "score": "0.6460462", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "cd2b73ceff2a04335d1a11d4c607ba5a", "score": "0.6460462", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "d5783f8ec8c809edc791360baabe0c85", "score": "0.6459118", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}", "title": "" }, { "docid": "d5783f8ec8c809edc791360baabe0c85", "score": "0.6459118", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}", "title": "" }, { "docid": "d5783f8ec8c809edc791360baabe0c85", "score": "0.6459118", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}", "title": "" }, { "docid": "96988edc109299a56adefeb4b8a00013", "score": "0.64509994", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), styleToClass(styles[i+1]));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith) foundBookmark = m;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = styleToClass(styles[i++]);\n }\n }\n }", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "1247fb4c812aa544305be89d6d29fe02", "score": "0.64442366", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "title": "" }, { "docid": "3dc63fe6df8866f393dcfb3c9ba16b8f", "score": "0.6427262", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans,\n allText = line.text,\n at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1 += 2) {\n builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1 + 1], builder.cm.options));\n }\n return;\n }\n\n var len = allText.length,\n pos = 0,\n i = 1,\n text = \"\",\n style,\n css;\n var nextChange = 0,\n spanStyle,\n spanEndStyle,\n spanStartStyle,\n title,\n collapsed;\n for (;;) {\n if (nextChange == pos) {\n // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null;nextChange = Infinity;\n var foundBookmarks = [],\n endStyles = void 0;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j],\n m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) {\n spanStyle += \" \" + m.className;\n }\n if (m.css) {\n css = (css ? css + \";\" : \"\") + m.css;\n }\n if (m.startStyle && sp.from == pos) {\n spanStartStyle += \" \" + m.startStyle;\n }\n if (m.endStyle && sp.to == nextChange) {\n (endStyles || (endStyles = [])).push(m.endStyle, sp.to);\n }\n if (m.title && !title) {\n title = m.title;\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) {\n collapsed = sp;\n }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) {\n for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) {\n if (endStyles[j$1 + 1] == nextChange) {\n spanEndStyle += \" \" + endStyles[j$1];\n }\n }\n }\n\n if (!collapsed || collapsed.from == pos) {\n for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) {\n buildCollapsedSpan(builder, 0, foundBookmarks[j$2]);\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) {\n return;\n }\n if (collapsed.to == pos) {\n collapsed = false;\n }\n }\n }\n if (pos >= len) {\n break;\n }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {\n text = text.slice(upto - pos);pos = upto;break;\n }\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "760c020e89e3167e17807c1f95598680", "score": "0.64143026", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "760c020e89e3167e17807c1f95598680", "score": "0.64143026", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "5e5641baa08ba12d33744b4ba9399a43", "score": "0.6411238", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "ea049b3744ea037a7c39cd2593ba65e3", "score": "0.6405294", "text": "function addMarkedSpan(line, span) { // 5543\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; // 5544\n span.marker.attachLine(line); // 5545\n } // 5546", "title": "" }, { "docid": "9e50afb28c3d812f423fc18bf4668dfd", "score": "0.6245897", "text": "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "title": "" }, { "docid": "9e50afb28c3d812f423fc18bf4668dfd", "score": "0.6245897", "text": "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "title": "" }, { "docid": "9e50afb28c3d812f423fc18bf4668dfd", "score": "0.6245897", "text": "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "title": "" }, { "docid": "d90210819cc06f5d2a296ab822ee86c4", "score": "0.6230539", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "788b0d4348a48d231ad7602e34489842", "score": "0.6225902", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "b20749ac12b996a4f5c58c08ddee813c", "score": "0.6220354", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "9d8376fe602526bf48d02dc0c1897b39", "score": "0.61949915", "text": "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n\t span.marker.attachLine(line)\n\t}", "title": "" } ]
a93f015856a85562c3feec41738a78ff
en la funcion getNews haremos nuestras peticiones
[ { "docid": "82349d146cf49d1eed8f98f98bcffeec", "score": "0.68687636", "text": "function getNews() {\n const articleRequest = new XMLHttpRequest();\n articleRequest.open('GET', `https://swapi.co/api/people/`);\n articleRequest.onload = addNews;\n articleRequest.onerror = handleError;\n articleRequest.send();\n}", "title": "" } ]
[ { "docid": "9b2a29012a7f2fe3866151e5dcb8f28c", "score": "0.79436946", "text": "function getNews() {\n const collections = [\n 'general',\n 'business',\n 'health',\n 'science',\n 'entertainment',\n 'technology',\n 'sports'\n ];\n\n NewsPiece.find((err, news) => {\n if (err) return console.error(err);\n news.forEach(newsItem => {\n newsItem.remove();\n });\n });\n\n collections.forEach(collection => {\n newsapi.v2\n .topHeadlines({\n // sources: 'bbc-news,the-verge',\n category: `${collection}`,\n language: 'en',\n country: 'us'\n })\n .then(response => {\n response.articles.forEach(article => {\n if (article.title && article.description && article.urlToImage) {\n const newsPiece = new NewsPiece({\n category: `${collection}`,\n title: article.title,\n author: article.author,\n description: article.description,\n content: article.content,\n urlToImage: article.urlToImage,\n source: article.source.name,\n publishedAt: article.publishedAt,\n url: article.url\n });\n newsPiece\n .save()\n .then()\n .catch(err => console.log(err));\n }\n });\n })\n .catch(err => console.log(err));\n });\n }", "title": "" }, { "docid": "48f16171660376c6b1039a2a06af49c4", "score": "0.7545567", "text": "function getNews(playerName, source) {\n // get todays date\n let currentDate = new Date(Date()).toISOString().substring(0,10);\n console.log(currentDate);\n var url = 'https://newsapi.org/v2/everything?' +\n 'q=\"' + playerName + '\"&' +\n //'from=2017-01-09&' +\n //'to='+ currentDate + \"&\" +\n 'sortBy=relevancy&' +\n 'sources='+ source + \"&\" + \n 'apiKey='+ config.secrets.MY_KEY;\n\n var req = new Request(url);\n fetch(req).then(response => \n response.json().then(data => ({\n data: data,\n status: response.status\n })\n ).then(res => {\n let news = res.data[\"articles\"];\n /* Keys:\n author\n description\n publishedAt\n title\n url\n urlToImage\n */\n \n news.forEach((a) => {\n let lol = new NewsArticle(a[\"title\"], a[\"publishedAt\"], \"\", a[\"source\"][\"name\"], a[\"url\"]);\n articles.push(lol);\n console.log(articles)\n });\n displayDataToScreen();\n }));\n}", "title": "" }, { "docid": "f78c645d2e11fe05b2838a4edff46036", "score": "0.75254947", "text": "getNews() {\n\n this.dataBase.findByIndex(\"/news\",\n [\"_id\", \"title\", \"attachment\", \"seoDescription\", \"isMainNews\", \"createDate\", \"writerId\"], \"categoryId\", mvc.routeParams.id).then( data => {\n\n if (data) {\n this.listMainNews = data.docs.filter((el) => { return el.isMainNews});\n if (this.listMainNews.lenght > 3) {\n this.listMainNews = this.listMainNews.slice(0, 3);\n }\n this.mainNews = this.listMainNews[0];\n this.getWriters();\n mvc.apply();\n } else {\n this.getNews();\n }\n }, () => {\n this.getNews();\n });\n }", "title": "" }, { "docid": "a1c40abd1b768a8027fabe6aace9d5b4", "score": "0.74150985", "text": "function getNews(){\nreturn news;\n}", "title": "" }, { "docid": "b1cabe7e72100794bbf80bb6f8bb148a", "score": "0.72255397", "text": "getNews() {\n //disables the whole news block if required by the config\n if (!this.settings.freshTabNews) {\n return {\n version: -1,\n news: []\n };\n }\n\n return CliqzFreshTabNews.getNews().then(function (news) {\n CliqzFreshTabNews.init();\n\n var newsList = news.newsList || [];\n var topNewsVersion = news.topNewsVersion || 0;\n\n return {\n version: topNewsVersion,\n news: newsList.map(r => ({\n title: r.title_hyphenated || r.title,\n description: r.description,\n displayUrl: CliqzUtils.getDetailsFromUrl(r.url).cleanHost || r.title,\n logo: CliqzUtils.getLogoDetails(CliqzUtils.getDetailsFromUrl(r.url)),\n url: r.url,\n type: r.type,\n breaking_label: r.breaking_label\n }))\n };\n });\n }", "title": "" }, { "docid": "c36fcbdaea7126932bf4a484c96d1e4f", "score": "0.7113793", "text": "getAllNews() {\n\n this.dataBase.findByIndex(\"/news\", [\"_id\", \"title\", \"attachment\"],\"categoryId\", mvc.routeParams.id).then( data => {\n if (data) {\n let length = data.docs.length;\n this.liftNewsInCategory = data.docs.slice(0, length / 2);\n this.rightNewsInCategory = data.docs.slice(length / 2, length);\n mvc.apply();\n } else {\n this.getAllNews()\n }\n }, () => {\n this.getAllNews();\n });\n\n }", "title": "" }, { "docid": "9f50bac75c9133f03c681d726e75174f", "score": "0.6957217", "text": "getNews() {\n return this._$http({\n url: this._AppConstants.api + \"/news\",\n method: \"GET\"\n }).then(res => {\n console.log(res.data.newss);\n\n return res.data.newss;\n\n });\n }", "title": "" }, { "docid": "4b0006adf67104e3c90766d518254770", "score": "0.69180423", "text": "function getAllnews() {\n vm.news = [];\n dataService.getAllNews().then(function (results) {\n // to get the latest 5 news .\n results.reverse().forEach(function (item, index) {\n if (index < 5) {\n vm.news.push(item);\n };\n })\n })\n }", "title": "" }, { "docid": "b31f986a2200765644375639e012cc62", "score": "0.6888386", "text": "function topNews(){\n \n var input = $(\".game-title\").attr(\"data-name\").split(' ').join('+')\n var articleURL = 'https://newsapi.org/v2/everything?sources=ign,polygon&language=en&q=\"' + input + '\"&sortBy=relevancy&apiKey=f38cc49da4df4fd0b9ceea723e83cb15';\n\n $.ajax({\n url: articleURL,\n method: \"GET\"\n }).then(function (response) {\n var result = response.articles;\n \n if (response.totalResults != 0) {\n \n \n var title1 = result[0].title;\n var title2 = result[1].title;\n var author1 = result[0].author;\n var author2 = result[1].author;\n var image1 = result[0].urlToImage;\n var image2 = result[1].urlToImage;\n var descript1 = result[0].description;\n var descript2 = result[1].description;\n var url1 = result[0].url;\n var url2 = result[1].url;\n\n\n\n \n if (title1) {\n $(\".article-title1\").html(title1);\n }\n if (title2) {\n $(\".article-title2\").html(title2);\n }\n if (author1) {\n $(\".readmore1\").html(\"<a href='\" + url1 + \"' target='_blank'> Read more </a>\")\n }\n if (author2) {\n $(\".readmore2\").html(\"<a href='\" + url2 + \"' target='_blank'> Read more </a>\")\n }\n if (descript1) {\n $(\".info-desc1\").html(descript1)\n }\n if (descript2) {\n $(\".info-desc2\").html(descript2)\n }\n if (author1) {\n $(\".author1\").html(\"Author: \" + author1)\n }\n if (author2) {\n $(\".author2\").html(\"Author: \" + author2)\n }\n if (image1) {\n $(\".article-img1\").attr(\"src\", image1)\n }\n if (image2) {\n $(\".article-img2\").attr(\"src\", image2)\n }\n $(\"#news\").show()\n } \n \n \n \n })\n\n}", "title": "" }, { "docid": "179ec65cadcd3c27caa6a780f23d189a", "score": "0.68440163", "text": "function getNews(place) {\n var queryURL = \"https://api.nytimes.com/svc/search/v2/articlesearch.json?q=articles&fq=glocations:\" + place + \"&api-key=g3KFAz8SGDwQs4rxRmIrPbDPuhJbsmtG\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n let results = response.response.docs;\n\n // Iterate through the results array of objects representing news articles\n for (let i = 0; i < results.length; i++) {\n let newArticles = {\n title: results[i].headline.main,\n url: results[i].web_url,\n by: results[i].byline.original,\n year: results[i].pub_date\n };\n newsArray.push(newArticles);\n }\n console.log(\"News:\", newsArray);\n\n // Add a few reccomendations from newsArray to the news card content\n\t\tlet limit = 5;\n\t\tif (newsArray.length < 5) { limit = newsArray.length; }\n\t\t$(\"#news-preview\").empty();\n\t\tfor (let i = 0; i < limit; i++) {\n let newDiv = $(\"<div>- \" + newsArray[i].title + \"</div>\");\n $(\"#news-preview\").append(newDiv);\n }\n\t\t// Unhide the \"show results\" link & show how many results there are\n\t\t$(\"#news-title\").text(place + \" in the News (\" + newsArray.length + \")\");\n $(\"#news-action\").removeClass(\"hide\");\n });\n}", "title": "" }, { "docid": "e6ec9cd86d3efc78e82c61d904922b3b", "score": "0.68364984", "text": "function createNews(params) {\n var newNews = new News();\n newNews.name = params.name;\n newNews.description = params.description;\n newNews.image = 'null';\n return newNews;\n}", "title": "" }, { "docid": "0b7cb27693606c229166aa3ace04d1cb", "score": "0.6829538", "text": "function getISSNews() {\n $.ajax({\n method: 'GET',\n url: 'https://newsapi.org/v2/everything?apiKey=14a203dbcd734c259c66e3b17d72eb30&q=iss',\n success: (response) => {\n\n response.articles.forEach(article => {\n let articleItem = {\n title: article.title,\n description: article.description,\n source: article.source.name,\n url: article.url\n }\n articles.push(articleItem);\n });\n\n addArticles(6);\n }\n });\n}", "title": "" }, { "docid": "77657d7b2cd241eb32ade12f3c706854", "score": "0.680291", "text": "async function getNews() {\n news = await fetch('https://api.nytimes.com/svc/topstories/v2/business.json?api-key=IlIdSVUvpiF5PABbTeerA3kRncTqyqAo').then(r => r.json())\n console.log(news)\n for (i = 0; i < 3; i++) {\n\n title = news.results[i].title\n console.log(title)\n url = news.results[i].url\n hotTitle = title.link(`${url}`)\n console.log(url)\n image = news.results[i].multimedia[0].url\n caption = news.results[i].multimedia[0].caption\n changeNewsInfo()\n changeNewsImage()\n changeNewsCaption()\n\n }\n}", "title": "" }, { "docid": "ba83e043d71140fca37853614fc4676f", "score": "0.67855096", "text": "function fetchHomeNews() {\n ArticleService.getHomeNews().then(function (data) {\n\n $scope.news = data;\n });\n }", "title": "" }, { "docid": "95f37f6d2df1c767673dad8b5c237e54", "score": "0.6777337", "text": "getNewsInfo(index){\n return news[index];\n }", "title": "" }, { "docid": "0c4825e79b25e711822356771c18456d", "score": "0.67713773", "text": "function getNews(source, isLoggedIn) {\n\t\t// paste your API key from https://newsapi.org/account after \"apiKey=\"\n\t\tvar url = \"https://newsapi.org/v1/articles?source=\" + source + \"&apiKey=ed80a50e4dbb431caf1a8983e42cf1ae\"\n\t\t$.getJSON(url, function(data) {\n\t\t\tconsole.log(data)\n\t\t\t$(\".container\").html('') // clear existing articles\n$(\".title-link\").css('text-decoration', 'none')\n$(\"#\" + source).css('text-decoration', 'underline') // underline the source link\n\nfor (var i = 0; i < data.articles.length; i++) {\n\tvar article = data.articles[i]\n\n\t$( \"<div></div>\", {\n\t\tid: \"article-container-\" + i,\n\t\tclass: \"article-container\",\n\t\tstyle: \"background-image: url(\" + article.urlToImage + \")\",\n\t}).appendTo($(\".container\"))\n\t\n\t$(\"#article-container-\" + i).bind(\"click\", { url: article.url }, function(e) {\n\t\twindow.open(e.data.url)\n\t})\n\n\t$( \"<div></div>\", {\n\t\tclass: \"article-text\",\n\t}).appendTo($(\"#article-container-\" + i))\n\t\n\t$( \"<div></div>\", {\n\t\tclass: \"article-title\",\n\t\ttext: article.title\n\t}).appendTo($(\"#article-container-\" + i + \" .article-text\"));\n\n\t$( \"<div></div>\", {\n\t\tclass: \"article-datetime\",\n\t\ttext: moment(article.publishedAt).format(\"MMMM Do YYYY, h:mm:ss a\")\n\t}).appendTo($(\"#article-container-\" + i + \" .article-text\"))\n\n\tif (isLoggedIn) {\n\t\t$( \"<div></div>\", {\n\t\t\tclass: \"slack-button\",\n\t\t\tid: \"slack-button-\" + i,\n\t\t\ttext: \"Send to Slack\",\n\t\t}).appendTo($(\"#article-container-\" + i))\n\n\t\t$(\"#slack-button-\" + i).bind(\"click\", {\n\t\t\tsource: source,\n\t\t\tarticle: article\n\t\t}, function(e) {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t\tvar source = e.data.source\n\t\t\tvar article = e.data.article\n\t\t\tsendToSlack(source, article.title, article.description, article.url, article.urlToImage)\n\t\t})\n\t}\n}\n\n\t\t})\n\t}", "title": "" }, { "docid": "3ff5e6770109682b8fbc4a60be587c60", "score": "0.67650807", "text": "function getNews() {\n $.ajax({\n url: baseURI + apiKey,\n success: function(res){\n numOfHeadlines(res);\n }\n });\n }", "title": "" }, { "docid": "2bf37bcc8f9c9c0dac10bbfe78df82ed", "score": "0.67560387", "text": "function getNews(callback) {\n getBbcNewsData(callback);\n getDoverbroecksNewsData(callback);\n}", "title": "" }, { "docid": "2cacef0bf88750566cd014babe99fcf1", "score": "0.674822", "text": "function getNews(req, res) {\n News.find({}, function (err, news) {\n if (err) {\n res.status(200).send({ message: \"Ocurrió un error interno, comuniquese con el administrador\" });\n } else {\n if (!news) {\n res.status(404).send({ message: \"No se encontraron noticias\" });\n } else {\n res.status(200).send({ news });\n }\n }\n });\n}", "title": "" }, { "docid": "09b2f6946e598300104cbe3cf9f399c8", "score": "0.670164", "text": "fetchNews(arePagesReset) {\n if (arePagesReset) this.pageSelector.resetPages();\n const queryString = this.buildQueryString();\n fetch(queryString)\n .then(response => response.json())\n .then(data => {\n if (arePagesReset) {\n this.pageSelector.setPages(data.response.pages);\n }\n this.newsList.populateList(data.response.results);\n })\n .catch(() => {\n this.newsList.renderList([], this.newsList.newsListElement, 'There was a connection error')\n });\n }", "title": "" }, { "docid": "256c97ece78b259e155efddb4b551708", "score": "0.66925704", "text": "function wsNyTimes() {\n\n\n $.ajax({\n url: 'https://newsapi.org/v2/everything?domains=wsj.com,nytimes.com&apiKey=7ccecb2a8e6547c3b9e5242259eeda0e',\n method: \"GET\",\n dataType: 'json'\n }).then(function(response) {\n\n let newsResponse = response.articles;\n\n for (let j = 0; j < newsResponse.length; j++) {\n\n\n console.log('my data Name: ' + response.articles[j].source.name);\n\n console.log('my datataddd author is: ' + response.articles[j].author);\n console.log('Title: ' + response.articles[j].title);\n\n console.log('my Array : ' + newsResponse[j]);\n\n\n // for images to load\n let showImage = $(\"<img>\");\n let staticSource = newsResponse[j].urlToImage;\n showImage.addClass('card-img-top mt-3 mb-3');\n showImage.attr('src', staticSource);\n showImage.addClass('newsImage');\n\n\n // for links to be read\n let newsLinkDiv = $('<div>');\n\n let newsLink = $(\"<a>\");\n\n newsLink.attr(\"href\", newsResponse[j].url);\n newsLink.attr(\"title\");\n newsLink.attr('target', '_blank')\n newsLink.html('Read More ')\n newsLink.addClass('btn btn-primary btn-block mt-3 mb-3');\n newsLink.addClass(\"link\");\n\n // for title display\n let titleDisplay = newsResponse[j].title;\n let title = $(\"<h6 class='card-title mb-2'>\").html(titleDisplay);\n\n // for description\n let description = newsResponse[j].description;\n let cardDescription = $('<p class=\"describe lead mb-2\">').html(description)\n\n console.log('Description: ' + cardDescription);\n\n // published date\n\n let datePublished = newsResponse[j].publishedAt;\n console.log('Publisssheeed: ' + newsResponse[j].publishedAt);\n let publishedDate = $('<h5 class=\"lead mb-2\">').html(datePublished);\n\n // for source name, usually website\n let namedSource = newsResponse[j].source.name;\n let sourceNamed = $('<p class=\"lead mb-2\">').html('Source: ' + namedSource)\n\n // div for loop show in html\n\n let newsDiv = $(\"<div class='news-card card m-3 col-sm-12 col-md-6 col-lg-4 mx-auto'>\");\n let footerDiv = $(\"<div class='card-footer'>\");\n\n\n newsDiv.prepend(cardDescription)\n newsDiv.prepend(title);\n newsDiv.prepend(sourceNamed)\n\n newsDiv.prepend(showImage);\n newsDiv.append(newsLink);\n // newsDiv.append(modalButton)\n newsLinkDiv.append(newsLink)\n newsDiv.append(newsLinkDiv)\n $(\".news-div\").append(newsDiv);\n\n }\n // end of for loop\n\n });\n\n\n }", "title": "" }, { "docid": "2710d963539fa2e0713767081e6b91c2", "score": "0.66903615", "text": "static listAllOfMyNews() {\n\t\treturn RestService.get('api/news');\n\t}", "title": "" }, { "docid": "3db4815bd18e4c10482522bebf19d4a6", "score": "0.66771775", "text": "_getNews(page = 0, key = 'news') {\n\t\tlet url = 'http://drupal.murilobastos.com/' + key\n\t\tconsole.log(url)\n\t\treturn fetch(url)\n\t\t\t.then((response) => response.json())\n\t\t\t.then((responseJson) => {\n\n\t\t\t\tthis._cacheRequest(page, key, responseJson)\n\t\t\t\tthis._setNewsData(page, key, responseJson)\n\t\t\t\treturn\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error)\n\t\t\t})\n\t}", "title": "" }, { "docid": "a531754c6355e049f2b75c6aacd33b4d", "score": "0.6596604", "text": "getNewsList(since) {\n return new Promise((resolve, reject) => {\n let url =\n ApiConst.BASE_URL +\n `/svc/mostpopular/v2/viewed/${since}.json?api-key=` +\n ApiConst.TOKEN;\n axios\n .get(url)\n .then(function(response) {\n return resolve({ response });\n })\n .catch(function(error) {\n return reject({ error });\n });\n });\n }", "title": "" }, { "docid": "fe02bf91ede806dceb0409711d58316e", "score": "0.65722203", "text": "async function updateNews() {\n props.setProgress(10)\n\n const URL = `https://newsapi.org/v2/top-headlines?country=${props.country}&category=${props.category}&apiKey=3fd2dfd5b9cf42b287f86cd58cd34cfa&page=${page}&pageSize=${props.pageSize}`\n\n setLoading(true)\n\n try {\n const data = await fetch(URL)\n props.setProgress(30)\n\n const parsedData = await data.json()\n props.setProgress(70)\n\n setArticles(parsedData.articles)\n setTotalResults(parsedData.totalResults)\n setLoading(false)\n\n props.setProgress(100)\n } catch (err) {\n setArticles([])\n setTotalResults(0)\n setLoading(false)\n }\n }", "title": "" }, { "docid": "d9557745baed4a8be05d036a8c04bc8b", "score": "0.6568714", "text": "async function getNews() {\n if (askedNews === false) {\n console.log(\"news api called\");\n const response = await fetch('https://gnews.io/api/v3/' + rnd3 + rnd1 + rnd2);\n const jsonResp = await response.json();\n jsonObj.newsJson = jsonResp;\n console.log(\"total articles= \" + jsonObj.newsJson.articleCount);\n askedNews = true;\n newsCnt++;\n let artLinkStr = jsonResp.articles[0].source.url;\n return jsonResp.articles[0].title + \"<br><br>Source: \" + jsonResp.articles[0].source.name + \"<br><a href=\\\"\" + artLinkStr + \"\\\" target=\\\"_blank\\\">\" + \"Article Link\" + \"</a>\" + \"<br><br>Enter 1 again to read another news or choose another option !\";\n }\n else {\n\n let foo = jsonObj.newsJson;\n let ind = newsCnt % (foo.articleCount);\n console.log(\"ind= \" + ind);\n newsCnt++;\n let artLinkStr = foo.articles[ind].source.url;\n return foo.articles[ind].title + \"<br><br>Source: \" + foo.articles[ind].source.name + \"<br><a href=\\\"\" + artLinkStr + \"\\\" target=\\\"_blank\\\">\" + \"Article Link\" + \"</a>\" + \"<br><br>Enter 1 again to read another news or choose another option !\";\n }\n // return \"This is a news\";\n}", "title": "" }, { "docid": "4d2ba1e9cbdb8fcf7b8f9d9c2ced99cc", "score": "0.65649885", "text": "function setNews() {\n var p = $http({\n method: 'GET',\n url:'/profile'\n }).then(function successfullCallBack(response) {\n\n news = response.data.data;\n\n });\n return p;\n}", "title": "" }, { "docid": "ad8b95298fb42c5a536e971910043a34", "score": "0.65633994", "text": "function getNew (req, res) {\n let newsId = req.params.newsId\n \n News.findById(newsId, (err, news) => {\n if (err) return res.status(500).send({ message: `Error al realizar la peticion: ${err}`})\n if(!news) return res.status(404).send({ message: `La Noticia no existe`}) \n \n res.status(200).send({ news })\n }) \n}", "title": "" }, { "docid": "9a6285c4b4c28f27bc15767f59e0cecd", "score": "0.6561286", "text": "getRandomNews() {\n\n this.dataBase.getData(\"/news/_design/views/_view/random\", true, '',).then( data => {\n if (data) {\n this.randomNews = data;\n if (this.randomNews.lenght > 10) {\n this.randomNews = this.randomNews.slice(0, 10);\n }\n mvc.apply();\n } else {\n this.getRandomNews();\n }\n }, () => {\n this.getRandomNews();\n });\n\n }", "title": "" }, { "docid": "c6c0c96ca5aab526817e5eb4c6cdce23", "score": "0.65483886", "text": "function getNews() {\n $.getJSON(newsURL, function(data) {\n showNews(data);\n });\n}", "title": "" }, { "docid": "0574f3909a7c123ae45202830dfa9526", "score": "0.65185004", "text": "function getNewsHeadlines() {\n return request(NEWS_ENDPOINT).then(\n response => {\n let data = JSON.parse(response);\n let newsData = data.articles.map((headline) => {\n return {\n title: headline.title,\n url: headline.url,\n imageURL: headline.urlToImage,\n }\n }\n );\n return newsData;\n }\n ).catch(error => console.log(\"News Error\"))\n}", "title": "" }, { "docid": "544f995373b99364600d344564c13714", "score": "0.6515053", "text": "function loadNewsDetail(url_parameter){\r\n\tvar news_template = \"<h3>news_title</h3>\" + \"<div id='news_id'>img_slide_show</div>\" +\r\n\t\"<p>news_summary</p><br /><a href='wikipedia_article' target='_blank'>see more on wikipedia</a><p class='p-small'>edited by:<br/> editor_list</p>\";\r\n $.ajax({\r\n\t type: \"GET\",\r\n\t url: wp_service_route_news + \"/\" + url_parameter,\r\n\t dataType: \"json\",\r\n\t success: function (news) {\r\n \t\t$(\"#wait\").html(\"\");\r\n\t \tif (news !== null){\t \t\t\t\t\t\t\t\r\n\t\t\t\tappend_str = news_template;\t\t\t\t\r\n\t\t\t\tappend_str = append_str.replace(/news_id/g, \"'\" + news.id + \"'\");\r\n\t\t\t\tappend_str = append_str.replace(/news_title/g,news.pageTitle);\r\n\t\t\t\tappend_str = append_str.replace(/img_slide_show/g,createImageSlideshow(news.id,0,news.imageUrlList));\r\n\t\t\t\tappend_str = append_str.replace(/news_summary/g,news.news);\r\n\t\t\t\tappend_str = append_str.replace(/wikipedia_article/g, news.BASE_URL + news.pageTitle);\r\n\t\t\t\tvar editor_list = \"\";\r\n\t\t\t\tif (news.editors !== undefined){ \r\n\t\t\t\t\tif (news.editors.length > 1) alert(\"editors: \" + news.editors.length);\r\n\t\t\t\t\tfor ( var i = 0; i < news.editors.length; i++) {\r\n\t\t\t\t\t\teditor_list += news.editors[i].user;\r\n\t\t\t\t\t\tif ((i+1)<news.editors.length) editor_list += \", \"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tappend_str = append_str.replace(/editor_list/g,editor_list);\r\n\t\t\t\t\r\n\t \t\t$(\"#wp_service_news_detail_results\").html(append_str);\r\n\t \t\t$('html,body').scrollTop(0);\r\n\t \t}\r\n\t \telse {\r\n\t \t\tloadDoc(\"error.html\");\t \r\n\t \t}\r\n\t },\r\n\t error: function(){\r\n\t \tloadDoc(\"error.html\");\r\n\t }\r\n\t});\r\n}", "title": "" }, { "docid": "70e730353f28c6336de77d30fa2fda8e", "score": "0.6503854", "text": "getNewsData() {\r\n const url ='https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=1355006627464de1bea55e1cd7420d1c';\r\n \r\n return fetch(url)\r\n .then((response) => {\r\n return response.json();\r\n }).then((res) => {\r\n let articles = res.articles;\r\n this.setState({\r\n newsData: articles,\r\n isLoaded: false,\r\n })\r\n });\r\n }", "title": "" }, { "docid": "54af96472952b49dc854b90cc0de1970", "score": "0.64909625", "text": "function islamicNews() {\n $.ajax({\n url:\n api.urlNews +\n \"everything?q=islam&language=id&sortBy=publishedAt&apiKey=\" +\n api.keyNews1,\n success: function (res) {\n let w = res.articles;\n\n insertCardRow(\"row-news-islamic\", w);\n },\n });\n}", "title": "" }, { "docid": "d80b130c80b1a670952f6b9d140efc5f", "score": "0.64808935", "text": "function topHeadlines() {\n\n var API = '7ccecb2a8e6547c3b9e5242259eeda0e';\n\n $.ajax({\n url: 'https://newsapi.org/v2/top-headlines?' +\n 'country=us&' +\n 'apiKey=' + API,\n method: \"GET\",\n dataType: 'json'\n }).then(function(response) {\n\n let newsResponse = response.articles;\n\n for (let i = 0; i < newsResponse.length; i++) {\n\n\n console.log('my data Name: ' + response.articles[i].source.name);\n\n console.log('my datataddd author is: ' + response.articles[i].author);\n console.log('Title: ' + response.articles[i].title);\n\n // for images to load\n let showImage = $(\"<img>\");\n let staticSource = newsResponse[i].urlToImage;\n showImage.addClass('card-img-top mt-3 mb-3');\n showImage.attr('src', staticSource);\n showImage.addClass('newsImage');\n\n\n // for links to be read\n let newsLinkDiv = $('<div>');\n let newsLink = $(\"<a>\");\n\n newsLink.attr(\"href\", newsResponse[i].url);\n newsLink.attr(\"title\");\n newsLink.attr('target', '_blank')\n newsLink.html('Read More ')\n newsLink.addClass('btn btn-primary btn-block mt-3 mb-3');\n newsLink.addClass(\"link\");\n\n // for title display\n let titleDisplay = newsResponse[i].title;\n let title = $(\"<h6 class='card-title mb-2'>\").html(titleDisplay);\n\n // for description\n let description = newsResponse[i].description;\n let cardDescription = $('<div class=\"describe lead mb-2\">').html(description);\n\n console.log('Description: ' + cardDescription);\n\n // published date\n\n let datePublished = newsResponse[i].publishedAt;\n console.log('Publisssheeed: ' + newsResponse[i].publishedAt);\n let publishedDate = $('<h5 class=\"lead mb-2\">').html(datePublished);\n\n // for source name, usually website\n let namedSource = newsResponse[i].source.name;\n let sourceNamed = $('<p class=\"lead mb-2\">').html('Source: ' + namedSource)\n\n // div for loop show in html\n\n let newsDiv = $(\"<div class='news-card card m-3 col-sm-12 col-md-6 col-lg-4 mx-auto'>\");\n let footerDiv = $(\"<div class='card-footer'>\");\n\n\n newsDiv.prepend(cardDescription)\n newsDiv.prepend(title);\n newsDiv.prepend(sourceNamed)\n newsDiv.prepend(publishedDate)\n\n\n newsDiv.prepend(showImage);\n // newsDiv.append(newsLink);\n newsLinkDiv.append(newsLink)\n newsDiv.append(newsLinkDiv)\n // newsDiv.append(modalButton)\n $(\".news-div\").append(newsDiv);\n\n }\n // end of for loop\n\n });\n // end of top headlines request\n\n }", "title": "" }, { "docid": "8180cb89e741031c38ee19bb57681527", "score": "0.6479713", "text": "function initNews(){\n\t// Eventos\n\tvar template_eventos = $('#news #eventos').html().trim();\n\tvar data_eventos = models().news.events;\n\n\tvar html = Mustache.to_html(template_eventos, data_eventos);\n\t$('#news #eventos').html(html);\n\t// Ofertas\n\tvar template_ofertas = $('#news #ofertas').html().trim();\n\tvar data_ofertas = models().news.deals;\n\n\tvar html = Mustache.to_html(template_ofertas, data_ofertas);\n\t$('#news #ofertas').html(html);\n\t// Investigacion\n\tvar template_investigacion = $('#news #investigacion').html().trim();\n\tvar data_investigacion = models().news.research;\n\n\tvar html = Mustache.to_html(template_investigacion, data_investigacion);\n\t$('#news #investigacion').html(html);\n\t// Animacion\n\tvar op1 = {\n\t\tperiod: 3000,\n duration: 1000,\n\t\tdirection: 'down'\n\t};\n\tvar op2 = {\n\t\tperiod: 4000,\n duration: 1500,\n\t\tdirection: 'up'\n\t};\n\tvar op3 = {\n\t\tperiod: 5000,\n duration: 2000,\n\t\tdirection: 'left'\n\t};\n\t$('#news #eventos').tileBlockSlider(op1);\n\t$('#news #ofertas').tileBlockSlider(op2);\n\t$('#news #investigacion').tileBlockSlider(op3);\n}", "title": "" }, { "docid": "df6bd9e1a7e58c1eb27905ef2ddf713b", "score": "0.64775634", "text": "function showNews(results) {\n let article = `\n \n <a class=\"link\" href=\"${results.articles[0].url}\" target=\"_blank\"><img class=\"thumb\" src=\"${results.articles[0].urlToImage}\"></a><br />\n \n <a class=\"title\" href=\"${results.articles[0].url}\" target=\"_blank\">${results.articles[0].title}<alt=\"${results.articles[0].description}\"></a><br /><br /><br />\n \n \n <a class=\"link\" href=\"${results.articles[1].url}\" target=\"_blank\"><img class=\"thumb\" src=\"${results.articles[1].urlToImage}\"></a><br />\n \n <a class=\"title\" href=\"${results.articles[1].url}\" target=\"_blank\">${results.articles[1].title} <alt=\"${results.articles[1].description}\"></a><br /><br /><br />\n \n \n <a class=\"link\" href=\"${results.articles[2].url}\" target=\"_blank\"><img class=\"thumb\" src=\"${results.articles[2].urlToImage}\"></a><br />\n \n <a class=\"title\" href=\"${results.articles[2].url}\" target=\"_blank\">${results.articles[2].title}<alt=\"${results.articles[2].description}\"></a><br /><br /><br />\n \n \n <a class=\"link\" href=\"${results.articles[3].url}\" target=\"_blank\"><img class=\"thumb\" src=\"${results.articles[3].urlToImage}\"></a><br />\n \n <a class=\"title\" href=\"${results.articles[3].url}\" target=\"_blank\">${results.articles[3].title}<alt=\"${results.articles[3].description}\"></a><br /><br />\n \n `;\n $(\".stories\").html(article);\n}", "title": "" }, { "docid": "f981be63e4454b01d86fc96c4c3acf87", "score": "0.6445538", "text": "function getDefaultNews() {\r\n return {\r\n \"Demo\": {\r\n \"_type\": \"News\",\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/news/search?q=azure+cloud\",\r\n \"totalEstimatedMatches\": 1310000,\r\n \"value\": [\r\n {\r\n \"about\": [\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\",\r\n \"name\": \"Windows Azure\"\r\n },\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/0e95d5e1-1e66-476f-eda0-0bb417a12c37\",\r\n \"name\": \"Cloud computing\"\r\n }\r\n ],\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"ZDNet\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-03T20:47:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"Microsoft Azure: Everything you need to know about Redmond's cloud service\",\r\n \"url\": \"https://www.zdnet.com/article/microsoft-azure-everything-you-need-to-know/\",\r\n \"description\": \"Microsoft Azure is a broad, ever-expanding set of cloud-based computing services that are available to businesses, developers, government agencies, and anyone who wants to build an app or run an enterprise on the internet without having to manage hardware.\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.CB50B48B5DED8E082BA372A35CE05180&pid=News\",\r\n \"width\": 570,\r\n \"height\": 322\r\n }\r\n }\r\n },\r\n {\r\n \"about\": null,\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"SD Times\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-04T19:13:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"Microsoft takes Azure to the next level\",\r\n \"url\": \"https://sdtimes.com/msft/microsoft-takes-azure-to-the-next-level/\",\r\n \"description\": \"Microsoft first developed its cloud computing service Azure with a mission to let developers and organizations do more in the cloud. Over the last year, the company has brought the service beyond ...\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.0C7B60231285DD55744FF23806BA65DE&pid=News\",\r\n \"width\": 490,\r\n \"height\": 275\r\n }\r\n }\r\n },\r\n {\r\n \"about\": [\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/9d9c40a9-f255-fc05-ea48-3c7685363661\",\r\n \"name\": \"Computerworld\"\r\n },\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\",\r\n \"name\": \"Windows Azure\"\r\n }\r\n ],\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"Computerworld\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-02T22:18:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"Crash Course in Azure Active Directory\",\r\n \"url\": \"https://www.computerworld.com/resources/182527/data-management/crash-course-in-azure-active-directory\",\r\n \"description\": \"Azure AD is Microsoft’s cloud-based directory and identity management service. It combines core directory services, advanced identity protection, and application access management. Azure AD delivers single sign-on (SSO) access to on-premises and cloud ...\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.A94BC8862AFD8A169A0FA650F100C568&pid=News\",\r\n \"width\": 300,\r\n \"height\": 248\r\n }\r\n }\r\n },\r\n {\r\n \"about\": [\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\",\r\n \"name\": \"Windows Azure\"\r\n }\r\n ],\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"SQL Server Central\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-02T07:11:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"Replicate NetSuite Data to Azure SQL (SSIS in Azure Data Factory)\",\r\n \"url\": \"http://www.sqlservercentral.com/articles/Integration+Services+(SSIS_/180310/\",\r\n \"description\": \"Azure Data Factory (ADF) is a scalable, trusted cloud-based solution for building automated data integration solutions with a visual, drag-and-drop UI. Moving on-premises SSIS workloads to Azure can reduce the operational costs of managing infrastructure ...\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.5202B2CFDFFF37B1D89114D2E89420ED&pid=News\",\r\n \"width\": 700,\r\n \"height\": 469\r\n }\r\n }\r\n },\r\n {\r\n \"about\": [\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\",\r\n \"name\": \"Windows Azure\"\r\n },\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/e3ddc8df-bbab-630e-7b7c-1321a15631ed\",\r\n \"name\": \"Microsoft Dynamics\"\r\n },\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/d30d2940-27f4-1035-3a16-b39e0410a136\",\r\n \"name\": \"Conditional access\"\r\n }\r\n ],\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"Msdynamicsworld.com\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-04T20:00:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"Microsoft Azure Active Directory Conditional Access and Dynamics 365: Enforce multi-factor authentication\",\r\n \"url\": \"https://msdynamicsworld.com/story/microsoft-azure-active-directory-conditional-access-and-dynamics-365-enforce-multi-factor\",\r\n \"description\": \"With Azure Active Directory Conditional Access, you can control how authorized users can access your cloud applications. Multi-factor authentication (MFA) is a method of authentication that requires more than one verification method and adds a second layer ...\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.62786DB28E1EA638E8B46C0A1887B36C&pid=News\",\r\n \"width\": 700,\r\n \"height\": 274\r\n }\r\n }\r\n },\r\n {\r\n \"about\": [\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\",\r\n \"name\": \"Windows Azure\"\r\n }\r\n ],\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"petri.com\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-03T15:12:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"The Easy Ways to Restore Azure VMs From Backup\",\r\n \"url\": \"https://www.petri.com/the-easy-ways-to-restore-azure-vms-from-backup\",\r\n \"description\": \"This is my favorite of the restore options to show to people that are new to Azure because it shows some of the clever things that you can do in an integrated software-defined cloud such as Azure. If you need to restore one or some files from a backup ...\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.C28C18FD4E4B1931BE83425F68F3C813&pid=News\",\r\n \"width\": 700,\r\n \"height\": 394\r\n }\r\n }\r\n },\r\n {\r\n \"about\": null,\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"DatabaseJournal\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-03T13:04:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"Customizing the Default Azure Data Studio Dashboards\",\r\n \"url\": \"https://www.databasejournal.com/features/mssql/customizing-the-default-azure-data-studio-dashboards.html\",\r\n \"description\": \"Azure Data Studio is a cross-platform database tool to allow data professionals a single user interface to work with databases on premise and in the cloud. This is a free new tool that is available for Windows, Mac, and Linux users. Azure Data Studio is ...\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.6A5A963AD254B6A57DC46B9375E6ACA9&pid=News\",\r\n \"width\": 700,\r\n \"height\": 377\r\n }\r\n }\r\n },\r\n {\r\n \"about\": [\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/cafb5c69-0d68-2211-85a0-3067c643f408\",\r\n \"name\": \"Oracle Corporation\"\r\n },\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/ebf1abd7-9ec4-7875-6a41-a8aaa77bdbb2\",\r\n \"name\": \"Technology\"\r\n },\r\n {\r\n \"readLink\": \"https://api.cognitive.microsoft.com/api/v7/entities/4169c32e-169f-50c1-d8ae-d87df1fca415\",\r\n \"name\": \"NativeX\"\r\n }\r\n ],\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"eWeek\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-02T20:12:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"How Oracle Is Embracing Cloud-Native Technology to Enable Applications\",\r\n \"url\": \"https://www.eweek.com/cloud/how-oracle-is-embracing-cloud-native-technology-to-enable-applications\",\r\n \"description\": \"Kubernetes is supported by the three major public cloud providers (AWS, Microsoft Azure and Google Cloud Platform) as well other cloud providers, including Oracle and IBM. Quillin said that most customers are committing to multiple clouds and none is ...\",\r\n \"image\": {\r\n \"contentUrl\": null,\r\n \"thumbnail\": {\r\n \"contentUrl\": \"https://www.bing.com/th?id=ON.B478918DF8016E5608DD63B69D1270DC&pid=News\",\r\n \"width\": 560,\r\n \"height\": 300\r\n }\r\n }\r\n },\r\n {\r\n \"about\": null,\r\n \"provider\": [\r\n {\r\n \"_type\": \"Organization\",\r\n \"name\": \"ZDNet\"\r\n }\r\n ],\r\n \"datePublished\": \"2019-01-03T22:23:00Z\",\r\n \"clusteredArticles\": null,\r\n \"mentions\": null,\r\n \"video\": null,\r\n \"category\": \"ScienceAndTechnology\",\r\n \"name\": \"Microsoft Azure: What is it and what can it do for you\",\r\n \"url\": \"https://www.zdnet.com/video/microsoft-azure-everything-you-need-to-know/\",\r\n \"description\": \"Second only to AWS among cloud providers, Microsoft Azure is an ever-expanding set of cloud-based computing services available to businesses, developers, government agencies, and anyone who wants to build an app or run an enterprise without having to ...\",\r\n \"image\": null\r\n }\r\n ]\r\n },\r\n \"RawJson\": \"{\\r\\n \\\"_type\\\": \\\"News\\\",\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/news/search?q=azure+cloud\\\",\\r\\n \\\"totalEstimatedMatches\\\": 1310000,\\r\\n \\\"value\\\": [\\r\\n {\\r\\n \\\"about\\\": [\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\\\",\\r\\n \\\"name\\\": \\\"Windows Azure\\\"\\r\\n },\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/0e95d5e1-1e66-476f-eda0-0bb417a12c37\\\",\\r\\n \\\"name\\\": \\\"Cloud computing\\\"\\r\\n }\\r\\n ],\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"ZDNet\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-03T20:47:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"Microsoft Azure: Everything you need to know about Redmond's cloud service\\\",\\r\\n \\\"url\\\": \\\"https://www.zdnet.com/article/microsoft-azure-everything-you-need-to-know/\\\",\\r\\n \\\"description\\\": \\\"Microsoft Azure is a broad, ever-expanding set of cloud-based computing services that are available to businesses, developers, government agencies, and anyone who wants to build an app or run an enterprise on the internet without having to manage hardware.\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.CB50B48B5DED8E082BA372A35CE05180&pid=News\\\",\\r\\n \\\"width\\\": 570,\\r\\n \\\"height\\\": 322\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": null,\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"SD Times\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-04T19:13:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"Microsoft takes Azure to the next level\\\",\\r\\n \\\"url\\\": \\\"https://sdtimes.com/msft/microsoft-takes-azure-to-the-next-level/\\\",\\r\\n \\\"description\\\": \\\"Microsoft first developed its cloud computing service Azure with a mission to let developers and organizations do more in the cloud. Over the last year, the company has brought the service beyond ...\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.0C7B60231285DD55744FF23806BA65DE&pid=News\\\",\\r\\n \\\"width\\\": 490,\\r\\n \\\"height\\\": 275\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": [\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/9d9c40a9-f255-fc05-ea48-3c7685363661\\\",\\r\\n \\\"name\\\": \\\"Computerworld\\\"\\r\\n },\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\\\",\\r\\n \\\"name\\\": \\\"Windows Azure\\\"\\r\\n }\\r\\n ],\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"Computerworld\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-02T22:18:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"Crash Course in Azure Active Directory\\\",\\r\\n \\\"url\\\": \\\"https://www.computerworld.com/resources/182527/data-management/crash-course-in-azure-active-directory\\\",\\r\\n \\\"description\\\": \\\"Azure AD is Microsoft’s cloud-based directory and identity management service. It combines core directory services, advanced identity protection, and application access management. Azure AD delivers single sign-on (SSO) access to on-premises and cloud ...\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.A94BC8862AFD8A169A0FA650F100C568&pid=News\\\",\\r\\n \\\"width\\\": 300,\\r\\n \\\"height\\\": 248\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": [\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\\\",\\r\\n \\\"name\\\": \\\"Windows Azure\\\"\\r\\n }\\r\\n ],\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"SQL Server Central\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-02T07:11:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"Replicate NetSuite Data to Azure SQL (SSIS in Azure Data Factory)\\\",\\r\\n \\\"url\\\": \\\"http://www.sqlservercentral.com/articles/Integration+Services+(SSIS_/180310/\\\",\\r\\n \\\"description\\\": \\\"Azure Data Factory (ADF) is a scalable, trusted cloud-based solution for building automated data integration solutions with a visual, drag-and-drop UI. Moving on-premises SSIS workloads to Azure can reduce the operational costs of managing infrastructure ...\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.5202B2CFDFFF37B1D89114D2E89420ED&pid=News\\\",\\r\\n \\\"width\\\": 700,\\r\\n \\\"height\\\": 469\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": [\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\\\",\\r\\n \\\"name\\\": \\\"Windows Azure\\\"\\r\\n },\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/e3ddc8df-bbab-630e-7b7c-1321a15631ed\\\",\\r\\n \\\"name\\\": \\\"Microsoft Dynamics\\\"\\r\\n },\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/d30d2940-27f4-1035-3a16-b39e0410a136\\\",\\r\\n \\\"name\\\": \\\"Conditional access\\\"\\r\\n }\\r\\n ],\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"Msdynamicsworld.com\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-04T20:00:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"Microsoft Azure Active Directory Conditional Access and Dynamics 365: Enforce multi-factor authentication\\\",\\r\\n \\\"url\\\": \\\"https://msdynamicsworld.com/story/microsoft-azure-active-directory-conditional-access-and-dynamics-365-enforce-multi-factor\\\",\\r\\n \\\"description\\\": \\\"With Azure Active Directory Conditional Access, you can control how authorized users can access your cloud applications. Multi-factor authentication (MFA) is a method of authentication that requires more than one verification method and adds a second layer ...\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.62786DB28E1EA638E8B46C0A1887B36C&pid=News\\\",\\r\\n \\\"width\\\": 700,\\r\\n \\\"height\\\": 274\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": [\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/cf3abf7d-e379-2693-f765-6da6b9fa9149\\\",\\r\\n \\\"name\\\": \\\"Windows Azure\\\"\\r\\n }\\r\\n ],\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"petri.com\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-03T15:12:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"The Easy Ways to Restore Azure VMs From Backup\\\",\\r\\n \\\"url\\\": \\\"https://www.petri.com/the-easy-ways-to-restore-azure-vms-from-backup\\\",\\r\\n \\\"description\\\": \\\"This is my favorite of the restore options to show to people that are new to Azure because it shows some of the clever things that you can do in an integrated software-defined cloud such as Azure. If you need to restore one or some files from a backup ...\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.C28C18FD4E4B1931BE83425F68F3C813&pid=News\\\",\\r\\n \\\"width\\\": 700,\\r\\n \\\"height\\\": 394\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": null,\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"DatabaseJournal\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-03T13:04:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"Customizing the Default Azure Data Studio Dashboards\\\",\\r\\n \\\"url\\\": \\\"https://www.databasejournal.com/features/mssql/customizing-the-default-azure-data-studio-dashboards.html\\\",\\r\\n \\\"description\\\": \\\"Azure Data Studio is a cross-platform database tool to allow data professionals a single user interface to work with databases on premise and in the cloud. This is a free new tool that is available for Windows, Mac, and Linux users. Azure Data Studio is ...\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.6A5A963AD254B6A57DC46B9375E6ACA9&pid=News\\\",\\r\\n \\\"width\\\": 700,\\r\\n \\\"height\\\": 377\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": [\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/cafb5c69-0d68-2211-85a0-3067c643f408\\\",\\r\\n \\\"name\\\": \\\"Oracle Corporation\\\"\\r\\n },\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/ebf1abd7-9ec4-7875-6a41-a8aaa77bdbb2\\\",\\r\\n \\\"name\\\": \\\"Technology\\\"\\r\\n },\\r\\n {\\r\\n \\\"readLink\\\": \\\"https://api.cognitive.microsoft.com/api/v7/entities/4169c32e-169f-50c1-d8ae-d87df1fca415\\\",\\r\\n \\\"name\\\": \\\"NativeX\\\"\\r\\n }\\r\\n ],\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"eWeek\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-02T20:12:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"How Oracle Is Embracing Cloud-Native Technology to Enable Applications\\\",\\r\\n \\\"url\\\": \\\"https://www.eweek.com/cloud/how-oracle-is-embracing-cloud-native-technology-to-enable-applications\\\",\\r\\n \\\"description\\\": \\\"Kubernetes is supported by the three major public cloud providers (AWS, Microsoft Azure and Google Cloud Platform) as well other cloud providers, including Oracle and IBM. Quillin said that most customers are committing to multiple clouds and none is ...\\\",\\r\\n \\\"image\\\": {\\r\\n \\\"contentUrl\\\": null,\\r\\n \\\"thumbnail\\\": {\\r\\n \\\"contentUrl\\\": \\\"https://www.bing.com/th?id=ON.B478918DF8016E5608DD63B69D1270DC&pid=News\\\",\\r\\n \\\"width\\\": 560,\\r\\n \\\"height\\\": 300\\r\\n }\\r\\n }\\r\\n },\\r\\n {\\r\\n \\\"about\\\": null,\\r\\n \\\"provider\\\": [\\r\\n {\\r\\n \\\"_type\\\": \\\"Organization\\\",\\r\\n \\\"name\\\": \\\"ZDNet\\\"\\r\\n }\\r\\n ],\\r\\n \\\"datePublished\\\": \\\"2019-01-03T22:23:00Z\\\",\\r\\n \\\"clusteredArticles\\\": null,\\r\\n \\\"mentions\\\": null,\\r\\n \\\"video\\\": null,\\r\\n \\\"category\\\": \\\"ScienceAndTechnology\\\",\\r\\n \\\"name\\\": \\\"Microsoft Azure: What is it and what can it do for you\\\",\\r\\n \\\"url\\\": \\\"https://www.zdnet.com/video/microsoft-azure-everything-you-need-to-know/\\\",\\r\\n \\\"description\\\": \\\"Second only to AWS among cloud providers, Microsoft Azure is an ever-expanding set of cloud-based computing services available to businesses, developers, government agencies, and anyone who wants to build an app or run an enterprise without having to ...\\\",\\r\\n \\\"image\\\": null\\r\\n }\\r\\n ]\\r\\n}\",\r\n \"QueryString\": null,\r\n \"Query\": null,\r\n \"Market\": \"en-us\",\r\n \"Freshness\": null\r\n };\r\n}", "title": "" }, { "docid": "4df799000903306786c4f83ef8769fdf", "score": "0.6440985", "text": "function getNews() {\n\n\n document.getElementById(\"searchPage\").style.display = \"none\";\n document.getElementById(\"homepage\").style.display = \"block\";\n\n //load json data:\n function loadJson(url, callBack) {\n let xmlHttpRequest;\n if (window.XMLHttpRequest) {\n xmlHttpRequest = new XMLHttpRequest();\n } else {\n xmlHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');\n }\n xmlHttpRequest.open(\"GET\", url, true);\n xmlHttpRequest.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n\n callBack(this);\n }\n };\n xmlHttpRequest.send();\n }\n\n\n //slide show:\n var slideIndex = 0;\n slideDisplay();\n\n function slideDisplay() {\n let slides = document.getElementsByClassName(\"singleSlide\");\n for (let i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > slides.length) {\n slideIndex = 1\n }\n slides[slideIndex - 1].style.display = \"block\";\n\n let timerId = setTimeout(slideDisplay, 4000); // Change image every 2 seconds\n slides.onmouseover = function () {\n clearTimeout(timerId);\n }\n slides.onmouseout = function () {\n setTimeout(slideDisplay, 4000);\n }\n\n }\n\n\n\n\n //allNews callback function:\n loadJson('/allNews', displayNews);\n var topNews;\n var top_articles;\n\n function displayNews(xmlHttpRequest) {\n topNews = JSON.parse(xmlHttpRequest.responseText);\n top_articles = topNews.articles;\n //console.log(top_articles);\n\n let aTag = document.querySelectorAll(\".aTag\");\n let imageTag = document.querySelectorAll(\".imageTag\");\n\n let h3_tag = document.querySelectorAll(\".h3_tag\");\n let p_tag = document.querySelectorAll(\".p_tag\");\n\n\n for (let i = 0; i < top_articles.length; ++i) {\n let img = top_articles[i].urlToImage;\n let title = top_articles[i].title;\n let desc = top_articles[i].description;\n let url = top_articles[i].url;\n\n aTag[i].href = url;\n imageTag[i].src = img;\n h3_tag[i].innerHTML = title;\n p_tag[i].innerHTML = desc;\n }\n\n }\n\n\n //cnn callback function:\n loadJson('/cnn', displayCnn);\n var cnn;\n var cnn_articles;\n\n function displayCnn(xmlHttpRequest) {\n cnn = JSON.parse(xmlHttpRequest.responseText);\n cnn_articles = cnn.articles;\n //console.log(cnn_articles);\n //get cnn news image, title and description\n let cnn_container = document.getElementById(\"cnn_card\");\n let cnn_card = cnn_container.querySelectorAll(\"div#showCard > .card\"); //cnn_card type: NodeList\n //console.log(cnn_card);\n for (let i = 0; i < cnn_card.length; ++i) {\n let img = cnn_articles[i].urlToImage;\n let title = cnn_articles[i].title;\n let desc = cnn_articles[i].description;\n let url = cnn_articles[i].url;\n\n cnn_card[i].children[0].src = img;\n cnn_card[i].children[1].innerHTML = title;\n cnn_card[i].children[2].innerHTML = desc;\n\n cnn_card[i].onclick = function () {\n window.open(url, \"_blank_\");\n }\n }\n }\n\n //fox callback function:\n loadJson('/fox', displayFox);\n var fox;\n var fox_articles;\n\n function displayFox(xmlHttpRequest) {\n fox = JSON.parse(xmlHttpRequest.responseText);\n fox_articles = fox.articles;\n\n let fox_container = document.getElementById(\"fox_card\");\n let fox_card = fox_container.querySelectorAll(\"div#showCard > .card\"); //cnn_card type: NodeList\n\n for (let i = 0; i < fox_card.length; ++i) {\n let img = fox_articles[i].urlToImage;\n let title = fox_articles[i].title;\n let desc = fox_articles[i].description;\n let url = fox_articles[i].url;\n\n fox_card[i].children[0].src = img;\n fox_card[i].children[1].innerHTML = title;\n fox_card[i].children[2].innerHTML = desc;\n\n fox_card[i].onclick = function () {\n window.open(url, \"_blank_\");\n }\n }\n }\n\n loadJson('/wordcloud', displayCloud);\n\n function displayCloud(xmlHttpRequest) {\n let wordMap = JSON.parse(xmlHttpRequest.responseText);\n let myWords = [];\n for (let i = 0; i < wordMap.length; ++i) {\n let dict = {};\n\n dict['word'] = wordMap[i][0];\n dict['size'] = wordMap[i][1];\n myWords[i] = dict;\n }\n\n var margin = {top: 10, right: 10, bottom: 10, left: 10},\n width = 300 - margin.left - margin.right,\n height = 300 - margin.top - margin.bottom;\n\n\n var svg = d3.select(\"#word_cloud\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var layout = d3.layout.cloud()\n .size([width, height])\n .words(myWords.map(function (d) {\n return {text: d.word, size: d.size};\n }))\n .padding(5) //space between words\n .rotate(function () {\n return ~~(Math.random() * 2) * 90;\n })\n .fontSize(function (d) {\n return d.size;\n }) // font size of words\n .on(\"end\", draw);\n layout.start();\n\n function draw(words) {\n svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + layout.size()[0] / 2 + \",\" + layout.size()[1] / 2 + \")\")\n .selectAll(\"text\")\n .data(words)\n .enter().append(\"text\")\n .style(\"font-size\", function (d) {\n return d.size;\n })\n .style(\"fill\", \"#69b3a2\")\n .attr(\"text-anchor\", \"middle\")\n .style(\"font-family\", \"Impact\")\n .attr(\"transform\", function (d) {\n return \"translate(\" + [d.x, d.y] + \")rotate(\" + d.rotate + \")\";\n })\n .text(function (d) {\n return d.text;\n });\n }\n\n }\n}", "title": "" }, { "docid": "32b83453ec12ff268fc60069e1a5602a", "score": "0.64351463", "text": "function handleResp(news) {\n console.log(news);\n $article.each(function(index) {\n var title = news.articles[index].title;\n var author = news.articles[index].name;\n var description = news.articles[index].description;\n var url = news.articles[index].url;\n var imgUrl = news.articles[index].urlToImage;\n var impressions = 0;\n // var impressions = articles[index].CachedCommentCount;\n\n $(this).find('.articleContent h3').html(title);\n $(this).find('.articleContent h6').html(author);\n $(this).find('.featuredImage img ').attr('src', imgUrl);\n $(this).find('.impressions').html(impressions);\n\n $(this).on('click', function(evt) {\n evt.preventDefault();\n // console.log('article clicked');\n showPopUp(title, description, url);\n });\n });\n }", "title": "" }, { "docid": "23f13572128f16a1608ce56d483b26f4", "score": "0.64290875", "text": "function showNews(data) {\n let articles = document.querySelector('.urls')\n // resource https://www.youtube.com/watch?v=v2tJ3nzXh8I&t=41s\n const newData = `\n <h3><a href=\"${data.url ?? \"\"}\" target=\"_blank\" id=\"webpage\">${data.title ?? \"No Title\"}</a></h3>\n <p id=\"author\">${data.author ?? \"No author\"}</p>\n <img id=\"image\" src=\"${data.urlToImage ?? \"./no_image.jpeg\"}\"/>\n <h4 id=\"desc\">${data.description ?? \"No Description Found\"}</h4>\n <hr/>\n `\n articles.insertAdjacentHTML('beforeend', newData);\n}", "title": "" }, { "docid": "4da9e6d126db103b8a40c31c042f2833", "score": "0.6416916", "text": "async getHackerNewsArticles(params)\n\t{\n\n\t\t// set self reference\n\t\tvar module_ref = this;\n\n\t\t// parse the page count \n\t\tvar pages_to_retrieve = parseInt(params.pages_to_retrieve);\n\t\tif(Number.isSafeInteger(pages_to_retrieve) !== true)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t// set between 1 and 20 pages\n\t\tif(pages_to_retrieve <= 0)\n\t\t\tpages_to_retrieve = 1;\n\t\tif(pages_to_retrieve > 20)\n\t\t\tpages_to_retrieve = 20;\n\t\t\t\n\n\t\t// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\t\t// %%% Launch New Browser Instance %%%%%%%%%%%%%%%%%%%%\n\t\t// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n\t\t// set headless based on passed through parameter\n\t\tvar headless = false;\n\t\tif(params.headless === \"yes\")\n\t\t\theadless = true;\n\n\t\t// create a new browser \n\t\tvar new_browser = await browser.launch\n\t\t({\n\t\t\theadless: headless,\n\t\t\tdefaultViewport:\n\t\t\t{\n\t\t\t\twidth: 1500,\n\t\t\t\theight: 600\n\t\t\t}\n\t\t});\n\t\t\n\t\t// create new page\n\t\tvar new_page = await new_browser.newPage();\t\t\n\n\t\t// page injectables (jquery, utilities, etc)\n\t\tvar injectables = await module_ref.getInjectables(module_ref.injectable_set);\n\t\t\t\t\n\t\t// create CDP client session and clear cookies\n\t\tvar client = await new_page.target().createCDPSession();\n\t\tawait client.send('Network.clearBrowserCookies');\t\n\n\t\t// go to ycombinator\n\t\tawait new_page.goto(\"https://news.ycombinator.com/\");\n\n\t\t\n\t\t// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\t\t// %%% Parse Articles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\t\t// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\t\t\n\t\t// Iterate through pages to retrieve\n\t\tvar articles = {};\n\t\tfor(var idx = 0; idx < pages_to_retrieve; idx++)\n\t\t{\n\n\t\t\t// Wait for the \"More\" link to show up\n\t\t\tawait new_page.waitForSelector(\".morelink\");\n\n\t\t\t// get page contents\n\t\t\tawait new_page.evaluate(injectables);\n\t\t\tvar page_articles = await new_page.evaluate(async function()\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// get article rows\n\t\t\t\tvar article_rows = $(\".athing\");\n\t\t\t\t\n\t\t\t\t// iterate through articles and save them\n\t\t\t\tvar page_articles = {};\n\t\t\t\tfor(var article_idx = 0; article_idx < article_rows.length; article_idx++)\n\t\t\t\t{\n\n\t\t\t\t\t// gather row\n\t\t\t\t\tvar row = article_rows[article_idx];\n\n\t\t\t\t\t// get the next tr in the table using the row index, and the parent tbody.\n\t\t\t\t\tvar next_row = row.parentNode.rows[row.rowIndex + 1];\n\n\t\t\t\t\t// get site rank\n\t\t\t\t\tvar article_site_rank = $(row).find(\".rank\").text();\n\n\t\t\t\t\t// get article parts\n\t\t\t\t\tvar article_title = $(row).find(\".storylink\").text();\n\t\t\t\t\tvar article_link = $(row).find(\".storylink\")[0].href;\n\t\t\t\t\tvar article_score = $(next_row).find(\".score\").text();\n\t\t\t\t\tvar article_username = $(next_row).find(\".hnuser\").text();\n\n\t\t\t\t\t// gather article comments link\n\t\t\t\t\tvar article_comments_link = $(next_row).find(\"a\").filter(function()\n\t\t\t\t\t{\n\n\t\t\t\t\t\t// check for comments or discuss link\n\t\t\t\t\t\tif\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t$(this).text().indexOf(\"comment\") !== -1 ||\n\t\t\t\t\t\t\t$(this).text().indexOf(\"discuss\") !== -1 \n\t\t\t\t\t\t){ \n\t\t\t\t\t\t\treturn true; \n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// skip bad link\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// It's very possible for articles to not have comments, such as in\n\t\t\t\t\t// the case of job postings. For this reason, we look them up in a try/catch\n\t\t\t\t\t// block.\n\t\t\t\t\tvar article_comments_link_href = \"\";\n\t\t\t\t\tvar article_comment_count = 0;\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\n\t\t\t\t\t\t// get comments link as href\n\t\t\t\t\t\tarticle_comments_link_href = article_comments_link[0].href;\n\n\t\t\t\t\t\t// Gather comment count via some string replacements and integer parsing.\n\t\t\t\t\t\tif($(article_comments_link[0]).text().indexOf(\"comment\") !== -1)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t// remove \" comments\" and \" comment\" from the count string.\n\t\t\t\t\t\t\tcomments_text = $(article_comments_link[0]).text();\n\t\t\t\t\t\t\tcomments_text = comments_text.replace(' comments', '');\n\t\t\t\t\t\t\tcomments_text = comments_text.replace(' comment', '');\n\n\t\t\t\t\t\t\t// parse the comment count\n\t\t\t\t\t\t\tarticle_comment_count = parseInt(comments_text);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch(err){}\n\n\t\t\t\t\t// set article based on title\n\t\t\t\t\tpage_articles[article_title] = \n\t\t\t\t\t{\n\t\t\t\t\t\tsite_rank: parseInt(article_site_rank),\n\t\t\t\t\t\ttitle: article_title,\n\t\t\t\t\t\tlink: article_link,\n\t\t\t\t\t\tscore: parseInt(article_score),\n\t\t\t\t\t\tusername: article_username,\n\t\t\t\t\t\tcomments_link: article_comments_link_href,\n\t\t\t\t\t\tcomment_count: article_comment_count,\n\t\t\t\t\t\tlocal_timestamp: Date.now()\n\t\t\t\t\t};\n\n\t\t\t\t}\n\n\t\t\t\t// return the found page articles\n\t\t\t\treturn page_articles;\n\n\t\t\t});\n\n\n\t\t\t// assign found articles\n\t\t\tarticles = Object.assign(articles, page_articles);\n\n\t\t\t// skip moving to next page if we don't have to\n\t\t\tif(idx+1 >= pages_to_retrieve)\n\t\t\t\tbreak;\n\t\t\n\t\t\t// sleep raondom time\n\t\t\tawait custom_utils.asyncSleepRandomMiliseconds(1500, 2500);\n\t\t\t\n\t\t\t// move to the next page using the \"More\" link.\n\t\t\tawait new_page.evaluate(async function()\n\t\t\t{\t\t\n\n\t\t\t\t// gather the \"More\" link and navigate to the next page\n\t\t\t\tvar more_link = $(\".morelink\")[0].href;\t\n\t\t\t\t\n\t\t\t\t// move locations\n\t\t\t\tlocation.href = more_link;\n\n\t\t\t});\n\n\t\t\t// wati for navigation\n\t\t\tawait new_page.waitForNavigation();\t\t\n\t\t\n\t\t}\n\n\t\t// ensure the output directory exists\n\t\tvar output_directory_exists = false;\n\t\ttry\n\t\t{\n\t\t\toutput_directory_exists = fs.lstatSync(params.save_directory).isDirectory();\n\t\t} catch(err){}\n\n\t\t// gather file path\n\t\tvar file_path = \"\";\n\t\tif(output_directory_exists === true)\n\t\t\tfile_path = path.join(params.save_directory, \"hacker_news__\"+Date.now()+\".json\");\n\n\t\t// hacker news articles\n\t\tvar hacker_news_articles = \n\t\t{\n\t\t\tpages_retireved: pages_to_retrieve,\n\t\t\tsaved_in: file_path,\n\t\t\ttotal_articles: Object.keys(articles).length,\n\t\t\tfinished_timestamp: Date.now(),\n\t\t\tarticles: articles\n\t\t};\n\n\t\t// write file if we have one\n\t\tif(file_path !== \"\")\n\t\t\tfs.writeFileSync(file_path, JSON.stringify(hacker_news_articles, 1, 1));\n\n\t\t// close the browser before returning\n\t\tawait new_browser.close();\n\t\treturn hacker_news_articles;\n\n\t}", "title": "" }, { "docid": "7b62b2d7d020a2794005cfabcf6e2b37", "score": "0.64092183", "text": "function newsFix(data){\n\t//create a blank object\n\tlet news = null\n\tlet en = false;\n\t//check if there is an english translation or no defined language to set the news as english\n\tif (typeof data.translations.en !== 'undefined'){\n\t\ten = true;\n\t\tdata.message = data.translations.en;\n\t}\n\t//Copy over the news article information that we need in the format that we need\n\tnews = {\n\t\tmessage: data.message,\n\t\tlink: data.link,\n\t\tupdate: data.update,\n\t\tprimeAccess: data.primeAccess,\n\t\tstream: data.stream,\n\t\ten: en\n\t}\n\treturn news;\n}", "title": "" }, { "docid": "03b4dd58c89a99eb73f5caf1ba55f603", "score": "0.64048314", "text": "fetchNews(callback) {\n let newsType = this.data.selected \n wx.request({\n url: 'https://test-miniprogram.com/api/news/list',\n data: {\n type: newsType\n },\n success: res => {\n let result = res.data.result\n for (let i = 0; i < result.length; i++) {\n result[i].date = utils.getDate(result[i].date)\n }\n let newsList = {\n headline: result.slice(0, 1),\n news: result.slice(1)\n }\n // Set newsList\n this.setData({\n newsList: newsList,\n })\n // Store the newest news list after fetching.\n wx.setStorage({\n key: newsType,\n data: newsList\n })\n },\n complete: () => {\n typeof callback === 'function' && callback()\n }\n })\n }", "title": "" }, { "docid": "9f98c8646376eb7fa8eb33b61a6913d8", "score": "0.6396732", "text": "function getAllNews(req, res, next) {\n newsController.getAllNews (req, next)\n .then(function(newsList){\n //if exists, return data in json format\n if (newsList) {\n res.status(HTTPStatus.OK);\n res.json(newsList);\n } else {\n res.status(HTTPStatus.NOT_FOUND);\n res.json({\n message: messageConfig.news.notFoundNews\n });\n }\n })\n .catch(function(err){\n return next(err);\n });\n }", "title": "" }, { "docid": "184c8d974fddae6947472dbabc213fd2", "score": "0.6388132", "text": "function initializeNews() { \n jQuery.ajax({\n url: \"/app/news\",\n success: function (data, status, jqXHR) {\n var news = JSON.parse(data);\n const sources = Object.keys(news);\n showHeadlines(news);\n },\n error: function (jqXHR, status) {\n alert(\"error\");\n }\n });\n }", "title": "" }, { "docid": "218eae84dbcaae4b29a9923b8eeda831", "score": "0.6387938", "text": "function getAllNews(req, res){\n\n\tNews.find({}).populate({ path: 'author' }). exec(function (err, news) {\n\t\t if (err) return handleError(err);\n\t\t res.send(news);\n })\n\n}", "title": "" }, { "docid": "5ae01801997cfd17b250e3f11f541b67", "score": "0.63816196", "text": "function getNews() {\n fetch(\n \"https://newscatcher.p.rapidapi.com/v1/search_free?q=\" +\n categoryValue +\n \"&lang=en&media=True\",\n {\n method: \"GET\",\n headers: {\n\n // three api keys are available incase call limit is exceeded\n // \"x-rapidapi-key\": \"3a9751746bmsh9d6faa02ca1deccp1c1053jsnbe743b8f565e\",\n // \"x-rapidapi-key\": \"3d1d938386mshb2c35f5f3d5524ep18467ejsn3601f760f204\",\n \"x-rapidapi-key\": \"4e65fa5d1fmshf86108e25761865p159b69jsn4aa46650c5be\",\n \"x-rapidapi-host\": \"newscatcher.p.rapidapi.com\",\n },\n }\n )\n// presents data from API call to page\n .then((response) => response.json())\n .then((response) => {\n console.log(response);\n \n topFlashHeadline.innerHTML = response.articles[index].title;\n topFlashSource.innerHTML = response.articles[index].clean_url;\n topFlashAbstract.innerHTML = response.articles[index].summary;\n\n // presents image from api response, if image is present. otherwise, a \"now image\" icon appears \n if (response.articles[index].media) {\n topFlashPhoto.setAttribute(\"src\", response.articles[index].media);\n }\n\n // Adds click function to card to open story in new window \n topFlash.addEventListener(\"click\", function(){\n window.open(response.articles[index].link, \"_blank\")\n })\n $(\".card\").attr(\"style\", \"border: #4a4a4a solid .25em; width: border-box; cursor: pointer;\");\n $(\"select option[value='\" + categoryValue + \"']\").attr('selected', 'selected');\n })\n .catch((err) => {\n console.error(err);\n });\n\n // presents stock widget when news category is business, economics or finance\n var stockWidgetStatus = document.getElementById(\"tradingWidget\")\n if (categoryValue === \"business\" || categoryValue === \"economics\" || categoryValue ===\"finance\")\n {stockWidgetStatus.style.display = \"block\"} \n else {stockWidgetStatus.style.display = \"none\"};\n\n // presents weather widget when news category is travel\n var weatherStatus = document.getElementById(\"weatherAPI\")\n if (categoryValue === \"travel\")\n {weatherStatus.style.display = \"block\"} \n else {weatherStatus.style.display = \"none\"};\n\n // presents ISS map when category is science or technology\n var issStatus = document.getElementById(\"issMapControl\")\n if (categoryValue === \"science\" || categoryValue === \"technology\")\n {issStatus.style.display = \"block\"} \n else {issStatus.style.display = \"none\"};\n}", "title": "" }, { "docid": "0911b33a004787141f4eaedee13e7865", "score": "0.63724273", "text": "function openNews(lien, p) {\n\t\t\tvar resume = p.parent().parent();\n\t\t\tvar div=resume.parent();\n\n\n // Custom UTT\n //resume.hide();\n\t\t\tresume.children(\".article-block\").children(\"a\").hide();\n\n div.children(\".contenuArticle:first\").each(function(){\n\t\t\t\tif ($(this).hasClass(\"articleCharge\")) {\n\t\t\t\t\t$(this).show();\n\t\t\t\t\tdiv.children(\".replierArticle:first\").show();\n\t\t\t\t\tscrollNews($(this));\n\t\t\t\t} else {\n\t\t\t\t\t$(this).addClass(\"wait\");\n\t\t\t\t\t$(this).show();\n\t\t\t\t\t$(this).load(lien.toString()+\" #container\", function() {\n\t\t\t\t\t\t$(this).removeClass(\"wait\");\n\t\t\t\t\t\t$(this).addClass(\"articleCharge\");\n\t\t\t\t\t\t$(this).find(\".meta, .postmeta, #footer, #header\").remove();\n\t\t\t\t\t\t$(this).find(\".entry\").children(\"h2:first, br:first\").remove();\n\t\t\t\t\t\t$(this).find(\".entry\").children(\"div\").children(\"div\").children(\"p\").removeAttr(\"style\");\n\t\t\t\t\t\tdiv.children(\".replierArticle:first\").show();\n\t\t\t\t\t\tscrollNews($(this));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "1724fa22878931f22f0cca7a8970a3d5", "score": "0.63539517", "text": "function onGetResponse(err, res) {\n renderNews(res);\n}", "title": "" }, { "docid": "c7639b0cbf6879f74c61a323cc2a3286", "score": "0.63238066", "text": "function displayUsaTodayNews(url) {\n $.get(url, function(results) {\n usaTodayResults = \"\";\n results.articles.forEach(function (usaArticles, i){\n usaTodayExpanded.push(usaArticles.title);\n usaTodayResults +=\n ` <article key=\"${i}\" feed=\"usaToday\" class=\"article\">\n <section class=\"featuredImage\">\n <img id=\"image\" src=\"${usaArticles.urlToImage}\" alt=\"\" />\n </section>\n <section class=\"articleContent\">\n <a href=\"${usaArticles.url}\"><h3>${usaArticles.title}</h3></a>\n <h6>${usaArticles.description}</h6>\n </section>\n <section class=\"impressions\">\n Score N/A\n </section>\n <div class=\"clearfix\"></div>\n </article>\n `\n });\n $('#main').append(usaTodayResults);\n $(\"#NewsFeedType\").append(\"<span>USA Today News Feed </span>\");\n });\n }", "title": "" }, { "docid": "ed8c31399d4f4af2dd8bbf16d7a4eeab", "score": "0.63179094", "text": "function _getAllNews(){\n return new Promise((resolve, reject) => {\n pool.connect()\n .then((client) => {\n client.query(queryStringSelectAllNews)\n .then((result) => {\n resolve({ 'statusCode': 200, 'values': result.rows });\n })\n .catch((error) => {\n error.statusCode = 500;\n error.message = global.errorMessages.ERROR_DATABASE_QUERY_FAILURE;\n reject(error);\n })\n .finally(() => {\n client.release();\n });\n })\n .catch((error) => {\n error.statusCode = 500;\n error.message = global.errorMessages.ERROR_DATABASE_CONNECTION_FAILURE;\n reject(error);\n })\n });\n}", "title": "" }, { "docid": "3942af882f914056d572eec73adb9253", "score": "0.62983215", "text": "function getespnnews(i) {\n\t\tvar promise = $.ajax({\n\t\t\t//url: 'http://api.espn.com/v1/sports/football/nfl/news/headlines/top/?limit=5&offset='+i+'&apikey=4jwg9fbsuwv2ajmuvym22jmr',\n\t\t\t url: 'http://localhost:4567/Latest',\n\t\t\tdataType: 'json'\n\t\t}).promise();\n\t\n\t\treturn Rx.Observable.fromPromise(promise);\n\t}", "title": "" }, { "docid": "48f2425668a5d5aa06bd1a9a87d6646d", "score": "0.6293004", "text": "async showPosts() {\n this.posts = await this.news.get(); //through news we get the data \n console.log(this.posts);\n }", "title": "" }, { "docid": "3b03cafed7a6ba10e6d9099bb8bd9340", "score": "0.6286359", "text": "function addNews(news) {\n const boardNews = document.querySelector('.board__news');\n\n // include the first five items of the input array\n // ! include the theme color as a solid border\n boardNews.innerHTML = news.slice(0, 5).map(({ color, date, title }) => `\n <a class=\"news--item\" href=\"#\" style=\"border-left: 4px solid ${color}\">\n <p class=\"date\">\n ${date.toDateString()}\n </p>\n <p class=\"title\">\n ${title}\n </p>\n </a>\n `).join('');\n}", "title": "" }, { "docid": "43a41ebbeec322541e176c4d6f62a2c3", "score": "0.6281774", "text": "function getNewsHeadlines(ws){\n request('https://newsapi.org/v1/articles?source=bbc-news&sortBy=top&apiKey=08962d9950894e9ab44c424a0690d2aa', function (error, response, body) {\n ws.send(JSON.stringify({\"action\":\"news\", \"articles\":JSON.parse(body).articles}));\n });\n}", "title": "" }, { "docid": "07dd772a5e28c331c77188ce1b132e37", "score": "0.6277229", "text": "function loadNewsList() {\n $.get( \"http://localhost:3004/newsList/\", function() {\n })\n .done(function(data) {\n\t\t\t\tmaxNewsId = data.length - 1;\n for ( var i = 0; i < data.length; i++ ) {\n\t\t\t\t\trenderNewsListItem(data[i]);\n\t\t\t\t}\n })\n .fail(function() {\n alert( \"Fail to load data\" );\n });\n\t}", "title": "" }, { "docid": "091cbe787f8d658bbc27eb98875df384", "score": "0.6266118", "text": "function sirvela2(){\r\n\r\n myApp.onPageInit('index-2', function (page) {\r\n\r\n $.getJSON( 'https://newsapi.org/v2/top-headlines?sources=al-jazeera-english&apiKey=64a17d3dd220407aa5addbb4ac869a4c', function( data ) {\r\n\r\n\r\n var arrayOfData = data.articles;\r\n\r\n\r\n\r\n\r\n while(document.getElementById('news2').childElementCount === 0){\r\n for(var i = 0; i <= arrayOfData.length; i += 1) {\r\n var div = document.createElement(\"div\");\r\n div.className = \"content-block-inner\";\r\n var h1 = document.createElement(\"h3\");\r\n h1.className = \"acomodo\";\r\n var p = document.createElement(\"p\");\r\n p.className = \"acomodo\";\r\n var imagen = document.createElement(\"IMG\");\r\n\r\n\r\n imagen.setAttribute(\"width\",\"300\");\r\n imagen.setAttribute(\"height\",\"200\");\r\n imagen.className = \"imageAcomodo\";\r\n var p2 = document.createElement(\"p\");\r\n var br = document.createElement(\"br\");\r\n\r\n h1.innerHTML = arrayOfData[i].title;\r\n p.innerHTML = arrayOfData[i].description;\r\n // if a imagen is coming null is better not to be displayed\r\n if(arrayOfData[i].urlToImage === null) {\r\n console.log('image no available');\r\n imagen.setAttribute(\"style\",\"display : none\");\r\n }\r\n else\r\n {\r\n imagen.setAttribute(\"src\", arrayOfData[i].urlToImage);\r\n }\r\n\r\n p2.innerHTML = arrayOfData[i].publishedAt;\r\n // saving data to an array\r\n\r\n\r\n if(document.getElementById('jason2').childElementCount < arrayOfData.length) {\r\n var titlesJ = JSON.stringify(arrayOfData[i].title);\r\n var descriptionJ = JSON.stringify(arrayOfData[i].description);\r\n var urlImageJ = JSON.stringify(arrayOfData[i].urlToImage);\r\n var publishedJ = JSON.stringify(arrayOfData[i].publishedAt);\r\n\r\n var divJason = document.createElement('div');\r\n divJason.innerHTML = '<br>' + '{ title:' + titlesJ + ',' +\r\n '\\ndescription:' + descriptionJ + ',\\n' +\r\n 'urlToImage:' + urlImageJ + ',\\n' +\r\n 'publishedAt:' + publishedJ + '}' + '<br>';\r\n\r\n\r\n document.getElementById('jason2').appendChild(divJason);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n document.getElementById('news2').appendChild(div);\r\n document.getElementById('news2').appendChild(h1);\r\n document.getElementById('news2').appendChild(p);\r\n document.getElementById('news2').appendChild(br);\r\n document.getElementById('news2').appendChild(imagen);\r\n document.getElementById('news2').appendChild(br);\r\n document.getElementById('news2').appendChild(p2);\r\n document.getElementById('news2').appendChild(br);\r\n\r\n ////////////// botton for source Json\r\n\r\n var boton = document.createElement('a');\r\n boton.className =\" open-panel button button-fill\";\r\n boton.innerHTML = \"JSON source\";\r\n boton.style.width ='120px';\r\n boton.style.height ='50px';\r\n\r\n\r\n document.getElementById('news2').appendChild(boton);\r\n\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n });\r\n\r\n\r\n document.getElementById('jason2').style.display =\"block\";\r\n document.getElementById('jason').style.display =\"none\";\r\n document.getElementById('jason3').style.display =\"none\";\r\n document.getElementById('jason4').style.display =\"none\";\r\n document.getElementById('jason5').style.display =\"none\";\r\n document.getElementById('jason6').style.display =\"none\";\r\n document.getElementById('jason7').style.display =\"none\";\r\n document.getElementById('jason8').style.display =\"none\";\r\n document.getElementById('jason9').style.display =\"none\";\r\n\r\n\r\n document.getElementById('news2').style.display = \"block\";\r\n document.getElementById('news1').style.display = \"none\";\r\n document.getElementById('news3').style.display = \"none\";\r\n document.getElementById('sport1').style.display = \"none\";\r\n document.getElementById('sport2').style.display = \"none\";\r\n document.getElementById('sport3').style.display = \"none\";\r\n document.getElementById('finance1').style.display = \"none\";\r\n document.getElementById('finance2').style.display = \"none\";\r\n document.getElementById('economy').style.display = \"none\";\r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "79172e74a9e3827cfe9a6965ae2eb948", "score": "0.6258481", "text": "function getNews(crypto_currency, no_articles, callback) {\n var options = { method: 'GET',\n url: 'https://api.cognitive.microsoft.com/bing/v5.0/news/search',\n qs: { q: crypto_currency },\n headers: { 'ocp-apim-subscription-key': '86984344e78141338f75c3af1d558485' }};\n\n request(options, function (error, response, body) {\n if (error) throw new Error(error);\n //console.log(body);\n body = JSON.parse(body);\n var filtered_articles=[];\n var count = 0;\n _.each(_.first(body.value, no_articles), function(article) {\n count++;\n var article_object = { 'title': article.name,\n 'url': article.url,\n 'image': { 'url': article.image.thumbnail.contentUrl,\n 'width': article.image.thumbnail.width,\n 'height': article.image.thumbnail.height },\n 'description': article.description,\n 'source': article.provider[0].name };\n //console.log(article_object);\n filtered_articles.push(article_object);\n if(count === no_articles) {\n callback(filtered_articles);\n }\n });\n });\n}", "title": "" }, { "docid": "7cf72a54888693c2b3cad10ed0713526", "score": "0.62580293", "text": "function renderNews() {\n var newsFeed = JSON.parse(localStorage.getItem('scs_news_feed'));\n renderNewsFeed(newsFeed);\n }", "title": "" }, { "docid": "7dfd14e19772e6e72ac7c23a72bfcf52", "score": "0.6255469", "text": "function changeNewsInfo() {\n // Displays title of News\n document.querySelector(`#newsstory0`).innerHTML = news.results[0].title.link(news.results[0].url)\n document.querySelector(`#newsstory1`).innerHTML = news.results[1].title.link(news.results[1].url)\n document.querySelector(`#newsstory2`).innerHTML = news.results[2].title.link(news.results[2].url)\n}", "title": "" }, { "docid": "af4323a4a08e5e6281c002f474166eea", "score": "0.62515646", "text": "async getTopNewsApi() {\n var response = await this.newsDao.getTopNewsApi();\n const data = await response.json();\n return data;\n }", "title": "" }, { "docid": "665101cd9b64e7923158181a565d625b", "score": "0.6248733", "text": "function topNewsId() {\n $.ajax({\n url: api.urlNews + \"top-headlines?country=id&apiKey=\" + api.keyNews1,\n success: function (res) {\n if ((res.status = \"ok\")) {\n let w = res.articles;\n\n $(\"#top-news-id-3\").append(\n `\n <div class=\"col-sm-8 my-auto\">\n <div class=\"card shadow-sm\">\n \n <img class=\"w-100\" src=\"` +\n w[w.length - 3].urlToImage +\n `\" />\n <div class=\"card-img-overlay d-flex overlay-dark\">\n <div class=\"align-self-center mx-auto text-light\">\n <a href=\"` +\n w[w.length - 3].url +\n `\" target=\"_blank\" class=\"h2 font-weight-bolder text-light\">` +\n w[w.length - 3].title +\n `\n </a>\n <br class=\"mb-3\" />\n <a class=\"mt-5\">\n <i class=\"fas fa-user mr-2\"></i> <span >` +\n w[w.length - 3].author +\n `</span> -\n <span ><i class=\"far fa-clock mr-2\"></i>` +\n timeDateFormat(w[w.length - 3].publishedAt).dt +\n `</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-sm-4 my-auto\">\n <div class=\"card mt-2 shadow-sm\">\n <img class=\"w-100\" src=\"` +\n w[w.length - 2].urlToImage +\n `\" />\n <div class=\"card-img-overlay d-flex overlay-dark\">\n <div class=\"align-self-center my-auto mx-auto text-light\">\n <a href=\"` +\n w[w.length - 2].url +\n `\" target=\"_blank\" class=\"h5 font-weight-bolder text-light\"\n id=\"text-title-corona\">` +\n w[w.length - 2].title +\n `</a>\n <br />\n <a class=\"mt-3\">\n <i class=\"fas fa-user mr-2\"></i> <span>` +\n w[w.length - 2].author +\n `</span> -\n <span id=\"time-edit-corona-news\"><i class=\"far fa-clock mr-2\"></i>` +\n timeDateFormat(w[w.length - 2].publishedAt).dt +\n `</span>\n </a>\n </div>\n </div>\n </div>\n <div class=\"card mt-2 shadow-sm\">\n <img class=\"w-100\" src=\"` +\n w[w.length - 1].urlToImage +\n `\" />\n <div class=\"card-img-overlay d-flex overlay-dark\">\n <div class=\"align-self-center mx-auto text-light\">\n <a href=\"` +\n w[w.length - 1].url +\n `\" target=\"_blank\" class=\"h5 font-weight-bolder text-light\"\n id=\"text-title-corona\">` +\n w[w.length - 1].title +\n `</a>\n <br />\n <a class=\"mt-3\">\n <i class=\"fas fa-user mr-2\"></i> <span id=\"author-corona\">` +\n w[w.length - 1].author +\n `</span> -\n <span id=\"time-edit-corona-news\"><i class=\"far fa-clock mr-2\"></i>` +\n timeDateFormat(w[w.length - 1].publishedAt).dt +\n `</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n `\n );\n\n $.each(w, function (i, data) {\n if (i < 12) {\n $(\"#berita-indonesia\").append(\n `\n <div class=\"col-md-4 mt-5 \">\n <div class=\"card shadow\">\n <div class=\"inner\">\n <img class=\"card-img-top\"\n src=\"` +\n data.urlToImage +\n `\"\n alt=\"Card image cap\" />\n </div>\n <div class=\"card-body\">\n <a class=\"card-title h5\" target=\"_blank\" href=\"` +\n data.url +\n `\">` +\n data.title +\n `</a>\n <p class=\"card-text\">\n ` +\n data.content.substring(0, 150) +\n `...\n </p>\n <p class=\"card-text\">\n <small class=\"text-muted mr-2\">\n <i class=\"far fa-calendar-check\"></i> \n ` +\n timeDateFormat(data.publishedAt).dt +\n `\n </small>\n <small class=\"text-muted\">\n <i class=\"far fa-clock\"></i>\n ` +\n timeDateFormat(data.publishedAt).tm +\n `</small>\n\n </p>\n </div>\n </div>\n </div>\n `\n );\n\n // Little Top News\n $(\"#top-news-nasional\").after(\n `\n <div class=\"row mt-2 ml-1 border-bottom\">\n <div class=\"col-md-4 my-auto\">\n <img class=\"card-img-top image-carousel\"\n src=\"` +\n data.urlToImage +\n `\"\n alt=\"Card image cap\">\n </div>\n <div class=\"col-md-8 my-auto\">\n <a target=\"_blank\" class=\"card-title text-dark\" href=\"` +\n data.link +\n `\">` +\n data.title +\n `</a>\n <br />\n <small class=\"text-muted\">\n <i class=\"far fa-clock mr-1\"></i>\n 05 Juli 2020\n </small>\n </div>\n </div>\n `\n );\n }\n\n if (i > 12) {\n return false;\n }\n });\n }\n },\n });\n}", "title": "" }, { "docid": "8953ebb3c2872c057664d996dc5ccde2", "score": "0.62250704", "text": "setNewsList(result) {\n let newsList = []\n let headNewsTitle = result[0].title\n let headNewsImage = result[0].firstImage\n let headNewsTimeStamp = result[0].date.slice(11, 16)\n let headNewsSource = result[0].source\n let headNewsID = result[0].id\n if (headNewsSource == '') {\n headNewsSource = \"未知来源\"\n }\n if (headNewsImage == '') {\n headNewsImage = '/images/default.png'\n }\n for (let i = 1; i < result.length; i += 1) {\n let news = result[i]\n if (news.source == '') {\n news.source = \"未知来源\"\n }\n if (news.firstImage == '') {\n news.firstImage = '/images/default.png'\n }\n newsList.push({\n title: news.title,\n timeStamp: news.date.slice(11, 16),\n source: news.source,\n imageURL: news.firstImage,\n id: news.id\n })\n }\n this.setData({\n headNewsTitle,\n headNewsImage,\n headNewsTimeStamp,\n headNewsSource,\n headNewsID,\n newsList: newsList\n })\n }", "title": "" }, { "docid": "1b614be9efa57e65295143cc9e9e13f7", "score": "0.6223477", "text": "function loadNewsImplementation(url){\r\n\tvar news_template_big = \"<h3><a href='#newsid=news_id' class='show_detail' newsid='news_id'>news_title</a></h3>\" +\r\n\t\t\t\t\t\t\t\"<div id='news_id'>img_slide_show</div>\" +\r\n\t\t\t\t\t\t\t\"<p>news_shortsummary <br /><a href='#newsid=news_id' class='show_detail' newsid='news_id'>more information</a></p>\";\r\n\tvar news_template_small = \"<h6><a href='#newsid=news_id' class='show_detail' newsid='news_id'>news_title</a></h6>\" +\r\n\t\t\t\t\t\t\t\"<div id='news_id'>img_slide_show</div>\" +\r\n\t\t\t\t\t\t\t\"<p class='p-small'>news_shortsummary <br /><a href='#newsid=news_id' class='show_detail' newsid='news_id'>more information</a></p>\";\r\n\t\r\n\t$.ajax({\r\n\t type: \"GET\",\r\n\t url: url,\r\n\t dataType: \"json\",\r\n\t success: function (data) {\r\n\t \t$(\"#wait\").html(\"\");\r\n\t \tdata.sort(function(a,b){ return parseInt(b.yesterdaysRelevance*100) - parseInt(a.yesterdaysRelevance*100);});\r\n\t \tvar append_str = \"\";\r\n\t \tvar counter = 0;\r\n\t \tvar subcounter = 0;\r\n\t \tvar news_rows = \"\";\r\n\t \t$.each(data,function(i,news){\t \t\t\r\n \t\t\tfound = false;\r\n \t\t\tappend_str = (counter == 0 ) ? news_template_big : news_template_small;\r\n \t\t\tappend_str = append_str.replace(/news_id/g, news.id);\r\n\t\t\t\tappend_str = append_str.replace(/news_title/g,news.pageTitle);\r\n\t\t\t\tappend_str = append_str.replace(/img_slide_show/g,createImageSlideshow(news.id,counter,news.imageUrlList));\t\t\t\t\r\n\t\t\t\tappend_str = append_str.replace(/news_shortsummary/g,news.shortNews);\r\n\r\n \t\t\tif(counter == 0 && (found == false)){\r\n \t\t\t\t$(\"#news_1\").html(append_str);\r\n\t \t\t\tcounter += 1;\r\n\t \t\t\tfound = true;\r\n \t\t\t}\r\n \t\t\tif(counter==1 && (found == false)){\t\t\t\t\t\t\r\n \t\t\t\t$(\"#news_2\").html(append_str);\r\n\t \t\t\tcounter += 1;\r\n\t \t\t\tfound = true;\r\n \t\t\t}\r\n \t\t\tif(counter==2 && (found == false)){\r\n \t\t\t\t$(\"#news_3\").html(append_str);\r\n\t \t\t\tcounter += 1;\r\n\t \t\t\tfound = true;\r\n \t\t\t}\r\n \t\t\tif(counter>2 && (found == false) && (subcounter==0)){ // first news item in news row\r\n \t\t\t\tnews_rows += \"<div class='row-fluid'><div class='span3'>\" + append_str +\"</div>\";\r\n \t\t\t\tsubcounter += 1;\r\n\t \t\t\tcounter += 1;\r\n\t \t\t\tfound = true;\r\n\t\t\t\t}\r\n \t\t\tif(counter>2 && (found == false) && (subcounter==1)){ // second news item in news row\r\n \t\t\t\tnews_rows += \"<div class='span3'>\" + append_str +\"</div>\";\r\n \t\t\t\tsubcounter += 1;\r\n\t \t\t\tcounter += 1;\r\n\t \t\t\tfound = true;\r\n\t\t\t\t}\t\r\n \t\t\tif(counter>2 && (found == false) && (subcounter==2)){ // third news item in news row\r\n \t\t\t\tnews_rows += \"<div class='span3'>\" + append_str + \"</div></div>\";\r\n \t\t\t\tsubcounter = 0; \r\n\t \t\t\tcounter += 1;\r\n\t \t\t\tfound = true;\r\n\t\t\t\t}\r\n\t \t}); // close for-each loop\r\n\t \tif(subcounter != 0){\r\n\t \t\tnews_rows += \"</div>\";\t \t\t\r\n\t \t}\r\n\t \t$(\"#row2\").append(news_rows);\r\n\t \t$('html,body').scrollTop(0);\r\n\t },\r\n\t error: function(){\r\n\t \tloadDoc(\"error.html\");\r\n\t } \r\n\t});\r\n}", "title": "" }, { "docid": "90dfdff0e2f107e998a6037d07d02f75", "score": "0.62159246", "text": "function WGNews(newsFull){\n\t//Set up array to put currently active news ID's into\n\tlet news = [];\n\t//loop through the full list of currently active news\n\tfor(let i = 0; i < newsFull.length; i++){\n\t\t//select the news and trim the data to needs\n\t\tlet newsNode = newsFull[i];\n\t\tlet id = newsNode.id;\n\t\tnewsNode = newsFix(newsNode);\n\t\t//check if the id matches one that has already been listed\n\t\tif(wGetLog.news.indexOf(id) === -1){\n\t\t\t//check if the news is an english news segment\n\t\t\tif (newsNode.en){\n\t\t\t\t//Identify if it is an Update or Prime Access news to link everyone\n\t\t\t\tif(newsNode.update == true || newsNode.primeAccess == true){\n\t\t\t\t\tanonChan.send(`${getRole(\"Updates\")} ${newsNode.message} `\n\t\t\t\t\t\t+ `\\nFourm Link: ${newsNode.link}`);\n\t\t\t\t//otherwise just notify the news channel\t\n\t\t\t\t}else{\n\t\t\t\t\tnoteChan.send(`${getRole(\"News\")} ${newsNode.message} `\n\t\t\t\t\t\t+ `\\nFourm Link: ${newsNode.link}`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//add the id to the active list so we don't repost any news Items\n\t\tnews.push(id);\n\t}\n\t//update the list of active news articles to be stored\n\twGetLog.news = news.slice();\t\n}", "title": "" }, { "docid": "5343682471eca28287644ed01493b457", "score": "0.6215752", "text": "async function getTickerNews(ticker) {\n const getAllNews = async() => {\n try {\n return await axios.get('https://stocknewsapi.com/api/v1?tickers=' + ticker + '&items=5&token=qq391fyosu6x7pcsnkfzbd5ytjgxuz2ibpndsr5p');\n } catch (error) {\n console.error(error);\n return null;\n }\n }\n let news = await getAllNews();\n \n return \"This week's top stories on \" + ticker + \"\\n\\n\" + news.data.data.map(entry => {\n \t return \"Title: \" + entry.title + \"\\nLink: \" + entry.news_url + \"\\nSentiment: \" + entry.sentiment}).join(\"\\n\\n\");\n }", "title": "" }, { "docid": "b15d79575a884d9c1a7e540fba46af19", "score": "0.619587", "text": "function alimenterNews() {\n\t$('#numeroPage').val($.isNumeric($('#numeroPage').val())? $('#numeroPage').val():1);\n\tvar params = 'numeroPage='+$('#numeroPage').val();\n\t$.ajax({\n\t\turl: \"index.php?domaine=news&service=getliste\",\n\t\tdata: params,\n\t\tdataType: 'json',\n\t\tsuccess : function(resultat, statut, erreur){\n\t\t\ttab = document.getElementById('tableauResultat');\n\t\t\t$('tr[typetr=news]').remove();\n\n\t\t\tvar total = resultat[0].nbLineTotal;\n\t\t\tvar nbpage = Math.ceil(total/resultat[0].nbLine);\n\n\n\t\t\t$('#numeroPage').val(resultat[0].page);\n\t\t\t$('#rch_page').val(resultat[0].page);\n\t\t\t$('#max_page').val(resultat[0].totalPage);\n\t\n\t\t\tvar nb=resultat[0].nbLine;\n\t\t\tvar tabJson = resultat[0].tabResult;\n\t\t\tvar i=0;\n\t\t\tfor(i=0; i<nb; i++) {\n\t\t\t\tvar row = $('<tr typetr=\"news\"/>');\n\t\t\t\trow.append($('<td/>').text(tabJson[i].titre));\n\t\t\t\t\n\t\t\t\trow.append($('<td class=\"text-center\"/>').append('<a href=\"#\" onclick=\"editernews(\\''+ tabJson[i].newsid +'\\')\"><span class=\"glyphicon glyphicon-pencil\"/></a>'));\n\n\t\t\t\t$(\"#tbodyResultat\").append(row);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "b7b26c692650a4561602ba74017d1248", "score": "0.61930305", "text": "function fetchHackerNewsAPI() {\n\n\tconsole.log(\"Request to Hacker News API started\");\n\n\tconst topics = ['javascript', 'redux+react', 'perl', 'python', 'ruby', 'angular'];\n\n\ttopics.forEach(function(topic){\n\t\tconst url = `https://hn.algolia.com/api/v1/search_by_date?query=${topic}&hitsPerPage=300&tags=story`\n\t\tconst results = [];\n\t\trequest(url, function(error, response, body) {\n\t\t\tif(error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\t\n\t\t\tconst data = JSON.parse(body);\n\t\t\tconst items = data.hits;\n\t\t\tlet story = {};\n\n\t\t\titems.forEach(item => {\n\t\t\t\tconst pageUrl = item.url;\n\t\t\t\tconst date = item['created_at'].match(/(\\d{4})-(\\d{2})-(\\d{2})/g);\n\t\t\t\tconst hn_title = item.title;\n\t\t\t\tconst points = item.points;\n\n\t\t\t\tif(pageUrl !== null){\n\t\t\t\t\tif(pageUrl.indexOf(\"https://github.com\", 0) === -1 ) {\n\t\t\t\t\t\tstory = {\n\t\t\t\t\t\t\tdate, hn_title, points, pageUrl, topic\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresults.push(story)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tfetchHTML(results);\n\t\t});\n\t});\n\n}", "title": "" }, { "docid": "3ac19d9e989648df1716e45dc3671b8e", "score": "0.61888605", "text": "async function getNews(query) {\n\n // using async/await to get rid of callback hell\n let response = await fetch(`https://newsapi.org/v2/everything?q=${query}&apiKey=978d6c3818ff431b8c210ae86550fb1f`)\n let content = await response.json()\n \n console.log(content)\n\n // match between the data returned from fetch() with template\n updateUI(content.articles.map(createArticle).join('\\n'))\n\n}", "title": "" }, { "docid": "4fbee2b77ed52da35f388b3781327ee3", "score": "0.6183552", "text": "function parse_page_news(){\n\n\t$('#maincol table[width=\"610px\"]').addClass('news-table');\n\n\t// copy the left td below the right td to make it possible to display\n\t// images etc. below the news text\n\tvar img_box_content = $('#maincol table td[align=\"center\"][valign=\"top\"]').addClass('news-url-image-box').html();\n\t$('.news_text').append('<div class=\"mobile-img-box-wrapper\">'+img_box_content+'</div>');\n\n\t// since news are visible\n\tparse_page_newsoverview();\n\n\t// since dates are visible\n\tparse_page_dates();\n\n}", "title": "" }, { "docid": "1d6e4086bca1643da745c1b9deec3aba", "score": "0.6172788", "text": "async function GetLatestNews()\r\n{\r\n var response = await fetch(`https://newsapi.org/v2/top-headlines?sources=bbc-news&apiKey=${APIKey}`);\r\n var jsonResponse = await response.json();\r\n var mainDOM = document.querySelector('.container');\r\n mainDOM.innerHTML = '';\r\n mainDOM.innerHTML = jsonResponse.articles.map(GetNewsTemplate).join('\\n'); \r\n var resultCountDOM = document.getElementById('newsCount');\r\n resultCountDOM.innerHTML = `Showing ${jsonResponse.totalResults} Results`;\r\n}", "title": "" }, { "docid": "0788bc4eea46c1e59bef96bbc0ae2fb5", "score": "0.6166556", "text": "function News(props) {\n let [news, setNews] = useState([]);\n\n useEffect(() => {\n axios\n .get(\n `https://newsapi.org/v2/everything?q=climate+change&apiKey=1ea3f2dd64b44ab98567cc138ab62ea6`\n )\n .then((res) => {\n setNews(res.data.articles);\n });\n }, []);\n\n // console.log(news);\n\n function displayNews() {\n return news?.map((article) => {\n return (\n <div>\n <div>\n <h1>{article.title}</h1>\n <img\n src={\n !article.urlToImage\n ? \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAe1BMVEX///9NTU3+/v5MTEw9PT3r6+vU1NRBQUFGRkbNzc2SkpJaWlqOjo5JSUk4ODj7+/vAwMDy8vLk5OQ0NDTZ2dlgYGCcnJxUVFT19fWBgYHKysp4eHgvLy+0tLSkpKTh4eFpaWllZWVxcXGrq6uHh4cqKiolJSWxsbG7u7tQBdOAAAAQtklEQVR4nO1dh2LzKAzGeOA0tYkzHGc0q+m17/+EB15hG6+M/tV/TWwDQp/FkATkANAQrD9MGbqSqjA0pFXP9ZXClkLBOyAUGfRDqC5reiM1QgjV2SCbkX2ek7Lg7QmkN8JzWF5wSBhWbB4hSXw7TB5g92pakA0rk/ZM7dfEzaD5AdE9hhoByO1Ml9HQ6qxrA3xLY8vp+qFN3zP1XRuBygt1h+Qe8r3CXLAhqXNBM09VAev01qyfhNoO0FaF/uhX0au27ZenMV77c6nyD+Gz8LxLRV35jQf4+RCOJ5FxHIdar6oiid8tScwjJfFyKFJ1DFnfSshsgtIhqTF1DOrmCbw2/SsIDQ4iVF7aMH0q+kMoXTax+1eoS0hKkeOJPY9hED4zPRVC47xtmU+b2hvFEIatLcJOkjwMoYqHEDCvLiGf65ah/qyj7gITes0xFw1FwciUk6A6vsrmVxirtbR2dqnqgQK0LEDvtz+ee6GppnqgVmtTuV5mOtTmGSA03FmHVtwtKx/RHb7PhDvqUPcU9Myy9SdoHJLG0qA5fmGRx8Sz29hwz3jC725SlF4SoSZq1q94SyYjlB6ORp8W+1LvkWwshCO/HZWFNFbdj1H0PWt9FELRKxGS2RuNT8Q6WbonLDPBKTNUYahOB8dUks+hEpEvpU3VuCW8n1l5Esokledu8DmaXBZqT6mt+44Im/xpHUJgh9DcWBS+Nneh8WOUTrrh/RkQMngkhMAKoU4wNTW32wfRYDKoEeJhmPeicRH61/dH09XvhQaqH9fXfhw+mmINQhuPT0SoIB+5rutUVFyXn8W/6gm9YTLUpdjr4oHMirl1OJ75BRpQhwotqhE6JUJOcFeWmy11T4SKmYAZmnnMPiqVxSpKAuMWopXicW+EFfdGzi2/WLxKqlPNCNlYtgKhAryEkNaOvIcQQq10qEYot1IFQvQRPISWH6gbwjb5fFqHF1iWHZoCr+tIYyLeKHsFhBb2GlRMhCUxCM0WvZwqJNmYy7CiMnkcHfIQK4RQSlHn710h9yggQ417T4R3p8ERskuNJTEIW7rTdVrDy9H5zvRDg3BQhyefLTqMNMPIELSaLeq6W72BV0TYjv4FhOxIox/1Ggka7rTUhND6PRoyDoawU6lB+qFipmbrb4NQYqV3QwdDaBqJ7UhttZmnh+GI2jRW82GPSh+PsONIYy3GoxG6tgg7V2vpW7CBarZndq22JIpwBLuUI2vvKZnPEwCG2PrF0D0Rmi0h/HFBXhyevrFoh+rjJfrVjluSCqFxmaTcLmgQVUrLESKTDiEGy7UX0fhRhNZN76IddbRphkZI5IiqMGEUToa0/J8DIfDdKI8G5lHACCUDdsSR7FLZPzQhhOAasgHi8DoEwsrHv1cUw4AQwsRjQuCu66LklyEEM+SwOnTQrErSD5W2MvRBqK5GXiNumi0gOITcIoUTHiwqsiQNwj48JXukecZPRYRp59olGjcibIcQg0/k3haPqECfw8kydsybUlM0EYKJxy6zuY43aaqgyey40TizhTqqr0UIccguJxJVZo0xdnBY2skyNkJKgo+vCN2DA3IZhOjQHCA9xme7HRB3m/HLdQtNZnwOq5VR1wmnRUZd2IJ+43OE3hjjTt8D7oxQk5m05GlY9kEC0NfMQ8zVATluvAXPiFAZiCK+RbaJEbFNozDeJOyCuZrpkm4NiNZJrcUxENpPmJYe8DI9rdent9sAopcaTKmn5YQ7gBu3izwPQjpuYMxy1iNMUTEmoY9mP+t5EJZznHZvKkNkEi93q3i+IQJQZh60H6pHiBtC1Qhplk96RqrA06h0lt3wbGymlO65bnET04L0CMEbqsIBRPRGC/YpVmZUpEUIgti9IXRR09rySOsWHOW7vnT+oXrvgjYVwmztFjZ6ATFyMzNEyfIeYb+rRZxGIJMI78hhETaGPEby8TkaECEEW6/yQqqNa95Mlzun8RDeGkPeSpWzRTl0tOCZRa4j7usL5yYmQkSYzThYazXMh3O/VT15UI4PB9Ag8omYNtoyj0WYTE/t6rm1UQah2dsSdpvYIrQwPG6kQQhxNs1dIB1rMT+EiXPbnsruTTVtR+rYD3sjpB4TvpAmR0xL63UYsAkddgNuPd5EU31Q4IEI8S6kqkBCNMIwjs48xxURFoSu2tq7jqX2nUe9+5IoZFdELvJVCit2fhi5cjcsuiLxhjVBjfYIW9lehWQiwtyHeEeluNEJG4ZChnahEl7BxPU1PMZGSPMpdJibz9WUjd6tGP0gPcDcG1ZTR4StzGdZh8SH9Zg25n3q/CrmTJfv8VHjqn3W7+lT3dh7jzQW2SSEGBw8zi7xJk0cMdhF6h5YH1TwjkomD0EIPjxeTtKLmliKRWSKVsruPIJdKsXbBQ8YE2lvJz6KkT9cZcatA2CO1KMoS3kAVWIyggfchJBMa8WUxiB0w43BtiRiX0Ku1ynJRVtFV7w7QggmiD21U87e1WgjYSuGoA9PMrgVCN2I9Yar3SYcQqulVfvlVxFhfkI4ULU3OlBs9ayPSDRi6rdTHnQqiEwZ0oFv+37YZo7X6ZD0wSPStLQoOupsG2rAanTouizCPIAquA93RgjmbqRpbm60xuqGCj6Ro0RYBqMYhG54FB2kHggljwCa4qU0JkYAOkWo0xUkzie0PEgv1UMX0qTji0591k/w96OV2BCG2n1pivXWCEGyjlwlwkK+PPgpIcTniM+mvK4AEx7jIxQ1WSNMVqGjRlgemvRmkj9cLKRJR1CZUnxSHhBiBeg54+sXT5gvn46etOIfj33x5QUnYlxZXhUDCJboBqAqwRwRFqCSr3XCnQkN8mitDwAYdFOniLCItc1QA0LHnSbcQgQRahWJh3rZC64JuHlwgxgPaoQdQ0/qQjJClCPkXj+PsFzh3nE9uljhv+FhjwFXzZI/G+w6XFu/ITSNFN1JaKWlDh2eeE1yq/NlL5JJViObhuZA4GDRD7uhVyMUZHKZTzpS/FQQySdeKX0mhokrPXSd6NLhhOVwCCUl8oOqQ0NTdW1vGpfCZIKTFDaAOi5CUCJ0WIQaiWuRI8evZp8g5s/mC0j4JFab8bJu63dbmTEj5AQMT4V4MJuq26iESLh3aQAVDIPQai2uJUIyUpSB8Dckj0t2CJno1jPoUB4NvW+qxW1j4IItI7wLOmUo/MPnQOgWa9eZY2qjjYhD/3kRUk8q8ovF3s4Aqe3QC6Gq+xl9i8Z+yFN0mrVpoyryigCq9mRXh+lhOISknUaGEL4lE5RPGS3OrjViGVKHuqiFdWnqDU8h0CJsocHmfVoMQs30LZo1bcFoEsisg4XZQvfTG9ZomxBaSdxTfQwjul982PmwG0LJTh0GoVucTOm+QmpYqxUuu/XDIcgaoSrG95wIBe3fD6EQxRDI4RbJFKm6UmzBKg8X2igQ3qIYbRCakzUR4ZknCxpFkRKYDRVl2U/hlm4IG8Jqs0foTO9LzlAIpYPDELDzTIUQYwzvS3QLRGeE+pZbwGMeFP3Q8hDP4LQcfn+pFLbLdRht3h5Dm7BzK22IdwsInehBP+yZO5kD2zTyugU75MujP/tEuCimODmzionIjWHFxbzFlZFhEEq/ZclKbHNhmBJrvmyeGmQ5MQ6LUCQfycLdmTogtENe2jT7x/ywJ0N7X5JKKatkj1khhNl28mjaZo2yGxFqZ5ii1DP82jVmhLBD2DDjW5ApMjD8Ktig1BphZxZjU79ByNggng4htD8dr/Q1Vb+7qntyT+qzpPgaBLU31qVejYwdE5ZNmW/byjPbbSuF3PHausOM8C4rllLngTihv4sEE3anC/2xCPqgtzBJglnOsGKKk8bfnmhLrEHAg/RRTBxgOI0xGxCAyX4qTrTCqMO/EfW16/lwuq93/SVhVFws450yv0JwqS4bjBz5YXgi5acerpjlH8lqV7bbsp1VNRW3VPmMOw1vGevbfPvwiSBc4Ko1JJFTPF965W5TiIezqvQIXfQDCoRgHhxLCNhPyF+GyQPyNKNPjsGSvgXynWV+Ri6WQXmkhsgeBHPCy8e0pI+LewzpA4qQ3hMDmyI8BrhECPyyttERrkMnyxFmu3i/uPi5qpKvNQi+rtOvRZr+t3DmIDnt94v1HMBr/LV+/5oB/7zfk3eT892G+328AenXAYDJ/gJm6Gsfv0EQxrkOwXe833sHgnC9+1pM5zlCcIi/9ju7IzmdoN6ibZc3740iBJt4N7t6q7zVJ/EKLFH8vXXQOdh4KUj/S5dv5Ps7PgefnjcDZ3QIzvt5rvIQbYPVfu6jKQbXeJKFaLJdxwlwQh8QhH68DrZhmCVuuAnevVOOcLs4BWksnQAcA+Epi+L5ysNJvM4AOC3yyFtGEAbeGYBLPAHb+J0Mfzj5JK/iQqOrm3jrL84QzGL6m0qkMyV4fiEj1ob8eesMZwk+nuJ5hTC/X4d+EiHS3sPQpwg3dPUpolWOjvAMPr0dQRjEtHO8xfnmulyHpOGBHRF0QhAm6XqPwjewpj55Gm+X9IRrtChOay834T7ylkQvKfmPtNQd2rtejRBsL97ejRLSSkn2MzpShKfQiRyPNOO2WqyG+waANVGE+By6Hp7HJ5K6ifNjQBmLkOpwtzj4AWlUKxpdvcbbY3xaBsEyHyuShbPF71T50WoTH8E8nk7whuowoghhsF8F4JzrkLAm74givHg/pPySnxhbgG2FkC6RIIzX3gxPQpQpdTiNfXAgrTT1dsk2JP0QuXNwuEzo2UKqfXym82qKwgsZeOIrSKa1DsFPnNK5MElc9A223hRShGl8IKPVGx4eITc70/8f0opqziNtabKInZg0UjoFJF9TEOzJiHf5IjrcX4naphdEBEvW8cI7EYTfi/Aco9xgyTzvsg4XpOQxjsnUM/e8nRPuAxCRGX/9Hzwu0C6K4mOCpt4aLX7Akoy3iROf3f03GPRXbSUm1FxL6YkY/5CSlzlPN2/L/MAnzMjjeUqk/Uh9cExnAB92aXI4YIh/Dj7ph6Szve8OSWHRHt83M5oJgO80ozP6dbNdphNwIBk+UwyC63UbpAE+fMzfN2SA8dMP0kwOmyt7MK6F391gB/EIiwJMKd5WrgyXmmW6OgBMx03IZ6grZhoJy6S8r7MztbVHaCah3de22s0orQzUith70nTjdRhfYF4U1CYcwGJOFVVOC/esE0LxgaDVXh7RMX1/+2gTOrgvDbB8VbmUj0Ro72m0lbHsovDRCPWkHpdv/a+4s2ZiPelaZOIHwM5vTzvzsAg7sbNM0Ge6L0L7ycYikxWnHgh1Q0tbdWl5PC39IbTm8UcvQ49dpfgj0KfLDGXQDlB8JN6v0jgHQ/jEWrxvJQ+lP4QvS7D27ur74nvIiW6wUEuXclJgo2OFrSoZosJ2CIeOTCor6ZDWmqfJb7NvlB3E7fzabAraeqZ/CO1qfTTCxnxDGpu9eDSWgwqBbXi+DsIO/H8JwuYHr0OGSFpztpeglghfMBjRTmBoDJ8Op+nWcXP1doUO8jQEqR+HUF2kDZumrZSdEaobRUuE1Z/Is98bb2GxcMsIVrUObIF3Q9pOiF+NUDARngdha0YvN438duJCMi0K6dNez1QwkV1f+12Yfxe9pmpGlNqOdUv7eSwxRqTRBRitgtHCEO2pVTEoXTRlhY37wHRpxjG5gadVBX0zc27AwNZau3JdETaVGxNh60BiK8k70RhM/xAKueX1w0HpHgj/By17wMa1bzfzAAAAAElFTkSuQmCC\"\n : article.urlToImage\n }\n alt=\"article img\"\n />\n </div>\n\n <div>\n <h3>Description: {article.description}</h3>\n <p>\n Snippet: {article.content} <a href={article.url}>Article Link</a>\n </p>\n </div>\n </div>\n );\n });\n }\n\n return <div>{displayNews()}</div>;\n}", "title": "" }, { "docid": "03425868e873988e9e6c09b664b285c7", "score": "0.61626947", "text": "render() {\n return (\n <div>\n <h3>Noticias ApiNews</h3>\n <ul>\n {this.state.news.map((noticia,i) => \n <li key={i}>\n \n {noticia.title}\n \n </li>)}\n {/* {noticia.name}, {noticia.email} */}\n </ul>\n </div>\n )\n }", "title": "" }, { "docid": "e067b661e4e3c5be2205bc6eca831601", "score": "0.61577946", "text": "function getNewsContent(item) {\n //console.log(newsContentCollection[item]);\n $('.ui-content').html(\n newsTopImageCollection[item] +\n newsTitleCollection[item] +\n newsDateCollection[item] +\n newsContentCollection[item]\n );\n $('#headerBackButton').show();\n $('#openpanel').hide();\n}", "title": "" }, { "docid": "ea85579d756b2cb267747a39e81c5b82", "score": "0.6147251", "text": "async getNews(endPoint, instance) {\n try {\n this.page = this.page + 1;\n this.setState({ fatchingStatus: true });\n console.log(\"getNews called \");\n var paraMeter = { params: { page: this.page } };\n\n var res = await this.apiObje.getRequest(\"\", paraMeter)\n var responseArr = [];\n\n await res.data.data.forEach((item) => {\n let { id, first_name, last_name, email, avatar } = item;\n responseArr.push(new Model(id, first_name, last_name, email, avatar));\n });\n\n if (responseArr.length === 0) {\n this.page = -1;\n this.setState({ fatchingStatus: false });\n } else if (responseArr.length > 0) {\n this.setState({ newsList: [...this.state.newsList, ...responseArr], isLoading: false });\n }\n } catch (error) {\n console.log(\"Error occur \" + error);\n }\n }", "title": "" }, { "docid": "e212301c9be426087518b94ce8532aa0", "score": "0.61403984", "text": "function news(){\r\n\tmyXHR('get',{'path':'/news/'}).done(function(json){\r\n\t\tvar x='<div id=\"dl-news\" style=\"display: none\"><h1>News</h1>';\r\n\t\tx+='<ul>';\r\n\t\tvar a=0;\r\n\t\t$.each(json.year, function(){\r\n\t\t\tx+='<li style=\"cursor: pointer\" data-id=\"'+a+'\" onclick=\"newsMore(this)\"><h3>'+$(this)[0].title+'</h3><h4>Date: '+$(this)[0].date+'</h4></li>';\r\n\t\t\ta++;\r\n\t\t});\r\n\t\tx+='</u></div>';\r\n\t\t$('body').append(x);\r\n\t\tcreateDialog(\"#dl-news\");\r\n\t});\r\n}", "title": "" }, { "docid": "53c7cd3289b680c4843e001bac118b52", "score": "0.61352766", "text": "static getNewsWithId(id) {\n\t\treturn RestService.get(`api/news/${id}`);\n\t}", "title": "" }, { "docid": "c5f370c7958823567f0ed236984a974a", "score": "0.61340725", "text": "function loadNewsViewer(){\n var newsViewer;\n \n switch (FEEDZILLA.options[\"style\"]) {\n case \"slide-left-to-right\":\n newsViewer = new SideSliderNewsViewer();\n break;\n case \"ticker\":\n // pass a custom number of items parameter, useful for tvsquad\n var numOfItems = FEEDZILLA.options[\"numOfItems\"] || '1';\n newsViewer = new TickerNewsViewer({\n numOfItems: numOfItems\n });\n break;\n default:\n newsViewer = new SpyNewsViewer();\n }\n \n // add some more options to pass to the controller\n FEEDZILLA.options[\"titleOnly\"] = true;\n FEEDZILLA.options[\"viewer\"] = newsViewer;\n FEEDZILLA.options[\"apiUrl\"] = \"http://api.feedzilla.com/v1/\";\n FEEDZILLA.options[\"width\"] = FEEDZILLA.options[\"w\"];\n FEEDZILLA.options[\"height\"] = FEEDZILLA.options[\"h\"];\n \n // prepare the controller\n var newsController = new NewsController(FEEDZILLA.options);\n \n // get the controller running\n newsController.run();\n \n }", "title": "" }, { "docid": "2afbe8df382e01abe2282ea42e6aa9b0", "score": "0.6129275", "text": "function sirvela(){\r\n // the information is going to be display in index-2\r\n\r\n myApp.onPageInit('index-2', function (page) {\r\n\r\n $.getJSON( 'https://newsapi.org/v2/top-headlines?sources=abc-news&apiKey=64a17d3dd220407aa5addbb4ac869a4c', function( data ) {\r\n\r\n\r\n var arrayOfData = data.articles;\r\n // jason is gotten\r\n\r\n\r\n\r\n // this while is to prevent overcreating of children nodes\r\n while(document.getElementById('news1').childElementCount === 0 ){\r\n for(var i = 0; i <= arrayOfData.length; i += 1) {\r\n var div = document.createElement(\"div\"); // div is created\r\n div.className = \"content-block-inner\";\r\n var h1 = document.createElement(\"h3\");// h3 element is created\r\n h1.className = \"acomodo\";\r\n var p = document.createElement(\"p\");// p element is created\r\n p.className = \"acomodo\";\r\n var imagen = document.createElement(\"IMG\");// IMG is created\r\n\r\n\r\n imagen.setAttribute(\"width\",\"300\");\r\n imagen.setAttribute(\"height\",\"200\");// image size is set\r\n imagen.className = \"imageAcomodo\";\r\n var p2 = document.createElement(\"p\");// p is created\r\n var br = document.createElement(\"br\");// an extra space is created\r\n\r\n h1.innerHTML = arrayOfData[i].title;\r\n p.innerHTML = arrayOfData[i].description;\r\n // if a imagen is coming null is better not to be displayed\r\n if(arrayOfData[i].urlToImage === null) {\r\n console.log('image no available');\r\n imagen.setAttribute(\"style\",\"display : none\");\r\n }\r\n else\r\n {\r\n imagen.setAttribute(\"src\", arrayOfData[i].urlToImage);\r\n }\r\n\r\n p2.innerHTML = arrayOfData[i].publishedAt;\r\n // saving data to an array\r\n\r\n\r\n // this if is to prevent , overcreation of childrennodes for jason extract\r\n if(document.getElementById('jason').childElementCount < arrayOfData.length) {\r\n\r\n var titlesJ = JSON.stringify(arrayOfData[i].title);\r\n var descriptionJ = JSON.stringify(arrayOfData[i].description);\r\n var urlImageJ = JSON.stringify(arrayOfData[i].urlToImage);\r\n var publishedJ = JSON.stringify(arrayOfData[i].publishedAt);\r\n\r\n var divJason = document.createElement('div');\r\n divJason.innerHTML = '<br>' + '{ title:' + titlesJ + ',' +\r\n '\\ndescription:' + descriptionJ + ',\\n' +\r\n 'urlToImage:' + urlImageJ + ',\\n' +\r\n 'publishedAt:' + publishedJ + '}' + '<br>'; // jason format is taken\r\n\r\n\r\n document.getElementById('jason').appendChild(divJason); // jason element is inserted in divjason created\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n document.getElementById('news1').appendChild(div);\r\n document.getElementById('news1').appendChild(h1);\r\n document.getElementById('news1').appendChild(p);\r\n document.getElementById('news1').appendChild(br);\r\n document.getElementById('news1').appendChild(imagen);\r\n document.getElementById('news1').appendChild(br);\r\n document.getElementById('news1').appendChild(p2);\r\n document.getElementById('news1').appendChild(br); // all the elements created are appended to news1\r\n\r\n ////////////// botton for source Json\r\n\r\n var boton = document.createElement('a');\r\n boton.className =\" open-panel button button-fill\";\r\n boton.innerHTML = \"JSON source\";\r\n boton.style.width ='120px';\r\n boton.style.height ='50px'; // button creationg for jason\r\n\r\n document.getElementById('news1').appendChild(boton);\r\n\r\n\r\n\r\n }\r\n }\r\n\r\n });\r\n\r\n\r\n document.getElementById('jason').style.display =\"block\"; // displayed right elements when click button is triggered\r\n document.getElementById('jason2').style.display =\"none\";\r\n document.getElementById('jason3').style.display =\"none\";\r\n document.getElementById('jason4').style.display =\"none\";\r\n document.getElementById('jason5').style.display =\"none\";\r\n document.getElementById('jason6').style.display =\"none\";\r\n document.getElementById('jason7').style.display =\"none\";\r\n document.getElementById('jason8').style.display =\"none\";\r\n document.getElementById('jason9').style.display =\"none\";\r\n\r\n document.getElementById('news1').style.display = 'block';\r\n document.getElementById('news2').style.display = 'none';\r\n document.getElementById('news3').style.display = \"none\";\r\n document.getElementById('sport1').style.display = \"none\";\r\n document.getElementById('sport2').style.display = \"none\";\r\n document.getElementById('sport3').style.display = \"none\";\r\n document.getElementById('finance1').style.display = \"none\";\r\n document.getElementById('finance2').style.display = \"none\";\r\n document.getElementById('economy').style.display = \"none\";\r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "64ea39d087b8cb4e334723d4e71a7093", "score": "0.6125925", "text": "function onGetResponce(err, res) {\n Preloader(false);\n if (err) {\n showAlert(`${err}, ${res.statusText}`, \"error-msg\");\n return;\n }\n\n if (!res.articles.length) {\n showAlert(\"Неверный запрос!\", \"error-warning\");\n }\n\n renderNews(res.articles);\n}", "title": "" }, { "docid": "17c423325fb01d93f61da75df196322a", "score": "0.61216193", "text": "function getNews(token)\t{\r\n\r\n\tlet key = token['access_token'];\r\n\tlet keyType = token['token_type'];\r\n\r\n\t//const date = '2018-09-12T15:48:30.743Z';\r\n\r\n\tvar date = new Date();\r\n //var dateISO = date.toISOString();\r\n\tvar dateISO = '2018-08-11T15:48:30.743Z';\r\n\r\n\tconst newsData = 'page=0&records=30&date='+dateISO+'&id=5&lang=PT&theme=Noticias';\r\n\r\n\tconst newsEndpoint = ' https://azapp-services.azurewebsites.net/api/Info/GetUpdatesAndDeletes/?'+newsData;\r\n\r\n\tconst newsHeaders = {\r\n \t\"Authorization\": \"Bearer \" + key,\r\n \t\"Content-Type\": \"application/x-www-form-urlencoded\"\r\n \t};\r\n\r\n\tconst newsOptions = {\r\n \tmethod: \"get\", \r\n \theaders: newsHeaders,\r\n \tmode: 'no-cors'\r\n \t};\r\n\r\n\treturn fetch(newsEndpoint, newsOptions)\r\n\t\t.then(newsResponse => newsResponse.json());\r\n\t\r\n}", "title": "" }, { "docid": "ee561c320d8f16cbe0fcfe017a5c76f7", "score": "0.6083429", "text": "function onGetResponce(err, res) {\n hidePreloader();\n if (err) {\n showAlert(err, 'error-msg');\n return;\n }\n if (!res.articles.length) {\n //show empty message\n showAlert('введи нормально блять', 'success');\n return;\n }\n renderNews(res.articles);\n}", "title": "" }, { "docid": "276b780c8f7cbd71c87c5effd6e68b9a", "score": "0.6078597", "text": "function redditNews() {\n\t\tlet URL = \"https://www.reddit.com/.json\";\n\t\t$.get(URL).done(function(data) {\n\t\t\tconsole.log(URL);\n\t\t\tlet newsData = data.data.children;\n\t\t\tconsole.log(newsData);\n\t\t\tfor (let i = 0; i < newsData.length; i++) {\n\t\t\t\t$('#news-feed').append(('<div class=\"card\">'+ '<a href=\"' + newsData[i].data.url + '\" target=\"_blank\">' + \n\t\t\t\t\t'<h3 class=\"card-header\">' + newsData[i].data.title + '</h3>' + '</a>' + \n\t\t\t\t\t'<h5 class=\"news-section\">' + \"Subreddit: \" + \n\t\t\t\t\t'<a target=\"_blank\" href=\"https://www.reddit.com/r/' + newsData[i].data.subreddit + '\">' + newsData[i].data.subreddit + \n\t\t\t\t\t'</a></h5>' + '</div>'));\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "6c553704a73d3ddfefa95af7bd07a41b", "score": "0.6075422", "text": "function getNewsOnClick() {\n event.preventDefault();\n // search topic\n let searchNewsTopic = getInputSelecton('newsTopic');\n // clear all articles from screen\n clearArticlesInScreen();\n // // Look for artciels and display\n displayArticles(searchNewsTopic);\n}", "title": "" }, { "docid": "9996dfe66d19ac84be6c5eb08d1d7ba9", "score": "0.6060038", "text": "function getDataFromXML() {\n var objNews = document.querySelector(\"#area-news\"),\n xmlhttp = new XMLHttpRequest(),\n xmlDoc,\n dataItem,\n i;\n\n arrayNews = [];\n lengthNews = 0;\n indexDisplay = 0;\n emptyElement(objNews);\n\n xmlhttp.open(XML_METHOD, XML_ADDRESS, false);\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {\n xmlDoc = xmlhttp.responseXML;\n dataItem = xmlDoc.getElementsByTagName(\"item\");\n\n if (dataItem.length > 0) {\n lengthNews = (dataItem.length > NUM_MAX_NEWS) ? NUM_MAX_NEWS : dataItem.length;\n for (i = 0; i < lengthNews; i++) {\n arrayNews.push({\n title: dataItem[i].getElementsByTagName(\"title\")[0].childNodes[0].nodeValue,\n link: dataItem[i].getElementsByTagName(\"link\")[0].childNodes[0].nodeValue\n });\n arrayNews[i].title = trimText(arrayNews[i].title, NUM_MAX_LENGTH_SUBJECT);\n }\n\n showNews(indexDisplay);\n } else {\n addTextElement(objNews, \"subject\", MSG_ERR_NODATA);\n }\n\n xmlhttp = null;\n } else {\n addTextElement(objNews, \"subject\", MSG_ERR_NOTCONNECTED);\n }\n };\n\n xmlhttp.send();\n }", "title": "" }, { "docid": "704b4448bcbb3c8972507d0583b63c35", "score": "0.6056332", "text": "function loadNewsList() {\n $('html,body').scrollTop(0);\n var postObj = {};\n postObj.userID = util.getSessionStorage(\"userID\");\n postObj.authSign = util.getSessionStorage(\"authSign\");\n postObj.startPos = (vm.startPos()-1) * vm.pageSize() + 1;\n postObj.pageSize = vm.pageSize();\n postObj.startTime = new Date($(\"#startTime\").val() + \" 00:00:00\").getTime();\n postObj.endTime = new Date($(\"#endTime\").val() + \" 23:59:59\").getTime();\n postObj.delete = \"\";\n util.callServerFunction('pubGetMyMsgList', postObj, function (data) {\n if (data.statusCode == 900) {\n vm.newsList.removeAll();\n if (data.list.length > 0) {\n for(var i=0;i<data.list.length;i++){\n vm.newsList.push({\n author_id: data.list[i].author_id,\n castType: data.list[i].castType,\n pm_id: data.list[i].pm_id,\n type: data.list[i].type,\n cover: data.list[i].cover,\n createTime: util.convertTime2Str(data.list[i].createTime),\n summary: data.list[i].summary,\n title: data.list[i].title,\n text: data.list[i].text,\n pt_id: data.list[i].pt_id,\n newsList: data.list[i].list,\n link: data.list[i].link\n });\n }\n } else if (vm.startPos() != 1) {\n vm.startPos(vm.startPos()-1);\n util.alert(\"系统提示\",\"您已经在最后一页了!\",\"s\");\n loadNewsList();\n } else {\n util.alert(\"系统提示\",\"哎呦!没有数据哦!\",\"s\");\n }\n } else {\n errorCodeApi(data.statusCode);\n }\n });\n}", "title": "" }, { "docid": "c9d429793c1b3669c27be65e8d12f981", "score": "0.6054022", "text": "function NYNews(title, updated, abstract, url) {\n this.title = title;\n this.updated = updated;\n this.summary = abstract;\n this.url = url;\n}", "title": "" }, { "docid": "074e01cf2dc018f6cdb3129e1b8c9c57", "score": "0.6052784", "text": "function sirvela3(){\r\n\r\n myApp.onPageInit('index-2', function (page) {\r\n\r\n $.getJSON( 'https://newsapi.org/v2/top-headlines?sources=cnn&apiKey=64a17d3dd220407aa5addbb4ac869a4c', function( data ) {\r\n\r\n\r\n var arrayOfData = data.articles;\r\n\r\n\r\n\r\n\r\n while(document.getElementById('news3').childElementCount === 0){\r\n for(var i = 0; i <= arrayOfData.length; i += 1) {\r\n var div = document.createElement(\"div\");\r\n div.className = \"content-block-inner\";\r\n var h1 = document.createElement(\"h3\");\r\n h1.className = \"acomodo\";\r\n var p = document.createElement(\"p\");\r\n p.className = \"acomodo\";\r\n var imagen = document.createElement(\"IMG\");\r\n\r\n\r\n imagen.setAttribute(\"width\",\"300\");\r\n imagen.setAttribute(\"height\",\"200\");\r\n imagen.className = \"imageAcomodo\";\r\n var p2 = document.createElement(\"p\");\r\n var br = document.createElement(\"br\");\r\n\r\n h1.innerHTML = arrayOfData[i].title;\r\n p.innerHTML = arrayOfData[i].description;\r\n // if a imagen is coming null is better not to be displayed\r\n if(arrayOfData[i].urlToImage === null) {\r\n console.log('image no available');\r\n imagen.setAttribute(\"style\",\"display : none\");\r\n }\r\n else\r\n {\r\n imagen.setAttribute(\"src\", arrayOfData[i].urlToImage);\r\n }\r\n\r\n p2.innerHTML = arrayOfData[i].publishedAt;\r\n // saving data to an array\r\n\r\n\r\n if(document.getElementById('jason3').childElementCount < arrayOfData.length) {\r\n var titlesJ = JSON.stringify(arrayOfData[i].title);\r\n var descriptionJ = JSON.stringify(arrayOfData[i].description);\r\n var urlImageJ = JSON.stringify(arrayOfData[i].urlToImage);\r\n var publishedJ = JSON.stringify(arrayOfData[i].publishedAt);\r\n\r\n var divJason = document.createElement('div');\r\n divJason.innerHTML = '<br>' + '{ title:' + titlesJ + ',' +\r\n '\\ndescription:' + descriptionJ + ',\\n' +\r\n 'urlToImage:' + urlImageJ + ',\\n' +\r\n 'publishedAt:' + publishedJ + '}' + '<br>';\r\n\r\n\r\n document.getElementById('jason3').appendChild(divJason);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n document.getElementById('news3').appendChild(div);\r\n document.getElementById('news3').appendChild(h1);\r\n document.getElementById('news3').appendChild(p);\r\n document.getElementById('news3').appendChild(br);\r\n document.getElementById('news3').appendChild(imagen);\r\n document.getElementById('news3').appendChild(br);\r\n document.getElementById('news3').appendChild(p2);\r\n document.getElementById('news3').appendChild(br);\r\n\r\n ////////////// botton for source Json\r\n\r\n var boton = document.createElement('a');\r\n boton.className =\" open-panel button button-fill\";\r\n boton.innerHTML = \"JSON source\";\r\n boton.style.width ='120px';\r\n boton.style.height ='50px';\r\n\r\n\r\n document.getElementById('news3').appendChild(boton);\r\n\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n });\r\n document.getElementById('jason3').style.display =\"block\";\r\n document.getElementById('jason').style.display =\"none\";\r\n document.getElementById('jason2').style.display =\"none\";\r\n document.getElementById('jason4').style.display =\"none\";\r\n document.getElementById('jason5').style.display =\"none\";\r\n document.getElementById('jason6').style.display =\"none\";\r\n document.getElementById('jason7').style.display =\"none\";\r\n document.getElementById('jason8').style.display =\"none\";\r\n document.getElementById('jason9').style.display =\"none\";\r\n\r\n document.getElementById('news3').style.display = \"block\";\r\n document.getElementById('news1').style.display = \"none\";\r\n document.getElementById('news2').style.display = \"none\";\r\n document.getElementById('sport1').style.display = \"none\";\r\n document.getElementById('sport2').style.display = \"none\";\r\n document.getElementById('sport3').style.display = \"none\";\r\n document.getElementById('finance1').style.display = \"none\";\r\n document.getElementById('finance2').style.display = \"none\";\r\n document.getElementById('economy').style.display = \"none\";\r\n\r\n\r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "5361075f05dd1b029e3053a57973d8cf", "score": "0.6049334", "text": "function getNews(query) {\n const url = `https://newsapi.org/v2/everything/?q=${query}&language=en`;\n\n const head = {\n headers: new Headers({\n \"X-Api-Key\": apiKey,\n }),\n };\n\n fetch(url, head)\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.text());\n })\n .then((responseJson) => console.log(responseJson))\n .catch((err) => {\n console.log(err);\n $(\"#js-error-message\").text(`Something went wrong: ${err.message}`);\n });\n}", "title": "" }, { "docid": "e83bb51d22d15f9622eb3d31788ea86a", "score": "0.6044155", "text": "function appendToNews(type,vv){\n\t$('.'+type+'-news').append('' +\n\t\t'<a class=\"card\" id=\"news-card\">'+\n\t\t'<div class=\"card__spinner\"></div>'+\n\t\t'<div class=\"card__container\">'+\n\t\t'<div class=\"news-card-top\" id=\"news-card-top\" style=\"background:linear-gradient(rgba(0, 0, 0, 0.88),rgba('+rand(0,255)+', '+rand(0,255)+', '+rand(0,255)+', 0.56)),url('+vv.urlToImage+') no-repeat 50% 50%;background-size: cover;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;-ms-background-size: cover;padding:0%\">'+\n\t\t'<p onclick=goToURL(\"'+vv.url+'\") class=\"\" style=\"color:white;text-decoration:none;font-size:22pt;text-align:left;padding:2%\">'+\n\t\t'<span id=\"article-title\">'+vv.title+'</span>'+\n\t\t'</p>'+\n\t\t'<p id=\"card__weather_description\" class=\"card__weather_description\" style=\"color:white;text-decoration:none;font-size:16pt;text-align:center;display: block;width: 100%;margin-bottom:2%\">'+vv.source.name+'</p>'+\n\t\t'</div>'+\n\t\t'<p class=\"card__temp\">'+\n\t\tvv.description+\n\t\t'</p>'+\n\t\t'</div>'+\n\t\t'</a>'\n\t);\n\t$('.'+type+'-news-title').show();\n}", "title": "" }, { "docid": "2f6c44e8f62bfc0d4d411477c9040a07", "score": "0.604108", "text": "function getNewsList() {\n\n var events = document.createElement(\"div\");\n\n /* */\n var futureNews = createNiceTitledDiv(\"Up-and-Coming Events\");\n futureNews.appendChild(createList(false, [\"August 2016: Games @ Dal(housie)\"]));\n events.appendChild(futureNews);\n events.appendChild(document.createElement(\"br\"));\n\n\n var news = createNiceTitledDiv(\"Recent Highlights\");\n var newsList = document.createElement(\"ul\");\n news.appendChild(newsList);\n newsList.appendChild(document.createElement(\"li\"));\n appendChildrenTo(newsList.lastChild, [\"Feb. 11, 2016: Math Dept talk: \", createTextLink(\"Keeping Your Distance is Hard\", getPublicFileLink(\"presentations/keepYourDistance/keepDistancePlyStateMath201602.pdf\")), \".\"]);\n newsList.appendChild(document.createElement(\"li\"));\n appendChildrenTo(newsList.lastChild, [\"August, 2015: Attended Games at Dal 2015.\"]);\n newsList.appendChild(document.createElement(\"li\"));\n appendChildrenTo(newsList.lastChild, [toNode(\"June 6, 2015: I spoke about \"), createTextLink(\"2-color Graph Placement Games\", \"https://cms.math.ca/Events/summer15/abs/gpg#kb\"), toNode(\" at the \"), createTextLink(\"CMS Summer Meeting\", \"https://cms.math.ca/Events/summer15/\"), toNode(\".\")]);\n newsList.appendChild(document.createElement(\"li\"));\n appendChildrenTo(newsList.lastChild, [toNode(\"April 17, 2015: CCSCNE Lightning Talk about teaching with \"), createTextLink(\"data structures games\", \"http://program.ccscne.org/2015/#prog/tag:Lightning+Talk\"), toNode(\".\")]);\n newsList.appendChild(document.createElement(\"li\"));\n appendChildrenTo(newsList.lastChild, [toNode(\"April 17, 2015: CCSCNE Workshop about \"), createTextLink(\"teaching with Chapel\", \"http://program.ccscne.org/2015/#prog/tag:Workshop\"), toNode(\".\")]);\n /*\n newsList.appendChild(document.createElement(\"li\"));\n appendChildrenTo(newsList.lastChild, [toNode(\"Feb. 27, 2015: BUCS Theory Seminar on \"), createTextLink(\"data structures games\", \"http://www.bu.edu/cs/news/calendar/?eid=165760\"), toNode(\".\")]);\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"Feb. 19, 2015: Talked about \"));\n newsList.lastChild.appendChild(createTextLink(\"voting issues\", getPublicFileLink(\"presentations/voting/plymouthMath201502.pdf\")));\n newsList.lastChild.appendChild(document.createTextNode(\" at our math dept's seminar series.\"));\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"Jan 22, 2015: Presented on Boolean Formula games at \"));\n newsList.lastChild.appendChild(createTextLink(\"CGTC1\", \"http://cgtc.eu/1\"));\n newsList.lastChild.appendChild(document.createTextNode(\".\"));\n //newsList.appendChild(document.createElement(\"li\"));\n //newsList.lastChild.appendChild(document.createTextNode(\"September 2014: Kyle starts teaching at Plymouth State!\"));\n\n\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"March 8, 2014: \"));\n newsList.lastChild.appendChild(createTextLink(\"David Bunde\", \"http://faculty.knox.edu/dbunde/\"));\n newsList.lastChild.appendChild(document.createTextNode(\" and I presented a workshop on teaching with \"));\n newsList.lastChild.appendChild(createTextLink(\"Chapel\", \"http://chapel.cray.com\"));\n newsList.lastChild.appendChild(document.createTextNode(\" at \"));\n newsList.lastChild.appendChild(createTextLink(\"SIGCSE 2014\", \"http://sigcse2014.sigcse.org/\"));\n newsList.lastChild.appendChild(document.createTextNode(\".\"));\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"February 4, 2014: Presented Neighboring Nim for the Math department at \"));\n newsList.lastChild.appendChild(createTextLink(\"University of New England \", \"http://www.une.edu/cas/math/\"));\n newsList.lastChild.appendChild(document.createTextNode(\".\"));\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"January 24, 2014: I spoke about \"));\n newsList.lastChild.appendChild(createTextLink(\"boolean formula games\", \"http://www.bu.edu/cs/news/calendar/?eid=148535\"));\n newsList.lastChild.appendChild(document.createTextNode(\" at Boston University.\"));\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"January 2014: I created a \"));\n newsList.lastChild.appendChild(createTextLink(\"Linux/Unix terminal tutorial\", HOME + \"?resource=terminalTutorial\"));\n newsList.lastChild.appendChild(document.createTextNode(\" for basic commands.\"));\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"November 21, 2013: \"));\n newsList.lastChild.appendChild(createTextLink(\"David Bunde\", \"http://faculty.knox.edu/dbunde/\"));\n newsList.lastChild.appendChild(document.createTextNode(\" and I gave a \"));\n newsList.lastChild.appendChild(createTextLink(\"workshop\", \"http://sc13.supercomputing.org/schedule/event_detail.php?evid=eps110\"));\n newsList.lastChild.appendChild(document.createTextNode(\" on teaching with \"));\n newsList.lastChild.appendChild(createTextLink(\"Chapel\", \"http://chapel.cray.com\"));\n newsList.lastChild.appendChild(document.createTextNode(\" at \"));\n newsList.lastChild.appendChild(createTextLink(\"Supercomputing 2013\", \"http://sc13.supercomputing.org/\"));\n newsList.lastChild.appendChild(document.createTextNode(\".\"));\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"October 25, 2013: I spoke about boolean variable games at \"));\n newsList.lastChild.appendChild(createTextLink(\"Integers 2013\", \"http://www.westga.edu/~math/IntegersConference2013/\"));\n newsList.lastChild.appendChild(document.createTextNode(\".\"));\n /*\n newsList.appendChild(document.createElement(\"li\"));\n newsList.lastChild.appendChild(document.createTextNode(\"September, 2013: I started my first semester at Colby College.\"));*/\n\n events.appendChild(news);\n //events.appendChild(document.createElement(\"br\"));\n return events;\n}", "title": "" }, { "docid": "ed6dbedc0e90224c19c24c0ad13a172a", "score": "0.6038789", "text": "function newsRequest(tickerSearch) {\n\n var apiKey = \"44ec6ee2a9c74c3dbe590b43546a857c\";\n var queryURL = \"https://newsapi.org/v2/everything?q=\" + tickerSearch + \"&apiKey=\" + apiKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n var articlesArray = [];\n // creating a loop to pull the top 3 articles\n for (var i = 0; i < 3; i++) {\n articlesArray.push(response.articles[i]);\n }\n\n displayArticles(articlesArray);\n\n });\n}", "title": "" }, { "docid": "eb9b4e13fb36de67feb4c022df5c9bc2", "score": "0.6038296", "text": "function loadNews(type,url_parameter){\r\n\tvar url = \"\";\r\n\tif (type==\"home\") url = wp_service_route_news + url_parameter;\r\n\telse if (type==\"category\") url = wp_service_route_categories + \"/\" + url_parameter + \"?limit=\" + category_news_limit;\r\n\tloadNewsImplementation(url);\r\n}", "title": "" }, { "docid": "7725eda9ce64ceb94f029ffc5bb6bb65", "score": "0.5996616", "text": "function displayNews(data) {\n //console.log(\"Enter displayNews(data) method -> jsonVar: \");\n //console.log(data);\n\n var id = document.getElementById(\"id\");\n id.innerHTML = data[0].id;\n\n if\n (\n checkXSS(data[0].title, data[0].id) &&\n checkXSS(data[0].description, data[0].id) &&\n checkXSS(data[0].url, data[0].id) &&\n checkXSS(data[0].priority, data[0].id) &&\n checkXSS(data[0].url_img, data[0].id) &&\n )\n {\n var title = document.getElementById(\"title\");\n title.innerHTML = data[0].title;\n\n var description = document.getElementById(\"description\");\n description.innerHTML = data[0].description;\n\n var pubDate = document.getElementById(\"pubDate\");\n pubDate.innerHTML = data[0].published_date;\n\n var url = document.getElementById(\"url\");\n url.innerHTML = data[0].url;\n url.href = data[0].url;\n\n var priority = document.getElementById(\"priority\");\n priority.innerHTML = data[0].priority;\n\n var img = document.getElementById(\"img\");\n if(data[0].url_img !== null) {\n img.src = data[0].url_img;\n }\n}\n\n //img.src = data[0].url;\n //img.innerHTML = data[0].img\n}", "title": "" }, { "docid": "8e929ebc08b685f4798c87e3799b3e8e", "score": "0.5976137", "text": "function getOneNews(newsId) {\r\n if (jj(newsId).jjIsDigit()) {\r\n new jj(\"do=News.getOneNews&id=\" + newsId.toString() + \"&panel=swTopNewsDiv&jj=1&title=swTitle\").jjAjax2(true);\r\n // $('#sliderPanel').hide();\r\n // $('#bodyPanel').show();\r\n // $('#sw').show();\r\n // swTab(3);\r\n\r\n }\r\n}", "title": "" }, { "docid": "17020104c5152a63b4ce372eef1e00e6", "score": "0.59559435", "text": "function sportv2(){\r\n\r\n myApp.onPageInit('index-2', function (page) {\r\n\r\n $.getJSON( 'https://newsapi.org/v2/top-headlines?sources=fox-sports&apiKey=64a17d3dd220407aa5addbb4ac869a4c', function( data ) {\r\n\r\n\r\n var arrayOfData = data.articles;\r\n\r\n\r\n\r\n\r\n while(document.getElementById('sport2').childElementCount === 0){\r\n for(var i = 0; i <= arrayOfData.length; i += 1) {\r\n var div = document.createElement(\"div\");\r\n div.className = \"content-block-inner\";\r\n var h1 = document.createElement(\"h3\");\r\n h1.className = \"acomodo\";\r\n var p = document.createElement(\"p\");\r\n p.className = \"acomodo\";\r\n var imagen = document.createElement(\"IMG\");\r\n\r\n\r\n imagen.setAttribute(\"width\",\"300\");\r\n imagen.setAttribute(\"height\",\"200\");\r\n imagen.className = \"imageAcomodo\";\r\n var p2 = document.createElement(\"p\");\r\n var br = document.createElement(\"br\");\r\n\r\n h1.innerHTML = arrayOfData[i].title;\r\n p.innerHTML = arrayOfData[i].description;\r\n // if a imagen is coming null is better not to be displayed\r\n if(arrayOfData[i].urlToImage === null) {\r\n console.log('image no available');\r\n imagen.setAttribute(\"style\",\"display : none\");\r\n }\r\n else\r\n {\r\n imagen.setAttribute(\"src\", arrayOfData[i].urlToImage);\r\n }\r\n\r\n p2.innerHTML = arrayOfData[i].publishedAt;\r\n // saving data to an array\r\n\r\n\r\n if(document.getElementById('jason5').childElementCount < arrayOfData.length) {\r\n var titlesJ = JSON.stringify(arrayOfData[i].title);\r\n var descriptionJ = JSON.stringify(arrayOfData[i].description);\r\n var urlImageJ = JSON.stringify(arrayOfData[i].urlToImage);\r\n var publishedJ = JSON.stringify(arrayOfData[i].publishedAt);\r\n\r\n var divJason = document.createElement('div');\r\n divJason.innerHTML = '<br>' + '{ title:' + titlesJ + ',' +\r\n '\\ndescription:' + descriptionJ + ',\\n' +\r\n 'urlToImage:' + urlImageJ + ',\\n' +\r\n 'publishedAt:' + publishedJ + '}' + '<br>';\r\n\r\n\r\n document.getElementById('jason5').appendChild(divJason);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n document.getElementById('sport2').appendChild(div);\r\n document.getElementById('sport2').appendChild(h1);\r\n document.getElementById('sport2').appendChild(p);\r\n document.getElementById('sport2').appendChild(br);\r\n document.getElementById('sport2').appendChild(imagen);\r\n document.getElementById('sport2').appendChild(br);\r\n document.getElementById('sport2').appendChild(p2);\r\n document.getElementById('sport2').appendChild(br);\r\n\r\n ////////////// botton for source Json\r\n\r\n var boton = document.createElement('a');\r\n boton.className =\" open-panel button button-fill\";\r\n boton.innerHTML = \"JSON source\";\r\n boton.style.width ='120px';\r\n boton.style.height ='50px';\r\n\r\n\r\n document.getElementById('sport2').appendChild(boton);\r\n\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n });\r\n\r\n\r\n document.getElementById('jason5').style.display =\"block\";\r\n document.getElementById('jason').style.display =\"none\";\r\n document.getElementById('jason2').style.display =\"none\";\r\n document.getElementById('jason3').style.display =\"none\";\r\n document.getElementById('jason4').style.display =\"none\";\r\n document.getElementById('jason6').style.display =\"none\";\r\n document.getElementById('jason7').style.display =\"none\";\r\n document.getElementById('jason8').style.display =\"none\";\r\n document.getElementById('jason9').style.display =\"none\";\r\n\r\n document.getElementById('sport2').style.display = \"block\";\r\n document.getElementById('news1').style.display = \"none\";\r\n document.getElementById('news2').style.display = \"none\";\r\n document.getElementById('news3').style.display = \"none\";\r\n document.getElementById('sport1').style.display = \"none\";\r\n document.getElementById('sport3').style.display = \"none\";\r\n document.getElementById('finance1').style.display = \"none\";\r\n document.getElementById('finance2').style.display = \"none\";\r\n document.getElementById('economy').style.display = \"none\";\r\n\r\n\r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "245887d3c01115818ce05ec8d82f8e86", "score": "0.5954535", "text": "async getArticleDatas() {\r\n this.setState({\r\n isLoading: true,\r\n });\r\n\r\n try {\r\n const response = await fetch(\r\n 'https://newsapi.org/v2/top-headlines?country=au&category=business&apiKey=a563e910722c48888110232f95f87bb7'\r\n );\r\n const responseJson = await response.json();\r\n await this.setState({\r\n total : responseJson.totalResults,\r\n responseCode : responseJson.status,\r\n datas: responseJson.articles,\r\n isLoading: false,\r\n });\r\n } catch (error) {\r\n console.error('getArticleDatas', error);\r\n this.setState({ \r\n responseCode : error, \r\n isLoading: false,\r\n });\r\n }\r\n }", "title": "" }, { "docid": "71614f865da614ff1a029895e104264c", "score": "0.59426695", "text": "function sportv3(){\r\n\r\n myApp.onPageInit('index-2', function (page) {\r\n\r\n $.getJSON( 'https://newsapi.org/v2/top-headlines?sources=marca&apiKey=64a17d3dd220407aa5addbb4ac869a4c', function( data ) {\r\n\r\n\r\n var arrayOfData = data.articles;\r\n\r\n\r\n\r\n\r\n while(document.getElementById('sport3').childElementCount === 0){\r\n for(var i = 0; i <= arrayOfData.length; i += 1) {\r\n var div = document.createElement(\"div\");\r\n div.className = \"content-block-inner\";\r\n var h1 = document.createElement(\"h3\");\r\n h1.className = \"acomodo\";\r\n var p = document.createElement(\"p\");\r\n p.className = \"acomodo\";\r\n var imagen = document.createElement(\"IMG\");\r\n\r\n\r\n imagen.setAttribute(\"width\",\"300\");\r\n imagen.setAttribute(\"height\",\"200\");\r\n imagen.className = \"imageAcomodo\";\r\n var p2 = document.createElement(\"p\");\r\n var br = document.createElement(\"br\");\r\n\r\n h1.innerHTML = arrayOfData[i].title;\r\n p.innerHTML = arrayOfData[i].description;\r\n // if a imagen is coming null is better not to be displayed\r\n if(arrayOfData[i].urlToImage === null) {\r\n console.log('image no available');\r\n imagen.setAttribute(\"style\",\"display : none\");\r\n }\r\n else\r\n {\r\n imagen.setAttribute(\"src\", arrayOfData[i].urlToImage);\r\n }\r\n\r\n p2.innerHTML = arrayOfData[i].publishedAt;\r\n // saving data to an array\r\n\r\n\r\n if(document.getElementById('jason6').childElementCount < arrayOfData.length) {\r\n var titlesJ = JSON.stringify(arrayOfData[i].title);\r\n var descriptionJ = JSON.stringify(arrayOfData[i].description);\r\n var urlImageJ = JSON.stringify(arrayOfData[i].urlToImage);\r\n var publishedJ = JSON.stringify(arrayOfData[i].publishedAt);\r\n\r\n var divJason = document.createElement('div');\r\n divJason.innerHTML = '<br>' + '{ title:' + titlesJ + ',' +\r\n '\\ndescription:' + descriptionJ + ',\\n' +\r\n 'urlToImage:' + urlImageJ + ',\\n' +\r\n 'publishedAt:' + publishedJ + '}' + '<br>';\r\n\r\n\r\n document.getElementById('jason6').appendChild(divJason);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n document.getElementById('sport3').appendChild(div);\r\n document.getElementById('sport3').appendChild(h1);\r\n document.getElementById('sport3').appendChild(p);\r\n document.getElementById('sport3').appendChild(br);\r\n document.getElementById('sport3').appendChild(imagen);\r\n document.getElementById('sport3').appendChild(br);\r\n document.getElementById('sport3').appendChild(p2);\r\n document.getElementById('sport3').appendChild(br);\r\n\r\n ////////////// botton for source Json\r\n\r\n var boton = document.createElement('a');\r\n boton.className =\" open-panel button button-fill\";\r\n boton.innerHTML = \"JSON source\";\r\n boton.style.width ='120px';\r\n boton.style.height ='50px';\r\n\r\n\r\n document.getElementById('sport3').appendChild(boton);\r\n\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n });\r\n\r\n document.getElementById('jason6').style.display =\"block\";\r\n document.getElementById('jason').style.display =\"none\";\r\n document.getElementById('jason2').style.display =\"none\";\r\n document.getElementById('jason3').style.display =\"none\";\r\n document.getElementById('jason4').style.display =\"none\";\r\n document.getElementById('jason5').style.display =\"none\";\r\n document.getElementById('jason7').style.display =\"none\";\r\n document.getElementById('jason8').style.display =\"none\";\r\n document.getElementById('jason9').style.display =\"none\";\r\n\r\n document.getElementById('sport3').style.display = \"block\";\r\n document.getElementById('news1').style.display = \"none\";\r\n document.getElementById('news2').style.display = \"none\";\r\n document.getElementById('news3').style.display = \"none\";\r\n document.getElementById('sport1').style.display = \"none\";\r\n document.getElementById('sport2').style.display = \"none\";\r\n document.getElementById('finance1').style.display = \"none\";\r\n document.getElementById('finance2').style.display = \"none\";\r\n document.getElementById('economy').style.display = \"none\";\r\n\r\n\r\n });\r\n\r\n}", "title": "" }, { "docid": "69eeb604dd202a48d055a16a20dc5ca6", "score": "0.59424067", "text": "async function printNews() {\n if (!data.status.news) {\n setTimeout(printNews, 100);\n return;\n }\n const div = document.getElementById('div-news');\n let text = '<h1>In The News</h1>';\n if (data.news.length > 30) data.news.length = 30;\n for (const item of data.news) {\n text += `${item.publishDate} &nbsp <b>${color.blue(item.publication)}</b>: &nbsp <a href=\"${item.url}\">${item.title}</a><br>`;\n }\n div.innerHTML = text;\n}", "title": "" } ]
4fdb744cb246406c57c60d0c5661aec5
PLAYER TRIES TO ATTACK
[ { "docid": "946fd69b23223c393f1a5e1e55aa473e", "score": "0.0", "text": "function doAttack(){statusMessage.delete(); setTimeout(doRealAttack,1000);}", "title": "" } ]
[ { "docid": "32137fe7ea390ec85850aebf47a69eee", "score": "0.66377115", "text": "function ATTACK (you, opp) {\n var attack = opp.health -= you.atk;\n var hit = you.health -= opp.counter;\n\n if(you.name===\"Baby Yoda\"){\n $('#yodaC > div > p').text(hit);\n if(opp.name===\"Jar Jar Binks\"){\n $('#jarD > div > p').text(attack);\n } else if(opp.name==\"Darth Vader\"){\n $('#vaderD > div > p').text(attack);\n } else{\n $('#lukeD > div > p').text(attack);\n }\n }\n\n if(you.name===\"Mando\"){\n $('#mandoC > div > p').text(hit);\n if(opp.name===\"Jar Jar Binks\"){\n $('#jarD > div > p').text(attack);\n } else if(opp.name==\"Darth Vader\"){\n $('#vaderD > div > p').text(attack);\n } else{\n $('#lukeD > div > p').text(attack);\n }\n }\n\n if(you.name===\"Jar Jar Binks\"){\n $('#jarC > div > p').text(hit);\n if(opp.name===\"Baby Yoda\"){\n $('#yodaD > div > p').text(attack);\n } else if(opp.name==\"Darth Vader\"){\n $('#vaderD > div > p').text(attack);\n } else if(opp.name==\"Mando\"){\n $('#mandoD > div > p').text(attack);\n } else{\n $('#lukeD > div > p').text(attack);\n }\n }\n\n if(you.name===\"Darth Vader\"){\n $('#vaderC > div > p').text(hit);\n if(opp.name===\"Baby Yoda\"){\n $('#yodaD > div > p').text(attack);\n } else if(opp.name==\"Jar Jar Binks\"){\n $('#jarD > div > p').text(attack);\n } else if(opp.name==\"Mando\"){\n $('#mandoD > div > p').text(attack);\n } else{\n $('#lukeD > div > p').text(attack);\n }\n }\n\n if(you.name===\"Luke Skywalker\"){\n $('#lukeC > div > p').text(hit);\n if(opp.name===\"Baby Yoda\"){\n $('#yodaD > div > p').text(attack);\n } else if(opp.name==\"Darth Vader\"){\n $('#vaderD > div > p').text(attack);\n } else if(opp.name==\"Mando\"){\n $('#mandoD > div > p').text(attack);\n } else{\n $('#yodaD > div > p').text(attack);\n }\n }\n\n //prints text to bottom about what happened when attack was clicked\n $('#myDmg').text(you.name + \" attacks \" + opp.name + \" for \" + you.atk + \" damage.\")\n $('#oppDmg').text(opp.name + \" counter attacks \" + you.name + \" for \" + opp.counter + \" damage.\")\n\n //special yoda condition\n if(you.name === \"Baby Yoda\"){\n if(hit <= 0){\n yodaC.style.display= \"none\";\n mandoC.style.display= \"block\";\n alert('Mando arrives and saves Baby Yoda')\n char1.atk = you.atk;\n }\n if(attack<=0){\n gameOn=false;\n clearOpp();\n $('#oppDmg').text(\"You have defeated \" + opp.name + \". Select a new challenger\" )\n } \n } else if(hit <= 0){\n gameOn=false;\n $('#oppDmg').text(\"You have been defeated by \" + opp.name + \". Game Over!\" )\n } else if(attack<=0){\n if(opp.name === 'Baby Yoda'){\n yodaD.style.display= \"none\";\n mandoD.style.display= \"block\";\n alert('Mando arrives and saves Baby Yoda')\n } else if($('#yodaE').css('display') === 'none' && $('#vaderE').css('display') === 'none' && $('#jarE').css('display') === 'none' && $('#lukeE').css('display') === 'none'){\n $('#oppDmg').text(\"You have defeated all Opponents! You Win!\" )\n gameOn=false;\n clearOpp();\n } else{\n gameOn=false;\n clearOpp();\n $('#oppDmg').text(\"You have defeated \" + opp.name + \". Select a new challenger\" )\n }\n }\n //increases attack of users char\n you.atk += you.baseAtk; \n }", "title": "" }, { "docid": "2bfcd8fbc83d981c10e51c2f1a812029", "score": "0.6208715", "text": "function yourAttack(){\nhitPoints = hitPoints - enemyAttack;\nenemyHP = enemyHP - attackPower;\nbonusHP = bonusHP - attackPower;\nattackPower = attackPower + 8;\naudio.play();\n}", "title": "" }, { "docid": "50d030334a967506e82acab0b7388ce3", "score": "0.61013716", "text": "playing() {\n const keys = Object.keys(this.players);\n let deadPlayers = 0;\n\n // if enemy is dead - create new one and reward players\n // else loop through player for collisions\n if (!this.enemy || this.enemy.hp <= 0) {\n // reward players - heal and exp\n for (let i = 0; i < keys.length; i++) {\n const player = this.players[keys[i]];\n\n player.currentExp += player.exp * 0.25;\n player.hp = Math.min(player.hp + (player.maxHp * 0.2), player.maxHp);\n\n // check if they level up\n if (player.currentExp > player.exp) {\n player.levelUp();\n\n // emit updated info to players\n process.send(new Message('levelPlayer', {\n hash: player.hash,\n player: player.getMaxStats(),\n }));\n }\n }\n\n // create new enemy\n // TO DO: pick random enemy type and str depends on player level\n this.bullets = [];\n this.enemyLevel++;\n this.enemy = new Test(this.enemyLevel, keys.length);\n } else {\n this.enemy.update(this.dt);\n\n // loop through players\n for (let i = 0; i < keys.length; i++) {\n const player = this.players[keys[i]];\n\n if (player.isAlive) {\n // dont check collision if hit\n if (player.hit > 0) {\n player.hit -= this.dt;\n } else {\n player.isHit = false;\n this.checkCollision(player);\n }\n\n // charge basic attack if not usable\n if (player.currentAttRate > 0) {\n player.currentAttRate -= this.dt;\n } else {\n player.currentAttRate = 0;\n }\n\n\n if (player.attacking) {\n const range = (player.maxDamage - player.minDamage) + 1;\n\n this.enemy.hp -= utils.getRandomInt(range, player.minDamage);\n\n // deal another strike if its critcal\n if (player.isCritcalHit) {\n this.enemy.hp -= utils.getRandomInt(range, player.minDamage);\n }\n\n player.attacking = false;\n player.currentAttRate = player.attRate;\n\n // TO DO: ADD emit to rpc attack animation if attacking is true\n process.send(new Message('playerAttacking', {\n pos: this.enemy.pos,\n isCritcalHit: player.isCritcalHit,\n }));\n }\n // check skill used\n if (player.skill1Used) {\n player.skill1(this.enemy, this.players, this.bullets);\n\n process.send(new Message('playerUsedSkill', {\n hash: player.hash,\n skillName: player.skill1Name,\n pos: this.enemy.pos,\n }));\n }\n if (player.skill2Used) {\n player.skill2(this.enemy, this.players, this.bullets);\n\n // do not run if its a toggle type skill\n if (!player.skill2IsToggleType) {\n process.send(new Message('playerUsedSkill', {\n hash: player.hash,\n skillName: player.skill2Name,\n pos: this.enemy.pos,\n }));\n }\n }\n } else {\n deadPlayers++;\n player.reviveTimer -= this.dt;\n\n // revive player when revive timer ends\n if (player.reviveTimer <= 0) {\n player.reviveTimer = 0;\n player.reviveTime += 5; // extend next revive time by 5 sec\n player.isAlive = true;\n player.hp = player.maxHp;\n\n // send message with new isAlive value\n process.send(new Message('playerIsAlive', {\n hash: player.hash,\n isAlive: player.isAlive,\n reviveTimer: player.reviveTimer,\n reviveTime: player.reviveTime,\n }));\n }\n }\n\n // update player's critcal hit location\n player.update(this.dt);\n\n this.clientPlayers[keys[i]] = player.getClientData();\n }\n }\n\n this.bullets = this.enemy.bullets;\n\n this.clientEmitters = this.enemy.emitters.map(emitter => ({\n pos: emitter.pos,\n sprite: emitter.sprite,\n }));\n\n // filter bullets data to send only necessary info\n this.clientBullets = this.bullets.map(bullet => ({\n pos: bullet.pos,\n radius: bullet.radius,\n drained: bullet.drained,\n sprite: bullet.sprite,\n }));\n\n this.state = keys.length === deadPlayers ? GAME_PREPARING : this.state;\n\n // emit updated info back\n process.send(new Message('updateRoom', {\n state: this.state,\n players: this.clientPlayers,\n enemy: this.enemy.getClientData(),\n emitters: this.clientEmitters,\n bullets: this.clientBullets,\n }));\n }", "title": "" }, { "docid": "0072eb058a8ef50560c49a69bf7a81ae", "score": "0.6079727", "text": "function attend(x){\n x.step = 0;\n x.fightStyle = 0;\n x.fightStyleLenght = 7;\n x.animSpeed = 0.4;\n x.smashPoint = 20;\n x.recuperation = 0.03;\n x.bodyAdvance = [1, 1, 1, 1, 1, 1, 1];\n x.bodyY = [1, 1, 0, 0, 1, 2, 2];\n x.armAdvance = [0, 0, 0, 0, 0, 0, 0];\n x.armHeight = [0, 0, 0, 0, 0, 0, 0];\n x.armY = [-1, -1, -1, 0, 1, 2, 1];\n x.legAdvance = [1, 0, 0, 0, 0, 0, 0];\n x.legHeight = [1, 0, 0, 0, 0, 0, 0];\n x.legY = [1, 0, 0, 0, 0, 0, 0];\n}", "title": "" }, { "docid": "0383832701075fd7740463575c043017", "score": "0.6076098", "text": "function updateAttackPossiblities(value)\t{\n\tsocket.send(\"Attack from:\" + value);\n\treturn false;\n}", "title": "" }, { "docid": "69ec4d4602d8815336a8a89e38b62089", "score": "0.6063448", "text": "attackPlayer(player){\n if (this.y + this.yChange === player.y && this.x + this.xChange === player.x){\n player.health -= this.attack;\n messages1.addCustomMessage(\"The \" + this.name + \" \" + this.attackSynonyms[Math.floor(random(this.attackSynonyms.length))] + \" you, dealing \" + this.attack + \" damage!\");\n }\n\n\n }", "title": "" }, { "docid": "dedc64b56a590fbef5297e7926d05262", "score": "0.5972848", "text": "function tank(options)\n{\n monsterSkill(this,options);\n this.order = 2;\n this.effect = function(icaster,player, monsters, target, damage)\n {\n console.log(\"lulz \"+damage);\n if (damage != 0 && Math.random() * 100 < this.percentProc)\n {\n console.log(\"test\");\n log(monsters[icaster].name + \"take the hit to protect his ally !\", \"INFO\");\n changemHP(icaster, damage);\n damage = 0;\n }\n return damage;\n }\n}", "title": "" }, { "docid": "716bc1ce54b3800138e5d1be1dfbe77d", "score": "0.5962717", "text": "function enemyAttack() {\n //!-------check if fortified------\n if (playerStatus.classList.contains(\"fortified\") && fortifyCounter > 0) {\n fortifyCounter -= 1;\n enemy.classList.remove(\"enIdle\");\n enemy.classList.toggle(\"enAttack\");\n messages.style.display = \"initial\";\n messages.innerHTML = \"<h1>You completely avoid damage</h1>\";\n makeClickable();\n setTimeout(function () {\n enemy.classList.toggle(\"enAttack\");\n }, 1000);\n } else {\n makeClickable();\n if (playerStatus.classList.contains(\"fortified\")) {\n //!remove fortified on fortifyCounter = 0\n fortifyCounter = 0;\n playerStatus.classList.toggle(\"fortified\");\n }\n if (pHealth.value > 0) {\n enemy.classList.remove(\"enIdle\");\n enemy.classList.toggle(\"enAttack\");\n setTimeout(function () {\n if (pHealth.value > 25 && playerStatus.innerHTML != \"50\" && playerStatus.innerHTML != \"20\" ) {\n pHealth.value -= 25; // enemy health reduction\n hero.classList.toggle(\"heroBeingHit\");\n setTimeout(function () {\n hero.classList.toggle(\"heroBeingHit\");\n }, 1200);\n //! when bock class is on -50% damage.\n } else if (pHealth.value > 25 && playerStatus.innerHTML == \"50\") {\n pHealth.value -= 12.5;\n } //! when defence class is on -20% damage.\n else if (pHealth.value > 15 && playerStatus.innerHTML == \"20\") {\n pHealth.value -= 20;\n }else {\n //! ------- player death condition -------- \n pHealth.value -= 25; // player health reduction\n playerDeath();\n }\n }, 1500);\n setTimeout(function () {\n enemy.classList.toggle(\"enAttack\");\n }, 1500);\n }\n }\n}", "title": "" }, { "docid": "58949485859b5ff40a943d8d1a91dc30", "score": "0.5949597", "text": "function counterAttack(player_index, opponent_index) {\n print(`${contenders[opponent_index].name} strikes back!`);\n game_state.health_points[player_index] -=\n\tcontenders[opponent_index].ctr_atk_pwr;\n}", "title": "" }, { "docid": "2694d487c6e9fd41e7d87db8e5200890", "score": "0.5945979", "text": "attack() { }", "title": "" }, { "docid": "18c2c3775a8512599d037d781072d297", "score": "0.5942554", "text": "setTrap(player) {\n let plays = []; // gather plays that set a trap\n const p = (player=='x' ? 0 : 1); // player index\n const o = (player=='o' ? 0 : 1); // opponent index\n // We need to find rows/cols/diags that have size-2 plays of player with no opponent.\n // Thus all they need is one more move to create a threat\n const threats = this.pendingThreats(player);\n // check intersection of rows vs cols/diags\n for (let i of threats.rows) {\n for (let j of threats.cols) {\n if (this.isEmpty(i,j)) plays.push([i,j]);\n }\n for (let j of threats.diags) {\n const k = (j==0 ? i : this.ibd.size-1-i);\n if (this.isEmpty(i,k)) plays.push([i,k]);\n }\n }\n // check intersection of cols vs diags\n for (let i of threats.cols) {\n for (let j of threats.diags) {\n const k = (j==0 ? i : this.ibd.size-1-i);\n if (this.isEmpty(i,k)) plays.push([i,k]);\n }\n }\n // if (player=='x' & this.ibd.moves==8) {\n // // console.log(\"threats: \"+JSON.stringify(threats,null,2));\n // // console.log(\"set trap: \"+plays);\n // }\n return this.uniquePlays(plays);\n }", "title": "" }, { "docid": "5b14426a7ee247e66f6b7c884bb9e27c", "score": "0.5932009", "text": "function ai_eultimate_action()\n{\n numClicks = 0;\n\tconsole.log(\"Eng AI used ult\");\n\t//canGo = true;\n\tuhp = uhp - 18;\n\tcmana = cmana - 14;\n\n\tif (uhp<=0){\n\t\tresetVariables();\n\t\tgame.state.start(\"lose\");\n\t} else {\n\thealthBar.width = uhp*8;\n\tuhp_txt.setText(\"Hp : \" + uhp);\n\taimanaBar.width=cmana*10;\n cmana_txt.setText(\"Mp : \" + cmana);\n\tplayer_report = \"Computer did 18 damage!\";\n\tsleep(1000).then(function(){\n player_dmg(player_report);\n\t});\n report = \"Computer used 14 MP\";\n ai_dmg(report);\n\tcanGo = true;\n\tdoAiExplosion(20);\n \ttrueBattle();\n\t}\n\n\n}", "title": "" }, { "docid": "feaa07f95b1aaa95a53be28f77942046", "score": "0.5909478", "text": "attack(TribeList) {\n this.attackList = TribeList;\n\n var that = this;\n\n this.chase(TribeList, function(tribe) {\n // Attacking other tribe incurs in a penalty cost\n var cost = 100;\n var stronger = that.silver < tribe.silver;\n\n if (stronger){\n // bad idea attacking a stronger tribe\n\t that.food -= 5 / cost;\n\t that.water -= 5 / cost;\n\t that.silver -= 1 / cost;\n }\n\n // in combat spend resources\n\t that.food -= 5 / cost;\n\t tribe.food -= 5 / cost;\n\t that.water -= 5 / cost;\n\t tribe.water -= 5 / cost;\n\n\t // loose silver to create ammo\n that.silver -= 5 / cost;\n tribe.silver -= 5 / cost;\n\n\t var attack = tribe.location.copy().sub(that.location).mul(that.maxforce);\n\t that.applyForce(attack);\n });\n if (Tribe.showBehavior){\n this.color = \"red\";\n }\n }", "title": "" }, { "docid": "9993d1b3eb802e5fd74460b86f827836", "score": "0.5906111", "text": "function attack(){\n\tvar audio = document.getElementById('punch');\n\n\taudio.play();\n\tconsole.log(\"inside Attack\");\n\t\n\t//attacker and defender scores decremented\n\tdefenderScore -= attackerPower;\n\tattackerScore -= characters[defender].attackPower;\n\t\n\n\t$('#'+attacker+' > figcaption:last').text(attackerScore);\n\t$('#'+defender+' > figcaption:last').text(defenderScore);\n\n\t$('#messageFooter').html(\"<span>\"+\"You attacked \"+characters[defender].name+\" for \"+attackerPower+\" damage.\"+\"<br>\"+characters[defender].name+\" attacked you for \"+characters[defender].attackPower+\" damage.\"+\"</span>\"+\"<br>\");\n\t\t\t\n\tconsole.log(\"inside Attack\",attackerPower,characters[attacker].basePower,attackerScore,characters[defender].attackPower,characters[defender].basePower,defenderScore);\n\t//attackers attack power gets increased\n\tattackerPower += characters[attacker].attackPower;\n\t// call result to check result after each attack\n\tresult();\n}", "title": "" }, { "docid": "57aa27126f820d0f11b9c665c4a0f79b", "score": "0.5898893", "text": "function antPoint() {\n\tantScore += 2;\n\tantTextUpdate();\n\tif (antScore == 10) gameOver(1);\n}", "title": "" }, { "docid": "155997b9d53024bc287c0e389424dd17", "score": "0.58980495", "text": "function doesBust(player, dealer){\n\n}", "title": "" }, { "docid": "f3c92953f7084c5b4e3faaf46da99304", "score": "0.58964986", "text": "function hitMe() {\n deckService.hitPlayer();\n if (deckService.getPlayerScore() > 21) {\n alert(deckService.getPlayerScore() + \" You Busted!!\");\n deckService.gameState.inProgress = false;\n postResults();\n }\n }", "title": "" }, { "docid": "9194a964539ee58c9c801f27bf3a1c4e", "score": "0.58816624", "text": "_doTrapStarshipTLAttack(character, effectResults) {\n return Promise.all([\n this.getStarshipTL(character),\n CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)\n ])\n .then(tuple => {\n let ac = tuple[0] || 10;\n let roll = tuple[1];\n\n effectResults.ac = ac;\n effectResults.roll = roll;\n effectResults.trapHit = roll.total >= ac;\n return effectResults;\n });\n }", "title": "" }, { "docid": "036232e203d4b625e8bfcef84e9796b1", "score": "0.5878218", "text": "function doRetreat() {\n let playerIdx = this.getAttribute(\"data-id\");\n let player = activeGame.getPlayer(playerIdx);\n if (confirm(format(FLEE_CONFIRM, [player.getName()]))) {\n player.retreat();\n togglePlayerButtons(playerIdx);\n output(format(FLED, [player.getName()]));\n awardTitle(player, \"Coward\");\n checkForGameEnd();\n updateScreen();\n }\n}", "title": "" }, { "docid": "5637919d395af9a9c0eee6ed968a9018", "score": "0.58710086", "text": "function counterattack() {\n $(\"#antagonist h4\").html(game.ant.health + \"❤️\");\n game.pro.health = game.pro.health - game.ant.hit;\n\n if (game.pro.health > 0) {\n // still battling, update health\n $(\"#protagonist h4\").html(\"❤️\" + game.pro.health);\n } else {\n lose();\n }\n }", "title": "" }, { "docid": "2a2f2985eda55f195c1c3140afeeb457", "score": "0.58575225", "text": "function tally(winner){\n total = total + 1;\n if (winner === \"Player!\"){\n pw = pw + 1;\n return\n }\n else if (winner === \"AI\"){\n cw = cw + 1;\n return\n }\n else {\n tie = tie + 1; \n return\n }\n }", "title": "" }, { "docid": "36e2b3b330a91961e77d9fef22dae7f3", "score": "0.58548", "text": "hitToyTom (follower, toy){\r\n\r\n // Make toy vanish\r\n toy.disableBody(true, true);\r\n // Add 1 to toms score and update text\r\n this.tomScore += 1;\r\n this.tomScoreText.setText(this.tomScore + ' :Tom');\r\n // Add and configure new toy of same type\r\n var newToy = collectibles.create(Phaser.Math.Between(25, 775), 0, toy.getData('name'));\r\n newToy.setData('name', toy.getData('name'));\r\n newToy.setBounce(1);\r\n newToy.setCollideWorldBounds(true);\r\n newToy.setVelocity(Phaser.Math.Between(-60, 60), 20);\r\n newToy.allowGravity = false;\r\n collectibles.remove(toy);\r\n\r\n }", "title": "" }, { "docid": "863733aeb64d4f4614406fe56ba75b2e", "score": "0.58438843", "text": "receivePlayerSelection(action, target) {\n if (action === 'attack') {\n this.units[this.index].attack(this.enemies[target]);\n }\n // next turn in 3 seconds\n this.time.addEvent({ delay: 3000, callback: this.nextTurn, callbackScope: this });\n }", "title": "" }, { "docid": "1b17e4e35e6503aa3575f54b86bdf542", "score": "0.5842454", "text": "attack(from, to, player) {\n let opponent = this.current().name == player.name ? this.opponent() : this.current()\n let attacker = player.getBoard(from)\n let defender = opponent.getBoard(to)\n attacker.defense -= defender.attack\n defender.defense -= attacker.attack\n attacker.canAct = false;\n attacker.needsAttackDisplay = true;\n this.resolveDamage()\n }", "title": "" }, { "docid": "7ccdcfc4e4f9d5ec52fdffff627eaa4b", "score": "0.5836846", "text": "function act_prayer_heard() {\n updateLog(` You have been heard!`);\n player.updateAltPro(500); /* protection field */\n}", "title": "" }, { "docid": "3c7fd08d020286fbe195ff1fd4ecd955", "score": "0.58357626", "text": "function whoAttacks() {\n let dice = Math.floor(Math.random() * 10);\n let whowon = 0\n if (dice >= 5) {\n\n\n whowon = opponentAttack()\n\n } else {\n\n whowon = myFighterAttack()\n\n }\n return whowon\n }", "title": "" }, { "docid": "0f58ee8d704032c8fc5846d7db004830", "score": "0.5821355", "text": "function ifLoose(){\n\tif(health1<=0){\n\t\talert(\"player Two Wins!!!!\")\n\t\tstart()\n\t\tbuy()\n\t}else if(health2 <= 0){\n\t\talert(\"Player One Wins!!!!\")\n\t\tstart()\n\t\tbuy()\n\t}\n}", "title": "" }, { "docid": "34bef5283c4da6d2623e0b71042358c3", "score": "0.5814271", "text": "function killsay() {\r\n if (!GetVal(\"Killsay\")) return;\r\n local = Entity.GetLocalPlayer();\r\n var normal_killsays = [\"LOL imagine getting tapped by otc\", \"You got killed by a free cheat, can't relate\", \"You just got pwned by Onetap crack, the #1 CS:GO free HvH cheat\",\r\n \"If I were you, I'd use Onetap crack\",\r\n \"Think you could do better than OTC3? Well think again dumbass\", \"XD.js - good free, open-source js for otc3\", \"Get good get OTC with XD.js \", \"Oof, thats a 1 on my otc screen bro\"\r\n ];\r\n\r\n var hs_killsays = [\"LOL imagine getting tapped by otc\", \"You got killed by a free cheat, can't relate\", \"You just got pwned by Onetap crack, the #1 CS:GO free HvH cheat\",\r\n \"If I were you, I'd use Onetap crack\",\r\n \"Think you could do better than OTC3? Well think again dumbass\", \"XD.js - good free, open-source js for otc3\", \"Get good get OTC with XD.js \", \"Oof, thats a 1 on my otc screen bro\"\r\n ];\r\n var victim = Entity.GetEntityFromUserID(Event.GetInt(\"userid\"));\r\n var attacker = Entity.GetEntityFromUserID(Event.GetInt(\"attacker\"));\r\n var headshot = Event.GetInt(\"headshot\") == 1;\r\n\r\n if (Entity.IsLocalPlayer(attacker) && attacker != victim) {\r\n var normal_say = normal_killsays[Math.floor(Math.random() * normal_killsays.length)];\r\n var hs_say = hs_killsays[Math.floor(Math.random() * hs_killsays.length)];\r\n\r\n if (headshot && Math.floor(Math.random() * 3) <= 1) //gamer style randomizer\r\n {\r\n Cheat.ExecuteCommand(\"say \" + hs_say);\r\n return;\r\n }\r\n Cheat.ExecuteCommand(\"say \" + normal_say);\r\n }\r\n}", "title": "" }, { "docid": "1f5e085fc190a266ec4382da40a9cf0a", "score": "0.58119917", "text": "function attackSequence(){\n // var currentEnemy = new Enemy(\"orc\", 200)\n while(player is alive && enemy is alive){\n // player attacks enemy\n // enemy attacks player\n }\n // battleResolution() // give the player loot\n}", "title": "" }, { "docid": "15e5e1ab0ace9c74592c82756e3f4181", "score": "0.5811362", "text": "attackEnemy(){\n this.totalAttack = this.attack + this.weaponAttack;\n for (let entity = 1; entity < map1.entities.length; entity++){\n if (map1.entities[entity].y === this.y + this.yChange && map1.entities[entity].x === this.x + this.xChange){\n map1.entities[entity].health -= this.totalAttack;\n messages1.addCustomMessage(\"You attack the \" + map1.entities[entity].name + \", dealing \" + this.totalAttack + \" damage. (\" + map1.entities[entity].health + \" health remaining)\");\n }\n }\n\n \n }", "title": "" }, { "docid": "571b6318336bd11045cf9a6619f9522c", "score": "0.5810158", "text": "commenceAttack() {\n // Attacks not allowed if hero or enemy defeated\n if (this.chosenHero.healthPoints > 0 &&\n this.chosenEnemy.healthPoints > 0)\n {\n // Hero attacks enemy\n this.chosenEnemy.healthPoints -= this.chosenHero.attackPower;\n this.gameAlert1 = `You inflicted ${this.chosenHero.attackPower} damage on ${this.chosenEnemy.name}!`;\n // Enemy attacks hero\n this.chosenHero.healthPoints -= this.chosenEnemy.counterAttackPower;\n this.gameAlert2 = `${this.chosenEnemy.name} inflicted ${this.chosenEnemy.counterAttackPower} damage on you!`;\n this.increaseHeroAttackPower();\n }\n }", "title": "" }, { "docid": "56ceb22d32c43b52bb072a7af0a5f5a8", "score": "0.5806828", "text": "startBattleIA(){\n //Step1: creation des multi-tread pour l'IA\n //?step2: verifi les distances des item food, verifi si il doi manger quelque chose ?\n //?step3: verifi les distances et evalue si dois ce raproche ou seloinger selon sa desc ?\n //?step4: verifi la meilleur action disponible selon ces states, son inteligence permet de mieux fair ces choix ?\n const action_eatFood = (()=>{\n $combats.foodItemMap.forEach(item => {\n // condition et math...\n return item;\n });\n })();\n const action_move = false; // store un endroit pour ce deplacer\n const action_atk = $combats.combatMode[0]; // store un mode action; 'attack'\n const action_target = $player; // store la cible la plus logique selon le setup\n setTimeout(()=>{\n const action = {type:'attack',source:this,target:$player,items:null}; // on creer un objet actions qui stock des para\n $combats.actionsTimeLine = [];\n $combats.actionsTimeLine.push(action); // will .shift() from combat update\n }, 300);\n\n\n }", "title": "" }, { "docid": "eed498a2e28d0b8bac1ac4879a083c8e", "score": "0.58067054", "text": "playerAttack() {\n if ((this.enemyCurrentX === (this.heroCurrentX + 1) && this.faceLeft === false) || (this.enemyCurrentX === (this.heroCurrentX - 1) && this.faceLeft === true) || (this.enemyCurrentX === this.heroCurrentX)) {\n if (Math.floor(Math.random() * 85) > 15) {\n let healthLoss = Math.floor(Math.random() * 12);\n if (this.heroMorale > 225) {\n healthLoss *= 2;\n }\n if (this.heroHealth < 150) {\n healthLoss *= 2;\n }\n this.enemyHealth -= healthLoss;\n this.heroMorale += (Math.floor(Math.random() * 12) * 3);\n }\n this.updateHealth();\n }\n }", "title": "" }, { "docid": "f2979db9cba9113a0b8b4dbd57505d09", "score": "0.5797679", "text": "pot(extraLives) {\n if (this.currentPlayer !== -1) {\n extraLives = extraLives ? extraLives : 0;\n //add the player to the through list\n for (let i = 0; i <= extraLives; i++) {\n this.through.push(this.toBeDrawn[this.currentPlayer]);\n }\n\n //remove the player from the current list\n \t this.toBeDrawn.splice(this.currentPlayer, 1);\n \t}\n\n //push back the new status of the game\n this.subscribers.forEach((sub) => {\n sub.pushEvent({\n type: \"pot\",\n player: this.toBeDrawn[this.currentPlayer],\n extraLives: extraLives,\n status: this.status()\n });\n });\n\n\n //draw the next player\n this.draw();\n }", "title": "" }, { "docid": "5bca9c95e2ca45912a6da8724a4753c6", "score": "0.5792251", "text": "playerattack(e){\r\n this._playerFighter.gotoAndPlay(\"playerpunch\");\r\n this._playerFighter.on(\"animationend\", this.startidlePlayer, this);\r\n }", "title": "" }, { "docid": "da86b3c07fbe744c0639954abc0c3824", "score": "0.5790507", "text": "hit()\n {\n //picks a card adds to the hand.\n //get hand value if > 21 \n //busted = true\n this.hand.addCard(this.deck.pickCard());\n const handVal = this.hand.getHandTotal()\n if(handVal>21)\n {\n if(this.hand.hasAce)\n {\n //hand total'den 10 cikar.\n //handVal i tekrar hesapla halen 21 den buyukse\n this.isBusted = true;\n }\n else{\n this.isBusted = true;\n }\n \n }\n }", "title": "" }, { "docid": "f2d952e660fdb330c262b6e79ba28c12", "score": "0.57893", "text": "pendingThreats(player) {\n const p = (player=='x' ? 0 : 1); // player index\n const o = (player=='o' ? 0 : 1); // opponent index\n let threats = {\n rows: [],\n cols: [],\n diags:[]\n };\n const n = this.ibd.size - 2; // number plays to making a threat\n for (let i=0; i<this.ibd.size; i++) { // search rows/cols\n if (this.ibd.rows[i].xocnt[p]==n &&\n this.ibd.rows[i].xocnt[o]==0) threats.rows.push(i);\n if (this.ibd.cols[i].xocnt[p]==n &&\n this.ibd.cols[i].xocnt[o]==0) threats.cols.push(i);\n }\n for (let i=0; i<2; i++) { // search diags\n if (this.ibd.diags[i].xocnt[p]==n &&\n this.ibd.diags[i].xocnt[o]==0) threats.diags.push(i);\n }\n return threats;\n }", "title": "" }, { "docid": "033b01006941b131f15e71e4a9a7048e", "score": "0.5780655", "text": "function attacks_exchange(e){\r\n \r\n//********************* Static variables for the preservation of game conditions ************************************\r\n \r\n if(typeof attacks_exchange.own_shots == 'undefined') //User shots counter. This variable and the following one avoid giving the victory to the user who has shot without paying attention to the rhythm of the machine.\r\n attacks_exchange.own_shots = 0;\r\n \r\n if(typeof attacks_exchange.enemy_shots == 'undefined') //Machine shots counter.\r\n attacks_exchange.enemy_shots = 0;\r\n \r\n if(typeof attacks_exchange.own_sunken_counter == 'undefined') //User sunken ships counter.\r\n attacks_exchange.own_sunken_counter = 0;\r\n \r\n if(typeof attacks_exchange.enemy_sunken_counter == 'undefined') //Machine sunken ships counter.\r\n attacks_exchange.enemy_sunken_counter = 0;\r\n \r\n if(typeof attacks_exchange.wait_for_enemy == 'undefined') //It avoid giving the victory to user when it is true.\r\n attacks_exchange.wait_for_enemy = false;\r\n \r\n if(typeof attacks_exchange.enemy_victory == 'undefined') //It alerts the \"enemy_attack\" function that the machine has already won, so that it does not go into an infinite loop (because there would be no more place to shoot).\r\n attacks_exchange.enemy_victory = false;\r\n \r\n//********************************************************************************************************************\r\n \r\n if(shot(Number(e.target.id.slice(1)))) //It calls to user shot function, and when this return \"true\", it adds a sunken ship to counter.\r\n attacks_exchange.enemy_sunken_counter++;\r\n \r\n attacks_exchange.own_shots++; //It adds always a shot to user counter.\r\n \r\n e.target.removeEventListener('click', attacks_exchange); //It prevents the locker used for calling this functions, from being able to call it again.\r\n \r\n if((enemy_counter.textContent = attacks_exchange.enemy_sunken_counter) != 15){ //If last user shot do not reach 15 sunken ships, it enables the enemy attack.\r\n \r\n setTimeout(function(){ //Delay.\r\n\r\n sign(\"The enemy prepare his shot!\");\r\n\r\n setTimeout(function(){ //Delay.\r\n\r\n if(enemy_attack(attacks_exchange.enemy_victory)) //It adds a sunken ship to user fleet counter, when the \"enemy_attack\" function return \"true\".\r\n attacks_exchange.own_sunken_counter++;\r\n \r\n attacks_exchange.enemy_shots++; //It adds always a shot to enemy counter.\r\n\r\n if((own_counter.textContent = attacks_exchange.own_sunken_counter) == 15){ //If the machine reaches 15 sunken ships, it announces its victory.\r\n \r\n final_sign_text.textContent = \"You lose!\";\r\n attacks_exchange.enemy_victory = true;\r\n final_sign.style.display = \"block\";\r\n }else if(attacks_exchange.wait_for_enemy && attacks_exchange.enemy_shots == attacks_exchange.own_shots - 1){ //Else if user is waiting for enemy and the enemy has finished its shots, it announces the user victory.\r\n \r\n if(attacks_exchange.enemy_shots == attacks_exchange.own_shots - 1){\r\n final_sign_text.textContent = \"You win!\";\r\n final_sign.style.display = \"block\"; \r\n }\r\n }\r\n }, 1000);\r\n }, 1500);\r\n }else if(attacks_exchange.enemy_shots < attacks_exchange.own_shots - 1){ //If user has reached 15 sunken ships but the enemy has not finished its shots, it puts the game result on hold.\r\n \r\n final_sign_text.textContent = \"Wait...\";\r\n attacks_exchange.wait_for_enemy = true;\r\n final_sign.style.display = \"block\";\r\n }else{ //But if the enemy has finished its shots, it announces the user victory.\r\n \r\n final_sign_text.textContent = \"You win!\";\r\n final_sign.style.display = \"block\"; \r\n }\r\n}", "title": "" }, { "docid": "8db2b637df2c3f00b020e54770bc68bb", "score": "0.57727194", "text": "addTroops(state, terrId){\n let player = state.game.players[state.game.turnIndex]\n state.game.territories[terrId].reserves += 1\n player.reserves --\n if (state.game.phase === 'initialTroops')\n player.tempReserves --\n state.game.players[state.game.turnIndex] = player\n }", "title": "" }, { "docid": "29b0286c359bde05319c674610320869", "score": "0.5770313", "text": "attack(opponent) {\n\n let weapon = Math.floor(Math.random() * this.weapons.length);\n let damage = Math.floor(Math.random() * this.weapons[weapon].maxDamage + 1);\n\n this.weapons[weapon].uses--;\n\n if (this.weapons[weapon].uses <= 0) {\n\n this.weapons[weapon].uses = 0;\n damage = 1;\n\n }\n\n return opponent.takeDamage(damage);\n\n }", "title": "" }, { "docid": "a0e111e6395635848afbda6202337e27", "score": "0.57658035", "text": "function C101_KinbakuClub_BlindMansBuff_ForeAft() {\n\tC101_KinbakuClub_BlindMansBuff_TouchSomebody = false;\n\tC101_KinbakuClub_BlindMansBuff_FeelSomebody = false;\n\tC101_KinbakuClub_BlindMansBuff_Random = Math.floor(Math.random() * 4);\n\tif (C101_KinbakuClub_BlindMansBuff_Random == 0)\tOverridenIntroText = GetText(\"Forwards0\");\n\tif (C101_KinbakuClub_BlindMansBuff_Random == 1) OverridenIntroText = GetText(\"Forwards1\");\n\tif (C101_KinbakuClub_BlindMansBuff_Random == 2) OverridenIntroText = GetText(\"Forwards2\");\n\tif (C101_KinbakuClub_BlindMansBuff_Random == 3) OverridenIntroText = GetText(\"Forwards3\");\n\tC101_KinbakuClub_BlindMansBuff_WhatHappened()\n}", "title": "" }, { "docid": "88c97a355fe89f9e4b45c82a7244e721", "score": "0.5764411", "text": "function onStrongAttackHandler(){\n attackMonster('MODE_STRONG_ATTACK');\n}", "title": "" }, { "docid": "adbc9712d6805370097eb1faf4394b68", "score": "0.5754216", "text": "conquerTerr(state, pl){\n const attackTerr = state.game.territories[pl.attackTerr.id-1]\n const defendTerr = state.game.territories[pl.defendTerr.id-1]\n attackTerr.reserves -= pl.redLose\n defendTerr.reserves = null\n const loser = state.game.players.findIndex((e) => e.id === defendTerr.owner)\n state.game.players[loser].terrCount--\n const winner = state.game.players.findIndex((e) => e.id === attackTerr.owner)\n state.game.players[winner].terrCount++\n defendTerr.owner = attackTerr.owner\n }", "title": "" }, { "docid": "a955f30c7c121fb24915415b913e1021", "score": "0.57503796", "text": "isPlayerBust() {\n if (this.getValueOfHand() > 21) {\n this.hitButton.disabled = true;\n this.standButton.disabled = true;\n this.hasHadTurn = true;\n GameMaster.giveAPlayerATurn();\n }\n }", "title": "" }, { "docid": "416dfdecedeb010d9c909a1b657ce848", "score": "0.57466525", "text": "hit() {\n\t\tAppDispatcher.handleViewAction({\n \t\tactionType: actionTypes.PLAYER_HIT,\n \t});\n\t}", "title": "" }, { "docid": "f03b751481b3f16e3143d7f6aa47fbbe", "score": "0.5743586", "text": "function aiAct(e, index){\n\n\t//determines distance from player\n\tlet dx = e.x - player.x;\n\tlet dy = e.y - player.y;\n\n\t//depending on distance (and enemy type), become alert or stay/go back to wandering aimlessly\n\tif(!e.alerted && Math.abs(dx) + Math.abs(dy) < 3+e.type)\n\t{\n\t\te.alerted = true;\n\t}\n\telse if(e.alerted && Math.abs(dx) + Math.abs(dy) > 4+e.type)\n\t{\n\t\te.alerted = false;\n\t}\n\t\n\tlet posX;\n\tlet posY;\n\tlet rndChoice;\n\n\tif(e.alerted){\n\t\t//dum tracking\n\t\t//checks what direction the player is in\n\t\t//if diagonal, chooses randomly between up/down and left/right\n\t\t//if in a straight line direction, chooses that direction\n\n\t\tif(dx < 0){ //player is below\n\t\t\tif(dy > 0){ //player to left\n\t\t\t\tif(validMove(e.x, e.y - 1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x + 1, e.y, false)){ //down\n\t\t\t\t\tposX = 1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(dy < 0){ //player to right\n\t\t\t\tif(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x+1, e.y, false)){ //down\n\t\t\t\t\tposX = 1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y-1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(dy == 0){\n\t\t\t\tif(validMove(e.x + 1, e.y, false)){ //down\n\t\t\t\t\tposX = 1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y - 1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t} \n\t\t\t\telse if(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(dx > 0){ //player is above\n\t\t\tif(dy > 0){ //player to left\n\t\t\t\t//check valid move in one direction, if not valid, \n\t\t\t\tif(validMove(e.x, e.y - 1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x - 1, e.y, false)){ //up\n\t\t\t\t\tposX = -1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(dy < 0){ //player to right\n\t\t\t\tif(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x - 1, e.y, false)){ //up\n\t\t\t\t\tposX = -1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y -1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(dy == 0){\n\t\t\t\tif(validMove(e.x - 1, e.y, false)){ //up\n\t\t\t\t\tposX = -1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y - 1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t} \n\t\t\t\telse if(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(dx == 0){ //player is to the sides\n\t\t\tif(dy < 0){ //right\n\t\t\t\tif(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x - 1, e.y, false)){ //up\n\t\t\t\t\tposX = -1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x + 1, e.y, false)){ //down\n\t\t\t\t\tposX = 1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(dy > 0){ //left\n\t\t\t\tif(validMove(e.x, e.y - 1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x - 1, e.y, false)){ //up\n\t\t\t\t\tposX = -1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x + 1, e.y, false)){ //down\n\t\t\t\t\tposX = 1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\t//walk randomly\n\t\tlet rndDir = Math.floor(Math.random() * 4);\n\t\tswitch(rndDir){\n\t\t\tcase 0:\n\t\t\t\tif(validMove(e.x, e.y - 1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif(validMove(e.x - 1, e.y, false)){ //up\n\t\t\t\t\tposX = -1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x + 1, e.y, false)){ //down\n\t\t\t\t\tposX = 1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(validMove(e.x, e.y + 1, false)){ //right\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = 1;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x, e.y - 1, false)){ //left\n\t\t\t\t\tposX = 0;\n\t\t\t\t\tposY = -1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif(validMove(e.x + 1, e.y, false)){ //down\n\t\t\t\t\tposX = 1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse if(validMove(e.x - 1, e.y, false)){ //up\n\t\t\t\t\tposX = -1;\n\t\t\t\t\tposY = 0;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t//if new direction has been decided, try to move, otherwise don't do anything\n\tif(posX != null && posY != null){\n\t\tmoveTo(e, index, {x: posX, y: posY});\n\t}\n}", "title": "" }, { "docid": "8975eead0964e133d80f9518c69ea2c0", "score": "0.57370424", "text": "function checkAcesPlayer() {\n if (playerscore > 21){\n if (playeraces == 1){\n playerscore = playerscore - 11; \n playerscore += 1; \n playeraces = 0; \n }\n }\n}", "title": "" }, { "docid": "43d1c90c635d742187d13db1db26f0ac", "score": "0.573589", "text": "function givePlayerADrink(player){\n player.takeDrinks(1);\n drinksToGive--;\n drinksGiven++;\n }", "title": "" }, { "docid": "715b6359d8998651c7fbbe25955608fb", "score": "0.57309926", "text": "function ApplyEnchantment() {\n if (experience >= enchantprice) {\n enchant += 1\n experience = experience - enchantprice\n enchantprice = Math.floor(enchantprice * 3)\n clicks = clicks + 100\n enchantmentxp += 100\n\n document.getElementById('ench').innerHTML = `<h5> Enchant: ${enchant} </h5>`\n document.getElementById('enchprice').innerHTML = ` ${enchantprice} `\n document.getElementById('enchxp').innerHTML = `<p>(+${enchantmentxp} XP per click)</p>`\n\n }\n update()\n\n}", "title": "" }, { "docid": "e26059432aca5eda1be4b85f857c1d46", "score": "0.5729445", "text": "attack(opponent) {\n\n console.log(\"Choose your weapon by entering in the number of the weapon:\");\n\n for (let i = 0; i < this.weapons.length; i++) {\n\n console.log(`[${i}] ${this.weapons[i].name} (remaining uses: ${this.weapons[i].uses})`);\n\n }\n\n let chosenWeapon = -1;\n\n while (chosenWeapon == -1 || isNaN(chosenWeapon) || chosenWeapon > this.weapons.length - 1) {\n\n chosenWeapon = readline.question(\"Weapon: \");\n\n }\n\n let damage = Math.floor(Math.random() * this.weapons[chosenWeapon].maxDamage + 1);\n\n this.weapons[chosenWeapon].uses--;\n\n if (this.weapons[chosenWeapon].uses <= 0) {\n\n this.weapons[chosenWeapon].uses = 0;\n damage = 1;\n\n }\n\n console.log();\n\n return opponent.takeDamage(damage);\n\n }", "title": "" }, { "docid": "da3c8dee32e7490bf12259dd74117464", "score": "0.5727346", "text": "onAttack() {\n let { HP, dead } = this.state;\n HP -= 10;\n if (!HP) dead = true;\n this.setState({ HP, dead });\n }", "title": "" }, { "docid": "fdf9ad641c1606363ec5b9212f5ca0bc", "score": "0.5724545", "text": "function computerHit() {\n\t//player1 hit or stand according to player1's total value\n\tif (!player1.stand) {\n\t\tplayer1.distributeCard(player1.cards.length);\t\t\n\t\tplayer1.showCards(pokerElements1);\t\t\n\t\tif (player1.totalValue()>21) { //player1 bust\n\t\t\tplayer1.result=\"LOSE!\"\n\t\t\tplayer2.result=\"WIN!\";\n\t\t\tplayer2.betLeft=player2.betLeft + player2.bet + player1.bet;\n\t\t\tplayer1.bet=0;\n\t\t\tplayer2.bet=0;\n\t\t\tplayer1.stand=true;\t\t\t\n\t\t\tplayer1.showCards(pokerElements1);\n\t\t\tshowResult();\t\t\n\t\t\tif (player2.betLeft==0) {\n\t\t\t\tvar playAgain=window.confirm(\"Ran out of money! Play again?\");\n\t\t\t\tif (playAgain) {\n\t\t\t\t\tplayer2.bet=10;\n\t\t\t\t\tplayer2.betLeft=90;\n\t\t\t\t\tdeal();\n\t\t\t\t}else{\n\t\t\t\t\tdocument.getElementById('deal').disabled=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//if player1's total value is larger than 17, player1 stand\n\t\t\tif (player1.totalValue()>=17) { \n\t\t\t\tplayer1.stand=true;\n\t\t\t\tif (document.getElementById('stand2').disabled) { //both player stand and not bust\n\t\t\t\t\tcompareStand(player1, player2);\n\t\t\t\t\tplayer1.showCards(pokerElements1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\t\n}", "title": "" }, { "docid": "d03efd1c84e21e7fb1fa80659975ae9e", "score": "0.5723249", "text": "function timeAct(frameTime, agent, mapArray){\n \n //TxtSet(\"txtbox\"+agent.id, 3, agent.hp+\",\"+agent.stpT);\n // waiting respawn ( 1 unit: 20ms)\n if(agent.respT > 0){\n agent.respT -= frameTime;\n if(agent.respT%20==0){\n TxtSet(\"txtbox\"+agent.id, 3, agent.respT/20);\n }\n if(agent.respT <= 0){\n TxtSet(\"txtbox\"+agent.id, 3, \"\");\n agent.hp = Math.floor(agent.maxhp);\n }\n }\n \n if(agent.hp <= 0){\n agent.actT = 0;\n agent.action = 0;\n agent.act_key = 0;\n agent.chgT = 0;\n for (var it=1; it <5; it++ ){\n \tagent.weapon[it].actT = 0;\n \tLyrFal(agent.weapon[it].img);\n \t\t}\n LyrFal(\"chg\"+agent.id);\n TxtSet(\"txtbox\"+agent.id, 3, \"\");\n return 0;\n }else{\n \tif(agent.action != Katk1){agent.mp += frameTime;}\n \tif(agent.mp > agent.maxmp){agent.mp=agent.maxmp;}\n }\n // charge motion--------------------------------------------------\n if(agent.chgT >0){\n \tTxtSet(\"txtbox\"+agent.id, 3, 'chg');\n agent.chgT=agent.chgT-frameTime;\n destinate_x = agent.imgx - agent.img_offset;\n destinate_y = agent.imgy - agent.img_offset;\n // size of chg : 40, offset :(40-25)/2\n LyrSetx(\"chg\"+agent.id, destinate_x -8);\n LyrSety(\"chg\"+agent.id, destinate_y -8);\n input_skl = skldata[agent.sklset[agent.action-Katk1]];\n TxtSet(\"txtbox\"+agent.id, 2, input_skl.chgtxt);\n \n if(agent.chgT<=0){// time end\n LyrFal(\"chg\"+agent.id);\n TxtSet(\"txtbox\"+agent.id, 2, input_skl.acttxt);\n agent.chgT=0;\n }\n \n // action-----------------------------------------------------------\n }else if(agent.actT >0){\n \t//TxtSet(\"txtbox\"+agent.id, 3, 'action');\n var input_skl, input_motion;\n let directionX = Math.cos(agent.rotationRight);\n let directionY = Math.sin(agent.rotationRight);\n let deltaX = frameTime * directionX;\n let deltaY = frameTime * directionY;\n // some action is set\n if(agent.action == Kdash){\n \t\n \tagent.speed = agent.agi*0.6;\n\t\t\t// update destination\n\t agent.x = agent.x + agent.speed * deltaX;\n agent.y = agent.y + agent.speed * deltaY;\n \n // destination is not a \"Wall\"\n\t MapCollision( agent, mapArray);\n\t destinate_x = agent.imgx - agent.img_offset;\n\t destinate_y = agent.imgy - agent.img_offset;\n\t // size of chg : 40, offset :(40-25)/2\n\t LyrSetx(\"bst\"+agent.id, destinate_x -8);\n\t LyrSety(\"bst\"+agent.id, destinate_y -8);\n \n }\n if(agent.action >= Katk1 && agent.action <= Katk3){\n \t\n \tinput_skl = skldata[agent.sklset[agent.action-Katk1]];\n \t// len, wide, angle\n \tfor (var it=1; it<5; it++ ){\n\t \tif(agent.weapon[it].actT>0){\n\t \t\t\n\t \t\tiactT = Math.floor(agent.weapon[it].actT*10);\n\t \t\tinput_motion = motionset[input_skl.wep_array[it]][iactT];\n\t \t\tagent.weapon[it].motion = input_motion;\n\t \t\tagent.weapon[it].SetSize(input_motion.wide*2);\n\t \t\tLyrResize( agent.weapon[it].img, input_motion.wide*2, input_motion.wide*2);\n\t \t\t//\n\t \t\tif(input_motion.type==0){\n\t\t \t\t//操作型(近接)\t\n\t\t \t\tagent.weapon[it].rotationRight = agent.rotationRight;\n\t\t \t\tlet shiftedX = Math.cos(agent.rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t \t\t\tlet shiftedY = Math.sin(agent.rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t \t\t\tagent.x = agent.x + frameTime * shiftedX *input_motion.spd;\n \t\t\tagent.y = agent.y + frameTime * shiftedY *input_motion.spd;\n\t\t\t \tagent.weapon[it].x = agent.x + input_motion.lng * shiftedX ;\n\t\t\t \tagent.weapon[it].y = agent.y + input_motion.lng * shiftedY ;\n\t\t\t \tagent.dfen =input_motion.dfen;\n\t\t\t \t//TxtSet(\"txtbox\"+agent.id, 3, agent.dfen);\n\t\t \t}\n\t\t \t//射出型\n\t\t \tif(input_motion.type==1 || input_motion.type==2){\n\t\t \t\t// init\n\t\t \t\tif(agent.weapon[it].actT == input_skl.actT){\n\t\t\t\t\t\t\t// 偏差撃ちしない\n\t\t \t\t\tagent.weapon[it].rotationRight = getTatgetDirection( agent, agent.target);\n\t\t \t\t\tlet shiftedX = Math.cos(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t \t\t\t\tlet shiftedY = Math.sin(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t\t \t\t\tagent.weapon[it].x = agent.x + frameTime*input_motion.lng * shiftedX ;\n\t\t\t \t\tagent.weapon[it].y = agent.y + frameTime*input_motion.lng * shiftedY ;\n\t\t\t \t\t//Update_footer();\n\t\t\t \t\t\n\t\t \t\t}else{\n\t\t \t\t\t//console.log(input_motion.lng);\n\t\t \t\t\tlet shiftedX = Math.cos(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t \t\t\t\tlet shiftedY = Math.sin(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t\t \t\t\tagent.weapon[it].x += frameTime*input_motion.lng * shiftedX ;\n\t\t\t \t\tagent.weapon[it].y += frameTime*input_motion.lng * shiftedY ;\n\t\t\t \t\twep_x = Math.max(Math.floor(agent.weapon[it].x),0);\n\t\t\t \t\twep_y = Math.max(Math.floor(agent.weapon[it].y),0);\n\t\t\t \t\tif(mapArray[wep_x][wep_y] < 1 ){\n\t\t\t\t\t\t\t\tif(input_motion.type==2){\n\t\t\t\t\t\t\t\t\tif(agent.weapon[it].actT >= 0.5){\n\t\t\t\t\t\t\t\t\t\tLyrReset( agent.weapon[it].img , headURL2+\"fire_c50.gif\" , 25, 25);\n\t\t\t\t\t\t\t\t\t\tagent.weapon[it].actT = 0.49;\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\tagent.weapon[it].actT = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t if(input_motion.type==2){\n\t\t\t\t\t if(agent.weapon[it].actT < 0.5 && agent.weapon[it].exploded==false){\n\t\t\t\t\t \tLyrReset( agent.weapon[it].img , headURL2+\"fire_c50.gif\" , 25, 25);\n\t\t\t\t\t \tagent.weapon[it].exploded=true;\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t \n\t\t\t \t}\n\t\t \t}//\n\t\t \t\n\t\t \tif(input_motion.type==3){\n\t\t \t\t//missile\t\n\t\t\t\t\t\tif(agent.weapon[it].actT == input_skl.actT){\n\t\t\t\t\t\t\t// 偏差撃ちしない\n\t\t \t\t\tagent.weapon[it].rotationRight = getTatgetDirection( agent, agent.target);\n\t\t \t\t\tlet shiftedX = Math.cos(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t \t\t\t\tlet shiftedY = Math.sin(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t\t \t\t\tagent.weapon[it].x = agent.x + frameTime*input_motion.lng * shiftedX ;\n\t\t\t \t\tagent.weapon[it].y = agent.y + frameTime*input_motion.lng * shiftedY ;\n\t\t\t \t\t//Update_footer();\n\t\t\t \t\t\n\t\t \t\t}else{\n\t\t \t\t\t//console.log(\"fire_c50.gif\");\n\t\t \t\t\tif(agent.weapon[it].actT < 1.2 && agent.weapon[it].guide>=2){\n\t\t\t\t\t\t\t\tagent.weapon[it].rotationRight = getTatgetDirection( agent.weapon[it], agent.target);\n\t\t\t\t\t\t\t\tagent.weapon[it].guide=1;\n\t\t\t\t }else if(agent.weapon[it].actT < 0.8 && agent.weapon[it].guide>=1){\n\t\t\t\t \tagent.weapon[it].rotationRight = getTatgetDirection( agent.weapon[it], agent.target);\n\t\t\t\t\t\t\t\tagent.weapon[it].guide=0;\n\t\t\t\t }\n\t\t\t\t \t\n\t\t \t\t\tlet shiftedX = Math.cos(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t \t\t\t\tlet shiftedY = Math.sin(agent.weapon[it].rotationRight+THREE.Math.degToRad(input_motion.shift));\n\t \t\t\t\t\n\t\t \t\t\tagent.weapon[it].x += frameTime*input_motion.lng * shiftedX ;\n\t\t\t \t\tagent.weapon[it].y += frameTime*input_motion.lng * shiftedY ;\n\t\t\t \t\twep_x = Math.floor(agent.weapon[it].x);\n\t\t\t \t\twep_y = Math.floor(agent.weapon[it].y);\n\t\t\t \t\t//exp\n\t\t\t \t\tif(mapArray[wep_x][wep_y] < 1 ){\n\t\t\t\t\t\t\t\tif(agent.weapon[it].actT >= 0.5){\n\t\t\t\t\t\t\t\t\tagent.weapon[it].actT = 0.49;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t if(agent.weapon[it].actT < 0.5 && agent.weapon[it].exploded==false){\n\t\t\t\t \tLyrReset( agent.weapon[it].img , headURL2+\"fire_c50.gif\" , 25, 25);\n\t\t\t\t \tagent.weapon[it].exploded=true;\n\t\t\t\t }\n\t\t\t \t}\n\t\t \t}\n\t\t \tagent.weapon[it].actT -= frameTime;\n\t \t}\n\t\t\t\t\n\n\t\t\t\t//\n\n\n\t // if end\n\t \tif(agent.weapon[it].actT<=0){\t\t// time end\n\t\t LyrFal(agent.weapon[it].img);\n\t \tagent.weapon[it].actT=0;\n\t \tagent.dfen=0;\n\t }\n \t}// end for it\n //console.log('kusoo');\n }\n \n\n agent.actT=agent.actT-frameTime;\n if(agent.actT<=0){\t\t// time end\n //LyrFal(agent.weapon[1].img);\n LyrFal(\"bst\"+agent.id);\n agent.action =0;\n agent.actT=0;\n agent.dfen=0;\n \n }else if(agent.action >= Katk1 && agent.action <= Katk3){\n\n }\n }else{//actT<=0\n //TxtSet(\"txtbox\"+agent.id, 3, 'others ');\n agent.action =0;\n \n if(agent.astpT >0){\n agent.astpT=agent.astpT-frameTime;\n if(agent.astpT <=0){\n //agent.weapon[1].motion = skldata[0].motion[0];\n TxtSet(\"txtbox\"+agent.id, 2, \"\");\n agent.astpT=0;\n \n }\n }\n if(agent.stpT >0){\n \t\n agent.stpT=agent.stpT-frameTime;\n if(agent.stpT <=0){\n //agent.weapon[1].motion = skldata[0].motion[0];\n TxtSet(\"txtbox\"+agent.id, 2, \"\");\n agent.stpT=0;\n }\n }\n \n } \n\n}", "title": "" }, { "docid": "f2d17f95250cce32067a2335b7fd66d6", "score": "0.57231057", "text": "function attackEnemy() {\n var whoWins;\n var winningNum = Math.floor(Math.random() * 2);\n whoWins = winningNum;\n if (whoWins === 1 && playerInfo.hp > 0) {\n console.log(\"You kicked the enemies ass. Right on!\")\n youWon();\n getItem();\n\n } else {\n playerInfo.hp = 0;\n console.log(\"You put up a good fight but were killed. Game Over\");\n\n }\n }", "title": "" }, { "docid": "bde5d7ae72a5a76f87fcdd42b2f71cb4", "score": "0.5721119", "text": "function getToilet() {\n // SetChosenPath(\"toilet\"); \n var roll = Math.floor((Math.random() * 6) + 1);\n var message = \"\";\n freeTravel += roll;\n if (roll === 1) {\n message = \"<br>You also get 1 turn of free Travel\";\n } else {\n message = \"<br>You also get \" + roll + \" turns of free Travel\";\n }\n UpdateUserMessage(\"You have arrived at the toilet.\\nGet 2 Health Points for free.\\n\" + message);\n player1.hp += 2;\n updateStats();\n}", "title": "" }, { "docid": "af18cfd74dd3b84118d30c3a0f311df7", "score": "0.57195944", "text": "function eventKeyDown( e ) {\n \n //get the key pressed\n var keyPressed = String.fromCharCode(e.keyCode);\n //console.log( keyPressed );\n \n //-----------------------------------------------------------\n //move or change the ship or fire the laser\n \n //attack the other bot\n if ( keyPressed == \" \" ) { \n \n if(botArray[0].hp > 0 && botArray[1].hp > 0){\n if(botArray[0].attacking != true){\n //no attacking while you're already attacking!\n var aiDam = botArray[0].attack();\n botArray[1].hp -= aiDam; //ai bot takes the damage of your hit\n\n if(botArray[1].hp > 0){\n //can only attack if it's still alive\n\n var hitchance = getRandom(0, 100);\n //attack the other bot\n if(level == 1){\n if(hitchance > 70){\n //30% chance of this happening\n var pDam = botArray[1].attack();\n botArray[0].hp -= pDam; // you take damage from the hit\n }\n }\n else if(level == 2){\n if(hitchance > 40){\n //60% chance of this happening\n var pDam = botArray[1].attack();\n botArray[0].hp -= pDam; // you take damage from the hit\n }\n }\n else{ //level == 3\n if (hitchance > 10){\n //90% chance of this happening\n var pDam = botArray[1].attack();\n botArray[0].hp -= pDam; // you take damage from the hit\n }\n }\n }\n }\n }\n }\n \n }", "title": "" }, { "docid": "0ba4662fcf83345e71495df8ee718fb2", "score": "0.57166594", "text": "function play(req, res, act, stat, obj2index, senario){\n //Randomly assign an item for the AI.\n var ai = Math.floor(Math.random() * 5);\n var result = senario[obj2index[act]][ai];\n stat.outcome = result;\n //Add onto win,loss,tie list\n if (result == \"win\"){\n stat.wins+=1;\n } else if (result == \"lose\") {\n stat.losses+=1;\n } else if (result == \"tie\") {\n stat.ties+=1;\n } else {\n stat.outcome= \"did not count\";\n }\n status(res, stat);\n \n}", "title": "" }, { "docid": "0c256ab644b059a9818c6b70054d4587", "score": "0.5709608", "text": "function hit(){\n playerHit();\n sumOfCards();\n fakeRender();\n if (playerSum > 21){\n resultsEl.textContent = `You have busted with ${playerSum} You have lost ${player.bet}.`;\n setTimeout(processLose, 1500);\n }\n if (playerSum === 21) {\n resultsEl.textContent = `Blackjack! You have ${playerSum}. You have won ` + player.bet * 2;\n setTimeout(processWin, 1500);\n }\n}", "title": "" }, { "docid": "770e7a8da4ce3e11cc5f2befe9ae60fb", "score": "0.5709583", "text": "function Attack() {\n for (i = 0; i < zeds.length; i++) {\n zeds[i].attractionPoint(\n random(0.05, 0.5),\n player1.position.x,\n player1.position.y\n );\n zeds[i].rotateToDirection = true;\n }\n}", "title": "" }, { "docid": "32d4397e1360b4cae6460212a4764512", "score": "0.57046795", "text": "function fightPlayerOne(){\n attackBtn1.click(function() {\n player1.attack(player2);\n pleyerDefend = 0;\n turn = 2;\n activePlayer = 2;\n combat();\n });\n defendBtn1.click(function(){\n playerDefend = 1;\n turn = 2;\n activePlayer = 2;\n combat();\n \n })\n}", "title": "" }, { "docid": "6a6724b4e911c4072e818d9fe01cc252", "score": "0.57031786", "text": "attack(card, target) { socket.emit('attack', { card, target }); }", "title": "" }, { "docid": "42a55e8ed8373b8ae7bf8297bce9726a", "score": "0.5693391", "text": "function BossAttack1() {\n\t\t\t var angle;\n\t\t\t for (angle = 0; angle <= 20; angle++) {\n\t\t\t enemyBullet(body, enemy, layer, angle * 18, enemyBullets, healthBar);\n\t\t\t }\n\t\t }", "title": "" }, { "docid": "a6e5da02dabdf4238fc913096fbc6d1c", "score": "0.5692912", "text": "function enemysAttack (){\n if (win === false){\n let enemy1 = new Enemy(-200, enemyY() ,getRndInteger(60, 160));\n allEnemies.unshift(enemy1);\n allEnemies.length = 15;\n }\n else {\n winningMessage ();\n }\n}", "title": "" }, { "docid": "a6e5da02dabdf4238fc913096fbc6d1c", "score": "0.5692912", "text": "function enemysAttack (){\n if (win === false){\n let enemy1 = new Enemy(-200, enemyY() ,getRndInteger(60, 160));\n allEnemies.unshift(enemy1);\n allEnemies.length = 15;\n }\n else {\n winningMessage ();\n }\n}", "title": "" }, { "docid": "a6e5da02dabdf4238fc913096fbc6d1c", "score": "0.5692912", "text": "function enemysAttack (){\n if (win === false){\n let enemy1 = new Enemy(-200, enemyY() ,getRndInteger(60, 160));\n allEnemies.unshift(enemy1);\n allEnemies.length = 15;\n }\n else {\n winningMessage ();\n }\n}", "title": "" }, { "docid": "4d09efd418d7c7366c50d18dd9e21c0c", "score": "0.56919324", "text": "_doTrapEACAttack(character, effectResults) {\n return Promise.all([\n this.getEAC(character),\n CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)\n ])\n .then(tuple => {\n let ac = tuple[0] || 10;\n let roll = tuple[1];\n\n effectResults.ac = ac;\n effectResults.roll = roll;\n effectResults.trapHit = roll.total >= ac;\n return effectResults;\n });\n }", "title": "" }, { "docid": "11913cf54f29041be6835aa42223c070", "score": "0.5688661", "text": "function strikeenemy(damage) {\n\n if(eventLock() == \"locked\") return;\n\n menu.status = 'You prepare to strike your foe...';\n view();\n\n setTimeout(()=>{\n if (player.speed + player.weapon.speed >= enemy.current.speed) {\n enemy.current.health -= damage;\n checkDead();\n if (enemy.current.health < 0) enemy.current.health = 0;\n\n if (pmvariables.cover > enemy.current.ad) pmvariables.cover -= enemy.current.ad;\n else if (pmvariables.cover <= enemy.current.ad) {\n pmvariables.remainingcover = pmvariables.cover;\n pmvariables.cover = 0;\n player.health -= enemy.current.ad - pmvariables.remainingcover;\n view();\n }\n\n\n checkDead();\n if (player.health < 0) player.health = 0;\n\n }\n else {\n if (pmvariables.cover > enemy.current.ad) pmvariables.cover -= enemy.current.ad;\n else if (pmvariables.cover <= enemy.current.ad) {\n pmvariables.remainingcover = pmvariables.cover;\n pmvariables.cover = 0;\n player.health -= enemy.current.ad - pmvariables.remainingcover;\n view();\n }\n if (player.health < 0) player.health = 0;\n\n enemy.current.health -= damage;\n checkDead();\n if (enemy.current.health < 0) enemy.current.health = 0;\n }\n if (player.health > 0 && enemy.current.health > 0) {\n if(player.health < 50 && enemy.current.health > 50) {\n menu.status = \"You don't see yourself winning a head on engagement any longer. Perhaps you should change strategy.\"\n view();\n time.event = true;\n\n }\n else {\n if (pmvariables.cover > 0) {\n menu.status = \"You dealt \" + damage + \" damage to the \" + enemy.current.name + \", and the \"\n + enemy.current.name + \" dealt \" + enemy.current.ad + \" damage to your cover.\";\n view();\n time.event = true;\n }\n\n else if (pmvariables.remainingcover > 0) {\n menu.status = \"You dealt \" + damage + \" damage to the \" + enemy.current.name + \", and the \"\n + enemy.current.name + \" dealt \" + enemy.current.ad + \" damage to your cover and destroyed it!\";\n view();\n time.event = true;\n }\n\n else {\n menu.status = \"You dealt \" + damage + \" damage to the \" + enemy.current.name + \", and the \"\n + enemy.current.name + \" dealt \" + enemy.current.ad + \" damage to you.\";\n view();\n time.event = true;\n }\n\n\n }\n\n }\n else if (player.health == 0) {\n player.health = 100;\n player.ad = 7;\n time.event = true;\n return;\n }\n },500);\n\n}", "title": "" }, { "docid": "1e4536bd3f88a6d37f6ee9a426057f06", "score": "0.5686416", "text": "_doTrapStarshipACAttack(character, effectResults) {\n return Promise.all([\n this.getStarshipAC(character),\n CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)\n ])\n .then(tuple => {\n let ac = tuple[0] || 10;\n let roll = tuple[1];\n\n effectResults.ac = ac;\n effectResults.roll = roll;\n effectResults.trapHit = roll.total >= ac;\n return effectResults;\n });\n }", "title": "" }, { "docid": "d861be901ab7f34aac5a75d55229b72d", "score": "0.5683727", "text": "function er_action(){\n\tif (canGo == true && numClicks == 0){\n\t//canGo = false;\n\tnumClicks++;\n\tchp = chp - 5;\n \tconsole.log(\"user : reg attack\");\n\tif (chp<=0)\n\t{\n\t\tresetVariables();\n\t\tgame.state.start(\"win\");\n\t} \n\telse \n\t{\n\t\tcanGo = false;\n\t\taihealthBar.width = chp*8;\n \t\tchp_txt.setText(\"Hp : \" + chp);\n\t\tvar aiStat= \"Player did 5 damage!\";\n\t\tdoSlash(1);\n\t\tsleep(1000).then(function() {\n\t\tai_dmg(aiStat);\n\t\ttrueBattle(); });\n\t}\n\t}\n}", "title": "" }, { "docid": "2b0b6ae4961a338fb7d873a88631699a", "score": "0.5679232", "text": "attack(opponent) {\n // console.log which character was attacked and how much damage was dealt\n // Then, change the opponent's hitPoints to reflect this\n console.log(`${opponent.name} attacked and lost ${this.strength}`);\n opponent.hitPoints -= this.strength;\n }", "title": "" }, { "docid": "86042ed0c4614e4cf3e66759ad71cd6e", "score": "0.5675284", "text": "function hit()\n{\n \"use strict\";\n var trashCan = 0;\n var i=0;\n userCards.push(rShoe.pop());\n displayCard(userCards[userCards.length-1],s + 3,\"p\");\n//Adds and displays user card when hit.\n for (i=0;i<userCards.length;i+=1)\n {\n if ((cardTotal(userCards))>21 && userCards[i].value==11)\n {\n userCards[i].value = 1; \n break;\n }\n }\n if ((cardTotal(userCards))>21)\n {\n loss();\n return ;\n }\n if ((cardTotal(userCards))==21)\n { \n win();\n }\n document.getElementById(\"surrender\").disabled=true;\n s = s + 1;\n say(\"Player Total: \" + cardTotal(userCards));\n//Sets possible outcomes after hit.\n}", "title": "" }, { "docid": "154e13801b5eec31d606171e759623a7", "score": "0.56746525", "text": "function userHit() {\n\n\tif(remainCards.length==52){ //if game has not started\n\t\twindow.alert(\"Click DEAL!\");\n\t}else{\n\t\traiseButton.disabled=true;\n\t\t//distribute one card to player2\n\t\tplayer2.distributeCard(player2.cards.length);\n\t\tplayer2.showCards(pokerElements2);\n\t\tdocument.getElementById('value2').children[0].innerHTML=player2.totalValue();\n\n\t\tif (player2.totalValue()>21) { //player2 bust\n\t\t\tplayer1.result=\"WIN!\";\n\t\t\tplayer2.result=\"LOSE!\";\t\t\t\n\t\t\tplayer1.bet=0;\n\t\t\tplayer2.bet=0;\n\t\t\tplayer1.showCards(pokerElements1);\n\t\t\tshowResult();\n\t\t\tif (player2.betLeft==0) {\n\t\t\t\tvar playAgain=window.confirm(\"Ran out of money! Play again?\");\n\t\t\t\tif (playAgain) {\n\t\t\t\t\tplayer2.bet=10;\n\t\t\t\t\tplayer2.betLeft=90;\n\t\t\t\t\tdeal();\n\t\t\t\t}else{\n\t\t\t\t\tdocument.getElementById('deal').disabled=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tcomputerHit();\n\t\t}\t\t\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "7d411226874d77df7381151c0054fdec", "score": "0.56725407", "text": "function ouchie(){\n\t\tplaySound(ow);\n\t\tshit.addClass('itHurt');\n\t\tsetTimeout(function(){\n\t\t\tshit.removeClass('itHurt');\n\t\t},1000);\n\t}", "title": "" }, { "docid": "37b2d11d879946a7c6564298beb2c39d", "score": "0.5669443", "text": "targetAndAttack() {}", "title": "" }, { "docid": "200089d80a36b604cdcdfff4f0719ca3", "score": "0.56694007", "text": "function playerAttack() {\n\tif (!human.acceptingInput) return;\n\n\thuman.character.currentAction = new Attack(human.character, human.character.target);\n}", "title": "" }, { "docid": "985a20be1300b392ecd624dae84d8406", "score": "0.5650541", "text": "function checkForChimney(player) {\n for (let i = 0; i < chimneys.length; i++) {\n if (chimneys[i].position === player.total) {\n player.total = chimneys[i].targetPosition;\n placePlayer(player);\n if (player.title === 'player1') {\n $player1GameLog.text(`${player.displayName} went down the chimney`);\n }\n if (player.title === 'computer' ) {\n $computerGameLog.text(`${player.displayName} went down the chimney`);\n }\n }\n }\n}", "title": "" }, { "docid": "9cce3a6bda0a696c1a3cec4ef6170c13", "score": "0.56504834", "text": "canAfford() { return player.r.gifts.gte(this.cost())}", "title": "" }, { "docid": "9cce3a6bda0a696c1a3cec4ef6170c13", "score": "0.56504834", "text": "canAfford() { return player.r.gifts.gte(this.cost())}", "title": "" }, { "docid": "9cce3a6bda0a696c1a3cec4ef6170c13", "score": "0.56504834", "text": "canAfford() { return player.r.gifts.gte(this.cost())}", "title": "" }, { "docid": "9cce3a6bda0a696c1a3cec4ef6170c13", "score": "0.56504834", "text": "canAfford() { return player.r.gifts.gte(this.cost())}", "title": "" }, { "docid": "04af56b620bc91e39a526510a7241b97", "score": "0.564375", "text": "function attack() {\n defender.hp -= hero.ap;\n healthPercent(defender.hp, defender.maxHP, '#defender-hp');\n\n $('#hero-attack').html('You hit ' + defender.name + ' for <strong>' + hero.ap + '</strong>.');\n $('#defender .char-status').html('health: ' + defender.hp);\n\n if (defender.hp > 0) {\n hero.hp -= defender.cap;\n healthPercent(hero.hp, hero.maxHP, '#hero-hp');\n\n $('#defender-attack').html(defender.name + ' hit you for <strong>' + defender.cap + '</strong>.');\n $('#hero .char-status').html('health: ' + hero.hp);\n }\n hero.ap += hero.baseAP;\n }", "title": "" }, { "docid": "45c57965487b0b84f88be13c98d0ce35", "score": "0.56422514", "text": "async fight(player1, player2, taunted, embed) {\n\t\tlet channel = player1.channel;\t\n\t\tlet world = await sql.getWorld(channel);\n\n\t\tembed.setTitle(`EPISODE ${world.episode}: ${embed.title}`);\n\n\t\t// If fighters are training - take them out of training and power them up\n\t\tawait this.completeTraining(player1);\n\t\tawait this.completeTraining(player2);\n\n\t\t// Get our power levels\n\t\tlet level1 = this.getPowerLevel(player1);\n\t\tlet level2 = this.getPowerLevel(player2);\n\n\t\tlet underlingPowered = false;\n\t\tif(player2.isNemesis) {\n\t\t\t// Someone attacked the Nemesis, summon underlings!\n\t\t\tlet underlingsMessages = [];\n\t\t\tconst underlings = await sql.getUnderlings(channel);\n\t\t\tfor(const i in underlings) {\n\t\t\t\tconst h = await sql.getPlayerById(underlings[i].id);\n\t\t\t\tif(!h) continue;\n\t\t\t\tif(!h.status.find(s => s.type == enums.Statuses.Dead) && \n\t\t\t\t\t!h.status.find(s => s.type == enums.Statuses.Annihilation) && h.id != player1.id && \n\t\t\t\t\t!h.status.find(s => s.type == enums.Statuses.Journey)) {\n\t\t\t\t\t// Living underling, send energy\n\t\t\t\t\tconst boost = this.getPowerLevel(h) * (1 - 0.2 * underlings[i].defeats);\n\t\t\t\t\tif(boost > 0) {\n\t\t\t\t\t\tunderlingsMessages.push(`${h.name} boosts ${player2.name}'s energy by ${numeral(boost.toPrecision(2)).format('0,0')}!`);\n\t\t\t\t\t}\n\t\t\t\t\tlevel2 += boost;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(underlingsMessages.length > 0) {\n\t\t\t\tunderlingPowered = true;\n\t\t\t\tembed.addField('The Nemesis summons underlings!', underlingsMessages.join('\\n'));\n\t\t\t}\n\t\t}\n\t\tembed.addField('Power Levels', `${player1.name}: ${numeral(level1.toPrecision(3)).format('0,0')}\\n${player2.name}: ${numeral(level2.toPrecision(3)).format('0,0')}`);\n\t\t\n\t\t// Randomize, then adjust skill ratings\n\t\tlet skill1 = 0;\n\t\tlet skill2 = 0;\n\t\tfor(let i = 0; i < settings.BattleDice; i++) {\n\t\t\tskill1 += Math.random();\n\t\t\tskill2 += Math.random();\n\t\t}\n\t\tskill1 *= 2 / settings.BattleDice;\n\t\tskill2 *= 2 / settings.BattleDice;\n\t\t\n\t\tconst history = await sql.getHistory(player1.id, player2.id);\n\t\tif(history && history.length > 0) {\n\t\t\t// Calculate revenge bonus from losing streak\n\t\t\tconst revengePlayerId = history[0].winnerId == player1.id ? player2.id : player1.id;\n\t\t\tlet battles = 0;\n\t\t\twhile(battles < history.length && history[battles].loserId == revengePlayerId) {\n\t\t\t\tbattles++;\n\t\t\t}\n\t\t\tif(player1.id == revengePlayerId) {\n\t\t\t\tconsole.log(`${player1.name} skill +${battles}0% due to revenge bonus`);\n\t\t\t\tskill1 += 0.1 * battles;\n\t\t\t}\n\t\t\tif(player2.id == revengePlayerId) {\n\t\t\t\tconsole.log(`${player2.name} skill +${battles}0% due to revenge bonus`);\n\t\t\t\tskill2 += 0.1 * battles;\n\t\t\t}\n\t\t}\n\n\t\tif(player1.isNemesis) {\n\t\t\tskill2 += 0.15;\n\t\t}\n\t\tif(player2.isNemesis) {\n\t\t\tskill1 += 0.15;\n\t\t}\n\t\t\n\t\tif(player1.isUnderling) {\n\t\t\tskill2 += 0.075;\n\t\t}\n\t\tif(player2.isUnderling) {\n\t\t\tskill1 += 0.075;\n\t\t}\n\n\t\tif(player1.status.find(s => s.type == enums.Statuses.TrainingComplete && skill1 < 1)) {\n\t\t\tskill1 = 1;\n\t\t}\n\t\tif(player2.status.find(s => s.type == enums.Statuses.TrainingComplete && skill2 < 1)) {\n\t\t\tskill2 = 1;\n\t\t}\n\t\t\n\t\tconsole.log(`${player1.name}: PL ${Math.floor(level1 * 10) / 10}, Skill ${Math.floor(skill1 * 10) / 10}`);\n\t\tconsole.log(`${player2.name}: PL ${Math.floor(level2 * 10) / 10}, Skill ${Math.floor(skill2 * 10) / 10}`);\n\t\t\n\t\t// Final battle scores!\n\t\tconst score1 = Math.sqrt(level1 * skill1);\n\t\tconst score2 = Math.sqrt(level2 * skill2);\n\t\t\n\t\tlet battleLog = '';\n\t\tif(skill1 < 0.8) {\n\t\t\tbattleLog += `${player1.name} underestimates ${this.their(player1.config.Pronoun)} foe!`;\n\t\t} else if(skill1 > 1.6) {\n\t\t\tbattleLog += `${player1.name} goes *even further beyond!*`;\n\t\t} else if(skill1 > 1.2) {\n\t\t\tbattleLog += `${player1.name} surpasses ${this.their(player1.config.Pronoun)} limits!`;\n\t\t} else {\n\t\t\tbattleLog += `${player1.name} fights hard!`;\n\t\t}\n\t\tbattleLog += ` Battle rating: ${numeral(score1.toPrecision(2)).format('0,0')}\\n`;\n\t\t\n\t\tif(skill2 < 0.8) {\n\t\t\tbattleLog += `${player2.name} underestimates ${this.their(player2.config.Pronoun)} foe!`;\n\t\t} else if(skill2 > 1.6) {\n\t\t\tbattleLog += `${player2.name} goes *even further beyond!*`;\n\t\t} else if(skill2 > 1.2) {\n\t\t\tbattleLog += `${player2.name} surpasses ${this.their(player2.config.Pronoun)} limits!`;\n\t\t} else {\n\t\t\tbattleLog += `${player2.name} fights hard!`;\n\t\t}\n\t\tbattleLog += ` Battle rating: ${numeral(score2.toPrecision(2)).format('0,0')}\\n`;\n\t\t\n\t\tembed.addField('Ready? Fight!', battleLog);\n\t\n\t\t// Determine winner - player[0] defeats player[1]\n\t\tlet players = [];\n\t\tif(score1 > score2) {\n\t\t\tplayers = [player1, player2];\n\t\t\tskills = [skill1, skill2];\n\t\t} else {\n\t\t\tplayers = [player2, player1];\n\t\t\tskills = [skill2, skill1];\n\t\t}\n\t\t\n\t\tconst nemesisHistory = players[1].isNemesis ? await sql.getNemesisHistory(channel) : null;\n\t\tconst outcome = await this.handleFightOutcome(world, players[0], players[1], skills[0], skills[1], \n\t\t\ttaunted && players[1].id == player2.id, nemesisHistory, underlingPowered);\n\t\tembed.addField('Results', outcome);\n\n\t\treturn embed;\n\t}", "title": "" }, { "docid": "029a41f20659c1312a5ee79233ab66cf", "score": "0.56419605", "text": "function act_just_pray() {\n if (rnd(100) < 75) {\n updateLog(` Nothing happens`);\n } else if (rnd(43) == 10) {\n /*\n v12.4.5 - prevents our hero from getting too many free +AC/WC\n */\n crumble_altar();\n return 'crumble';\n } else if (rnd(43) == 10) {\n if (player.WEAR || player.SHIELD) {\n updateLog(` You feel your armor vibrate for a moment`);\n }\n enchantarmor();\n return 'ac';\n } else if (rnd(43) == 10) {\n if (player.WIELD) {\n updateLog(` You feel your weapon vibrate for a moment`);\n }\n enchweapon();\n return 'wc';\n } else {\n createmonster(makemonst(level + 1));\n }\n return;\n}", "title": "" }, { "docid": "d63ef413ad4b1e3e9acc48ca72a30c61", "score": "0.56417084", "text": "function attackButton(){\n attackCycle(playerCharacter, monsterCharacter);\n}", "title": "" }, { "docid": "3ac71d61ee57cafe47df72a2ac0353cb", "score": "0.5641571", "text": "eat() {\n this.score += 1;\n this.moves += reward;\n this.addTail();\n }", "title": "" }, { "docid": "fe23f1836a378b21023e787b9657163d", "score": "0.5640826", "text": "function stats() {\n var player = battle.player;\n var enemy = battle.enemy;\n var reply = \"stats\\n\";\n var info = [];\n if (!battle.enemy.equipedWeapon) {\n var enemyWeapon = \"nothing\";\n var enemyWeaponAP = 0;\n } else {\n var enemyWeapon = battle.enemy.equipedWeapon.name;\n var enemyWeaponAP = battle.enemy.equipedWeapon.attackPower;\n }\n if (!battle.player.equipedWeapon) {\n var playerWeapon = \"nothing\";\n var playerWeaponAP = 0;\n } else {\n var playerWeapon = battle.player.equipedWeapon.name;\n var playerWeaponAP = battle.player.equipedWeapon.attackPower;\n }\n var totalDEFplayer = player.defense;\n for (var armor in player.equipedArmor) {\n if (player.equipedArmor.hasOwnProperty(armor) && player.equipedArmor[armor]) {\n totalDEFplayer += player.equipedArmor[armor].defense;\n }\n }\n var totalDEFenemy = enemy.defense;\n for (var armor in enemy.equipedArmor) {\n if (enemy.equipedArmor.hasOwnProperty(armor) && enemy.equipedArmor[armor]) {\n totalDEFenemy += enemy.equipedArmor[armor].defense;\n }\n }\n // add all the rows to the array\n info.push([\"name\", player.name, enemy.name]); // push names\n info.push([\"lvl\", player.lvl.toString(), enemy.lvl.toString()]); // push lvl\n info.push([\"DEF\", player.defense.toString(), enemy.defense.toString()]); // defense\n info.push([\"AP\", player.attackPower.toString(), enemy.attackPower.toString()+\"\\n\"]); // attack power\n info.push([\"weapon\", playerWeapon, enemyWeapon]); // weapon name\n info.push([\"weapon AP\", playerWeaponAP.toString(), enemyWeaponAP.toString()+\"\\n\"]); // weapon attackPower\n info.push([\"total AP\", (player.attackPower + playerWeaponAP).toString(), (enemy.attackPower + enemyWeaponAP).toString()]); // total AP the person has\n info.push([\"total DEF\", totalDEFplayer.toString(), totalDEFenemy.toString()]); // total defense points\n\n reply += textGrid(info);\n msg.reply(\"```\"+reply+\"```\"); // add it to a code block to get the monospaced font\n msg.content = \"battle\";\n battle.status = 0;\n battleHandler(battle, msg);\n }", "title": "" }, { "docid": "bd4edaab45976d49e2e4eaefabfb15ae", "score": "0.5636041", "text": "selectAttack() {\n let randomAttack = Math.floor(Math.random() * this.enemies[hercules.currentEnemy].attacks.length);\n this.enemies[hercules.currentEnemy].currentAttack = this.enemies[hercules.currentEnemy].attacks[randomAttack];\n alert(`${this.enemies[hercules.currentEnemy].name} chose to use ${this.enemies[hercules.currentEnemy].currentAttack}, this does ${this.enemies[hercules.currentEnemy].atkPower} damage to Hercules`);\n }", "title": "" }, { "docid": "a64b32fcadb5f0df6de00458e54d9841", "score": "0.56282073", "text": "function playerHit(){\n if(player[\"state\"] < 161){\n plhit.play();\n enemyBullets.length = 0;\n if(!--player[\"lives\"]){\n pause();\n endGameSelections();\n }\n player[\"state\"] = 199;\n player.position.x = borders.width/2;\n player.position.y = borders.height*0.7;\n let lives = '';\n for(let i=0; i<player[\"lives\"]; i++){\n lives += ' 💖';\n }\n document.getElementById(\"lives\").innerHTML = lives;\n }\n}", "title": "" }, { "docid": "9c7ecc039ad4dec25a6235fcffaf4e47", "score": "0.56241107", "text": "_doTrapAttack(character, effect) {\n let ac = getAC(character);\n effect.ac = ac;\n\n return TrapThemeHelper.rollAsync('1d20 + ' + effect.attack)\n .then((atkRoll) => {\n effect.roll = atkRoll;\n effect.trapHit = atkRoll.total >= ac;\n return effect;\n });\n }", "title": "" }, { "docid": "270a064e4f987e22e4436e26e63c129b", "score": "0.5617372", "text": "function playerAction() {\n // Does nothing if no cards in hand\n if ( Choop.hand.length === 0 ) {\n return \n }\n // Calls the Choop.play method against Doop\n let choopAttack = Choop.play();\n console.log(choopAttack)\n Doop.defend(choopAttack)\n // Update the health and armor of both\n healthArmorUpdate(player1, Choop);\n healthArmorUpdate(monster1, Doop);\n // Clears the cards, updates the deck numbers, hides the spell\n handWrapper.innerHTML = \"\"\n drawDeck.firstElementChild.innerText = Choop.drawDeck.length;\n discardDeck.innerText = Choop.discardDeck.length;\n spell.style.display = \"none\";\n // Add a set interval throughout this part\n if ( Doop.alive ) {\n monsterAction();\n } else {\n alert(\"You have slain the monster!\")\n }\n}", "title": "" }, { "docid": "29f2890167491130750996baab43f2e9", "score": "0.5617231", "text": "hit() {\n _target.moodScore++;\n _target.hits++;\n _target.healthScore -= 2;\n }", "title": "" }, { "docid": "bc0425a55df1a5cdf8118e5c94ebd845", "score": "0.5608852", "text": "function traps(traps) {\n \n switch (traps.tileNumber){\n case 3:\n case 25:\n spikeTrap(traps);\n playerCardPosition(traps);\n break;\n case 14:\n case 28:\n whiteWalker(traps);\n playerCardPosition(traps);\n break;\n case 7:\n dragonEgg(traps);\n playerCardPosition(traps);\n break;\n case 8:\n case 17:\n firetrap(traps);\n playerCardPosition(traps);\n break;\n case 30:\n checkIfWon(traps);\n }\n\n /*stopping the players form going over 30*/\n if (traps.tileNumber > 30) {\n traps.tileNumber = traps.tileNumber - diceNumber;\n }\n}", "title": "" }, { "docid": "8e740f3209bcd19b5ed119d2a965de0a", "score": "0.5602102", "text": "attackEnemy(hitPower, target) {\n target.takeHit(hitPower);\n }", "title": "" }, { "docid": "10f5c5276921b894d29021f38a87f15f", "score": "0.55992174", "text": "_doTrapAttack(character, effect) {\n return Promise.all([\n TrapThemeHelper.getSheetAttr(character, 'AC'),\n TrapThemeHelper.rollAsync('1d20 + ' + effect.attack)\n ])\n .then((tuple) => {\n let ac = tuple[0];\n let atkRoll = tuple[1];\n\n effect.ac = ac || '??';\n effect.roll = atkRoll;\n if(ac)\n effect.trapHit = atkRoll.total >= ac;\n else\n effect.trapHit = 'AC unknown';\n\n return effect;\n });\n }", "title": "" }, { "docid": "3acf332e160613b612817ae2f73538e8", "score": "0.5599167", "text": "firstDeal() {\n delay(() => this.playerHit(), 500)\n .delay(() => this.playerHit(), 500);\n }", "title": "" }, { "docid": "8aa85e2bd1f4e9207425ee1aad016df5", "score": "0.55957466", "text": "function C101_KinbakuClub_BlindMansBuff_WhatHappened() {\n\tC101_KinbakuClub_BlindMansBuff_Result = Math.floor(Math.random() * 20);\n\tif ((C101_KinbakuClub_BlindMansBuff_Result <= 3) && (!C101_KinbakuClub_BlindMansBuff_TooSlow)) {\n\t\tC101_KinbakuClub_BlindMansBuff_CurrentStage = 20;\n\t\tC101_KinbakuClub_BlindMansBuff_Random = Math.floor(Math.random() * 4);\n\t\tif (C101_KinbakuClub_BlindMansBuff_Random == 0)\tOverridenIntroText = GetText(\"Lost0\");\n\t\tif (C101_KinbakuClub_BlindMansBuff_Random == 1) OverridenIntroText = GetText(\"Lost1\");\n\t\tif (C101_KinbakuClub_BlindMansBuff_Random == 2) OverridenIntroText = GetText(\"Lost2\");\n\t\tif (C101_KinbakuClub_BlindMansBuff_Random == 3) OverridenIntroText = GetText(\"Lost3\");\n\t}\n\tif ((C101_KinbakuClub_BlindMansBuff_Result <= 3) && (C101_KinbakuClub_BlindMansBuff_TooSlow)) {\n\t\tC101_KinbakuClub_BlindMansBuff_CurrentStage = 20;\n\t\tOverridenIntroText = GetText(\"Lost1\");\n\t}\n\tC101_KinbakuClub_BlindMansBuff_TooSlow = false;\n\tif (C101_KinbakuClub_BlindMansBuff_Result >= 16) {\n\t\tif (!PlayerHasLockedInventory(\"Cuffs\")) {\n\t\t\tC101_KinbakuClub_BlindMansBuff_TouchSomebody = true;\n\t\t\tOverridenIntroText = GetText(\"Touching\");\n\t\t}\n\t\tif (PlayerHasLockedInventory(\"Cuffs\")) {\n\t\t\tC101_KinbakuClub_BlindMansBuff_FeelSomebody = true;\n\t\t\tOverridenIntroText = GetText(\"Feeling\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6796357e65774057771b243bc98a57da", "score": "0.5594872", "text": "function checkForBusts() {\n var playerPoints = playerHand.getPoints();\n if (playerPoints > 21) {\n var messages = document.getElementById('messages');\n messages.textContent = 'You busted. Better luck next time!';\n return true;\n }\n var dealerPoints = dealerHand.getPoints();\n if (dealerPoints > 21) {\n var messages = document.getElementById('messages');\n messages.textContent = 'Dealer busted. You win!';\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "d99a256d7ce8bd85c4e5dd574f7b86a6", "score": "0.5592131", "text": "function twoinarow(player){\n}", "title": "" }, { "docid": "0348f2080442907b6aa15ac292cdeb9d", "score": "0.5591309", "text": "function hit(){\n\tif(robot_receivedShot() == true){\n\t\trequest(\n\t\t\t{\n\t\t\t\turl: \"http://172.31.41.35:3000/game/0/player/\" + user_details.id + \"/hit\",\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tjson: true\n\t\t\t},\n\t\t\t\tfunction (error, response, body){\n\t\t\t\t\tconsole.log('We got hit and damage is done');\n\t\t\t\t});\n\t}\n\t\n}", "title": "" }, { "docid": "02f5992a00738c1bc026909489fd3a7c", "score": "0.5590976", "text": "function checkIfHit(){\n\n\t// if it hits tank 1\n\tif(x>t1x && x<(t1x + 20) && y>t1y && y<(t1y + 10) && exVar == true){\n\t\tconsole.log(\"hit tank 1\")\n\t\thealth1 -= explodePower\n\t\texplode = true\n\t\tfire = false\n\t\tp2Money += (explodePower * 1000)\n\t\tp1Money += (explodePower * 100)\n\t\tswitchTurn()\n\t\tconsole.log(\"switched\")\n\t\texVar = false\n\t\tifLoose()\n\t// if it hits tank 2 \n\t} else if(x>t2x && x<(t2x + 20) && y>t2y && y<(t2y + 10) && exVar == true) {\n\t\tconsole.log(\"hit tank 2\")\n\t\tp1Money += (explodePower * 1000)\n\t\tp2Money += (explodePower * 100)\n\t\thealth2-=explodePower\n\t\texplode = true\n\t\tfire = false\n\t\tswitchTurn()\n\t\texVar = false\n\t\tifLoose()\n\t// if it hits the ground\n\t}else if(y>canvas.height){\n\t\t\tfire = false\n\t\t\tswitchTurn();\n\t\t\tescaped = true\n\t\t\ty = 0\n\t\t\tballColor = \"lightblue\"\n\t\t\n\t\t\n\t\t\n\t\t\n\t}\n\n\tupdateHealth()\n\n}", "title": "" }, { "docid": "5afb8392d2bc84e212f0018110611be9", "score": "0.5590862", "text": "function attackAnime(){\n\tif(HP > 0){\n\t\tvar j = 10;\n\t\t\n\t\tif(facing == \"W\"){\n\t\t\tcurrX2 = 781;\n\t\t\tcurrY2 = 1601;\n\t\t\twhile (j != 0){\n\t\t\t\tctx.drawImage(playerImage,\n\t\t\t\t\tcurrX2, currY2, // sprite upper left positino\t\n\t\t\t\t\tCHAR_WIDTH2, CHAR_HEIGHT2, // size of a sprite 64 x 64\n\t\t\t\t\tCHAR_START_X-64, CHAR_START_Y, // canvas position\n\t\t\t\t\tCHAR_WIDTH2*1, CHAR_HEIGHT2*1 // sprite size shrinkage\n\t\t\t\t);\n\t\t\t\t//currX2 += 188;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if(facing == \"E\"){\n\t\t\tcurrX2 = 841;\n\t\t\tcurrY2 = 1986;\n\t\t\twhile (j != 0){\n\t\t\t\tctx.drawImage(playerImage,\n\t\t\t\t\tcurrX2, currY2, // sprite upper left positino\t\n\t\t\t\t\tCHAR_WIDTH2, CHAR_HEIGHT2, // size of a sprite 64 x 64\n\t\t\t\t\tCHAR_START_X + 4, CHAR_START_Y, // canvas position\n\t\t\t\t\tCHAR_WIDTH2*1, CHAR_HEIGHT2*1 // sprite size shrinkage\n\t\t\t\t);\n\t\t\t\t//currX2 += 188;\n\t\t\t\tj--;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tj = 5;\n\t\t//currX2 = 593;\n\t\t//Plays the sound for the sword attack\n\t\tvar sword = new Audio('sounds/Drop Sword-SoundBible.com-768774345.mp3');\n\t\tsword.play();\n\t}\n}", "title": "" } ]
6a9e2082055f34e6404c85bcdb0a2d67
Constructor method for MongoAccess class
[ { "docid": "d6ec7597fee799f6ecfb036744433c47", "score": "0.0", "text": "constructor(){\n this.app = new App();\n this.div_title = this.app.add_div();\n this.div_form = this.app.add_div();\n this.load_title_div();\n }", "title": "" } ]
[ { "docid": "3f49e7e73b61dc1104d28e741b43a0c3", "score": "0.7198808", "text": "constructor() {\n this.collection = 'category'\n this.mongoDB = new MongoLib()\n }", "title": "" }, { "docid": "1f49960daf9e232f2b9a58debcf5f8aa", "score": "0.7092769", "text": "constructor() {\n if (Init.instance == null) Init.instance = this;\n\n const config = ctrlLib.getConfig();\n this.MongoURL = config.MongoDB.url;\n this.MongoName = config.MongoDB.dbname;\n ({MongoClient: this.MongoClient} = mongodb);\n\n return Init.instance;\n }", "title": "" }, { "docid": "58c0ef806e3ff6bbe039cbdae81ccab0", "score": "0.70926976", "text": "constructor(db, collection) {\n this.db = db;\n this.collection = collection;\n }", "title": "" }, { "docid": "7b6dc5377c19e80c7f9d9cffe084bcf1", "score": "0.7032377", "text": "constructor(db, collection) {\n this.db = db;\n this.collection = collection === '' ? undefined : collection;\n }", "title": "" }, { "docid": "4fa45b3e9f9952f4c850c810a12d85b0", "score": "0.69658995", "text": "async init() {\n this.database = await mongo.connect(this.dbUrl, { useNewUrlParser: true });\n this.dbo = this.database.db(\"docs\");\n\n }", "title": "" }, { "docid": "387bde8fbdbc19df4b5ad18969167a8e", "score": "0.69460344", "text": "function MongoMockNew (dbObj) {\n this.db = dbObj;\n}", "title": "" }, { "docid": "6fa3f4e39b566e7f9c5faba710550638", "score": "0.6862647", "text": "function MongoDatabaseHelper() {\r\n /**\r\n * The URI for the Mongo connection.\r\n * @type {string}\r\n */\r\n this.uri = MONGO_CONFIG.uri || '';\r\n}", "title": "" }, { "docid": "bc56f68e99ce1327fde95e949629716f", "score": "0.6766736", "text": "constructor(props) {\n Object.assign(this, props);\n for (const k of OBJECTS) {\n this[k] = props.db.collection(k);\n }\n }", "title": "" }, { "docid": "3f6060e271d294943290ba2db801a920", "score": "0.66455907", "text": "function init (args,cb) {\n\t\tvar ertieneca = this;\n\t\tdbProvider= new MongoProvider(seneca.log);\n\t\tdbProvider.data(config.mongo_connection,config.mongo_options,function(err,db){\n\t\t\tif (err){cb(err)}\n\t\t\t\tdbClient = new MongoStore(db,seneca.log);\n\t\t\t\treturn cb();\n \t\t}); // end mongo provider\n\t}", "title": "" }, { "docid": "55df0312691f618d00a84983418672ee", "score": "0.6574314", "text": "constructor(params, options) {\n this.methods = {};\n this.statics = {}; // TODO research this in Mongoose\n\n //this.def = params;\n this.obj = params; // for Mongoose compatibility\n this.options = options; // unused\n //if (CONNECT_MONGO) this.mongo = new monSchema(params);\n }", "title": "" }, { "docid": "194d67d8efb74b1fd92a17381236de72", "score": "0.6512799", "text": "function MongoStore() {\n var self = new store.Store()\n var parent = self.parent()\n\n var mark = common.idgen(4)\n\n\n self.name = 'mongo'\n\n\n // TODO: make private?\n self.waitmillis = MIN_WAIT\n self.dbinst = null\n self.collmap = {}\n\n\n function error(args,err,cb) {\n if( err ) {\n seneca.log(args.tag$,'error: '+err)\n seneca.fail({code:'entity/error',store:self.name},cb)\n\n if( 'ECONNREFUSED'==err.code || 'notConnected'==err.message ) {\n if( MIN_WAIT == self.waitmillis ) {\n self.collmap = {}\n reconnect(args)\n }\n }\n\n return true\n }\n\n return false\n }\n\n\n function reconnect(args) {\n seneca.log(args.tag$,'attempting db reconnect')\n\n self.configure(self.spec, function(err,me){\n if( err ) {\n seneca.log(args.tag$,'db reconnect (wait '+self.waitmillis+'ms) failed: '+err)\n self.waitmillis = Math.min(2*self.waitmillis,MAX_WAIT)\n setTimeout( function(){reconnect(args)}, self.waitmillis )\n }\n else {\n self.waitmillis = MIN_WAIT\n seneca.log(args.tag$,'reconnect ok')\n }\n })\n }\n\n\n self.db = function() {\n return self.dbinst;\n }\n\n\n self.init = function(si,opts,cb) {\n parent.init(si,opts,function(err,canondesc){\n if( err ) return cb(err);\n mark = canondesc+'~'+mark\n\n // TODO: parambulator check on opts\n\n seneca = si\n\n self.configure(opts,function(err){\n if( err ) {\n return seneca.fail({code:'entity',store:self.name,error:err},cb)\n } \n else cb();\n })\n })\n }\n\n\n\n self.configure = function(spec,cb) {\n self.spec = spec\n\n var conf = 'string' == typeof(spec) ? null : spec\n\n if( !conf ) {\n conf = {}\n var urlM = /^mongo:\\/\\/((.*?):(.*?)@)?(.*?)(:?(\\d+))?\\/(.*?)$/.exec(spec);\n conf.name = urlM[7]\n conf.port = urlM[6]\n conf.server = urlM[4]\n conf.username = urlM[2]\n conf.password = urlM[3]\n\n conf.port = conf.port ? parseInt(conf.port,10) : null\n }\n\n if( conf.replicaset ) {\n var rservs = []\n for( var i = 0; i < conf.replicaset.servers.length; i++ ) {\n\tvar servconf = conf.replicaset.servers[i]\n\trservs.push(new mongo.Server(servconf.host,servconf.port,{native_parser:false,auto_reconnect:true}))\n }\n var rset = new mongo.ReplSetServers(rservs)\n self.dbinst = new mongo.Db(\n\tconf.name, rset\n )\n }\n else {\n self.dbinst = new mongo.Db(\n conf.name,\n new mongo.Server(\n conf.host || conf.server, \n conf.port || mongo.Connection.DEFAULT_PORT, \n {}\n ), \n {native_parser:false,auto_reconnect:true}\n )\n }\n\n self.dbinst.open(function(err){\n if( !error({tag$:'init'},err,cb) ) {\n self.waitmillis = MIN_WAIT\n\n if( conf.username ) {\n self.dbinst.authenticate(conf.username,conf.password,function(err){\n // do not attempt reconnect on auth error\n if( err) {\n cb(err)\n }\n else {\n seneca.log({tag$:'init'},'db open and authed for '+conf.username)\n cb(null,self)\n }\n })\n }\n else {\n seneca.log({tag$:'init'},'db open')\n cb(null,self)\n }\n }\n });\n }\n\n\n self.close$ = function(cb) {\n if(self.dbinst) {\n self.dbinst.close(cb)\n }\n }\n\n \n self.save$ = function(args,cb) {\n var ent = args.ent \n\n var update = !!ent.id;\n\n getcoll(args,ent,function(err,coll){\n if( !error(args,err,cb) ) {\n var entp = {};\n\n var fields = ent.fields$()\n fields.forEach( function(field) {\n entp[field] = ent[field]\n })\n\n if( update ) {\n coll.update({_id:makeid(ent.id)},entp,{upsert:true},function(err,update){\n if( !error(args,err,cb) ) {\n seneca.log(args.tag$,'save/update',ent,mark)\n cb(null,ent)\n }\n })\n }\n else {\n coll.insert(entp,function(err,inserts){\n if( !error(args,err,cb) ) {\n ent.id = inserts[0]._id.toHexString()\n\n seneca.log(args.tag$,'save/insert',ent,mark)\n cb(null,ent)\n }\n })\n }\n }\n })\n }\n\n\n self.load$ = function(args,cb) {\n var qent = args.qent\n var q = args.q\n\n getcoll(args,qent,function(err,coll){\n if( !error(args,err,cb) ) {\n var mq = metaquery(qent,q)\n var qq = fixquery(qent,q)\n\n coll.findOne(qq,mq,function(err,entp){\n if( !error(args,err,cb) ) {\n var fent = null;\n if( entp ) {\n entp.id = entp._id.toHexString();\n delete entp._id;\n\n fent = qent.make$(entp);\n }\n\n seneca.log(args.tag$,'load',fent,mark)\n cb(null,fent);\n }\n });\n }\n })\n }\n\n\n self.list$ = function(args,cb) {\n var qent = args.qent\n var q = args.q\n\n getcoll(args,qent,function(err,coll){\n if( !error(args,err,cb) ) {\n var mq = metaquery(qent,q)\n var qq = fixquery(qent,q)\n\n coll.find(qq,mq,function(err,cur){\n if( !error(args,err,cb) ) {\n var list = []\n\n cur.each(function(err,entp){\n if( !error(args,err,cb) ) {\n if( entp ) {\n var fent = null;\n if( entp ) {\n entp.id = entp._id.toHexString();\n delete entp._id;\n\n fent = qent.make$(entp);\n }\n list.push(fent)\n }\n else {\n seneca.log(args.tag$,'list',list.length,list[0],mark)\n cb(null,list)\n }\n }\n })\n }\n })\n }\n })\n }\n\n\n self.remove$ = function(args,cb) {\n var qent = args.qent\n var q = args.q\n\n getcoll(args,qent,function(err,coll){\n if( !error(args,err,cb) ) {\n var qq = fixquery(qent,q) \n\n if( q.all$ ) {\n coll.remove(qq,function(err){\n cb(err)\n })\n }\n else {\n var mq = metaquery(qent,q)\n coll.findOne(qq,mq,function(err,entp){\n if( !error(args,err,cb) ) {\n if( entp ) {\n coll.remove({_id:entp._id},function(err){\n cb(err)\n })\n }\n else cb(null)\n }\n })\n }\n }\n })\n }\n\n\n var fixquery = function(qent,q) {\n var qq = {};\n for( var qp in q ) {\n if( !qp.match(/\\$$/) ) {\n qq[qp] = q[qp]\n }\n }\n if( qq.id ) {\n qq._id = makeid(qq.id)\n delete qq.id\n }\n\n return qq\n }\n\n\n var metaquery = function(qent,q) {\n var mq = {}\n\n if( q.sort$ ) {\n for( var sf in q.sort$ ) break;\n var sd = q.sort$[sf] < 0 ? 'descending' : 'ascending'\n mq.sort = [[sf,sd]]\n }\n\n if( q.limit$ ) {\n mq.limit = q.limit$\n }\n\n if( q.fields$ ) {\n mq.fields = q.fields$\n }\n\n return mq\n }\n\n\n var getcoll = function(args,ent,cb) {\n var canon = ent.canon$({object:true})\n\n var collname = (canon.base?canon.base+'_':'')+canon.name\n\n if( !self.collmap[collname] ) {\n self.dbinst.collection(collname, function(err,coll){\n if( !error(args,err,cb) ) {\n self.collmap[collname] = coll\n cb(null,coll);\n }\n });\n }\n else {\n cb(null,self.collmap[collname])\n }\n }\n\n return self\n}", "title": "" }, { "docid": "4d9f76f67818a47af471f08a54e46822", "score": "0.64999306", "text": "constructor(db) {\n this.s = { db };\n }", "title": "" }, { "docid": "4d9f76f67818a47af471f08a54e46822", "score": "0.64999306", "text": "constructor(db) {\n this.s = { db };\n }", "title": "" }, { "docid": "92d2bdff4fa485d22540dd4924a97783", "score": "0.6496166", "text": "constructor(snapshotCollection) {\n // store the collection that holds doc snapshots\n this.snapshotCollection = snapshotCollection;\n // maintain an object containing all authorities, one authority per doc in the format { <docId1>: ProseMeteorAuthority, <docId2>: ProseMeteorAuthority }\n this.authorities = {};\n }", "title": "" }, { "docid": "0fed76e05f749c76dd91df35d92b86d4", "score": "0.6485468", "text": "initCollection() {\n // MongoDB just works, we dont need to do anything\n }", "title": "" }, { "docid": "d819731edd7eb531702d76c27478c477", "score": "0.6482254", "text": "constructor(){\n this.server = express();\n this.port = process.env.PORT;\n this.mongDb = new MongoClass();\n }", "title": "" }, { "docid": "506d78cfe7c2f19e60e558cd71f844f6", "score": "0.64804196", "text": "constructor(db, name, options) {\n var _a, _b;\n (0, utils_1.checkCollectionName)(name);\n // Internal state\n this.s = {\n db,\n options,\n namespace: new utils_1.MongoDBNamespace(db.databaseName, name),\n pkFactory: (_b = (_a = db.options) === null || _a === void 0 ? void 0 : _a.pkFactory) !== null && _b !== void 0 ? _b : utils_1.DEFAULT_PK_FACTORY,\n readPreference: read_preference_1.ReadPreference.fromOptions(options),\n bsonOptions: (0, bson_1.resolveBSONOptions)(options, db),\n readConcern: read_concern_1.ReadConcern.fromOptions(options),\n writeConcern: write_concern_1.WriteConcern.fromOptions(options)\n };\n }", "title": "" }, { "docid": "b48b603e323deb3923e92b00e007fcba", "score": "0.64287794", "text": "constructor(db, name, options) {\n var _a, _b;\n utils_2.checkCollectionName(name);\n // Internal state\n this.s = {\n db,\n options,\n namespace: new utils_2.MongoDBNamespace(db.databaseName, name),\n pkFactory: (_b = (_a = db.options) === null || _a === void 0 ? void 0 : _a.pkFactory) !== null && _b !== void 0 ? _b : utils_1.DEFAULT_PK_FACTORY,\n readPreference: read_preference_1.ReadPreference.fromOptions(options),\n bsonOptions: bson_1.resolveBSONOptions(options, db),\n readConcern: read_concern_1.ReadConcern.fromOptions(options),\n writeConcern: write_concern_1.WriteConcern.fromOptions(options),\n slaveOk: options == null || options.slaveOk == null ? db.slaveOk : options.slaveOk\n };\n }", "title": "" }, { "docid": "50cc1c84d55b3eaabb598b0743492980", "score": "0.63507044", "text": "init() {\n\n\t\tthis.mongoClient.connect(this.uri, function(err,db) {\n\n\t\t\tif(err) console.error(err);\n\n\t\t\tdb.close();\n\n\t\t});\n\t}", "title": "" }, { "docid": "c5e28256b6640283f9568887b0334c56", "score": "0.63408405", "text": "function MongoProvider(options){\n _options = options || {};\n this.viewPath = options.viewPath;\n this.db = mongoose.createConnection(_options.mongoUrl);\n\n}", "title": "" }, { "docid": "491b6de8aeace37b9156d7d9e86d74fe", "score": "0.62603897", "text": "function MongoProvider() {\n this.empty = true;\n this.upd = {};\n this.ins = {};\n\n this.q = require('queue')({concurrency:1});\n\t\n\tthis.cc =[], this.newtick =true;\n}", "title": "" }, { "docid": "2fdd9f2ad639896d4960127b0491cb62", "score": "0.62329596", "text": "function MongodbStore() {\n Store.call(this)\n\n // this.sessions = Object.create(null)\n}", "title": "" }, { "docid": "d2c0e38b1af960b3480d806bac7eee21", "score": "0.60647017", "text": "function AwesomeDB()\n{\n this.MySQL = Object.create(Adb_MySQL);\n}", "title": "" }, { "docid": "a785b18a372dc156f1f934c8a9b6e502", "score": "0.6046284", "text": "function NativeCollection() {\n\t this.collection = null;\n\t MongooseCollection.apply(this, arguments);\n\t}", "title": "" }, { "docid": "796b5ceb438e7dddd7665c1c9c6ceac6", "score": "0.6019088", "text": "function MongoCommandBroker() {\n\n\t\t/**\n\t\t * The cursor that trails the collection looking for new items\n\t\t * @property cursor\n\t\t * @type {Cursor}\n\t\t */\n\t\tthis.cursor = null;\n\t}", "title": "" }, { "docid": "882446dbcd718a7d57aaf6558cbd2bad", "score": "0.5990711", "text": "constructor(collection, key, query, options) {\n super(collection, options);\n this.options = options !== null && options !== void 0 ? options : {};\n this.collection = collection;\n this.key = key;\n this.query = query;\n }", "title": "" }, { "docid": "882446dbcd718a7d57aaf6558cbd2bad", "score": "0.5990711", "text": "constructor(collection, key, query, options) {\n super(collection, options);\n this.options = options !== null && options !== void 0 ? options : {};\n this.collection = collection;\n this.key = key;\n this.query = query;\n }", "title": "" }, { "docid": "61bfe2f050848830e1d6b9b97ddeeb38", "score": "0.5987483", "text": "constructor() { \n \n DocumentsByUser.initialize(this);\n }", "title": "" }, { "docid": "6ee39e1480cf56787b1df015cc670d40", "score": "0.5982802", "text": "constructor(){\n super();\n this.database = {};\n }", "title": "" }, { "docid": "792afeab2c6d1d87d6a3dabf44bd6b64", "score": "0.59785414", "text": "mongo() {\n this.mongoConnection = mongoose.connect(\n // url de conexao do Mongo\n process.env.MONGO_URL, // mongo cria a base de dados\n {\n useNewUrlParser: true,\n useFindAndModify: true,\n useUnifiedTopology: true,\n } // configs\n );\n }", "title": "" }, { "docid": "df6b13a6a4c17a451ffcbea3ec3e3b18", "score": "0.5968787", "text": "constructor(logger) {\n\n if (mongoService) {\n return mongoService\n }\n\n // Set up parameters defining Mongo instance\n this.MONGO_HOST = process.env.MONGO_HOST;\n this.MONGO_DATABASE = process.env.MONGO_DATABASE;\n\n this.MONGO_PORT = process.env.MONGO_PORT ? process.env.MONGO_PORT : 27017;\n this.MONGO_USER = process.env.MONGO_USER ? process.env.MONGO_USER : null;\n this.MONGO_PASSWORD = process.env.MONGO_PASSWORD ? process.env.MONGO_PASSWORD : null;\n this.MONGO_REPL_SET = process.env.MONGO_REPL_SET ? process.env.MONGO_REPL_SET : null;\n this.MONGO_KEEP_ALIVE = process.env.MONGO_KEEP_ALIVE ? process.env.MONGO_KEEP_ALIVE : 120;\n this.MONGO_SSL = process.env.MONGO_SSL ? process.env.MONGO_SSL : false;\n this.MONGO_VALIDATE_SSL = process.env.MONGO_VALIDATE_SSL ? process.env.MONGO_VALIDATE_SSL : false;\n this.MONGO_SHARD_ENABLED = process.env.MONGO_SHARD_ENABLED ? process.env.MONGO_SHARD_ENABLED : false;\n this.MONGO_POOL_SIZE = process.env.MONGO_POOL_SIZE ? process.env.MONGO_POOL_SIZE : 5;\n \n this.created = new Date();\n this.mongoose = mongoose;\n this.mongoose.Promise = require('bluebird').Promise;\n this.timer = 5;\n this.logger = logger;\n\n this.MONGO_PARAMS = [this.MONGO_REPL_SET ? \"replicaSet=\" + this.MONGO_REPL_SET : \"\", (this.MONGO_SSL) ? \"ssl=true\" : \"\"]\n .filter(piece => { return piece }).join('&');\n this.MONGO_URI = `mongodb://${this.MONGO_HOST}${(this.MONGO_PORT) ? \":\" + this.MONGO_PORT : \"\"}/${this.MONGO_DATABASE}?${this.MONGO_PARAMS}`;\n\n this.MONGO_OPTIONS = {\n db: { native_parser: true },\n server: {\n poolSize: this.MONGO_POOL_SIZE,\n sslValidate: this.MONGO_VALIDATE_SSL,\n auto_reconnect : true,\n socketOptions: {\n keepAlive: this.MONGO_KEEP_ALIVE\n }\n },\n replset: { rs_name: this.MONGO_REPL_SET },\n mongos: this.MONGO_SHARD_ENABLED,\n user: this.MONGO_USER,\n pass: this.MONGO_PASSWORD\n };\n\n mongoService = this;\n\n // Set up logging for all connection events\n this.mongoose.connection.on('open', () => {\n logger.debug({action: \"mongoConnectionOpened\", mongoHost : mongoService.MONGO_HOST}, `Mongo Connection Opened for ${mongoService.MONGO_HOST}`);\n });\n\n this.mongoose.connection.on('connected', () => {\n logger.debug({action: \"mongoConnectionConnected\", mongoHost : mongoService.MONGO_HOST}, `Mongo Connection Established with ${mongoService.MONGO_HOST}`);\n });\n\n this.mongoose.connection.on('error', (err) => {\n logger.error({action: \"mongoConnectionError\", mongoHost : mongoService.MONGO_HOST, err}, `Mongo Connection ERROR: ${err}`);\n });\n\n this.mongoose.connection.on('disconnected', () => {\n logger.error({action: \"mongoConnectionDisconnected\", mongoHost : mongoService.MONGO_HOST}, `Mongo Connection Closed for ${mongoService.MONGO_HOST}`);\n });\n\n return mongoService;\n }", "title": "" }, { "docid": "a1c61e82e2a415bdc2a9d1aac01f9681", "score": "0.5968335", "text": "constructor(client, databaseName, options) {\n var _a;\n options = options !== null && options !== void 0 ? options : {};\n // Filter the options\n options = (0, utils_1.filterOptions)(options, DB_OPTIONS_ALLOW_LIST);\n // Ensure we have a valid db name\n validateDatabaseName(databaseName);\n // Internal state of the db object\n this.s = {\n // Client\n client,\n // Options\n options,\n // Logger instance\n logger: new logger_1.Logger('Db', options),\n // Unpack read preference\n readPreference: read_preference_1.ReadPreference.fromOptions(options),\n // Merge bson options\n bsonOptions: (0, bson_1.resolveBSONOptions)(options, client),\n // Set up the primary key factory or fallback to ObjectId\n pkFactory: (_a = options === null || options === void 0 ? void 0 : options.pkFactory) !== null && _a !== void 0 ? _a : utils_1.DEFAULT_PK_FACTORY,\n // ReadConcern\n readConcern: read_concern_1.ReadConcern.fromOptions(options),\n writeConcern: write_concern_1.WriteConcern.fromOptions(options),\n // Namespace\n namespace: new utils_1.MongoDBNamespace(databaseName)\n };\n }", "title": "" }, { "docid": "0fa548a29b93790d59d6d9caab9193d4", "score": "0.59578514", "text": "constructor(client, databaseName, options) {\n var _a;\n options = options !== null && options !== void 0 ? options : {};\n // Filter the options\n options = utils_1.filterOptions(options, DB_OPTIONS_ALLOW_LIST);\n // Ensure we have a valid db name\n validateDatabaseName(databaseName);\n // Internal state of the db object\n this.s = {\n // Client\n client,\n // Options\n options,\n // Logger instance\n logger: new logger_1.Logger('Db', options),\n // Unpack read preference\n readPreference: read_preference_1.ReadPreference.fromOptions(options),\n // Merge bson options\n bsonOptions: bson_1.resolveBSONOptions(options, client),\n // Set up the primary key factory or fallback to ObjectId\n pkFactory: (_a = options === null || options === void 0 ? void 0 : options.pkFactory) !== null && _a !== void 0 ? _a : utils_1.DEFAULT_PK_FACTORY,\n // ReadConcern\n readConcern: read_concern_1.ReadConcern.fromOptions(options),\n writeConcern: write_concern_1.WriteConcern.fromOptions(options),\n // Namespace\n namespace: new utils_1.MongoDBNamespace(databaseName)\n };\n }", "title": "" }, { "docid": "f91ff0633d9ccb788bb64431651395db", "score": "0.59476113", "text": "function MongoDBNamespace(db, collection) {\n _classCallCheck(this, MongoDBNamespace);\n\n this.db = db;\n this.collection = collection;\n }", "title": "" }, { "docid": "82d2286aadb151abce50a0c9ac44f562", "score": "0.5934948", "text": "function BaseDAO(db, collectionName) {\n if (false === (this instanceof BaseDAO)) {\n return new BaseDAO(db);\n }\n\n this.collection = db.collection(collectionName);\n}", "title": "" }, { "docid": "c5c7a625db13bd2c15808b5466ec7d60", "score": "0.5921835", "text": "constructor(mongoose) {\n // This is the schema we need to store artwalks in MongoDB\n const artwalkSchema = new mongoose.Schema({\n name: String,\n bilds: String // A list of bilds as string\n });\n\n // This model is used in the methods of this class to access artwalks\n this.artwalkModel = mongoose.model('artwalk', artwalkSchema);\n }", "title": "" }, { "docid": "cc47c72b5ee69e565fe3903edc13eca6", "score": "0.5917722", "text": "function MyDBConnector(){}", "title": "" }, { "docid": "439b50affa0bf0333ef8187564c788d2", "score": "0.590429", "text": "constructor(\n /**\n * Set to an instance of DbUnknownDocument if the data for a document is\n * not known, but it is known that a document exists at the specified\n * version (e.g. it had a successful update applied to it)\n */\n t, \n /**\n * Set to an instance of a DbNoDocument if it is known that no document\n * exists.\n */\n e, \n /**\n * Set to an instance of a Document if there's a cached version of the\n * document.\n */\n n, \n /**\n * Documents that were written to the remote document store based on\n * a write acknowledgment are marked with `hasCommittedMutations`. These\n * documents are potentially inconsistent with the backend's copy and use\n * the write's commit version as their document version.\n */\n s, \n /**\n * When the document was read from the backend. Undefined for data written\n * prior to schema version 9.\n */\n i, \n /**\n * The path of the collection this document is part of. Undefined for data\n * written prior to schema version 9.\n */\n r) {\n this.unknownDocument = t, this.noDocument = e, this.document = n, this.hasCommittedMutations = s, \n this.readTime = i, this.parentPath = r;\n }", "title": "" }, { "docid": "e0dd1e5789632bc1ee762f5f59ee621e", "score": "0.58913344", "text": "async openMongoClient () {\n\t\tthis.mongoClient = new MongoClient({ collections: COLLECTIONS });\n\t\ttry {\n\t\t\tawait this.mongoClient.openMongoClient(ApiConfig.getPreferredConfig().storage.mongo);\n\t\t\tthis.data = this.mongoClient.mongoCollections;\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow `unable to open mongo client: ${JSON.stringify(error)}`;\n\t\t}\n\t}", "title": "" }, { "docid": "1661755100eac373e8f68f59523803bd", "score": "0.58902407", "text": "constructor(url, debug) {\n /** \n * Defines an empty pool of Redis connections.\n * @property {string} url - Connection URL for MongoDB.\n */\n this.url = url;\n /** \n * Defines an empty pool of Redis connections.\n * @property {boolean} url - Debug flag.\n */\n this.debug = 1;\n }", "title": "" }, { "docid": "0163a7cac6efa647f6eed3626a08232f", "score": "0.5884324", "text": "function NativeCollection() {\n this.collection = null;\n MongooseCollection.apply(this, arguments);\n}", "title": "" }, { "docid": "4536fe8817d32bec44896acc36a3d313", "score": "0.5864866", "text": "function MongoRegistrationProvider() {\n\t}", "title": "" }, { "docid": "b26ae7a06b130ba1a60664cf4d0a1300", "score": "0.5855879", "text": "constructor () {\n const Db = require('./Db'); \n this.db = new Db();\n\n const Methods = require('./Methods');\n this.methods = new Methods();\n }", "title": "" }, { "docid": "017a59eca8bf40b69b4a9cbb8b8e84c3", "score": "0.58454776", "text": "constructor() {\n super('CourseInstance', new SimpleSchema({\n semesterID: SimpleSchema.RegEx.Id,\n courseID: { type: SimpleSchema.RegEx.Id, optional: true },\n verified: Boolean,\n fromSTAR: { type: Boolean, optional: true },\n grade: { type: String, optional: true },\n creditHrs: Number,\n note: { type: String, optional: true },\n studentID: SimpleSchema.RegEx.Id,\n ice: { type: Object, optional: true, blackbox: true },\n retired: { type: Boolean, optional: true },\n }));\n this.validGrades = ['', 'A', 'A+', 'A-',\n 'B', 'B+', 'B-', 'C', 'C+', 'C-', 'D', 'D+', 'D-', 'F', 'CR', 'NC', '***', 'W', 'TBD', 'OTHER'];\n this.publicationNames = {\n scoreboard: `${this._collectionName}.scoreboard`,\n };\n if (Meteor.server) {\n this._collection._ensureIndex({ _id: 1, studentID: 1, courseID: 1 });\n }\n }", "title": "" }, { "docid": "ef8ef7acff26fed6424b6d859de6dcc6", "score": "0.5837221", "text": "constructor() {\n // see https://www.npmjs.com/package/auto-bind\n autoBind(this);\n\n this.r = require(\"rethinkdb\");\n\n this.models = {};\n }", "title": "" }, { "docid": "d4fe36b50b04b323fcc23392165e8d7d", "score": "0.5832014", "text": "constructor(collection, options) {\n super(collection, options);\n this.options = options !== null && options !== void 0 ? options : {};\n this.collectionName = collection.collectionName;\n }", "title": "" }, { "docid": "d4fe36b50b04b323fcc23392165e8d7d", "score": "0.5832014", "text": "constructor(collection, options) {\n super(collection, options);\n this.options = options !== null && options !== void 0 ? options : {};\n this.collectionName = collection.collectionName;\n }", "title": "" }, { "docid": "6b98c9c0e0a3eaf0be194c171d775480", "score": "0.5821832", "text": "function Collection() {}", "title": "" }, { "docid": "6b98c9c0e0a3eaf0be194c171d775480", "score": "0.5821832", "text": "function Collection() {}", "title": "" }, { "docid": "9d4eebfbbe8256e8ab5b53d28f7219e1", "score": "0.58161324", "text": "function init() {\n mongoose.connect('mongodb://localhost:27017/zooDB'); \n }", "title": "" }, { "docid": "85c22624d3246619e7eb13f3292605ce", "score": "0.58156127", "text": "'mongo.connect'() {\n this.connect();\n }", "title": "" }, { "docid": "fc7a28c180411a85d8d6318e95e7dccd", "score": "0.58155936", "text": "function IndexAccess(){\n // default constructor: call super.constructor\n return Accessor.prototype.constructor.apply(this,arguments)\n }", "title": "" }, { "docid": "d708bf5688f0294c920e0f82153057aa", "score": "0.580823", "text": "constructor() {\n this.__initializeFields();\n this.initialize();\n }", "title": "" }, { "docid": "4d843e0365f52b3b118dd85278a2a51a", "score": "0.5806252", "text": "async build() {\n // create client\n this._client = await new Promise((resolve, reject) => {\n // connect\n MongoClient.connect(this._config.url, (err, client) => {\n // reject\n if (err) return reject(err);\n\n // resolve client\n resolve(client);\n });\n });\n\n // Internally store db by name provided in config\n this._db = this._client.db(this._config.db);\n }", "title": "" }, { "docid": "29d8116cbbd7e6b6a84ca31b3c81a4c2", "score": "0.5780408", "text": "constructor(name, schema){\n super(); //This function is to inherit from the Model\n this.name = name;\n this.schema = schema;\n this.model = mongoose.model(this.name, this.schema);\n }", "title": "" }, { "docid": "8243cd4870cd6cfdd267496b0ba4021a", "score": "0.57786393", "text": "constructor(opt) {\n super();\n opt = opt || {};\n opt.host = opt.host || 'localhost';\n opt.database = opt.database || 'event';\n const cluster = new couchbase.Cluster(`couchbase://${opt.host}`);\n debug('database connecting...');\n this.db = cluster.openBucket(opt.database);\n }", "title": "" }, { "docid": "2a05df961e57ea87609dc623564a636f", "score": "0.57711786", "text": "constructor() {\n super('CourseInstance', new SimpleSchema({\n semesterID: { type: SimpleSchema.RegEx.Id },\n courseID: { type: SimpleSchema.RegEx.Id, optional: true },\n verified: { type: Boolean },\n fromSTAR: { type: Boolean, optional: true },\n grade: { type: String, optional: true },\n creditHrs: { type: Number },\n note: { type: String, optional: true },\n studentID: { type: SimpleSchema.RegEx.Id },\n ice: { type: Object, optional: true, blackbox: true },\n }));\n this.validGrades = ['', 'A', 'A+', 'A-',\n 'B', 'B+', 'B-', 'C', 'C+', 'C-', 'D', 'D+', 'D-', 'F', 'CR', 'NC', '***', 'W'];\n this.publicationNames = [];\n this.publicationNames.push(this._collectionName);\n this.publicationNames.push(`${this._collectionName}.Public`);\n this.publicationNames.push(`${this._collectionName}.PerStudentAndSemester`);\n this.publicationNames.push(`${this._collectionName}.PublicStudent`);\n this.publicationNames.push(`${this._collectionName}.PublicSlugStudent`);\n this.publicationNames.push(`${this._collectionName}.studentID`);\n if (Meteor.server) {\n this._collection._ensureIndex({ _id: 1, studentID: 1, courseID: 1 });\n }\n }", "title": "" }, { "docid": "80a2ae54321990080d21d0f3d6d20f42", "score": "0.57705945", "text": "constructor(database) {\n this.database = database;\n }", "title": "" }, { "docid": "345f4178bcc6399ef08a8c27eee9fc8c", "score": "0.5737327", "text": "initializeDb() {\n mongoose.connect(config.MONGODB_URI, {\n useCreateIndex: true,\n useNewUrlParser: true,\n useUnifiedTopology: true,\n useFindAndModify: false,\n });\n }", "title": "" }, { "docid": "1083b698998d6695f418c12c554f28f5", "score": "0.5737231", "text": "constructor(collection) {\n super(collection);\n if (collection == null)\n throw new Error(\"Collection name could not be null\");\n }", "title": "" }, { "docid": "7f1ccfdc97bcf7f57437c88d3426015a", "score": "0.57289106", "text": "function CouchAccess(name, url) {\r\n\t\tthis.name = name;\r\n\t\tthis.url = url;\r\n\t\tvar dataConstructor = $.getProperty($.THIS, name);\r\n\t\tif (typeof dataConstructor === \"function\") this.dataConstructor = dataConstructor;\r\n\t\t$.core.EventSource.apply(this); // Apply/inject/mix EventSource functionality into this.\r\n\t\t//$.extendDestroy(this, function(){});\r\n\t}", "title": "" }, { "docid": "7ca8b54e43f134466e0f648fd07101fe", "score": "0.5712754", "text": "async openMongoClient() {\n\t\tthis.mongoClient = new MongoClient({ collections: ['users', 'sendGridToSegmentLastRunAt'] });\n\t\ttry {\n\t\t\tconsole.log('Connecting to Mongo...');\n\t\t\tawait this.mongoClient.openMongoClient(this.config.storage.mongo);\n\t\t\tthis.data = this.mongoClient.mongoCollections;\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : JSON.stringify(error);\n\t\t\tthrow `unable to open mongo client: ${message}`;\n\t\t}\n\t}", "title": "" }, { "docid": "7ab943470680b805a71d24ef05474f55", "score": "0.5711673", "text": "function DatabaseObject(findResults) {\n this.testAnimals.lastUpdatedDocument = undefined;\n this.testAnimals.aggregateState = 0;\n this.testAnimals.findResults = findResults;\n}", "title": "" }, { "docid": "67b3276e6a1fbb21a4d14c9043130984", "score": "0.57029855", "text": "function PersonHelper(){\n this.documentDefinition = new mongoose.Schema({\n name:String,\n age: String \n });\n}", "title": "" }, { "docid": "96a4441d59100f3d7586fb54bc5e587a", "score": "0.5700004", "text": "function Collection(db, topology, dbName, name, pkFactory, options) {\n checkCollectionName(name);\n\n // Unpack variables\n const internalHint = null;\n const slaveOk = options == null || options.slaveOk == null ? db.slaveOk : options.slaveOk;\n const serializeFunctions =\n options == null || options.serializeFunctions == null\n ? db.s.options.serializeFunctions\n : options.serializeFunctions;\n const raw = options == null || options.raw == null ? db.s.options.raw : options.raw;\n const promoteLongs =\n options == null || options.promoteLongs == null\n ? db.s.options.promoteLongs\n : options.promoteLongs;\n const promoteValues =\n options == null || options.promoteValues == null\n ? db.s.options.promoteValues\n : options.promoteValues;\n const promoteBuffers =\n options == null || options.promoteBuffers == null\n ? db.s.options.promoteBuffers\n : options.promoteBuffers;\n const collectionHint = null;\n\n const namespace = new MongoDBNamespace(dbName, name);\n\n // Get the promiseLibrary\n const promiseLibrary = options.promiseLibrary || Promise;\n\n // Set custom primary key factory if provided\n pkFactory = pkFactory == null ? ObjectID : pkFactory;\n\n // Internal state\n this.s = {\n // Set custom primary key factory if provided\n pkFactory: pkFactory,\n // Db\n db: db,\n // Topology\n topology: topology,\n // Options\n options: options,\n // Namespace\n namespace: namespace,\n // Read preference\n readPreference: ReadPreference.fromOptions(options),\n // SlaveOK\n slaveOk: slaveOk,\n // Serialize functions\n serializeFunctions: serializeFunctions,\n // Raw\n raw: raw,\n // promoteLongs\n promoteLongs: promoteLongs,\n // promoteValues\n promoteValues: promoteValues,\n // promoteBuffers\n promoteBuffers: promoteBuffers,\n // internalHint\n internalHint: internalHint,\n // collectionHint\n collectionHint: collectionHint,\n // Promise library\n promiseLibrary: promiseLibrary,\n // Read Concern\n readConcern: ReadConcern.fromOptions(options),\n // Write Concern\n writeConcern: WriteConcern.fromOptions(options)\n };\n}", "title": "" }, { "docid": "7f71fc9931757c3744945d58246cc179", "score": "0.5687684", "text": "static async init () {\n if (!collections.USER_COLL) {\n throw new Error('Missing env variable');\n }\n User.COLLECTION = collections.USER_COLL;\n User.validator = new SchemaValidator();\n const instance = Mongo.instance();\n\n await User.validator.init({ schemas: [schema] });\n\n User.db = instance.getDb();\n }", "title": "" }, { "docid": "6563f1cd0b272f4a717739cbacada989", "score": "0.56735086", "text": "function Mongoose() {\n\t this.connections = [];\n\t this.plugins = [];\n\t this.models = {};\n\t this.modelSchemas = {};\n\t // default global options\n\t this.options = {\n\t pluralization: true\n\t };\n\t var conn = this.createConnection(); // default connection\n\t conn.models = this.models;\n\t}", "title": "" }, { "docid": "8aa8c7c6a91f4fb70420ff75b5fafaa5", "score": "0.56640655", "text": "constructor(){\n this.dbs = new Map();\n }", "title": "" }, { "docid": "af73744478fb6d1129a9bf4674bcb27b", "score": "0.56614405", "text": "init(callback) {\n\t\tMongoClient.connect(url, { server: { reconnectTries: 100, reconnectInterval: 3000} }, function(err, database) {\n\t\t\tif(!err && database) {\n\t\t\t\t//if there was no error and we got a database\n\t\t\t\tthis.db = database;\n\t\t\t\tcallback();\n\t\t\t} else {\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t}.bind(this));\n\t}", "title": "" }, { "docid": "6c1af97dfeba0302148721f6180770a4", "score": "0.5661225", "text": "constructor(config) {\n // Store config\n this._config = config;\n\n // Bind builder to self\n this.build = this.build.bind(this);\n\n // Bind raw methods to self\n this.getRawDb = this.getRawDb.bind(this);\n this.getRawTable = this.getRawTable.bind(this);\n this.getRawCursor = this.getRawCursor.bind(this);\n\n // Bind internal methods to self\n this._queryToCursor = this._queryToCursor.bind(this);\n\n // Bind public methods to self\n this.raw = this.raw.bind(this);\n this.find = this.find.bind(this);\n this.count = this.count.bind(this);\n this.remove = this.remove.bind(this);\n this.insert = this.insert.bind(this);\n this.findOne = this.findOne.bind(this);\n this.findById = this.findById.bind(this);\n this.findByIds = this.findByIds.bind(this);\n this.removeById = this.removeById.bind(this);\n this.replaceById = this.replaceById.bind(this);\n\n // Start building internal connections and store promise\n this.building = this.build();\n }", "title": "" }, { "docid": "b98491d29ad9a51890badb6a0bf0c67d", "score": "0.56603307", "text": "_lazyInitCollection() {\n if (!this._initialized) {\n this._initialized = true;\n const options = this.options;\n const storageManagerClass = options.storageManager || _defaultStorageManager;\n const delegateClass = options.delegate || _defaultDelegate;\n const indexManagerClass = options.indexManager || _defaultIndexManager;\n this.idGenerator = options.idGenerator || _defaultIdGenerator;\n this.cursorClass = options.cursorClass || _defaultCursor;\n this.indexManager = new indexManagerClass(this, options);\n this.storageManager = new storageManagerClass(this, options);\n this.delegate = new delegateClass(this, options);\n }\n }", "title": "" }, { "docid": "eaac49eed059c195fadbed03d4b876b9", "score": "0.5646859", "text": "function Mongoose() {\n this.connections = [];\n this.models = {};\n this.modelSchemas = {};\n // default global options\n this.options = {\n pluralization: true\n };\n var conn = this.createConnection(); // default connection\n conn.models = this.models;\n\n Object.defineProperty(this, 'plugins', {\n configurable: false,\n enumerable: true,\n writable: false,\n value: [\n [saveSubdocs, { deduplicate: true }],\n [validateBeforeSave, { deduplicate: true }],\n [shardingPlugin, { deduplicate: true }]\n ]\n });\n}", "title": "" }, { "docid": "0d2cd49728c8e2ac2c7d770bbefe411b", "score": "0.5640727", "text": "function init() {\n return new Promise((resolve, reject) => {\n console.log('DB instance not ready yet');\n MongoClient.connect(host, function(err, db) {\n if (err) reject(err);\n console.log('DB instance initialized');\n\n instance = {\n getAll(collectionName){\n return new Promise((resolve, reject) => {\n const collection = db.collection(collectionName);\n collection.find().toArray(function(err, docs) {\n if(err) reject(err);\n\n const response = {\n \"collection\" : collectionName,\n \"data\" : docs\n }\n\n resolve(response);\n });\n });\n },\n save(doc, collectionName){\n return new Promise((resolve, reject) => {\n docData['updated'] = new Date();\n const collection = db.collection(collectionName);\n collection.insertOne(doc, function(err, res) {\n if (err) reject(err);\n\n const response = {\n \"collection\": collectionName,\n \"data\": doc\n };\n resolve(response);\n });\n });;\n\n resolve(response);\n },\n find(id, collectionName){\n return new Promise((resolve, reject) => {\n const collection = db.collection(collectionName);\n collection.findOne({\n _id: ObjectID(id)\n }, function(err, doc) {\n if(err) reject(err);\n\n const response = {\n \"collection\": collectionName,\n \"data\": doc\n }\n resolve(response);\n })\n });\n },\n remove(id, collectionName, forceDelete){\n return new Promise((resolve, reject) => {\n const collection = db.collection(collectionName);\n //docData['deleted'] = new Date();\n collection.remove(\n { \"_id\": ObjectID(id) },\n [],\n function( err, lastErrorObject ) {\n if(err) reject(err);\n const response = {\n \"collection\": collectionName,\n \"data\": null,\n \"operationDetails\": lastErrorObject\n };\n resolve(response);\n });\n });\n },\n update(id, docData, collectionName){\n return new Promise((resolve, reject) => {\n const collection = db.collection(collectionName);\n docData['updated'] = new Date();\n collection.findAndModify(\n { \"_id\": ObjectID(id) },\n [],\n { \"$set\": docData },\n { update: true },\n function (err, doc, lastErrorObject) {\n if(err) reject(err);\n\n const response = {\n \"collection\": collectionName,\n \"data\": doc.value,\n \"operationDetails\": doc.lastErrorObject\n };\n resolve(response);\n });\n });\n },\n hi() {\n console.log('instance says hello!');\n }\n };\n // Return the instance once finalized\n resolve(instance);\n });\n });\n }", "title": "" }, { "docid": "e04def681ca79f6f787da58d60044ec2", "score": "0.5628885", "text": "constructor() {\n // TODO\n }", "title": "" }, { "docid": "6f1e09dc3ce981d9bc92940fa239db8f", "score": "0.5612324", "text": "function UsersDAO(db) {\n \"use strict\";\n\n /* If this constructor is called without the \"new\" operator, \"this\" points\n * to the global object. Log a warning and call it correctly. */\n if (false === (this instanceof UsersDAO)) {\n console.log('Warning: UsersDAO constructor called without \"new\" operator');\n return new UsersDAO(db);\n }\n\n var users = db.collection(\"users\");\n\n this.add = function(username, password, type, callback) {\n \"use strict\";\n\n // Generate password hash\n var salt = bcrypt.genSaltSync();\n var password_hash = bcrypt.hashSync(password, salt);\n\n // Create user document\n var user = {\n '_id': username, \n 'password': password_hash,\n 'type' : type\n };\n\n users.insert(user, function (err, result) {\n \"use strict\";\n\n if(err) return callback(err);\n\n console.log(\"Inserted new user.\");\n callback(err);\n });\n }\n\n this.update = function(username, name, email, photo, callback) {\n \"use strict\";\n\n var query = {\n '_id': username\n };\n\n var set = new Object;\n set['name'] = name;\n set['email'] = email;\n if(photo)\n set['photo'] = photo;\n\n var update = new Object;\n update['$set'] = set;\n\n users.update(query, update, function (err, updated) {\n \"use strict\";\n\n if(err) return callback(err);\n\n console.log(\"Updated the user.\");\n callback(err);\n });\n }\n\n this.getUsers = function(callback){\n \"use strict\";\n\n users.find().sort(\"username\", 1).toArray(function(err, items){\n if(err){\n console.log(\"Error getUsers, \" + err);\n return callback(err, null);\n }\n console.log(\"Found \" + items.length + \" users\"); \n callback(err, items);\n });\n }\n\n this.getUser = function(username, callback){\n \"use strict\";\n\n var query = new Object;\n query._id = username;\n\n users.findOne(query, function(err, doc){\n if(err){\n console.log(\"Error getUser, \" + err);\n return callback(err, null);\n }\n console.log(\"User found.\"); \n callback(err, doc);\n });\n }\n\n this.validateLogin = function(username, password, callback) {\n \"use strict\";\n\n // Callback to pass to MongoDB that validates a user document\n function validateUserDoc(err, user) {\n \"use strict\";\n\n if (err) return callback(err, null);\n\n if (user) {\n if (bcrypt.compareSync(password, user.password)) {\n callback(null, user);\n }\n else {\n var invalid_password_error = new Error(\"Invalid password\");\n // Set an extra field so we can distinguish this from a db error\n invalid_password_error.invalid_password = true;\n callback(invalid_password_error, null);\n }\n }\n else {\n var no_such_user_error = new Error(\"User: \" + user + \" does not exist\");\n // Set an extra field so we can distinguish this from a db error\n no_such_user_error.no_such_user = true;\n callback(no_such_user_error, null);\n }\n }\n\n // TODO: hw2.3\n users.findOne({ '_id' : username }, validateUserDoc);\n }\n}", "title": "" }, { "docid": "4adb798ecacfe7670fbbac8ce8460495", "score": "0.56100714", "text": "constructor(config) {\n assert.notEqual(config.host, null);\n this.host = config.host;\n this.db = config.db;\n this.user = config.user;\n this.password = config.password;\n }", "title": "" }, { "docid": "4eb985317c1a41bf9f129ce3eeb21729", "score": "0.5608147", "text": "function Ctor( doc ) {\n\t\t\tvar self = this;\n self.type = \"Course\";\n self.id = doc._id || \"\";\n self.rev = doc._rev || \"\";\n self.isDeleted = doc.isDeleted || false;\n self.Title = doc.Title || \"\";\n self.Transcript = doc.Transcript || {};\n self.Courses = doc.Courses || [];\n self.Subject = doc.Subject || {};\n self.Term = doc.Term || {};\n self.Grade = doc.Grade || {};\n\t\t}", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.56002885", "text": "function Collection () {}", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.56002885", "text": "function Collection () {}", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.56002885", "text": "function Collection () {}", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.56002885", "text": "function Collection () {}", "title": "" }, { "docid": "c9dd3e4f832c7fb0a365897ac86ec73d", "score": "0.56002885", "text": "function Collection () {}", "title": "" }, { "docid": "210e13c1ecc60808eebb612c93df0e94", "score": "0.55978155", "text": "constructor() { \n \n AddCollection.initialize(this);\n }", "title": "" }, { "docid": "f8e08d9088564b031f447b99b26a984e", "score": "0.55959433", "text": "constructor (connectionString, storePath) {\n\n }", "title": "" }, { "docid": "80723ad7613e4b7e60088177b931527d", "score": "0.5590956", "text": "constructor() {\n this._id;\n this._title;\n this._query;\n }", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.5588673", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.5588673", "text": "constructor(){}", "title": "" }, { "docid": "8ab1793ef5d048f70ee275b5b5eecd7e", "score": "0.5584992", "text": "getCollection(name, opts) {\n return new Collection(this, name, opts);\n }", "title": "" }, { "docid": "586fb9bfd65ff6bec4e24c00157ffbe7", "score": "0.5575534", "text": "function initialize(\n dbName,\n dbCollectionName,\n successCallback,\n failureCallback\n) {\n MongoClient.connect(process.env.MONGO_CONNECT, function (err, dbInstance) {\n if (err) { \n failureCallback(err);\n } else {\n const dbObject = dbInstance.db(dbName);\n const dbCollection = dbObject.collection(dbCollectionName);\n successCallback(dbCollection);\n }\n });\n}", "title": "" }, { "docid": "c781a415361b6a7cfb40eb3dad47c868", "score": "0.5565109", "text": "function DbManager(){\n\n\n\tvar db = {\n\n\t\tdb: null,\n\n\t\tserviceRunning : true,\n\t\tconnected : false,\n\n\t\tdontSave : [],\n\n\t\tdefaults : {\n\t\t\tident : \"CouchModel\",\n\t\t},\n\n\t\tidAttribute : \"_id\",\n\n\t\tthiscodeonclient : false,\n\n\n\t\tconnect : function (){\n\n\t\t\tif(typeof IAMONTHECLIENT !== 'undefined' && IAMONTHECLIENT != false){\n\t\t\t\tthis.thiscodeonclient = true;\n\t\t\t}else{\n\t\t\t\tif(!this.connected){\n\t\t\t\t\tvar nano = require('nano')('http://localhost:5984');\n\t\t\t\t\tvar db_name = \"integrator\";\n\t\t\t\t\tthis.db = nano.use(db_name);\n\n\t\t\t\t\tthis.connected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t},\n\n\n\t\tsaveThingType : function(thingType, callback){\n\t\t\t// check if server or client side here. if client side, route through server\n\t\t\tvar doc = {};\n\t\t\tdoc._id = \"thingType/\" + thingType.getUniqueId();\n\t\t\tif(typeof thingType._rev !== \"undefined\"){\n\t\t\t\tdoc._rev = thingType._rev;\n\t\t\t}\n\n\t\t\tdoc.allowedWidgetTypes = thingType.allowedWidgetTypes;\n\n\t\t\tdoc.defaultWidgets = [];\n\t\t\tGLOBAL.$.each(thingType.defaultWidgets, function (index, defaultWidget){\n\t\t\t\tvar widgetDoc = {uniqueName : defaultWidget.uniqueName,\n\t\t\t\t\t\t\t\tconfig : defaultWidget.config,\n\t\t\t\t\t\t\t\twidgetTypeName : defaultWidget.widgetType.typeName};\n\t\t\t\tdoc.defaultWidgets.push(widgetDoc);\t\n\t\t\t});\n\n\t\t\tthis.insertDoc(doc, function(rdata){\n\t\t\t\tthingType._rev = rdata.rev;\n\t\t\t\tcallback(rdata);\n\t\t\t});\n\t\t},\n\n\n\t\tsaveThing : function(thing, callback){\n\t\t\tvar doc = {};\n\t\t\tdoc._id = \"thing/\"+thing.id;\n\t\t\tif(typeof thing._rev !== \"undefined\"){\n\t\t\t\tdoc._rev = thing._rev;\n\t\t\t}\n\t\t\tdoc.widgetInstances = [];\n\t\t\tGLOBAL.$.each(thing.widgetInstances, function (index, widgetInstance){\n\t\t\t\tvar widgetInstanceDoc = {\n\t\t\t\t\tdata: widgetInstance.data,\n\t\t\t\t\twidgetTypeName : widgetInstance.widget.widgetType.typeName,\n\t\t\t\t\tuniqueName : widgetInstance.widget.uniqueName\n\t\t\t\t};\n\t\t\t\tdoc.widgetInstances.push(widgetInstanceDoc);\n\t\t\t});\n\t\t\tthis.insertDoc(doc, function(rdata){\n\t\t\t\tconsole.log(\"updating rev from \" + thing._rev + \" to \" + rdata.rev);\n\t\t\t\tconsole.log(rdata);\n\t\t\t\tthing._rev = rdata.rev;\n\t\t\t\tcallback(rdata);\n\t\t\t});\n\t\t},\n\n\t\tloadThingType : function(thingTypeId, callback, notFoundCallback){\n\t\t\t\n\t\t\tvar id = \"thingType/\"+ thingTypeId;\n\t\t\tthis.loadDoc(id, callback, notFoundCallback);\n\t\t\treturn false;\n\t\t},\n\n\n\t\tloadThing : function(thingId, callback, notFoundCallback){\n\t\t\tvar id = \"thing/\" + thingId;\n\t\t\tthis.loadDoc(id, callback, notFoundCallback);\n\t\t\treturn false;\n\t\t},\n\n\t\tloadDoc : function(id, callback, notFoundCallback){\n\t\t\tthis.connect();\n\t\t\tif(this.thiscodeonclient){\n\t\t\t\tvar url = \"./couchdb/\"+id;\n\t\t\t\tGLOBAL.$.ajax({\n\t\t\t\t\turl : url,\n\t\t\t\t\ttype : \"GET\",\n\t\t\t\t\tcontentType : 'application/json',\n\t\t\t \t\tsuccess : function(rdata, status){\n\n\t\t\t \t\t\tcallback(rdata);\n\t\t\t \t\t},\n\t\t\t \t\terror : function(jqXHR, status, message){\n\t\t\t \t\t\tconsole.log(\"error !!!! \");\n\t\t\t \t\t\tconsole.log(status);\n\t\t\t \t\t\tconsole.log(message);\n\t\t\t \t\t\tif(message.message == \"missing\"){\n\t\t\t \t\t\t\tnotFoundCallback(message);\n\t\t\t \t\t\t}else{\n\t\t\t\t \t\t\tcallback(message);\n\t\t\t\t \t\t}\n\t\t\t \t\t},\n\t\t\t \t\tcomplete : function (jqXHR, textStatus){\n\t\t\t \t\t\tconsole.log(\"complete \" + url);\n\t\t\t \t\t\tconsole.log(textStatus);\n\t\t\t \t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.db.get(id, {}, function(err, body){\n\t\t\t\tif(err){\n\t\t\t\t\tconsole.log(\"db error!!!\");\n\t\t\t\t\terr.notfound = true;\n\t\t\t\t\tcallback(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcallback(body);\n\t\t\t});\n\n\t\t},\n\n\t\tinsertDoc : function(doc, callback2, errorCallback){\n\t\t\tthis.connect();\n\nconsole.log(\"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii\");\n\n\t\t\tif(this.thiscodeonclient){\n\t\t\t\tGLOBAL.$.ajax({\n\t\t\t\t\turl : \"./\"+ doc._id ,\n\t\t\t\t\ttype : \"PUT\",\n\t\t\t\t\tdata : JSON.stringify(doc),\n\t\t\t\t//\tprocessData : false,\n\t\t\t\t\tcontentType : 'application/json',\n\t\t\t \t\tsuccess : function(rdata, status){\n\t\t\t \t\t\tcallback2(rdata);\n\t\t\t \t\t},\n\n\t\t\t \t\terror : function(jqXHR, status, message){\n\t\t\t \t\t\tconsole.log(\"error \");\n\t\t\t \t\t\tconsole.log(status);\n\t\t\t \t\t\tconsole.log(message);\n\t\t\t \t\t\tif(errorCallback){\n\t\t\t \t\t\t\terrorCallback(message);\n\t\t\t \t\t\t}else{\n\t\t\t\t \t\t\tcallback2(message);\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t\t});\t\t\n\n\n\t\t\t\treturn;\n\t\t\t}\n\n\n\n\t\t\tthis.db.insert(doc,\n\t\t\t\tfunction (error,http_body,http_headers) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\tconsole.log(\"error message in insert\");\n\t\t\t\t\t\tconsole.log(doc._id);\n\t\t\t\t\t\tconsole.log(doc._rev);\n\t\t\t\t\t console.log(error);\n\t\t\t\t\t if(errorCallback){\n\t\t\t\t\t \terrorCallback(error);\n\t\t\t\t\t }else{\n\t\t\t\t\t\t callback2(error);\n\t\t\t\t\t }\n\t\t\t\t\t return error;\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(\"iiiinserted\");\n\t\t\t\t\tconsole.log(http_body);\n\t\t\t\t\tcallback2(http_body);\n\t \t\t}\n \t\t);\n\n\t\t}\n\n\t}\n\n\treturn db;\n\n}", "title": "" }, { "docid": "85eeb5330b1ad8020386258ec65fd604", "score": "0.5558657", "text": "getMongo() {\n return this[mongo];\n }", "title": "" }, { "docid": "37f4b245749f6d1744a1be0ea7d88743", "score": "0.55531275", "text": "function constructor (){\r\n\t}", "title": "" }, { "docid": "cc91ceaec08b7433e832040ab4f9121f", "score": "0.55501395", "text": "init() {\n if (this.__isInitialized) return // silently do nothing.\n\n this.__isInitialized = true\n\n // we need to fill the multiplexer with the first adds\n this.collection.find(this.selector, this.options).forEach((doc) => this.add(doc))\n this.multiplexer.ready()\n }", "title": "" }, { "docid": "f66ee57414255f4244ad5d088c1767f9", "score": "0.5548425", "text": "constructor() {\n\t\t// ...\n\t}", "title": "" }, { "docid": "cc5905a36fc73e51887003dc417300ff", "score": "0.5546875", "text": "constructor() {\n const oThis = this;\n oThis.usersCollection = firebaseDb.collection('users');\n }", "title": "" }, { "docid": "f0f8d2b8f722dffab69b90c31e06023c", "score": "0.5545709", "text": "constructor () {\n this.cluster = new couchbase.Cluster('couchbase://localhost');\n }", "title": "" }, { "docid": "5c2be4a8e7faaac105dad61aa7deb7e4", "score": "0.5540917", "text": "function Collections() {\n this._databaseName = config.database.name;\n this._databaseUrl = config.database.url;\n this._auth = config.authorization.token;\n\n var collectionUrlPath = helpers.urls.replace(helpers.urls.api.collections.url, { db: this._databaseName});\n this.collectionUrl = helpers.urls.combine(this._databaseName, collectionUrlPath);\n}", "title": "" }, { "docid": "bc01c28a3ca5ebf2fc702361a3a17ad7", "score": "0.5534863", "text": "function CouchAuth() {}", "title": "" }, { "docid": "68ae2dcb63101d7dcd019324088b3121", "score": "0.553278", "text": "constructor(config) {\n\t\tsuper(config, {\n\t\t\tconfigUniqueKeys,\n\t\t\tserviceName: 'Datastore',\n\t\t\tService: Datastore,\n\t\t});\n\t}", "title": "" }, { "docid": "1dcbf4912facc78976877e4a60fa96f7", "score": "0.5520971", "text": "initialize() {\n initialized = true;\n\n // load file sync database\n var db = low(SERVER_DB_PATH);\n db.defaults({ projects: [] }).value();\n this.db = db.get('projects');\n\n // bind useful findAll method\n this.db.findAll = function(query) {\n var query = query || {};\n\n if (query.uid) {\n return this.find( query ).value();\n }\n\n return this.chain().filter( query ).value().filter( n => n !== null );\n };\n }", "title": "" }, { "docid": "2c944d214f029dc7433c969c909f4066", "score": "0.55157006", "text": "function NextMangler(mongoDriver) {\n\t\tthis.mongoDriver=mongoDriver;\n\t}", "title": "" } ]
e14c139f1836726efaafa498be6c5027
TODO: Do I set scriptStarted to false? TODO: Use scriptstarted to set/restore a state
[ { "docid": "a3716049ddd6945e8138fbf4eebd3206", "score": "0.0", "text": "RenderPostMeta() {\n\t\tif (!this.script && !this.script.scriptStarted) {\n\t\t\tconsole.warn('The Meta will not post');\n\t\t\treturn;\n\t\t}\n\t\tconst postMetas = [];\n\t\tthis.script.metas.forEach((meta) => {\n\t\t\tif (meta.post) {\n\t\t\t\tpostMetas.push(UItools.getInput(meta.key, meta.type, `meta_${meta.id}`));\n\t\t\t}\n\t\t});\n\t\tif (!postMetas.length) {\n\t\t\twindow.UI.RenderPostInterview();\n\t\t\treturn;\n\t\t}\n\t\tconst endButton = UItools.addHandler(UItools.getButton('End Interview', '', ''), (e) => {\n\t\t\te.preventDefault();\n\t\t\tconst inputData = document.querySelectorAll('input');\n\t\t\tconst data = [];\n\t\t\tinputData.forEach((input) => {\n\t\t\t\tdata.push({\n\t\t\t\t\tkey: input.name,\n\t\t\t\t\tvalue: input.value,\n\t\t\t\t\ttype: input.type\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst api = new API();\n\t\t\tapi.call({\n\t\t\t\taction: 'post_meta',\n\t\t\t\tmeta: data,\n\t\t\t\tscript: window.UI.script.id,\n\t\t\t\trespondent: window.UI.script.respondent\n\t\t\t}, (data) => {\n\t\t\t\tif (data.status) {\n\t\t\t\t\tconsole.log('postmeta: uploaded');\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('postmeta: failed');\n\t\t\t\t}\n\t\t\t});\n\t\t\twindow.UI.RenderPostInterview();\n\t\t});\n\n\t\tthis.Clear(this.main);\n\t\tUItools.render(\n\t\t\t[\n\t\t\t\tthis.elements.GetHeader('Interviewee Post Meta', null, false, 'disabled'),\n\t\t\t\tUItools.getForm('postMeta',\n\t\t\t\t\t[\n\t\t\t\t\t\tUItools.wrap(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\tUItools.createElement(),\n\t\t\t\t\t\t\t\tUItools.wrap(\n\t\t\t\t\t\t\t\t\tpostMetas,\n\t\t\t\t\t\t\t\t\t'metabox'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tUItools.wrap(\n\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\tUItools.wrap(\n\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\t\tUItools.getText(this.script.title, '', '', 'h2'),\n\t\t\t\t\t\t\t\t\t\t\t\tUItools.getText(this.script.description) // TODO: Extra description\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tendButton\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t['grid', 'row-BB']\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t['grid', 'col-131']\n\t\t\t\t\t\t)\n\t\t\t\t\t],\n\t\t\t\t\t'/',\n\t\t\t\t\tfalse\n\t\t\t\t)\n\t\t\t],\n\t\t\tthis.main\n\t\t);\n\t\tpostMetas[0].querySelector('input').focus();\n\t}", "title": "" } ]
[ { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.65704167", "text": "started() {}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.656977", "text": "started() {\n\n\t}", "title": "" }, { "docid": "f0acda0e5a91ef4e6ae122a9cfc51f0a", "score": "0.6568342", "text": "started() {\n\t\t\n\t}", "title": "" }, { "docid": "4812d6b00c58bb955dfefeb5841ccc54", "score": "0.6443652", "text": "start() {\n // Shouldn't call start twice.\n assertFalse(this.started);\n this.started = true;\n }", "title": "" }, { "docid": "870a8265ad4fdc4e5cb5a0f40dd0f8bc", "score": "0.6306492", "text": "scriptCallback()\n\t{\n\t\t//We don't update on this reset.\n\t\tthis.state.clear = false;\n\t}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.62280446", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.62280446", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.62280446", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.62280446", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "60aa7cebb009f324cdf76d2ed13297e5", "score": "0.6225506", "text": "_start() {\n\t\tthis._state = this.STATE_RUNNING;\n\t}", "title": "" }, { "docid": "53873a2057b8048d115000276c1b30be", "score": "0.6213938", "text": "started () {\n\n }", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.61850375", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.61850375", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.61850375", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.6175888", "text": "async started() {}", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.6175888", "text": "async started() {}", "title": "" }, { "docid": "dcbcc30460cfa10176e32f4fba38f650", "score": "0.60727906", "text": "function scriptStateLoad() {\n scriptState = JSON.parse(window.localStorage.getItem('galefuryScriptState'));\n scriptStateFillDefaults();\n scriptStateClean();\n scriptLogRebaseIds();\n scriptStateSave();\n}", "title": "" }, { "docid": "b8bcdb861175a3d26fa55877d163cef2", "score": "0.6049357", "text": "function start(){ \n menuFlag = false;\n setup();\n}", "title": "" }, { "docid": "8dadaedf7449993c7243da07d8f5717c", "score": "0.6039565", "text": "function onStart() {\n if (status === 'started')\n return\n\n if (status !== 'no-started') {\n onRestart()\n return\n }\n\n update(\n 'started',\n new Date().toISOString(),\n null\n )\n }", "title": "" }, { "docid": "a9618c1b43546691796619f9c981b48b", "score": "0.6029439", "text": "function game_Check(){\n if(!started){\n init();\n started = true;\n }\n }", "title": "" }, { "docid": "29af2000852db6400b42b69dfa409039", "score": "0.5969467", "text": "onStarted() {\n this._hasStarted = true;\n if (this._started) {\n this._started.raise();\n }\n }", "title": "" }, { "docid": "3d9853cb9ade1db2c6500d6f4a58507e", "score": "0.59029144", "text": "function game_start () {\n\tif(started === true)\n\t\tnextSequence(), started=false;\n}", "title": "" }, { "docid": "0eb32234da4ca9c8a1ebd754ce9085f7", "score": "0.5871823", "text": "function start(){\n\n}", "title": "" }, { "docid": "6fe7b0357d2cc4e19a5ecb37ccec7e9c", "score": "0.58710146", "text": "function start() {\n \n }", "title": "" }, { "docid": "f8e5de9964e1ca9a02bc8dc7e96b12c2", "score": "0.5861077", "text": "function start() {\n \n }", "title": "" }, { "docid": "7d3fec61dfbdda4732a75a3a83e0a858", "score": "0.584148", "text": "function start() {\r\n generateDate();\r\n lastMood = \"default\";\r\n locked = false;\r\n\r\n chrome.storage.sync.get(['firstRun'], function(result) {\r\n if (result.firstRun != 1) firstRun();\r\n else getSaved();\r\n });\r\n}", "title": "" }, { "docid": "35e418115dee10a985a534c6f3bb5a62", "score": "0.58210343", "text": "start () {\n\t\tthis.stage = \"\";\n\t\tthis.doStart ();\n\t}", "title": "" }, { "docid": "d4e36d2ff16a9469b16b0dd8d7e56241", "score": "0.58025664", "text": "function setStart( start )\n{\n script.api.manualStart = true;\n script.api.start = start;\n}", "title": "" }, { "docid": "5261a6ef4d7309c6d6a4c39182726071", "score": "0.58006716", "text": "start(){\n this.startTime = new Date().getTime();\n this.started = true;\n return true;\n }", "title": "" }, { "docid": "ee6f3ea46a5c7669657b09bc89d5dedb", "score": "0.57982206", "text": "function start(){\n\t\n\t}", "title": "" }, { "docid": "d7d2ac3d1a4ae28fb899acb5da024e47", "score": "0.57974464", "text": "function setStoppedState() {\n console.log('setStoppedState');\n}", "title": "" }, { "docid": "c48a2b3bcf919020473d98ddbe043a18", "score": "0.57876974", "text": "function start() {\r\n\tstartTime = new Date();\r\n}", "title": "" }, { "docid": "9377c5f92ed604b1974993f3490fe634", "score": "0.57810426", "text": "ensureStopped() { }", "title": "" }, { "docid": "3eb557693ea1e486ad204aa60afd9c8c", "score": "0.57801276", "text": "start() {\n\t\tthis._isRunning = true\n\t\tif(typeof this._onStart === 'function'){\n\t\t\tthis._onStart.call(null)\n\t\t}\n\t}", "title": "" }, { "docid": "031e9b20de21f377db8a7be75d7bdbd1", "score": "0.57577413", "text": "function Start() {}", "title": "" }, { "docid": "7776ba5ef0fdeb626151cc6b13482d85", "score": "0.5754301", "text": "function startQuiz() {\n STORE.quizStarted = true;\n console.log('The quiz has started');\n}", "title": "" }, { "docid": "ec9d883aac9204086688634078abd876", "score": "0.5732057", "text": "function Start () {\n\n\tprint (state + \" report\");\n\t\n}", "title": "" }, { "docid": "c82c9cbbc5aef2770d920ba169fbff49", "score": "0.5729741", "text": "onRestarted_() {}", "title": "" }, { "docid": "266aa2f0f88d531393521e37dcddbb5d", "score": "0.5727014", "text": "function resetScript()\n{\n\tinstances = {};\n\tcharFlags = {};\n\tcharIDs = [];\n\tclearInterval(subWatcherInterval);\n\tclearInterval(conWatcherInterval);\n\tclearInterval(upcomingCheckInterval);\n\tmessagesRecieved = 0;\n\tmessagesRecievedLast = 0;\n\tforcedEndings = 0;\n\n\twsClient = new persistentClient();\n\n\treportError(\"CRITICAL: Script Restarted\", \"\");\n}", "title": "" }, { "docid": "e108e4d43c5404c2973b7ed7100d2a16", "score": "0.5718724", "text": "function startGameFile(){\n skinKey = 0;\n maxSkinKey = 6;\n gameStarted = false;\n}", "title": "" }, { "docid": "40eaf0ebe02f589bdb8e612464f78bbb", "score": "0.5709144", "text": "onStart()\r\n {\r\n this.changeState( this.default );\r\n }", "title": "" }, { "docid": "c2f0032f0375a80156798570189ff7fc", "score": "0.5697509", "text": "enterState() {\n fireAllMethodsInArray(this.options.onFirstRun, this.eventData('firstRun'));\n fireAllMethodsInArray(this.options.onEnter, this.eventData('enter'));\n this.options.onFirstRun = [];\n this.active = true;\n }", "title": "" }, { "docid": "b828b1d516c010a24712857f75d0717b", "score": "0.56954134", "text": "function start() {\n startTime = new Date();\n}", "title": "" }, { "docid": "bc8d6475b4185f2df24ec11de4ca2e03", "score": "0.56946176", "text": "function start() { startTime = new Date(); }", "title": "" }, { "docid": "b7d181b4912f021a15f4071e6b5b4221", "score": "0.5693743", "text": "function node_script_started(){\n\tdebug('running');\n\t//jweb_dict.set('status', 'running');\n\t//refreshJweb();\n\tnodeIsRunning();\n\tnode_script.message('update_paths');\n\tpackage_button.message('active', 1);\n\toji_package_button.message('active', 1);\n\tlogs_button.message('active', 1);\n}", "title": "" }, { "docid": "7aec94a13a288b8f72f15c51d19714e2", "score": "0.5692374", "text": "resume() {\n this.stopped = false;\n }", "title": "" }, { "docid": "bb9540e24a28a0c0b331f209dab28ad6", "score": "0.56723636", "text": "function Start(){\n\t\tgameStatus=\"start\";\n\t\tconsole.log(gameStatus);\n\t}", "title": "" }, { "docid": "5e5ddc1a9533557b99f0b7a31849da85", "score": "0.5670399", "text": "function startGame(){\n gameHasBegun = true;\n}", "title": "" }, { "docid": "b10929675326b219835a0fcb3a7fe6a4", "score": "0.567026", "text": "canStart() {\n return true;\n }", "title": "" }, { "docid": "9de1d22a00179a3c67a74da27ec4bde4", "score": "0.5669048", "text": "function startFresh() {\n \n\n}", "title": "" }, { "docid": "332498267f3eaa86bdcba0b51db3e0b7", "score": "0.5662535", "text": "hasNotStarted() {\n return true;\n }", "title": "" }, { "docid": "bde22654908d108a8684d5c362a4528e", "score": "0.56590813", "text": "function start() {\n // if (!window.confirm(\"Start?\")) return;\n\n stage0();\n\n}", "title": "" }, { "docid": "0c9fc6483bc0b874ff2cef2ebfe4b46e", "score": "0.5657688", "text": "function start_game() {\n // this function is used to start_game and reset_game\n reset_var_shallow();\n\n // console.log(\"Game has started!\");\n}", "title": "" }, { "docid": "256ab162e1393279302c6426fed68375", "score": "0.56567734", "text": "Start() {}", "title": "" }, { "docid": "dfdcd0f59d6032e00f5f10a5aecca486", "score": "0.5641089", "text": "start() {\n this.status = 'starting';\n this.date.start = new Date();\n this.hr.start = process.hrtime();\n }", "title": "" }, { "docid": "0b86450a467665766fb4d8e0ae8d819a", "score": "0.56024307", "text": "takeStartSceneSnapshot() {\n this.sceneBeforeRun = this.selectedScene;\n }", "title": "" }, { "docid": "9eea7f382e57d2721bf3d94e35f405d1", "score": "0.560144", "text": "constructor() {\n super(names.Started, StateType.Started, undefined, undefined);\n }", "title": "" }, { "docid": "1b66507f97a276836f5345d7b7363485", "score": "0.5600368", "text": "function start() {\n setHasStarted(true)\n onStart()\n }", "title": "" }, { "docid": "5408431f6c9231fa1e5ee6f3822c5e59", "score": "0.5599806", "text": "function Start() {\n\n}", "title": "" }, { "docid": "59d6ce00663074eac7d335f6ff097555", "score": "0.5594903", "text": "function Awake () \n{\n // set time to be stopped in the meditative state\n slowSpeed = 0.00;\n \n // get proper gameobjects and scripts\n HUD = GameObject.Find(\"HUD\");\n medView = GameObject.Find(\"MeditativeState\");\n \n wheelScript = GameObject.Find(\"EnzoWheel\").GetComponent(meditativeWheel);\n followScript = GameObject.Find(\"MeditativeState\").GetComponent(HUDfollow);\n \n // setup the necessary scripts, as they will be immediately disabled\n wheelScript.setup();\n followScript.setup();\n \n // get the pause script\n pauseScript = GameObject.Find(\"PauseMenu\").GetComponent(pauseMenuScript);\n \n // disable the various pieces of the meditative state\n medView.SetActive(false);\n \n}", "title": "" }, { "docid": "8b9600607209976f7ecd86db9ba78598", "score": "0.55929744", "text": "function Start (){\n}", "title": "" }, { "docid": "89b56cdbadbe59bcaf1f04a64473793c", "score": "0.55880696", "text": "function Start() {\n}", "title": "" }, { "docid": "90aac6d6ff243bb20ad8a585bd03e9a3", "score": "0.55863166", "text": "start() { }", "title": "" }, { "docid": "62f7aba81b143a0f54f4c51c981ba151", "score": "0.55776864", "text": "function Start() {\n\t\n}", "title": "" }, { "docid": "1746d7ea9e51482a78cf874ba7f8975d", "score": "0.5571113", "text": "start () {\n this.isRunning = true\n }", "title": "" }, { "docid": "e3d25ac429d2cfbaec0f375510757cee", "score": "0.55658036", "text": "restart() {\n this.paused = false;\n }", "title": "" }, { "docid": "ebbe00921cac077b3609189a4e66d35a", "score": "0.5565464", "text": "function Start () {\n\t\n\t}", "title": "" }, { "docid": "41a670bd587e7db15bb8e4b66a29cb79", "score": "0.55603755", "text": "abort() {\n this.started = false;\n }", "title": "" }, { "docid": "4712acd873ff647e8b096e595cfd08ac", "score": "0.5556307", "text": "function restart(){ \n menuFlag = false;\n let restart = true;\n setup(restart);\n}", "title": "" }, { "docid": "790f95ed501beb3d761be31816573ab8", "score": "0.55427784", "text": "function stateChange () {\n // Execute as many scripts in order as we can\n let pendingScript\n while (pendingScripts[0] && pendingScripts[0].readyState === 'loaded') {\n pendingScript = pendingScripts.shift()\n // avoid future loading events from this script (eg, if src changes)\n pendingScript.onreadystatechange = null\n // can't just appendChild, old IE bug if element isn't closed\n firstScript.parentNode.insertBefore(pendingScript, firstScript)\n }\n}", "title": "" }, { "docid": "922da2b1528166a46bc31a1eca822373", "score": "0.55337864", "text": "started() {\n this.clearStats();\n }", "title": "" }, { "docid": "d02e0675cb4115772b454f58325d4790", "score": "0.553372", "text": "doStart () {\n\t\t// Default implementation does nothing\n\t}", "title": "" }, { "docid": "bd5f981ca8706fb80ffaf01a9765c4d1", "score": "0.5531213", "text": "function Awake():void {\n\t// Assign references to various components\n\t_ce = GetComponent(\"CombatEngine\");\n\t_me = GetComponent(\"MovementEngine\");\n\t_status = GetComponentInChildren(TextMesh);\n\n\t// Set initial values for booleans\n\t_statusDisplaying = false;\n\n\t// Reset intial status to be blank\n\t_currStatus = \"\";\n\t_statusTimeoutClock = 0;\n}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.553096", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.553096", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.553096", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.553096", "text": "start() {}", "title": "" }, { "docid": "0cd1f82a4b21ec0cd520ec30dbb6421c", "score": "0.55297256", "text": "function Start () {\n\n\n\n}", "title": "" }, { "docid": "5a574ca366863d419f322bd8bd5941f9", "score": "0.5526463", "text": "startGame() {\n this.gameStarted = true;\n this.emitToNativeScript(START_GAME, true);\n }", "title": "" }, { "docid": "d6f98fcc6a11c5b4fe1c9ba12326779b", "score": "0.55256593", "text": "Awake() {}", "title": "" }, { "docid": "0efb31aa32bf4e8ae89aded6c04a2d09", "score": "0.5524447", "text": "function start() {\n updateStatus();\n }", "title": "" }, { "docid": "2e90565be33d07310b5345f796453bd2", "score": "0.5517552", "text": "get hasStarted() {\n return this._hasStarted;\n }", "title": "" }, { "docid": "0a75a68ac434d51173730596e52b2609", "score": "0.5511041", "text": "onStart(dir) {\n if(this.isPatrolling){return}\n // this.sprite.classList.remove(this.name+\"-\"+this.sprite.dirstr);\n this.isPatrolling=true;\n this.isStarted=true;\n console.log(this.namespace + \" Started\");\n }", "title": "" }, { "docid": "4309c3663a13e79a67bf592729838561", "score": "0.5510061", "text": "start() {\n if (this.isSdkLoaded_) {\n this.callMethod_('start');\n } else {\n this.preloadState_.started = true;\n }\n }", "title": "" }, { "docid": "0f0e61a2ff7916727b76647d3d32ca6c", "score": "0.5505848", "text": "function start(){\n if(gameHasStarted == false){\n makeLoadingScreen();\n }\n \n}", "title": "" } ]
ad19b20d4483141e562c0628d90a1cae
Convert boxes into JSON
[ { "docid": "dbc3ee08ea77ebf01efd18a7fab4fec0", "score": "0.788428", "text": "function boxesToJSON( boxes ) {\n var box_list = [];\n for ( var i=0; i<boxes.length; i++ ) {\n\tvar ne = boxes[i].getNorthEast();\n\tvar sw = boxes[i].getSouthWest();\n\n\tbox_list[i*4] = ne.lat();\n\tbox_list[i*4 + 1] = ne.lng();\n\tbox_list[i*4 + 2] = sw.lat();\n\tbox_list[i*4 + 3] = sw.lng();\n }\n\n return JSON.stringify( { \"rectangles\" : box_list } );\n}", "title": "" } ]
[ { "docid": "c5b7e66012ebd5f8e51be14ce3b8120e", "score": "0.60035586", "text": "toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n if (this.content.size)\n obj.content = this.content.toJSON();\n if (this.marks.length)\n obj.marks = this.marks.map((n) => n.toJSON());\n return obj;\n }", "title": "" }, { "docid": "64cfc13327b4a57b200be5a0776bbaf8", "score": "0.5810665", "text": "function convertToText(obj) {\n var str = '';\n str = str + ' { \"all\":['; //start\n\n for (var i = 0; i < obj.all.length; i++) {\n\n str = str + '{';\n str = str + '\"name\":' + '\"' + obj.all[i].name.toString() + '\"' + ',\\n';\n str = str + '\"sides\":[\\n';\n\n for (var j = 0; j < obj.all[i].sides.length; j++) {\n\n str = str + '{';\n str = str +\n '\"finishing_type\" :' + '\"' + obj.all[i].sides[j].finishing_type.toString() + '\"' + \" , \\n\" +\n '\"finishing_value\" :' + '\"' + obj.all[i].sides[j].finishing_value.toString() + '\"' + \" , \\n\" +\n '\"eyelets_bool\" :' + obj.all[i].sides[j].eyelets_bool + \" , \\n\" +\n '\"eyelets_distance\" :' + '\"' + obj.all[i].sides[j].eyelets_distance.toString() + '\"' + \" , \\n\" +\n '\"eyelets_size\" :' + '\"' + obj.all[i].sides[j].eyelets_size.toString() + '\"' + \" , \\n\" +\n '\"eyelets_cmyk\" :' + '\"' + obj.all[i].sides[j].eyelets_cmyk.toString() + '\"' + \" , \\n\" +\n '\"eyelets_outline_bool\" :' + obj.all[i].sides[j].eyelets_outline_bool\n ;\n str = str + '}';\n\n if (j !== obj.all[i].sides.length-1) {\n str = str + \" , \\n \";\n }\n\n }\n\n str = str + ']\\n';\n\n str = str + '}';\n\n if (i !== obj.all.length-1) {\n str = str + ' , \\n ';\n }\n }\n\n str = str + ' ] } '; //finish\n return str;\n}", "title": "" }, { "docid": "e8eb87a6797fd3a1900223c65525ed84", "score": "0.5771515", "text": "function createJsonList(){\n var padElms = document.getElementsByClassName(\"padElm\");\n var jsonArr = [];\n for(var i =0; i < padElms.length; i++){\n var cur = padElms[i];\n var next = {\n \"text\":cur.innerHTML,\n \"size\":cur.style.fontSize,\n \"posX\":cur.style.left,\n \"posY\":cur.style.top,\n \"id\": cur.id,\n \"selected\":\"false\",\n \"sub\":\"none\"\n }\n jsonArr.push(next);\n }\n return jsonArr;\n}", "title": "" }, { "docid": "8f85a6e176c5999854a76664ed4c530a", "score": "0.56686544", "text": "toString() {\n return JSONFormat(this.content, {\n type: 'space',\n size: 2\n });\n }", "title": "" }, { "docid": "9b9a254b8dc73080f509e0db8bbce46c", "score": "0.56256866", "text": "getVertical(vBox)\n {\n let newBox = []\n vBox.map((data, i) => {\n this.setState({boxID: data.box_id})\n newBox = [\n {\"Property\": \"Box ID\",\n \"Value\": data.box_id},\n {\"Property\": \"Job ID\",\n \"Value\": data.job_id},\n {\"Property\": \"Customer\",\n \"Value\": data.customer_name},\n {\"Property\": \"Location\",\n \"Value\": data.box_location},\n {\"Property\": \"Operator\",\n \"Value\": data.box_operator},\n {\"Property\": \"State\",\n \"Value\": data.box_state},\n {\"Property\": \"Step\",\n \"Value\": data.box_step},\n {\"Property\": \"Dispatch\",\n \"Value\": data.job_dispatch}\n ]\n })\n return newBox\n }", "title": "" }, { "docid": "7a255c24f18bb7d04a913173941eb214", "score": "0.5614843", "text": "function trimmedToJSON(){ \n\t//takes the global stage and convert only data that are needed to JSON\n\tvar serialized = {};\n\tserialized[\"actors\"] = [];\n\n\tfor(var key in stage.actors){\n\t\tswitch(stage.actors[key].key){\n\t\t\tcase \"tank\":\n\t\t\t\tvar convertedJSON = tankToJSON(stage.actors[key]);\n\t\t\t\tserialized[\"actors\"].push(convertedJSON);\n\t\t\t\tbreak;\n\t\t\tcase \"opponent\":\n\t\t\t\tserialized[\"actors\"].push(opponentToJSON(stage.actors[key]));\n\t\t\t\tbreak;\n\t\t\tcase \"bullet\":\n\t\t\t\tvar bulletJSON = bulletToJSON(stage.actors[key]);\n\t\t\t\tserialized[\"actors\"].push(bulletJSON);\n\t\t\t\tbreak;\t\t\t\t\n\t\t}\n\t}\n\treturn serialized;\n}", "title": "" }, { "docid": "aec6f9acbebea8451ad2b24ce9eff730", "score": "0.55815595", "text": "function simplifyJSON(data) {\n\t// Get size information from decoded NBT data\n\tvar size = data.size.value.value;\n\t// Create three-dimensional array with dimensions matching structure\n\tvar box = new Array(size[1]).fill(0).map(\n\t\t\t(i) => new Array(size[0]).fill(0).map(\n\t\t\t\t(j) => new Array(size[2]).fill('minecraft:air')\n\t\t\t)\n\t\t);\n\t// Loop through all non-air blocks in structure\n\tdata.blocks.value.value.forEach((block) => {\n\t\tvar pos = block.pos.value.value;\n\t\t// Set name of block in correct position\n\t\tbox[pos[1]][pos[0]][pos[2]] = data.palette.value.value[block.state.value].Name.value;\n\t});\n\t// Return generated array\n\treturn box;\n}", "title": "" }, { "docid": "c1fd71137cf8d84650f66b40e259b8ad", "score": "0.55551755", "text": "function createJsonList(){\n var padElms = document.getElementsByClassName(\"padElm\");\n var jsonArr = [];\n //console.log(\"num of elms recieved from body - \" + padElms.length)\n for(var i =0; i < padElms.length; i++){\n var cur = padElms[i];\n var elmSize;\n var selected = \"false\";\n var id = parseInt(document.getElementById(\"mouseBool\").innerHTML);\n if(parseInt(cur.id) == id){\n selected = \"true\";\n //console.log(\"it worked\");\n }\n if(cur.style.fontSize == \"80px\"){\n elmSize = \"1\"\n }else{\n elmSize = \"0\";\n }\n var next = {\n \"text\":cur.innerHTML,\n \"size\":elmSize,\n \"posX\":cur.style.left,\n \"posY\":cur.style.top,\n \"id\": cur.id,\n \"selected\":selected,\n \"sub\":\"none\"\n }\n jsonArr.push(next);\n }\n return jsonArr;\n}", "title": "" }, { "docid": "7636245c3f6a06efc66b71fe8ec1d098", "score": "0.5551345", "text": "function SaveAll() {\n var textStrings = $(\"#graphicalEditor\").contents().find('*[data-cream-topping-type]');\n var Topping = { \"Text\" : [], \"Image\" : [] };\n for (var i = 0; i < textStrings.length; i++) {\n switch (textStrings[i].dataset.creamToppingType) {\n case \"text\":\n var TextJSON = { \"id\" : textStrings[i].dataset.creamToppingName, \"val\" : textStrings[i].innerHTML };\n Topping.Text.push(TextJSON);\n break;\n case \"image\":\n var ImageJSON = { \"id\" : textStrings[i].dataset.creamToppingName, \"val\" : textStrings[i].src };\n Topping.Image.push(ImageJSON);\n break;\n }\n }\n\n console.log(\"[CreamTopping] Will be saved topping with values: \");\n console.log(Topping);\n\n //ReloadEditor();\n}", "title": "" }, { "docid": "91c3b6f36cb1907f543aff24384b61e6", "score": "0.553882", "text": "toJSON() {\r\n let raw = {\r\n x: this.x / MIN_SIZE,\r\n y: this.y / MIN_SIZE,\r\n w: this.width / MIN_SIZE,\r\n h: this.height / MIN_SIZE,\r\n r: this._rendererName\r\n };\r\n\r\n if(this.left) {\r\n raw.l = this.left.toJSON();\r\n }\r\n\r\n if(this.above) {\r\n raw.a = this.above.toJSON();\r\n }\r\n\r\n return raw;\r\n }", "title": "" }, { "docid": "b12763c46a19b81ffacbd862a58dc410", "score": "0.55088884", "text": "function showBoxData(){\n state.boxArr.forEach(function(box){\n\n if(box.selected){\n inpX.value = box.x;//box.x;\n inpY.value = box.y;//box.y;\n inpW.value = box.w;//box.w;\n inpH.value = box.h;//box.h;\n inpText.value = box.text;\n inpKey.value = box.key;\n inpItem.value = box.item;\n inpXskew.value = box.xSkew;\n }\n })\n inpPaddingX.value = xPadding;\n inpPaddingY.value = yPadding;\n }", "title": "" }, { "docid": "36292c94c43a2c6e3d29aa31ef91ccc2", "score": "0.54728335", "text": "function drawBoxes(boxes) {\n boxpolys = new google.maps.Rectangle({\n bounds: boxes,\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }", "title": "" }, { "docid": "d22a45cfc9d0e6b4de5e14ae5a0f7ffe", "score": "0.5415432", "text": "function azureCVObjsToCogniBoundingBox(azureCVObjects, width, height){\n for(let aObj of azureCVObjects){\n let bl = { 'x': aObj['rectangle']['x'],\n 'y': (aObj['rectangle']['y']+aObj['rectangle']['h'] > height)? aObj['rectangle']['y']+aObj['rectangle']['h']:height\n };\n let br = { 'x': (aObj['rectangle']['x']+aObj['rectangle']['w'] < width)? aObj['rectangle']['x']+aObj['rectangle']['w']:width,\n 'y': (aObj['rectangle']['y']+aObj['rectangle']['h'] > height)? aObj['rectangle']['y']+aObj['rectangle']['h']:height\n };\n let tl = { 'x': aObj['rectangle']['x'],\n 'y': aObj['rectangle']['y'],\n };\n let tr = { 'x': (aObj['rectangle']['x']+aObj['rectangle']['w']<width)? aObj['rectangle']['x']+aObj['rectangle']['w']:width,\n 'y': aObj['rectangle']['y'],\n };\n aObj['boundingBox'] = {\n 'bl': bl, 'br': br, 'tr': tr, 'tl': tl,\n 'height': +(bl['y']-tl['y']).toFixed(1), 'width': +(br['x']-bl['x']).toFixed(1)\n };\n }\n}", "title": "" }, { "docid": "2014269519a7cb41e97087aea0f60525", "score": "0.5393834", "text": "function drawBoxes(boxes) {\n progressMessage.setProgressMessage(\"draw bounding boxes\");\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "title": "" }, { "docid": "a3c96e8ade97744a20b3c7f76d8b4b33", "score": "0.53661394", "text": "function transformBoxData(data) {\n var hash = {};\n data.forEach(function(el) { \n if (!!hash[el.x]) {\n hash[el.x].push(el.y);\n } else {\n hash[el.x] = [el.y];\n }\n });\n\n var data = [];\n for (var k in hash) {\n var vals = hash[k];\n vals.sort(function(a, b) { return a - b; });\n data.push([parseInt(k, 10), vals[0], vals[Math.floor(vals.length / 4)], vals[Math.floor(vals.length / 4) * 3], vals[vals.length-1]]);\n }\n console.log(data);\n return data;\n}", "title": "" }, { "docid": "911360e19086d448999d4d59abca707c", "score": "0.53599834", "text": "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n };\n }", "title": "" }, { "docid": "ebc848db9422bfcadf14f71827dc9c54", "score": "0.53131664", "text": "function load_from_box() {\n $('#json_editor').html('');\n json_editor('json_editor', $('#jsoninput').val());\n\n // add the jquery editing magic\n apply_editlets();\n }", "title": "" }, { "docid": "6938812fac0d1396cfbe722a071aa04e", "score": "0.5308091", "text": "function annotationJSON()\n {\n // function to adjust precision of numbers when converting to JSON\n function twoDigits(key, val) {\n if (val != undefined)\n return val.toFixed ? Number(val.toFixed(2)) : val;\n }\n var blob = new Blob( [ JSON.stringify( storage, twoDigits ) ], { type: \"application/json\"} );\n return blob;\n }", "title": "" }, { "docid": "5be908cb2a9c776d929df55d5e1ce4e7", "score": "0.5305619", "text": "function make_bounding_box(boudingBox){\n i = boundingBox.vertices\n thick = 100\n length = 2 * Math.abs(i[1].x - i[0].x)\n return [{\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[1].x, y: i[1].y-thick/2}, // in px also may be undefined (when initializing)\n rotation: 0, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n },\n {\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[2].x+thick/2, y: i[2].y}, // in px also may be undefined (when initializing)\n rotation: 90, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n },\n {\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[3].x, y: i[3].y+thick/2}, // in px also may be undefined (when initializing)\n rotation: 180, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n },\n {\n dimensions: { h: thick, w: length}, // most likely assume in mm (1mm = 3.779528px)\n coordinates: { x: i[0].x-thick/2, y: i[0].y}, // in px also may be undefined (when initializing)\n rotation: 270, // in degrees\n pinned: true,\n nodes: [{x: 0, y: 20, color: 4}]\n }]\n}", "title": "" }, { "docid": "2b3644fd6da8964c94f5bf765d99fe89", "score": "0.52969927", "text": "toJSON() {\n return { ranges: this.ranges.map(r => r.toJSON()), main: this.mainIndex };\n }", "title": "" }, { "docid": "3da8769ff5ea4b165bcb1ff210fc3b47", "score": "0.5289204", "text": "toJSON() {\n let parts = [];\n for (let i = 0; i < this.sections.length; i += 2) {\n let len = this.sections[i], ins = this.sections[i + 1];\n if (ins < 0)\n parts.push(len);\n else if (ins == 0)\n parts.push([len]);\n else\n parts.push([len].concat(this.inserted[i >> 1].toJSON()));\n }\n return parts;\n }", "title": "" }, { "docid": "ca64ff6765b8a8c927ebd60621137007", "score": "0.5287689", "text": "function drawBoxData(request) {\n $.getJSON('/charts/api/get_box_data/', request, function(data) {\n console.log(data);\n if (!data.error) {\n data = transformBoxData(data.data);\n drawBoxChart(data, 'chart-div2');\n } else {\n alert(data.error);\n }\n });\n}", "title": "" }, { "docid": "9216123d0c505b1960515244276df753", "score": "0.5279551", "text": "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "title": "" }, { "docid": "ba016a8bb591d77ae3e51e067ed29d61", "score": "0.52782685", "text": "getGameStringifiedExtended() {\n\t\tif (this.boxesCached == null) {\n\t\t\tthis.boxesCached = [];\n\t\t\tthis.goodiesCached = [];\n\t\t\tfor (var y = 0; y < this.height; y++) {\n\t\t\t\tthis.boxesCached[y] = '';\n\t\t\t\tvar d = 0;\n\t\t\t\tvar box = 0;\n\t\t\t\tfor (var x = 0; x < this.width; x++) {\n\t\t\t\t\td = (d + 1) % 2;\n\t\t\t\t\tif (d == 0) box = 0;\n\t\t\t\t\tif (this.gameMap.isBoxAtPosition(x, y))\n\t\t\t\t\t\tbox += (this.gameMap.getTile(x, y) - c.FILTER_BOX) << (2 * d);\n\t\t\t\t\telse if (this.gameMap.isGoodieAtPosition(x, y))\n\t\t\t\t\t\tthis.goodiesCached.push({\n\t\t\t\t\t\t\t\"x\": x,\n\t\t\t\t\t\t\t\"y\": y,\n\t\t\t\t\t\t\t\"g\": (this.gameMap.getTile(x, y) - c.FILTER_GOODIE)\n\t\t\t\t\t\t});\n\t\t\t\t\tif ((d == 1) || (x == (this.width - 1)))\n\t\t\t\t\t\tthis.boxesCached[y] += box.toString(16);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn JSON.stringify({\n\t\t\t\"boxes\": this.boxesCached,\n\t\t\t\"men\": this.men,\n\t\t\t\"sounds\": this.sounds,\n\t\t\t\"bombs\": this.bombs,\n\t\t\t\"goodies\": this.goodiesCached,\n\t\t\t\"width\": this.width,\n\t\t\t\"height\": this.height,\n\t\t\t\"rev\": this.rev,\n\t\t\t\"stime\": Date.now()\n\t\t});\n\t}", "title": "" }, { "docid": "7970cfea91ba5c622df2ad8e66d37902", "score": "0.52657545", "text": "function drawBoxes() {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 1,\n map: map\n });\n }\n}", "title": "" }, { "docid": "13a17ee7584a2a7cdfd2a3257199910b", "score": "0.5256994", "text": "function drawBoxes(boxes) {\n boxpolys = new Array(boxes.length);\n for (var i = 0; i < boxes.length; i++) {\n boxpolys[i] = new google.maps.Rectangle({\n bounds: boxes[i],\n fillOpacity: 0,\n strokeOpacity: 1.0,\n strokeColor: '#000000',\n strokeWeight: 3,\n map: map\n });\n }\n}", "title": "" }, { "docid": "73d2e0f8a97fddf34e2aaf5bc6015809", "score": "0.52410537", "text": "toJSON() {\n return {\n id: this.id,\n name: this.name,\n color: this.color,\n position: this.body.position,\n quaternion: this.body.quaternion\n };\n }", "title": "" }, { "docid": "27f8c703e1dbef7c74512a6c3b27bd26", "score": "0.5232076", "text": "function serializeTree() {\n var result = {};\n\n $('#proofTreeContainer .proofTreeNest').each(function() {\n var treeLocation = $(this).attr('id');\n var lineLeft = $('#' + treeLocation + ' > .proofTreeLine > .proofTreeLineLeft').text();\n var lineRight = $('#' + treeLocation + ' > .proofTreeLine > .proofTreeLineRight').text();\n var lineCondition = $('#' + treeLocation + ' .proofTreeLine > .proofTreeLineCondition').text();\n var lineLabel = $('#' + treeLocation + ' > .proofTreeLabel > .proofTreeDropdownLabel').val();\n var lineSideCondition = $('#' + treeLocation + ' > .proofTreeSideCondition').val();\n\n result[treeLocation] = {};\n result[treeLocation]['left'] = $.trim(lineLeft);\n result[treeLocation]['middle'] = $.trim(lineRight);\n result[treeLocation]['right'] = $.trim(lineCondition);\n result[treeLocation]['label'] = $.trim(lineLabel);\n result[treeLocation]['sideCondition'] = $.trim(lineSideCondition);\n });\n\n var keypress = jQuery.Event('input');\n $('#serializedTree').val(JSON.stringify(result));\n $('#serializedTree').click().trigger(keypress).blur();\n\n return result;\n }", "title": "" }, { "docid": "d838c82abfe4d6dce29b05943af065f7", "score": "0.52236795", "text": "stringifyVector(vec) {\n return '{\"x\":'+vec.x+',\"y\":'+vec.y+',\"z\":'+vec.z+'}';\n }", "title": "" }, { "docid": "021d82ec53bcb20dec4e1504189fc854", "score": "0.52216125", "text": "function createBox()\n\t{\n\t\tbox = that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor,\n\t\t\tdepth: that.depth\n\t\t}, fw.dockTo(that));\n\t}", "title": "" }, { "docid": "2a2a62e3f1d1a919f84464edd37eb67d", "score": "0.52161026", "text": "getBoxes() {\n return this.boxes.map(\n box => this.getBoxData(box)\n );\n }", "title": "" }, { "docid": "67afc57c3900281e0eef248d6b751f52", "score": "0.52159274", "text": "function createJSON(object){\n\n\ttry{\n\n\t\t// save vertices as arrays for x, y and z\n\t\tlet x = [];\n\t\tlet y = [];\n\t\tlet z = [];\n\n\t\t// get vertices\n\t\tlet vertices = object.geometry.getAttribute('position');\n\n\t\t// get number of vertices\n\t\tlet count = object.geometry.getAttribute('position').count;\n\n\t\t// add coordinates to arrays\n\t\tfor(let i = 0; i < count; i++){\n\t\t\tx.push(vertices.getX(i));\n\t\t\ty.push(vertices.getY(i));\n\t\t\tz.push(vertices.getZ(i));\n\t\t}\n\n\t\t// save vertex indices\n\t\tlet faces = [];\n\n\t\t// get vertices as array\n\t\tlet array = object.geometry.getIndex().array;\n\t\tlet length = array.length;\n\n\t\t// store indices for each point in an array and add array to indices array\n\t\tfor(let i = 0; i < length;){\n\t\t\tlet row = [];\n\t\t\trow.push(array[i++],array[i++],array[i++]);\n\t\t\tfaces.push(row);\n\t\t}\n\n\t\t// create JSON\n\t\tlet json = {\n\t\t\tobjID: object.name.toString(),\n\t\t\tobjClass: object.userData[0].toString(),\n\t\t\tcolor: \"\",\n\t\t\tsanding: \"\",\n\t\t\tvertex_indices: faces,\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tz: z\n\t\t};\n\n\t\t// return object as json\n\t\treturn json;\n\n\t}catch(error){\n\n // update display\n status = 'Fehler bei JSON-Erstellung';\n\n\t\t// return null\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "55b54897709b785d1c67f8e650fd5cbd", "score": "0.5191369", "text": "function boxCreator() {\n let attributesForBoxes = document.createAttribute('class');\n attributesForBoxes.value = 'box-attributes';\n let box = document.createElement('div');\n box.id = `box${i}`;\n box.setAttributeNode(attributesForBoxes);\n document.getElementById('game').appendChild(box);\n document.getElementById('game').style.display = 'flex';\n }", "title": "" }, { "docid": "e79c945022f8394eeb2347400100c446", "score": "0.5189725", "text": "function verJson() {\n alert(JSON.stringify(miLibro));\n}", "title": "" }, { "docid": "3c404b51f4742970a2c11ad693196b81", "score": "0.5162678", "text": "toJSON() {\n const result = toJSONImpl(this.root, true);\n result.dimensions = this.dimensions;\n return result;\n }", "title": "" }, { "docid": "f3e01ffb412cf8066ce668b26b4cabed", "score": "0.51555234", "text": "function BoxRenderer() {}", "title": "" }, { "docid": "7e6f294099dff1bb7038145f3662142e", "score": "0.5141796", "text": "toServerObject() {\n return JSON.stringify({\n \"_ContainerHeight\": parseFloat(this.cH),\n \"_ContainerWidth\": parseFloat(this.cW),\n \"_Orders\": InputOrder.listToServerObjects(this.orders),\n \"_Algorithm\": this.algorithm\n });\n }", "title": "" }, { "docid": "3e6f5b87da871b65e479334b195f9d9c", "score": "0.51283866", "text": "function drawEndBoxData(request) {\n $.getJSON('/charts/api/get_end_box_data/', request, function(data) {\n console.log(data);\n if (!data.error) {\n data = transformEndBoxData(data.data, data.x);\n drawBoxChart(data, 'chart-div2', 'string');\n } else {\n alert(data.error);\n }\n });\n}", "title": "" }, { "docid": "2e0541f6ac2f4aa6b75c89aecfe49f6a", "score": "0.5122586", "text": "serialize(){\n let result = {\n type: this.type,\n id: this.id,\n properties: {},\n subparts: this.subparts.map(subpart => {\n return subpart.id;\n }),\n ownerId: null,\n loadedStacks: (this.loadedStacks.map(stack => {\n return stack.id;\n })),\n };\n\n // Serialize current part properties\n // values\n this.partProperties._properties.forEach(prop => {\n let name = prop.name;\n let value = prop.getValue(this);\n // If this is the events set, transform\n // it to an Array first (for serialization)\n if(name == 'events'){\n value = Array.from(value);\n }\n result.properties[name] = value;\n });\n return result;\n }", "title": "" }, { "docid": "7a852a49c8ba9e1ec4f1acb5c318169d", "score": "0.5119857", "text": "toJSON() {\n return this.content.length ? this.content.map((n) => n.toJSON()) : null;\n }", "title": "" }, { "docid": "c87c0fe351aa39dd1b7e00659bff0e14", "score": "0.51181436", "text": "function __convertLayerToJSON(_layer){\n var layerCopy = jQuery.extend(true,[],_layer);\n for (var i=0; i<layerCopy.length;i++){\n if('object' in layerCopy[i]['animation']){\n layerCopy[i]['animation']['object'] = '#'+layerCopy[i]['animation']['object'][0].id;\n }\n }\n return JSON.stringify(layerCopy);\n }", "title": "" }, { "docid": "08dd1b295c7fd2b3a927d4f1aee7cb7e", "score": "0.5098333", "text": "function formatRectObjects(rect) {\n return `top=${rect.y}`.padEnd(10) + `left=${rect.x}`.padEnd(10) + `bottom=${rect.y + rect.h}`.padEnd(12) \n + `right=${rect.x + rect.w}`.padEnd(10) + `(${rect.w}x${rect.h})`;\n }", "title": "" }, { "docid": "ef693d2117e5a0c5a983bf3b0e69694f", "score": "0.5098129", "text": "function buildBoard(){\n self.ttt.boxes = [{select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"}];\n self.ttt.$save();\n }", "title": "" }, { "docid": "fe8aa4cfe815dbeeb31d5dfff97b7b42", "score": "0.509077", "text": "toJSON() {\n return {\n r: this.r,\n g: this.g,\n b: this.b,\n a: this.a,\n };\n }", "title": "" }, { "docid": "310e9bbdf63d7f01a98b1dcffd82eef4", "score": "0.5063883", "text": "function drawBoxes(boxesArray)\t{\n\tvar scene = document.getElementById('scene');\n\tfor (i=0; i < boxesArray.length; i++)\t{\n\t\tvar myDiv = document.createElement('div');\n\t\tmyDiv.setAttribute('id',boxesArray[i].id);\n\t\tmyDiv.style.backgroundColor = boxesArray[i].color;\n\t\tmyDiv.setAttribute('class','box');\n\t\tmyDiv.style.left = boxesArray[i].x +'px';\n\t\tmyDiv.style.top = boxesArray[i].y + 'px';\n\t\tmyDiv.innerHTML = boxesArray[i].name;\n\t\tmyDiv.onclick = displayBoxContents;\n\t\tscene.appendChild(myDiv);\n\t}\n\t\n}", "title": "" }, { "docid": "585ad84ecb333df5d2dd333d29fd4c6e", "score": "0.5063525", "text": "toJSON() {\n if (!this.content.size)\n return null;\n let json = { content: this.content.toJSON() };\n if (this.openStart > 0)\n json.openStart = this.openStart;\n if (this.openEnd > 0)\n json.openEnd = this.openEnd;\n return json;\n }", "title": "" }, { "docid": "afad455abab860c25f84d080b141aff7", "score": "0.5062232", "text": "function addBox(width, height, center = [0, 0, 1]) {\n let object = {\n name: '',\n type: 'box',\n width: width,\n height: height,\n center: center,\n fill: '#FFFFFF',\n stroke: '#000000',\n actualStroke: '#000000',\n T: Math.identity(),\n R: Math.identity(),\n S: Math.identity(),\n angleRotation: 0\n }\n objectSelected = objects.push(object)\n drawObjects()\n return objectSelected\n }", "title": "" }, { "docid": "01d8db63dcd5e262dbde7fcd0808e113", "score": "0.5057173", "text": "function gCloudVObjsToCogniBoundingBox(gCloudObjects, width, height){\n for(let gCloudObj of gCloudObjects){\n let vertices;\n let normalized = false;\n\n if(gCloudObj['boundingPoly']['vertices'].length > 0) // we can't know for sure that vertices will be filled (in case we check and use normalizedVertices)\n vertices = gCloudObj['boundingPoly']['vertices'];\n\n else if(gCloudObj['boundingPoly']['normalizedVertices'].length > 0) {\n vertices = gCloudObj['boundingPoly']['normalizedVertices'];\n normalized = true;\n }\n\n let x1 = vertices[0]['x']; // min x\n let x2 = vertices[0]['x']; // max x\n let y1 = vertices[0]['y']; // min y\n let y2 = vertices[0]['y']; // max y\n\n // remind that\n // - x goes from 0 -> N (left -> right)\n // - y goes from 0 -> N (top -> bottom)\n for(let point of vertices){\n x1 = Math.min(x1, point['x']);\n x2 = Math.max(x2, point['x']);\n y1 = Math.max(y1, point['y']);\n y2 = Math.min(y2, point['y']);\n }\n\n let bl = { 'x': (normalized)? +(x1 * width).toFixed(1):x1,\n 'y': (normalized)? +(y1 * height).toFixed(1):y1\n };\n let br = { 'x': (normalized)? +(x2 * width).toFixed(1):x2,\n 'y': (normalized)? +(y1 * height).toFixed(1):x1\n };\n let tl = { 'x': (normalized)? +(x1 * width).toFixed(1):x1,\n 'y': (normalized)? +(y2 * height).toFixed(1):y2\n };\n let tr = { 'x': (normalized)? +(x2 * width).toFixed(1):x2,\n 'y': (normalized)? +(y2 * height).toFixed(1):y2\n };\n\n gCloudObj['boundingBox'] = {\n 'bl': bl, 'br': br, 'tr': tr, 'tl': tl,\n 'height': +(bl['y']-tl['y']).toFixed(1), 'width': +(br['x']-bl['x']).toFixed(1)\n };\n }\n}", "title": "" }, { "docid": "f8ec2d44a86cb192634ca6cf4c99006c", "score": "0.5056717", "text": "function transformEndBoxData(data, x) {\n var hash = {};\n x = x.split(',');\n data.forEach(function(el) { \n l = boxLabel(el, x);\n if (!!hash[l]) {\n hash[l].push(el[0]);\n } else {\n hash[l] = [el[0]];\n }\n });\n\n var data = [];\n for (var k in hash) {\n var vals = hash[k];\n vals.sort(function(a, b) { return a - b; });\n data.push([k, vals[0], vals[Math.floor(vals.length / 4)], vals[Math.floor(vals.length / 4) * 3], vals[vals.length-1]]);\n }\n console.log(data);\n return data;\n}", "title": "" }, { "docid": "7ac765f4a3dc943ea0cce17e3460075a", "score": "0.5054885", "text": "function formatRectObjects(rect) {\n return `top=${rect.y}`.padEnd(10) + `left=${rect.x}`.padEnd(10) + `bottom=${rect.y + rect.h}`.padEnd(12)\n + `right=${rect.x + rect.w}`.padEnd(10) + `(${rect.w}x${rect.h})`;\n }", "title": "" }, { "docid": "7ddb2c5aeab5c36ad2fb95032abb028e", "score": "0.5050604", "text": "toJSON() {\n return {\n termType: this.termType,\n value: this.value\n };\n }", "title": "" }, { "docid": "7ddb2c5aeab5c36ad2fb95032abb028e", "score": "0.5050604", "text": "toJSON() {\n return {\n termType: this.termType,\n value: this.value\n };\n }", "title": "" }, { "docid": "24978af87ff6f9be94bf9f627f5c95e5", "score": "0.50491625", "text": "getJSONRepresentation() {\n return {\n bulletX: this.x,\n bulletY: this.y,\n bulletRadius: this.radius,\n bulletColour: this.colour,\n bulletCursorDirectionX: this.cursorDirection.x,\n bulletCursorDirectionY: this.cursorDirection.y\n }\n }", "title": "" }, { "docid": "b9a0516bb21170de6fa91ab4a8df7566", "score": "0.5044133", "text": "function writeToJson(){\n var modalbody = jQuery(\".modal-body\")[0];\n\n var jsonObj = {\n \"id\": influencer_id,\n \"name\": jQuery(\"#name\")[0].value,\n \"profile_icon\": jQuery(\"#icon_img\", modalbody).attr(\"src\"),\n \"description\": (jQuery(\"#description\", modalbody)[0]).value,\n \"big_image\": jQuery(\"#background_img\", modalbody).attr(\"src\"),\n \"blog\": [],\n \"style\": [],\n \"picks\": []\n };\n\n var blog_div = jQuery(\"#blog_div\");\n var blogs = jQuery(\".chunk_div\", blog_div);\n for (var i=0; i<blogs.length; i++){\n jsonObj.blog[i] = {\n \"img\": jQuery(\"img\", blogs[i]).attr(\"src\"),\n \"description\": (jQuery(\"textarea\", blogs[i])[0]).value\n }\n\n }\n\n var style_div = jQuery(\"#style_div\");\n var styles = jQuery(\".chunk_div\", style_div);\n for (var i=0; i<styles.length; i++){\n jsonObj.style[i] = {\n \"img\": jQuery(\"img\", styles[i]).attr(\"src\"),\n \"link\": jQuery(\"input\", styles[i])[1].value\n }\n }\n\n var picks_div = jQuery(\"#picks_div\");\n var picks = jQuery(\".chunk_div\", picks_div);\n for (var i=0; i<picks.length; i++){\n jsonObj.picks[i] = escapeHtml(picks[i].children[0].value);\n }\n\n console.log(jsonObj);\n\n //change new Json Object\n if(influencer_id == 0)\n {\n jsonObj.show_curation = 0;\n jsonObj.curation_image_big = \"\";\n jsonObj.curation_image_small = \"\";\n jsonObj.id = newJsonObj.global_available_id;\n newJsonObj.global_available_id++;\n jsonObj.show_curation = 0;\n jsonObj.curation_image_big=\"\";\n jsonObj.curation_image_small=\"\";\n newJsonObj.influencers.push(jsonObj);\n }\n else\n {\n var j = 0;\n for(;j<newJsonObj.influencers.length;j++)\n {\n if(newJsonObj.influencers[j].id == influencer_id)\n break;\n }\n jsonObj.show_curation = newJsonObj.influencers[j].show_curation;\n jsonObj.curation_image_big = newJsonObj.influencers[j].curation_image_big;\n jsonObj.curation_image_small = newJsonObj.influencers[j].curation_image_small;\n newJsonObj.influencers[j] = jsonObj;\n }\n\n\n parseJSON(newJsonObj);\n}", "title": "" }, { "docid": "dd55950639b4eca3eca200856f27ca5a", "score": "0.5043414", "text": "function displayJSON(json){\n const angle = 2*Math.PI/totalNum\n const radius = Math.max(rect_width * 3, 140*totalNum / (2 * Math.PI))\n let curr_angle = 0\n let center = null\n\n var parentCell = graph.getDefaultParent()\n\n // wipe old vertices and edges\n\n model.beginUpdate()\n try\n {\n wipeGraphicalDisplay()\n center = graph.insertVertex(parentCell, null, '', 0, 0, 0, 0,\n 'defaultVertex;arcSize=50')\n } catch (err){\n return\n }\n finally\n {\n // Updates the display\n model.endUpdate()\n }\n\n let i = 0\n for (i = 0; i < totalNum; i++){\n // get position of center of the rectangle\n let center_x = Math.cos(curr_angle) * radius\n let center_y = Math.sin(curr_angle) * radius\n\n // get posiition of top left corner of rectangle\n let corner_x = Math.round(center_x - rect_width / 2)\n let corner_y = Math.round(center_y - rect_height / 2)\n\n // display rectangle\n model.beginUpdate()\n try\n {\n let v1 = graph.insertVertex(parentCell, null, 'Hello'+i, corner_x, corner_y, rect_width, rect_height)\n v1.uid = i\n let e1 = graph.insertEdge(parentCell, null, '', v1, center)//, 'defaultEdge;endArrow='\n } \n catch (err) {\n return\n }\n finally\n {\n // Updates the display\n model.endUpdate()\n }\n\n curr_angle += angle\n }\n}", "title": "" }, { "docid": "837c70d581da3e666d178c89267b8ac6", "score": "0.50426644", "text": "function dumpAsJson() {\n const json = JSON.stringify(\n {offlinePages: offlinePages, savePageRequests: savePageRequests},\n function(key, value) {\n return key.endsWith('Time') ? new Date(value).toString() : value;\n },\n 2);\n\n $('dump-box').value = json;\n $('dump-info').textContent = '';\n $('dump-modal').showModal();\n $('dump-box').select();\n}", "title": "" }, { "docid": "5203b0fed7db6d004f766152f2841112", "score": "0.5042027", "text": "toJSON() {\n var result = toJSONImpl(this.root, true);\n result.dimensions = this.dimensions;\n return result;\n }", "title": "" }, { "docid": "36a9f6d8d07ab668e7513feb9ebfa26b", "score": "0.50322187", "text": "function makeBox(boxType, indicator, locationTitle, resourceURI, checkBool, iObject, lObject) {\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\tdataType: \"json\",\n\t\tasync: false,\n\t\tbeforeSend: function(request) {\n\t\t request.setRequestHeader(\"X-ArchivesSpace-Session\", token);\n\t\t},\n\t\turl: baseUrl + '/repositories/' + repoId + \"/search?page=1&page_size=20&q=%22\" + locationTitle + \"%22\",\n\t\tsuccess: function(data) {\n\t\t\tfor(i=0; i<data[\"results\"].length; i++) {\n\t\t\t\tif (data[\"results\"][i][\"title\"] == locationTitle) {\n\t\t\t\t\tvar today = new Date();\n\t\t\t\t\tvar date = today.toISOString().split('T')[0];\n\t\t\t\t\tnewLocation = {\"status\": \"current\", \"jsonmodel_type\": \"container_location\", \"start_date\": date, \"ref\": data[\"results\"][i][\"uri\"]}\n\t\t\t\t\tboxObject = {\"jsonmodel_type\": \"top_container\", \"type\": boxType, \"indicator\": indicator, \"container_locations\": [], \"restricted\": checkBool, \"active_restrictions\": []}\n\t\t\t\t\tboxObject[\"container_locations\"].push(newLocation);\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\tdata: JSON.stringify(boxObject),\n\t\t\t\t\t\tbeforeSend: function(request) {\n\t\t\t\t\t\t request.setRequestHeader(\"X-ArchivesSpace-Session\", token);\n\t\t\t\t\t\t request.setRequestHeader('Content-Type', 'application/json');\n\t\t\t\t\t\t},\n\t\t\t\t\t\turl: baseUrl + '/repositories/' + repoId + \"/top_containers\",\n\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\tvar boxURI = data[\"uri\"]\n\t\t\t\t\t\t\tvar newContainer = {\"indicator_1\": boxObject[\"indicator\"], \"type_1\": boxObject[\"type\"]}\n\t\t\t\t\t\t\tvar instance = {\"jsonmodel_type\": \"instance\", \"instance_type\": \"mixed_materials\", \"sub_container\": {\"jsonmodel_type\": \"sub_container\", \"top_container\": {\"ref\": boxURI}}, \"is_representative\": false}\n\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\t\tbeforeSend: function(request) {\n\t\t\t\t\t\t\t\t request.setRequestHeader(\"X-ArchivesSpace-Session\", token);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\turl: baseUrl + resourceURI,\n\t\t\t\t\t\t\t\tsuccess: function(resourceObj) {\n\t\t\t\t\t\t\t\t\tresourceObj[\"instances\"].push(instance);\n\t\t\t\t\t\t\t\t\t//console.log(resourceObj);\n\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\t\t\t\tdata: JSON.stringify(resourceObj),\n\t\t\t\t\t\t\t\t\t\tbeforeSend: function(request) {\n\t\t\t\t\t\t\t\t\t\t request.setRequestHeader(\"X-ArchivesSpace-Session\", token);\n\t\t\t\t\t\t\t\t\t\t request.setRequestHeader('Content-Type', 'application/json');\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\turl: baseUrl + resourceObj['uri'],\n\t\t\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").addClass(\"has-success\");\n\t\t\t\t\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-ok form-control-feedback\");\n\t\t\t\t\t\t\t\t\t\t\t\tiObject.addClass(\"form-control-success\");\n\t\t\t\t\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").addClass(\"has-success\");\n\t\t\t\t\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-ok form-control-feedback\");\n\t\t\t\t\t\t\t\t\t\t\t\tlObject.addClass(\"form-control-success\");\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").addClass(\"has-error\");\n\t\t\t\t\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-remove form-control-feedback\");\n\t\t\t\t\t\t\t\t\t\t\t\tiObject.addClass(\"form-control-error\");\n\t\t\t\t\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").addClass(\"has-error\");\n\t\t\t\t\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-remove form-control-feedback\");\n\t\t\t\t\t\t\t\t\t\t\t\tlObject.addClass(\"form-control-error\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").addClass(\"has-error\");\n\t\t\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-remove form-control-feedback\");\n\t\t\t\t\t\t\t\t\t\tiObject.addClass(\"form-control-error\");\n\t\t\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").addClass(\"has-error\");\n\t\t\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-remove form-control-feedback\");\n\t\t\t\t\t\t\t\t\t\tlObject.addClass(\"form-control-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\terror: function(data) {\n\t\t\t\t\t\t\t\talert(\"ERROR: Location failed to Post\");\n\t\t\t\t\t\t\t\t//alert(JSON.stringify(data));\n\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").addClass(\"has-error\");\n\t\t\t\t\t\t\t\tiObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-remove form-control-feedback\");\n\t\t\t\t\t\t\t\tiObject.addClass(\"form-control-error\");\n\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").addClass(\"has-error\");\n\t\t\t\t\t\t\t\tlObject.parent(\".col-xs-4\").find(\".inputGlyph\").addClass(\"glyphicon-remove form-control-feedback\");\n\t\t\t\t\t\t\t\tlObject.addClass(\"form-control-error\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c4cd65548474a6592c23f86a16519ac0", "score": "0.5031117", "text": "function createRectangle() {\n $.get(\"/shape/rectangle\", function (data, status) {\n var obj = JSON.parse(data);\n app.drawRectangle(obj.loc,obj.width,obj.height,obj.color);\n }, \"json\");\n}", "title": "" }, { "docid": "974d555aff1cd68edb14c669e04ae92e", "score": "0.503107", "text": "function SaveTheView()\n{\n console.log($(\".display-area\")[0].children)\n var z=$(\".display-area\")[0].children.length;\n for(i=0;i<z;i++)\n {\n console.log($(\".display-area\")[0].children[i])\n console.log($(\".display-area\")[0].children[i].attributes.name.value)\n console.log($(\".display-area\")[0].children[i].style.position)\n console.log($(\".display-area\")[0].children[i].style.top)\n console.log($(\".display-area\")[0].children[i].style.left)\n \n shapes.id=$(\".display-area\")[0].children[i].id;\n shapes.type=$(\".display-area\")[0].children[i].attributes.name.value;\n shapes.position=$(\".display-area\")[0].children[i].style.position;\n shapes.left=$(\".display-area\")[0].children[i].style.left;\n shapes.top=$(\".display-area\")[0].children[i].style.top;\n }\n console.log(shapes)\n}", "title": "" }, { "docid": "7b01d9720cb00da56571f7d1a9950b5e", "score": "0.50308233", "text": "function createSingleJson(text,size,posX,posY,id,selected,sub){\n var next = {\n \"text\":text,\n \"size\":size,\n \"posX\":posX,\n \"posY\":posY,\n \"id\": id,\n \"selected\":selected,\n \"sub\":sub\n }\n return next;\n}", "title": "" }, { "docid": "d5b1616da8a18b11c452266eedfc4e7d", "score": "0.50245917", "text": "function AE_typeMaker() {\n //minified json2.js\n $.evalFile($.getenv(\"BUCK_VENDOR_ROOT\")+\"/AE/lib/json2.js\");\n try{\n \n app.beginUndoGroup(\"Export Layered PSD and JSON\");\n var proj = app.project;\n var comp = proj.activeItem;\n if (!(comp instanceof CompItem)) return alert(\"Select a comp or viewer window before running this script.\");\n // function that gets justification of text layers\n function textJustVal(textDoc){\n var val = textDoc.justification;\n //var Justification = {};\n if(val == ParagraphJustification.LEFT_JUSTIFY){\n return \"LEFT\";\n }else if(val == ParagraphJustification.RIGHT_JUSTIFY){\n return \"RIGHT\";\n }else if(val == ParagraphJustification.CENTER_JUSTIFY){\n return \"CENTER\";\n }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_LEFT){\n return \"LEFTJUSTIFIED\";\n }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_RIGHT){\n return \"RIGHTJUSTIFIED\";\n }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_CENTER){\n return \"CENTERJUSTIFIED\";\n }else if(val == ParagraphJustification.FULL_JUSTIFY_LASTLINE_FULL){\n return \"FULLYJUSTIFIED\";\n }else{\n alert(\"There must be an error.\");\n }\n }\n \n //function to get needed information to recreate text layers in photoshop,\n //and export that information to a JSON file.\n //returns JSON objects for supplied text layer 'l'\n function textToObjs(l) {\n var textObj = {};\n var textDocument = l.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").value;\n \n //temporarily unparent the layer (if it is actually parented) to get accurate scale\n try{\n var tempParent = l.parent;\n l.parent = \"\";\n var scaleV = l.property(\"ADBE Transform Group\").property(\"ADBE Scale\").value;\n l.parent = tempParent;\n } catch (e) {\n var scaleV = l.property(\"ADBE Transform Group\").property(\"ADBE Scale\").value;\n }\n //\n\n textObj.layerName= l.name;\n textObj.layerScale= [scaleV[0],scaleV[1]];\n textObj.rotation = l.property(\"ADBE Transform Group\").property(\"ADBE Rotate Z\").value;\n \n //NOTE: position is handled in the main recurse() function, because i'm either lazy, stupid, or STPUD LIKE A FOX. guess which! \n\n //textObj.anchorPoint = l.transform.anchorPoint.value;\n\n textObj.font= textDocument.font;\n textObj.fontSize= textDocument.fontSize;\n textObj.fillColor= textDocument.fillColor;\n textObj.justification= textJustVal(textDocument);\n textObj.applyFill= textDocument.applyFill;\n textObj.text= textDocument.text;\n textObj.tracking= textDocument.tracking;\n try {\n if(textDocument.boxText) textObj.kind = \"PARAGRAPHTEXT\";\n textObj.boxTextSize= textDocument.boxTextSize;\n \n } catch(e) {\n if(textDocument.pointText) textObj.kind = \"POINTTEXT\";\n }\n \n // replace line returns with no characters/whitespace with line returns WITH whitespace\n l.property(\"Source Text\").setValue(textDocument.text.replace(\"\\r\\r\",\"\\rQ\\r\")); // cheat to make certain the second line always has a valid baselineLocs value (doesn't work with \\r)\n textObj.baselineLocs = l.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").value.baselineLocs;\n l.property(\"Source Text\").setValue(textObj.text);\n return textObj;\n\n }\n \n // recursively converts text objects to strings. returns JSON string.\n function textToString(inComp) {\n try{\n var res = {};\n var cnt = 0;\n var compCnt = 0;\n var parentPath = [\"doc\"];\n var parentScaleOffset = [];\n \n var parentPositionOffset = [\"comp(\\\"\"+inComp.name+\"\\\")\"];\n var aeParentPath = [\"comp(\\\"\"+inComp.name+\"\\\")\"];\n var parentRotationOffset = [];\n var baseComp = app.project.activeItem;\n var tempComp = app.project.items.addComp(\"tempComp\",baseComp.width,baseComp.height,baseComp.pixelAspect,baseComp.duration,baseComp.frameRate);\n\n function recurse(inComp,tempComp){ //recursively checks comps for text layers, returns a \"path\" to them, requires the variable \"parentPath\" note: now it does a bunch of other stuff *shrug*\n try{\n\n var lyrs = inComp.layers;\n \n for (var i=1; i<=lyrs.length; i++) {\n var l = lyrs[i];\n var currPath;\n if (l.source instanceof CompItem) {\n //build a recursive toComp() expression to find the position of text layers inside the comp, something like this:\n // thisComp.layer(\"middle Comp 1\").toComp(comp(\"middle Comp 1\").layer(\"deepest Comp 1\").toComp(comp(\"deepest Comp 1\").layer(\"deepest\").toComp([0,0,0])))\n aeParentPath[compCnt] = \"comp(\\\"\"+l.source.name+\"\\\")\";\n parentPositionOffset.push(\"layer(\\\"\"+l.name+\"\\\").toComp(\"+aeParentPath[compCnt]);\n \n currPath = \"layerSets.getByName('\"+l.name+\"')\";\n parentPath.push(currPath);\n \n //temporarily unparent the layer (if it is actually parented) to get accurate scale\n try{\n var tempParent = l.parent;\n l.parent = \"\";\n parentScaleOffset.push(l.property(\"ADBE Transform Group\").property(\"ADBE Scale\").value);\n l.parent = tempParent;\n } catch (e) {\n parentScaleOffset.push(l.property(\"ADBE Transform Group\").property(\"ADBE Scale\").value);\n }\n //\n parentRotationOffset.push(l.property(\"ADBE Transform Group\").property(\"ADBE Rotate Z\").value);\n\n compCnt++;\n recurse(l.source,tempComp);\n } else if (l instanceof TextLayer) { //is the layer a text layer?\n var prnt = aeParentPath[compCnt-1];\n res[\"textLayer\"+cnt] = textToObjs(l);\n res[\"textLayer\"+cnt].parentPath = parentPath.slice(0,compCnt+1).join(\".\");\n // create null to find position of text layer\n var tempNull = tempComp.layers.addNull();\n var nullPos = tempNull.property(\"ADBE Transform Group\").property(\"ADBE Position\");\n if (!prnt) {prnt = \"comp(\\\"\"+app.project.activeItem.name+\"\\\")\"}\n nullPos.expression =\"r = \"+prnt+\".layer(\\\"\"+l.name+\"\\\").sourceRectAtTime();\\r\"+ parentPositionOffset.slice(0,compCnt+1).join(\".\")+\".layer(\\\"\"+l.name+\"\\\").toComp([r.left,r.top])\"+Array(compCnt+1).join(\")\"); //toComp spiral of doom\n res[\"textLayer\"+cnt].layerPosition = nullPos.value;\n\n //\n // calculate scale based on all parent comps\n var tempScale = [100,100,100];\n for (s = 0; s<compCnt; s++) {\n for (a = 0; a<tempScale.length; a++){tempScale[a] *= parentScaleOffset[s][a]*.01};\n }\n res[\"textLayer\"+cnt].parentScaleOffset = tempScale;\n //\n \n // add all elements of rotation offset array\n res[\"textLayer\"+cnt].parentRotationOffset = 0;\n for (r = 0; r<compCnt; r++) {res[\"textLayer\"+cnt].parentRotationOffset += parentRotationOffset[r]};\n //\n cnt++; //iterate counter for each found text layer\n }\n\n if (i == lyrs.length && inComp != app.project.activeItem) {\n compCnt--;\n parentScaleOffset.pop();\n parentRotationOffset.pop();\n parentPositionOffset.pop();\n parentPath.pop(); \n }\n }\n \n } catch (err) {\n alert(err.line+\"\\r\"+err.toString());\n }\n }\n \n recurse(inComp,tempComp);\n tempComp.remove();\n return JSON.stringify(res, undefined, 4);\n } catch (err) {\n alert(err.line+\"\\r\"+err.toString());\n }\n }\n \n var objString = textToString(comp);\n \n //app.executeCommand(app.findMenuCommandId(\"Photoshop Layers...\")); // export layered photoshop file\n var thisFile = proj.file.fsName.substring(0,proj.file.fsName.lastIndexOf(\".\"));\n var textFile = new File(thisFile+\".json\");\n objFile = textFile.saveDlg (\"Save text as JSON...\", \"JSON:*.json;\");\n if (!objFile) return ;\n //write JSON file\n\n if (objFile.open(\"w\")) {\n objFile.encoding = \"UTF-8\";\n objFile.write(objString);\n objFile.close();\n }\n \n app.endUndoGroup();\n } catch (err) {\n alert(err.line+\"\\r\"+err.toString());\n }\n}", "title": "" }, { "docid": "ff741de61ba3530ceab9b8a62ac5cb71", "score": "0.50143206", "text": "toJSON () {\n return {\n title: this.title,\n sections: this.sections.map(s => ({\n name: s.name,\n data: s.data\n }))\n }\n }", "title": "" }, { "docid": "febe5a24c7e34e389a3854e053e99437", "score": "0.49946478", "text": "function writeJson() { //写json\n\n\tvar crock,\n\t\timages = exportImageData,\n\t\tidx = images.length - 1,\n\t\tjsOut,\n\t\thdr = exportHeader;\n\n\tjsOut = new File(hdr.outDir + '/' + hdr.prefix + '.js');\n\tjsOut.open('w');\n\tjsOut.writeln('/* exported json for ' + hdr.psdName + ' */');\n\tjsOut.writeln('\\n');\n\tjsOut.writeln('var imgInput = function () {');\n\tjsOut.writeln('\\n');\n\tjsOut.writeln(' var input = {');\n\tjsOut.writeln(' \"container\" : {');\n\tjsOut.writeln(' \"width\" : ' + hdr.psdWidth + ',');\n\tjsOut.writeln(' \"height\" : ' + hdr.psdHeight);\n\tjsOut.writeln(' },');\n\n\tjsOut.writeln(' \"images\" : [');\n\n\t// Photoshop extracts top first; put em in the JSON bottom first\n\tfor (idx; idx >= 0; idx -= 1) {\n\n\t\tjsOut.writeln(' {');\n\t\tjsOut.writeln(' \"name\" : \"' + images[idx].name + '\",');\n\t\tjsOut.writeln(' \"extension\": \"' + hdr.extension + '\",');\n\t\tjsOut.writeln(' \"left\" : ' + images[idx].left + ',');\n\t\tjsOut.writeln(' \"top\" : ' + images[idx].top + ',');\n\t\tjsOut.writeln(' \"width\" : ' + images[idx].width + ',');\n\t\tjsOut.writeln(' \"height\" : ' + images[idx].height);\n\n\t\tcrock = idx > 0 ? jsOut.writeln(' },') : jsOut.writeln(' }');\n\t}\n\tjsOut.writeln(' ]');\n\tjsOut.writeln(' };');\n\tjsOut.writeln('\\n');\n\tjsOut.writeln(' return JSON.stringify(input);');\n\tjsOut.writeln('}');\n\n\tjsOut.close();\n}", "title": "" }, { "docid": "b61713f4d9b1b7401717458bdc863764", "score": "0.49885878", "text": "function glean_json(divid, indent) {\n var base = $('#' + divid);\n var rootnode = base.children('div[data-role=\"value\"]:first');\n var jsObject = parse_node(rootnode);\n var json = JSON.stringify(jsObject, null, indent);\n return json;\n }", "title": "" }, { "docid": "e50082e5e0f6fb106f1d55b4a6941f49", "score": "0.49882227", "text": "serialize_bones( inc_scale = false, rtn_str=true ){\r\n\t\tlet out\t= new Array( this.bones.length ),\r\n\t\t\ti \t= 0,\r\n\t\t\tb;\r\n\r\n\t\tfor( b of this.bones ){\r\n\t\t\tout[ i ] = {\r\n\t\t\t\tname\t: b.name,\r\n\t\t\t\tlen\t\t: b.len,\r\n\t\t\t\tidx\t\t: b.idx,\r\n\t\t\t\tp_idx \t: b.p_idx,\r\n\t\t\t\tpos\t\t: Array.from( b.local.pos ),\r\n\t\t\t\trot\t\t: Array.from( b.local.rot ),\r\n\t\t\t};\r\n\t\t\tif( inc_scale ) out[ i ].scl = Array.from( b.local.scl );\t\t\r\n\t\t\ti++;\r\n\t\t}\r\n\r\n\t\tif( rtn_str ){\r\n\t\t\tlet buf = \"[\\n\";\r\n\t\t\tfor( let i=0; i < out.length; i++ ){\r\n\t\t\t\tif( i != 0 ) buf += \",\\n\";\r\n\t\t\t\tbuf += JSON.stringify( out[ i ] );\r\n\t\t\t}\r\n\t\t\tbuf += \"\\n]\";\r\n\t\t\treturn buf;\r\n\t\t}\r\n\r\n\t\treturn out;\r\n\t}", "title": "" }, { "docid": "8c1155534196265caebcd7e5a97fe1aa", "score": "0.49854326", "text": "function addBox(data) {\n \t// Store the type for later use\n var type = data.instantActionType;\n \n if (type === undefined) {\n // It's an account\n type = \"account\";\n }\n\n // Get the colour for the left hand box and the label descriptions\n var gradient = null;\n \n // Data differs based on type\n var amount = null;\n var contentLabel = null;\n var contentSubLabel = null;\n var accountDescription = null;\n var description = null;\n \n switch (type) {\n case \"bet\":\n amount = data.unitStake;\n if (amount < 5.01) {\n gradient = \"bggrey\";\n } else if (amount < 15.01) {\n gradient = \"bggrey\";\n } else if (amount < 25.01) {\n gradient = \"bggrey\";\n } else {\n gradient = \"bggold\";\n }\n \n gradient = \"bggrey\";\n \n contentLabel = \"£\" + amount;\n contentSubLabel = data.transactionSubTypeDescription;\n accountDescription = data.accountDescription;\n description = data.description;\n break;\n case \"account\":\n gradient = \"bggreen\";\n contentLabel = \"New\";\n contentSubLabel = \"Account\";\n accountDescription = data.lastName + \", \" + data.firstName;\n description = data.email;\n break;\n case \"failed_bet\":\n gradient = \"bgred\";\n amount = data.unitStake;\n contentLabel = \"£\" + amount;\n contentSubLabel = \"Failed Bet\";\n accountDescription = data.account.lastName + \", \" + data.account.firstName;\n description = data.description;\n break;\n case \"payrec\" :\n gradient = \"bgbronze\";\n amount = data.credit > 0 ? data.credit : data.debit;\n contentLabel = \"£\" + amount;\n contentSubLabel = \"Payrec\";\n accountDescription = data.account.lastName + \", \" + data.account.firstName;\n description = data.description;\n break;\n }\n\n // Use Mustache to populate the template\n var result = mustache.render(template, { \n \"background_gradient\" : gradient,\n \"left_content\" : contentLabel, \n \"left_sub_label\" : contentSubLabel,\n \"account_description\" : accountDescription, \n \"account_username\" : data.userName ? data.userName.toLowerCase() : (data.username ? data.username.toLowerCase() : data.account.userName.toLowerCase()),\n \"account_number\" : data.accountNumber,\n \"description\" : description,\n \"right_footer_left\" : type === \"bet\" ? \"Potential Win £\" + data.potentialWin : \"\",\n \"right_footer_middle\" : type === \"bet\" ? \"Total Stake £\" + data.betTotalCost : \"\",\n \"right_footer_right\" : \"\" \n });\n \n // Add the result to the page\n content.prepend(result);\n boxCount++;\n \n var justAdded = $(\"#content .box\").first();\n justAdded.addClass(type);\n justAdded.data(\"data\", data);\n \n // Update time\n updateTime(justAdded); \n \n // Check to see if we should be displaying this box\n boxFilter(justAdded);\n\n // Hide fields that are meant to be hidden\n if ($(\"#showUsername\").prop(\"checked\")) {\n justAdded.find(\".account_username\").show();\n } else {\n justAdded.find(\".account_username\").hide();\n }\n \n if ($(\"#showAccountNumber\").prop(\"checked\")) {\n justAdded.find(\".account_number\").show();\n } else {\n justAdded.find(\".account_number\").hide();\n }\n\n // If we have more than max row items we need to start removing the older ones. Note, once it's gone it's gone, if the max rows is increased it's too bad.\n if (boxCount > +$(\"#max-rows\").val()) {\n $(\"#content .box\").last().remove();\n }\n\t}", "title": "" }, { "docid": "096e416512a16a0b2cd5597a401183d1", "score": "0.49846053", "text": "function sanitizeFacesJson(faces) {\n const newFacesJson = faces.map(face => {\n return {\n name: face.name,\n boundingBoxId: face.boundingBoxId,\n }\n });\n return newFacesJson; \n}", "title": "" }, { "docid": "6568db0d47ced164a5f25582313833b1", "score": "0.49835372", "text": "function boundingBox( jqNode, jqGraph, box ) {\n var v = jqNode.offset();\n var graphOffset = jqGraph.offset();\n var top = v.top - graphOffset.top;\n var left = v.left - graphOffset.left;\n box = box || {};\n box.top = top;\n box.left = left;\n box.right = left + jqNode.width();\n box.bottom = top + jqNode.height();\n return box;\n }", "title": "" }, { "docid": "7bde73c2970e77ab19270d87ba49aebb", "score": "0.4982495", "text": "function drawBox () {\n\n\t\t\tvar $topBar = $('<div class=\"round-top back-right-image\"><div class=\"round-top-fill back-left-image\"></div></div>');\n\n\t\t\tif(opts.headerTitle != \"\" && opts.headerThickness == \"thick\") {\n\t\t\t\tvar $text = $('<span class=\"text-top\"></span>').html(opts.headerTitle)\n\n\t\t\t\t$topBar.find('.round-top-fill').html($text);\n\t\t\t}\n\n\t\t\tvar $bodyContent = $('<div class=\"round-body\"><div class=\"round-body-content\"></div></div>');\n\n\t\t\tif(opts.type != \"\" && !opts.wrapContent){\n\t\t\t\tvar content = \"\";\n\n\t\t\t\tcontent\t+= '<div class=\"message-body\">';\n\t\t\t\tfor (i in messages) {\n\t\t\t\t\tif (typeof i != typeof function(){}) {\n\t\t\t\t\t\tif(i > 0) {\n\t\t\t\t\t\t\tfor( j=0; j < messages[i].length; j++) {\n\t\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][j] + '</div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-summary\">' + messages[i][0] + '</div>';\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][1] + '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t};\n\t\t\t\tcontent\t+= '</div>';\n\n\t\t\t\t$bodyContent.children().append(content);\n\t\t\t}\n\n\t\t\tvar $bottomBar = $('<div class=\"round-bottom back-right-image\"><div class=\"round-bottom-fill back-left-image\"></div></div>');\n\n\t\t\t//for error/warning/success boxes that have no fill color specifications\n\t\t\tif(opts.fillColor != \"\")\n\t\t\t\topts.fillColor = opts.fillColor + \"-\";\n\n\t\t\tvar $container = $('<div class=\"round-container\"></div>')\n\t\t\t\t\t\t\t\t\t.addClass(opts.borderColor+\"-\"+opts.fillColor+\"container\")\n\t\t\t\t\t\t\t\t\t.append($topBar)\n\t\t\t\t\t\t\t\t\t.append($bodyContent)\n\t\t\t\t\t\t\t\t\t.append($bottomBar);\n\n\t\t\t//add an ID to the container if specified\n\t\t\tif(opts.containerId != \"\"){\n\t\t\t\t$container.attr('id',opts.containerId);\n\t\t\t}\n\n\t\t\t//add header thickness class to container if specified\n\t\t\tif(opts.headerThickness != \"\"){\n\t\t\t\t$container.addClass(opts.headerThickness+\"-top\");\n\t\t\t}\n\n\t\t\t//add more classes if specified\n\t\t\tif(opts.containerClass != \"\"){\t//FIX THIS...ONLY ADDS 1 CLASS\n\t\t\t\t$container.addClass(opts.containerClass);\n\t\t\t}\n\n\t\t\t$container.css({width : opts.width});\n\n\t\t\treturn $container;\n\t\t}", "title": "" }, { "docid": "238d6938ca4312ebb461c5097bff99a6", "score": "0.4980923", "text": "static smoBox(box) {\n var hround = (f) => {\n return Math.round((f + Number.EPSILON) * 100) / 100;\n }\n var x = typeof(box.x) == 'undefined' ? hround(box.left) : hround(box.x);\n var y = typeof(box.y) == 'undefined' ? hround(box.top) : hround(box.y);\n\t\treturn ({\n\t\t\tx: hround(x),\n\t\t\ty: hround(y),\n\t\t\twidth: hround(box.width),\n\t\t\theight: hround(box.height)\n\t\t});\n\t}", "title": "" }, { "docid": "9f3f931551defc997915340e95e21ca3", "score": "0.49807107", "text": "function mkBoxes() {\n boxes.forEach(function(val){\n ctx.drawImage(boxImg, val[0] * boxSize, val[1] * boxSize, boxSize, boxSize);\n })\n}", "title": "" }, { "docid": "6d0be67394ab0eac85dad0e4891e8bc6", "score": "0.4977951", "text": "serialize() {\n return {\n deserializer: 'latex-document-outline/LatexDocumentOutlineView',\n structure: JSON.stringify(this.structure),\n };\n }", "title": "" }, { "docid": "db67098ca300bb60c04378965f12fd54", "score": "0.4973405", "text": "toJSON() {\n return { styledProperties: this.styledProperties };\n }", "title": "" }, { "docid": "0edd61715aef3809b8842e79beb3c854", "score": "0.49723518", "text": "json() {\n var json = super.json()\n json[Token.END] = this.end\n json[Token.VALUE] = this.value\n json[Token.TYPE] = this.type\n return json\n }", "title": "" }, { "docid": "97630e990706b39cc3189eca0f20a17b", "score": "0.49699962", "text": "function deserialize() {\n var element = document.getElementById('text');\n var type = document.getElementById(\"formatType\").value;\n var features = formats['in'][type].read(element.value);\n var bounds;\n if(features) {\n if(features.constructor != Array) {\n features = [features];\n }\n for(var i=0; i<features.length; ++i) {\n if (!bounds) {\n bounds = features[i].geometry.getBounds();\n } else {\n bounds.extend(features[i].geometry.getBounds());\n }\n\n }\n vectors.addFeatures(features);\n map.zoomToExtent(bounds);\n var plural = (features.length > 1) ? 's' : '';\n element.value = features.length + ' feature' + plural + ' aggiunte'\n } else {\n element.value = 'Nessun input ' + type;\n }\n}", "title": "" }, { "docid": "858e681c6529bffad2605787a56a3c57", "score": "0.4968534", "text": "function serialize(feature) {\n\tvar type = document.getElementById(\"formatType\").value;\n // scrive la stringa in formato pretty json (solo geojson)\n var pretty = document.getElementById(\"prettyPrint\").checked;\n var str = formats['out'][type].write(feature, pretty);\n\n str = str.replace(/,/g, ', ');\n document.getElementById('output').value = str;\n}", "title": "" }, { "docid": "29f45760bb1dea6eaa0edb1be189e787", "score": "0.49680552", "text": "function prettyPrint() {\n var orig = document.getElementById('filter-json').value;\n \n try {\n var obj = JSON.parse(orig);\n \n // Format the JSON Box\n document.getElementById('filter-json').value = JSON.stringify(obj, undefined, 2);;\n document.getElementById('filter-json').style.backgroundColor = \"rgb(0, 255, 255, 0.2)\"\n\n // Update the Hash Box\n document.getElementById('layer-hash-input').value = btoa(orig);\n\n } catch(err) {\n document.getElementById('filter-json').style.backgroundColor = \"rgb(255, 0, 0, 0.2)\"\n }\n}", "title": "" }, { "docid": "e8bb9de35410ca43b3dbc9e153bf2879", "score": "0.49676803", "text": "bbox() {\n let width = this.box.attr(\"width\");\n let height = this.box.attr(\"height\");\n let x = this.box.attr(\"x\");\n let y = this.box.attr(\"y\");\n let cy = y + height / 2;\n let cx = x + width / 2;\n\n return {\n width: width,\n height: height,\n x: x,\n y: y,\n cx: cx,\n cy: cy\n };\n }", "title": "" }, { "docid": "9dd0e5ea5500d7ef74adb605e7485538", "score": "0.4965911", "text": "function createBox (box_type,size, scene) {\n var mat = new BABYLON.StandardMaterial(\"mat\", scene);\n var texture = new BABYLON.Texture(\"images/textures/box_atlas.png\", scene);\n mat.diffuseTexture = texture;\n var columns = 8; // 6 columns\n var rows = 8; // 4 rows\n var faceUV = new Array(6);\n\n switch (box_type) {\n case \"wood\":\n for (var i = 0; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(6 / columns, 3 / rows, 7 / columns, 4 / rows);\n }\n break;\n case \"tnt\":\n var Ubottom_left = 3 / columns;\n var Vbottom_left = 3 / rows;\n var Utop_right = 4 / columns;\n var Vtop_right = 4 / rows;\n //select the face of the cube\n faceUV[0] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[1] = new BABYLON.Vector4(Ubottom_left, Vbottom_left, Utop_right, Vtop_right);\n faceUV[2] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n faceUV[3] = new BABYLON.Vector4(Utop_right, Vtop_right, Ubottom_left, Vbottom_left);\n for (var i = 4; i < 6; i++) {\n faceUV[i] = new BABYLON.Vector4(4 / columns, 3 / rows, 5 / columns, 4 / rows);\n }\n\n\n break;\n }\n var box = BABYLON.MeshBuilder.CreateBox('box', {size:size,faceUV: faceUV}, scene);\n box.isPickable = true;\n box.material = mat;\n box.position = position;\n return box;\n }", "title": "" }, { "docid": "1af8c053660867d0a1a0753ecec72f32", "score": "0.49637225", "text": "function getHitboxStructure(vertices, roads, box) {\n switch (box.data.type) {\n case BoardState.Position.Type.Vertex:\n return (BoardState.requireVertex(vertices, box.data.coordinate)).structure;\n case BoardState.Position.Type.Road:\n return (BoardState.requireRoad(roads, box.data.coord1, box.data.coord2)).structure;\n }\n}", "title": "" }, { "docid": "8f93bb194c6738cdd454f6e2345541e1", "score": "0.4961911", "text": "toJson() {\n // todo: convert to `iife` with arrow functions\n function recursive(node, jsnode) {\n jsnode[node.name] = {};\n if (node.childs.length != 0) {\n for (let child of node.childs) {\n recursive(child, jsnode[node.name]);\n }\n }\n else {\n jsnode[node.name] = null;\n }\n }\n let js = {};\n recursive(this.root, js);\n return js;\n }", "title": "" }, { "docid": "53169c545877b5d09a28498be5da7081", "score": "0.49490026", "text": "function compressAllBoxes(boxes){\n boxes.forEach(function(item){\n console.log(item)\n });\n}", "title": "" }, { "docid": "4dbbd50f3f116c0104a2a3786a84b5a4", "score": "0.4936421", "text": "function addBoxes() {\n O('box-container').innerHTML += \"<div class='box'>More Boxes!!!!</div>\"\n}", "title": "" }, { "docid": "05864850bccc06c64bca57727fb371df", "score": "0.4930078", "text": "function formToJSON(){\n\n\tlet jfile = {};\n\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\tlet value = eval(\"$('#\" + NAME_LIST[i] + \"').val()\");\n\t\tif (value == \"\"){\n\n\t\t\tjfile[String(NAME_LIST[i])] = null;\n\t\t} else {\n\n\t\t\tjfile[String(NAME_LIST[i])] = value;\n\t\t};\n\t};\n\n\tjfile.color = hexToRGB(\"0x\"+jfile.color.slice(1));\n\treturn jfile;\n}", "title": "" }, { "docid": "2a94e784531d295a0cb01e167f860208", "score": "0.49282432", "text": "function prepaddreq() {\n var superJSONObj = {};\n\n $(\"div[id^='tb']\").each(function(index) { //for each text blob box...\n var subObj = {};\n var text = ($(this).find(\"textarea[id^='ta']\").prop(\"value\"));\n var textArr = (text.split(\"\\n\")).filter(q => q !== \"\");\n subObj[$(this).prop(\"id\")] = textArr;\n var tagArray = [];\n $(this).find(\"span[id^='stag']\").each(function(index) {\n tagArray.push( $(this).text());\n subObj[\"tags\"] = tagArray;\n });\n superJSONObj[$(this).prop(\"id\")] = subObj;\n });\n\n diagobj(superJSONObj);\n return superJSONObj;\n}", "title": "" }, { "docid": "fbf7bf3f021f7cdd2c2afd6790530be0", "score": "0.492662", "text": "function valueEncodeComplex(data) {\n\tvar output = {\n\t\t'blocks': [],\n\t\t'palette': []\n\t};\n\t\n\tvar size = data.size.value.value;\n\tvar box = new Array(size[1]).fill(0).map(\n\t\t\t(i) => new Array(size[0]).fill(0).map(\n\t\t\t\t(j) => new Array(size[2]).fill(0)\n\t\t\t)\n\t\t);\n\toutput.blocks = box;\n\t\n\tdata.blocks.value.value.forEach((block) => {\n\t\tvar pos = block.pos.value.value;\n\t\toutput.blocks[pos[1]][pos[0]][pos[2]] = block.state.value;\n\t});\n\tdata.palette.value.value.forEach((state) => {\n\t\toutput.palette.push({\n\t\t\t'name': state.Name.value,\n\t\t\t'properties': state.Properties ? state.Properties.value : {}\n\t\t});\n\t});\n\t\n\treturn output;\n}", "title": "" }, { "docid": "64377936dd4480b2f3695e50a60a3dae", "score": "0.49232286", "text": "controlsToJSON(controls, _alias) {\n const nbrOfControls = controls.Count\n const className = controls.Class.Name\n let attr\n const json = {}\n const alias = _alias || className\n json[alias] = {}\n\n for (let i = 1; i <= nbrOfControls; i += 1) {\n attr = controls(i).Field.Name\n json[alias][attr] = {}\n json[alias][attr].text = controls(i).Text\n json[alias][attr].value = controls(i).Value\n if (controls(i).Field.Type === 16) { // Relation\n json[alias][attr].class = controls(i).Field.LinkedField.Class.Name\n }\n\n // check if optionkey support\n if (lbs.limeVersion.comparable > lbs.common.parseVersion('10.8').comparable) {\n if (controls(i).Field.Type === (19 || 18)) { // Option or Set\n json[alias][attr].key = controls(i).OptionKey\n }\n }\n }\n\n return json\n }", "title": "" }, { "docid": "5aa06ef2d21a1507267fa4a8b2a7eeb4", "score": "0.4918431", "text": "function saveJSON() {\n // save stage as a json string\n var json = stage.toJSON();\n var data = \"text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(json));\n var a = document.createElement('a');\n a.href = 'data:' + data;\n a.download = 'canvas.json';\n a.innerHTML = 'download JSON';\n var container = document.getElementById('container');\n container.appendChild(a);\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}", "title": "" }, { "docid": "0a3497591d4d1001427c3bcc5c34d6a4", "score": "0.49106684", "text": "function xml2json(xml, pad, type) {\n if (pad === void 0) { pad = 1; }\n if (type === void 0) { type = 1; }\n //we will use tabular indentation to format our json\n var indent = \"\";\n //we add tabs according to the number passed as argument\n for (var t = 0; t < pad; ++t)\n indent += \"\\t\";\n //a string where we will store json\n var txt = \"\";\n //same as indent but one tab bigger and used to indent key/value pairs\n var padding = indent + \"\\t\";\n //output formatting along with formatting corner cases\n if (pad === 1)\n txt = \"{\\n\" + indent + \"\\\"\" + xml.nodeName + \"\\\": {\\n\";\n else {\n if (type === 2)\n txt = indent + \"\\\"\" + xml.nodeName + \"\\\": [\\n\" + indent + \" {\\n\";\n else if (type === 3 || type === 4)\n txt = indent + \" {\\n\";\n else\n txt = indent + \"\\\"\" + xml.nodeName + \"\\\": {\\n\";\n }\n //any node attribute gets appended as a child node (element node) for easier conversion\n if (xml.attributes.length > 0) {\n for (var j = 0; j < xml.attributes.length; ++j) {\n //underscore is used to seperate attributes from nodes\n var attChar = \"_\";\n var node = document.createElement(attChar + xml.attributes[j].nodeName);\n node.appendChild(document.createTextNode(xml.attributes[j].nodeValue));\n xml.appendChild(node);\n }\n }\n //two arrays first and last that will hold indexes of first and last repeating nodes in a group respectively\n //example: for nodes {book,book,pen,pen,pen,paper} first will hold {0,2} while last will hold {1,4}\n var first = new Array;\n var last = new Array;\n //passedType will be used for outputting repeating nodes that are grouped in squared brackets\n var passedType;\n //looping through every child node\n for (var i = 0; i < xml.childNodes.length; i++) {\n //in case there are repeating nodes we rearange them so we can more easily\n //group them in squared brackets\n if (xml.childNodes.length > 1 && i == 0) {\n var state;\n var firstIndex;\n var lastIndex;\n //looping through every node to se if one repeates itself\n for (var k = 0; k < xml.childNodes.length - 1; k++) {\n state = false;\n for (var z = k + 1; z < xml.childNodes.length; z++) {\n if (xml.childNodes[k].nodeName === xml.childNodes[z].nodeName && z - k > 1) {\n //a repeating node is found and is placed immediately after the first accurance\n if (state === false)\n firstIndex = k;\n state = true;\n xml.childNodes[k + 1].parentNode.insertBefore(xml.childNodes[z], xml.childNodes[k + 1]);\n k++;\n lastIndex = k;\n }\n else if (xml.childNodes[k].nodeName === xml.childNodes[z].nodeName && z - k == 1) {\n if (state === false)\n firstIndex = k;\n state = true;\n lastIndex = z;\n k++;\n }\n }\n if (state === true) {\n first.push(firstIndex);\n last.push(lastIndex);\n }\n }\n }\n //if passedType is 1 it means that the node is unique\n //if passedType is 2, 3 or 4 the node is repeated x amount of times and is grouped\n //if passedType is 2, node is the first in the group\n //if passedType is 4, node is the last in the group\n //if passedType is 3, node is somewhere in between\n //with group holding all nodes of the same name\n passedType = 1;\n if (first.length > 0) {\n for (var temp = 0; temp < first.length; ++temp)\n if (first[temp] === i)\n passedType = 2;\n for (var temp = 0; temp < last.length; ++temp)\n if (last[temp] === i)\n passedType = 4;\n for (var temp = 0; temp < last.length; ++temp)\n if (first[temp] < i && last[temp] > i)\n passedType = 3;\n }\n //we recursively call xml2json in these two cases:\n //1. node has an attribute \n //2. node has more than one child or only has an element node\n //for each level of depth another tab is added hence the pad+1\n if (xml.childNodes[i].nodeType === 1 && xml.childNodes[i].attributes.length > 0) {\n txt += xml2json(xml.childNodes[i], pad + 1, passedType);\n }\n else if (xml.childNodes[i].childNodes.length > 1 || (xml.childNodes[i].childNodes.length == 1 && xml.childNodes[i].childNodes[0].nodeType === 1)) {\n txt += xml2json(xml.childNodes[i], pad + 1, passedType);\n }\n else {\n //if recursive cases have not been met the node is either a text node or an element node\n if (xml.childNodes[i].nodeType === 3) {\n //whitespaces get filtered as text so we check if the text node actually has text\n //we remove all new lines and spaces and if the resulting string is empty we skip this node\n var str = xml.childNodes[i].nodeValue;\n str = str.replace(/\\r?\\n|\\r/g, '');\n str = str.replace(/\\s+/g, '');\n if (str === '')\n continue;\n txt += padding;\n switch (passedType) {\n case 2:\n {\n txt += \"\\\"\" + xml.childNodes[i].nodName + \"\\\": [\\n\" + padding + \"\\t\\\"\" + xml.childNodes[i].nodeValue + \"\\\"\";\n break;\n }\n case 3:\n {\n txt += \"\\t\\\"\" + xml.childNodes[i].nodeValue + \"\\\"\";\n break;\n }\n case 4:\n {\n txt += \"\\t\\\"\" + xml.childNodes[i].nodeValue + \"\\\"\\n\" + padding + \"]\";\n break;\n }\n default:\n {\n txt += \"\\\"\" + xml.childNodes[i].nodeName + \"\\\": \\\"\" + xml.childNodes[i].nodeValue + \"\\\"\";\n break;\n }\n }\n }\n if (xml.childNodes[i].nodeType === 1) {\n txt += padding;\n switch (passedType) {\n case 2:\n {\n txt += \"\\\"\" + xml.childNodes[i].nodeName + \"\\\": [\\n\" + padding + \"\\t\\\"\" + xml.childNodes[i].childNodes[0].nodeValue + \"\\\"\";\n break;\n }\n case 3:\n {\n txt += \"\\t\\\"\" + xml.childNodes[i].childNodes[0].nodeValue + \"\\\"\";\n break;\n }\n case 4:\n {\n txt += \"\\t\\\"\" + xml.childNodes[i].childNodes[0].nodeValue + \"\\\"\\n\" + padding + \"]\";\n break;\n }\n default:\n {\n txt += \"\\\"\" + xml.childNodes[i].nodeName + \"\\\": \\\"\" + xml.childNodes[i].childNodes[0].nodeValue + \"\\\"\";\n break;\n }\n }\n }\n //if the current node isn't the last node and is either an element or a text node we add a comma\n if (i < xml.childNodes.length - 1 && (xml.childNodes[i].nodeType === 1 || xml.childNodes[i].nodeType === 3))\n txt += \",\";\n //newline for format\n if (xml.childNodes[i].nodeType === 1 || xml.childNodes[i].nodeType === 3)\n txt += \"\\n\";\n }\n }\n //output formating along with formating corner cases\n txt += \"\" + indent;\n if (type != 1)\n txt += \" \";\n txt += \"}\";\n if (type === 2 || type === 3 || (pad != 1 && type === 1 && xml.nodeName != xml.parentNode.lastChild.nodeName))\n txt += \",\";\n txt += \"\\n\";\n if (type === 4) {\n txt += indent + \"]\";\n if (xml.nodeName != xml.parentNode.lastChild.nodeName)\n txt += \",\";\n txt += \"\\n\";\n }\n if (pad === 1)\n txt += \"}\";\n return txt;\n}", "title": "" }, { "docid": "e5cfab28c428d2393cc200b4c90b3fe1", "score": "0.49082807", "text": "function drawnItemToJSON(layer) {\n\n // Calculate feature coordinates\n var latlngs;\n if (layer instanceof L.Polygon) {\n latlngs = layer._defaultShape ? layer._defaultShape() : layer.getLatLngs();\n } else {\n latlngs = layer.getLatLng();\n }\n\n const feature = {\n \"options\": layer.options,\n \"properties\": layer.properties,\n \"latlngs\": latlngs\n };\n\n return feature;\n\n}", "title": "" }, { "docid": "6c2b47ad31da750b48cd48afd3849a7d", "score": "0.49069273", "text": "_createSnapStructure(input){\n return utils.jsonToSnapList(input);\n }", "title": "" }, { "docid": "9aed42b3441b19bd5bbe94f10b2cb59e", "score": "0.49055892", "text": "function addBox(coin) {\nvar options = {\n width : \"18%\",\n height : \"25%\",\n content: \"Coin Pool Net Ratio\",\n tags: true,\n border: {\n type: 'line'\n },\n style: {\n fg: 'white',\n border: {\n fg: '#f0f0f0'\n },\n hover: {\n bg: 'green'\n }\n }\n}\nif (r == 1) {\n options.right = r\n} else {\n options.left = l\n}\noptions.label = \"{bold}\"+coin+\"{/bold}\";\nif (b == 1) {\n options.bottom = b;\n} else {\n options.top= t;\n}\nconsole.log(coin + t + b + l + r );\nbox[coin] = blessed.box( options);\n\n\n\nscreen.append(box[coin]);\n \n P++;\n l = P*20 + \"%\";\n \n if (P == '5' ) {\n r = '';\n rcount++;\n t = rcount * 25 + \"%\";\n l = '0%';\n P = 0;\n } \n \n \n\n}", "title": "" }, { "docid": "4e6ee15dc54084cb5aa52533ebf9dba9", "score": "0.4898793", "text": "toJSON() {\n if (!this.text)\n return null;\n\n if (!this.json)\n this.json = xmlJS.xml2js(this.text, { compact: true });\n\n return this.json;\n }", "title": "" }, { "docid": "2962881691458170d4961bc976856164", "score": "0.48947608", "text": "function generateJSON() {\n var saveFile = new Object(),\n /* Centralizes cards by discovering the position of the top-left card */\n posX = ((-collumns) + !(collumns%2)),\n posZ = (lines - !(lines%2));\n \n /* Start save-file object */\n saveFile.SaveName = \"Minesweeper \" + lines + \"x\" + collumns + \" (\" + mines + \" mines)\";\n saveFile.GameMode = \"Minesweeper\";\n saveFile.Date = \"11/7/2015 7:16:23 PM\"; // TO-DO\n saveFile.Table = \"Table_RPG\";\n saveFile.Sky = \"Sky_Field\";\n saveFile.Note = \"MINESWEEPER\\n\\n\" + lines + \" lines\\n\" + collumns + \" collumns\\n\" + mines + \" mines (\" + Math.floor(100*mines/(lines*collumns)) + \"%)\";\n saveFile.Rules = \"\";\n saveFile.PlayerTurn = \"\";\n saveFile.Grid = new Object();\n saveFile.Grid.Type = 0;\n saveFile.Grid.Lines = false;\n saveFile.Grid.Snapping = false;\n saveFile.Grid.Offset = true;\n saveFile.Grid.BothSnapping = false;\n saveFile.Grid.xSize = 2.0;\n saveFile.Grid.ySize = 2.0;\n saveFile.Grid.PosOffset = new Object();\n saveFile.Grid.PosOffset.x = 0.0\n saveFile.Grid.PosOffset.y = 1.0\n saveFile.Grid.PosOffset.z = 0.0\n saveFile.Hands = new Object();\n saveFile.Hands.Enable = false;\n saveFile.Hands. DisableUnused = false;\n saveFile.Hands.Hidding = 0;\n saveFile.DrawImage = \"iVBORw0KGgoAAAANSUhEUgAAAWAAAADQCAYAAAA53LuNAAAFFElEQVR4Ae3QgQAAAADDoPlTH+SFUGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgy8DQx5DAABHyNK3wAAAABJRU5ErkJggg==\"\n saveFile.VectorLines = [];\n saveFile.ObjectStates = [];\n \n // Flags deck\n var flagsDeck = new Object();\n flagsDeck.Name = \"Deck\";\n flagsDeck.Transform = new Object();\n flagsDeck.Transform.posX = 10.9998751;\n flagsDeck.Transform.posY = 3.76623344;\n flagsDeck.Transform.posZ = -18.99992;\n flagsDeck.Transform.rotX = 0;\n flagsDeck.Transform.rotY = 180.013916;\n flagsDeck.Transform.rotZ = 180.000015;\n flagsDeck.Transform.scaleX = 0.625;\n flagsDeck.Transform.scaleY = 0.625;\n flagsDeck.Transform.scaleZ = 0.625;\n flagsDeck.Nickname = \"\";\n flagsDeck.Description = \"\";\n flagsDeck.ColorDiffuse = new Object();\n flagsDeck.ColorDiffuse.r = 0.713266432;\n flagsDeck.ColorDiffuse.g = 0.713266432;\n flagsDeck.ColorDiffuse.b = 0.713266432;\n flagsDeck.Locked = false;\n flagsDeck.Grid = true;\n flagsDeck.Snap = true;\n flagsDeck.Autoraise = true;\n flagsDeck.Sticky = true;\n flagsDeck.SidewaysCard = false;\n flagsDeck.DeckIDs = [];\n for (var i = 0; i < mines; i++) { // Adds one flag for each mine\n flagsDeck.DeckIDs.push(110);\n }\n flagsDeck.CustomDeck = {\n 1: {\n FaceURL: \"http://i.imgur.com/aHiVv66.jpg\",\n BackURL: \"http://i.imgur.com/xL8AXmY.jpg{Unique}\"\n }\n }\n saveFile.ObjectStates.push(flagsDeck);\n \n // Interrogation mark deck\n var interrogationDeck = new Object();\n interrogationDeck.Name = \"Deck\";\n interrogationDeck.Transform = new Object();\n interrogationDeck.Transform.posX = 16.9999142;\n interrogationDeck.Transform.posY = 3.76623344;\n interrogationDeck.Transform.posZ = -18.99992;\n interrogationDeck.Transform.rotX = 0;\n interrogationDeck.Transform.rotY = 180.013916;\n interrogationDeck.Transform.rotZ = 180.000015;\n interrogationDeck.Transform.scaleX = 0.625;\n interrogationDeck.Transform.scaleY = 0.625;\n interrogationDeck.Transform.scaleZ = 0.625;\n interrogationDeck.Nickname = \"\";\n interrogationDeck.Description = \"\";\n interrogationDeck.ColorDiffuse = new Object();\n interrogationDeck.ColorDiffuse.r = 0.713266432;\n interrogationDeck.ColorDiffuse.g = 0.713266432;\n interrogationDeck.ColorDiffuse.b = 0.713266432;\n interrogationDeck.Locked = false;\n interrogationDeck.Grid = true;\n interrogationDeck.Snap = true;\n interrogationDeck.Autoraise = true;\n interrogationDeck.Sticky = true;\n interrogationDeck.SidewaysCard = false;\n interrogationDeck.DeckIDs = [];\n for (var i = 0; i < mines; i++) { // Adds one ? for each mine\n interrogationDeck.DeckIDs.push(111);\n }\n interrogationDeck.CustomDeck = {\n 1: {\n FaceURL: \"http://i.imgur.com/aHiVv66.jpg\",\n BackURL: \"http://i.imgur.com/xL8AXmY.jpg{Unique}\"\n }\n }\n saveFile.ObjectStates.push(interrogationDeck);\n \n // Regular game cards\n for (var i = 1; i <= lines; i++) {\n for (var j = 1; j <= collumns; j++) {\n var card = addCard(i, j, posX, posZ)\n saveFile.ObjectStates.push(card);\n }\n }\n /* End save-file object */\n \n var json = JSON.stringify(saveFile, null, '\\t');\n saveTextAs(json, \"Minesweeper.json\"); // FileSaver.js by Eli Grey, modified by Brian Chen\n}", "title": "" }, { "docid": "9c5871500026122d5442a674989a05ca", "score": "0.48911384", "text": "function buildKersesBox() {\n\tvar kersesBox = document.createElement(\"div\");\n\tkersesBox.setAttribute(\"class\", \"kerses\");\n\tvar shadow = kersesBox.attachShadow({mode: 'open'});\n\tvar style = document.createElement(\"link\");\n\tstyle.setAttribute(\"rel\", \"stylesheet\");\n\tstyle.setAttribute(\"type\", \"text/css\");\n\tstyle.setAttribute(\"href\", chrome.runtime.getURL(\"kerses.css\"));\n\t//style.setAttribute(\"href\", \"kerses.css\");\n\tshadow.appendChild(style);\n\n\t// Create the inner box that contains the data\n\tvar box = document.createElement(\"div\");\n\tbox.classList.add(\"kerses-box\");\n\n\t// Create Button\n\tvar button = document.createElement(\"button\");\n\tbutton.classList.add(\"kerses-close\");\n\tbutton.addEventListener(\"click\", function() {\n\t\tdocument.body.removeChild(document.body.getElementsByClassName(\"kerses\")[0]);\n\t})\n\tbox.appendChild(button);\n\n\t// Create inner div\n\tvar internals = document.createElement(\"div\");\n\tinternals.classList.add(\"kerses-internals\");\n\tbox.appendChild(internals)\n\n\t// Add the inital loading data\n\taddLoading(internals)\n\n\tshadow.appendChild(box);\n\tdocument.body.appendChild(kersesBox);\n}", "title": "" }, { "docid": "a5cc788717c3bc5298e841de83c7a732", "score": "0.4888126", "text": "function formToJSON() {\n\tvar item_id = $('#item_id').val();\n\treturn JSON.stringify({\n\t\t\"item_id\": item_id == \"\" ? null : item_id, \n\t\t\"cat_menu_id\": $('#cat_menu_id').val(), \n\t\t\"item_nombre\": $('#item_nombre').val(),\n\t\t\"item_desc\": $('#item_desc').val(),\n\t\t\"item_val\": $('#item_val').val(),\n\t\t\"picture\": currentWine.picture,\n\t\t\n\t\t});\n}", "title": "" }, { "docid": "b582c96e922454cfb9806fc5ceef0543", "score": "0.4887498", "text": "json() {\n var pos = this.input.pos(this.start)\n return {\"input\":this.input.id, \"start\":this.start,\n \"row\":pos[0], \"column\":pos[1]}\n }", "title": "" }, { "docid": "ac9d818dfff0515e980a2e8077a63edd", "score": "0.4883034", "text": "function convertBoxes(boxes, d, data, ids) {\n var ptr = 0\n var count = 0\n for(var i=0, n=boxes.length; i<n; ++i) {\n var b = boxes[i]\n if(boxEmpty(d, b)) {\n continue\n }\n for(var j=0; j<2*d; ++j) {\n data[ptr++] = b[j]\n }\n ids[count++] = i\n }\n return count\n}", "title": "" }, { "docid": "ac9d818dfff0515e980a2e8077a63edd", "score": "0.4883034", "text": "function convertBoxes(boxes, d, data, ids) {\n var ptr = 0\n var count = 0\n for(var i=0, n=boxes.length; i<n; ++i) {\n var b = boxes[i]\n if(boxEmpty(d, b)) {\n continue\n }\n for(var j=0; j<2*d; ++j) {\n data[ptr++] = b[j]\n }\n ids[count++] = i\n }\n return count\n}", "title": "" } ]
05475eb2332884254c40e375a3b15057
still need to finish submit
[ { "docid": "15bbbeeab587e7fab6cd0b622f3987b2", "score": "0.0", "text": "function onSubmit6() {\n EditService.updateFamily(vm.data)\n .then(function successCallback(response) {\n if (response.status === 200) {\n UtilityFactory.showTemplateToast('<md-toast>The ' + vm.data.selectedType.label + ' event for ' +\n vm.data.fullName + ' has been added to ' + vm.params.appName + '.</md-toast>');\n onReset();\n\n } else {\n var err = response.data;\n err = err.substring(7, err.length);\n UtilityFactory.showAlertToast('<md-toast>' + err + '. Please reenter.</md-toast>');\n onReset();\n }\n });\n }", "title": "" } ]
[ { "docid": "d95f520bc5a8351b7676c87f79ed97c8", "score": "0.74191684", "text": "function doSubmit() {\n \tsetTimeout(_doSubmit, 10); // this lets dom updates render\n }", "title": "" }, { "docid": "cb18c7b0658ef465b0fa925c6a9def5c", "score": "0.72688705", "text": "function deferFormSubmit(){\n\t\t\tautosubmit = true;\n\t\t\tsubmitBtn.set('disabled', true);\n\t\t\tdescArea.set('disabled', true);\n\t\t\tsubmitBtn.set('value', 'Waiting for the upload to finish...')\n\t\t\tcancelSubmitLink.show();\n\t\t}", "title": "" }, { "docid": "5a8ffe0e4ceb49633199cbbb43c5ceed", "score": "0.72313535", "text": "afterSubmit() {\n // override accordingly\n }", "title": "" }, { "docid": "518ac99becd90b670da6ddc471c7b2e5", "score": "0.721348", "text": "function submit(){\n\t\tstop();\n\t\tcheckAnswers();\n\t\tshowResults();\t\n\t}", "title": "" }, { "docid": "bf5c7635c610077aa64a2d6a17fa339b", "score": "0.71314675", "text": "function submitCheck()\n {\n\t submitInd = true;\n return true;\n }", "title": "" }, { "docid": "fded00a68ced959b9a0b421a2f66ad3d", "score": "0.7117125", "text": "function processWhenSubmit() {\n\t\t// Init GUI\n\t\tresponse.style.display = \"none\";\n\t\tprogressBar.value = 0;\n\t\tprogressBar.style.display = \"\";\n\t\t\n\t\t// Make an AJAX request\n\t\tvar frm = this;\n\t\tcallAjax(frm, uploadSuccess);\n\t\t\n\t\t// Prevent normal submit\n\t\treturn false;\n\t}", "title": "" }, { "docid": "ef33bca547f94a07ad9005ee812d4a5b", "score": "0.7077578", "text": "function submit() {\n\n \n} //submit function close out", "title": "" }, { "docid": "429dc76cd9c00f0048eddbeddef7d1d3", "score": "0.6942787", "text": "function trySubmit() {\n\t\tvar gForm;\n\t\t// verify every gForm instance has finished its validation\n\t\tfor(var gf in includedGformInstances) {\n\t\t\tgForm = includedGformInstances[gf];\n\t\t\tif (gForm && gForm.submitted !== true)\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ($scope.submitted)\n\t\t\treturn;\n\t\t\n\t\t$scope.submitted = true;\n\t\t$scope.submitting = true;\n\t\tsetFieldsReadonly();\n\t\t$http.post(spUtil.getURL('sc_cat_item_guide'), {\"items\": $scope.included, \"sc_cat_item_guide\": $scope.data.sys_id}).success(function(response) {\n\t\t\tvar a = response.answer;\n\t\t\tvar n = a.number;\n\t\t\t$scope.$emit(\"$$uiNotification\", response.$$uiNotification);\n\t\t\t$scope.$emit(\"$sp.sc_order_guide.submitted\", a);\n\t\t\tif (n)\n\t\t\t\tissueMessage(n, a.table, a.sys_id);\n\t\t\t$scope.submitting = false;\n\t\t\t$scope.submitButtonMsg = $scope.m.submittedMsg;\n\t\t})\n\t}", "title": "" }, { "docid": "3eaf1440b1bf527619a4cfc812635765", "score": "0.689702", "text": "function submit() {\n if (isGameStart) {\n isGameStart = false;\n getStopWatch();\n getResponseSheet();\n getResultCard();\n }\n}", "title": "" }, { "docid": "5a0dbc2b28e138b331ac7a22a8cedc02", "score": "0.688943", "text": "function submit() {\n setDisplayForm(false);\n setIsCompleted(true);\n }", "title": "" }, { "docid": "4651536bd9d473960c90c0a30bd402af", "score": "0.6876381", "text": "_submitAnother() {\n this._createAnother = true;\n this.$.form.submit();\n }", "title": "" }, { "docid": "a7db8297c5882f6924c2cb5d54be983f", "score": "0.68326706", "text": "function submitCheckOnce()\n {\n if (submitInd){\n return false;\n }else{\n\t submitInd = true;\n return true;\n\t }\n }", "title": "" }, { "docid": "8c241e57ef04ad4fe4c9c3ad251aa4c8", "score": "0.6789685", "text": "function submitBulkForm() {\r\n processFile();\r\n return false;\r\n }", "title": "" }, { "docid": "23e04a15e845e51252493247c3ce6b3f", "score": "0.67801356", "text": "function tryToSubmitForm() {\n $('#save_order_onidletimeout_btn').show();\n console.log(\"try To Submit Form: on timeout. len=\"+$('#save_order_onidletimeout_btn').length);\n\n if( $('#save_order_onidletimeout_btn').length > 0 &&\n ( cycle == \"new\" || cycle == \"edit\" || cycle == \"amend\" ) &&\n checkIfOrderWasModified()\n ) {\n console.log(\"try To Submit Form: save!!!!!!!!!!!\");\n //save if all fields are not empty; don't validate\n $('#save_order_onidletimeout_btn').trigger('click');\n } else {\n idlelogout();\n }\n}", "title": "" }, { "docid": "f773a37217c1f30e38a4524fbe27f52f", "score": "0.67756134", "text": "function bindFormSubmit() {\n $form.submit(function(e) {\n var data = {};\n\n e.preventDefault();\n\n if (!$submitBtn.hasClass(\"disabled\")) {\n\n data = {\n id: $trimSelect.val(),\n year: $yearSelect.val(),\n make: $makeSelect.val(),\n model: $modelSelect.find(\"option:selected\").eq(0).text(),\n trim: $trimSelect.find(\"option:selected\").eq(0).text(),\n helperFile: $form.data('file'), //LIM 148 \n dealerCode: $form.data('dealercode') // LIM 148\n };\n\n opts.addCallback(data);\n\n resetForm();\n }\n });\n }", "title": "" }, { "docid": "4b51e8adaecc613e5d867462916e52f4", "score": "0.6742541", "text": "onSubmit() {\n chayns.dialog.alert('', 'Your message was send successfully. We do our best to help you as far as possible.');\n this._submit.classList.add('button--disabled');\n location.reload();\n if (this.isValid())\n this.props.submit ? this.props.submit(this.form) : null;\n\n }", "title": "" }, { "docid": "46ea19ce6d5b47734dc573da34af27e3", "score": "0.67321366", "text": "function doSubmit() {\n tooshort = false;\n emptyPass(pass);\n\n if (!tooShort)\n existUser(email, pass);\n \n}", "title": "" }, { "docid": "e5ae547697b3d1072b3e94d77152221f", "score": "0.6699488", "text": "afterSubmit(triple) {}", "title": "" }, { "docid": "23e637df393c8094354e79de3ffed09a", "score": "0.6691305", "text": "function validationpassed() {\n // Multiple instances may have been bound to the form, only submit one.\n // This is a workaround and not ideal.\n // Improvements welcomed.\n if (window.lock != \"locked\") {\n var myform = $('.ui.form');\n $.ajax({\n type: myform.attr('method'),\n url: myform.attr('action'),\n data: myform.serialize(),\n success: function (data) {\n //if successful at posting the form via ajax.\n myformposted(data);\n window.lock = \"\";\n }\n });\n }\n window.lock = \"locked\";\n }", "title": "" }, { "docid": "93c9eafbfc1b191cf2e8e9ff09300a72", "score": "0.6683072", "text": "function __submitForm(){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(_bDocumentDetermination || (bFromDataComplete && bDocumentDataComplete) ){\r\n\t\t\t\t\t\t\tvar sProcedureId = \"\",\r\n\t\t\t\t\t\t\tsCourseOffering = \"\",\r\n\t\t\t\t\t\t\tsObjectIds = \"\",\r\n\t\t\t\t\t\t\tsPrevDecisionId = \"\";\r\n\t\t\t\t\t\t\t//push courses Info to content\r\n\t\t\t\t\t\t\tif(_oCourses && !jQuery.isEmptyObject(_oCourses)){\r\n\t\t\t\t\t\t\t\t//if(jQuery.isPlainObject(_oCourses)){\r\n\t\t\t\t\t\t\t\tsProcedureId = _oCourses.ProcedureId ? _oCourses.ProcedureId : \"\"; \r\n\t\t\t\t\t\t\t\tsCourseOffering = _oCourses.CourseOffering ? _oCourses.CourseOffering : \"\"; \r\n\t\t\t\t\t\t\t\tsObjectIds = _oCourses.ObjectIds ? _oCourses.ObjectIds : \"\"; \r\n\t\t\t\t\t\t\t\tsPrevDecisionId = _oCourses.PrevDecisionid ? _oCourses.PrevDecisionid : \"\";\r\n\t\t\t\t\t\t\t\t/*$.each(_oCourses,function(i, o){\r\n\t\t\t\t\t\t\t\t\toPreparedData.content.push(o);\r\n\t\t\t\t\t\t\t\t});*/\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//Action Code\r\n\t\t\t\t\t\t\tsActionCode = sActionCode || 'IADH2';\r\n\t\t\t\t\t\t\t//prepare Request to POST\r\n\t\t\t\t\t\t\toReq.url = \"GFD_FormSubmissionCollection\";\r\n\t\t\t\t\t\t\toReq.method = \"POST\";\r\n\t\t\t\t\t\t\toReq.data = {\r\n\t\t\t\t\t\t\t\t\t\"ProcedureId\": sProcedureId,\r\n\t\t\t\t\t\t\t\t\t\"CourseOffering\": sCourseOffering,\r\n\t\t\t\t\t\t\t\t\t\"ObjectIds\": sObjectIds,\r\n\t\t\t\t\t\t\t\t\t\"PrevDecisionid\": sPrevDecisionId,\r\n\t\t\t\t\t\t\t\t\t'ContextId': sContextId,\r\n\t\t\t\t\t\t\t\t\t'FormId': sFormId,\r\n\t\t\t\t\t\t\t\t\t'FormSubmId': notification,\r\n\t\t\t\t\t\t\t\t\t'Action': sActionCode,\r\n\t\t\t\t\t\t\t\t\t'CustomContent': JSON.stringify(oPreparedData.customContent),\r\n\t\t\t\t\t\t\t\t\t'Content': JSON.stringify(oPreparedData.content),\r\n\t\t\t\t\t\t\t\t\t//'DocContent': JSON.stringify(oPreparedData.documentContent)\r\n\t\t\t\t\t\t\t\t\t'DocContent': _bDocumentDetermination ? \"\" : JSON.stringify(aPreparedDocumentData)\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t//call BE via connector\r\n\t\t\t\t\t\t\t_oDataModel.processRequest(oReq, callback); \r\n\t\t\t\t\t\t}else if(oRawDataFormIfIncomplete && oRawDataDocumentIfIncomplete){\r\n\t\t\t\t\t\t\t//call error callback with rawdata\r\n\t\t\t\t\t\t\terrorCallback.call(this,oRawDataFormIfIncomplete,oRawDataDocumentIfIncomplete,bFromDataComplete,bDocumentDataComplete);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}", "title": "" }, { "docid": "95ada0f9174a1934b84889c2ac1ae377", "score": "0.6682519", "text": "function processingOnSubmit () {\n $$('.submit').each(function(s) {\n s.value = 'Processing...';\n Form.Element.disable(s);\n });\n return true;\n}", "title": "" }, { "docid": "eec95c0ab0f08ff5bd0414db1293a0f2", "score": "0.66813236", "text": "submitForm(){\n\t}", "title": "" }, { "docid": "ef39622fb4933d68aa90cc8a5ef6b672", "score": "0.6660781", "text": "function doSubmit() {\n\tif (document.getElementById('update').value.length >= 1000) {\n\t\t// some functionality will not work as expected on result pages\n\t\treturn true;\n\t} else { // safe to use in request-URI\n\t\tvar url = [];\n\t\turl[url.length] = 'update';\n\t\tif (document.all) {\n\t\t\turl[url.length] = ';';\n\t\t} else {\n\t\t\turl[url.length] = '?';\n\t\t}\n\t\taddParam(url, 'queryLn');\n\t\taddParam(url, 'update');\n\t\taddParam(url, 'limit');\n\t\taddParam(url, 'infer');\n\t\turl[url.length - 1] = '';\n\t\tdocument.location.href = url.join('');\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "f0b39983b5ed37885b3a82393c2a054e", "score": "0.6653898", "text": "function _submitRecord(){const redirect=settings.type==='single'||settings.type==='edit'||settings.type==='view';let beforeMsg;let authLink;let level;let msg='';const include={irrelevant:false};form.view.html.dispatchEvent(events.BeforeSave());beforeMsg=redirect?t('alert.submission.redirectmsg'):'';authLink=`<a href=\"${settings.loginUrl}\" target=\"_blank\">${t('here')}</a>`;gui.alert(`${beforeMsg}<div class=\"loader-animation-small\" style=\"margin: 40px auto 0 auto;\"/>`,t('alert.submission.msg'),'bare');return fileManager.getCurrentFiles().then(files=>{const record={'xml':form.getDataStr(include),'files':files,'instanceId':form.instanceID,'deprecatedId':form.deprecatedID};if(form.encryptionKey){const formProps={encryptionKey:form.encryptionKey,id:form.view.html.id,// TODO: after enketo-core support, use form.id\nversion:form.version};return encryptor.encryptRecord(formProps,record);}else{return record;}}).then(connection.uploadRecord).then(result=>{result=result||{};level='success';if(result.failedFiles&&result.failedFiles.length>0){msg=`${t('alert.submissionerror.fnfmsg',{failedFiles:result.failedFiles.join(', '),supportEmail:settings.supportEmail})}<br/>`;level='warning';}// this event is used in communicating back to iframe parent window\ndocument.dispatchEvent(events.SubmissionSuccess());if(redirect){if(!settings.multipleAllowed){const now=new Date();const age=31536000;const d=new Date();/**\n * Manipulate the browser history to work around potential ways to\n * circumvent protection against multiple submissions:\n * 1. After redirect, click Back button to load cached version.\n */history.replaceState({},'',`${settings.defaultReturnUrl}?taken=${now.getTime()}`);/**\n * The above replaceState doesn't work in Safari and probably in\n * some other browsers (mobile). It shows the\n * final submission dialog when clicking Back.\n * So we remove the form...\n */jquery('form.or').empty();jquery('button#submit-form').remove();d.setTime(d.getTime()+age*1000);document.cookie=`${settings.enketoId}=${now.getTime()};path=/single;max-age=${age};expires=${d.toGMTString()};`;}msg+=t('alert.submissionsuccess.redirectmsg');gui.alert(msg,t('alert.submissionsuccess.heading'),level);setTimeout(()=>{location.href=decodeURIComponent(settings.returnUrl||settings.defaultReturnUrl);},1200);}else{msg=msg.length>0?msg:t('alert.submissionsuccess.msg');gui.alert(msg,t('alert.submissionsuccess.heading'),level);_resetForm(true);}}).catch(result=>{let message;result=result||{};console.error('submission failed',result);if(result.status===401){message=t('alert.submissionerror.authrequiredmsg',{here:authLink,// switch off escaping just for this known safe value\ninterpolation:{escapeValue:false}});}else{message=result.message||gui.getErrorResponseMsg(result.status);}gui.alert(message,t('alert.submissionerror.heading'));});}", "title": "" }, { "docid": "05400153a3ccc0fdf373f69a1f3e7241", "score": "0.6648181", "text": "function submitFn() {\r\n\t\t\t\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\t\t\t\tvar contentWrap = form.find('.contentWrap');\r\n\t\t\t\t\t\t\t\tvar jsonCombine = $(document.createElement('textarea')).attr('name', 'Contents').html(jsonConvert(contentWrap)).hide();\r\n\t\t\t\t\t\t\t\tcontentWrap.find('input, textarea, select, radio').attr('name', \"\");\r\n\t\t\t\t\t\t\t\tjsonCombine.appendTo(form);\r\n\r\n\t\t\t\t\t\t\t\tseajs.use('upload', function (u) {\r\n\t\t\t\t\t\t\t\t\tnew u.Upload({\r\n\t\t\t\t\t\t\t\t\t\tform: form,\r\n\t\t\t\t\t\t\t\t\t\taction: A.main.config.action.add,\r\n\t\t\t\t\t\t\t\t\t\tcallback: function (data, node) {\r\n\t\t\t\t\t\t\t\t\t\t\tif (data.success === true) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tlocation.reload();\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\talert(data.message);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "8c665e57a6e091adf1d0978c02945a1c", "score": "0.66048217", "text": "function handleSubmit() {\r\n $('#pages').cycle(4)\r\n postToNodeServer(globalForm.endingTips, displayPostResult);\r\n}", "title": "" }, { "docid": "cb6f5ad007ca7de0397291252ce0adb5", "score": "0.6601947", "text": "function _submitForm(event) {\n event.preventDefault()\n var $selectedSimple = $('input[type=radio]').filter(':checked');\n var $selectedMultiple = $('input[type=checkbox]').filter(':checked');\n _fillSimpleHiddenElements($selectedSimple);\n _fillMultipleHiddenElements($selectedMultiple);\n $(\"button:submit\").prop(\"disabled\", true);\n $('#preferences').submit();\n trackOCIPreferences(Globals.page_section,reservationIdOci);\n }", "title": "" }, { "docid": "0c567ade7acbddfbc6eb920f7645a0bd", "score": "0.658911", "text": "onSubmit () {\n if (!this.checkData()) {\n return\n }\n\n this.submitLiteral()\n }", "title": "" }, { "docid": "afe6f57126ccdccd1d63c51e50bc20e0", "score": "0.65648544", "text": "onSubmit() {}", "title": "" }, { "docid": "5deb44c6bec6823684def969c04fe0b8", "score": "0.6554621", "text": "submit() {\n if (this.validateSubmit() && !this.waiting) {\n if (this.mode === 'register') {\n this.__store();\n } else if (this.mode === 'updating') {\n this.__update();\n }\n }\n }", "title": "" }, { "docid": "5af1f6a91c8e815b55ebd030cdd930b0", "score": "0.65467376", "text": "_handleSubmitEvent()\n {\n this.submitForm();\n }", "title": "" }, { "docid": "f3af4fcab70cf50b8a7a036f49ce2fb9", "score": "0.65434194", "text": "function submitData() {\n if (done) return;\n done = true;\n let endReason = 'done';\n if (errorEnd) {\n endReason = 'error';\n } else if (responses.length < videos.length) {\n endReason = 'fail';\n }\n onDone({\n responses,\n endReason\n });\n }", "title": "" }, { "docid": "110fc149a7bba82c09acbeb3e2f5b3a7", "score": "0.65391606", "text": "handleFinishClick() {\n const values = this.getFieldValues();\n this.submit.emit({ body: values });\n }", "title": "" }, { "docid": "31dda2a98f912be63d839d292b228768", "score": "0.65389884", "text": "function Submit_success(tx)\n{\n\t\t\n\t $('#objectives').html(\"\"); // clear the objectives\n\t // $('#submitbutton').hide(); // hide the submit button\n\t \t \n\t // Check if the current level is completed for the participant..\n\t db.transaction(CheckCurrentLevelStatus, transaction_error);\n\t // Get the next Level Objectives..\t \n\t\n}", "title": "" }, { "docid": "bf29c2f8d3d0b56eb9ec8a0050d46cd6", "score": "0.653328", "text": "function forceSubmit() {\n //var submitBtnObjectRef = $(__constants.DOM_SEL_SUBMIT_BTN).attr(__constants.ADAPTOR_INSTANCE_IDENTIFIER); \n var activityBodyObjectRef = $(__constants.DOM_SEL_ACTIVITY_BODY).attr(__constants.ADAPTOR_INSTANCE_IDENTIFIER); \n /*Getting answer in JSON format*/\n\t\tvar answerJSON = getAnswersJSON(true);\n \n /*Send Results to platform*/\n\t\tactivityAdaptor.submitSkipQuestion(answerJSON, activityBodyObjectRef);\n }", "title": "" }, { "docid": "6f83e36a69cb0f1c842e7560265f911b", "score": "0.6530308", "text": "function onSubmit() {\n contentCopy = angular.copy(ctrl.content);\n\n if (ctrl.fileChanged) {\n if (angular.isFunction(ctrl.submitData)) {\n ctrl.isLoadingState = true;\n ctrl.submitData({ newContent: ctrl.content }).then(function (data) {\n ctrl.closeDialog({ value: data });\n }).catch(function (error) {\n ctrl.serverError = error.statusText;\n }).finally(function () {\n ctrl.isLoadingState = false;\n });\n }\n }\n }", "title": "" }, { "docid": "93bd3ec2d57fc9719670d6cc486686ba", "score": "0.65172803", "text": "function doSubmit() {\n\t\n\t/* before submitting, we have to grab the form elements that have been inserted into the DOM after it\n\t\twas loaded. Firefox seems to be the only browser that munges an ajax form in with the existing form.\n\t\tAll others keep the dynamically added elements separate, and therefore if we are not careful, these\n\t\telements are not passed when the main form (\"metadata-form\") is submitted.\n\t*/\n\t\n\tmungeFormFieldElements ();\n\n\tdocument.forms[0].method = \"post\";\n\tdocument.forms[0].submit();\n\treturn true;\n}", "title": "" }, { "docid": "7dedaaed20343b47776517e85cb2a46d", "score": "0.65163535", "text": "function submitForm() {\n\t$('.submit').click(function() {\n verifyNames(function () {\n \t\t// find questions not passing word count requirement\n \t\tvar questionsWordCount = verifyWordCount(envision.quality.questions.concat(envision.natural.questions));\n \t\t// if all questions pass, save form\n \t\tif (!questionsWordCount.length) {\n \t\t\t// set timer to converted hours:mins:secs\n \t\t\tenvision.timeTaken = getTimer(new Date() - new Date(envision.timer));\n\n \t\t\tsave();\n \t\t} else {\n \t\t\talert('You must meet the minimum character requirement for the following questions:\\n\\n' + questionsWordCount.join('\\n'))\n \t\t}\n });\n\t})\n}", "title": "" }, { "docid": "270c930ec4a2d05c8f579cc51864d793", "score": "0.6512456", "text": "function formSubmit(){\n if(!edit) {\n create_cards();\n }\n edit = false;\n validateForm();\n toggleVisibility();\n resetForm();\n return false;\n}", "title": "" }, { "docid": "da0aeb2488a3ee63b0039c127ebaca45", "score": "0.6509327", "text": "submit() {\n this.processAll()\n if (this.valid) {\n ipcRenderer.send('teacherCreation', {\n fullName: this.name.value,\n socialID: this.sid.value,\n sex: this.sex.value,\n degree: this.degree.value,\n phoneNumber: this.phone.value,\n birthDate: `${this.birthDate.year.value}/${this.birthDate.month.value}/${this.birthDate.day.value}`,\n address: this.address.value\n })\n\n // clearing the fields for another creation\n // this.name.value = ''\n // this.phone.value = ''\n // this.sid.value = ''\n // this.degree.value = ''\n // this.address.value = ''\n // this.birthDate.day.value = ''\n // this.birthDate.month.value = ''\n // this.birthDate.year.value = ''\n\n // resetting every field\n resetError(this.name)\n resetError(this.phone)\n resetError(this.sid)\n resetError(this.degree)\n resetError(this.address)\n resetError(this.birthDate.day)\n resetError(this.birthDate.month)\n resetError(this.birthDate.year)\n }\n }", "title": "" }, { "docid": "d94165de2e184cc8bec13dbacc077f5e", "score": "0.6498405", "text": "function handleSubmit() {\n d3.event.preventDefault();\n populatePanel();\n }", "title": "" }, { "docid": "04f6c09b44cfb9160e8c103735db0fcc", "score": "0.6467966", "text": "function cancelDeferredFormSubmit(){\n\t\t\tautosubmit = false;\n\t\t\tsubmitBtn.set('disabled', false);\n\t\t\tdescArea.set('disabled', false);\n\t\t\tsubmitBtn.set('value', 'Save');\n\t\t\tcancelSubmitLink.hide();\n\t\t}", "title": "" }, { "docid": "2399d062e8cb7a9985de310f243e375c", "score": "0.6466588", "text": "function onSubmit() {\n if(!publishing.governedBy) {\n publishing.connections = [];\n \n // Loop through each input switch and add the corresponding Connection id to the connections list \n modal.$element.find('.switch[data-connection-id] input').each(function(i) {\n if(this.checked) {\n publishing.connections.push(\n this.parentElement.dataset.connectionId\n );\n }\n });\n \n // Apply to children flag\n publishing.applyToChildren = modal.$element.find('#switch-publishing-apply-to-children input')[0].checked;\n\n // Commit publishing settings to Content model\n content.settings.publishing = publishing;\n \n // API call to save the Content model\n apiCall('post', 'content/' + content.id, content)\n \n // Upon success, reload the UI \n .then(() => {\n NavbarMain.reload();\n\n if(Router.params.id == content.id) {\n let contentEditor = ViewHelper.get('ContentEditor');\n\n contentEditor.model = content.getObject();\n return contentEditor.render();\n \n } else {\n return Promise.resolve();\n\n }\n })\n .catch(UI.errorModal);\n }\n\n }", "title": "" }, { "docid": "c6ac715cc2808dfa820672ca1ef414a3", "score": "0.6460171", "text": "function submit() {\r\n console.log(\"submitted successfully\");\r\n setLocalState(values);\r\n }", "title": "" }, { "docid": "05fb3e8b12ee106825483b9572165900", "score": "0.64516175", "text": "function handleSubmit(event) {\r\n\r\n /* Check Answer */\r\n var s = __pluginInstance.leoRightItem.score();\r\n /* Marking Answers. */\r\n if (activityAdaptor.showAnswers) {\r\n __pluginInstance.leoRightItem.displayFeedback(s);\r\n }\r\n\r\n __updateAnsStatus(s);\r\n /* Saving Answer. */\r\n __saveResults(true);\r\n\r\n //$('input[id^=option]').attr(\"disabled\", true);\r\n }", "title": "" }, { "docid": "8ffc2bebc2f28ecec974395ee2124f3b", "score": "0.6449992", "text": "function hadndleFormSubmit(event) {\n event.preventDefault();\n if (formObject.name) {\n API.saveMaterial({\n name: formObject.name,\n price: formObject.price,\n notes: formObject.notes\n })\n .then(res => loadMaterials())\n .catch(err => console.log(err));\n document.getElementById(\"matFrm\").reset();\n setFormObject({}) \n }\n }", "title": "" }, { "docid": "7f347b66c1169c29a73fed51501ef0c5", "score": "0.6447906", "text": "function submitFormOnce(currentForm)\n {\n if (!submitInd){\n\t submitInd = true;\n\t currentForm.submit();\n\t }\n }", "title": "" }, { "docid": "549ebbb0f27ebb4550bfb782c6ccb304", "score": "0.6440115", "text": "onSuccess() {\n this.isSubmitting = false;\n this.reset();\n }", "title": "" }, { "docid": "14236fcf4cfcc3fc3770c87af94cbad7", "score": "0.64304256", "text": "submit() {\n this.reviewing = true;\n this.showElement(DOM.nextbuttonid);\n // Update score for this question, call Question.submit\n this.score[this.currentquestion] = this.questions[this.currentquestion].submit();\n if (this.score[this.currentquestion].pct >= this.questions[this.currentquestion].requiredscore) {\n // If on last question, adjust button label and click event\n if (this.currentquestion == this.questions.length - 1) {\n document.getElementById(DOM.nextbuttonid).textContent = \"Finish\";\n document.getElementById(DOM.nextbuttonid).addEventListener(\"click\", e => this.finish(e));\n }\n } else {\n document.getElementById(DOM.nextbuttonid).textContent = \"Retry\";\n }\n this.disableElement(DOM.submitbuttonid);\n this.showElement(DOM.nextbuttonid);\n if (this.score[this.currentquestion].pct < 1) {\n this.showhint();\n }\n this.updateScores();\n this.defocus();\n }", "title": "" }, { "docid": "47cd04310be4bbd4550113a26e5603ac", "score": "0.6429411", "text": "function submitAction() {\n //******************************************************************************\n //* Purpose:\n //*\n //* Inputs:\n //*\n //* Return: none\n //******************************************************************************\n\n debugMsg(\"<submitAction>\");\n var noerror = true;\n if (thisFormAttrs != null)\n noerror = validateForm(document.forms[0], thisFormAttrs);\n if (noerror && businessLogicImplemented)\n noerror = validateBusinessLogic(document.forms[0].thisFormAttrs);\n if (noerror) {\n document.forms[0].buttonClicked.value = SUBMIT_CLICKED;\n document.forms[0].submit();\n } else if (onErrorFormSubmit) {\n assignOldFormValue();\n }\n}", "title": "" }, { "docid": "59dfdd4ad0489c0931e919207af9eed1", "score": "0.64280856", "text": "function end_of_remote_evaluations() {\n\t////\n\tif ( g_remotedformObject != null ) {\n\t\trolled_oats_prepare_storage_format('edit-body');\n\t\tg_remotedformObject.submit();\n\t}\n\t////\n}", "title": "" }, { "docid": "6cfdd3eafcc6b27095019e76a917d694", "score": "0.64264774", "text": "function initSubmitInd() {\n submitInd = false;\n}", "title": "" }, { "docid": "6fabbb6bf3d2218785157c45e93cce70", "score": "0.6423859", "text": "function watchSubmit() {\n\t$('#js-form').submit(event => {\n\t\tevent.preventDefault();\n\t\t$('.js-results-1').addClass('hidden');\n\t\t$('.js-results-2').addClass('hidden');\n\t\t$('.js-results-3').addClass('hidden');\n\t\tlet searchTerm = $('.js-search').val();\n\t\tmaxResults = $('.js-max-results').val();\n\t\tif($('.js-checkbox-1').is(\":checked\")){\n\t\t\tfetchTwitchStreamData(searchTerm, maxResults);\n\t\t};\n\t\tif($('.js-checkbox-2').is(\":checked\")){\n\t\t\tfetchTwitchClipsData(searchTerm, maxResults);\n\t\t};\n\t\tif($('.js-checkbox-3').is(\":checked\")){\n\t\t\tfetchYoutubeData(searchTerm, maxResults);\n\t\t};\n\t\t});\n\t$('.js-search').val('');\n\t$('.js-max-results').val('');\n}", "title": "" }, { "docid": "3567c84d3ee1d397df27099cb0c24d6d", "score": "0.64119476", "text": "function submitForm(currentForm)\n {\n\t submitInd = true;\n\t currentForm.submit();\n }", "title": "" }, { "docid": "2c40c766c2fccc1449991dc534b3ae2a", "score": "0.6404278", "text": "finishSave() {\n this.inlineEditorView.submit();\n }", "title": "" }, { "docid": "5e2773628b825cc4bbe95ac8cc504590", "score": "0.6403726", "text": "function submit() {\n squashActions();\n submitOneAction(0).then(function() {\n window.location.reload(true);\n });\n}", "title": "" }, { "docid": "97134644c989bed5b6146a104ad60ffb", "score": "0.63925", "text": "function submitCallback() {\n createPost();\n }", "title": "" }, { "docid": "2c3c2682f84c65f8ceecc614882afb79", "score": "0.63923556", "text": "handleSubmit(e) {\n const ready_in = this.getFormData()['ready_in']\n const readyUpdate = this.props.actions.readyUpdate\n const cableReadyUpdate = this.props.actions.cableReadyUpdate\n\n e.preventDefault()\n readyUpdate({ready_in: ready_in, success: [cableReadyUpdate]})\n }", "title": "" }, { "docid": "6d68162a09ac3be46c26baef37f12773", "score": "0.63876367", "text": "submitform(){\n\n\n this.reset();\n var selected_fromdate = this.form.find('#from_date_sk').val();\n var selected_todate = this.form.find('#to_date_sk').val();\n var fromTS = parseInt((new Date(selected_fromdate).getTime()/1000)-this.tzadj);\n var toTS = parseInt((new Date(selected_todate).getTime()/1000)-this.tzadj);\n let duration = ` <i class='fa fa-clock-o fa-fw '></i>\n from ${selected_fromdate} to ${selected_todate}\n (${h_fmtduration(toTS-fromTS)})`\n this.dom.find(\".target\").html(duration)\n this.tmint = mk_time_interval([fromTS,toTS]);\n this.cgguid = this.form.find('#cg_id').val();\n this.meter = this.form.find('#meter_id').val();\n this.filter_text=this.form.find('#fltr_crs').val();\n this.run();\n return false;\n }", "title": "" }, { "docid": "6c9b179ac85b875781137b19d47fece1", "score": "0.6376776", "text": "function automaticsubmit(obj) {\n\tif (!sjbjlform_sent) {\n\t\t$(obj).closest('form').submit();\n\t}\n}", "title": "" }, { "docid": "35623ba023e81e271987f968a1a3548a", "score": "0.6369821", "text": "submit() {\n // return the newstate and nextPage(bool)\n var { newState, nextPage } = this.checkBeforeSubmit();\n if (nextPage) {\n this.props.ParentSubmit(newState);\n }\n }", "title": "" }, { "docid": "e624ef5d8443d39a308830b5da4460a9", "score": "0.6364888", "text": "function dummy_submit_form($form)\n {\n \tif($form.valid())\n \t{\n \t\tform_loading($form);\n \t\t\n \t\tsetTimeout(function() {\n \t\t\tform_success($form);\n \t\t}, 2000);\n \t}\n }", "title": "" }, { "docid": "365a2e72749fc56396f1aa8f86a4d210", "score": "0.6363136", "text": "_submitHandler(ev){\n\t\tev.preventDefault();\n\t\tthis.submitForm();\n\t}", "title": "" }, { "docid": "9528d5af3fbebb153318cc804a4694c0", "score": "0.6362713", "text": "function submitAfterValidate() {\n\t\t\tif(!isValid) {\n\t\t\t\tvar result = { success: false, message: error };\n\t\t\t\treturn res.send(JSON.stringify(result));\n\t\t\t} \n\t\t\telse {\n\t\t\t\tif(!dayChanged) {\n\t\t\t\t\t// Data was valid, but nothing was changed\n\t\t\t\t\tvar result = { success: false, message: 'Unable to Update: No days '+\n\t\t\t\t\t\t'have been changed.' };\n\t\t\t\t\treturn res.send(JSON.stringify(result));\n\t\t\t\t}\n\n\t\t\t\t// Everything was okay, so save the days!\n\t\t\t\tSiteService.saveDays(daysToEdit)\n\t\t\t\t\t.then(function(result) {\n\t\t\t\t\t\t// return the updates so the frontend can track new objects\n\t\t\t\t\t\tres.send(JSON.stringify(result));\n\t\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4e4ed09f268dce02d3895a7741e5c137", "score": "0.6360876", "text": "function onSubmit() {\n\t\tonSubmitForm(history);\n\t}", "title": "" }, { "docid": "f7785f127f9c8ab01315e8c199d8d9e5", "score": "0.6360206", "text": "function submit() {\n displayResponse();\n if(currentTime !== 0) {\n startChallenge();\n }\n }", "title": "" }, { "docid": "a9d3638a71460f25ead2784fe88c3338", "score": "0.635818", "text": "submit(e) {\n e.preventDefault();\n this.currentStep++;\n this.updateForm();\n }", "title": "" }, { "docid": "a9d3638a71460f25ead2784fe88c3338", "score": "0.635818", "text": "submit(e) {\n e.preventDefault();\n this.currentStep++;\n this.updateForm();\n }", "title": "" }, { "docid": "5dd3c800a0015e4dee18499c9fb1ad52", "score": "0.63554686", "text": "function formSubmit() {\n\t$('.query-form').submit(function(e) {\n\t\te.preventDefault();\n\t\t$('.js-results ul').empty();\n\t\tstate.videos = [];\n\t\tstate.query = $(this).find('.js-query').val();\n\t\tgetDataFromApi(state.query, handleApiData);\n\t});\n}", "title": "" }, { "docid": "9b97c11140d9fe0c58872fcf0f200106", "score": "0.6346148", "text": "onSubmit(event) {\n event.preventDefault();\n\n // Validate the form\n FORM_ELEMENTS.validate(this.state.step);\n\n // Set a timeout due to the setState function of react\n setTimeout(() => {\n // Validate all the inputs on the current step\n const valid = FORM_ELEMENTS.isValid(this.state.step);\n\n if (valid) {\n // if we are in the last step we will submit the form\n if (this.state.step === this.state.stepLength && !this.state.submitting) {\n const dataset = this.props.dataset;\n\n // Start the submitting\n this.setState({ submitting: true });\n\n // Set the request\n const requestOptions = {\n type: (dataset) ? 'PATCH' : 'POST',\n omit: (dataset) ? ['connectorUrlHint', 'authorization', 'connectorType', 'provider'] : ['connectorUrlHint', 'authorization']\n };\n\n // Save the data\n this.service.saveData({\n type: requestOptions.type,\n id: dataset,\n body: omit(this.state.form, requestOptions.omit)\n })\n .then((data) => {\n toastr.success('Success', `The dataset \"${data.id}\" - \"${data.name}\" has been uploaded correctly`);\n if (this.props.onSubmit) {\n this.props.onSubmit(data.id);\n }\n })\n .catch((err) => {\n this.setState({ submitting: false });\n try {\n if (err && !!err.length) {\n err.forEach((e) => {\n toastr.error('Error', e.detail);\n });\n } else {\n toastr.error('Error', 'Oops! There was an error, try again');\n }\n } catch (e) {\n toastr.error('Error', 'Oops! There was an error, try again');\n }\n });\n } else {\n this.setState({\n step: this.state.step + 1\n });\n }\n } else {\n toastr.error('Error', 'Fill all the required fields or correct the invalid values');\n }\n }, 0);\n }", "title": "" }, { "docid": "7e887dcb80669fb1283ab26b43f99d45", "score": "0.6344029", "text": "async onSubmit() {\n await this.send('submitAction');\n }", "title": "" }, { "docid": "ac02d1b9b1bafd40d559b15cf9634410", "score": "0.63435936", "text": "function onSubmit(evt) {\n if ($(\"#newEntrySubmit\").hasClass(\"disabled\")) return;\n // Check if user has entered a substantial note\n if ($(\"#newEntryNote\").val().length == 0) {\n $(\".formErrors\").removeClass(\"visible\");\n $(\"#errorsReview\").addClass(\"visible\");\n $(\"#newEntryNote\").focus();\n return;\n }\n $(\"#errorsReview\").removeClass(\"visible\");\n $(\"#newEntrySubmit\").addClass(\"disabled\");\n var req = zdAuth.ajax(\"/api/edit/createentry\", \"POST\", {\n simp: $(\"#newEntrySimp\").val(),\n trad: getTrad(),\n pinyin: getPinyin(),\n trg: $(\"#newEntryTrg\").val(),\n note: $(\"#newEntryNote\").val()\n });\n req.done(function (data) {\n $(\"#newEntrySubmit\").removeClass(\"disabled\");\n onSubmitReady(data.success);\n });\n req.fail(function (jqXHR, textStatus, error) {\n $(\"#newEntrySubmit\").removeClass(\"disabled\");\n onSubmitReady(false);\n });\n $(\"#newEntrySubmit\").addClass(\"disabled\");\n }", "title": "" }, { "docid": "987a54ce1432ea0e3e890414c683d7d0", "score": "0.63393515", "text": "function dummy_submit_form($form) {\r\n if ($form.valid()) {\r\n form_loading($form);\r\n\r\n setTimeout(function() {\r\n form_success($form);\r\n }, 2000);\r\n }\r\n }", "title": "" }, { "docid": "159ac3f4c91d71c82630aa96c12c53bd", "score": "0.6337593", "text": "submit() {\n this.onSubmit()\n }", "title": "" }, { "docid": "83ce77c82b3c213832a660d81809d0fa", "score": "0.6328746", "text": "function submitHelper() {\n updateGuess();\n updateGuessDisplay();\n updateChallengerNames()\n updateChallengerNamesDisplay();\n currentGame.increaseGuessCounter();\n currentGame.logStartTime();\n checkGuess([currentGame.challenger1GuessValue, currentGame.challenger2GuessValue]);\n currentGame.hasBeenWon == true ? gameWon(): '';\n checkFormInputs();\n clearForm([challenger1GuessField, challenger2GuessField]);\n}", "title": "" }, { "docid": "804666531274686eb64f6ca886665dcb", "score": "0.6328413", "text": "function submit () {\n $scope.submitting = true\n\n $http.post('/api/users', $scope.data)\n .then(submitSuccess, submitFailed)\n }", "title": "" }, { "docid": "c6214fc8c7307256e4969063bca4fe85", "score": "0.6327823", "text": "function _eventClickSubmit(){\n\tTi.API.info('SUBMIT BUTTON CLICK');\n\tvalidateSuggestionForm();\n}", "title": "" }, { "docid": "9104585523409230637365cedec928d1", "score": "0.6318705", "text": "function submit()\n\t{\n\t\t/*\n\t\t * XXX: this can be out of sync since\n\t\t * 'submitform-nocoords' is set by an asynchronous\n\t\t * callback for the geolocator.\n\t\t */\n\t\tif (find('submitform-nocoords').checked) {\n\t\t\tattr('submitform-latitude', \n\t\t\t\t'disabled', 'disabled');\n\t\t\tattr('submitform-longitude', \n\t\t\t\t'disabled', 'disabled');\n\t\t}\n\t\treturn(sendForm(find('submitform'), \n\t\t\tgenericSetup, genericError, submitSuccess));\n\t}", "title": "" }, { "docid": "0e320d6b0046c2d512ce6e3cb422b54e", "score": "0.6312517", "text": "async function handleSubmit() {\n // Wait for the fetch calls to finish \n await Promise.all(\n props.activeStops.map((stop) => {\n let body = { \"stop\": stop.stop_id };\n\n let response = actionFetch(\n \"https://csi420-02-vm6.ucd.ie/favoritestop/\",\n \"POST\",\n body,\n props.setError,\n props.setIsPending,\n props.setOkMessage\n );\n\n return response;\n }\n ));\n\n // Update the user \n isAuthenticated();\n\n // Set the active stops to an empty array even if the response is not ok\n props.setActiveStops([]);\n\n // Close the action component after one second \n setTimeout(() => {\n props.setAction(false);\n }, 1000);\n }", "title": "" }, { "docid": "289100132108f3f45a389c271f8d3937", "score": "0.63117194", "text": "function onSubmit() {\n stopTimer();\n markCorrectAnswers(app.repository);\n if (checkAnswers(app.repository)) {\n localRepository.completed = true;\n alert('You answered correct to all questions. CONGRATULATIONS!')\n } else {\n localRepository.completed = false;\n alert('Wrong answers. Correct are marked in green.');\n }\n\n localStorage.setObject(QUIZ, localRepository);\n }", "title": "" }, { "docid": "263e6e4e70dd09095ce33af5d5cb6c82", "score": "0.63068074", "text": "function landingExistingUserSubmit () {\n\t\t\tGLOB.clientRef.push( { \n\t\t\t\t\"msgType\": \"landingExistingUserForm\",\n\t\t\t\t\"passcode\" : $('#landingExistingUserPasscode').val(),\n\t\t\t\t\"TOSCheckbox\" : $('#landingExistingUserTOSCheckbox').prop( \"checked\" )\n\t\t\t} ); \n\t\t\t// Disable user controls\n\t\t\tdisableControls ()\n\t\t\treturn false; // We don't want the form to trigger a page load. We want to do that through jQuery. \n\t\t}", "title": "" }, { "docid": "5886c104837a11a39357a1b5d01890f6", "score": "0.63060606", "text": "_onSubmitButtonClick(evt) {\n evt.preventDefault();\n typeof this._onSubmit === 'function' && this._onSubmit(this._data);\n return this.update(this._data);\n }", "title": "" }, { "docid": "342d1d8a092de529839ed3b0f582f4f4", "score": "0.6297345", "text": "submit() {\n\n $(this.form).submit();\n }", "title": "" }, { "docid": "436e7a763c6227afe9fcad0509e5143e", "score": "0.6292757", "text": "function submitFlash() {\n // Roll up the form & show the \"now submitting\" message\n formView.closeForm();\n\n $submitting.slideDown(function () {\n setTimeout(submitThanks, 1000);\n });\n }", "title": "" }, { "docid": "1022fbbea977e4163e649d40f5ccbbf3", "score": "0.6292012", "text": "submitForm(){\n\tthis.populateDocumentFromForm();\n }", "title": "" }, { "docid": "8010068afcb3ea7122cfb06d4f1bfb0f", "score": "0.62790406", "text": "onFormSubmit(e) {\n e.preventDefault() // Stop form submit\n\n this.onjobSubmit();\n this.props.onMenuClicked('my_analysis_page');\n }", "title": "" }, { "docid": "60b92b740b4f3266da11b4b5d3e0f0f4", "score": "0.62786263", "text": "finishProcessing () {\n this.busy = false;\n this.successful = true;\n }", "title": "" }, { "docid": "e763fe2ae466ac9a89e41108b9fae131", "score": "0.6276107", "text": "function handleSubmit() {\n keys.setAttribute(\"style\", \"height:0;\");\n buttons.forEach(btn =>\n btn.setAttribute(\"style\", \"height:0; padding: 0; border: 0; display:none;\")\n );\n submit.setAttribute(\"style\", \"display:none;\");\n startOver.setAttribute(\"style\", \"height:3rem; padding: 1rem 0; border: 1px solid white\");\n dispwrap.setAttribute(\"style\", \"margin-bottom: 0;\");\n instructions.setAttribute(\"style\", \"height: 0; display:none;\");\n message.setAttribute(\"style\", \"display:block;\");\n let totalLifeOfContractAmount = totalLifeOfContract();\n displayEl.value = totalLifeOfContractAmount;\n let firstYearRaiseAmount = firstYearRaise();\n let firstYearBasePayAmount = firstYearBasePay();\n let secondYearRaiseAmount = secondYearRaise(firstYearBasePayAmount);\n let secondYearBasePayAmount = Number(secondYearBasePay(firstYearBasePayAmount));\n results.innerHTML = resultsString(firstYearRaiseAmount, secondYearRaiseAmount, totalLifeOfContractAmount, secondYearBasePayAmount);\n\n }", "title": "" }, { "docid": "853a0e5e3a3f9f1a6181683d7de0e98a", "score": "0.6272408", "text": "function doSubmit() {\n\t\t\t\t// make sure form attrs are set\n\t\t\t\tvar t = $form.attr2('target'),\n\t\t\t\t\ta = $form.attr2('action'),\n\t\t\t\t\tmp = 'multipart/form-data',\n\t\t\t\t\tet = $form.attr('enctype') || $form.attr('encoding') || mp;\n\n\t\t\t\t// update form attrs in IE friendly way\n\t\t\t\tform.setAttribute('target', id);\n\t\t\t\tif (!method || /post/i.test(method)) {\n\t\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t\t}\n\t\t\t\tif (a !== s.url) {\n\t\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t\t}\n\n\t\t\t\t// ie borks in some cases when setting encoding\n\t\t\t\tif (!s.skipEncodingOverride && (!method || /post/i.test(method))) {\n\t\t\t\t\t$form.attr({\n\t\t\t\t\t\tencoding : 'multipart/form-data',\n\t\t\t\t\t\tenctype : 'multipart/form-data'\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// support timout\n\t\t\t\tif (s.timeout) {\n\t\t\t\t\ttimeoutHandle = setTimeout(function() {\n\t\t\t\t\t\ttimedOut = true; cb(CLIENT_TIMEOUT_ABORT);\n\t\t\t\t\t}, s.timeout);\n\t\t\t\t}\n\n\t\t\t\t// look for server aborts\n\t\t\t\tfunction checkState() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar state = getDoc(io).readyState;\n\n\t\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\t\tif (state && state.toLowerCase() === 'uninitialized') {\n\t\t\t\t\t\t\tsetTimeout(checkState, 50);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlog('Server abort: ', e, ' (', e.name, ')');\n\t\t\t\t\t\tcb(SERVER_ABORT);\t\t\t\t// eslint-disable-line callback-return\n\t\t\t\t\t\tif (timeoutHandle) {\n\t\t\t\t\t\t\tclearTimeout(timeoutHandle);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add \"extra\" data to form if provided in options\n\t\t\t\tvar extraInputs = [];\n\n\t\t\t\ttry {\n\t\t\t\t\tif (s.extraData) {\n\t\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\t\tif (s.extraData.hasOwnProperty(n)) {\n\t\t\t\t\t\t\t\t// if using the $.param format that allows for multiple values with the same name\n\t\t\t\t\t\t\t\tif ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n\t\t\t\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"' + s.extraData[n].name + '\">', ownerDocument).val(s.extraData[n].value)\n\t\t\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"' + n + '\">', ownerDocument).val(s.extraData[n])\n\t\t\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!s.iframeTarget) {\n\t\t\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t\t\t$io.appendTo($body);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (io.attachEvent) {\n\t\t\t\t\t\tio.attachEvent('onload', cb);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tio.addEventListener('load', cb, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tsetTimeout(checkState, 15);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tform.submit();\n\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t// just in case form has element with name/id of 'submit'\n\t\t\t\t\t\tvar submitFn = document.createElement('form').submit;\n\n\t\t\t\t\t\tsubmitFn.apply(form);\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\t\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\t\tform.setAttribute('action', a);\n\t\t\t\t\tform.setAttribute('enctype', et); // #380\n\t\t\t\t\tif (t) {\n\t\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t\t}\n\t\t\t\t\t$(extraInputs).remove();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "abb8a181f74d61c76ee820524e9353f4", "score": "0.6272131", "text": "function _handleSubmit(event) {\n \n var query;\n\n query = $queryBox.val();\n \n event.preventDefault();\n\n $container\n .find(\".alert\")\n .remove();\n \n if(_validateForm(query)) {\n \n _showLoader($results);\n\n $.when(\n _getImageResults(query)\n ).then(function(res) {\n var json;\n _hideLoader($results);\n try {\n var json = $.parseJSON(res);\n _animateResults(query);\n _displayImage(json);\n } catch(err) {\n\n }\n }); \n \n }\n\n }", "title": "" }, { "docid": "2f8c03f4eb94263cdebb711e770138ff", "score": "0.6271126", "text": "function holdForAuthSubmit(data) { \n\tcounter = 0;\n\tfunction checkAuth() {\t\t\n\t\tif (authInProcess) {\n\t\t\tcounter++;\n\t\t\tif (counter > 20) {\n\t\t\t\tsetTimeout(checkAuth, 500);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tdata.submit();\t\t\n\t\t\treturn true;\n\t\t}\n\t}\n\tcheckAuth();\t\n}", "title": "" }, { "docid": "42709a7bc3b3690d40143bcbcca88416", "score": "0.6270234", "text": "handleSubmit(e) {\n e.preventDefault();\n this.setState({ attemptedSubmit: true });\n if (this.state.name && this.state.dscript) {\n this.props.addTrip(this.getTripObj());\n this.props.close();\n }\n }", "title": "" }, { "docid": "8c9a733f7d604ec6066d153b3530bf3c", "score": "0.6269798", "text": "function updateCourseTrans(){\n try{\n var err1 = validateModule.validate(_objTrans);\n var err2 = validateFile(1);\n if(err1 && err2){\n $('#form-course-trans').ajaxSubmit({\n beforeSubmit: function(a,f,o) {\n o.dataType = 'json';\n },\n complete: function(XMLHttpRequest, textStatus) {\n var res = XMLHttpRequest.responseJSON;\n if(res.status){\n jMessage(6, function(){\n window.location = window.location\n });\n }\n else{\n jMessage(7, function(){\n $('#trans_title').focus();\n });\n }\n },\n });\n }\n else{\n validateModule.focusFirstError();\n }\n }\n catch(e){\n alert('updateCourseTrans: ' + e.message);\n }\n}", "title": "" }, { "docid": "4011222a54a255c9ac6860eeaad5eb14", "score": "0.6267732", "text": "function submitData() {\n $(\"button\").click(function(event) {\n if (hasTyped) {\n end = new Date();\n interval = (end - begin) / 1000;\n req.eventType = \"timeTaken\";\n req.interval = interval;\n hasTyped = false;\n sendData('submit');\n }\n });\n}", "title": "" }, { "docid": "038429f6901ccf242bef08faff663442", "score": "0.62626064", "text": "function submittingStuff()\n{\n\tif (gup('assignmentId') == \"ASSIGNMENT_ID_NOT_AVAILABLE\")\n\t{\n\t\t// If we're previewing, disable the button and give it a helpful message\n\t\tdocument.getElementById('submitButton').disabled = true;\n\t\tdocument.getElementById('submitButton').value = \"You must ACCEPT the HIT before you can submit the results.\";\n\t} \n\t\n\telse if (!occupied)\n\t{\n\t\t// If we're previewing, disable the button and give it a helpful message\n\t\tdocument.getElementById('submitButton').disabled = true;\n\t\tdocument.getElementById('submitButton').value = \"occupy one of the blue squares to submit and recieve payment.\";\n\t}else {\n\t\tvar form = document.getElementById('mturk_form');\n\t\tif (document.referrer && ( document.referrer.indexOf('workersandbox') != -1) ) {\n\t\t\tform.action = \"https://workersandbox.mturk.com/mturk/externalSubmit\";\n\t\t}\n\t\tdocument.getElementById('submitButton').disabled = false;\n\t\tdocument.getElementById('submitButton').value = \"You completed the Task! click here to finish and recieve payment.\";\n\t\t//alert(\"You completed the task! Clock the bottom button to recieve payment\");\n\t}\n}", "title": "" }, { "docid": "06f1680b7274b01539fc162f8fcb72bf", "score": "0.6261849", "text": "function submitCurrent() {\n getCurrentUrl(function (url) {\n popularityContest.submit(url)\n .done(function () {\n notify('Successfully Submitted Link', url);\n })\n .fail(function () {\n notify('Sorry, your link was not submitted.', url);\n });\n });\n }", "title": "" }, { "docid": "8a844bb8952e3135dd359db25ab9e4d9", "score": "0.6261247", "text": "submit() {\n if (this.validateSubmit()) {\n if (this.mode === 'register') {\n this.__store();\n }else if(this.mode === 'updating'){\n this.__update();\n }\n }\n }", "title": "" }, { "docid": "be713159105aa3d6f032bd91556df713", "score": "0.6256123", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (!method) {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (a != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\ttimeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n\t\t\t}\n\t\t\t\n\t\t\t// look for server aborts\n\t\t\tfunction checkState() {\n\t\t\t\ttry {\n\t\t\t\t\tvar state = getDoc(io).readyState;\n\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\tif (state.toLowerCase() == 'uninitialized')\n\t\t\t\t\t\tsetTimeout(checkState,50);\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\tlog('Server abort: ' , e, ' (', e.name, ')');\n\t\t\t\t\tcb(SERVER_ABORT);\n\t\t\t\t\ttimeoutHandle && clearTimeout(timeoutHandle);\n\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" />').attr('value',s.extraData[n])\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!s.iframeTarget) {\n\t\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t\t$io.appendTo('body');\n\t io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n\t\t\t\t}\n\t\t\t\tsetTimeout(checkState,15);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "67d6199a6d115ff5185b9de188184250", "score": "0.62553024", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (!method) {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (a != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\ttimeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n\t\t\t}\n\n\t\t\t// look for server aborts\n\t\t\tfunction checkState() {\n\t\t\t\ttry {\n\t\t\t\t\tvar state = getDoc(io).readyState;\n\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\tif (state.toLowerCase() == 'uninitialized')\n\t\t\t\t\t\tsetTimeout(checkState,50);\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\tlog('Server abort: ' , e, ' (', e.name, ')');\n\t\t\t\t\tcb(SERVER_ABORT);\n\t\t\t\t\ttimeoutHandle && clearTimeout(timeoutHandle);\n\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" />').attr('value',s.extraData[n])\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!s.iframeTarget) {\n\t\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t\t$io.appendTo('body');\n\t io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n\t\t\t\t}\n\t\t\t\tsetTimeout(checkState,15);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cbf63af0d5288eabb8282779dbb5ce2a", "score": "0.6250952", "text": "function onNewSubmit()\n{\n var form = document.getElementsByTagName(\"form\")[0];\n if(checkForm(form))\n {\n attachStatus(form, \"Waiting for Supervisor Approval\");\n form.submit();\n }\n}", "title": "" }, { "docid": "96f94a3d38bdac9e0ad5b1ebc72f6061", "score": "0.62471515", "text": "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (!method) {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (a != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\ttimeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n\t\t\t}\n\t\t\t\n\t\t\t// look for server aborts\n\t\t\tfunction checkState() {\n\t\t\t\ttry {\n\t\t\t\t\tvar state = getDoc(io).readyState;\n\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\tif (state.toLowerCase() == 'uninitialized')\n\t\t\t\t\t\tsetTimeout(checkState,50);\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\tlog('Server abort: ' , e, ' (', e.name, ')');\n\t\t\t\t\tcb(SERVER_ABORT);\n\t\t\t\t\ttimeoutHandle && clearTimeout(timeoutHandle);\n\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\">').attr('value',s.extraData[n])\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!s.iframeTarget) {\n\t\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t\t$io.appendTo('body');\n\t\t\t\t\tio.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n\t\t\t\t}\n\t\t\t\tsetTimeout(checkState,15);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "title": "" } ]
3ef20c827ffedb44bf6ecdcc714afe9c
Sets the request headers.
[ { "docid": "d12140123b2b2184f9b79ce6658e6d1e", "score": "0.72249836", "text": "function setHeaders(headers) {\n if (headers == null) return this;\n return {__proto__: this, _headers: headers};\n }", "title": "" } ]
[ { "docid": "216f4685264c53984fc0cb8366a3eb39", "score": "0.80943346", "text": "set headers(val) {\n\t\tthis.req.headers = val;\n\t}", "title": "" }, { "docid": "714c3f03388de35527cbadddb9af3e2c", "score": "0.8005784", "text": "set headers(val) {\n this.req.headers = val;\n }", "title": "" }, { "docid": "00ef6e0421b8d76f51d97cec5f6e5a90", "score": "0.7811706", "text": "function setHeaders() {\r\n const defaults = {\r\n Accept:\r\n \"text/javascript, application/json, text/html, application/xml, text/xml, */*\",\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n };\r\n\r\n /**\r\n * Merge headers with defaults.\r\n */\r\n for (var name in defaults) {\r\n if (!options.headers.hasOwnProperty(name))\r\n options.headers[name] = defaults[name];\r\n }\r\n\r\n for (var name in options.headers) {\r\n request.setRequestHeader(name, options.headers[name]);\r\n }\r\n }", "title": "" }, { "docid": "432cca31c7ffd842359fb05cc6eb6361", "score": "0.7592746", "text": "_setRequestHeaders() {\n var transport = this._transport,\n requestHeaders = this._getAllRequestHeaders();\n\n for (var key in requestHeaders) {\n transport.setRequestHeader(key, requestHeaders[key]);\n }\n }", "title": "" }, { "docid": "39722b5f9dae344d8600c16279bbd4b2", "score": "0.7124947", "text": "function setHeaderRequest(){\n return { headers: { 'Content-Type': 'application/json; charset=utf-8' }}\n }", "title": "" }, { "docid": "1f110867dd8ff3fd507dacff54af4ac9", "score": "0.7115805", "text": "set headers(value) {}", "title": "" }, { "docid": "2cb503f61a6a01a584c158e53bcb4c2a", "score": "0.7104275", "text": "resetRequestHeaders() {\n headers = Object.assign({}, this.options.defaultHeaders);\n }", "title": "" }, { "docid": "99547f16e1a04673c205e9c2675c5435", "score": "0.7050619", "text": "function setHeader(pair) {\n\t\t\t\treq.setRequestHeader(pair._0, pair._1);\n\t\t\t}", "title": "" }, { "docid": "7c1e641ff96e35506f8eaa039c073005", "score": "0.69787824", "text": "setHeaders(key,value) {\n this.headers.set(key,value);\n\n return this;\n }", "title": "" }, { "docid": "9da520d4acbda2a70d6612cf59c34672", "score": "0.69359875", "text": "function setStandardHeaders(req, callerId) {\n req.setRequestHeader(\"Accept\", \"application/json\");\n req.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\");\n req.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\n req.setRequestHeader(\"OData-Version\", \"4.0\");\n if (callerId) {\n req.setRequestHeader(\"MSCRMCallerID\", callerId);\n }\n\n }", "title": "" }, { "docid": "869093cf87364217ec72e40f9cf311ed", "score": "0.6921957", "text": "modifyHeadersForRequest(headers, authToken, appCheckToken) {\r\n\t headers['X-Goog-Api-Client'] = getGoogApiClientValue();\r\n\t // Content-Type: text/plain will avoid preflight requests which might\r\n\t // mess with CORS and redirects by proxies. If we add custom headers\r\n\t // we will need to change this code to potentially use the $httpOverwrite\r\n\t // parameter supported by ESF to avoid triggering preflight requests.\r\n\t headers['Content-Type'] = 'text/plain';\r\n\t if (this.databaseInfo.appId) {\r\n\t headers['X-Firebase-GMPID'] = this.databaseInfo.appId;\r\n\t }\r\n\t if (authToken) {\r\n\t authToken.headers.forEach((value, key) => (headers[key] = value));\r\n\t }\r\n\t if (appCheckToken) {\r\n\t appCheckToken.headers.forEach((value, key) => (headers[key] = value));\r\n\t }\r\n\t }", "title": "" }, { "docid": "7b73b493a6dccecef3a75d17eb00b7e3", "score": "0.6903065", "text": "function setHeaderRequest(){\r\n return { headers: { 'Content-Type': 'application/json; charset=utf-8' }}\r\n}", "title": "" }, { "docid": "7b73b493a6dccecef3a75d17eb00b7e3", "score": "0.6903065", "text": "function setHeaderRequest(){\r\n return { headers: { 'Content-Type': 'application/json; charset=utf-8' }}\r\n}", "title": "" }, { "docid": "30183ed1467087245e40d237e9320e46", "score": "0.68922585", "text": "function setHeaders () {\n if (!options.headers) {\n options.headers = {};\n }\n\n if (options.bugReport) {\n options.headers[ 'Report-Msgid-Bugs-To' ] = options.bugReport;\n }\n\n if (options.lastTranslator) {\n options.headers[ 'Last-Translator' ] = options.lastTranslator;\n }\n\n if (options.team) {\n options.headers[ 'Language-Team' ] = options.team;\n }\n\n if (options.defaultHeaders && !options.headers.hasOwnProperty('X-Poedit-KeywordsList')) {\n options.headers[ 'X-Poedit-KeywordsList' ] = options.gettextFunctions.map(function (obj) {\n let keyword = obj.name;\n\n if (obj.plural || obj.context) {\n keyword += ':1';\n }\n if (obj.plural) {\n keyword += `,${obj.plural}`;\n }\n if (obj.context) {\n keyword += `,${obj.context}c`;\n }\n\n return keyword;\n }).join(';');\n }\n}", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "07ba97833386e523518b172ef4003da5", "score": "0.68559974", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }", "title": "" }, { "docid": "5d97bbf3066c747dd0d6c4e17adab934", "score": "0.6839876", "text": "setHeader(key, value) {\n key = key.toLocaleLowerCase();\n this.headers[key] = value;\n if (this.request) {\n this.request.setHeader(key, value);\n }\n }", "title": "" }, { "docid": "467b52f376f02deffd0b5079bb965d1e", "score": "0.6828142", "text": "_cleanRequestHeaders() {\n if (this.options.resetHeaders) {\n headers = Object.assign({}, this.options.defaultHeaders);\n }\n }", "title": "" }, { "docid": "248432485740e604de043e3cea7a1f4c", "score": "0.68100566", "text": "withHeaders(headers) {\n Object.assign(this.headers, headers);\n return this;\n }", "title": "" }, { "docid": "e7de9b66cf99a9d4db7e55ee12f403ee", "score": "0.6740452", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n options.headers['X-TFS-FedAuthRedirect'] = 'Suppress';\n }", "title": "" }, { "docid": "5d46a79d44fbe36bd6eae5f55ffeced4", "score": "0.6729649", "text": "addUserAgentHeader(request) {\n if (!request.headers) {\n request.headers = new HttpHeaders();\n }\n if (!request.headers.get(this.headerKey) && this.headerValue) {\n request.headers.set(this.headerKey, this.headerValue);\n }\n }", "title": "" }, { "docid": "5d46a79d44fbe36bd6eae5f55ffeced4", "score": "0.6729649", "text": "addUserAgentHeader(request) {\n if (!request.headers) {\n request.headers = new HttpHeaders();\n }\n if (!request.headers.get(this.headerKey) && this.headerValue) {\n request.headers.set(this.headerKey, this.headerValue);\n }\n }", "title": "" }, { "docid": "f0c5e8770f1c52ef73a8a8b7fd1c4b99", "score": "0.66986644", "text": "function resetHeaders() {\n if(_.size(headers) > 0 && (!$.ajaxSettings.headers || _.size($.ajaxSettings.headers) == 0)) {\n $.ajaxSettings.headers = headers;\n }\n }", "title": "" }, { "docid": "9196c4e5e3f469830277284cf6dea971", "score": "0.6661736", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }", "title": "" }, { "docid": "7e20ab103c352f9f33f52bac69ffd2e5", "score": "0.6607962", "text": "setHttpHeaders(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec);\n }", "title": "" }, { "docid": "43aed4efb7d77387aff421d866757501", "score": "0.6521172", "text": "function bindHeaders(xhrFromBeforeSend) {\n\n\t\tvar currentScope = CorrelatorSharp.currentScope;\n\t\tvar statics = CorrelatorSharp.Statics;\n\n\t\tif (!currentScope)\n \t\tthrow new Error('Activity Scope is not supported.');\n\n xhrFromBeforeSend.setRequestHeader(statics.CORRELATION_ID_HEADER], currentScope.id.value);\n xhrFromBeforeSend.setRequestHeader(statics.CORRELATION_ID_STARTED_HEADER], currentScope.id.time.toISOString());\n xhrFromBeforeSend.setRequestHeader(statics.CORRELATION_ID_NAME_HEADER], currentScope.name); \n\n if (currentScope.parent)\n \txhrFromBeforeSend.setRequestHeader(statics.CORRELATION_ID_PARENT_HEADER], currentScope.parent);\n\t}", "title": "" }, { "docid": "b72479ad0abb0976b51c351ebf4527d0", "score": "0.64381164", "text": "setHeader(name, value) {\n this.apiHeaders[name] = value;\n return this;\n }", "title": "" }, { "docid": "593bf683071a6b4e817953593fc1abba", "score": "0.6425997", "text": "getRequestHeaders() {}", "title": "" }, { "docid": "67b2399c49b5c0dd10f63e613cd6b793", "score": "0.642345", "text": "Headers() {\n debug('Initializing : Content Headers ...');\n\n this.app.use(\n helmet({\n noCache: true,\n referrerPolicy: true\n })\n );\n\n this.app.use(cors());\n\n this.app.set('view engine', 'ejs');\n this.app.use(methodOverride('X-HTTP-Method')); // Microsoft\n this.app.use(methodOverride('X-HTTP-Method-Override')); // Google/GData\n this.app.use(methodOverride('X-Method-Override')); // IBM\n this.app.use(bodyParser.json());\n this.app.use(\n bodyParser.urlencoded({\n extended: true\n })\n );\n }", "title": "" }, { "docid": "4588fc846c9e47255a60fbbaa055b260", "score": "0.6416986", "text": "function header_modifier (info) {\n // Replace the User-Agent header\n console.log(\"Changing headers before request!\")\n var headers = info.requestHeaders;\n headers.forEach(function (header, i) {\n if (header.name.toLowerCase() == 'user-agent') {\n header.value = userAgent;\n }\n });\n return {requestHeaders: headers};\n }", "title": "" }, { "docid": "032a1ed25e4db7c0c41f0880bfaa1f4f", "score": "0.6411655", "text": "function initHeaders(res) {\n\tres.set({\n\t\t\"Access-Control-Allow-Origin\":\"*\",\n\t\t\"Access-Control-Allow-Headers\":\"Content-Type\"\n\t});\n}", "title": "" }, { "docid": "dfb541f619e6b82a183e727f539dece3", "score": "0.6362577", "text": "setHTTPHeaders(response) {\n\t\tresponse.setHeader('Content-Language', 'en-CA');//Canadian English\n\t\tresponse.setHeader('Cross-Origin-Resource-Policy', 'same-site');//Allow requests from the same site\n\t\tresponse.setHeader('Content-Security-Policy', `default-src 'self'; object-src 'none'; child-src 'self'`);//Dont allow resources from outside of the site to load, no plugins at all should load\n\t\tresponse.setHeader('X-Content-Type-Options', 'nosniff');\n\t\tresponse.setHeader('X-Frame-Options', 'DENY');//Disallow embedding of general requests in frames\n\t}", "title": "" }, { "docid": "563d5a3a51fd9880c4556793a09f834c", "score": "0.630044", "text": "setHeader(fetchParams = {}, headerName, value) {\n if (!fetchParams.headers) fetchParams.headers = {};\n if (fetchParams.headers.set) {\n fetchParams.headers.set(headerName, value);\n }\n else {\n fetchParams.headers[headerName] = value;\n }\n return fetchParams;\n }", "title": "" }, { "docid": "a518e81a95e85cbd6c06e870e01b3aa1", "score": "0.627975", "text": "async setHTTPHeaders(blobHTTPHeaders, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-setHTTPHeaders\", options);\n options.conditions = options.conditions || {};\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blobContext.setHttpHeaders(Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "title": "" }, { "docid": "6fabb0498670a004180660a5f534a3d9", "score": "0.6276509", "text": "setRequestHeader(string, string) {\n\n }", "title": "" }, { "docid": "87f0584465f82375336924be4e1487dd", "score": "0.62680423", "text": "requestHeaders() {\n return {\n \"Accept\": HTTPHeaderContentType.json,\n \"Content-Type\": HTTPHeaderContentType.json,\n }\n }", "title": "" }, { "docid": "7acb335a7af1d65b8e4ae67120916a96", "score": "0.6243207", "text": "function setHeaders(kgsResponse, res) {\n HEADERS.forEach(header => {\n if (header in kgsResponse.headers) {\n const newHeader = kgsResponse.headers[header];\n\n if (header === \"set-cookie\") {\n newHeader[0] = `${newHeader[0].replace(\n \"Path=/json-cors\",\n \"Path=/api/json-cors\"\n )}; SameSite=Strict`;\n }\n\n res.setHeader(header, newHeader);\n }\n });\n}", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "0fd9c1bda2d3f50dd78ebb00216bad00", "score": "0.6213131", "text": "prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }", "title": "" }, { "docid": "56d91cf43be524d3f57750d587c69ba0", "score": "0.61541", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Basic ' + new Buffer('PAT:' + this.token).toString('base64');\n options.headers['X-TFS-FedAuthRedirect'] = 'Suppress';\n }", "title": "" }, { "docid": "ccd4d3f6bf4ed0c8e27bd2281601acbb", "score": "0.6153967", "text": "function setHeader(xhr) {\n var bearertoken = getCookie(token);\n if (bearertoken) {\n var bearerHeader = 'Bearer ' + bearertoken;\n xhr.setRequestHeader('Authorization', bearerHeader);\n }\n}", "title": "" }, { "docid": "9cf14501f843a892609f9552723ee91f", "score": "0.6142183", "text": "withHeader(key, value) {\n this.headers[key] = value;\n return this;\n }", "title": "" }, { "docid": "b320a0b88a524ffc7900237b29f40997", "score": "0.61265665", "text": "preProcessHeaders() {\n this.headersRaw.forEach(function(header) {\n this.headers[header.name.toLowerCase()] = header.value;\n }, this);\n\n if ('x-fstrz' in this.headers) {\n this.processXFstrzHeader();\n }\n\n if (this.details.statusCode > 500) {\n this.inError = true;\n }\n }", "title": "" }, { "docid": "a7435a872938c35a434f71473984cfb2", "score": "0.61254716", "text": "willSendRequest(request) {\n request.headers.set('Authorization', `Bearer ${this.context.token}`);\n }", "title": "" }, { "docid": "a7435a872938c35a434f71473984cfb2", "score": "0.61254716", "text": "willSendRequest(request) {\n request.headers.set('Authorization', `Bearer ${this.context.token}`);\n }", "title": "" }, { "docid": "73de64242a2959fd96e8cceeac34f7a9", "score": "0.60989994", "text": "set allowedHeaderNames(allowedHeaderNames) {\n this.sanitizer.allowedHeaderNames = allowedHeaderNames;\n }", "title": "" }, { "docid": "73de64242a2959fd96e8cceeac34f7a9", "score": "0.60989994", "text": "set allowedHeaderNames(allowedHeaderNames) {\n this.sanitizer.allowedHeaderNames = allowedHeaderNames;\n }", "title": "" }, { "docid": "798aabba7b73c6b7f50d00e9d97210ec", "score": "0.60957336", "text": "function setHeader(headers, name, value) {\n var realHeaderName = lookupCaseInsensitive(headers, name);\n setHeaderInternal(headers, realHeaderName, name, value);\n}", "title": "" }, { "docid": "bc24fb0e3c821eb8a50f59834c115c8e", "score": "0.6091581", "text": "function setBasicHeaders() {\n return function headerMidware(req, res, next) {\n res.header('Access-Control-Allow-Headers',\n 'Origin, X-Requested-With, Content-Type, Accept');\n res.header('cache-control', 'max-age=0');\n next();\n };\n}", "title": "" }, { "docid": "af67382a5a047f4892a4047d24d9f739", "score": "0.6032197", "text": "setRegisterExtraHeaders(extraHeaders) {\n this.registerExtraHeaders = extraHeaders;\n if (this.jssipUA) {\n let headers = extraHeaders !== null ? extraHeaders : [];\n if (this.oauthToken !== null) {\n headers = headers.slice();\n headers.push('Authorization: Bearer ' + this.oauthToken);\n }\n this.jssipUA.registrator().setExtraHeaders(headers);\n }\n }", "title": "" }, { "docid": "f2a13e8b6c35022561562edb6076341a", "score": "0.60048306", "text": "function setGlobalHeaders(key, value) {\n globalHeaders = {\n ...globalHeaders,\n [key]: value\n };\n }", "title": "" }, { "docid": "60b2e5c70b980b6f361feb39d20c7426", "score": "0.5988115", "text": "prepareRequest(options) {\n options.headers['Authorization'] = 'Basic ' + new Buffer(this.username + ':' + this.password).toString('base64');\n options.headers['X-TFS-FedAuthRedirect'] = 'Suppress';\n }", "title": "" }, { "docid": "7093f9703c08a15339070e8192bb5bbc", "score": "0.5954121", "text": "newHeaders(headers) { return new Headers(headers); }", "title": "" }, { "docid": "997cd6e4580afcc7a7369eeb2e26d618", "score": "0.5951578", "text": "function Headers(headers) {\n var _this = this;\n /**\n * \\@internal header names are lower case\n */\n this._headers = new Map();\n /**\n * \\@internal map lower case names to actual names\n */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "997cd6e4580afcc7a7369eeb2e26d618", "score": "0.5951578", "text": "function Headers(headers) {\n var _this = this;\n /**\n * \\@internal header names are lower case\n */\n this._headers = new Map();\n /**\n * \\@internal map lower case names to actual names\n */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "997cd6e4580afcc7a7369eeb2e26d618", "score": "0.5951578", "text": "function Headers(headers) {\n var _this = this;\n /**\n * \\@internal header names are lower case\n */\n this._headers = new Map();\n /**\n * \\@internal map lower case names to actual names\n */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "997cd6e4580afcc7a7369eeb2e26d618", "score": "0.5951578", "text": "function Headers(headers) {\n var _this = this;\n /**\n * \\@internal header names are lower case\n */\n this._headers = new Map();\n /**\n * \\@internal map lower case names to actual names\n */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "997cd6e4580afcc7a7369eeb2e26d618", "score": "0.5951578", "text": "function Headers(headers) {\n var _this = this;\n /**\n * \\@internal header names are lower case\n */\n this._headers = new Map();\n /**\n * \\@internal map lower case names to actual names\n */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "997cd6e4580afcc7a7369eeb2e26d618", "score": "0.5951578", "text": "function Headers(headers) {\n var _this = this;\n /**\n * \\@internal header names are lower case\n */\n this._headers = new Map();\n /**\n * \\@internal map lower case names to actual names\n */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var /** @type {?} */ values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "95b7cb3dfd27610cd49ba89606a1759c", "score": "0.5949589", "text": "setHeader() {\n Vue.axios.defaults.headers.common[\n \"Authorization\"\n ] = `Bearer ${JwtService.getToken()}`;\n\n Vue.axios.defaults.headers.common[\n \"Accept-Language\"\n ] = i18nService.getActiveLanguage();\n }", "title": "" }, { "docid": "f0e9a2a5f1b1487244af8df4ef9745bb", "score": "0.5915306", "text": "function Headers(init) {\n this._guard = 'none';\n this._headerList = [];\n if (init) fill(this, init);\n }", "title": "" }, { "docid": "f0e9a2a5f1b1487244af8df4ef9745bb", "score": "0.5915306", "text": "function Headers(init) {\n this._guard = 'none';\n this._headerList = [];\n if (init) fill(this, init);\n }", "title": "" }, { "docid": "b35c12735f50cc5e9259f62db533c795", "score": "0.59152895", "text": "set(headerName, headerValue) {\n this._headersMap[getHeaderKey(headerName)] = {\n name: headerName,\n value: headerValue.toString(),\n };\n }", "title": "" }, { "docid": "2be9a24d0f0f3030874b2dec0ddb53c3", "score": "0.590116", "text": "function addAuthRocketHeaders(req) {\n\tlet newReq = req;\n\tif (!config.accountId || !config.apiKey || !config.realmId) {\n\t\tlogger.error({description: 'AccountId, apiKey, and realmId are required.', func: 'addAuthRocketHeaders'});\n\t\treturn req;\n\t}\n let headers = {\n 'X-Authrocket-Account': config.accountId,\n 'X-Authrocket-Api-Key': config.apiKey,\n 'X-Authrocket-Realm': config.realmId,\n // 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n // 'User-agent': 'https://github.com/prescottprue/authrocket' //To provide AuthRocket a contact\n };\n\tlogger.log({description: 'addAuthRocketHeaders called.', config: config});\n\t//Add each header to the request\n\teach(keys(headers), (key) => {\n\t\tnewReq = addHeaderToReq(req, key, headers[key]);\n\t});\n\tlogger.log({description: 'addAuthRocketHeaders request created.', func: 'addAuthRocketHeaders'});\n\treturn newReq;\n}", "title": "" }, { "docid": "7f3db24b681aae1aa7fa63d42b2da0e2", "score": "0.58992916", "text": "function HttpHeaders(headers) {\n var _this391 = this;\n\n _classCallCheck(this, HttpHeaders);\n\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n this.normalizedNames = new Map();\n /**\n * Queued updates to be materialized the next initialization.\n */\n\n this.lazyUpdate = null;\n\n if (!headers) {\n this.headers = new Map();\n } else if (typeof headers === 'string') {\n this.lazyInit = function () {\n _this391.headers = new Map();\n headers.split('\\n').forEach(function (line) {\n var index = line.indexOf(':');\n\n if (index > 0) {\n var name = line.slice(0, index);\n var key = name.toLowerCase();\n var value = line.slice(index + 1).trim();\n\n _this391.maybeSetNormalizedName(name, key);\n\n if (_this391.headers.has(key)) {\n _this391.headers.get(key).push(value);\n } else {\n _this391.headers.set(key, [value]);\n }\n }\n });\n };\n } else {\n this.lazyInit = function () {\n _this391.headers = new Map();\n Object.keys(headers).forEach(function (name) {\n var values = headers[name];\n var key = name.toLowerCase();\n\n if (typeof values === 'string') {\n values = [values];\n }\n\n if (values.length > 0) {\n _this391.headers.set(key, values);\n\n _this391.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }", "title": "" }, { "docid": "41326f2eeafd87b88585de2275410d5e", "score": "0.5894844", "text": "function setHeaders(res, path) {\n \n\t res.setHeader(\"Access-Control-Allow-Credentials\", true);\n\t res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n\t res.setHeader(\"Cache-Control\", \"no-cache\");\n\t res.setHeader(\"Content-Type\", \"application/json; charset=utf-8\");\n}", "title": "" }, { "docid": "68a90bcb035bb175c988a365fa680d4d", "score": "0.5886103", "text": "function generateRequestHeaders(token_object) {\n var headers = {'User-Agent': user_agent, 'Content-Type' : 'application/json'};\n\n if (token_object && token_object.access_token && token_object.token_type)\n headers['Authorization'] = token_object.token_type + \" \" + token_object.access_token;\n\n return headers;\n }", "title": "" }, { "docid": "bec861e9224b7ea6180a7da4bf5b2db8", "score": "0.58771825", "text": "function setupAjaxHeaders()\n {\n var csrf = $('meta[name=\"csrf_token\"]').attr('content');\n\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': csrf\n }\n });\n\n app.factory('httpRequestInterceptor', function(){\n return {request: function(config) {\n config.headers['X-CSRF-TOKEN'] = csrf;\n return config;\n }}\n });\n app.config(function($httpProvider) {\n $httpProvider.interceptors.push('httpRequestInterceptor');\n });\n }", "title": "" }, { "docid": "62bb62b6ee31575d656976a0b665c168", "score": "0.58680224", "text": "headers() {\n return this._request.headers;\n }", "title": "" }, { "docid": "7f2246c2c8c78efdcbb744d80bf3fd5f", "score": "0.58613765", "text": "createHeaders() {\n return this.authToken ? {\n ...this.headers,\n 'Authorization': 'Bearer ' + this.authToken\n } : this.headers;\n }", "title": "" }, { "docid": "4d4a540f59d099c39c38bcf44feb5228", "score": "0.585094", "text": "getHeaders() {\n return {\n 'Content-Type': 'application/json',\n 'X-CC-Api-Key': this.api_key,\n 'X-CC-Version': this.api_version,\n };\n }", "title": "" }, { "docid": "ec94bd08f73b01efe14f3cd7b8fcb1d0", "score": "0.5828798", "text": "async addAuthHeader(headers) {\n const user = this.user || await this.getCurrentUser() // this.user is null on initial req\n const expiry = user ? user.token_expires : 0\n const jwt = user ? user.token : false\n\n if (jwt && expiry * 1000 > Date.now()) {\n headers['Authorization'] = `Bearer ${jwt}`\n }\n\n return headers\n }", "title": "" }, { "docid": "5a3aacfeb93869dd75a867acf932de8b", "score": "0.58260345", "text": "setHeaders() {\n let cookie = JSON.parse(Cookies.get('user'));\n $.ajaxSetup({\n headers: {\n 'Access-Token': cookie.user.auth_token\n }\n })\n // OLD VERSION - Not working\n // let user = Cookies.get('user');\n // // console.log(user);\n // if (user) {\n // let auth = JSON.parse(user).user.access_token;\n // // console.log(auth);\n // $.ajaxSetup({\n // headers: {\n // 'Access-Token': auth\n // }\n // });\n // } else {\n // this.goto('');\n // }\n }", "title": "" }, { "docid": "308ecc707a3bd77fa5aa7af411430c0c", "score": "0.58167416", "text": "getHeaders() {\n return {\"X-Requested-By\": \"ambari\"};\n }", "title": "" }, { "docid": "961a66f654faab0ca20d232f08c298cc", "score": "0.5816148", "text": "function prepareRequest(request) {\r\n return Object.assign(Object.assign({}, request), { headers: request.headers.all() });\r\n}", "title": "" }, { "docid": "882c3c9654d14fbccffdde8b2bfa9462", "score": "0.5793649", "text": "function beforeRequestSend(config) {\n config.headers = config.headers || {};\n // retreive token value from local storage\n // if token is not null or empry, then set the token into htth header 'Authorization'\n if ($window.localStorage.getItem(metsys.LOCAL_STORAGE_TOKEN_KEY) && $window.localStorage.getItem(metsys.LOCAL_STORAGE_TOKEN_KEY) !== '') {\n // set the token value into the authorization header\n config.headers.Authorization = 'Bearer ' + $window.localStorage.getItem(metsys.LOCAL_STORAGE_TOKEN_KEY);\n }\n config.headers.Authorization = 'Bearer';\n // return config object\n return config;\n }", "title": "" }, { "docid": "a6b9753209775ed1fa3c879a714b1f3e", "score": "0.5779967", "text": "clearDefaultHeaders() {\n this._defaultHeaders = {};\n }", "title": "" }, { "docid": "3afb134721feee76116f8d1cc5238f25", "score": "0.5758174", "text": "function Headers(headers) {\n var _this = this;\n /** @internal header names are lower case */\n this._headers = new Map();\n /** @internal map lower case names to actual names */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers._headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "3f2f3019796cfe93f311ae45dd1d8791", "score": "0.57505643", "text": "function HttpHeaders(headers) {\n var _this = this;\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n this.normalizedNames = new Map();\n /**\n * Queued updates to be materialized the next initialization.\n */\n this.lazyUpdate = null;\n if (!headers) {\n this.headers = new Map();\n }\n else if (typeof headers === 'string') {\n this.lazyInit = function () {\n _this.headers = new Map();\n headers.split('\\n').forEach(function (line) {\n var index = line.indexOf(':');\n if (index > 0) {\n var name_1 = line.slice(0, index);\n var key = name_1.toLowerCase();\n var value = line.slice(index + 1).trim();\n _this.maybeSetNormalizedName(name_1, key);\n if (_this.headers.has(key)) {\n _this.headers.get(key).push(value);\n }\n else {\n _this.headers.set(key, [value]);\n }\n }\n });\n };\n }\n else {\n this.lazyInit = function () {\n _this.headers = new Map();\n Object.keys(headers).forEach(function (name) {\n var values = headers[name];\n var key = name.toLowerCase();\n if (typeof values === 'string') {\n values = [values];\n }\n if (values.length > 0) {\n _this.headers.set(key, values);\n _this.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }", "title": "" }, { "docid": "ae07196e032bf368fd36d8c9439eba32", "score": "0.5743973", "text": "function setJwt(jwt) {\n\t// Tell axios to append this header to all http requests\n\taxios.defaults.headers.common['x-auth-token']\t= jwt;\n}", "title": "" }, { "docid": "c5eb09da53f1ca59e3db36ccbe0b87cc", "score": "0.5725355", "text": "function addHeaders(res, document) {\n\t\tvar allow = 'GET,HEAD,DELETE,OPTIONS';\n\t\tif (isContainer(document)) {\n\t\t\tres.links({\n\t\t\t\ttype: document.interactionModel\n\t\t\t});\n\t\t\tallow += ',POST';\n\t\t\tres.set('Accept-Post', media.turtle + ',' + media.jsonld + ',' + media.json);\n\t\t} else {\n\t\t\tallow += ',PUT';\n\t\t}\n\n\t\tres.set('Allow', allow);\n\t}", "title": "" }, { "docid": "60823a99da9dfb4ecaee68c1a36f2f2a", "score": "0.57163936", "text": "function setHawkHeaders(res, sessionToken) {\n res.setHeader('Hawk-Session-Token', sessionToken);\n res.setHeader('Access-Control-Expose-Headers', 'Hawk-Session-Token');\n}", "title": "" }, { "docid": "15df7d1399b641a1f5c89eb65414dd65", "score": "0.57091266", "text": "function update_2_3_0() {\n\t\tfunction updateHeaders(headerKeys, headerPrefix) {\n\t\t\tconsole.log(headerKeys);\n\n\t\t\tfor (var i = 0; i < headerKeys.length; i++) {\n\t\t\t\tvar headerKey = headerPrefix + headerKeys[i];\n\t\t\t\tvar header = JSON.parse(localStorage.getItem(headerKey));\n\n\t\t\t\tconsole.log(headerPrefix, headerKey);\n\n\t\t\t\t// Create the new header field if one does not exist\n\t\t\t\theader.pattern = header.pattern || \".*\";\n\n\t\t\t\tlocalStorage.setItem(headerKey, JSON.stringify(header));\n\t\t\t}\n\t\t}\n\n\t\tvar requestHeaders = localStorage.getItem(\"backbone.requestHeaders\");\n\t\tvar responseHeaders = localStorage.getItem(\"backbone.requestHeaders\");\n\n\t\tif (!!requestHeaders) {\n\t\t\tupdateHeaders(requestHeaders.split(\",\"), \"backbone.requestHeaders-\");\n\t\t}\n\n\t\tif (!!responseHeaders) {\n\t\t\tupdateHeaders(responseHeaders.split(\",\"), \"backbone.responseHeaders-\");\n\t\t}\n\t}", "title": "" }, { "docid": "6fb80d693ffbf0cc490467196959a4f2", "score": "0.5701742", "text": "function Headers(headers) {\n var _this = this;\n /** @internal header names are lower case */\n this._headers = new Map();\n /** @internal map lower case names to actual names */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "6fb80d693ffbf0cc490467196959a4f2", "score": "0.5701742", "text": "function Headers(headers) {\n var _this = this;\n /** @internal header names are lower case */\n this._headers = new Map();\n /** @internal map lower case names to actual names */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" }, { "docid": "6fb80d693ffbf0cc490467196959a4f2", "score": "0.5701742", "text": "function Headers(headers) {\n var _this = this;\n /** @internal header names are lower case */\n this._headers = new Map();\n /** @internal map lower case names to actual names */\n this._normalizedNames = new Map();\n if (!headers) {\n return;\n }\n if (headers instanceof Headers) {\n headers.forEach(function (values, name) {\n values.forEach(function (value) { return _this.append(name, value); });\n });\n return;\n }\n Object.keys(headers).forEach(function (name) {\n var values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];\n _this.delete(name);\n values.forEach(function (value) { return _this.append(name, value); });\n });\n }", "title": "" } ]
645b934a5a6e791a852e6d01e8c7e6ca
Case reducer Move widget in different order
[ { "docid": "f28dcb8a7485febb037db3319bda9d9f", "score": "0.60756487", "text": "function moveWidget(widgetState, action) {\n const from = widgetState.findIndex(widget => {\n return widget.id == action.from;\n });\n const to = widgetState.findIndex(widget => {\n return widget.id == action.to;\n });\n\n return swapIndices(widgetState, from, to);\n}", "title": "" } ]
[ { "docid": "0815c7d3b5d06b668218d9001ca24915", "score": "0.65510875", "text": "_handleMoveItem(e) {\n this.activeItem = e.detail.item;\n this.moveItem(e.detail.item, e.detail.moveUp, e.detail.byGroup);\n }", "title": "" }, { "docid": "d4cf599305e619114a5f61e5fba0cca8", "score": "0.61460507", "text": "function action() {\n let me = unites[0],\n others = unites.filter(x => x.id != me.id),\n target = Nearest(others, me, \"EXPLORER\") || me,\n ennemie = Nearest(others, me, \"WANDERER\"),\n action = ('MOVE ' + target.x + \" \" + target.y);\n if (distance(me, ennemie) <= 1) {\n let oppY = parseInt(me.x - ennemie.x),\n oppX = parseInt(me.y - ennemie.y);\n\n }\n action = ('MOVE ' + (target.x + oppX) + \" \" + (target.y + oppY))\n}", "title": "" }, { "docid": "f104970bf6b429131469ffbe59afbb44", "score": "0.6107131", "text": "move() {\n \n }", "title": "" }, { "docid": "523f48a64fadd15a88dd8a4f95a38327", "score": "0.598778", "text": "onAfterMove() {}", "title": "" }, { "docid": "6986c5f5ab7c4af530a88ead0f67dd88", "score": "0.5983306", "text": "onModifyMove() {}", "title": "" }, { "docid": "bc12a658f96fc621145696a666ffc951", "score": "0.59264934", "text": "function moveState(){\n let actionName = bestAction();\n let tempState = {x: 0 , y: 0}\n if(actionName === undefined) return;\n if(actionName === 'right') tempState.x = tempState.x + 50\n if(actionName === 'left') tempState.x = tempState.x - 50\n if(actionName === 'up') tempState.y = tempState.y - 50\n if(actionName === 'down') tempState.y = tempState.y + 50\n return {action: tempState, actionName: actionName};\n}", "title": "" }, { "docid": "b35331ac7d589ad72d49aa44ee4461e2", "score": "0.5925545", "text": "toggleMoveOrder() {\n\t\tthis.setState({history: this.state.history,\n\t\t\t\t\t\t\t\t\t p1IsNext: this.state.p1IsNext,\n\t\t\t\t\t\t\t\t\t stepNumber: this.state.stepNumber,\n\t\t\t\t\t\t\t\t displayAsc: !this.state.displayAsc});\n\t}", "title": "" }, { "docid": "d7544f1593a4ef0a350b038f087543a0", "score": "0.5894573", "text": "function moveHelper() {\n move(this);\n }", "title": "" }, { "docid": "9833020f6b4f4640d751148cc57df7b1", "score": "0.58870196", "text": "function MOVE(Pos) {\r\n var idmove = charIDToTypeID(\"move\");\r\n var desc16925 = new ActionDescriptor();\r\n var idnull = charIDToTypeID(\"null\");\r\n var ref1390 = new ActionReference();\r\n var idLyr = charIDToTypeID(\"Lyr \");\r\n var idOrdn = charIDToTypeID(\"Ordn\");\r\n var idTrgt = charIDToTypeID(\"Trgt\");\r\n ref1390.putEnumerated(idLyr, idOrdn, idTrgt);\r\n desc16925.putReference(idnull, ref1390);\r\n var idT = charIDToTypeID(\"T \");\r\n var ref1391 = new ActionReference();\r\n var idLyr = charIDToTypeID(\"Lyr \");\r\n ref1391.putIndex(idLyr, Pos);\r\n desc16925.putReference(idT, ref1391);\r\n var idAdjs = charIDToTypeID(\"Adjs\");\r\n desc16925.putBoolean(idAdjs, false);\r\n var idVrsn = charIDToTypeID(\"Vrsn\");\r\n desc16925.putInteger(idVrsn, 5);\r\n var idLyrI = charIDToTypeID(\"LyrI\");\r\n var list446 = new ActionList();\r\n list446.putInteger(36);\r\n desc16925.putList(idLyrI, list446);\r\n executeAction(idmove, desc16925, DialogModes.NO);\r\n}", "title": "" }, { "docid": "16949989cf371122d8a6286465eb562d", "score": "0.5852898", "text": "function onMoveHandle(data) {\n\n}", "title": "" }, { "docid": "b4638f1721d7fe1e21168fc61e20e655", "score": "0.58246946", "text": "function movePiece(){\n if(!moving){\n if (direc==\"right\"){\n \n count=1;\n empty_slot-=1;\n txt=this.textContent;\n slide();\n }\n else {\n \n if (direc==\"left\") {\n count=-1;\n empty_slot+=1;\n txt=this.textContent;\n slide();\n }\n }\n \n if (direc==\"down\") {\n count=1;\n empty_slot-=4;\n txt=this.textContent;\n slide();\n }\n else {\n \n if (direc==\"up\") {\n count=-1;\n empty_slot+=4;\n txt=this.textContent;\n slide();\n }\n }\n \n\n }\n }", "title": "" }, { "docid": "e1855b84d01889a2c8b61f95cb9bc23d", "score": "0.5785357", "text": "renderMove(move, first, second = ``, focus) {\n return (\n <ChessMove key={ move } move={ move } first={ first } second={ second } focus={ focus } />\n );\n }", "title": "" }, { "docid": "d952b05201ced0f8ffae0ca0abb209ce", "score": "0.5755715", "text": "function moveTile(e) {\n switch (e.keyCode) {\n case 37:\n move(\"left\");\n break;\n case 38:\n move(\"up\");\n break;\n case 39:\n move(\"right\");\n break;\n case 40:\n move(\"down\");\n break;\n }\n}", "title": "" }, { "docid": "cb9acc4fcb54c18a16a5ca7f78cc0d2b", "score": "0.57324624", "text": "handleMove(capture, index) {\n let preMovePosition = this.state.squares;\n let pieceToMove = this.state.squares[this.state.selected];\n let postMovePosition = preMovePosition;\n let capturedB = this.state.capturedBlackPieces;\n let capturedW = this.state.capturedWhitePieces;\n\n if (!this.checkIfMoveValid(index)) {\n this.setError(\"Cannot move piece there\");\n } else {\n // If the piece was captured and it is White's turn then the\n // captured piece is black\n if (capture && this.state.turn === WHITE) {\n capturedB.push(preMovePosition[index]);\n }\n // If the piece was captured and it is Black's turn then the\n // captured piece is white\n else if (capture && this.state.turn === BLACK) {\n capturedW.push(preMovePosition[index]);\n }\n\n pieceToMove.deselectPiece();\n this.dehighlightMoves();\n this.makeMove(this.state.selected, index);\n \n postMovePosition[index] = pieceToMove;\n \n this.setState({\n squares: postMovePosition,\n selected: NOT_SELECTED,\n capturedBlackPieces: capturedB,\n capturedWhitePieces: capturedW,\n count: this.state.count + 1,\n error: \"\"\n });\n\n }\n }", "title": "" }, { "docid": "5f2d5923d95eb852ad373cd7b57bff25", "score": "0.572469", "text": "getMoveAction(x, y) {\n var gc = this.controller;\n return ComponentFactory.ClickAction(function() {\n gc.move(x, y, false); \n });\n }", "title": "" }, { "docid": "707229a4ad3917452f009febab0ee0a5", "score": "0.5708847", "text": "function getMove(state) {\n return 'up'\n}", "title": "" }, { "docid": "5b2da8518457002c7faa0d9c075338a8", "score": "0.57077515", "text": "moving(event, ui) {\n this.props.moveNote(this.props.id, ui.x, ui.y);\n }", "title": "" }, { "docid": "0ab92062648fdc5692a06a4a42c70c82", "score": "0.57020813", "text": "function onMoveRightCustomByOne(context) {\n moveSelectedElementsByCustomColum(\"right\", context);\n}", "title": "" }, { "docid": "51d3cbd9d0a32edfef0ca69525391be2", "score": "0.5699949", "text": "mkMove(r, c){\n if(this.pools[r][c] != '.') return;\n console.log(\"clicked move on: \" + r + \", \" + c);\n if(this.yourTurn){\n this._addMove(r, c, this.yourSign);\n //this._timesToEnd(3, false); //// TODO: implement function\n this.yourTurn = false;\n //document.getElementById('whoMove').innerHTML = 'Wysyłanie ruchu';\n this.sendMove(r, c);\n }\n }", "title": "" }, { "docid": "d19876505880641fe55dc491290c598c", "score": "0.5698504", "text": "function moveSwimlane() {\n let slid = this.dataset.swimlaneId;\n let swimlane = document.querySelector(\"#swimlane\" + slid);\n let container = document.querySelector(\".container\");\n let previous = document.querySelector(\"#swimlane\" + slid).previousSibling;\n let next = document.querySelector(\"#swimlane\" + slid).nextSibling;\n\n let pidx = Array.prototype.indexOf.call(container.children, previous);\n let nidx = Array.prototype.indexOf.call(container.children, next);\n let cidx = Array.prototype.indexOf.call(container.children, swimlane);\n\n console.log(this.dataset.direction);\n console.log(swimlane);\n\n if(this.dataset.direction == \"left\") {\n // list.insertBefore(newItem, list.childNodes[0]);\n container.insertBefore(swimlane, container.childNodes[pidx]);\n }\n else if (this.dataset.direction == \"right\") {\n container.insertBefore(swimlane, container.childNodes[++nidx]);\n }\n}", "title": "" }, { "docid": "02ae90006d1f70c7bccef0fd66ad34af", "score": "0.5696496", "text": "function ReorderFields(actionType, listBoxCtrl) {\n if (actionType == 'up') {ListBoxMoveUp(listBoxCtrl);}\n else if (actionType == 'down') {ListBoxMoveDown(listBoxCtrl);}\n}", "title": "" }, { "docid": "f92ebb794dfbf877366feb6afe24b623", "score": "0.5687428", "text": "function magicReorder (){\n createCards();\n}", "title": "" }, { "docid": "479d927db5bbb3707b1280f274b8e847", "score": "0.56863415", "text": "actionMove() {\n console.log(\"fun times\");\n }", "title": "" }, { "docid": "a519b021b6b641e6d2ceb0a69159d763", "score": "0.5677968", "text": "move(keyCode) {\n if (this.hasWon || this.hasLost) {\n return\n }\n this.isChangedAfterMove = false\n // do move\n switch (keyCode) {\n case 37:\n this.moveAllLeft()\n break\n case 38:\n this.moveAllUp()\n break\n case 39:\n this.moveAllRight()\n break\n case 40:\n this.moveAllDown()\n break\n }\n if (this.isChangedAfterMove) {\n this.placeRandomNumber()\n }\n this.hasLost = this.isFinished()\n }", "title": "" }, { "docid": "4076699e94fab23e3ce4789445a0726d", "score": "0.5667772", "text": "move(up, left, right, down, direction) {}", "title": "" }, { "docid": "6a44b631d28dfb8ee956adb72f4db6ad", "score": "0.56660366", "text": "function movePiece1(elmt){\n \n switch(direc){\n case \"right\":\n elmt.style.left=parseInt(elmt.style.left)+100+'px';\n empty_slot-=1;\n break;\n case \"left\":\n elmt.style.left=parseInt(elmt.style.left)-100+'px';\n empty_slot+=1;\n break;\n case \"down\":\n elmt.style.top=parseInt(elmt.style.top)+100+'px';\n empty_slot-=4;\n break;\n case \"up\":\n elmt.style.top=parseInt(elmt.style.top)-100+'px';\n empty_slot+=4;\n break;\n\n default:\n\n\n }\n}", "title": "" }, { "docid": "c5ba423c470b94df2390dd47b3281fe0", "score": "0.56428146", "text": "move() {}", "title": "" }, { "docid": "c5ba423c470b94df2390dd47b3281fe0", "score": "0.56428146", "text": "move() {}", "title": "" }, { "docid": "c5ba423c470b94df2390dd47b3281fe0", "score": "0.56428146", "text": "move() {}", "title": "" }, { "docid": "d9322085bde342a79fe82f4b90e777e5", "score": "0.56280965", "text": "makeMove(position) {\n var { match, actions } = this.props;\n if (match.winner || match.board[position] !== \"\") return;\n actions.makeMove(match.currentPlayer, position);\n }", "title": "" }, { "docid": "67104aa6ce7ad10e9bee997e19ce9b80", "score": "0.5614948", "text": "handleToPrevFromMove(move_index) {\n cancelSpeech()\n if (this.props.move_index <= 0) {\n return;\n }\n this.props.decrement_move_index(move_index);\n this.setState((state) => {\n return {\n timerKey: Math.random(),\n move_time: this.props.location.state.move_time,\n break_time: this.props.location.state.break_time,\n }\n })\n }", "title": "" }, { "docid": "f16ef07219c63770a06be31e8317e259", "score": "0.5608424", "text": "handleInput(e) {\n switch (e) {\n case \"up\":\n this.move(0, -80);\n break;\n case \"down\":\n this.move(0, 80);\n break;\n case \"left\":\n this.move(-100, 0);\n break;\n case \"right\":\n this.move(100, 0);\n break;\n }\n }", "title": "" }, { "docid": "92e64c0d70684a30aa74f8854dc770ec", "score": "0.5595281", "text": "function moveHandler() {\n if (rendering) {\n return;\n }\n\n const offset = setOffset();\n if (offset) {\n const { dx, dy } = offset;\n api.dispatchAction({\n type: 'leafletMove',\n dx,\n dy\n });\n }\n }", "title": "" }, { "docid": "0172a173e30ef1a0365aa889f8d8c227", "score": "0.55930716", "text": "move() {\n let keys = '';\n if (keyIsDown(config.settings.controls.left1.code) || keyIsDown(config.settings.controls.left2.code)) {\n keys += 'l';\n }\n if (keyIsDown(config.settings.controls.up1.code) || keyIsDown(config.settings.controls.up2.code)) {\n keys += 'u';\n }\n if (keyIsDown(config.settings.controls.right1.code) || keyIsDown(config.settings.controls.right2.code)) {\n keys += 'r';\n }\n if (keyIsDown(config.settings.controls.down1.code) || keyIsDown(config.settings.controls.down2.code)) {\n keys += 'd';\n }\n switch (keys) {\n case 'l':\n this.cursor.x -= this.speed;\n break;\n case 'u':\n this.cursor.y -= this.speed;\n break;\n case 'r':\n this.cursor.x += this.speed;\n break;\n case 'd':\n this.cursor.y += this.speed;\n break;\n case 'lu':\n this.cursor.x -= this.speed * Z.cos45;\n this.cursor.y -= this.speed * Z.cos45;\n break;\n case 'lr':\n // Net zero\n break;\n case 'ld':\n this.cursor.x -= this.speed * Z.cos45;\n this.cursor.y += this.speed * Z.cos45;\n break;\n case 'ur':\n this.cursor.x += this.speed * Z.cos45;\n this.cursor.y -= this.speed * Z.cos45;\n break;\n case 'ud':\n // Net zero\n break;\n case 'rd':\n this.cursor.x += this.speed * Z.cos45;\n this.cursor.y += this.speed * Z.cos45;\n break;\n case 'lur':\n this.cursor.y -= this.speed; // Net up\n break;\n case 'lud':\n this.cursor.x -= this.speed; // Net left\n break;\n case 'lrd':\n this.cursor.y += this.speed; // Net down\n break;\n case 'urd':\n this.cursor.x += this.speed; // Net right\n break;\n case 'lurd':\n // Net zero\n break;\n }\n if (keys !== '') {\n this.off.x = this.cursor.x - center.x;\n this.off.y = this.cursor.y - center.y;\n }\n }", "title": "" }, { "docid": "893edbfd4054ceea9624934117f2625c", "score": "0.55877316", "text": "function moveLeft() {\n $('#catalog').turn('previous');\n}", "title": "" }, { "docid": "8dfffd34294d216f0febc96f949d709b", "score": "0.558608", "text": "static beforeMove(state) {return state;}", "title": "" }, { "docid": "a09e2d4b6311a69c6e1db27e3421d13c", "score": "0.55808765", "text": "function ORDERED(movepoint) {\n\t target = movepoint.transform;\n}", "title": "" }, { "docid": "7cbd1ff4715f1c7cc182e1faddde1a46", "score": "0.5571912", "text": "performAction(planner) {\n let action = '';\n\n switch (this.state) {\n case STATE_RELEASE:\n action = 'RELEASE';\n break;\n case STATE_RETREAT:\n action = 'MOVE ' + planner.basePositionX + ' ' + planner.basePositionY;\n break;\n case STATE_CAPTURE:\n let closestGhostDistance = 9999999;\n let values = Array.from(planner.ghosts.values());\n\n for (let i = 0; i < values.length; i++) {\n let ghost = values[i];\n\n let distance = equlidianDistanceBetweenMobiles(this, ghost);\n if (distance > this.minShootingRange && distance < this.maxShootingRange) {\n this.currentTargetMobile = ghost;\n action = 'BUST ' + ghost.ID;\n break;\n }\n\n if (closestGhostDistance > distance) {\n closestGhostDistance = distance;\n this.currentTargetMobile = ghost;\n }\n }\n\n if (action === '') {\n if (closestGhostDistance > this.maxShootingRange) {\n action = 'MOVE ' + this.currentTargetMobile.currentX + ' ' + this.currentTargetMobile.currentY;\n }\n else {\n let moves = this.team === 0 ? MOVE_DIRECTION_FIRST_TEAM : MOVE_DIRECTION_SECOND_TEAM;\n\n for (let i = 0; i < moves.length; i++) {\n let move = pickNextMoveCoordinatesForMobile(this, moves[i]);\n if (validateMove(move)) {\n action = 'MOVE ' + move.x + ' ' + move.y;\n break;\n }\n }\n }\n }\n break;\n case STATE_SEAK:\n let moves = this.team === 0 ? MOVE_DIRECTION_FIRST_TEAM : MOVE_DIRECTION_SECOND_TEAM;\n\n for (let i = 0; i < moves.length; i++) {\n let move = pickNextMoveCoordinatesForMobile(this, moves[i]);\n if (validateMove(move)) {\n action = 'MOVE ' + move.x + ' ' + move.y;\n break;\n }\n }\n\n break;\n case STATE_SPAWNED:\n printErr('## ERROR: id=' + this.id + ' STATE IS STILL SPAWNED');\n break;\n }\n\n return action;\n }", "title": "" }, { "docid": "dde630786ff732c91d04ae15bd31c262", "score": "0.5569446", "text": "function doMoveItem(idBlock) { ANCIENT_MOVE = idBlock; }", "title": "" }, { "docid": "4b12056d7f15ba0e1b9de2c33563ef5e", "score": "0.55693686", "text": "handleToNextFromMove(move_index) {\n cancelSpeech()\n if (this.props.move_index >= this.props.moves.length - 1) {\n return;\n }\n this.props.increment_move_index(move_index);\n this.setState((state) => {\n return {\n timerKey: Math.random(),\n move_time: this.props.location.state.move_time,\n break_time: this.props.location.state.break_time,\n }\n })\n }", "title": "" }, { "docid": "fc23191ce472d1ef8027bcfb9e82b335", "score": "0.5543983", "text": "moveSelected(delta) {\n this[selectionSym].forEach(obj=> {\n if(obj.move)\n obj.move(delta);\n });\n }", "title": "" }, { "docid": "976d73337eac029c70b0b13bae72970b", "score": "0.55427706", "text": "_decrementMoves() {\n this._movesContainer.updateMoves(--this._currentMoves);\n }", "title": "" }, { "docid": "2afa52ce00e5576d55b431026e1105da", "score": "0.55405974", "text": "moveActiveHandle(udx, udy, obj, type = this.activeHandleType) {\n if (!udx && !udy) {\n return\n }\n switch (type) {\n case TOP_LEFT:\n this.moveActiveHandle(udx, udy, obj, TOP)\n this.moveActiveHandle(udx, udy, obj, LEFT)\n return\n case TOP_RIGHT:\n this.moveActiveHandle(udx, udy, obj, TOP)\n this.moveActiveHandle(udx, udy, obj, RIGHT)\n return\n case BOTTOM_LEFT:\n this.moveActiveHandle(udx, udy, obj, BOTTOM)\n this.moveActiveHandle(udx, udy, obj, LEFT)\n return\n case BOTTOM_RIGHT:\n this.moveActiveHandle(udx, udy, obj, BOTTOM)\n this.moveActiveHandle(udx, udy, obj, RIGHT)\n return\n }\n\n let dx = udx\n let dy = udy\n\n // if no rotation we can skip extra calculations\n if (obj.rotation) {\n const sin = Math.sin(-obj.rotation * FROM_DEGREES)\n const cos = Math.cos(-obj.rotation * FROM_DEGREES)\n dx = ObjectHelper.rpx(sin, cos, udx, udy, 0, 0)\n dy = ObjectHelper.rpy(sin, cos, udx, udy, 0, 0)\n }\n\n // TODO: add pivot point e.g. 50% of left & right would do 50% smaller changes to left and 50% smaller changes to right\n switch (type) {\n case ROTATE: {\n const h = this.handles[ROTATE]\n h.x += udx\n h.y += udy\n\n const center = this.handles[CENTER]\n const an = Math.atan2(h.y - center.y, h.x - center.x) + Math.PI * 0.5\n\n // this will rotate around base point - change only rotation\n // obj.rotation = an * FROM_RADIANS\n\n // this will rotate around middle point\n ObjectHelper.rotateObject(obj, an)\n break\n }\n case BOTTOM: {\n // this is same fro NON tile as for tile TOP\n if (!obj.gid) {\n obj.height += dy\n break\n }\n\n obj.x -= dy * Math.sin(obj.rotation * FROM_DEGREES)\n obj.y += dy * Math.cos(obj.rotation * FROM_DEGREES)\n obj.height += dy\n break\n }\n case TOP: {\n if (!obj.gid) {\n obj.x -= dy * Math.sin(obj.rotation * FROM_DEGREES)\n obj.y += dy * Math.cos(obj.rotation * FROM_DEGREES)\n obj.height -= dy\n break\n }\n\n obj.height -= dy\n break\n }\n case LEFT: {\n obj.x += dx * Math.cos(obj.rotation * FROM_DEGREES)\n obj.y += dx * Math.sin(obj.rotation * FROM_DEGREES)\n obj.width -= dx\n break\n }\n case RIGHT: {\n obj.width += dx\n break\n }\n }\n }", "title": "" }, { "docid": "971923f18e5f01f236bf36b3d23568ad", "score": "0.553478", "text": "moveX(increment) {\n if (increment > 0) {\n let distance = this.getCurrentScenarioDistances().get(CONS.direction.RIGHT);\n\n if (distance < 0) {\n increment = 0;\n } else {\n increment = Math.max(Math.min(distance, increment), 0);\n }\n\n super.moveX(increment);\n\n } else if (increment < 0) {\n let distance = this.getCurrentScenarioDistances().get(CONS.direction.LEFT);\n\n if (distance < 0) {\n increment = 0;\n } else {\n distance = distance * -1;\n\n increment = Math.max(distance, increment);\n }\n\n super.moveX(increment);\n\n }\n }", "title": "" }, { "docid": "86b4f4f0b50d215c72ad4e8e26d2213a", "score": "0.55302787", "text": "function eventMove(e) {\n e.preventDefault();\n if(Object.keys(active_widgets).length <= 0) return;\n\n if(e.constructor.name != \"MouseEvent\") {\n for (var i = 0; i < e.changedTouches.length; i++) {\n id = e.changedTouches[i].identifier;\n new_x = e.changedTouches[i].screenX;\n new_y = e.changedTouches[i].screenY;\n calcDeltaAndCallMove(active_widgets['id_'+id], new_x, new_y);\n }\n } else {\n new_x = e.screenX;\n new_y = e.screenY;\n calcDeltaAndCallMove(active_widgets['id_0'], new_x, new_y);\n }\n}", "title": "" }, { "docid": "f1309501d1fc6a2e7daafbe8649fb2e1", "score": "0.55275196", "text": "function moveAction(activity, evtargs) {\r\n var errorMessage;\r\n\r\n if(activity.id === currentActivityId) {\r\n \r\n if(typeof activity.move === 'function') {\r\n activity.move.apply(undefined, evtargs);\r\n }\r\n else {\r\n errorMessage = NationalInstruments.HtmlVI.replaceStrings(NationalInstruments.HtmlVI.errorMessages.UNEXPECTED_BEHAVIOR, 'The move callback is not a function. If the move property was not provided this function should not run.');\r\n throw new Error(errorMessage);\r\n }\r\n \r\n }\r\n else {\r\n errorMessage = NationalInstruments.HtmlVI.replaceStrings(NationalInstruments.HtmlVI.errorMessages.UNEXPECTED_BEHAVIOR, 'Attempted to complete activity that was NOT the current activity. Only the current activity should be able to fire the move action.');\r\n throw new Error(errorMessage);\r\n }\r\n }", "title": "" }, { "docid": "8d344a50470fa3cc4ee6afda48c9acd3", "score": "0.55091166", "text": "function moveToNext () {}", "title": "" }, { "docid": "b706d14b105a196642bbcf2349aea29a", "score": "0.550809", "text": "function move(interactions) {\r\n if (interactions.left) {\r\n// jQuery has a library function called \"animate\" that takes plate and move it -5px\r\n// to the left. '1' is the animation time in milliseconds.\r\n plate.animate({left: '-=5'}, 1);\r\n }\r\n if (interactions.right) {\r\n plate.animate({left: '+=5'}, 1);\r\n }\r\n // if (settings.walls) {\r\n // \twalls();\r\n // }\r\n\r\n wall();\r\n }", "title": "" }, { "docid": "f9aa82870977a812674078f7731fca41", "score": "0.54983574", "text": "function mm_component_move (id, arrow) {\n var component = window.mammen.elements[id];\n\n if (arrow == 'up') {\n if (id > 0) {\n var tmp_up = window.mammen.elements[id*1-1];\n\n window.mammen.elements[id*1-1] = component;\n window.mammen.elements[id] = tmp_up;\n }\n } else if (arrow == 'down') {\n if (id < window.mammen.elements.length) {\n var tmp_down = window.mammen.elements[id*1+1];\n\n window.mammen.elements[id*1+1] = component;\n window.mammen.elements[id] = tmp_down;\n }\n }\n }", "title": "" }, { "docid": "497d73f62c1413475c104bd71698f378", "score": "0.5497953", "text": "moveCard(card1, deck1, card2, deck2) {\n this.setState((prevState, props) => {\n // Unselect the card\n prevState.cardSelected = null;\n // Store the last state\n prevState.lastState = null;\n prevState.lastState = JSON.stringify(prevState);\n // Move the cards\n let deck1Copy = prevState[deck1].slice();\n const cards = deck1Copy.splice(prevState[deck1].indexOf(card1), prevState[deck1].length);\n prevState[deck1] = deck1Copy;\n prevState[deck2] = prevState[deck2].concat(cards);\n\n // Flip the card if necessary\n if (prevState.nbHiddenCards[deck1] > 0 && prevState.nbHiddenCards[deck1] === prevState[deck1].length) {\n prevState.nbHiddenCards[deck1] = prevState.nbHiddenCards[deck1] - 1;\n }\n\n return prevState;\n }, () => {\n if (this.isFinished()) {\n Alert.alert(\n 'Congratulations!',\n 'You finished the game! Play again?',\n [\n {text: 'Easy', onPress: () => this.setState(this.getInitStatus(Solitaire.EASY_MODE))},\n {text: 'Hard', onPress: () => this.setState(this.getInitStatus(Solitaire.HARD_MODE))}\n ]\n );\n }\n });\n }", "title": "" }, { "docid": "e52be6e6906132784a48e73d281289cc", "score": "0.5484315", "text": "handleToPrevFromBreak(move_index) {\n cancelSpeech()\n if (this.props.move_index < 0) {\n return;\n }\n if(move_index != 0){\n this.props.decrement_move_index(move_index);\n }\n this.props.toggle_move_or_break(this.props.move_or_break);\n this.setState((state) => {\n return {\n timerKey: Math.random(),\n move_time: this.props.location.state.move_time,\n break_time: this.props.location.state.break_time,\n }\n })\n }", "title": "" }, { "docid": "a39a1f9a102adf6840521a31f4880054", "score": "0.5482145", "text": "function moveBiker() {\n\t// use the move method of the global biker object\n\tif(biker.stepSize == 0) {\n\t\tbiker.stepSize = -1;\n\t}\n}", "title": "" }, { "docid": "dec1580d25c36abe3c11575be0d74629", "score": "0.5480667", "text": "applyMove(move) {\n switch (move.type) {\n case Move.DRAW: {\n // Move waste back to hand if hand is empty\n if (this.hand.length === 0 && this.waste.length > 0) {\n this.hand = this.waste.reverse();\n this.waste = [];\n }\n // Draw up to rules.drawSize cards and place in waste\n let cardsToDraw = this.rules.drawSize;\n while (cardsToDraw > 0 && this.hand.length > 0) {\n this.waste.push(this.hand.pop());\n cardsToDraw--;\n }\n break;\n }\n case Move.WASTE_TO_FOUNDATION: {\n const card = this.waste[this.waste.length - 1];\n const suit = getSuit(card);\n this.foundation[suit]++;\n this.waste.pop();\n break;\n }\n case Move.WASTE_TO_TABLEAU: {\n const dstCol = move.extras[0];\n let column = this.tableau[dstCol];\n const srcCard = this.waste[this.waste.length - 1];\n this.waste.pop();\n column.faceUp.push(srcCard);\n break;\n }\n case Move.TABLEAU_TO_FOUNDATION: {\n const srcCol = move.extras[0];\n let column = this.tableau[srcCol];\n const card = column.faceUp[column.faceUp.length - 1];\n const suit = getSuit(card);\n this.foundation[suit]++;\n this.tableau[srcCol].faceUp.pop();\n break;\n }\n case Move.TABLEAU_TO_TABLEAU: {\n const srcCol = move.extras[0];\n const srcRow = move.extras[1];\n const dstCol = move.extras[2];\n this.tableau[dstCol].faceUp = this.tableau[dstCol].faceUp.concat(\n\tthis.tableau[srcCol].faceUp.slice(srcRow)\n );\n this.tableau[srcCol].faceUp = this.tableau[srcCol].faceUp.slice(0, srcRow);\n break;\n }\n case Move.FOUNDATION_TO_TABLEAU: {\n const suit = SUITS[move.extras[0]];\n const foundationCard = VALUES[this.foundation[suit]] + suit;\n let dstCol = this.tableau[move.extras[1]];\n dstCol.faceUp.push(foundationCard);\n this.foundation[suit]--;\n break;\n }\n }\n\n // Flip over any cards that have been exposed in the tableau\n for (let i = 0; i < this.tableau.length; i++) {\n let column = this.tableau[i];\n if (column.faceUp.length === 0 && column.faceDown.length !== 0) {\n\tcolumn.faceUp.push(column.faceDown.pop());\n }\n }\n }", "title": "" }, { "docid": "20d6e027d8345058cbc42d5c00717481", "score": "0.5476946", "text": "function move(move){\n\n }", "title": "" }, { "docid": "9ab2c0d9d38b628a3f20de0782ded6c6", "score": "0.5472402", "text": "move() { }", "title": "" }, { "docid": "9ab2c0d9d38b628a3f20de0782ded6c6", "score": "0.5472402", "text": "move() { }", "title": "" }, { "docid": "82e08cc0bdb891bd7cc4260cc278e508", "score": "0.5469978", "text": "updateMovementOfItems ()\n {\n const list = this.itemsBefore.concat(this.itemsAfter);\n\n for (let i = 0; i < list.length; i++)\n {\n const item = list[i];\n\n if (item.shouldBeMoved !== item.isMoved)\n {\n const movement = item.shouldBeMoved ? item.displacedPosition : item.initialPosition;\n setStyles(item.element, {\n transform: `translateY(${movement}px)`,\n });\n item.isMoved = item.shouldBeMoved;\n }\n }\n }", "title": "" }, { "docid": "c9e772ecbde3f28c4d8d138ee3bc0b9c", "score": "0.5468593", "text": "function move(dir){\r\n\tdir ? cRow++ : cRow--; \r\n\tvar r = $('r'+cRow);\r\n\tif(r){\r\n\t\tcolorRow(r, true);\r\n\t\tcolorRow($('r'+(dir?cRow-1:cRow+1)), false);\r\n\t}\r\n\telse \r\n\t\tdir ? cRow-- : cRow++; \r\n}", "title": "" }, { "docid": "11d5770bc5249cbfdf3e4e39aa83b0c8", "score": "0.5465359", "text": "function move() {\n $lis.each(function(index, element) {\n var state = states[index];\n $(element).css('zIndex', state.$zIndex).finish().animate(state, setting.speed).find('img').css('opacity', state.$opacity);\n });\n }", "title": "" }, { "docid": "6da5f8d7d9b651a464a374cf182ca68f", "score": "0.5461824", "text": "function boardMove(keyCode){\n let beforeMove = gameTiles.map(tile => tile.textContent);\n let afterMove;\n switch(keyCode.code){\n case \"ArrowUp\":\n moveUp();\n combineColumnUp();\n moveUp();\n afterMove = gameTiles.map(tile => tile.textContent);\n if(!arraysEqual(beforeMove, afterMove)) spawnNumOnEmptyTile();\n break;\n case \"ArrowRight\":\n moveRight();\n combineRowRight();\n moveRight();\n afterMove = gameTiles.map(tile => tile.textContent);\n if(!arraysEqual(beforeMove, afterMove)) spawnNumOnEmptyTile();\n break;\n case \"ArrowDown\":\n moveDown();\n combineColumnDown();\n moveDown();\n afterMove = gameTiles.map(tile => tile.textContent);\n if(!arraysEqual(beforeMove, afterMove)) spawnNumOnEmptyTile();\n break;\n case \"ArrowLeft\":\n moveLeft();\n combineRowLeft();\n moveLeft();\n afterMove = gameTiles.map(tile => tile.textContent);\n if(!arraysEqual(beforeMove, afterMove)) spawnNumOnEmptyTile();\n break;\n default:\n break;\n }\n saveLocalGame();\n}", "title": "" }, { "docid": "7582751f032b4adc9e498dce6369a93a", "score": "0.5448154", "text": "postUndo(move) {\n // (Potentially) Reset king position\n const c = this.getColor(move.start.x, move.start.y);\n if (this.getPiece(move.start.x, move.start.y) == V.KING)\n this.kingPos[c] = [move.start.x, move.start.y];\n }", "title": "" }, { "docid": "8a88886af68ce1f73fc17f32ab76b566", "score": "0.54421365", "text": "move() {\r\n const color = this.read();\r\n this.changeColor();\r\n if(color) { //true\r\n this.right();\r\n this.advance();\r\n } else {\r\n this.left();\r\n this.advance();\r\n }\r\n }", "title": "" }, { "docid": "c291e48e4962b2537cefd05958dc8d02", "score": "0.5442049", "text": "function move(contxt, state, dir, posX, posY, colors, moves) {\n\tcontxt.save();\n\n\t// BREAK CASE\n\tif (moves == 0) {\n\t\treturn;\n\t}\n\n\t// 'moves' decrements its self after each call to the function\n\tmoves--;\n\t\n\t// grabs the color of the square the mover is currently on\n\tvar space = contxt.getImageData(posX-8, posY-8, 1, 1);\n\tr = space.data[0];\n\tg = space.data[1];\n\tb = space.data[2];\n\n\t// compares each combination of rgb values. the color determines the state\n\tif (r == 0 && g == 0 && b == 0) {\n\t\tstate = 0;\n\t}\n\telse if (r == 255 && g == 0 && b == 0) {\n\t\tstate = 1;\n\t}\n\telse if (r == 255 && g == 255 && b == 0) {\n\t\tstate = 2;\n\t}\n\telse if (r == 0 && g == 0 && b == 255) {\n\t\tstate = 3;\n\t}\n\n\t// draws the colored square on the board. should be the next color in the sequence\n\tdrawSquare(contxt, posX, posY, colors[++state]);\n\tstate--;\n\n\t// given the state, we determine whether the mover turns left or right\n\t// this is done using the 'dir' variable\n\tswitch(true) {\n\t\tcase (state == 0 || state == 1):\n\t\t\t// turn left\n\t\t\tif (dir > 0) {\n\t\t\t\tdir--;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdir = 3;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase (state == 2 || state == 3):\n\t\t\t// turn right\n\t\t\tif (dir < 3) {\n\t\t\t\tdir++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdir = 0;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\t// after the direction has been manipulated by the previous switch statement,\n\t// we move the mover in its new direction\n\tswitch(dir) {\n\t\tcase 0:\n\t\t\t// triangle -> north\n\t\t\tposY-=18;\n\t\t\tdraw_triangle_N(contxt, posX, posY);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t// triangle -> east\n\t\t\tposX+=18;\n\t\t\tdraw_triangle_E(contxt, posX, posY);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t// triangle -> south\n\t\t\tposY+=18;\n\t\t\tdraw_triangle_S(contxt, posX, posY);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t// triangle -> west\n\t\t\tposX-=18;\n\t\t\tdraw_triangle_W(contxt, posX, posY);\n\t}\n\n\tcontxt.restore();\n\n\t// executes every 1/10 of a second\n\tsetTimeout(move, 100, contxt, state, dir, posX, posY, colors, moves);\n\n\treturn;\n}", "title": "" }, { "docid": "a5dff2928e18ab974eb3eac200b39851", "score": "0.5435875", "text": "function move(objMove,bDir) {\n if(objMove.length <= 0) {\n alert(messagesData.thereisnoitemtomove);\n return;\n }\n var idx = objMove.selectedIndex\n if (idx==-1)\n alert(messagesData.youmustfirstselectitemtoreorder)\n else {\n var nxidx = idx+( bDir? -1 : 1)\n if (nxidx<0) nxidx=objMove.length-1\n if (nxidx>=objMove.length) nxidx=0\n var oldVal = objMove[idx].value\n var oldText = objMove[idx].text\n objMove[idx].value = objMove[nxidx].value\n objMove[idx].text = objMove[nxidx].text\n objMove[nxidx].value = oldVal\n objMove[nxidx].text = oldText\n objMove.selectedIndex = nxidx\n }\n}", "title": "" }, { "docid": "a5dff2928e18ab974eb3eac200b39851", "score": "0.5435875", "text": "function move(objMove,bDir) {\n if(objMove.length <= 0) {\n alert(messagesData.thereisnoitemtomove);\n return;\n }\n var idx = objMove.selectedIndex\n if (idx==-1)\n alert(messagesData.youmustfirstselectitemtoreorder)\n else {\n var nxidx = idx+( bDir? -1 : 1)\n if (nxidx<0) nxidx=objMove.length-1\n if (nxidx>=objMove.length) nxidx=0\n var oldVal = objMove[idx].value\n var oldText = objMove[idx].text\n objMove[idx].value = objMove[nxidx].value\n objMove[idx].text = objMove[nxidx].text\n objMove[nxidx].value = oldVal\n objMove[nxidx].text = oldText\n objMove.selectedIndex = nxidx\n }\n}", "title": "" }, { "docid": "a4bd0cae9c9be8107b1a6f41c07b4c4a", "score": "0.54266703", "text": "function moveCard() {\n let slid = this.parentNode.parentNode.dataset.swimlaneId;\n let cid = this.dataset.cardId;\n\n let card = document.querySelector(\"#card\" + cid);\n\n let leftSlid;\n let rightSlid;\n let left;\n let right;\n\n //try to get left swimlane data, may not exist\n try {\n left = document.querySelector(\"#swimlane\" + slid).previousSibling;\n leftSlid = left.dataset.swimlaneId;\n }\n catch (e) {\n console.error(e);\n }\n\n //try to get right swimlane data, may not exist\n try {\n right = document.querySelector(\"#swimlane\" + slid).nextSibling;\n rightSlid = right.dataset.swimlaneId;\n }\n catch (e) {\n console.error(e);\n }\n\n console.log(left);\n console.log(right);\n\n let direction = this.dataset.moveDirection;\n\n if(left != null && direction == \"left\") {\n left.appendChild(card);\n card.dataset.swimlaneId = leftSlid;\n }\n else if(right != null && direction == \"right\") {\n right.appendChild(card);\n card.dataset.swimlaneId = rightSlid;\n }\n}", "title": "" }, { "docid": "8d84473c48cfc1574884606dd782ad2d", "score": "0.5419116", "text": "onMoveUp() {\n $.post(\"/haskell/move/item/\" + this.item.uid, {direction: \"up\"})\n .done(() => { moveNodeUp('#' + this.itemNode);\n fadeIn('#' + this.itemNode); });\n }", "title": "" }, { "docid": "179f3c2d89ab6d8c1427d01a6be47201", "score": "0.54190516", "text": "moves() {\r\n console.log(\"I am moving\");\r\n }", "title": "" }, { "docid": "246aa821eac4d48548b7e8bdcdf8e270", "score": "0.5411389", "text": "moveTo(choose){\n const book = this.props;\n switch(choose){\n case 'C':\n this.props.updateBookShelf(book, 'currentlyReading');\n break;\n case 'W':\n this.props.updateBookShelf(book, 'wantToRead');\n break;\n case 'R':\n this.props.updateBookShelf(book, 'read');\n break;\n case 'N':\n this.props.updateBookShelf(book, 'none');\n break;\n default:\n console.log(`${choose} isn't a valid argument!`);\n }\n }", "title": "" }, { "docid": "712db8b25a5c659d466df1a3953d5df0", "score": "0.54111886", "text": "startMove(direction) {\n\n const {data,actions, isCameraMoving} = get();\n data.direction = direction; \n\n if(data.direction == \"back\") {\n data.currentPath = data.currentTouchPoint.previousPath.curve;\n data.nextTouchPoint = data.currentTouchPoint.previousTouchPoint;\n data.destinationPos = data.currentPath.v0;\n data.currentTrack = data.currentTouchPoint.previousPath.tubeBufferGeometryPath;\n // console.log(data.currentPath);\n }\n else if (data.direction == \"forwards\") {\n data.currentPath = data.currentTouchPoint.nextPath.curve;\n data.nextTouchPoint = data.currentTouchPoint.nextTouchPoint; \n data.destinationPos = data.currentPath.v3;\n data.currentTrack = data.currentTouchPoint.nextPath.tubeBufferGeometryPath;\n // console.log(data.currentPath);\n // console.log(data.destinationPos);\n\n }\n\n data.isCameraMoving = true; \n\n // actions.move();\n\n }", "title": "" }, { "docid": "f9e3a3f11610694be6ee502c12ddebed", "score": "0.5409434", "text": "function move(direction) {}", "title": "" }, { "docid": "fbeb7c785f89d2373be7da455aebc9bb", "score": "0.5406873", "text": "move(item, offset) {\n let index = item.index + offset + (offset > 0);\n\n index = Mavo.wrap(index, this.children.length + 1);\n\n this.add(item, index);\n\n if (item instanceof Mavo.Primitive && item.itembar) {\n item.itembar.reposition();\n }\n }", "title": "" }, { "docid": "83ee844281bf2bb024b337552be1212f", "score": "0.54067695", "text": "handleOnClick_btMoveGameToTop(e) {\n const games = store.getState().games;\n\n for (let i = 0; i < games.length; i++)\n if (games[i] === this.props.selectedGame) {\n games.unshift(games[i]);\n games.splice(i + 1, 1);\n break;\n }\n\n store.dispatch(setGames(games));\n }", "title": "" }, { "docid": "8d501e381aa1e4d22c0ebeae7af08b91", "score": "0.5399342", "text": "function customActionOnMoveEvent() {\n\t// ... action to do on call\n}", "title": "" }, { "docid": "0c521a71337875c91fee42c41e55316d", "score": "0.53966326", "text": "function doMove( move )\n{ \n stopPlaying();\n changeHighlight( move, 0 );\n var mvParameters = gblCurrentMove.attr('rel');\n var arr = mvParameters.split(' ');\n var diagNbr = parseInt(arr[0],10);\n var posn = arr[1];\n var moveTxt = arr[2];\n changeFrame( diagNbr );\n pos(posn,diagNbr,'y','Position after ' + moveTxt);\n}", "title": "" }, { "docid": "80af6b369d904162fe8a501501096ed7", "score": "0.53935736", "text": "function movePiece(event) {\n switch (event.key) {\n case 'ArrowRight':\n currentPiece.moveRight();\n break;\n case 'ArrowLeft':\n currentPiece.moveLeft();\n break;\n case 'ArrowDown':\n currentPiece.moveDown();\n break;\n case 'z':\n currentPiece.rotatePiece();\n break;\n }\n}", "title": "" }, { "docid": "30c2c711f4051dd6ab3bc8aa94c564d7", "score": "0.5390627", "text": "function nextMove(move, dir, diff) {\n if (dir === \"-\") {\n move -= diff;\n } else if (dir === \"+\") {\n move += diff;\n }\n return move;\n}", "title": "" }, { "docid": "1413192ba06d750a6ecbca73af33122c", "score": "0.5390219", "text": "handleCallback(move) {\n this.props.handleCallback(move);\n }", "title": "" }, { "docid": "418d06ae97496f322b3606323179558f", "score": "0.5377107", "text": "function moveRight() {\n $('#catalog').turn('next');\n}", "title": "" }, { "docid": "6fa814255e66417607cb86816c0c6fa7", "score": "0.5376574", "text": "handleInput( keyPressed ) {\n this.move( keyPressed );\n }", "title": "" }, { "docid": "360d7feb6be0da8eb8b594a912c89d57", "score": "0.53730565", "text": "function move(current, prev, next, shift) {\n\t\t current.setX(current.getX() + shift);\n\t\t current.getFormatterMetrics().freedom.left += shift;\n\t\t current.getFormatterMetrics().freedom.right -= shift;\n\t\t\n\t\t if (prev) prev.getFormatterMetrics().freedom.right += shift;\n\t\t if (next) next.getFormatterMetrics().freedom.left -= shift;\n\t\t }", "title": "" }, { "docid": "03dccc5ec9c657ef7b2587d626866e40", "score": "0.53719723", "text": "getMove(nextDirection, currentSquare) {\n let err = '',\n square = currentSquare;\n\n if (nextDirection === 0) {\n //up\n if (currentSquare < this.props.size) {\n //error state\n err = \"up\";\n }\n else {\n square -= this.props.size;\n }\n } else if (nextDirection === 1) {\n //right\n if ( (currentSquare + 1) % this.props.size == 0) {\n //error\n err = \"right\";\n }\n else {\n square++;\n }\n } else if (nextDirection === 2){\n //down\n if (currentSquare + this.props.size > this.props.size * this.props.size) {\n err = \"down\";\n }\n else {\n square += this.props.size;\n }\n }else if (nextDirection === 3){\n //left\n if (currentSquare % this.props.size == 0) {\n err = \"left\";\n }\n else {\n square--;\n }\n }\n\n return {\n error:err,\n square:square\n };\n }", "title": "" }, { "docid": "dc2388bf21ac5fe30291db89ffab5a3f", "score": "0.5366859", "text": "moveCurrentUp (evt)\n {\n if(\n this.count == 0\n || !this.selection.current\n || this.selection.current.id == this.first.id\n ){\n return false\n }\n let current_index = Number(this.selection.current.index)\n if(!evt){evt={}}\n let pa = this.getPrevious(evt.shiftKey ? 5 : 1)\n // On déplace dans les listes\n this._items .splice(current_index, 1)\n this._ids .splice(current_index, 1)\n // this._items.splice(current_index - 1, 0, this.selection.current)\n // this._ids.splice(current_index - 1, 0, this.selection.current.id)\n this._items .splice(pa.index, 0, this.selection.current)\n this._ids .splice(pa.index, 0, this.selection.current.id)\n\n // NOTE 0001\n // Note : puisqu'on utilise `pa.index` ci-dessus pour positionner l'élément\n // déplacé, et que `.index` se sert du DOM pour renvoyer l'index, il faut\n // déplacer le paragraphe seulement après, sinon pa.index sera faux.\n this.moveBefore(this.selection.current, pa)\n }", "title": "" }, { "docid": "2d9046fef8f3becb6998afc57605e7e6", "score": "0.53654367", "text": "_move() {\n this._frog.move()\n }", "title": "" }, { "docid": "fe53f273f123d1b99c44efafaec263f6", "score": "0.5362018", "text": "function move() {\n switch (direction) {\n case 'u':\n if ((head.y)-15 >= 0) {\n var new_head = {x:head.x, y:head.y-15};\n snake.pop();\n snake.unshift(new_head);\n pre_direction = 'u';\n } else {\n quit();\n }\n break;\n case 'd':\n if ((head.y)+15 <= canvas.height) {\n var new_head = {x:head.x, y:head.y+15};\n snake.pop();\n snake.unshift(new_head);\n pre_direction = 'd';\n } else {\n quit();\n }\n break;\n case 'r':\n if ((head.x)+15 <= canvas.width) {\n var new_head = {x:head.x+15, y:head.y};\n snake.pop();\n snake.unshift(new_head); \n pre_direction = 'r';\n } else {\n quit();\n } \n break;\n case 'l':\n if ((head.x)-15 >= 0) {\n var new_head = {x:head.x-15, y:head.y};\n snake.pop();\n snake.unshift(new_head); \n pre_direction = 'l';\n } else {\n quit();\n }\n break;\n }\n \n if (check_eaten()) {\n quit();\n }\n head = snake[0];\n get_food();\n render();\n}", "title": "" }, { "docid": "ac7dfb70f0df09d21f97a9c9e6da5d85", "score": "0.5361088", "text": "function move_key(e){\n\tif(e.keyCode == 39 || e.keyCode == 68) { //right\n\t\tlaunchCGI(\"move\", 2, \"empty\");\n\t}\n\telse if(e.keyCode == 37 || e.keyCode == 65) {\t//left\n\t\tlaunchCGI(\"move\", 4, \"empty\");\n\t}\n\telse if(e.keyCode == 38 || e.keyCode == 87) {\t//up\n\t\tlaunchCGI(\"move\", 1, \"empty\");\n\t}\n\telse if(e.keyCode == 40 || e.keyCode == 83) {\t//down\n\t\tlaunchCGI(\"move\", 3, \"empty\");\n\t}\n}", "title": "" }, { "docid": "372e905b5b0e26385003f93a3fcabd9d", "score": "0.53550303", "text": "render({ }, { items, values }) {\n return (\n <div style=\"border:1px solid black; padding:5px;\">\n <h1>Data Driven Floaters 2d</h1> \n <div style=\"width:100wv;border:1px solid black;height:100px;\">&nbsp;\n <div class=\"posRel\">\n { items.map( (item, idx) => ( \n <div class=\"horizontalList\" style={item.distance} title={item.title} >\n {item.label}\n <div idx={idx} style=\"font-size:.7em\" onClick={() => this.moveMe(idx)}>{item.distance}</div>\n </div>\n )) } \n </div> \n </div>\n <p style=\"margin-top:40px;\">------- C o n t r o l s -------------</p> \n <button style=\"margin-left: 10px;\" value=\"left\" onClick={this.move}>Move Boats Left</button>\n <button style=\"margin-left: 10px;\" value=\"right\" onClick={this.move}>Move Boats Right</button>\n <button style=\"margin-left: 10px;\" value=\"up\" onClick={this.move}>Move Boats Up</button>\n <button style=\"margin-left: 10px;\" value=\"down\" onClick={this.move}>Move Boats Down</button>\n </div>\n );\n }", "title": "" }, { "docid": "b1311e8ef94ea08e02fcf8d4eb3b5cba", "score": "0.5353125", "text": "moveStatusUp(e) {\n this.changeStatus(e, \"up\");\n }", "title": "" }, { "docid": "d1293852f3331ec420be8534728579d9", "score": "0.53528476", "text": "function transformMoveAction(state, action) {\r\n const viewport = document.getElementById(getViewportId(state));\r\n const { endPos } = action.payload;\r\n const viewportState = getViewport(state);\r\n const viewportRect = viewport.getBoundingClientRect();\r\n const newMousePos = {\r\n x: ((endPos.x - viewportRect.left - viewportState.xPos) / viewportState.zoom),\r\n y: ((endPos.y - viewportRect.top - viewportState.yPos) / viewportState.zoom),\r\n };\r\n const newAction = { ...action, payload: { endPos: newMousePos } };\r\n return newAction;\r\n}", "title": "" }, { "docid": "d924d7a162fbbc25e2a0644d434bb5d5", "score": "0.53449166", "text": "moveCard(destinationLaneKey, currentLaneKey, currentCardKey) {\n\t\t/** \n\t\t * @destinationLaneKey - is Key of Lane (in which the card will be moved to)\n\t\t * @currentLaneKey - is Key of Current Lane\n\t\t * @currentCardKey - is Key of Current Card \n\t\t */\n\t\tlet lanesData = this.state.lanesData || [];\n\t\tlet removeCardFromLanesData = [];\n\t\tlet temp = {}; // to store deleted object element\n\t\tlanesData.map((lane, n) => {\n\t\t\tObject.keys(lane.cards || [])\n\t\t\t\t.map((_key) => {\n\t\t\t\t\tif (_key === currentCardKey) {\n\t\t\t\t\t\ttemp = lane.cards[_key];\n\t\t\t\t\t\t// Will add Object(card) to destinationLane\n\t\t\t\t\t\tconst addCardToItsDestinationLane = [...this.state.lanesData.map(lane => {\n\t\t\t\t\t\t\treturn ({\n\t\t\t\t\t\t\t\tcards: destinationLaneKey === lane.key && temp !== \"\" ?\n\t\t\t\t\t\t\t\t\tlane.cards = { ...lane.cards, [currentCardKey]: temp } : lane.cards = { ...lane.cards },\n\t\t\t\t\t\t\t\tpos: lane.pos,\n\t\t\t\t\t\t\t\tkey: lane.key,\n\t\t\t\t\t\t\t\ttitle: lane.title\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})];\n\t\t\t\t\t\t// Will filter out deleted object(card)\n\t\t\t\t\t\tremoveCardFromLanesData = [...addCardToItsDestinationLane.map(lane => ({\n\t\t\t\t\t\t\tcards: (Object.keys(lane.cards || [])\n\t\t\t\t\t\t\t\t\t.map(key => {\n\t\t\t\t\t\t\t\t\t\tlet temp_array = lane.cards[key];\n\t\t\t\t\t\t\t\t\t\ttemp_array['key_id'] = key;\n\t\t\t\t\t\t\t\t\t\treturn temp_array;\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.filter(card => destinationLaneKey === lane.key || card.key_id !== currentCardKey)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.reduce((obj, card) => {\n\t\t\t\t\t\t\t\t\tobj[card.key_id] = { description: card.description, key_id: card.key_id, title: card.title }\n\t\t\t\t\t\t\t\t\treturn obj;\n\t\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t\tpos: lane.pos,\n\t\t\t\t\t\t\tkey: lane.key,\n\t\t\t\t\t\t\ttitle: lane.title\n\t\t\t\t\t\t}))];\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t});\n\n\t\t// set data to state\n\t\tthis.setState({ lanesData: removeCardFromLanesData }, () => {\n\t\t\tlet resolvedObj = this.arrayToObj(this.state.lanesData);\n\t\t\tlet urlProjectKey = window.location.href.split('/')[5];\n\t\t\tthis.props.saveFetchedLanesAction(urlProjectKey, resolvedObj);\n\t\t});\n\t}", "title": "" }, { "docid": "bf40942aeea1b1d130e92d722864e468", "score": "0.5342521", "text": "function nextMove() {\n count = count + 1;\n document.getElementById(\"demoMoveDIV\").innerHTML = \"Moves: \" + count;\n\n updateTopDisk();\n\n if (demoDisknumber % 2 == 0) {\n\n if (count % 3 == 0) {\n if (towerBtop == 0 || towerBtop > towerCtop && towerCtop != 0) {\n stringTowerCtop = \"#\" + towerCtop + \"\";\n $(stringTowerCtop).prependTo(\"#demoTowerB\");\n demomoveHistory(\"TowerC\", \"TowerB\", towerCtop, count);\n updateTopDisk();\n\n } else if (towerCtop == 0 || towerCtop > towerBtop && towerBtop != 0) {\n stringTowerBtop = \"#\" + towerBtop + \"\";\n $(stringTowerBtop).prependTo(\"#demoTowerC\");\n demomoveHistory(\"TowerB\", \"TowerC\", towerBtop, count);\n updateTopDisk();\n\n }\n } else if (count % 3 == 1) {\n if (towerBtop == 0 || towerBtop > towerAtop && towerAtop != 0) {\n stringTowerAtop = \"#\" + towerAtop + \"\";\n $(stringTowerAtop).prependTo(\"#demoTowerB\");\n demomoveHistory(\"TowerA\", \"TowerB\", towerAtop, count);\n updateTopDisk();\n\n } else if (towerAtop == 0 || towerAtop > towerBtop && towerBtop != 0) {\n stringTowerBtop = \"#\" + towerBtop + \"\";\n $(stringTowerBtop).prependTo(\"#demoTowerA\");\n demomoveHistory(\"TowerB\", \"TowerA\", towerBtop, count);\n updateTopDisk();\n\n }\n\n } else if (count % 3 == 2) {\n if (towerCtop == 0 || towerCtop > towerAtop && towerAtop != 0) {\n stringTowerAtop = \"#\" + towerAtop + \"\";\n $(stringTowerAtop).prependTo(\"#demoTowerC\");\n demomoveHistory(\"TowerA\", \"TowerC\", towerAtop, count);\n updateTopDisk();\n\n } else if (towerAtop == 0 || towerAtop > towerCtop && towerCtop != 0) {\n stringTowerCtop = \"#\" + towerCtop + \"\";\n $(stringTowerCtop).prependTo(\"#demoTowerA\");\n demomoveHistory(\"TowerC\", \"TowerA\", towerCtop, count);\n updateTopDisk();\n\n }\n }\n\n\n } else {\n if (count % 3 == 0) {\n if (towerCtop == 0 || towerCtop > towerBtop && towerBtop != 0) {\n stringTowerBtop = \"#\" + towerBtop + \"\";\n $(stringTowerBtop).prependTo(\"#demoTowerC\");\n demomoveHistory(\"TowerB\", \"TowerC\", towerBtop, count);\n updateTopDisk();\n\n } else if (towerBtop == 0 || towerBtop > towerCtop && towerCtop != 0) {\n stringTowerCtop = \"#\" + towerCtop + \"\";\n $(stringTowerCtop).prependTo(\"#demoTowerB\");\n demomoveHistory(\"TowerC\", \"TowerB\", towerCtop, count);\n updateTopDisk();\n }\n } else if (count % 3 == 1) {\n if (towerCtop == 0 || towerCtop > towerAtop && towerAtop != 0) {\n stringTowerAtop = \"#\" + towerAtop + \"\";\n $(stringTowerAtop).prependTo(\"#demoTowerC\");\n demomoveHistory(\"TowerA\", \"TowerC\", towerAtop, count);\n updateTopDisk();\n } else if (towerAtop == 0 || towerAtop > towerCtop && towerCtop != 0) {\n stringTowerCtop = \"#\" + towerCtop + \"\";\n $(stringTowerCtop).prependTo(\"#demoTowerA\");\n demomoveHistory(\"TowerC\", \"TowerA\", towerAtop, count);\n updateTopDisk();\n }\n\n } else if (count % 3 == 2) {\n if (towerBtop == 0 || towerBtop > towerAtop && towerAtop != 0) {\n stringTowerAtop = \"#\" + towerAtop + \"\";\n $(stringTowerAtop).prependTo(\"#demoTowerB\");\n demomoveHistory(\"TowerA\", \"TowerB\", towerAtop, count);\n updateTopDisk();\n\n } else if (towerAtop == 0 || towerAtop > towerBtop && towerBtop != 0) {\n stringTowerBtop = \"#\" + towerBtop + \"\";\n $(stringTowerBtop).prependTo(\"#demoTowerA\");\n demomoveHistory(\"TowerB\", \"TowerA\", towerBtop, count);\n updateTopDisk();\n\n }\n }\n }\n}", "title": "" }, { "docid": "b3437ae7a5eedfab706496ed1863a682", "score": "0.5340469", "text": "function handleMove(e) {\n const { pageX, pageY } = e;\n\n // ! consider the relative distance in the [-1, 1] range\n const dx = (cx - pageX) / (width / 2);\n const dy = (cy - pageY) / (height / 2);\n\n // rotate the card around the x axis, according to the vertical distance, and around the y acis, according to the horizontal gap\n this.style.transform = `rotateX(${10 * dy * -1}deg) rotateY(${10 * dx}deg)`;\n }", "title": "" }, { "docid": "5a0f873273b6820ad3641723f9868b97", "score": "0.53356147", "text": "moveAndDropDownBox(origin, dest, 0, 1, 0.06f);\n\t\t\t\t\t\t\t\t\t\t} else if (ghostBot.transform.position.x < clickedObject.transform.position.x){\n\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\tmovement type 3, increasing on X axis\n\t\t\t\t\t\t\t\t\t\t\tparameters:\n\t\t\t\t\t\t\t\t\t\t\t1 - origin of the movement\n\t\t\t\t\t\t\t\t\t\t\t2 - destination of the movement\n\t\t\t\t\t\t\t\t\t\t\t3 - axis of movement (0 for X, 1 for Z)\n\t\t\t\t\t\t\t\t\t\t\t4 - direction offset: if X grows, mov is type 3, pass -1\n\t\t\t\t\t\t\t\t\t\t\t5 - breadcrumb offset: if X grows, mov is type 3, breadcrumb decreases in Z, pass -0.06f\n\t\t\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\t\t\tmoveAndDropDownBox(origin, dest, 0, -1, -0.06f);\n\t\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "ecc6e7fe0a2c1ad900a604410a286321", "score": "0.53319305", "text": "function Move(){\n if(!moving){\n if((parseInt(this.style.left)+parseInt(this.offsetWidth)) === parseInt(getX()) && this.style.top===getY()){\n this.className = this.className + \" movablepiece\";\n direc=\"right\";\n }else if(parseInt(this.style.left) === (parseInt(getX())+parseInt(this.offsetWidth)) && this.style.top===getY()){\n this.className = this.className + \" movablepiece\";\n direc= \"left\";\n }else if((parseInt(this.style.top)+parseInt(this.offsetHeight)) === parseInt(getY()) && this.style.left===getX()){\n this.className = this.className + \" movablepiece\";\n direc= \"down\";\n }else if(parseInt(this.style.top) === (parseInt(getY())+parseInt(this.offsetHeight)) && this.style.left===getX()){\n this.className = this.className + \" movablepiece\";\n direc= \"up\";\n }else{\n direc= \"none\";\n }\n }\n \n\n}", "title": "" }, { "docid": "207a4d0c41b6cd5a9af9dae807458970", "score": "0.5331845", "text": "function moves(operation) {\n const moveElem = document.querySelector('.moves');\n let moveCount = moveElem.textContent;\n\n if (operation == 'reset') {\n moveElem.textContent = 0;\n }\n else {\n if (moveCount == 13 || moveCount == 27) {\n rating();\n }\n\n moveCount = Number(moveCount);\n moveCount++;\n\n moveElem.textContent = moveCount;\n }\n\n}", "title": "" }, { "docid": "c41ac375e3471be65134fad009d936b5", "score": "0.5331649", "text": "move({ xDir, yDir }) {\n // Moving left\n if(xDir === -1) {\n this.x -= this.size;\n } else if(xDir === 1) {\n this.x += this.size;\n } else if(yDir === -1) {\n this.y -= this.size;\n } else {\n this.y += this.size;\n }\n }", "title": "" }, { "docid": "503b53470224d0ac748ea34fed23d673", "score": "0.5329718", "text": "function moveStage(dir){\r\n\tfaceFold.stage += dir < 0 ? -1 : 1;\r\n\tif(faceFold.stage == stages['SELECT_IMAGE']){\r\n\t\t$(\"#upload_buttons\").show();\r\n\t\t$(\"#zoom_buttons\").hide();\r\n\t\t$(\"#backNextButtons\").hide();\r\n\t\t$(\"#shareButtons\").hide();\r\n\t}\r\n\telse if(faceFold.stage == stages['CROP_N_SCALE']){\r\n\t\t$(\"#upload_buttons\").hide();\r\n\t\t$(\"#zoom_buttons\").show();\r\n\t\t$(\"#backNextButtons\").show();\r\n\t\t$(\"#shareButtons\").hide();\r\n\t}\r\n\telse if(faceFold.stage == stages['SELECT_LINE']){\r\n\t\t$(\"#upload_buttons\").hide();\r\n\t\t$(\"#zoom_buttons\").hide();\r\n\t\t$(\"#backNextButtons\").show();\r\n\t\t$(\"#shareButtons\").hide();\r\n\t}\r\n\telse if(faceFold.stage == stages['SET_OFFSETS']){\r\n\t\t$(\"#upload_buttons\").hide();\r\n\t\t$(\"#zoom_buttons\").hide();\r\n\t\t$(\"#backNextButtons\").show();\r\n\t\t$(\"#shareButtons\").hide();\r\n\t}\r\n\telse if(faceFold.stage == stages['DISPLAY_RESULT']){\r\n\t\t$(\"#upload_buttons\").hide();\r\n\t\t$(\"#zoom_buttons\").hide();\r\n\t\t$(\"#backNextButtons\").show();\r\n\t\t$(\"#shareButtons\").show();\r\n\t\t\r\n\t\tfaceFold.canvas.attr(\"width\", faceFold.newSize[0]).attr(\"height\", faceFold.newSize[1]);\r\n\t}\r\n}", "title": "" }, { "docid": "a3280635a650d4df3f428e7de70f69d2", "score": "0.5329456", "text": "move() {\n let new_position = this.currentPosition_xy.slice(0);\n if (this.direction === 'N') {\n new_position[1] = (new_position[1] + 1) % (this.grid_xy[1] + 1); // use modulo to return 0 for pos no.\n } else if (this.direction === 'E') {\n new_position[0] = (new_position[0] + 1) % (this.grid_xy[0] + 1); // use modulo to return 0 for pos no.\n } else if (this.direction === 'S') {\n new_position[1] -= 1;\n if (new_position[1] < 0) {\n // addresses roll over case, neg\n new_position[1] += this.grid_xy[1] + 1;\n }\n } else if (this.direction === 'W') {\n new_position[0] -= 1;\n if (new_position[0] < 0) {\n // addresses roll over case, neg\n new_position[0] += this.grid_xy[0] + 1;\n }\n }\n if (!this.hasObstacles()) {\n this.currentPosition_xy = new_position;\n }\n }", "title": "" }, { "docid": "e3c9206c5bbfc30102e80d1a4f93552f", "score": "0.53287977", "text": "function moveSomething(e) {\n switch(e.keyCode) {\n case 37: //left\n x -= 4;\n moveCtx(x, y);\n break;\n case 38: //up\n y -= 4;\n moveCtx(x, y); \n break;\n case 39: //right\n x += 4;\n moveCtx(x, y); \n break;\n case 40: //down\n y += 4;\n moveCtx(x, y); \n break; \n } \n}", "title": "" }, { "docid": "13413543c68ebd236d405cab67fdf80d", "score": "0.53269786", "text": "moveActiveDown() { this.moveActive(0, 1) }", "title": "" } ]
034a277c4f1eb4fc5c6dd543df79470f
Renders the shoe product based on the incoming 'product' array/API call
[ { "docid": "912402b336c9f543c6c63c6bab2b5b20", "score": "0.6072076", "text": "function renderProduct(p) {\n return (\n <div key={p.id} className=\"product\">\n <Link to={`/${category}/${p.id}`}>\n <img src={`/images/${p.image}`} alt={p.name} />\n <h3>{p.name}</h3>\n <p>${p.price}</p>\n </Link>\n </div>\n );\n }", "title": "" } ]
[ { "docid": "7dd014a91955523b97d76c1e629d7150", "score": "0.7338014", "text": "function renderProduct(data) {\n var product = data.data;\n var baseUrl = window.location.origin;\n\n for (x in product) {\n var strHtml = '';\n strHtml += '<!-- product -->';\n strHtml += '<div class=\"col-md-4 col-xs-6\">';\n strHtml += '<div class=\"product\">'\n strHtml += '<a href=\"' + baseUrl + '/shop_project/public/product/' + product[x].id + '\">';\n strHtml += '<div class=\"product-img\">'\n strHtml += '<img src = \"' + baseUrl + '/shop_project/public' + product[x].picture + '\" alt = \"' + product[x].name + '\">';\n strHtml += '<div class=\"product-label\">'\n if (product[x].sale) {\n strHtml += '<span class=\"sale\">-' + product[x].sale + '%</span>'\n }\n if (product[x].new) {\n strHtml += '&nbsp;<span class=\"new\">NEW</span>'\n }\n strHtml += '</div>'\n strHtml += '</div>'\n strHtml += '</a>'\n strHtml += '<div class=\"product-body\">'\n strHtml += '<p class=\"product-category\">' + product[x].category.name + '</p>'\n strHtml += '<h3 class=\"product-name\"><a href=\"' + baseUrl + '/shop_project/public/product/' + product[x].id + '\">' + product[x].name + '</a></h3>'\n strHtml += '<h4 class=\"product-price\">' + (product[x].price - product[x].price * product[x].sale / 100) + '$ </h4>'\n if (product[x].sale) {\n strHtml += '<del class=\"product-old-price\">' + product[x].price + '$</del>'\n } else {\n strHtml += '<br />'\n }\n strHtml += '<div class=\"product-rating\">'\n for (i = 0; i < product[x].rating; i++) {\n if (i == 0) {\n strHtml += '<i class=\"fa fa-star\"></i>'\n } else {\n strHtml += '&nbsp;<i class=\"fa fa-star\"></i>'\n }\n }\n strHtml += '</div>'\n strHtml += '<div class=\"product-btns\">'\n strHtml += '<button class=\"add-to-wishlist\"><i class=\"fa fa-heart-o\"></i><span class=\"tooltipp\">addto wishlist</span></button>'\n strHtml += '&nbsp;<button class=\"add-to-compare\"><i class=\"fa fa-exchange\"></i><span class=\"tooltipp\">addto compare</span></button>'\n strHtml += '&nbsp;<button class=\"quick-view\"><i class=\"fa fa-eye\"></i><span class=\"tooltipp\">quickview</span></button>'\n strHtml += '</div>'\n strHtml += '</div>'\n strHtml += '<div class=\"add-to-cart\">'\n strHtml += '<button class=\"add-to-cart-btn\"><i class=\"fa fa-shopping-cart\"></i> add to cart</button>'\n strHtml += '</div>'\n strHtml += '</div>'\n strHtml += '</div>'\n strHtml += '<!-- /product -->'\n $(strHtml).appendTo('#areaProduct');\n }\n }", "title": "" }, { "docid": "3f1d8ee30bb622d6f9f1e66c50fd9c31", "score": "0.7288909", "text": "function renderProductList () {\n for(var i=0; i<products.length; i++) {\n renderProduct (products[i]);\n }\n}", "title": "" }, { "docid": "9551bfc52002452b4d1ac7686e513847", "score": "0.6896743", "text": "render(productList) {\n let product = document.getElementById(\"product\");\n for(let i = 0; i < productList.length; i++){\n product.innerHTML += this.renderOneTeddy(productList[i]);\n }\n }", "title": "" }, { "docid": "ce0a6ed855f8d74f451d9d663710510e", "score": "0.68912435", "text": "function renderProduct(data) {\n let allProducts = document.querySelector(\".allProducts\");\n let product = data.data;\n \n // pagingURL for scroll event\n if (data.paging !== undefined) {\n pagingURL = `${API_HOST_Products}/${type}?paging=${data.paging}`;\n console.log(pagingURL)\n window.addEventListener(\"scroll\", handleScroll);\n } else {\n pagingURL = \"\";\n window.removeEventListener(\"scroll\", handleScroll);\n };\n\n // start creating product from JSON data\n for (let i = 0; i < product.length; i++) {\n let productContainer = document.createElement(\"a\");\n productContainer.setAttribute(\"class\", \"productContainer\");\n productContainer.setAttribute(\"href\", `product.html?id=${product[i].id}`);\n // div.productImage\n let productImage = document.createElement(\"img\");\n productImage.setAttribute(\"class\", \"productImage\");\n productImage.setAttribute(\"src\", `${product[i].main_image}`);\n productContainer.appendChild(productImage);\n // div.allColors\n let allColors = document.createElement(\"div\");\n allColors.setAttribute(\"class\", \"allColors\");\n productContainer.appendChild(allColors);\n // div.allColors (individual color chip)\n for (let j = 0; j < product[i].colors.length; j++) { \n let colorChip = document.createElement(\"div\");\n colorChip.setAttribute(\"class\", \"colorChip\");\n colorChip.setAttribute(\"title\", product[i].colors[j].name);\n colorChip.setAttribute(\"style\", `background-color:#${product[i].colors[j].code};`);\n allColors.appendChild(colorChip);\n };\n /* ------- forEach also works for colorChip\n product[i].colors.forEach(color => {\n colorChip = document.createElement(\"div\");\n colorChip.setAttribute(\"class\", \"color\");\n colorChip.setAttribute(\"style\", \"background-color:#\" + color.code);\n colorChip.title = color.name;\n allColors.appendChild(colorChip);\n });\n ------- */\n // div.productName\n let productName = document.createElement(\"div\");\n productName.setAttribute(\"class\", \"productName\");\n productName.innerHTML = product[i].title;\n productContainer.appendChild(productName);\n // div.productPrice\n let productPrice = document.createElement(\"div\");\n productPrice.setAttribute(\"class\", \"productPrice\");\n productPrice.appendChild(document.createTextNode(`TWD.${product[i].price}`))\n productContainer.appendChild(productPrice);\n allProducts.appendChild(productContainer);\n };\n}", "title": "" }, { "docid": "895fe8ea7470c3a86db299f4f45aa2bb", "score": "0.6881089", "text": "function renderProducts() {\n $(\"#productsHTML\").empty();\n for (var i = 0; i < products.productList.length; i++) {\n var value = products.productList[i];\n renderProduct(value);\n }\n}", "title": "" }, { "docid": "4fea8011d4dd02afd341b821c85619ca", "score": "0.6800478", "text": "function display_products() {\n console.log(\"displaying products\");\n\n str = '';\n for (product in products){\n str += `\n <div id=\"prod_${product}\" style=\"display:none\"><h3>${products[product].range} ${products[product].model} at \\$${products[product].price}</h3>\n <img src=\"${products[product].image}\" alt=\"product image\" width=\"100\"></div>\n `;\n }\n return str;\n}", "title": "" }, { "docid": "9b2809d4aaa49d25dde8574c03aa3276", "score": "0.67813027", "text": "async renderProducts(num) {\n let me = this;\n let debugInfo = me.root.getElementById('debugInfo');\n // TODO: replace!\n let items = ['Shirt', 'Kite', 'Wakeboard', 'Bindung', 'Trapez'];\n var item = items[Math.floor(Math.random() * items.length)];\n let res = await getProducts(item);\n if (res) {\n let prods = res.body.data.products;\n console.log('prods', prods);\n if (typeof debugInfo !== 'undefined') {\n //debugInfo.innerHTML = JSON.stringify(prods);\n let str = '<p class=\"text-lg text-black font-semibold\">OXID GraphQL Products</p>';\n let count = 0;\n prods.forEach(function(p) {\n // TODO: replace!\n if (count < num) {\n let button = '';\n if (p.variants.length === 0) {\n button = `\n <button id=\"${p.id}\" class=\"wkbutton rounded-lg bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-2 rounded\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Layer_1\" enable-background=\"new 0 0 510.735 510.735\" height=\"35\" viewBox=\"0 0 510.735 510.735\" width=\"35\"><path d=\"m482.082 171.571h-51.609l-71.834-135.683c-3.876-7.321-12.951-10.114-20.275-6.238-7.321 3.876-10.114 12.954-6.238 20.275l64.403 121.646h-282.41l64.403-121.646c3.876-7.321 1.083-16.399-6.238-20.275-7.319-3.875-16.399-1.083-20.275 6.238l-71.835 135.683h-51.521c-15.799 0-28.653 12.854-28.653 28.653v33.321c0 15.134 11.796 27.557 26.677 28.577l50.322 209.217c1.621 6.741 7.651 11.492 14.584 11.492h327.47c6.93 0 12.958-4.748 14.582-11.484l50.44-209.227c14.873-1.028 26.66-13.447 26.66-28.575v-33.321c0-15.799-12.853-28.653-28.653-28.653zm-452.082 30h450.735v30.626h-450.735zm403.846 140.895h-65.674l10.022-80.269h75.003zm-163.458 110.365v-80.365h63.805l-10.034 80.365zm-83.774 0-10.043-80.365h63.817v80.365zm-129.063-190.634h75.008l10.031 80.269h-65.732zm105.24 0h77.597v80.269h-67.566zm107.597 80.269v-80.269h77.573l-10.022 80.269zm-186.315 30h62.265l10.043 80.365h-52.978zm323.166 80.365h-52.847l10.034-80.365h62.187z\"/></svg>\n </button>`;\n }\n str += `\n <div class=\"box-article\">\n <br><img style=\"float: left\" src=\"${p.imageGallery.images[0].icon}\"/>\n <div style=\"margin-top: 3px\"><a style=\"font-family: sans-serif;float: left;margin-left: 10px;color: #000\" target=\"_blank\" href=\"${p.seo.url}\">${p.title}</a><br></div>\n <div class=\"wrapper\"></div> \n ${button}\n </div>`;\n count++;\n }\n });\n debugInfo.innerHTML = str;\n // add button event listener\n const buttons = me.root.querySelectorAll('.wkbutton');\n buttons.forEach(b => {\n b.addEventListener('click', async function (e) {\n await me.addItem(b.id, 1);\n })\n });\n } \n }\n }", "title": "" }, { "docid": "01b406a0e194847685a935f5b23867cc", "score": "0.67280227", "text": "function drawProducts() {\n //gets products from the vend service\n let products = vendService.getProducts()\n let template = ''\n //builds template from each prodcut into template string\n for (let i = 0; i < products.length; i++) {\n const product = products[i];\n if (product.quantity > 0) {\n template += `\n <div>\n <p>${product.name} - ${product.price} Qt. ${product.quantity}</p>\n <button onclick=\"app.controllers.vendController.vendItem(${i})\">BUY</button>\n </div>\n `\n }\n }\n //adds template string to table\n document.getElementById('products').innerHTML = template\n}", "title": "" }, { "docid": "175947594aae53872e4d03dfae47959a", "score": "0.6701926", "text": "function renderProduct(product) {\n\n $subtractBtn = $(\"<a>\").addClass(\"btn-floating halfway-fab waves-effect waves-light bg-yellow btn-subtract\").append($(\"<i>\").addClass(\"material-icons\").text(\"trending_down\"));\n\n $productTitle = $(\"<div>\").addClass(\"card-image\").append($(\"<span>\").addClass(\"card-title\").text(product.name)).append($subtractBtn);\n\n $productContent = $(\"<div>\").addClass(\"card-content\").append($(\"<p>\").text(\"quantity : \" + product.quantity)).append($(\"<p>\").text(\"packaging size : \" + product.packagingSize)).append($(\"<p>\").text(\"expiration date : \" + product.expirationDate));\n\n $product = $(\"<div>\").addClass(\"col s12 m6 m4\").append($(\"<div>\").addClass(\"card\").attr(\"id\", product.name).append($productTitle).append($productContent));\n\n $(\"#productsHTML\").append($product);\n\n}", "title": "" }, { "docid": "a17ea1a684c10920357dee51b14680db", "score": "0.6661504", "text": "function displayProduct() {\n loadProduct();\n loadCart();\n\n let product_page = document.querySelector(\".product_page\");\n let output = \"\";\n let product_warning = document.querySelector(\".product_warning\");\n //check if the product not exists\n if(product_array.length < 1) {\n product_warning.innerHTML = \"Product not found\";\n }\n // if the product exists\n else {\n let item_size = \"\";\n product_array.forEach(function(product) {\n let prev_price = \"\";\n if(product.status === \"sales\") {\n prev_price = \"$\"+product.deletedprice;\n } else {\n prev_price = \"\";\n }\n let megethos = \"\";\n\n output += \"<div class='product_left'><div class='product_left_pic'><img src='\"+product.picture+\"'></div></div>\";\n output += \"<div class='product_right'><div class='product_right_content'><p class='product_right_name'>\"+product.name+\"</p>\";\n if(product.status === \"sales\") {\n prev_price = product.deletedprice;\n output += \"<p class='product_right_price'><span class='right_prev_price'>\"+prev_price+\"<span class='euroFont'> &euro;</span></span><span class='current_price_display'>\"+product.price+\"<span class='euroFont'> &euro;</span></span></p>\";\n } else {\n output += \"<p class='product_right_price'><span class='current_price_display'>$\"+product.price+\"</span></p>\";\n }\n output += \"<p class='product_right_size'>Size</p>\";\n if( (product.category === 'jacket') || (product.category === 'fur') || (product.category === 'shirt') ) {\n megethos += \"<p class='xs size_inline' data-size='xs'>XS</p><p class='s size_inline' data-size='s'>s</p><p class='m size_inline' data-size='m'>M</p><p class='l size_inline' data-size='l'>L</p><p class='xl size_inline' data-size='xl'>XL</p>\";\n output += megethos;\n } else if(product.category === \"shoes\") {\n megethos += \"<select class='size_select'><option></option><option>35</option><option>36</option><option>37</option><option>38</option><option>39</option><option>40</option><option>41</option>\";\n megethos += \"<option>42</option><option>43</option><option>44</option><option>45</option><option>46</option>\";\n megethos += \"</select>\";\n output += megethos;\n } else if( (product.category === \"sunglasses\") || (product.category === 'accessories') || (product.category === 'hat') ) {\n megethos += \"<p class='one_size'>This product is one size.</p>\";\n output += megethos;\n }\n output += \"<div class='wish_cart_display_icons' data-category='\"+product.category+\"' data-the_product='\"+product.the_product+\"' data-desc='\"+product.name+\"' data-price='\"+product.price+\"' data-pic='\"+product.picture+\"'><img src='images/wish.png' class='product_display_wish'><img src='images/cart.png' class='product_display_cart' data-category='\"+product.category+\"' data-the_product='\"+product.the_product+\"' data-desc='\"+product.name+\"' data-price='\"+product.price+\"' data-pic='\"+product.picture+\"'></div>\";\n output += \"<p class='available'>Available</p>\";\n output += \"<p class='product_wish_add_p' data-desc='\"+product.name+\"'>Added to the wishlist</p>\";\n output += \"<p class='warning_cart_product'></p>\";\n output += \"<div class='cart_margin'><p class='product_cart_add_p' data-desc='\"+product.name+\"'>Added to the cart</p></div>\";\n output += \"</div>\";\n output += \"</div>\";\n\n});\n product_page.innerHTML = output;\n\n product_array.forEach(function(product) {\n if( (product.category === \"jacket\") || (product.category === \"shirt\") || (product.category === \"fur\") ) {\n let size_inline = document.querySelectorAll(\".size_inline\");\n size_inline.forEach(function(size) {\n size.addEventListener('click', function() {\n clearColor(size_inline);\n\n size.style.border = \"2px solid #000\";\n item_size = size.dataset.size;\n\n });\n });\n }\n});\n\n\n let size_select = document.querySelector(\".size_select\");\n // add product to the cart\n let product_display_cart = document.querySelectorAll(\".product_display_cart\");\n product_display_cart.forEach(function(the_icon) {\n the_icon.addEventListener('click', function() {\n data_category = the_icon.dataset.category;\n if(data_category === \"shoes\") {\n item_size = size_select[size_select.selectedIndex].value;\n } else if( (data_category === \"accessories\") || (data_category === \"sunglasses\") || (data_category === \"hat\") ) {\n item_size = \"No sizes\";\n }\n let the_product = the_icon.dataset.the_product;\n let name = the_icon.dataset.desc;\n let price = parseInt(the_icon.dataset.price);\n let picture = the_icon.dataset.pic;\n\n let warning_cart_product = document.querySelector(\".warning_cart_product\");\n if( (data_category === \"jacket\") || (data_category === \"shoes\") || (data_category === \"fur\") || (data_category === \"shirt\") ) {\n if(item_size === \"\") {\n warning_cart_product.style.display = \"block\";\n warning_cart_product.innerHTML = \"Choose your size\";\n return;\n }\n }\n\n // increace the counter\n number++;\n let the_cart_count = document.querySelectorAll(\".the_cart_count\");\n let counterCart = document.querySelectorAll(\".counterCart\");\n let counterCart_p = document.querySelectorAll(\".counterCart p\");\n counterCart.forEach(function(counter) {\n counter.style.display = \"block\";\n setTimeout(function() {\n counter.style.background = \"green\";\n }, 2000);\n });\n\n // cart icon\n counterCart.forEach(function(counter) {\n counter.style.background = \"green\";\n counter.style.borderColor = \"green\";\n counter.style.transform = \"scale(1.2)\";\n setTimeout(function() {\n counter.style.background = \"#909090\";\n counter.style.borderColor = \"#909090\";\n counter.style.transform = \"scale(1)\";\n }, 2000);\n });\n\n // add counter to cart icon\n counterCart_p.forEach(function(counter_p) {\n counter_p.innerHTML = number;\n setTimeout(function() {\n counter_p.style.color = \"#fff\";\n }, 2000);\n });\n\n the_cart_count.forEach(function(the_count) {\n the_count.innerHTML = \"My cart (\"+number+\")\";\n });\n\n addItem(name, price, picture, 1, number, item_size);\n let product_cart_add = document.querySelectorAll(\".product_cart_add[data-desc='\"+name+\"']\")[0];\n let product_cart_add_p = document.querySelectorAll(\".product_cart_add_p[data-desc='\"+name+\"']\")[0];\n addedThePTotheCart(product_cart_add_p);\n warning_cart_product.style.display = \"none\";\n warning_cart_product.innerHTML = \"\";\n let size_inline = document.querySelectorAll(\".size_inline\");\n if( (data_category === \"jacket\") || (data_category === \"shoes\") || (data_category === \"fur\") || (data_category === \"shirt\") ) {\n item_size = \"\";\n }\n clearColor(size_inline);\n saveCart();\n });\n });\n\n // add product to the wishList\n let wish_icon = document.querySelectorAll(\".product_display_wish\");\n if(wish_icon) {\n wish_icon.forEach(function(the_wish) {\n the_wish.addEventListener('click', function(e) {\n\n let the_product = the_wish.parentNode;\n let name = the_product.dataset.desc;\n let picture = the_product.dataset.pic;\n let price = parseInt(the_product.dataset.theprice);\n\n // check if already add the item to the wishList\n\n for(let i in wishCart) {\n if(wishCart[i].name === name) {\n let product_wish_add_p = document.querySelectorAll(\".product_wish_add_p[data-desc='\"+name+\"']\")[0];\n warningProductCart(product_wish_add_p);\n return;\n }\n }\n\n // increase the counter of items\n numberWish++;\n let counterWish = document.querySelectorAll(\".counterWish\");\n let counterWish_p = document.querySelectorAll(\".counterWish p\");\n\n counterWish.forEach(function(counter) {\n counter.style.display = \"block\";\n counter.style.background = \"green\";\n counter.style.borderColor = \"green\";\n counter.style.transform = \"scale(1.2)\";\n setTimeout(function() {\n counter.style.transform = \"scale(1)\";\n counter.style.borderColor = \"#909090\";\n counter.style.background = \"#909090\";\n }, 1000);\n });\n\n // add number to wishlist icon\n counterWish_p.forEach(function(counter_p) {\n counter_p.innerHTML = numberWish;\n setTimeout(function() {\n counter_p.style.color = \"#fff\";\n }, 2000);\n });\n\n addToWish(the_product, name, price, picture);\n let product_wish_add_p = document.querySelectorAll(\".product_wish_add_p[data-desc='\"+name+\"']\")[0];\n product_wish_add_p.style.display = \"inline-block\";\n });\n });\n }\n }\n}", "title": "" }, { "docid": "1d1cfd605fd4be5a9eeff9d072df91b5", "score": "0.6633857", "text": "render() {\n let self = this;\n\n if (store.state.products.length === 0 ) {\n\n return;\n\n } else {\n\n // Get the products from the state\n let products = store.state.products[0]['products'];\n\n // Filter the products\n this.filterProductsArray(products);\n\n // Create string from the products object\n let productString = this.createProductListString(products);\n\n // Render it to the DOM\n self.element.innerHTML = productString;\n }\n }", "title": "" }, { "docid": "be35008634f9e5cde0b8fa0fb322081b", "score": "0.66261226", "text": "renderProducts() {\n if (!(this.props.productsList[0] == undefined)) {\n if (this.props.productsList[0].count == 0 ) {\n return (\n <h3 className=\"no-products\">No products to display</h3>\n )\n } else {\n return (\n this.props.productsList[0].products.map((product) => {\n return (\n <span className=\"product col-sm-4\">\n <div className=\"card-container\">\n <span className=\"product-category\"> Category: { product.category } </span>\n <span className=\"product-price\"> ${ product.price } </span>\n <div className=\"card-inner\">\n <img src={product.image}></img>\n </div>\n <span className=\"product-name\" key= {product._id }> { product.name } </span>\n </div>\n </span>\n )\n })\n )\n }\n } else {\n return <div>Loading...</div>\n }\n }", "title": "" }, { "docid": "1e6294476d3f89dbcb3fca5f8bf73cfc", "score": "0.65904623", "text": "function displayProduct(product) {\r\n\t\tlet imgUrl = product.url;\r\n\t\tlet name = product.name;\r\n\t\tlet price = product.price;\r\n\t\t$('.products').append('\\\r\n\t\t\t<div class=\"products-grid text-center mt-2\">\\\r\n\t\t\t\t<div class=\"m-2 h-100 border\">\\\r\n\t\t\t\t\t<img src=\"' + imgUrl + '\">\\\r\n\t\t\t\t\t<br><p>' + name + '</p>\\\r\n\t\t\t\t\t<p>Rs. ' + price + '</p>\\\r\n\t\t\t\t</div>\\\r\n\t\t\t</div>');\r\n $('.products-grid div').on( {\r\n click: function() {openProduct(product);},\r\n mouseover: function() {$(this).addClass('shadow');},\r\n mouseout: function() {$(this).removeClass('shadow');}\r\n });\r\n\t}", "title": "" }, { "docid": "2d32bfec06054354c66da898f0c045d6", "score": "0.65320206", "text": "function showRelatedProducts(array){\n getJSONData(PRODUCTS_URL).then(function(resultObj) { \n if (resultObj.status === \"ok\") {\n productList = resultObj.data;\n\n let htmlRelatedProducts = \"\";\n\n for (let i = 0; i <array.length; i++ ) {\n let relatedProductsPosition = array[i];\n let relatedProducts = productList[relatedProductsPosition];\n \n htmlRelatedProducts +=`\n \n <div class=\"card-group mt-6\">\n <div class=\"card\" style=\"width: 18rem;\">\n <img class=\"card-img-top\" src=\"` + relatedProducts.imgSrc +`\">\n <div class=\"card-body\">\n <h5 class=\"card-title\"> ` + relatedProducts.name +`</h5>\n <p class=\"card-text\">` + relatedProducts.description +`</p>\n <a href=\"product-info.html\" class=\"btn btn-primary\">Ver producto</a>\n </div\n </div>\n </div>\n `\n }\n\n document.getElementById(\"relatedProductContainer\").innerHTML = htmlRelatedProducts;\n };\n\n });\n}", "title": "" }, { "docid": "777b2ce068b0e9224ab1972d767962a8", "score": "0.6517549", "text": "function DisplayProduct() {\n const fetchPromise = fetch('http://localhost:8188/DairyService.svc/items',\n {\n headers: {\n \"Accept\": \"application/json\",\n },\n });\n const streamPromise = fetchPromise.then((response) => response.json());\n\n let section = document.getElementById(\"productpage\");\n let imgurl = \"http://localhost:8188/DairyService.svc/itemimg?id=\";\n\n const get = (data) => {\n let products, image, ItemId, Origin, Price, Title, Type, button;\n for (let i = 0; i < data.length; i++) {\n products = document.createElement(\"div\");\n products.className += \"products\";\n image = document.createElement(\"img\");\n Title = document.createElement(\"h3\")\n Origin = document.createElement(\"h3\");\n Price = document.createElement(\"h3\");\n Type = document.createElement(\"h3\")\n button = document.createElement(\"button\");\n\n ItemId = data[i].ItemId;\n image.src = imgurl + ItemId;\n products.id += ItemId;\n Title.innerHTML = data[i].Title;\n Origin.innerHTML = \"Made in \" + data[i].Origin;\n Price.innerHTML = \"$\" + data[i].Price;\n Type.innerHTML = data[i].Type;\n button.innerHTML = \"Buy\";\n button.id += data[i].ItemId;\n button.setAttribute(\"onclick\", \"buyProduct(this.id)\");\n\n products.appendChild(image);\n products.appendChild(Title);\n products.appendChild(Origin);\n products.appendChild(Type);\n products.appendChild(Price);\n products.appendChild(button)\n section.appendChild(products);\n }\n }\n streamPromise.then(get);\n}", "title": "" }, { "docid": "092ce69596234165c191a96b77ad186e", "score": "0.64965546", "text": "function renderProductsDisplay() {\n let productsHTML = '<div class=\"cardsDiv\">'; //opening a div section\n\n allProductsNow.forEach((features) => {\n const {\n id,\n name,\n image,\n oldPrice,\n price,\n description,\n installments,\n } = features;\n\n const productHTML = `\n <div class=\"productCard\">\n <div class=\"imageDiv\">\n <img src=\"${image}\" alt=\" foto de ${name}\" />\n </div>\n <div class=\"infoDiv\">\n <p class=\"cardName\">${name}</p>\n <p class=\"cardDescription\">${description}</p>\n <p class=\"cardOldPrice\">De: R$${oldPrice.toFixed(2)}</p>\n <p class=\"cardPrice\">Por: R$${price.toFixed(2)}</p>\n <p class=\"cardInst\">\n ou ${installments.count}x de R$${installments.value.toFixed(2)}\n </p>\n <button id=\"${id}\" class=\"cardButton\">Comprar</button>\n </div>\n </div>\n `;\n\n productsHTML += productHTML;\n });\n\n productsHTML += '</div>'; //closing div section\n\n productsDisplay.innerHTML = productsHTML;\n}", "title": "" }, { "docid": "3861bcfd2a603733ae9cd4a234f4d827", "score": "0.649523", "text": "render() //Display the fetched data from the API\n {\n var productController = this;\n const productHTMLList = [];\n\n for (var i=0; i < productController._items.length; i++)\n {\n const item = productController._items[i]; //assign the individual item to the variable\n\n //var loc = window.location.href;\n //var full = item.oImageUrl.pathname;\n\n const productHTML = createHTMLList(item.oTitle, item.oDescription, item.oTargetDate);\n\n productHTMLList.push(productHTML);\n }\n\n //Join all the elements/items in my productHTMLList array into one string, and separate by a break\n const pHTML = productHTMLList.join('\\n');\n const itemsContainer = document.querySelector('#row');\n itemsContainer.innerHTML = pHTML;\n\n\n //addEventListener - click\n /*\n for (var i=0; i < productController._items.length; i++)\n {\n const item = productController._items[i];\n document.getElementById(i).addEventListener(\"click\", function() { displayProductDetails(item);});\n }*/\n }", "title": "" }, { "docid": "e1bb539eddfc973dbd903837f54dd326", "score": "0.64834934", "text": "function productsShow() {\n let productsList = '';\n API.products.forEach(function (el) {\n productsList +=\n '<div class=\"product\" data-id=\"' + el.id + '\">' +\n ' <div class=\"product-image\">' +\n ' <img src=\"' + el.img + '\" alt=\"\">' +\n ' </div>' +\n ' <div class=\"product-info\">' +\n ' <div class=\"product-info__name\">' + el.title + '</div>' +\n ' <div class=\"product-info__price\">' + el.price.toLocaleString('ru-RU') + ' руб.</div>' +\n ' </div>' +\n ' <div class=\"product-buttons\">' +\n ' <button class=\"btn btn--primary product-buttons__order\">Заказать</button>' +\n ' <button class=\"btn btn--secondary product-buttons__cart\">В корзину</button>' +\n ' </div>' +\n '</div>';\n });\n goodsPlace.insertAdjacentHTML('beforeEnd', productsList);\n productBtnsListener();\n order();\n }", "title": "" }, { "docid": "c28b36646972b9a71eaee48ac58330e8", "score": "0.6480178", "text": "function createDisplay(products){\n const display_container = '<div class=\"product_display_container\"></div>';\n const title = '<div class=\"product_display_header\">' + products.name + ' for ' + products.device_model + '(' + products.color + ')</div>';\n let image;\n if(products.back_img_location && products.side_img_location) {\n image = '<div class=\"product_display_all_images\">' +\n '<img class=\"product_display_front\" src=\"../public/images/' + products.front_img_location + '\">' +\n '<div class=\"product_display_small_images\">' +\n '<img class=\"product_display_back\" src=\"../public/images/' + products.back_img_location + '\">' +\n '<img class=\"product_display_side\" src=\"../public/images/' + products.side_img_location + '\">' +\n '</div>' +\n '</div>';\n }else if(products.front_img_location){\n image = '<div class=\"product_display_all_images\">' +\n '<img class=\"product_display_front\" src=\"../public/images/' + products.front_img_location + '\">' +\n '</div>';\n }else{\n image = '<div class=\"product_display_all_images\">' +\n '<img class=\"product_display_front\" src=\"../public/images/placeholder150-min.png\">' +\n '</div>';\n }\n const description = '<div class=\"product_display_description_header\">Description</div>' +\n '<div class=\"product_display_description_body\">' + products.description + '</div>';\n const product_upc = '<div class=\"product_display_upc\">UPC: ' + products.upc + '</div>';\n const sku = '<div class=\"product_display_sku\">SKU: ' + products.sku + '</div>';\n const quantity = '<div class=\"product_display_quantity\"><span class=\"in_stock\">In Stock</span><span class=\"in_stock_amount\">' + products.quantity + '</span></div>';\n const price_container = '<div class=\"product_price_container\"></div>';\n const retail_price = '<div class=\"product_display_msrp\">MSRP $' + products.retail_price + '</div>';\n const wholesale_table = '<div class=\"product_display_wholesale\">' +\n '<table style=\"width: 100%\">' +\n '<tr>' +\n '<th>QTY:</th>' +\n '<th>1-50</th>' +\n '<th>51-200</th>' +\n '<th>201-349</th>' +\n '<th>350-499</th>' +\n '<th>500-999</th>' +\n '<th>1000-2999</th>' +\n '<th>3000-4999</th>' +\n '<th>5000+</th>' +\n '</tr>' +\n '<tr>' +\n '<td></td>' +\n '<td>$' + products[\"tier1_1-50\"] + '</td>' +\n '<td>$' + products[\"tier2_51-200\"] + '</td>' +\n '<td>$' + products[\"tier3_201-349\"] + '</td>' +\n '<td>$' + products[\"tier4_350-499\"] + '</td>' +\n '<td>$' + products[\"tier5_500-999\"] + '</td>' +\n '<td>$' + products[\"tier6_1000-2999\"] + '</td>' +\n '<td>$' + products[\"tier7_3000-4999\"] + '</td>' +\n '<td>$' + products[\"tier8_5000\"] + '</td>' +\n '</tr>' +\n '</table>' +\n '</div>';\n $('.product_display').append(display_container);\n $('.product_display_container').append(title, image, description, product_upc, sku, quantity, price_container);\n $('.product_price_container').append('<div><b>Pricing</b></div>',retail_price, wholesale_table)\n}", "title": "" }, { "docid": "e0531bbbe0d25e626aab7fa97ce3ee99", "score": "0.6455963", "text": "function renderProducts(listOfProducts) {\n $('#productWrapper').html(\"\");\n for (let product of listOfProducts) {\n // Part of REQUIREMENT D: If this product is out of stock - you cant add it to cart\n if (product.AvailableProducts === 0) {\n $('#productWrapper').append(`\n <div class=\"product\" id=\"${product.Id}\">\n <h3 class=\"productName\">${product.Name}</h3>\n <img src=\"${product.Image}\" alt=\"\">\n <p>Sorry! This product is out of stock</p>\n </div>\n `)\n } else {\n $('#productWrapper').append(`\n <div class=\"product\" id=\"${product.Id}\">\n <h3 class=\"productName\">${product.Name}</h3>\n <img src=\"${product.Image}\" alt=\"\">\n <p>Available products: ${product.AvailableProducts}</p>\n <button class=\"addToCart\">Add to cart</button>\n </div>\n `)\n }\n }\n}", "title": "" }, { "docid": "4621aaf6506ebc7b093d35504d07304d", "score": "0.64396816", "text": "renderProducts(){\n return this.state.products.map((product, idx) => (\n <li key={idx}>\n <div className=\"product\">\n <div className=\"img-wrapper\">\n <img className=\"imgsrc\" src={product.image} alt={product.name}/>\n </div>\n <span className=\"line-divider\"></span>\n <div className=\"description\">\n <div className=\"name\">\n <small>Name</small>\n <div className=\"elipsis -hyperlink\" onClick={() =>{\n this.handleProductDetails(product);\n }}>{product.name}</div>\n </div>\n <div className=\"category\">\n <small>Category</small>\n <div className=\"cbs-badge\">\n <div className=\"elipsis\">{product.category}</div>\n </div>\n </div>\n </div>\n </div>\n </li>\n ))\n }", "title": "" }, { "docid": "3e2d04829ef9b51404a6499af2292e41", "score": "0.6419379", "text": "function showProduct(objectURL, product) {\n // create <section>, <h2>, <p>, and <img> elements\n const section = document.createElement('section');\n const heading = document.createElement('h2');\n const para = document.createElement('p');\n const image = document.createElement('img');\n\n // give the <section> a classname equal to the product \"type\" property so it will display the correct icon\n section.setAttribute('class', product.type);\n\n // Give the <h2> textContent equal to the product \"name\" property, but with the first character\n // replaced with the uppercase version of the first character\n heading.textContent = product.name.replace(product.name.charAt(0), product.name.charAt(0).toUpperCase());\n\n // Give the <p> textContent equal to the product \"price\" property, with a $ sign in front\n // toFixed(2) is used to fix the price at 2 decimal places, so for example 1.40 is displayed\n // as 1.40, not 1.4.\n para.textContent = '$' + product.price.toFixed(2);\n\n // Set the src of the <img> element to the ObjectURL, and the alt to the product \"name\" property\n image.src = objectURL;\n image.alt = product.name;\n\n // append the elements to the DOM as appropriate, to add the product to the UI\n main.appendChild(section);\n section.appendChild(heading);\n section.appendChild(para);\n section.appendChild(image);\n }", "title": "" }, { "docid": "7c812a39b57e78d4e7ecd13fffdc6f38", "score": "0.63607466", "text": "function displayItems(products) {\n products.forEach(product => {\n \n // Crée une div pour l'affichage des produits\n const productCard = document.createElement('div');\n productCard.setAttribute('id', product._id);\n productCard.setAttribute('class', 'card p-3 m-3');\n\n // Affiche l'image des produits\n const productImg = document.createElement('img');\n productImg.setAttribute('src', product.imageUrl);\n productImg.setAttribute('class', 'img-fluid');\n productImg.setAttribute('style', 'max-width: 400px');\n productCard.appendChild(productImg);\n\n // Affiche le nom des produits\n const productName = document.createElement('h3');\n productName.setAttribute('class', 'name card-title pt-2');\n productName.innerHTML = product.name;\n productCard.appendChild(productName);\n\n // Affiche le prix des produits\n const productPrice = document.createElement('p');\n productPrice.setAttribute('class', 'price');\n productPrice.innerHTML = product.price.toFixed(2) /100 + ',00 €';\n productCard.appendChild(productPrice); \n\n // Crée le bouton \"Voir plus\" sur chaque carte produit\n const productLink = document.createElement('a');\n productLink.setAttribute('href', 'product.html?id=' + product._id);\n productLink.setAttribute('class', 'link btn bg-pink btn-outline-dark');\n productLink.innerHTML = 'Voir plus ➔ ';\n productCard.appendChild(productLink); \n \n // Insère la div \"productCard\" dans la div nommée \"products\"\n document.getElementById('products').appendChild(productCard);\n });\n}", "title": "" }, { "docid": "eb032da4313de48895931daa053812e1", "score": "0.6356002", "text": "function showProducts(products){\n\t\tfor(var i in products){\n\t\t\tproducts[i].ImagePath = randomImagePath();\n\t\t\tvar a = new Date();\n\t\t\tproducts[i].CreationDate = a.getDate() + \"/\" + a.getMonth()+1 + \"/\" + a.getFullYear();\n\t\t\tproducts[i].CategoryName = getCategoryNameByCategoryID(products[i].CategoryID,allCategories);\n\t\t\tproducts[i].ProductQty = 0;\n\t\t\tshowProduct(products[i],\"products-holder\");\n\t\t }\n\t}", "title": "" }, { "docid": "796951ffb2de658edd80cca907f99190", "score": "0.6335952", "text": "function showProducts(array) {\n var res = '';\n $.each(array,function(idx,val) {\n res += \"<li class=\\\"product\\\">\";\n res += \"<a href=\\\"#\\\" class=\\\"product-photo\\\">\";\n res += \"<img src=\\\"\" + 'http:'+val.image.small+\"\\\"\"+\"height=\\\"130\\\"\"+\"/>\";\n res += \"<a/>\";\n res += \"<h2><a href='#'>\"+val.name+\"</a></h2>\";\n res += \"<ul class=\\\"product-description\\\">\";\n res += \"<li><span>Manufacturer: </span>\"+val.specs.manufacturer+\"</li>\";\n res += \"<li><span>Storage:</span>\"+val.specs.os+\"</li>\";\n res += \"<li><span>Os:</span>\"+val.specs.os+\"</li>\";\n res += \"<li><span>Camera</span>\"+val.specs.camera+\"</li>\";\n res += \"<li><span>Description:</span>\"+val.description+\"</li>\";\n res += \"</ul>\";\n res += \"<p class=\\\"product-price\\\"\"+\">Price: \"+val.price+\"</p>\";\n res += \"</li>\";\n });\n return res;\n }", "title": "" }, { "docid": "6f7dfb8854d401043c4545f68966b322", "score": "0.63286364", "text": "render() {\n var product;\n if (this.state.product != null) {\n if (this.state.product.user === this.props.auth.user.name) {\n product = this.state.product ? (\n <div className=\"container\">\n <div className=\"product-container\">\n <div className=\"row\">\n <div className=\"col-sm-12 col-md-6 col-lg-6\">\n <img className=\"img-fluid\" src={this.state.product.image} alt=\"Card cap\"\n height=\"40\"/>\n </div>\n <div className=\" col-sm-12 col-md-6 col-lg-6\">\n <div className=\"info-container\">\n <div className=\"product-info\">\n <h1 className=\"product-name\">{this.state.product.title}</h1>\n <p className=\"product-text\">This product was posted\n by: {this.state.product.user}</p>\n <p className=\"product-price\">Price: <i\n className=\"fas fa-dollar-sign\"/> {this.state.product.price}</p>\n <p className=\"product-text\">{this.state.product.info}</p>\n <div className=\"action\">\n <button onClick={this.handleClick} type=\"button\"\n className=\"btn btn-product add-cart\">Add to Cart\n </button>\n </div>\n <div className=\"action suggestion\">\n <button onClick={(e) => this.handleWishlist(this.state.product._id)}\n type=\"button\"\n className=\"btn btn-sm btn-product add-wishlist\"><i\n className=\"fas fa-heart\"/> Add to Wishlist\n </button>\n </div>\n <div className=\"action suggestion\">\n <button type=\"button\" onClick={this.handleSuggestion}\n className=\"btn btn-product add-cart\">Suggest to users\n </button>\n </div>\n <div className=\"action suggestion\">\n <Popup trigger={\n <button type=\"button\" className=\"btn btn-product add-cart\">Edit\n Product Details</button>} modal contentStyle={contentStyle}>\n {close => (\n <div>\n <Edit user={this.props.auth.user.id} product={this.state}/>\n </div>\n )}\n </Popup>\n </div>\n <div className=\"action suggestion\">\n <button type=\"button\" onClick={this.handleDelete}\n className=\"btn btn-product add-cart\">Delete Product\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"comment-container\">\n <div className=\"comments\">\n <h1>Leave a comment</h1>\n <form onSubmit={this.handleSubmit} className=\"input-group input-group-md\">\n <input type=\"text\" onChange={this.handleChange} className=\"form-control\"\n aria-label=\"Large\" aria-describedby=\"inputGroup-sizing-sm\"\n placeholder=\"Your comment\"/>\n </form>\n <div className=\"comments-text\">\n <Comments data={this.state} productid={window.location.pathname.split(\"/\").pop()}\n deleteComment={this.deleteComment} loggedUser={this.props.auth.user.name}/>\n </div>\n </div>\n </div>\n\n </div>\n ) : (\n <div>Loading Details...</div>\n )\n } else {\n product = this.state.product ? (\n <div className=\"container\">\n <div className=\"product-container\">\n <div className=\"row\">\n <div className=\"col col-lg-6\">\n <img className=\"img-fluid\" src={this.state.product.image} alt=\"Card cap\"\n height=\"40\"/>\n </div>\n <div className=\"col col-lg-6\">\n <div className=\"info-container\">\n <div className=\"product-info\">\n <h1 className=\"product-name\">{this.state.product.title}</h1>\n <p className=\"product-text\">This product was posted\n by: {this.state.product.user}</p>\n <p className=\"product-price\">Price: <i\n className=\"fas fa-dollar-sign\"></i> {this.state.product.price}</p>\n <p className=\"product-text\">{this.state.product.info}</p>\n <div className=\"action\">\n <button onClick={this.handleClick} type=\"button\"\n className=\"btn btn-sm btn-product add-cart\">Add to Cart\n </button>\n </div>\n <div className=\"action suggestion\">\n <button onClick={(e) => this.handleWishlist(this.state.product._id)}\n type=\"button\"\n className=\"btn btn-sm btn-product add-wishlist\"><i\n className=\"fas fa-heart\"/> Add to Wishlist\n </button>\n </div>\n <div className=\"action suggestion\">\n <button type=\"button\" onClick={this.handleSuggestion}\n className=\"btn btn-sm btn-product add-cart\">Suggest to users\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"comment-container\">\n <div className=\"comments\">\n <h1>Leave a comment</h1>\n <form onSubmit={this.handleSubmit} className=\"input-group input-group-md\">\n <input type=\"text\" onChange={this.handleChange} className=\"form-control\"\n aria-label=\"Large\" aria-describedby=\"inputGroup-sizing-sm\"\n placeholder=\"Your comment\"/>\n </form>\n <div className=\"comments-text\">\n <Comments data={this.state} productid={window.location.pathname.split(\"/\").pop()}\n deleteComment={this.deleteComment} loggedUser={this.props.auth.user.name}/>\n </div>\n </div>\n </div>\n\n </div>\n ) : (\n <div>Loading products...</div>\n )\n }\n }\n\n return (\n <div className=\"container\">\n {product}\n <SweetAlert\n show={this.state.show}\n title={this.state.modalTitle}\n text={this.state.modalMessage}\n type={this.state.type}\n onConfirm={() => this.setState({show: false})}\n />\n </div>\n )\n }", "title": "" }, { "docid": "f0d8bb8f296be045eec58723062d61a0", "score": "0.631613", "text": "function displayProductDetails(product) {\n const imageDisplayed = displayImage(product)\n const priceDisplayed = displayPrice(product)\n const nameDisplayed = displayTitle(product)\n const descriptionDisplayed = displayDescription(product)\n const optionDisplayed = displayOption(product)\n return `\n<div class=\"card text-center\" style=\"max-width: 500px;\">\n ${imageDisplayed}\n <div class=\"card-body\">\n ${nameDisplayed}\n ${descriptionDisplayed}\n ${priceDisplayed}\n ${optionDisplayed}\n <div class=\"form-group\">\n <a href=\"\" id=\"btn\" class=\"btn btn-primary\"><i class=\"fas fa-cart-arrow-down\">\n </i> Ajouter au panier</a>\n</div>`\n}///////////////////End Page Presentation Teddies Selctionner////////////////////////", "title": "" }, { "docid": "bb1cc7b3835980fa6a88ae9c60a319d0", "score": "0.63141704", "text": "function displayProducts() {\n console.log('\\nSelecting all products for sale...\\n')\n connection.query('SELECT item_id, product_name, price FROM products', function(err, res) {\n if (err) throw err;\n for (let i = 0; i < res.length; i++) {\n console.log('Item#: ' + res[i].item_id + ' || Description: ' + res[i].product_name + ' || Price: ' + res[i].price);\n }\n console.log('\\n');\n runShop();\n })\n }", "title": "" }, { "docid": "59c4385eff6da58f725362e8012becea", "score": "0.6304052", "text": "function display_product_infos(index) {\n\n var product_content = activityDetailTemplate(data.cur_product);\n $(\"#product_container\").html(product_content);\n}", "title": "" }, { "docid": "ec3a1dff7617cbf5a222676ed30024b9", "score": "0.6294947", "text": "function RenderProduct(props) {\n const { activePage, productsPerPage, products, handleModal } = props;\n\n const renderedProducts = products.slice( activePage * productsPerPage - productsPerPage, activePage * productsPerPage ).map((product) => {\n return(\n <div key={ product.id } className={'product-container'}>\n <img alt={product.shoe} src={product.media.smallImageUrl} className={'product-img'} onClick={() => handleModal(product, true)}></img>\n <div className={'product-details'}>\n <div className={'product-name'}>{product.shoe} <span className={'product-brand'}>{product.brand}</span></div>\n </div>\n <div className={'product-release-date'}>\n Released: {Utils.formatDate(product.releaseDate)}\n </div>\n <div className={'product-actions'}>\n <div className={'product-price'}>{Utils.formatPrice(product.retailPrice)}</div>\n <Button className={'product-cart-action'} size={'small'} startIcon={ <AddShoppingCartIcon /> } variant=\"outlined\" onClick={() => handleModal(product, true)}>\n <span>Add to cart</span>\n </Button>\n </div>\n </div>\n )\n })\n return renderedProducts;\n}", "title": "" }, { "docid": "5d3a6457591ea19c206808aa50020439", "score": "0.6293721", "text": "function renderProducts() {\n var div = document.createElement('div');\n div.setAttribute('class', 'mobile-products-container');\n\n if (products.length === 0) {\n div.innerHTML = \"<h1>Nenhum produto foi encontrado.</h1>\";\n } else {\n for (let i=currentIndex-6; i < products.length; i++) {\n let price = products[i].price.toFixed(2).replace('.', ',');\n\n div.innerHTML += `\n <div class=\"mobile-product\">\n <div class=\"mob-product\">\n <img src=\"${products[i].img}\">\n <div class=\"mob-product-details\">\n <span class=\"mob-product-title\">\n ${products[i].name}\n </span>\n <span class=\"mob-product-price\">\n R$ ${price}\n </span>\n <span class=\"mob-product-price2\">\n ${products[i].miniDesc}\n </span>\n <button class=\"mob-buy-product\" name=\"${i}\" onclick=\"addToCart(${products[i].id}, 1)\">COMPRAR</button>\n </div>\n </div>\n </div>\n\n `\n }\n }\n\n // Insere nossas novas divs ACIMA do botão de carregar mais\n document.getElementById('products-container').insertBefore(div, document.getElementById('products-container').lastElementChild);\n\n}", "title": "" }, { "docid": "fa883fbca266d30d032eb66aee96aecf", "score": "0.6290351", "text": "function fillProducts(product) {\n let productTile = document.createElement('div');\n let productName = document.createElement('p');\n let productImage = document.createElement('img');\n let productPrice = document.createElement('p');\n\n productTile.classList.add('producttile');\n productName.classList.add('product-name');\n productImage.classList.add('product-image');\n productPrice.classList.add('product-price');\n\n productTile.dataset.href = product.link;\n productTile.dataset.productId = product.product_id;\n productName.innerHTML = product.product_name;\n productImage.src = product.image.link;\n productPrice.innerHTML = product.price + ' ' + product.currency;\n\n productTile.appendChild(productName);\n productTile.appendChild(productImage);\n productTile.appendChild(productPrice);\n productTile.addEventListener('click', displayProduct);\n\n products.appendChild(productTile);\n }", "title": "" }, { "docid": "9b15aab4c9141f369195a63c70c2440c", "score": "0.6289304", "text": "function showProducts(response) {\n // console.log(response);\n if(response.status) {\n var len = response.products.length;\n if(len) {\n // if the length of product list is not 0\n var i = 0;\n products = response.products;\n var list = $('.product-list');\n for(i = 0; i < len; i++) {\n if (products[i].name == '') {\n list.append('<a class=\"item-product\" data-index='+ i +'>No name</a>');\n } else {\n list.append('<a class=\"item-product\" data-index='+ i +'>'+ products[i].name +'</a>');\n }\n }\n } else {\n // if the length of product list is 0\n $('.product-list').html(\"The current list of products is empty\");\n }\n }\n}", "title": "" }, { "docid": "68ecb551bd71e7acc2707f32571f785d", "score": "0.6288062", "text": "function renderProducts(productName, productId, productImg, productPrice) {\r\n const produits = document.querySelector(\"#produits\"); // Récupère la div qui contiendra les différents articles\r\n const article = document.createElement(\"article\"); // Creer un élément \"article\" dans le DOM\r\n\r\n /*Modifie le DOM en créant les éléments dans mon \"article\"*/\r\n article.innerHTML = `\r\n <img class=\"image_index1\" alt=\"${productName}\" src=\"${productImg}\">\r\n <button class=\"button_index1 type=\"button\"><a href=\"index2.html?id=${productId}\"><i class=\"fas fa-eye\"></i></a></button>\r\n <p class=\"title_index1\">${productName}</p>\r\n <p class=\"price_index1\">${productPrice / 100},00</p>\r\n `;\r\n produits.append(article);\r\n}", "title": "" }, { "docid": "bc1c77a09b60bb5db3fe39aa43d59634", "score": "0.62869155", "text": "function relatedProducts(relatedProduct) {\n\n getJSONData(PRODUCTS_URL).then(function(resultObj){\n if (resultObj.status === \"ok\")\n {\n let htmlContentToAppend = \"\";\n for(let i = 0; i < relatedProduct.length; i++){\n let product = resultObj.data[relatedProduct[i]];\n htmlContentToAppend += ` \n <a href = \"product-info.html?name=`+ product.name + `\" class=\"list-group-item list-group-item-action col-4\">\n <img src=\" ` + product.imgSrc + `\" class=\"img-thumbnail\"> \n <h3> ` + product.name + ` </h3><br>\n <p> ` + product.currency + ` ` + product.cost + ` </p>\n\n </a>\n `\n }\n\n document.getElementById('relatedProducts').innerHTML = htmlContentToAppend;\n };\n\n });\n}", "title": "" }, { "docid": "28052fba9343d377b32309b1d7fe9d7b", "score": "0.6281132", "text": "function showProductPage(product){\n const imagesHTML = productImagesHTML(product);\n const infosHTML = productInfoHTML(product);\n\n $(\"#product-page .model-photos\").html(imagesHTML);\n $(\"#product-page #select\").html(infosHTML);\n\n showDrawer(\"product-page\");\n}", "title": "" }, { "docid": "47a2c404ff53519d88f6537b34de135c", "score": "0.6265445", "text": "function product(){\n\t\t$.ajax({\n\t\t\turl\t:\t\"action.php\",\n\t\t\tmethod:\t\"POST\",\n\t\t\tdata\t:\t{getProduct:1},\n\t\t\tsuccess\t:\tfunction(data){\n\t\t\t\t$(\"#get_product\").html(data);\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "4b8f425148ef63dc64bc2d5252024cec", "score": "0.62619704", "text": "render() {\n if (this.props.product === null) {\n return <div></div>;\n }\n const { title, price, detail, image, rating } = this.props.product;\n let ratingArray = [1, 2, 3, 4, 5];\n return (\n <div className=\"product-detail-container\">\n <div className=\"heading\">Product Detail</div>\n <div className=\"img-container\">\n <img src={image} alt={title}></img>\n </div>\n <div className=\"creadential-container\">\n <div>Name :</div>\n <div>{title}</div>\n </div>\n <div className=\"creadential-container\">\n <div>Price :</div>\n <div>{price}</div>\n </div>\n <div className=\"creadential-container\">\n <div>Rating :</div>\n <div>\n {ratingArray.map((item) => {\n if (item <= rating) {\n return (\n <i className=\"fa fa-star\" aria-hidden=\"true\" key={item}></i>\n );\n }\n return <span></span>;\n })}\n </div>\n </div>\n <div className=\"creadential-container detail-container\">\n <div className=\"detail\">Detail :</div>\n <div className=\"text\">{detail}</div>\n </div>\n <button className=\"button\" onClick={this.handleCartButtonClick}>\n Add to Cart\n </button>\n </div>\n );\n }", "title": "" }, { "docid": "04e09749bd943eb41e50f37fb9182eb6", "score": "0.6252222", "text": "function ProductTemplate(myProducts) {\n return `\n <div class=\"cards\">\n <i class=\"fa fa-heart\" aria-hidden=\"true\"></i>\n <div class=\"img\">\n <img src=\"${myProducts.image}\">\n </div>\n <h4 >${myProducts.productName} </h4>\n <a href=\"\">Add to Cart</a>\n <h3>${myProducts.price}</h3>\n </div>\n `;\n }", "title": "" }, { "docid": "b75fb536b03613eff432d2e7e7411596", "score": "0.62473893", "text": "function displayProducts() {\n\tconnection.query((\"SELECT * FROM products\"), function (err, result, fields) {\n \tif (err) throw err;\n \tconsole.log(\"ID || Product Name || Department || Price || Stock Quantity\");\n \tfor(let i=0; i<result.length; i++) {\n \t\t\tconsole.log(result[i].item_id + \" || \" + result[i].product_name + \" || \"\n \t\t\t\t+ result[i].department_name + \" || \" + result[i].price\n \t\t\t\t+ \" || \" + result[i].stock_quantity);\n \t\t}\n\n \t\tproductIdSearch(); //ask customer to choose an id of a product they would like to purchase\n });\n\t\n\t\n}", "title": "" }, { "docid": "ca3e036ed5f1ef44babd4e7471ed644d", "score": "0.6229064", "text": "function SelectedProduct(props) {\n\t// function isPrimary(value) {\n\t// const type = typeof value;\n\t// if (type == 'number') {\n\t// return 'number';\n\t// } else if (type == 'string') {\n\t// return 'string';\n\t// } else if (Object.keys(value).length > 0) {\n\t// return 'map';\n\t// } else if (Object.prototype.toString.call(value) === '[object Array]') {\n\t// return 'array';\n\t// }\n\t// }\n\tif (props.status == 'loading') {\n\t\treturn (\n\t\t\t<div className={styles.root}>\n\t\t\t\t{' '}\n\t\t\t\t<ClipLoader />\n\t\t\t</div>\n\t\t);\n\t}\n\tif (props.status == 'idle' && JSON.stringify(props.inView) == '{}') {\n\t\treturn (\n\t\t\t<div className={styles.root}>\n\t\t\t\t<p className={styles.prompt}>select a product to view here.</p>\n\t\t\t</div>\n\t\t);\n\t}\n\tif (props.error != null) {\n\t\treturn <div className={styles.root}>Error</div>;\n\t}\n\n\treturn (\n\t\t<div className={styles.root}>\n\t\t\t{/* {Object.keys(props.product).length > 0\n ? Object.keys(props.product).map((key, i) => (\n <DataEntry key={i} type={isPrimary(props.product[key])} propertyName={key} value={props.product[key]} />\n ))\n : ''} */}\n\n\t\t\t<ImagesDisplay productID={props.inView.id} images={props.inView.images} />\n\t\t\t<DataEntry propertyName=\"Title\" value={props.inView.title} />\n\t\t\t<DataEntry propertyName=\"Price\" value={props.inView.price} />\n\t\t\t<DataEntry value={props.inView.attributes} propertyName=\"Attributes\" />\n\t\t\t<DataEntry value={props.inView.type} propertyName=\"Type\" />\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "e399c83bbd4c9ad07ae11f4f18d1418d", "score": "0.622867", "text": "function displaySearchedProducts(products){\n for(let product of products){\n document.write(productDetails(product));\n }\n}", "title": "" }, { "docid": "1f9a77ce0fe819f25418a8e3b83cdf06", "score": "0.6220608", "text": "function renderResults(){\n const ulElem = document.getElementById('productClicks');\n ulElem.innerHTML = '';\n\n for(let product of Product.allProducts){\n const liElem = document.createElement('li');\n liElem.textContent = `${product.name} had ${product.votes} votes, and was seen ${product.timesShown} times.`;\n ulElem.appendChild(liElem);\n }\n renderChart();\n storeProducts();\n}", "title": "" }, { "docid": "118cb5d06385f625a63ec2a0347ee4d2", "score": "0.62166375", "text": "function renderProductsPage(data) {\n let page = $('.all-products'),\n allProducts = $('.all-products .products-list > li');\n\n allProducts.addClass('hidden');\n\n allProducts.each(function() {\n let that = $(this);\n\n data.forEach(function(item) {\n if (that.data('index') == item.id) {\n that.removeClass('hidden');\n }\n });\n });\n\n\n page.addClass('visible');\n }", "title": "" }, { "docid": "76f21830e99d206db44c260f05a0cdea", "score": "0.62100714", "text": "function displayProducts () {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(err, res) {\n if (err) throw err;\n console.log(`Welcome to the Bamazon MarketPlace! Please take a look at the products that we offer!`)\n console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`);\n res.forEach(element => {\n var item_id = element.item_id;\n var product_name = element.product_name;\n var price = element.price;\n var stock_quantity = element.stock_quantity;\n console.log(`ID: #${item_id} - Product: ${product_name} for $${price}.00 ~~ Inventory: ${stock_quantity}`);\n });\n\n purchaseProduct();\n });\n }", "title": "" }, { "docid": "b03b71ca5d4f5bc2fe1bd18376106152", "score": "0.62066245", "text": "function displayProducts () {\n connection.query(\"SELECT id, product_name, department_name, price FROM products\", function(err, response) {\n if (err) throw err;\n console.log(\"Current Inventory:\");\n for (let record in response) {\n let product = response[record];\n\n console.log(\n \"Product ID:\", product.id, \"|\",\n \"Product:\", product.product_name, \"|\",\n \"Department:\", product.department_name, \"|\",\n \"Price ($):\", product.price, \"|\"\n );\n };\n });\n inquirerCustomer();\n }", "title": "" }, { "docid": "aae17b13e4acc60da9e1040054a8eea2", "score": "0.6204321", "text": "function viewProductForSale() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n // console.log(\"\\n\", results, \"\\n\");\n displayProducts(results);\n menuOptions();\n });\n}", "title": "" }, { "docid": "fc6148737df1b714bb1fc8109da4bd0e", "score": "0.6193498", "text": "function display_product_infos(index) {\n\n var product_html = \"\";\n product_html += myProviderDetailTemplate(data.cur_product);\n\n if (product_html == '') product_html = noItemsTemplate(1);\n\n $(\"#product_container\").html(product_html);\n}", "title": "" }, { "docid": "5c9b473fae048dee750fa6cd47d3676e", "score": "0.618883", "text": "function displayItem(product) {\n\n // Crée une div pour l'image du produit \n const productImgDiv = document.createElement('div');\n productImgDiv.setAttribute('class', 'card border-0 col-sm-8 col-lg-6 m-0 productImgDiv');\n \n // Affiche l'image du produit\n const productImg = document.createElement('img');\n productImg.setAttribute('src', product.imageUrl);\n productImg.setAttribute('class', 'rounded img-fluid productImg');\n productImg.setAttribute('style', 'max-width: 400px');\n productImgDiv.appendChild(productImg);\n\n // Crée une div pour la description du produit \n const productDescDiv = document.createElement('div');\n productDescDiv.setAttribute('class', 'col-sm-8 col-lg-6 m-0 pt-4');\n\n // Affiche le nom du produit \n const productName = document.createElement('h1');\n productName.setAttribute('class', 'name h3 card-title pt-2');\n productName.innerHTML = product.name;\n productDescDiv.appendChild(productName);\n\n // Affiche la description du produit\n const productDescription = document.createElement('p');\n productDescription.innerHTML = product.description;\n productDescDiv.appendChild(productDescription);\n \n // Affiche les lentilles à choisir pour un produit\n const productLenses = document.createElement('label');\n productLenses.innerHTML = 'Options : ';\n productDescDiv.appendChild(productLenses); \n\n // Crée un champ de sélection pour choisir les options \n const productLensesSelect = document.createElement('select'); \n productLenses.appendChild(productLensesSelect); \n\n // Affiche l'option par défaut pour le choix de la lentille\n const productLensesOption = document.createElement('option'); \n productLensesOption.innerHTML = 'Veuillez choisir une lentille';\n productLensesSelect.appendChild(productLensesOption);\n\n // Affiche les options pour le choix de la lentille\n for (let i = 0; i < product.lenses.length; i++ ){\n const optionLenses = document.createElement('option');\n optionLenses.setAttribute('value', product.lenses[i]);\n optionLenses.innerHTML = product.lenses[i];\n productLensesSelect.appendChild(optionLenses);\n }\n \n // Affiche le prix du produit\n const productPrice = document.createElement('p');\n productPrice.setAttribute('class', 'price pt-4');\n productPrice.innerHTML = product.price /100 + ',00 €';\n productDescDiv.appendChild(productPrice); \n\n // Insère les div \"productImgDiv\" et \"productDescDiv\" dans la div nommée \"product\"\n document.getElementById('product').appendChild(productImgDiv);\n document.getElementById('product').appendChild(productDescDiv);\n\n // Récupère le bouton \"Ajouter au panier\" créé dans product.html \n const btn = document.querySelector('#addToCart'); \n\n btn.addEventListener('click', () => {\n addToCart(product)\n totalCost(product);\n });\n}", "title": "" }, { "docid": "e9ff44f100f486ca6b97255af2ef575f", "score": "0.61836994", "text": "function Products() {\n return (\n <div>\n <h2>Welcome to Product</h2>\n <div className=\"productContainer\">\n {Object.keys(Shoes).map(keyName => {\n const shoe = Shoes[keyName];\n return (\n <Link key={keyName}\n className=\"link\"\n to={`/product/${keyName}`}>\n <h4> {shoe.name}</h4>\n <img src={shoe.img} height={150} alt=\"Shoe\" />\n </Link>);\n })}\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "bcd2e7b3a1e6bb1ca4081af029c4daf9", "score": "0.6181544", "text": "async show() {\n console.log('show product called');\n const { ctx, service } = this;\n const { id } = ctx.params;\n const res = await service.product.show(id);\n ctx.status = 200;\n ctx.helper.success({ ctx, res });\n }", "title": "" }, { "docid": "b4218af2662a6047e81601c9494e6480", "score": "0.61723316", "text": "getFormatedProducts(products){\n var concatenatedProducts ='';\n\n products.forEach(product => {\n\n //pentru fiecare produs construieste urmatorul html\n concatenatedProducts += \n `\n <div class=\"col-3 border m-2\">\n <img onclick=\"openProduct(${product.id})\" class=\"w-100\" src=\"${product.productUrl}\"/>\n <p>${product.name}</p>\n <p>${product.description}</p>\n <p><del>${product.price}</del></p>\n <p>${product.discountPrice}</p>\n <i class=\"bi bi-trash\" onclick=\"removeProduct(${product.id})\"> remove</i></br>\n <i class=\"bi bi-arrows-fullscreen\" onclick=\"openProduct(${product.id})\"> show</i></br>\n <i class=\"bi bi-brush\" onclick=\"updateProductById(${product.id})\"> update</i></br>\n <i class=\"bi bi-cart\" onclick=\"addToCart(${product.id})\"> cart</i></br>\n <i class=\"bi bi-heart\" onclick=\"addToFavorites(${product.id})\"> favorite</i>\n </div>`\n });\n return concatenatedProducts;\n }", "title": "" }, { "docid": "62a5e838adfc742a60bdd98d01e27da6", "score": "0.61640733", "text": "render() {\n var bike = this.state.product[0];\n return (\n <div>\n <Navbar />\n\n {console.log(\"product\", this.state.product)}\n <div className=\"detailed-main-container\">\n <img\n className=\"detailed-left-container\"\n src={bike && bike.image_url}\n />\n <div className=\"detailed-right-container\">\n <h1>{bike && bike.model}</h1>\n <hr />\n <h3>PRODUCT DESCRIPTION:</h3>\n <p className=\"detailed-description\">{bike && bike.description}</p>\n <p>${bike && bike.price}.00</p>\n <button className=\"addToCart\" onClick={() => this.addToCart(bike)}>\n ADD TO CART\n </button>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "a8fd8d25aca99917800dc7a6c3a14429", "score": "0.6163188", "text": "function product(){\r\n\t\t$.ajax({\r\n\t\t\turl\t:\t\"action.php\",\r\n\t\t\tmethod:\t\"POST\",\r\n\t\t\tdata\t:\t{getProduct:1},\r\n\t\t\tsuccess\t:\tfunction(data){\r\n\t\t\t\t$(\"#get_product\").html(data);\r\n\t\t\t}\r\n\t\t})\r\n\t}", "title": "" }, { "docid": "be379acec0d52075b8558b4e2fbbd256", "score": "0.615455", "text": "function displayProducts() {\n\t\t\n\t\t// connection to mysql server\n\t\tconnect.connection.query('SELECT * FROM Products', function(err, data) {\n\n\t\t\t// if error, throw error\n\t\t\tif (err) throw err;\n\n\t\t\t// welcome screen and display all the items available to buy\n\t\t\tconsole.log('\\nWelcome to the Bamazon Cult Cinema Shop. Where you can purchase classic films in classic formats. \\n');\n\n\t\t\t// loop through the list of items and display to the screen\n\t\t\tvar i;\n\t\t\tvar data_length = data.length;\n\t\t\tfor (i = 0; i < data_length; i++) {\n\n\t\t\t\t// display the item ID, name of product and price\n\t\t\t\tconsole.log(' ' + data[i].ItemID + ' \"' + data[i].ProductName + '\" FORMAT: ' + data[i].DepartmentName + ' - PRICE: $' + data[i].Price + ' - Qty: ' + data[i].StockQuantity + '\\n');\n\n\t\t\t} // end for loop\n\n\t\t\t// call the selectProduct function here so that it's called once the products have been displayed\n\t\t\tselectProduct();\n\t\t\t\n\t\t}); // end connection.query()\n\n\t} // end displayProducts()", "title": "" }, { "docid": "3fe3a3b8d90e078da97578dd59387cb0", "score": "0.61477417", "text": "function generateListProduct(product) {\n\tvar html = '<div class=\"col-md-12 product product-list\">\\\n\t<div class=\"row\">\\\n\t<div class=\"col-md-3 col-sm-6 text-center\">\\\n\t<a href=\"/san-pham/' + product.id + '/' + product.slug + '\"><img src=\"/storage/' + product.thumb + '\" alt=\"\" class=\"img-fluid\"></a>\\\n\t</div>\\\n\t<div class=\"col-md-9 col-sm-6 contents\">\\\n\t<h6 class=\"product-name\">' + product.name + '</h6>';\n\tif (auth == 1) {\n\t\thtml += '<h6 class=\"product-price\">' + product.sell_price + '</h6>';\n\t}\n\thtml += '<p class=\"size\"><span class=\"font-weight-bold\">Kích thước: </span>' + product.sizes + '</p>\\\n\t<p class=\"color\"><span class=\"font-weight-bold\">Màu sắc: </span>' + product.colors + '</p>\\\n\t<a name=\"' + product.name + '\" class=\"btn btn-success\" href=\"/san-pham/' + product.id + '/' + product.slug + '\" role=\"button\">Xem Chi Tiết</a>\\\n\t</div>\\\n\t</div>\\\n\t</div>';\n\n\treturn html;\n}", "title": "" }, { "docid": "8a59007a295fbe5ebbc86522f12542cf", "score": "0.61470884", "text": "function displayProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n\n data = [\n ['ID'.underline, 'Name'.underline, 'Price'.underline]\n ];\n\n config = {\n columns: {\n 2: {\n alignment: 'right'\n }\n }\n };\n\n for (let i in res) {\n data.push([res[i].item_id, res[i].product_name, \"$\" + res[i].price.toFixed(2)]);\n }\n output = table(data, config);\n console.log(output);\n purchaseProduct();\n });\n }", "title": "" }, { "docid": "f1766b21ca3edd79a8900a8af4ca9746", "score": "0.61465865", "text": "function displayProduct(product) {\n document.getElementById(\"productlist\").innerHTML += `\n <div class=\"align-list\"><a href=\"product.html?id=${product._id}\">\n <div class=\"card\"><img src=\"${product.imageUrl}\" alt=\"image_zurss\">\n <div class=\"card-item\">\n <div class=\"card-title\">${product.name}</div>\n <div class=\"card-price\">${product.price}€</div>\n </div>\n </div>\n </a><div>\n \n `\n}", "title": "" }, { "docid": "03236ab77fd6f3148aa852bd0648e2cd", "score": "0.6138905", "text": "function renderProducts(){\n\n //draw filter \n filter = getFilter();\n\n // set all products initial \n var filtered_products = null;\n\n console.log('filterfromrender', filter);\n // categorie filter\n if (filter.categories.length !== 0 || filter.categories !== undefined){\n filtered_products = products.filter(function (product) {\n console.log('regex',new RegExp(filter.categories.join('|')).test(product.categories))\n return new RegExp(filter.categories.join('|')).test(product.categories);\n });\n }\n\n console.log('filtered_products', filtered_products)\n \n //text filter\n if (filter.text !== '' || filter.text !== undefined){\n filtered_products = products.filter(function (product) {\n if (product.productname.toUpperCase().indexOf(filter.text.toUpperCase()) > -1){\n return true;\n }else{\n return false;\n }\n });\n }\n\n\n console.log(document.getElementsByClassName('showing')[0].querySelector);\n\n //clear results counter \n document.getElementsByClassName('showing')[0].querySelector('p').innerHTML= '';\n\n // clear all products\n document.getElementById('product-list').innerHTML = '';\n\n\n // render all product carts\n for (var i = 0; i < filtered_products.length; i++ ){\n\n var hasLabel = filtered_products[i].label !== undefined? 'block': 'none';\n\n //TODO remove single-product href # with / in live (Webserver config for seo)\n var div = document.createElement('div');\n div.className = \"col-lg-3 col-md-4 col-sm-4 col-xs-12\";\n div.style.opacity = 0;\n div.innerHTML = ' <div class=\"single-product\">\\\n <div class=\"product-img\">\\\n <span style=\"display:'+hasLabel+'\" class=\"pro-label new-label\"><span class=\"text-label\">'+filtered_products[i].label+'</span></span>\\\n <span class=\"pro-price-2\">'+filtered_products[i].price.toLocaleString('de-DE', {maximumFractionDigits: 2, minimumFractionDigits: 2, minimumIntegerDigits:1 })+' €</span>\\\n <a href=\"single-product.html#'+filtered_products[i].itemId+'#'+filtered_products[i].seoname+'\"><img data-filename=\"'+filtered_products[i].images[0]+'\" src=\"img/product/'+filtered_products[i].images[0]+'\" alt=\"\" /></a>\\\n </div>\\\n <div class=\"product-info clearfix text-center\">\\\n <div class=\"fix\">\\\n <h4 class=\"post-title\"><a href=\"/\">'+filtered_products[i].productname+'</a></h4>\\\n </div>\\\n <div class=\"fix\">\\\n <span class=\"pro-rating\">\\\n #<a>'+filtered_products[i].itemId+'</a>\\\n </span>\\\n </div>\\\n <div class=\"product-action clearfix\">\\\n <a href=\"single-product.html#'+filtered_products[i].itemId+'#'+filtered_products[i].seoname+'\" data-i18n=\"productdetails\" data-placement=\"top\"> Details zum Produkt</i></a>\\\n </div>\\\n </div>\\\n </div>';\n document.getElementById('product-list').appendChild(div);\n\n // console.log('animate')\n div.velocity({ opacity: 1 },2500);\n // div.velocity({ opacity: 0.5 },300);\n // div.velocity({ opacity: 1 },500);\n\n } // End for-loop\n\n // Set Showing results text\n document.getElementsByClassName('showing')[0].querySelector('p').innerHTML= $.i18n( 'showing' ) + ' ' +filtered_products.length+ ' ' + $.i18n( 'oftotal' ) + ' ' +products.length+ ' ' + $.i18n( 'items' );\n document.getElementsByClassName('showing_xs')[0].querySelector('p').innerHTML= '' +filtered_products.length+ ' / ' +products.length+ ' ' + $.i18n( 'items' );\n\n renderCategories();\n\n}", "title": "" }, { "docid": "721baa0fd142ea34710af434a056094b", "score": "0.6135038", "text": "function render () {\n for (let i = 0; i < productos.length; i++) {\n if(productos[i].cantidad > 0){\n const productosRender = productos.map((producto)=>{\n return `<ul><div class=\"productosContainer\">\n <div class=\"imagenContainer\"> \n <img src=\"${producto.imagen}\"></img>\n </div>\n <div class=\"contentContainer\">\n <li class=\"nombreProducto\">${producto.nombre}</li>\n <li class\"descripcionProducto\">${producto.descripcion}</li>\n <li class=\"precioProducto\">$${producto.precio}</li>\n <div>\n <div class=\"buttonsContainer\">\n <a class=\"btn btn-outline-success\" href=\"#formEditar\" id=\"buttonEditar\">Editar<span class=\"icon-pencil\"></span></a>\n <button class=\"btn btn-outline-success\" id=\"buttonEliminar\">Eliminar<span class=\"icon-bin\"></span></button>\n </div>\n </div></ul>`\n }).join(\"\")\n productosContainer.innerHTML = productosRender\n }\n }\n}", "title": "" }, { "docid": "6c725afa1f7c65b478932eaaee41c68f", "score": "0.6126187", "text": "function displayUserProducts() {\n document.write(`\n <div class=\"shop-item\">\n <span class=\"shop-item-title\">${userproducts[0].name}</span>\n <div class=\"enlarge\">\n <img class=\"shop-item-image\" src=${userproducts[0].image}>\n </div>\n <div class=\"shop-item-description\">${userproducts[0].description}</div>\n <div class=\"shop-item-details\">\n <span class=\"shop-item-price\">$${userproducts[0].price.toFixed(2)}</span>\n <label id=\"quantity${0}_label\" class=\"shop-item-quantity\">Quantity</label>\n <input class=\"cart-quantity-input\" type=\"text\" name=\"quantity${0}\" onkeyup=checkQuantityTextbox(this); placeholder=\"0\">\n </div>\n </div>\n `);\n }", "title": "" }, { "docid": "e043f2663e77fee0f54d4845378d8ec7", "score": "0.6124799", "text": "function displayFeatureProducts(products){\n for(let i=0; i<3; i++){\n document.write(productDetails(products[i]));\n }\n}", "title": "" }, { "docid": "6938cf06f7700b18dc5dd028d5528739", "score": "0.61195934", "text": "function displayProducts() {\n let display = new displayTable();\n connection.query(\"SELECT * FROM products\", function (err, results) {\n display.displayInventoryTable(results);\n purchaseItem();\n });\n}", "title": "" }, { "docid": "7786b49495f3558b3d54a9828fffa03f", "score": "0.61184484", "text": "function product() {\n $.ajax({\n url: \"action.php\",\n method: \"POST\",\n data: {getProduct: 1},\n success: function (data) {\n $(\"#get_product\").html(data);\n }\n });\n }", "title": "" }, { "docid": "ce6a5514fd8c132fe69d0452b5a596c1", "score": "0.61170095", "text": "_renderProduct(product) {\n let $newProductElem = $('<div\\>', {\n class: 'featured_item',\n html: `<a class=\"product\" href=\"./single_page.html\">\n <img src=${product.imageSrc} alt=${product.imageAlt} class=\"img_f_item\">\n <p class=\"item_first_line\">${product.productName}</p>\n <p class=\"item_second_line t-red\">$${product.price}</p>\n \n </a>\n \n <div class=\"add_cart_flex\">\n <a href=\"#Add_to_Cart\" class=\"a_add_cart\" data-product-price=${product.price} data-product-color=${product.color}\n data-product-size=${product.size} data-product-quantaty=${product.quantaty} data-product-name=${product.productName} data-id=${product.id}\n data-rating=${product.rating} data-product-image-src=${product.imageSrc} data-product-image-alt=${product.imageAlt} data-sex=${product.sex}>\n <img src=\"./img/white_cart.svg\" alt=\"cart\" class=\"img_add_cart\">Add to Cart</a>\n </div>`\n });\n $($newProductElem).on('click', '.a_add_cart', () => {\n this.bigCartItem.addProductToCart(product);\n //this.getProducts(product)\n })\n $(this.container).append($newProductElem);\n }", "title": "" }, { "docid": "ffdcede4adaa8f66edf5b03347addafd", "score": "0.6113418", "text": "function renderProductView(parent, products) {\r\n for (let i = 0; i < products.length; i++) {\r\n let data = products[i];\r\n let topParentElem = document.createElement(\"div\");\r\n topParentElem.className = (\"unique-item-container col-md-4 no-gutter\");\r\n\r\n let parentElem = document.createElement(\"div\");\r\n parentElem.className = (\"item-container\");\r\n\r\n let childEle1 = document.createElement(\"div\");\r\n childEle1.className = (\"img-item img-fluid \" + data.img);\r\n childEle1.onclick = function (ev) {\r\n getProductDetails(data.uid).then(res => {\r\n window.location.href = '#product';\r\n renderProductDetails(res.data)\r\n }, err => {\r\n console.log(err);\r\n });\r\n }\r\n\r\n let childEle2 = document.createElement(\"div\");\r\n childEle2.className = (\"white-box\");\r\n\r\n let childEle3 = document.createElement(\"div\");\r\n childEle3.className = (\"item-title\");\r\n childEle3.innerHTML = (data.name);\r\n childEle3.onclick = function (ev) {\r\n getProductDetails(data.uid).then(res => {\r\n window.location.href = '#product';\r\n renderProductDetails(res.data)\r\n }, err => {\r\n console.log(err);\r\n });\r\n }\r\n\r\n let childEle4 = document.createElement(\"div\");\r\n childEle4.className = (\"item-detail-top row\");\r\n\r\n let subChild41 = document.createElement(\"div\");\r\n subChild41.className = (\"left-detail left-text col\");\r\n subChild41.innerHTML = (data.type);\r\n\r\n let subChild42 = document.createElement(\"div\");\r\n subChild42.className = (\"right-detail right-text ml-auto\");\r\n subChild42.innerHTML = ('$' + data.price);\r\n\r\n childEle4.appendChild(subChild41);\r\n childEle4.appendChild(subChild42);\r\n\r\n let childEle5 = document.createElement(\"div\");\r\n childEle5.className = (\"item-detail-bottom row\");\r\n\r\n let subChild51 = document.createElement(\"div\");\r\n subChild51.className = (\"rating col-9\");\r\n subChild51.style.width = '20em';\r\n for (let i = 0; i < data.rating; i++) {\r\n subChild51.innerHTML += '<span class=\"fa fa-star marked\"></span>';\r\n }\r\n for (let i = 0; i < (5 - data.rating); i++) {\r\n subChild51.innerHTML += '<span class=\"fa fa-star unmarked\"></span>';\r\n }\r\n\r\n let subChild52 = document.createElement(\"div\");\r\n subChild52.className = (\"cart-icon ml-auto\");\r\n subChild52.innerHTML = ('<i class=\"fa fa-cart-plus cart-icon\" aria-hidden=\"true\"></i>');\r\n\r\n childEle5.appendChild(subChild51);\r\n childEle5.appendChild(subChild52);\r\n\r\n parentElem.appendChild(childEle1);\r\n parentElem.appendChild(childEle2);\r\n parentElem.appendChild(childEle3);\r\n parentElem.appendChild(childEle4);\r\n parentElem.appendChild(childEle5);\r\n topParentElem.appendChild(parentElem);\r\n parent.appendChild(topParentElem);\r\n }\r\n}", "title": "" }, { "docid": "b11ca928640dd4db123200f4b43cc6f9", "score": "0.6112617", "text": "function displayProducts()\n{\n var temp = ``;\n\n for(var i =0 ;i < productsContainer.length ; i++)\n {\n temp +=`\n <div class=\"col-md-3\">\n \n <h2 class=\"text-center\">`+productsContainer[i].price+`</h2>\n \n <div class=\"product\">\n <div class=\"price\">`+productsContainer[i].price+`</div>\n <img src=\"images/1.jpg\" class=\"img-fluid\">\n <h5>`+productsContainer[i].name+`<span class=\"ml-3 badge badge-primary\">`+productsContainer[i].category+`</span> </h5>\n <p>`+productsContainer[i].desc+`</p>`;\n\n if(productsContainer[i].sale == true)\n {\n temp +=`<div class=\"sale\">sale</div>`;\n\n }\n \n \n temp +=`</div>\n <button onclick=\"deleteProduct(`+i+`)\" class=\"btn btn-outline-danger btn-sm mb-4\">delete</button>\n <button onclick=\"updateProduct(`+i+`)\" class=\"btn btn-outline-warning btn-sm mb-4\">update</button>\n\n </div>`;\n }\n\n document.getElementById(\"productsRow\").innerHTML = temp;//kda hy7ot el data f div row 34an tt3rd\n}", "title": "" }, { "docid": "1e63f68861f02ccd1aaaa3d7d464c2ad", "score": "0.6112122", "text": "function populateProductDetails(product) {\n\t// Populate the product details with the data from the product object\n\tdocument.getElementById(\"product-name\").innerHTML = product.productName;\n\tdocument.getElementById(\"product-desc-long\").innerHTML = product.productDescLong;\n\tdocument.getElementById(\"product-price\").innerHTML = '$' + product.productPrice;\n}", "title": "" }, { "docid": "2c2b3a163da15b5d1b579d57009c0985", "score": "0.6112022", "text": "showComboProducts(combos) {\n var lenCombo = combos.length;\n var html = \" \";\n if (lenCombo > 0) {\n for (var r = 0, lengthCombo = lenCombo; r < lengthCombo; r++) {\n if (parseInt(combos[r][\"cart_menu_component_product_qty\"]) > 0) {\n var comboPro = combos[r][\"cart_menu_component_product_name\"];\n var comboQty = combos[r][\"cart_menu_component_product_qty\"];\n var comboPrice = combos[r][\"cart_menu_component_product_price\"];\n var newPrice = comboPrice > 0 ? \" (+\" + comboPrice + \")\" : \"\";\n html += \"<p>\" + comboQty + \" X \" + comboPro + newPrice + \" </p> \";\n }\n }\n return html;\n }\n return \"\";\n }", "title": "" }, { "docid": "f2c758f557d1240e14c7c4b087406823", "score": "0.6106822", "text": "function singleProductPage(shoe) {\n var template = loadContent('content/produktseite.xhtml');\n \n template = template.replace('{name}', shoe.getName());\n template = template.replace('{url}', shoe.getBildUrl());\n template = template.replace('{description}', shoe.getBeschreibung());\n template = template.replace('{price}', shoe.getPreis().toFixed(2));\n template = template.replace('{color}', shoe.getFarbe());\n template = template.replace('{size-from}', shoe.getGroesseVon());\n template = template.replace('{size-to}', shoe.getGroesseBis());\n template = template.replace(/{id}/g, shoe.getId());\n \n // Bei Objekten der Klasse Laufschuh wird die Dämpfung ausgegeben.\n if (shoe.klasse == \"Laufschuh\") {\n template = template.replace('{damping}', shoe.getDaempfung());\n }\n else {\n template = template.replace('{damping}', 'Keine');\n }\n \n return template;\n}", "title": "" }, { "docid": "4e8d2534947e7a0de42a9827b7257aa6", "score": "0.6099702", "text": "function displayProducts(products, max) {\n var html = '';\n\n if (products.length === 0) {\n html += '<div class=\"product-group\">No products were found.</div>';\n }\n else {\n for (var i = 0; i < max; i++) {\n var inStock = (parseInt(products[i]['dvdQuantity']) > 0 || parseInt(products[i]['bluRayQuantity']) > 0);\n var bluRayOnly = (parseInt(products[i]['dvdQuantity']) === 0 && parseInt(products[i]['bluRayQuantity']) > 0);\n\n var addToCartButton = '<div class=\"col-7\">' +\n ((inStock) ? 'Add to Cart' : 'Out of Stock') +\n '</div>' +\n '<div class=\"col-5 text-right\">' +\n ((inStock && !bluRayOnly) ? '£' + products[i]['dvdPrice'] : (bluRayOnly) ? '£' + products[i]['bluRayPrice'] : '') +\n '</div>';\n\n html += '<div class=\"col-4 mb-3 card-container\" id=\"' + products[i]['_id']['$oid'] + '\">' +\n '<div class=\"card thumbnail\">' +\n '<img class=\"card-img-top\" src=\"./img/products/' + products[i]['cover'] + '\">' +\n '<div class=\"card-body\">' +\n '<div class=\"row\">' +\n '<div class=\"col-12\">' +\n '<h6 class=\"card-title\">' + products[i]['title'] + '</h6>' +\n '</div></div></div>' +\n '<ul class=\"list-group list-group-flush\">' +\n '<button type=\"button\" class=\"list-group-item list-group-item-action btn view-product-btn view-product\" data-toggle=\"modal\" data-target=\"#productModal\">' +\n 'View Product' +\n '</button>' +\n '<button class=\"list-group-item list-group-item-action active ' + ((inStock) ? 'add-to-cart-btn' : 'out-of-stock-btn') + '\" id=\"cardAddToCart\">' +\n '<div class=\"row\">'\n + addToCartButton +\n '</div></button></ul></div></div>';\n }\n }\n\n getElementById('products').innerHTML = html;\n}", "title": "" }, { "docid": "9532a929051cb091069b1acd54236613", "score": "0.6089061", "text": "function viewProducts(){\n connection.query(\"SELECT * FROM products\",function(err,response){\n if(err) throw err;\n console.log(\"*********************************************\");\n console.log(\"View products below...\");\n for (let i=0; i<response.length;i++){\n console.log(\"\");\n console.log(`Item ID: ${response[i].item_id} ||Product Name: ${response[i].product_name} ||Department: ${response[i].department} ||Price ${response[i].price} ||Stock Quantity: ${response[i].stock_quantity}`);\n }\n startBamazonManager();\n })\n}", "title": "" }, { "docid": "c6e8b0fbc72a368c5fa0002fca5dcd76", "score": "0.60869765", "text": "function updateCartPreview(event) {\n // TODO: Get the item and quantity from the form\n // TODO: Add a new element to the cartContents div with that information\n var HTMLcontent = document.getElementById(\"cartContents\");\n HTMLcontent.innerHTML = ''\n if (!event) {\n console.log(allClicked.length)\n for (var i = 0; i < allClicked.length; i++){\n HTMLcontent.innerHTML += '<div>Item: ' + allClicked[i][0] + '</div>' \n + '<div>Quantity: ' + allClicked[i][1] + '</div><br>'\n }\n } else {\n HTMLcontent.innerHTML += '<div>' + Product.allProducts[event.target[1].value].name + '</div>' \n + '<div>' + event.target[2].value + '</div><br>'\n }\n\n}", "title": "" }, { "docid": "fbafd3c2f920c953a0ed1cd16c794ef3", "score": "0.607245", "text": "render() {\n return (\n <ScrollView>\n {this.props.navigation.getParam('productList').map(product => {\n const productAtCart = this.props.cartList.find(cartProduct => cartProduct._id === product._id)\n if (productAtCart) {\n return (<ProductTile key={productAtCart._id} product={productAtCart} onSelectProduct={this.handleSelectProduct} screen={'ProductListing'} />)\n } else {\n return (<ProductTile key={product._id} product={product} onSelectProduct={this.handleSelectProduct} screen={'ProductListing'} />)\n }\n })}\n </ScrollView>\n )\n }", "title": "" }, { "docid": "a9ad64838db4e893f1352b49cea618a5", "score": "0.6068249", "text": "function buildProductPage(productInfo) {\n\n // Grab .offer-panel\n var offerPanel = document.querySelector('.offer-panel');\n console.log(productInfo);\n var productTemplate = productInfo.body_html;\n\n offerPanel.innerHTML = productTemplate;\n}", "title": "" }, { "docid": "b8b3c343b5112965e782660b4a4a8165", "score": "0.6057558", "text": "function getProducts() {\n fetch(\"https://sleepy-journey-80556.herokuapp.com/show-products/\")\n .then((res) => res.json())\n .then((data) => {\n console.table(data);\n let list = document.getElementById(\"products\");\n console.log(list);\n data.forEach((product) => {\n let item = `\n <div class=\"card\" id=\"container\" >\n <div class=\"product-image\">\n <img src=${product.image} />\n </div>\n\n <div class = \"product-info\">\n <h4>${product.name}</h4>\n <h4>${product.price}</h4>\n <h5>${product.description}</h5>\n <h5>${product.reviews}</h5>\n <p><button onclick=\"addToCart(${product.ID})\">Add to Cart</button></p>\n <p><a href='details.html'><button>View more details</button></a></p>\n </div>\n \n </div>\n `;\n // console.log(item);\n list.innerHTML += item;\n });\n });\n}", "title": "" }, { "docid": "f5bab36a68bbf0bdba3f845c07db388a", "score": "0.6055594", "text": "showComboProducts(combos) {\n var lenCombo = combos.length;\n var html = \" \";\n if (lenCombo > 0) {\n for (var r = 0, lengthCombo = lenCombo; r < lengthCombo; r++) {\n var comboPro = combos[r][\"menu_product_name\"];\n var comboQty = combos[r][\"menu_product_qty\"];\n var comboPrice = combos[r][\"menu_product_price\"];\n var newPrice = comboPrice > 0 ? \" (+\" + comboPrice + \")\" : \"\";\n if (parseInt(comboQty) > 0) {\n html += \"<p>\" + comboQty + \" X \" + comboPro + newPrice + \" </p> \";\n }\n }\n return html;\n }\n return \"\";\n }", "title": "" }, { "docid": "bc6a9ab520b3edccc6fa5b1fbb9d217a", "score": "0.6050453", "text": "function display() {\n \"use strict\";\n\n //a catalog of products to display\n var catalog = [\n {\n \"id\": \"product.id.1\",\n \"type\": \"bundle\",\n \"colour\": \"blue\",\n \"sortorder\": 1\n },\n {\n \"id\": \"product.id.2\",\n \"type\": \"bundle\",\n \"colour\": \"red\",\n \"sortorder\": 2\n }\n ];\n\n //iterate over products and assemble templates for each\n var source = $(\"#product-template\").html();\n var template = Handlebars.compile(source);\n for (var p in catalog) {\n $(\"#products\").append(template(catalog[p]));\n }\n\n //add a submit button to the form\n var submit = $(\"<button />\", {\n text: \"Serialize\",\n click: function(e) {\n e.preventDefault();\n serialize();\n }\n });\n $(\"#products\").append(submit);\n}", "title": "" }, { "docid": "e8769d183d58f2d8c066aa6d6bc1807a", "score": "0.6041526", "text": "function windowViewProduct(productID){\n\n let _makeProductView = require('./modules/product-window-html');\n $('.insite').empty();\n\t$( \".product-grid\" ).empty();\n\t$(\".category_description\").empty();\njQuery.ajax({\n\turl: ('https://nit.tron.net.ua/api/product/'+productID),\n\tmethod: 'get',\n\tdataType: 'json',\n\tsuccess: function(json){\n\t\t\n\t $('.insite').append(_makeProductView(json));\n\t\t\n\t},\n\terror: function(xhr){\n\t\talert(\"An error occured: \" + xhr.status + \" \" + xhr.statusText);\n\t},\n\n});\n\n\n}", "title": "" }, { "docid": "f07463c310687e7ca107a9c047551b4f", "score": "0.6040382", "text": "function displayCart(AllProducts){\n\n for (let elem of cart){\n\n let productRow = document.getElementById('row')\n \n for (let product of AllProducts){\n\n if(elem.id === product._id){\n\n let container = document.createElement('div')\n \n let productImg = document.createElement('img')\n productImg.src = product.imageUrl \n\n let productName = document.createElement('p')\n let productNameText = document.createTextNode(product.name)\n productName.appendChild(productNameText)\n productName.className = 'name'\n\n let productOption = document.createElement('p')\n let productOptionText = document.createTextNode(elem.lense)\n productOption.appendChild(productOptionText)\n productOption.className = 'option'\n\n let productQuantity = document.createElement('p')\n let productQuantityText = document.createTextNode(elem.quantity)\n productQuantity.appendChild(productQuantityText)\n productQuantity.className = 'quantity'\n\n let productPrice = document.createElement('p')\n let productPriceText = document.createTextNode((elem.quantity * product.price)/100 )\n productPrice.appendChild(productPriceText)\n productPrice.className = 'price'\n\n container.appendChild(productImg)\n container.appendChild(productName)\n container.appendChild(productOption)\n container.appendChild(productQuantity)\n container.appendChild(productPrice)\n\n productRow.appendChild(container)\n }\n }\n }\n}", "title": "" }, { "docid": "50b4045333be475331cd75e4a36153ba", "score": "0.60389066", "text": "function GoNewProduct() {\n addActive(\"#newproduct\");\n $.ajax({\n type: \"GET\",\n url: '../service/products/get',\n dataType: 'json',\n data: '',\n success: function (respones) {\n $(\"#main-right-top\").removeClass(\"hidden\");\n $(\"#title-submenu\").text(\"Hàng mới về\" );\n $('#countPro').text(respones.length);\n $(\"#main-right\").empty();\n\n for(var i=0; i<respones.length; i++){\n var strShoe = '' +\n '<div class=\"col-sm-4 text-center view-shoe animated slideInUp\" onclick=\"btnBuyShoe('+ respones[i].product_id +')\">' +\n '<img src=\"'+ respones[i].image_name+'\" class=\"img-responsive center-block img-shoe\"/>' +\n '<div>'+ respones[i].product_name+'</div>' +\n '<div class=\"price-shoe\"><span>'+ respones[i].price+'</span><span>&nbsp;VND</span></div>' +\n '</div>';\n $(\"#main-right\").append(strShoe);\n }\n\n\n }\n });\n}", "title": "" }, { "docid": "000e7f9323efde44e1bfd46354b4a908", "score": "0.60366845", "text": "function GoPromotionProduct() {\n addActive(\"#promotionproduct\");\n $.ajax({\n type: \"GET\",\n url: '../service/products/get',\n dataType: 'json',\n data: '',\n success: function (respones) {\n $(\"#main-right-top\").removeClass(\"hidden\");\n $(\"#title-submenu\").text(\"Hàng giảm giá\" );\n $('#countPro').text(respones.length);\n $(\"#main-right\").empty();\n\n for(var i=0; i<respones.length; i++){\n var strShoe = '' +\n '<div class=\"col-sm-4 text-center view-shoe animated slideInUp\" onclick=\"btnBuyShoe('+ respones[i].product_id +')\">' +\n '<img src=\"'+ respones[i].image_name+'\" class=\"img-responsive center-block img-shoe\"/>' +\n '<div>'+ respones[i].product_name+'</div>' +\n '<div class=\"price-shoe\"><span>'+ respones[i].price+'</span><span>&nbsp;VND</span></div>' +\n '</div>';\n $(\"#main-right\").append(strShoe);\n }\n\n\n }\n });\n}", "title": "" }, { "docid": "7286feab9dd41eea61fa171ae1c7d1f1", "score": "0.60315853", "text": "function drawProductList() {\n if (!checkActiveUser()) return\n\n $(\".manager-menu\").hide()\n $(\".pl_product\").remove()\n $(\"#products_list\").show()\n\n for (const prod of data.products) {\n $(\"#pl_list\").append(`\n <tr class=\"no-bs-dark-2 pl_product\">\n <td>${prod.id}</td>\n <td class=\"pl_name_column\">${prod.name}</td>\n <td>${prod.price}</td>\n <td>${prod.stock}</td>\n <td><button type=\"button\" class=\"btn btn-primary pl_edit_btn px-3 py-1\" data-productId=\"${prod.id}\">Edit</button></td>\n <td><button type=\"button\" class=\"btn btn-danger pl_remove_btn px-3 py-1\" data-productId=\"${prod.id}\">Remove</button></td>\n </tr>`)\n }\n\n $(\".pl_edit_btn\").click(e => {\n const id = e.target.getAttribute(\"data-productId\")\n showUpdateProduct(transformIdToObj(data.products, id))\n })\n\n $(\".pl_remove_btn\").click(e => {\n const id = e.target.getAttribute(\"data-productId\")\n e.target.parentElement.parentElement.remove()\n data.products.splice(data.products.indexOf(transformIdToObj(data.products, id)), 1)\n saveStorage()\n })\n}", "title": "" }, { "docid": "7df8eec558ff0bb5ae386f55ff6a72ac", "score": "0.60315615", "text": "function viewProductsForSale() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n //Table formatting using Cli-table package\n var table = new Table({\n head: ['ITEM ID', 'PRODUCT NAME','DEPT', 'PRICE','QTY'],\n colWidths: [10, 40, 20, 15, 10]\n });\n console.log(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n console.log(chalk.bold(\"Bamazon Inventory\"));\n console.log(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n for(var i=0; i <res.length; i++){\n table.push ([res[i].item_id, res[i].product_name, res[i].department_name, \"$\" + res[i].price, res[i].stock_quantity]);\n }\n console.log (table.toString());\n console.log (\"\");\n startMrgApp();\n});\n }", "title": "" }, { "docid": "dde5ee69e7ec9d386b90517acaede8b8", "score": "0.60264415", "text": "function ars_build_page_ui(products, cart) {\n\n const rootEl = document.getElementById('root')\n const cartEl = ars_render_cart_sidebar(rootEl)\n const pageEl = ars_render_page_structure(rootEl)\n let pageHead = ars_create_page_heading( 'Shopping Cart App', 1 )\n let listElements = {\n listWrap : { el: ars_create_new_element('div','', [ ars_get_attr_obj('id', 'products-data') ] ), prevParent:pageEl },\n listCont : { el: ars_create_new_element('ul','', [ ars_get_attr_obj('class', 'products list-unstyled row') ] ), prevParent:'listWrap' },\n }\n //let productList = products.get_products()\n let productList = products.get_random_products()\n\n pageHead = ars_render_page_heading(pageEl, pageHead)\n\n if( productList ){\n productList.map( (e, i)=>{\n let e_price = products.get_product_price(e)\n\n listElements['listItem_'+i] = { el: ars_create_new_element('li','', [ ars_get_attr_obj('class', 'col-4 product-item my-3') ] ), prevParent:'listCont' }\n listElements['p_wrap_'+i] = { el: ars_create_new_element('div','', [ ars_get_attr_obj('class', 'product-wrap') ] ), prevParent:'listItem_'+i }\n\n listElements['p_imgw_'+i] = { el: ars_create_new_element('div','', [ ars_get_attr_obj('class', 'product-image') ] ), prevParent:'p_wrap_'+i }\n listElements['p_img_'+i] = { el: ars_create_new_element('img','', [ ars_get_attr_obj('alt', e.title), ars_get_attr_obj('src', e.img), ars_get_attr_obj('class', 'img-fluid center-block') ] ), prevParent:'p_imgw_'+i }\n\n listElements['p_head_'+i] = { el: ars_create_new_element('div','', [ ars_get_attr_obj('class', 'product-head') ] ), prevParent:'p_wrap_'+i }\n listElements['p_titl_'+i] = { el: ars_create_new_element('h3', e.title ), prevParent:'p_head_'+i }\n\n listElements['p_meta_'+i] = { el: ars_create_new_element('div','', [ ars_get_attr_obj('class', 'product-meta') ] ), prevParent:'p_wrap_'+i }\n\n if( e_price instanceof Array){\n listElements['p_pric_'+i] = { el: ars_create_new_element('span','', [ ars_get_attr_obj('class', 'price') ] ), prevParent:'p_meta_'+i }\n listElements['p_pedl_'+i] = { el: ars_create_new_element('del',e_price[0] ), prevParent:'p_pric_'+i }\n listElements['p_pins_'+i] = { el: ars_create_new_element('ins', e_price[1] ), prevParent:'p_pric_'+i }\n }\n else{\n listElements['p_pric_'+i] = { el: ars_create_new_element('span',e_price, [ ars_get_attr_obj('class', 'price') ] ), prevParent:'p_meta_'+i }\n }\n\n listElements['p_bbar_'+i] = { el: ars_create_new_element('div','', [ ars_get_attr_obj('class', 'btns-bar') ] ), prevParent:'p_meta_'+i }\n listElements['p_cbtn_'+i] = { el: ars_create_new_element('button','Add to Cart', [ ars_get_attr_obj('class', 'btn btn-sm btn-outline-primary'), ars_get_attr_obj('data-action', 'cart'), ars_get_attr_obj('data-refId', e.id) ] ), prevParent:'p_bbar_'+i }\n listElements['p_wbtn_'+i] = { el: ars_create_new_element('button','Add to Wishlist', [ ars_get_attr_obj('class', 'btn btn-sm btn-outline-secondary'), ars_get_attr_obj('data-action', 'wishlist'), ars_get_attr_obj('data-refId', e.id), ars_get_attr_obj('disabled', 'disabled') ] ), prevParent:'p_bbar_'+i }\n listElements['p_binp_'+i] = { el: ars_create_new_element('input','', [ ars_get_attr_obj('type', 'hidden'), ars_get_attr_obj('value', e.id) ] ), prevParent:'p_bbar_'+i }\n\n })\n\n }\n\n ars_render_products_list(pageEl, listElements)\n\n}", "title": "" }, { "docid": "57b2b1bbeee470a3e4a9ee0a357dfa1c", "score": "0.6022683", "text": "function renderInventory() {\n // console.log('___ENTER displayInventory___');\n\n // Construct the db query string\n queryString = \"SELECT * FROM products\";\n\n // Make the db query\n connection.query(queryString, function(err, data) {\n if (err) throw err;\n\n console.log(chalk.redBright(\"------Available items: ---------\"));\n console.log(\n chalk.blueBright(\n \"\\n---------------------------------------------------------------------\\n\"\n )\n );\n\n var inventory = \"\";\n for (var i = 0; i < data.length; i++) {\n inventory = \"\";\n inventory += \"Item ID: \" + data[i].item_id + \" || \";\n inventory += \"Product Name: \" + data[i].product_name + \" || \";\n inventory += \"Department: \" + data[i].department_name + \" || \";\n inventory += \"Price: $\" + data[i].price + \"\\n\";\n\n console.log(inventory);\n }\n\n console.log(\n chalk.blueBright(\n \"---------------------------------------------------------------------\\n\"\n )\n );\n\n //Prompt the user for item/quantity they would like to purchase\n customersInput();\n });\n}", "title": "" }, { "docid": "78d28f49a9014b2fe95c80ec386b1174", "score": "0.60180324", "text": "function getProducts() {\n fetch(\"https://final-project2021.herokuapp.com/show-items/\")\n .then((res) => res.json())\n .then((data) => {\n let list = document.getElementById(\"myproducts\");\n\n data.forEach((product) => {\n // console.log(product.product_id);\n let item = `\n <div id=\"row3\" class= \"card\" >\n <div class=\"column3\">\n <img class=\"image\" src=${product.images} />\n <h4 class=\"c3\">${product.product_name}</h4>\n <h4>${product.brand_name}</h4>\n <h4>${product.price}</h4>\n <p><button onclick=\"addTocart(${product.product_id})\">Add to Cart</button></p>\n </div>\n </div>\n `;\n list.innerHTML += item;\n });\n });\n try {\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "aa21e04a78e37d29c530427caa9514da", "score": "0.60122746", "text": "function viewProductsForSale () {\n connection.query(\"SELECT * FROM products\", (err, data ) => {\n if (err){\n log(err);\n log(`Oops! Something has gone wrong here. Please try connecting later.`)\n }\n log(\"******************************************************\");\n log(\"************Welcome to Bamazon's Manager Interface*************\");\n log(\"******************************************************\");\n log(\"\");\n log(\"***********Current inventory below************\"); \n log(\"\"); \n\n let table = new Table({\n head: [\"Product ID\",\"Department\", \"Price\", \"In Stock\"],\n colWidths: [8, 20, 8, 8],\n colAligns: [\"center\",\"left\", \"center\", \"center\"],\n style: {\n head: [\"purple\"],\n compact: true\n }\n }); \n \n for (var i = 0; i < data.length; i++) {\n table.push([\n data[i].item_id, \n data[i].product_name,\n data[i].price,\n data[i].stock_quantity\n ]);\n }\n\n log(table.toString()); \n log(\"******************************************************\");\n \n });\n}", "title": "" }, { "docid": "d9c92eaeb033652ec76f49548c4cb58a", "score": "0.6011248", "text": "function CheeseCard({ productData, min, max, category }) {\n console.log(productData);\n const dataObject = JSON.parse(productData.productData);\n //console.log(dataObject);\n return (\n <>\n {/* src={`/assets/products/${prod.ProductName.replace(/ /g, \"-\")}.png`} */}\n {dataObject\n .filter((cheese) => category === \"all\" || cheese.category === category)\n .filter((cheese) => cheese.price >= min && cheese.price <= max)\n .map((cheese) => {\n return (\n <a href={\"./products/\" + cheese.name} className={layoutStyles.card}>\n <Image\n src={`/${cheese.image}.jpeg`}\n width=\"200\"\n height=\"170\"\n alt={cheese.name}\n />\n <h2>{cheese.name}</h2>\n <p>See more</p>\n </a>\n );\n })}\n </>\n );\n}", "title": "" }, { "docid": "e841192809394a28fcadb1581f293854", "score": "0.6002972", "text": "function showMyProducts(group){\n\t\t$.ajax({\n\t\t\turl: `${url}/products`,\n\t\t\ttype: 'GET',\n\t\t\tdataType :'json',\n\t\t\tsuccess: function(data){\n\t\t\t\tdocument.getElementById('myProductCards').innerHTML = \"\";\n\t\t\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\t\t\tif(group === \"selling\" && data[i].sellerId == sessionStorage.getItem(\"userID\") && data[i].status === \"listed\"){\n\t\t\t\t\t\tlet card =`<div class=\"product-link position-rel card p-0 col-lg-3 col-sm-12 col-md-6\" id=\"${data[i][\"_id\"]}\">\n\t\t\t\t\t\t<img class=\"card-img-top p-4 bg-light\" src=\"${data[i].image}\" alt=\"Image\">\n\t\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t<h3 class=\"card-title\"> ${data[i].title}</h3>\n\t\t\t\t\t\t<h4 class=\"card-text\">$${data[i].price}</h4>\n\t\t\t\t\t\t</div></div>`;\n\t\t\t\t\t\tdocument.getElementById('myProductCards').innerHTML += card;\n\t\t\t\t\t}\n\t\t\t\t\tif(group === \"sold\" && data[i].sellerId == sessionStorage.getItem(\"userID\") && data[i].status === \"sold\"){\n\t\t\t\t\t\tlet card =`<div class=\"product-link position-relative card p-0 col-lg-3 col-sm-12 col-md-6\" id=\"${data[i][\"_id\"]}\">\n\t\t\t\t\t\t<img class=\"card-img-top p-4 bg-light\" src=\"${data[i].image}\" alt=\"Image\">\n\t\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t<h3 class=\"card-title\"> ${data[i].title}</h3>\n\t\t\t\t\t\t<div class=\"alert alert-danger col-12 text-center\" role=\"alert\">Sold</div>\n\t\t\t\t\t\t</div></div>`;\n\t\t\t\t\t\tdocument.getElementById('myProductCards').innerHTML += card;\n\t\t\t\t\t}\n\t\t\t\t\tif(group === \"bought\" && data[i].buyerId == sessionStorage.getItem(\"userID\") && data[i].status === \"sold\"){\n\t\t\t\t\t\tlet card =`<div class=\"product-link position-relative card p-0 col-lg-3 col-sm-12 col-md-6\" id=\"${data[i][\"_id\"]}\">\n\t\t\t\t\t\t<img class=\"card-img-top p-4 bg-light\" src=\"${data[i].image}\" alt=\"Image\">\n\t\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t<h3 class=\"card-title\"> ${data[i].title}</h3>\n\t\t\t\t\t\t<div class=\"alert alert-success col-12 text-center\" role=\"alert\">Bought</div>\n\t\t\t\t\t\t</div></div>`;\n\t\t\t\t\t\tdocument.getElementById('myProductCards').innerHTML += card;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\topenProduct();\n\t\t\t},\n\t\t\terror: function(error) {\n\t\t\t\tconsole.log('no good');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "9bd9879f9289d1013a8d8dbaca97171c", "score": "0.59986025", "text": "function GoShoeMale() {\n addActive(\"#shoemale\");\n $(\"#main-right-top\").removeClass(\"hidden\");\n $(\"#title-submenu\").text(\"Giày nam\");\n $(\"#main-right\").empty();\n\n $.ajax({\n type: \"GET\",\n url: '../service/products/getType/nam',\n dataType: 'json',\n data: '',\n success: function (respones) {\n\n $('#countPro').text(respones.length);\n for(var i=0; i<respones.length; i++){\n var strShoe = '' +\n '<div class=\"col-sm-4 text-center view-shoe animated slideInUp\" onclick=\"btnBuyShoe('+ respones[i].product_id +')\">' +\n '<img src=\"'+ respones[i].image_name+'\" class=\"img-responsive center-block img-shoe\"/>' +\n '<div>'+ respones[i].product_name+'</div>' +\n '<div class=\"price-shoe\"><span>'+ respones[i].price+'</span><span>&nbsp;VND</span></div>' +\n '</div>';\n $(\"#main-right\").append(strShoe);\n }\n\n\n }\n });\n}", "title": "" }, { "docid": "e6d2cf18d8871ead439cd2730671f82d", "score": "0.5996047", "text": "function productList() {\n return `\n <script type=\"application/json\">\n [\n {% for product in collections.all.products %}\n \"{{ product.title }}\",\n {% endfor %}\n ]\n </script>\n `;\n}", "title": "" }, { "docid": "5c3d276d573137b4760340703e181b3d", "score": "0.5995386", "text": "function renderProductDetails() {\n\t\tconst url = window.location.pathname;\n\t\tconst id = url.substring(url.lastIndexOf('/') + 1);\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: \"http://localhost:4002/api/products/\" + id,\n\t\t\t\tcontentType :'application/json',\n\t\t\t\tsuccess: handlePage\n\t\t\t});\n\t}", "title": "" }, { "docid": "6254c663ad5a69d35c6dbffaf39563b4", "score": "0.599491", "text": "function showProducts() {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, products, _i, products_1, product, productDiv, productImage, infoDiv, nameH, priceP, reviewP, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 3, , 4]);\r\n return [4 /*yield*/, fetch('https://pw-uiewg-walletapp.firebaseio.com/products.json')];\r\n case 1:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 2:\r\n products = _a.sent();\r\n for (_i = 0, products_1 = products; _i < products_1.length; _i++) {\r\n product = products_1[_i];\r\n productDiv = document.createElement('div');\r\n productDiv.className = \"product\";\r\n productsDiv.appendChild(productDiv);\r\n productImage = document.createElement('img');\r\n productImage.className = \"photo\";\r\n productImage.src = product.photo;\r\n productDiv.appendChild(productImage);\r\n infoDiv = document.createElement('div');\r\n infoDiv.className = \"info\";\r\n productDiv.appendChild(infoDiv);\r\n nameH = document.createElement('h3');\r\n nameH.className = \"name\";\r\n nameH.innerText = product.name;\r\n infoDiv.appendChild(nameH);\r\n priceP = document.createElement('p');\r\n priceP.className = \"price\";\r\n product.price = product.price.toLocaleString(\"en-US\", { minimumFractionDigits: 2, maximumFractionDigits: 2 });\r\n priceP.innerText = \"\\u20B1\" + product.price;\r\n infoDiv.appendChild(priceP);\r\n reviewP = document.createElement('p');\r\n reviewP.className = \"reviews\";\r\n reviewP.innerText = product.reviews.length + \" reviews\";\r\n infoDiv.appendChild(reviewP);\r\n }\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n productsDiv.innerHTML = \"<b>Failed to load products</b>\";\r\n return [3 /*break*/, 4];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "d6552d376cd2c8e3ee5150085ddb3663", "score": "0.5993511", "text": "function shopForGlass() {\n // save the drink type\n var drinkOfChoice = thisVar.find(\".shop-results\");\n // save the glass type text which precedes the button\n glass = thisVar.find(\".shp\").text();\n console.log(glass);\n // builds the API request URL to get cocktail name results\n var queryURL = \"https://api.walmartlabs.com/v1/search?apiKey=vcn53dyhzmzmxzmg2krfxddy&query=\" + glass + \"&categoryId=4044&sort=bestseller\";\n console.log(queryURL);\n // AJAX request\n $.ajax({\n url: queryURL,\n method: \"GET\",\n dataType: \"jsonp\"\n }).done(function(response) {\n // store the response object\n shopRecos = response.items;\n console.log(shopRecos);\n // build the html that will display the shopping recommendations\n productRecoUL = $(\"<div>\");\n productRecoUL.addClass(\"shopper\");\n // productRecoUL.addClass(\"owl-theme\");\n // loop through each recommendation\n for (s = 0; s < shopRecos.length; s++) {\n // verify the recommendation is available for online purchase\n if (shopRecos[s].availableOnline) {\n\n // create a new img element\n var resultImg = ($(\"<img>\"));\n // add the API's product image URL to the img element\n resultImg.attr(\"src\", shopRecos[s].imageEntities[0].largeImage);\n\n // create a new p element for the product name\n var name = ($(\"<p>\"));\n // add the API's product text to the p element\n if (shopRecos[s].name.length > 40) {\n name.text((shopRecos[s].name).substring(0, 40) + \"...\");\n } else {\n name.text((shopRecos[s].name));\n };\n \n\n // create a new p element for the price\n var price = ($(\"<p>\"));\n price.text(\"$\" + (shopRecos[s].salePrice).toFixed(2));\n\n //create the a href element & append to productRecoUL\n var recoLink = $('<a>',{\n href: shopRecos[s].productUrl,\n target: \"_blank\"\n });\n\n // build a new div\n var resultDiv = $(\"<div>\", {\n class: \"reccomendation\"\n });\n\n // Append/prepend everything\n recoLink.append(resultImg).append(name);\n resultDiv.append(recoLink).append(price);\n productRecoUL.prepend(resultDiv);\n\n }; // if statement\n }; //end loop\n // console.log(productRecoUL.html());\n // call the openModal function\n openModal();\n });\n //open modal\n \n}", "title": "" }, { "docid": "31eb1097f05179d103f83a287c94b793", "score": "0.5988753", "text": "shopEvent(eventData) {\n const numProds = Math.ceil(Math.random() * 4);\n\n const products = [];\n let j;\n let priceFactor;\n\n for (let i = 0; i < numProds; i += 1) {\n j = Math.floor(Math.random() * eventData.products.length);\n\n priceFactor = 0.7 + 0.6 * Math.random();\n\n products.push({\n item: eventData.products[j].item,\n qty: eventData.products[j].qty,\n price: Math.round(eventData.products[j].price * priceFactor),\n });\n }\n this.ui.showShop(products);\n }", "title": "" }, { "docid": "c664df48efa83b25fc898944665474be", "score": "0.59813464", "text": "async populatePage() {\n // make ajax request to get the product\n let response = await this.props.getProduct(this.product);\n\n let status = response.status;\n\n let product = {};\n if (status < 201) {\n product = response.data;\n } else {\n return;\n }\n \n response = await this.props.getRecommendations(this.product); \n status = response.status;\n\n if (status < 201) {\n // get the response json object after parsing\n responseObject = JSON.parse(response.data);\n \n // destruct the object to get the attributes of the object\n let { similarProducts, complementaryProducts } = responseObject;\n\n similarProductNames = []\n\n for (let i = 0; i < similarProducts.length; ++i) {\n \n const product = similarProducts[i];\n\n const cartCard = <CartCard clickable onCardPress = {() => this.onCardPress(product)} img = {product.productImgUrl} title = {product.title} price = {product.price}/>\n\n similarProductNames.push(cartCard);\n }\n\n this.similarProducts = this.ds.cloneWithRows(similarProductNames);\n\n\n complementaryProductNames = []\n\n for (let i = 0; i < complementaryProducts.length; ++i) {\n\n const product = complementaryProducts[i];\n\n const cartCard = <CartCard clickable onCardPress = {() => this.onCardPress(product)} img = {product.productImgUrl} title = {product.title} price = {product.price}/>\n\n complementaryProductNames.push(cartCard);\n }\n\n this.complementaryProducts = this.ds.cloneWithRows(complementaryProductNames);\n\n if (similarProducts.length !== 0) {\n this.similar = true;\n }\n\n if (complementaryProducts.length !== 0) {\n this.comp = true;\n }\n\n\n this.productCard = <BasicItemCard productView onAddToCart = {() => this.onAddToCart(product)} title = {product.title} category = {product.category} productImg = {product.productImgUrl} price = {product.price}/>\n } else {\n return;\n }\n this.props.removeProduct();\n }", "title": "" }, { "docid": "ec24cdf346ca4314b0ffbf78faf1a1e2", "score": "0.59737235", "text": "handleProducts() {\n const cartArray = [Object.entries(this.state.cart)];\n const test = cartArray[0];\n //console.log(\"EL TEST\", test);\n test.forEach((element, i) => {\n //console.log(\"element\", element);\n //console.log(\"i\", i);\n const currentSku = element[0];\n //console.log(currentSku);\n axios\n .get(`http://localhost:5000/api/products/sku/${currentSku}`)\n .then((response) => {\n //console.log(\"respones\", response.data);\n let productsCopy = [...this.state.products];\n //console.log(\"units\", this.state.cart[currentSku]);\n response.data[\"units\"] = this.state.cart[currentSku]; //this line is to associate the number of units with the product in matter.\n productsCopy.push(response.data);\n this.setState({ products: productsCopy });\n //console.log(\"state\", this.state.products);\n });\n });\n }", "title": "" }, { "docid": "dc738c55d64c29e47d5163e96ac1b281", "score": "0.59736645", "text": "function viewProducts(){\n console.log('All available items:');\n\n // select all products enteres in database\n db.query('SELECT * FROM products', function(err, res){\n if(err) throw err;\n console.table(res);\n\n // for(var i = 0; i< res.length; i++){\n\n // // console.log(\n // // \"ID: \" + res[i].item_id + \" | \" + \n // // \"Product: \" + res[i].product_name + \" | \" + \n // // \"Department: \" + res[i].department_name + \" | \" + \n // // \"Price: \" + res[i].price + \" | \" + \n // // \"QUANTITY: \" + res[i].stock_quantity);\n // }\n\n // allow user to start a new search\n runSearch();\n });\n}", "title": "" }, { "docid": "a9a77a413405f1f6d30ad4afbdc207d1", "score": "0.597337", "text": "function renderProducts() {\n\n var newImage1 = rig();\n\n getImage1.src = newImage1.imagePath;\n getImage1.name = newImage1.name;\n newImage1.timesRendered++;\n\n var newImage2 = rig();\n\n getImage2.src = newImage2.imagePath;\n getImage2.name = newImage2.name;\n newImage2.timesRendered++;\n\n var newImage3 = rig();\n\n getImage3.src = newImage3.imagePath;\n getImage3.name = newImage3.name;\n newImage3.timesRendered++;\n}", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "dd9f0ee428963a5392ab8604e629004b", "score": "0.0", "text": "function e(t,e,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return e?r[n][0]:r[n][1]}", "title": "" } ]
[ { "docid": "178433e4b11f9ddcb88c4b6e193a2995", "score": "0.82468", "text": "function Wr(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "title": "" }, { "docid": "a390e3889aaf18f7f94b575486cc78ae", "score": "0.82049495", "text": "function ya(e,a,t){var n={ss:a?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:a?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:a?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===t?a?\"хвилина\":\"хвилину\":\"h\"===t?a?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,a){var t=e.split(\"_\");return a%10==1&&a%100!=11?t[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?t[1]:t[2]}(n[t],+e)}", "title": "" }, { "docid": "d8460bf77dfc9523fd479119f87673fb", "score": "0.8185823", "text": "function b(e,t,n){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}//! moment.js locale configuration", "title": "" }, { "docid": "495a928bc0fe94f1ee8dfcd920e9e883", "score": "0.747598", "text": "function n0(e,t,n,s){var i={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[e+\" Tage\",e+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[e+\" Monate\",e+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[e+\" Jahre\",e+\" Jahren\"]};return t?i[n][0]:i[n][1]}//! moment.js locale configuration", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.72037613", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71981734", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71981734", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.7170814", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.7170814", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.7170814", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d11d49c1c0d4ff5684649e17cdef56d0", "score": "0.71322805", "text": "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "title": "" }, { "docid": "d455a45fc49181379dc1a8784dc96a09", "score": "0.7127862", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(\"undefined\"!==typeof console&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "bb8b71ffd36b2533e0a66198bff05a13", "score": "0.69287264", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(typeof values === 'undefined'){data = locale_locales__getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "ee81d7536b923f48eaaac79336a54c14", "score": "0.67246926", "text": "async function useLocale(name: string) {\n // import locale as you do normally\n // smth like `require('moment/locale/en-gb')` will happen down the lines\n await import(`moment/locale/${name}`);\n moment.locale(name); // apply it to moment\n // eslint-disable-next-line no-underscore-dangle (in case eslint is also used ;) )\n momentTZ.defineLocale(name, moment.localeData()._config); // copy locale to moment-timezone\n momentTZ.locale(name); // apply it to moment-timezone\n}", "title": "" }, { "docid": "2c83a51fb5077040656e855f9655f4e9", "score": "0.6690726", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "bd45c18382f47b3e3883f2f8774dbdef", "score": "0.64982843", "text": "function toMomentLocale(lang) {\n if (lang === undefined) {\n return undefined;\n }\n\n // moment.locale('') equals moment.locale('en')\n // moment.locale(null) equals moment.locale('en')\n if (!lang || lang === 'en' || lang === 'default') {\n return 'en';\n }\n return lang.toLowerCase().replace('_', '-');\n}", "title": "" }, { "docid": "905b2a63b0758abf2b864fb122567678", "score": "0.6456787", "text": "convertFormat() {\n\n let format = this.options.format;\n this.options._format = this.options.format; // store orginal Moment format\n\n if (format) {\n\n // lower case everything\n format = format.toLowerCase();\n\n // Since we lowercased everything convert the map is slightly different than above\n const map = {'mmm': 'M', 'mmmm': 'MM', 'ddd': 'D', 'dddd': 'DD'};\n const re = new RegExp(Object.keys(map).join('|'), 'gi');\n format = format.replace(re, matched => {\n return map[matched];\n });\n\n }\n\n // this is moment format converted to bootstrap-datepicker.js format.\n this.options.format = format;\n\n }", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.6334324", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.6334324", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62773275", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "15c20f00d96a62ebece47e3cb1a1aa8d", "score": "0.61189526", "text": "defaultLocale() {\n return validLocale[0];\n }", "title": "" }, { "docid": "73d22ab8f995621a741e2135a4ca6d40", "score": "0.6095494", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60916936", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60916936", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60916936", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60916936", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60916936", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60916936", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60916936", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "40b3c68c07532eaf59b06d98280ea5ac", "score": "0.6078313", "text": "static localize () {\n\t\tthis.trigger ('willLocalize');\n\n\t\t// Setup the correct locale for the momentjs dates\n\t\tmoment.locale (this._languageMetadata[this.preference ('Language').code]);\n\n\t\tthis.element ().find ('[data-string]').each ((element) => {\n\t\t\tconst string_translation = this.string ($_(element).data ('string'));\n\n\t\t\t// Check if the translation actually exists and is not empty before\n\t\t\t// replacing the text.\n\t\t\tif (typeof string_translation !== 'undefined' && string_translation !== '') {\n\t\t\t\t$_(element).text (string_translation);\n\t\t\t}\n\t\t});\n\t\tthis.trigger ('didLocalize');\n\t}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60770184", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60770184", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60770184", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60770184", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6071914", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
21110feef32c3f0926dfab0954bbb45a
FRIEND UPDATER (LEVEL 2)
[ { "docid": "b6cc4550f5cf2faaa0b48e84eeb4768f", "score": "0.0", "text": "function TargetUpdater2 ( opts ) {\n this._opts = opts;\n return this;\n}", "title": "" } ]
[ { "docid": "4c29c0cbb043aee41a204de006adf9ef", "score": "0.6257076", "text": "function updateFriends() {\n\t\t// FriendFactory.getFriends takes a callback function that has the output as a parameter\n\t\tFriendFactory.getFriends(function(output) {\n\t\t\t$scope.friends = output;\n\n\t\t});\n\t}", "title": "" }, { "docid": "357655f7e7dc71302f5b08bc9971c616", "score": "0.5943595", "text": "function C101_KinbakuClub_RopeGroup_FriendOfAFriend() {\n\tif (ActorGetValue(ActorLove) >= 3) {\n\t\tOverridenIntroText = GetText(\"StayRightThere\");\n\t\tC101_KinbakuClub_RopeGroup_NoActor()\n\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 661;\n\t}\n}", "title": "" }, { "docid": "4716297df57832eb17fee3aba0c0c9d8", "score": "0.59373516", "text": "function friendChange(req, res, json) {\n if (!json.touser) {\n return403(req, res, 'touser is necessary, see : http://10.21.118.240/wiki/doku.php?id=groupchange&#%E5%88%A0%E9%99%A4%E5%A5%BD%E5%8F%8B');\n return false;\n }\n if (!json.user) {\n return403(req, res, 'user is necessary, see : http://10.21.118.240/wiki/doku.php?id=groupchange&#%E5%88%A0%E9%99%A4%E5%A5%BD%E5%8F%8B');\n return false;\n }\n\n json.order = 'SYS';\n msgsend.sys(json.touser, json);\n return200(req, res, '请求成功');\n\n}", "title": "" }, { "docid": "d92953cbbe68fd2536f2291f186d0567", "score": "0.5879715", "text": "function updateFriendInfo(aNick, aFriend, aEndpoint) {\n var friend = findFriend(aNick, aFriend);\n if (friend !== null) {\n people[aNick][friend].endpoint = aEndpoint;\n } else {\n people[aNick].push({nick: aFriend, endpoint: aEndpoint});\n }\n }", "title": "" }, { "docid": "b6e5f5977a72d2b80131f61f106cab52", "score": "0.58695394", "text": "function UpdateInSentFriendRequestList(friendUid){\n\tdatabase.ref(\"users/\"+currentUser.uid+\"/SentFriendRequestList\").push().\n\tset({requestUid:friendUid}).then(function(){\n\t\tconsole.log(\"friend request details added in PendingRequestList\");\n\t\tSentFriendRequestList.push(friendUid);\n\t\tlet div=document.getElementsByClassName(friendUid)[0];\n\t\tdocument.getElementById('friendList').removeChild(div);\n\t\tdisplayUserWhomCurrentUserSendRequestAlready(friendUid);\n\t});\n\t\n}", "title": "" }, { "docid": "4617b39b3ee8953d425fb8f4a62e1dc5", "score": "0.57777065", "text": "requestFriend(uid) {\n // console.log('send friend request to: ', uid, name)\n firebase.database().ref(`/users/${this.uid}/requestedFriends/`).update({[uid]: uid})\n firebase.database().ref(`users/${uid}/requestingFriends/`).update({[this.uid]: this.uid})\n }", "title": "" }, { "docid": "098d71cb87817dff4ea053c5bbf34ca4", "score": "0.57409084", "text": "function update(){\n updateAccess();\n getLeaderboard();\n}", "title": "" }, { "docid": "9102159edacce023986b4704349c4481", "score": "0.5722298", "text": "function queryUpdateFoodUsageRelation(tx, id, val, val2, i) {\n \ttx.executeSql('UPDATE TABLEUSAGE SET relationship = ' + val + ', people = ' + val2 + ' WHERE usageID = ' + id);\t\n \tuserFoodUsageInfo[i][2] = val;\n \tuserFoodUsageInfo[i][1] = val2;\n }", "title": "" }, { "docid": "775bd0b5a6e430ebf0b0da60a9954992", "score": "0.5716423", "text": "_update(){}", "title": "" }, { "docid": "d8d3b1003306f94cbafd85dd716f29f1", "score": "0.56970626", "text": "function updateFriendPingFromFoursquare(friendid, friendEntry, callit) // actual entry in mongo\r\n {\r\n var fsq = context.foursquare.create(); \r\n fsq.Users.getUser(friendid, r.oat, function (err,res) {\r\n // console.log('getting details on: ' + friendid);\r\n\r\n if (err) {\r\n callit(err, null);\r\n } else {\r\n if (res && res.user) { \r\n // pings aren't always reported by foursquare when false.\r\n var pingThisFriend = res.user.pings === true;\r\n if (res.rateLimitRemaining) {\r\n clientResults.rateLimitRemaining = res.rateLimitRemaining;\r\n }\r\n\r\n var oldPingValue = ! pingThisFriend;\r\n if (friendEntry && friendEntry.ping) {\r\n oldPingValue = friendEntry.ping;\r\n }\r\n\r\n friendEntry.pu = new Date();\r\n\r\n if (pingThisFriend != oldPingValue) {\r\n if (friendEntry.ping) {\r\n clientResults.log(\"Ping value changed for friend #\" + friendid + \": \" + pingThisFriend);\r\n } // else this is the first time ever checked.\r\n\r\n friendEntry.ping = pingThisFriend;\r\n }\r\n\r\n // how to handle the no-_id set code?\r\n if (friendEntry._id) {\r\n delete friendEntry._id;\r\n }\r\n\r\n // store their photo uri for windows 8 use\r\n if (res.user && res.user.photo) {\r\n friendEntry.photo = res.user.photo;\r\n }\r\n\r\n context.mongo.collections.friends.findAndModify(\r\n { userid: myId, friendid: friendid }, // query\r\n [['_id', 'asc']], // sort\r\n {$set: friendEntry },\r\n {\r\n 'new': true,\r\n upsert: true,\r\n safe: true\r\n },\r\n function(err, obj) {\r\n if(err) {\r\n console.log('mongo set fail!');\r\n console.dir(err);\r\n }\r\n\r\n // Set the document in the shared storage for use in this run.\r\n task.storage.friendsTable[friendid] = friendEntry;\r\n\r\n callit(err, null);\r\n });\r\n } else {\r\n // Not enough data!\r\n console.log('updateFriendPing info, not enough data was in the response...');\r\n\r\n // NOTE: Not erroring out for now!\r\n callit(null, null);\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "f334d6bf46e5d626224d83c23222860f", "score": "0.5695576", "text": "function updateFoodUsageRelAndPeople(data, i) {\n \tvar id = userFoodUsageInfo[i][0];\n \tdb.transaction( function(tx){ queryUpdateFoodUsageRelation(tx, id, data[0].type, data[0].number, i) }, errorCallbackSQLite);\t\n }", "title": "" }, { "docid": "df8988a950e063de16acb2cd36ae0d5b", "score": "0.5692126", "text": "function updateFriendsLocations() {\n\n /* TODO: pull from the database to grab friends' locations */\n getFriendsLocation().then(response => {\n setFriends(response);\n })\n \n }", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.5651639", "text": "function update(){}", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.5651639", "text": "function update(){}", "title": "" }, { "docid": "cabef28ed4ffff2f7e60a5b530a13cb7", "score": "0.56412613", "text": "addOrUpdateFriend(friend) {\n if (!this.friends) {\n this.friends = [friend];\n }\n else {\n var index = -1;\n for (var i = 0; i < this.friends.length; i++) {\n if (this.friends[i].$key == friend.$key) {\n index = i;\n }\n }\n if (index > -1) {\n this.friends[index] = friend;\n }\n else {\n this.friends.push(friend);\n }\n }\n }", "title": "" }, { "docid": "0eab5365af588c1b3fbc4f0885c8de25", "score": "0.5641151", "text": "function changeFriendElement(friendKey){\n var friendData;\n for (var i = 0; i < userArr.length; i++){\n if(friendKey == userArr[i].uid){\n friendData = userArr[i];\n break;\n }\n }\n\n if(friendData != null) {\n var userUid = friendData.uid;\n var friendName = friendData.name;\n var friendUserName = friendData.userName;\n var friendShareCode = friendData.shareCode;\n var liItemUpdate = document.getElementById(\"user\" + userUid);\n liItemUpdate.innerHTML = friendName;\n liItemUpdate.className = \"gift\";\n liItemUpdate.onclick = function () {\n var span = document.getElementsByClassName(\"close\")[0];\n var friendSendMessage = document.getElementById('sendPrivateMessage');\n var friendInviteRemove = document.getElementById('userInviteRemove');\n var friendNameField = document.getElementById('userName');\n var friendUserNameField = document.getElementById('userUName');\n var friendShareCodeField = document.getElementById('userShareCode');\n\n if (friendShareCode == undefined) {\n friendShareCode = \"This User Does Not Have A Share Code\";\n }\n\n friendNameField.innerHTML = friendName;\n friendUserNameField.innerHTML = \"User Name: \" + friendUserName;\n friendShareCodeField.innerHTML = \"Share Code: \" + friendShareCode;\n\n friendSendMessage.onclick = function() {\n generatePrivateMessageDialog(friendData);\n };\n\n friendInviteRemove.onclick = function () {\n modal.style.display = \"none\";\n deleteFriend(userUid);\n };\n\n //show modal\n modal.style.display = \"block\";\n\n //close on close\n span.onclick = function () {\n modal.style.display = \"none\";\n };\n\n //close on click\n window.onclick = function (event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n };\n }\n }", "title": "" }, { "docid": "ced327b33a4f0b6766fc05b29a537bff", "score": "0.56349826", "text": "function uppdatMemberInAppData(e){\n\n const originalName =e.target.closest('.member-in-list').querySelector('.memebr-name').textContent;\n\n const newList = {\n name:e.target.closest('.member-in-list').querySelector('.new-member-name').value\n };\n\n appData.members.forEach((member)=>{\n if(member.name===originalName){\n member.name=newList.name;\n }\n })\n\n}", "title": "" }, { "docid": "9c12903a4949b44d23014307a1daa2b7", "score": "0.56233835", "text": "async updateConversation(usr, update) {\n const condition = { facebook_id: usr.facebook_id };\n await userService.updateOne(condition, update);\n }", "title": "" }, { "docid": "3309ea7cf82e43b17429a35b25e993fd", "score": "0.5614351", "text": "followed(fansId){\n\n }", "title": "" }, { "docid": "46fb5f37e7ee2d4bb554027cebbbce9a", "score": "0.5607954", "text": "unFollowed(fansId){\n\n }", "title": "" }, { "docid": "9bd0a2f98d54aef2d1f501673363ea41", "score": "0.5606184", "text": "addOrUpdateFriend(friend) {\n if (!this.friends) {\n this.friends = [friend];\n }\n else {\n var index = -1;\n for (var i = 0; i < this.friends.length; i++) {\n if (this.friends[i].key == friend.key) {\n index = i;\n }\n }\n if (index > -1) {\n this.friends[index] = friend;\n }\n else {\n this.friends.push(friend);\n }\n }\n }", "title": "" }, { "docid": "781105b75432f7ef30da5d61970069ff", "score": "0.55814767", "text": "async function acceptFriendReq(req,res){\n try {\n const userId = await req.user._id;\n const fromUserId = await req.params.id\n \n await Friend.findOneAndUpdate(\n { requester: fromUserId, recipient: userId },\n { $set: { status: 3 }}\n )\n await Friend.findOneAndUpdate(\n { recipient: fromUserId, requester: userId },\n { $set: { status: 3 }}\n )\n } catch (error) {\n console.error()\n res.status(400).json({ error });\n } \n}", "title": "" }, { "docid": "15b1e29c97c44a4092af1515325a465c", "score": "0.5541645", "text": "function vkAddToFriends(uid) { showBox('al_friends.php', {act: 'add_box', mid: uid});}", "title": "" }, { "docid": "69a9ed04388b0e8d1e2a2d525d0948de", "score": "0.5528877", "text": "update(newPerson) {\n // condLog(\"Update the Ahnentafel object\", newPerson);\n\n if (newPerson && newPerson._data.Id) {\n this.primaryPerson = newPerson;\n }\n if (this.primaryPerson) {\n // this.PrimaryID = newPerson._data.Id\n this.list = [0, this.primaryPerson._data.Id]; // initialize the Array\n this.listByPerson = new Array(); // initialize the Array\n this.listByPerson[this.primaryPerson._data.Id] = 1; // add the primary person to the list\n\n if (this.primaryPerson._data.Father && this.primaryPerson._data.Father > 0) {\n this.addToAhnenTafel(this.primaryPerson._data.Father, 2);\n }\n if (this.primaryPerson._data.Mother && this.primaryPerson._data.Mother > 0) {\n this.addToAhnenTafel(this.primaryPerson._data.Mother, 3);\n }\n this.listAll(); // sends message to the condLog for validation - this could be commented out and not hurt anything\n }\n }", "title": "" }, { "docid": "db9e3f0c7c5274b5bebedd4c2b9ab73c", "score": "0.55151105", "text": "updateRecipient() {\n\t\tthis.changeRecipient(this.manager.get(\"WWSUrecipients\").activeRecipient);\n\t}", "title": "" }, { "docid": "55400e28645bf897d1dc238da24cba52", "score": "0.54993075", "text": "function Relationship_Update(relationship_ID : int, impact : String)\n{\n\tdb = new dbAccess();\n\tdb.OpenDB(\"InteractionDB.sqdb\");\n\tvar tick_change : float;\n\t// determine tick change based on impact\n\tif (impact == 'negative')\n\t{\n\t\ttick_change = 1.0;\n\t}\n\telse if (impact == 'positive')\n\t{\n\t\ttick_change = -1.0;\n\t}\n\telse\n\t{\n\t\tDebug.Log('Not a valid impact');\n\t\treturn false;\n\t}\n\tvar characters = db.BasicQuery(\"SELECT character_ID, aquaintance_ID FROM relationships WHERE relationship_ID = \"+relationship_ID, true);\n\tvar character_ID : int;\n\tvar aquaintance_ID : int;\n\twhile(characters.Read())\n\t{\n\t\tcharacter_ID = characters.GetValue(0);\n\t\taquaintance_ID = characters.GetValue(1);\n\t}\n\t// update relationship\n\tvar ramp : String = \"SELECT ramp FROM opinions WHERE opinion_ID = relationships.opinion_ID\"; // get the ramp to change teh aggravation accordingly\n\tvar update : String = \"ticks = ticks + \"+tick_change+\", latest_impact = '\"+impact+\"', aggravation = aggravation + (ticks+\"+tick_change+\"+abs(ticks+\"+tick_change+\")*(\"+ramp+\"))\";\n\tdb.BasicQuery(\"UPDATE relationships SET \"+update+\" WHERE relationship_ID = \"+relationship_ID, false);\n\tdb.CloseDB();\n\n\tCalculate_Favour(character_ID, aquaintance_ID);\n}", "title": "" }, { "docid": "044f873d86d95c63a05772af68be69a2", "score": "0.54973966", "text": "changeMoodLevel(newMoodLevel) {\n this.dataProvider.updateCurrentUser().update({\n moodLevel: newMoodLevel\n }).then(params => {\n this.presentToast();\n });\n }", "title": "" }, { "docid": "446bd8158478fcae445796a167e00aca", "score": "0.5477809", "text": "function updateFbFriend(contactId, cfdata) {\n fb.friend2mozContact(cfdata);\n\n cfdata.fbInfo = cfdata.fbInfo || {};\n\n cfdata.fbInfo.org = [fb.getWorksAt(cfdata)];\n var birthDate = null;\n if (cfdata.birthday_date && cfdata.birthday_date.length > 0) {\n birthDate = fb.getBirthDate(cfdata.birthday_date);\n }\n cfdata.fbInfo.bday = birthDate;\n\n var address = fb.getAddress(cfdata);\n if (address) {\n cfdata.fbInfo.adr = [address];\n }\n\n if (cfdata.shortTelephone) {\n cfdata.fbInfo.shortTelephone = cfdata.shortTelephone;\n delete cfdata.shortTelephone;\n }\n\n // Then the new data saved to the cache\n var fbContact = new fb.Contact(fbContactsById[contactId]);\n var fbReq = fbContact.update(cfdata);\n\n // Nothing special\n fbReq.onsuccess = function() {\n debug('Friend updated correctly', cfdata.uid);\n onsuccessCb();\n };\n\n // Error. mark the contact as pending to be synchronized\n fbReq.onerror = function() {\n window.console.error('FB: Error while saving contact data: ',\n cfdata.uid);\n changed++;\n checkTotals();\n };\n }", "title": "" }, { "docid": "03fa1030bfcf99f8411f8677a0c4cbe5", "score": "0.5468112", "text": "async watchFriendsList()\n\t{\n\t\tawait DB.watchFriendsList();\n\t}", "title": "" }, { "docid": "8fc79946a82967a82b4a602a116f5519", "score": "0.5458099", "text": "function frndrelationchange(frndid,status='2'){\n var adminidforstorage= document.getElementById(\"adminusername\").value;\n //alert(\"ga\");\n$.ajax({\n type: \"POST\",\n\n cache: false,\n url: \"delete_friend/\",\n datatype: \"html\",\n data:{userid: adminidforstorage,friendid: frndid, friendship_status : status},\n success: function(data) {\n\n\n if(blockedlist.includes(frndid)){}\n else{blockedlist.push(frndid);}\n updateblockstatusonfb(frndid,'yes');\n\n loadmyfrndsintocollapse4();\n if(global_sendtouser==frndid){\n\n // chatcollapse(frndid);\n showchatofthatuser(frndid);\n $('#textmsgcollapsebottom').collapse('hide');\n document.getElementById(\"chatwindow\").innerHTML=\"\";\n showchatofthatuser(frndid,'yes');\n\n\n }\n}\n\n});\n\n\n}", "title": "" }, { "docid": "a07c756a97e324a1a2aa690cc9683a8c", "score": "0.54561836", "text": "updated () {}", "title": "" }, { "docid": "7fa1e064e70229f94d2e38b4960ad052", "score": "0.54505163", "text": "function changeUserAccessLevel(uid, newAccessLevel, email){\n var ids = [];\n var c_id;\n return new Promise(function(resolve, reject) {\n itemOp.find({'uid.id':uid, accessLevel: {$gt: newAccessLevel}}, {cid:1})\n .then(function(items){\n if(items.length > 0){\n c_id = items[0].cid.id;\n for(var i = 0, l = items.length; i < l; i++){\n ids.push(items[i]._id);\n }\n logger.debug(ids);\n return itemOp.update({_id: {$in: ids}}, {$set: {accessLevel: newAccessLevel}}, {multi:true});\n } else {\n return false;\n }\n })\n .then(function(response){\n if(!response){\n return false;\n } else {\n return changePrivacy(ids, uid, email, c_id);\n }\n })\n .then(function(response){\n if(!response){\n resolve({error: false, message: 'Nothing to update'});\n } else {\n resolve({error: false, message: 'success'});\n }\n })\n .catch(function(error){\n logger.debug('Error remove friend: ' + error);\n reject({error: true, message: error});\n });\n });\n}", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.5447663", "text": "function update() {}", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.5447663", "text": "function update() {}", "title": "" }, { "docid": "7d2da88beefe791ac8ddc4fd49eb3f38", "score": "0.5447663", "text": "function update() {}", "title": "" }, { "docid": "b666e5feadde13089dd41945e9d022b3", "score": "0.5437524", "text": "update()\n\t{\n\t\t//TODO:\n\t}", "title": "" }, { "docid": "b1a467baefc4b8ec8fea1b3c6995c257", "score": "0.5424646", "text": "function friendPeer(app, src, dest, pid, cbDone) {\n // for every found pairing, get any already indexed id parallels and add this\n // to the set\n // construct the per-app-account idr where the statuses are saved\n var id = 'friend:'+src+'@'+app+'/friends#'+dest;\n nexusClient.getOnePars(id, \"ids\", function(err, one) {\n var pars = one && one.pars;\n if (parStatus(pars, \"peers\")) return cbDone(false);\n // new peering!\n logger.debug(\"new peering found \",app,src,dest,pid);\n pars = parUpdateStatus(pars, \"peers\", true);\n var par = pid2par(pid);\n // also be sure to index the pid for it to match\n if (pars.indexOf(par) === -1) pars.unshift(par);\n nexusClient.setOneCat(id, \"ids\", {pars:pars}, function() {\n cbDone(true);\n });\n });\n\n}", "title": "" }, { "docid": "7ff1d7332b9ada80a9319b8249ddfd62", "score": "0.54092175", "text": "update() {\n\n // setState causes the component to re-render\n this.setState({\n friends:this.props.model.getListOfFriendsFromFirebase(),\n partyName: this.props.model.getPartyName(),\n numberOfGuests: this.props.model.getNumberOfGuests(),\n partyDuration: this.props.model.getPartyDuration()\n })\n }", "title": "" }, { "docid": "814c7299c59e4b9dd2b0dd858ba914f7", "score": "0.5408896", "text": "function userUpdated(\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n /**\n * User Information Object. */\n info\n)\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n{\n var nick = info.nick;\n var hasVid = info.hasVid;\n \n console.log(2, \"User updated.\");\n var nickstr = nick;\n\n if (hasVid===true)\n nickstr += ' (Video On)';\n else if (hasVid===false)\n nickstr += ' (Video Off)';\n\n $('#participant-list li').each(function () {\n if (nick === $(this).attr('nick')) {\n $(this).text(nickstr);\n Callcast.ShowRemoteVideo(info);\n }\n });\n \n}", "title": "" }, { "docid": "9a4d111541434ee0a51478d4c18f9c0a", "score": "0.53933376", "text": "async function updateUserFriends() {\n userFriends = await getFriendsList(currentUser.id);\n //console.log( userFriends );\n}", "title": "" }, { "docid": "265b2cd89e429acd2352fdb94aeab335", "score": "0.5393203", "text": "function confirmFriend (username, friendUserName, ret) {\n\treadByUsername(username, function(result){\n\t\tvar isFriend = result.friends.indexOf(friendUserName);\n\t\tvar contains = result.requests.indexOf(friendUserName);\n\t\tif (contains != -1){\n\t\t\tresult.splice(contains, 1);\n\t\t}\n\t\tif (isFriend == -1){\n\t\t\tresult.friends.push(friendUserName);\n\t\t}\n\t\tupdate(username, result, ret);\n\t});\n\treadByUsername(friendUserName, function(result){\n\t\tvar isFriend = result.friends.indexOf(username);\n\t\tvar contains = result.requests.indexOf(username);\n\t\tif (contains != -1){\n\t\t\tresult.splice(contains, 1);\n\t\t}\n\t\tif (isFriend == -1){\n\t\t\tresult.friends.push(username);\n\t\t}\n\t\tupdate(friendUserName, result, ret);\n\t});\n}", "title": "" }, { "docid": "3d85636177082960c5eeac4f98b67589", "score": "0.53900486", "text": "function addTrailMate() {\n firebase.auth().onAuthStateChanged(user => {\n if (user) {\n db.collection(\"users\").doc(user.uid).update({\n friendslist: firebase.firestore.FieldValue.arrayUnion(otherUser)\n // otherUser is the target uid\n });\n }\n });\n}", "title": "" }, { "docid": "e88c72d512a91ded85111f2190c8a039", "score": "0.5389774", "text": "async acceptFriend(input){\n const data = await conn.query(\"UPDATE Fitness_userRelationships SET status='Friends' WHERE user_id_1 =? AND user_id_2 =?\",[input.user_id_1,input.user_id_2]);\n if(!data) {\n throw Error('Not able to accept friend request')\n } else {\n return {status:\"Success\", msg: \"You are now friends!\"}\n }\n }", "title": "" }, { "docid": "e6f5cb61580967c7b536f469a9b1881c", "score": "0.5371203", "text": "function acceptFollowRequest(guid, followerGuid) {\n \n // Confirm we received a request \n \n connection.beginTransaction(function(err) {\n if (err) { \n console.log('Error:', JSON.stringify(err, null, 2));\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } else { \n connection.query({\n sql: 'UPDATE `friends` set `status` = ? WHERE `guid1` = ? AND `guid2` = ?',\n values: [ Relationship.IsFollowing, followerGuid, guid]\n }, \n function (err, results) {\n if (err) { \n printError(err);\n rollbackErrorResponse(); \n } else {\n console.log(\"will update notification\");\n updateAcceptFollowNotification(guid, followerGuid);\n }\n }); \n }\n }); \n }", "title": "" }, { "docid": "10534441883e899f504423a702e6eac0", "score": "0.5370816", "text": "function boss2_update() {\n\n}", "title": "" }, { "docid": "73bc0eac19776f23b2bece3a731ee84a", "score": "0.53606814", "text": "function fromFriends(container,friend_id) {\n $.ajax(\"/rest/fromFriends\",{data:{friend_id : friend_id},headers:jwtHeader(),method:\"PATCH\"})\n .done(function (data) {\n //REST returns \"mate\" if another is a mate or \"noMate\" otherwise\n $(container).closest(\".userEntity\").find(\".friendship\")[0].innerHTML =\n data===\"mate\"?\"<span class=\\\"badge badge-secondary\\\">Почитатель</span>\":\"\";\n $(container).find (\".toFriends\")[0].style.display = \"\";\n $(container).find (\".fromFriends\")[0].style.display = \"none\";\n onChangeFilter();//If a friend not a friend now, we must rid of them\n })\n .fail(onError)\n}", "title": "" }, { "docid": "f2801e7700f8d9bc3a878229519e65a9", "score": "0.5356656", "text": "function updateChat()\r\n{\r\n}", "title": "" }, { "docid": "2b625d06ee1216aee35918882bd52ad1", "score": "0.53496516", "text": "turn_part2(){\n\t\t/*\n\t\tAction phase\n\t\t*/\n this.update(); //this comes first, otherwise leader skill doesn't apply\n if (!this.leader.isKoed()){\n\t\t\tthis.leader.leaderSkill.apply(this);\n\t\t}\n\n\n\t\tfor (let member of this.membersRem){\n\t\t\tmember.healableDamage = 0;\n\t\t}\n this.isKoed();\n\t}", "title": "" }, { "docid": "ead0769db5abfdc175212de201c60d3b", "score": "0.5341837", "text": "componentDidUpdate() {\n const userId = this.props.location.pathname.split('/')[2];\n userId && this.getFriends(`friendsOf/${userId}`, 'get');\n }", "title": "" }, { "docid": "16ab4a9e51fe93adb09b577e3a238ddd", "score": "0.53391135", "text": "function uiSetFriendList(friends){\n\tvar obj = $('.chat_friend_list_body'); \n\tobj.empty();\n\tfor (var fid in friends){\n\t\tvar f = friends[fid];\n\t\tif (f.status)\n\t\t\tobj[0].appendChild(uiFriendTag(fid, f))\n\t}\n\tobj = $('.whiteboard_friend_list');\n\tobj.empty(); \n\tfor (var fid in friends){\n\t\tvar f = friends[fid];\n\t\tif (f.status)\n\t\t\tobj[0].appendChild(uiWbFriendTag(fid, f))\n\t}\n}", "title": "" }, { "docid": "f610e108385747bad33ceae4d32ea661", "score": "0.53341174", "text": "set friends(aValue) {\n this._logger.debug(\"friends[set]\");\n this._friends = aValue;\n }", "title": "" }, { "docid": "2ff842e4c3e34f697b11827eb5d3d8e3", "score": "0.53329843", "text": "setFriends(person1, person2) {\n person1.adjacent.add(person2);\n person2.adjacent.add(person1);\n }", "title": "" }, { "docid": "163f541de55c18a7977aefbe35526984", "score": "0.5331117", "text": "function updateisSeenMessage(userId, id, idexp, arg3) {\n arg3.children().last().removeClass(\"font-weight-bold\");\n $.ajax({\n type: \"POST\",\n url: `/updateseen/${userId}/${id}/${idexp}`,\n }).done(function (res) {});\n }", "title": "" }, { "docid": "4fa68314eedf9a91ca9c3cee003cc205", "score": "0.5321818", "text": "update()\n\t{\n\t\t// adjust for follow-mode\n\t\tif(this.follow_mode !== View.FOLLOW_MODE_NONE)\n\t\t\tthis._follow()\n\t}", "title": "" }, { "docid": "d5b83f073d937905c66dd02943fa313d", "score": "0.5321547", "text": "unfollow(fid) {\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n const { uid } = yield this.authService.getUser();\n return yield this.firestoreService.update(`friends/${uid}`, {\n friendIds: firebase_app__WEBPACK_IMPORTED_MODULE_3__[\"firestore\"].FieldValue.arrayRemove(fid)\n });\n });\n }", "title": "" }, { "docid": "7fe91d2a29d8f33588cff630eeba0d4c", "score": "0.5316253", "text": "updateFriends(){\n var that = this;\n var tmpAllUsersList = {};\n var potentialFriendsList = {};\n var tmpUsersList = {};\n var tmpFriendList = {};\n\n //--- common for most of the calls\n var fetchAction = require('node-fetch');\n var user_auth_token = this.getCookie(\"HASURA_AUTH_TOKEN\");\n var authorization = \"Bearer \".concat(user_auth_token);\n var url = \"https://data.bathtub62.hasura-app.io/v1/query\";\n var requestOptions = { \"method\": \"POST\", \n \"headers\": { \"Content-Type\": \"application/json\",\n \"Authorization\": authorization\n }\n };\n\n var body = {\n \"type\": \"select\",\n \"args\": {\n \"table\": \"users\", \"columns\": [ \"username\" ]\n }\n };\n requestOptions.body = JSON.stringify(body);\n fetchAction(url, requestOptions)\n .then(function(response) {\n return response.json();\n })\n .then(function(result) { //console.log(result);\n for(let i=0,j=1; i < result.length; i++,j++){\n tmpAllUsersList[j] = result[i].username;\n }\n //---We have list of all users now we will fetch existing friends of current user\n var body = {\n \"type\": \"select\",\n \"args\": {\n \"table\": \"friends\",\n \"columns\": [\n \"total_friends\",\n \"friend_username_1\",\"friend_username_2\",\"friend_username_3\",\"friend_username_4\",\"friend_username_5\",\n \"friend_username_6\",\"friend_username_7\",\"friend_username_8\",\"friend_username_9\",\"friend_username_10\"\n ],\n \"where\": { \"user_id\": { \"$eq\": that.user.hasura_id } }\n }\n };\n requestOptions.body = JSON.stringify(body);\n fetchAction(url, requestOptions)\n .then(function(response) {\n return response.json();\n })\n .then(function(result) { //console.log(result);\n that.state.noOfFriends = result[0].total_friends; //try a setState here\n var tmpStr = \"friend_username_\";\n for(let i=0,j=1; i < that.state.noOfFriends; i++,j++){\n let tmpCol = tmpStr + j;\n tmpFriendList[j] = result[0][tmpCol];\n }\n that.setState({friends:tmpFriendList});\n //--- this is the list of all existing friends\n //--- next we will show potential friends = users who aren't already friends\n var TMPusers = tmpAllUsersList;\n var TMPfriends = that.state.friends;\n \n var k = 1;\n for(let i=1; i<=Object.keys(TMPusers).length; i++){\n let check = 0;\n for(let j=1; j<=Object.keys(TMPfriends).length; j++){\n if((TMPusers[i]===TMPfriends[j])||(TMPusers[i]===that.user.username)){\n check = 1;\n }\n }\n if(check===0){\n potentialFriendsList[k] = TMPusers[i];\n k++;\n }\n }\n //console.log(potentialFriendsList); \n that.setState({users:potentialFriendsList});\n })\n .catch(function(error) {\n console.log('Request Failed:' + error);\n });\n //------------\n })\n .catch(function(error) {\n console.log('Request Failed:' + error);\n });\n }", "title": "" }, { "docid": "969c451539fcf8ea1e8a5e94bcd54652", "score": "0.5304747", "text": "function updateUnblockedUserNotification(guid, followerGuid) {\n console.log(\"updateUnblockedUserNotification, guid: \" + guid + \" followerGuid: \" + followerGuid);\n\n connection.query({\n sql: \"UPDATE `notifications` SET type = ? WHERE guid = ? AND fguid = ? AND type = ?\",\n values: [ NotificationType.BeingFollowed, guid, followerGuid, NotificationType.BlockedUser ]\n }, \n function (err, results) {\n if (err) {\n printError(err);\n rollbackErrorResponse();\n }\n if (results.affectedRows == 1) {\n console.log(\"updateNotifications result.affectedRows > 0\");\n connection.commit(function(err) {\n if (err) {\n printError(err);\n rollbackErrorResponse();\n } else {\n console.log('successful commit!'); \n finalAppResponse( friendActionResponse( \n true, Relationship.IsFollowing, false)\n );\n }\n });\n } else {\n rollbackErrorResponse();\n }\n });\n }", "title": "" }, { "docid": "206c8b5de38c5d2bb73fa0edec64ea27", "score": "0.52813774", "text": "function OnBackToFriends(item){\n\tlblWarning.innerText = \"\";\n\tfriend_user_id = \"\";\n\tDrawFriends();\n}", "title": "" }, { "docid": "d1b97ac38037d56cd91a4ffa2f2f8377", "score": "0.52804065", "text": "set friends(aValue) {\n this._logService.debug(\"gsDiggEvent.friends[set]\");\n this._friends = aValue;\n }", "title": "" }, { "docid": "8de30ab3154079736dd5d219711f378d", "score": "0.52774394", "text": "onConnectRequest(id) {\n /* Set veteran sent friend request state */\n let veteran = this.getVeteran(id);\n veteran.sent_friend_request = true;\n this.setState({ veterans: this.state.veterans });\n\n /* Remove any existing friend requests from that user */\n let removeIndex = null;\n this.state.friendRequests.forEach((req, i) => {\n if (req.id === id) {\n removeIndex = i;\n }\n });\n if (removeIndex != null) {\n this.state.friendRequests.splice(removeIndex, 1);\n this.setState({ friendRequests: this.state.friendRequests });\n }\n }", "title": "" }, { "docid": "6c5a53bf946ffe731fdd062534b8391f", "score": "0.52764976", "text": "selfUpdated() { }", "title": "" }, { "docid": "00c496a8f3ce329715a597a1bf64a51e", "score": "0.527568", "text": "verifyUserUpdate (callback) {\n\t\tconst { user } = this.meResponse;\n\t\tAssert(user.internalMethod === 'mention_notification', 'internalMethod not correct');\n\t\tAssert(user.internalMethodDetail === this.currentUser.user.id, 'internalMethodDetail not set to post author');\n\t\tAssert(user.numMentions === 1, 'numMentions not set to 1');\n\t\tcallback();\n\t}", "title": "" }, { "docid": "4427c7ab5938f1c5665fd47fa27b789c", "score": "0.5270737", "text": "function updater() {\n\t\n\t}", "title": "" }, { "docid": "5ec0fbe3c3b03e314322aa5d179ad4df", "score": "0.52680975", "text": "update(filter, user) {\n\t\tconsole.log(\"update user: \", user);\n\t}", "title": "" }, { "docid": "17f67cfa6c36487758e8b4eb6f45f668", "score": "0.5267306", "text": "trackFollowStatus(){if(this.auth.currentUser){friendlyPix.firebase.registerToFollowStatusUpdate(this.userId,data=>{this.followCheckbox.prop('checked',data.val()!==null);this.followCheckbox.prop('disabled',false);this.followLabel.text(data.val()?'Following':'Follow');friendlyPix.MaterialUtils.refreshSwitchState(this.followContainer)})}}", "title": "" }, { "docid": "4caa3b6911c7802c3ce1f8b6505a1d55", "score": "0.52651453", "text": "function addFriend (name, object) {\n // add given name to given objects friends list\n object.friends.push(name);\n // return the updates object\n return object;\n}", "title": "" }, { "docid": "2d0c02569959df418fe559b20dccb47d", "score": "0.5262439", "text": "function updateUserInfo(cb){\n\t\toh.user.info(function(res){\n\t\t\tvar userdata = res.data[first(res.data)];\n\t\t\tuser_campaigns = Object.keys(userdata.campaigns);\n\t\t\tif(cb) cb(userdata);\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "297c201c86641ed50f8648c4ffbba0fa", "score": "0.5255036", "text": "function C011_LiteratureClass_Mildred_FairLeader() {\n\tActorSpecificChangeAttitude(\"Sidney\", 1, 1);\n\tActorSpecificChangeAttitude(\"Natalie\", 1, 1);\n\tGameLogSpecificAdd(CurrentChapter, \"\", \"FairLeader\");\n}", "title": "" }, { "docid": "d321d14a2ef12f09b5855b5b4267ae52", "score": "0.525338", "text": "update(cache, { data: { addTeamLeader }}) {\n const { getAllTeamLeaders } = cache.readQuery({ query: ALL_TEAMLEADER })\n cache.writeQuery({\n query: ALL_TEAMLEADER,\n data: { getAllTeamLeaders: [...getAllTeamLeaders, addTeamLeader]}\n })\n }", "title": "" }, { "docid": "9ef7748f07f536bf75e07fb3bd1ae5ea", "score": "0.5242888", "text": "function get_fb_friends() {\r\n\t\t$('#'+tag+'_status span:first').text('Checking Friends.........');\r\n\t\tFB.api('/me/friends?access_token=' +access_token,function(response){\r\n\t\t\t//console.log(response);\r\n\t\t\tfor (x in response.data) {\r\n\t\t\t\tfriends.push(response.data[x].id);\r\n\t\t\t\tfriends_object[response.data[x].id] = {\"id\":response.data[x].id, \"name\": response.data[x].name};\r\n\t\t\t}\r\n\t\t\tcreatelist();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "224416ec7fbf62e914cc0a25a76b12fa", "score": "0.5225594", "text": "function Friend(){}", "title": "" }, { "docid": "262f82ecc79772a4439c0d02ec1fc8b3", "score": "0.5222798", "text": "function changeFriendPiece(posX, posY, friendPosX, friendPosY)\n {\n\n 'use strict';\n\n console.log(\"entry to the friend function\");\n\n golan[friendPosY][friendPosX][1]--;\n\n if(golan[posY][posX][2] == \"\")\n {\n console.log(\"entry to the first test group\");\n golan[posY][posX][2] = golan[friendPosY][friendPosX][2];\n\n for(var i = 0; i < allGroup.length; i++)\n {\n\n if(golan[friendPosY][friendPosX][2] == allGroup[i][0])\n {\n\n allGroup[i][allGroup[i].length] = posY + \"_\" + posX;\n\n }\n\n }\n\n }\n\n else\n {\n\n for(var i = 0; i < allGroup.length; i++)\n {\n\n if(golan[friendPosY][friendPosX][2] == allGroup[i][0])\n {\n\n for(var j = 0; j < allGroup.length; j++)\n {\n\n if(golan[posY][posX][2] == allGroup[j][0])\n {\n\n for(var k = 1; k < allGroup[i].length; k++)\n {\n\n var X = parseInt((allGroup[i][k].split(\"_\"))[1]);\n\n var Y = parseInt((allGroup[i][k].split(\"_\"))[0]);\n\n allGroup[j][allGroup[j].length] = allGroup[i][k];\n\n golan[Y][X][2] = allGroup[j][0];\n\n }\n\n allGroup.splice(i, 1);\n\n } \n\n }\n }\n }\n\n }\n\n\n }", "title": "" }, { "docid": "363d3a660e57249856a3976381c50c08", "score": "0.5220852", "text": "async function updateData(req, res) {\n try {\n const database = res.database;\n const allowedKey = [\n \"email\",\n \"name\",\n \"firstname\",\n \"tags\",\n \"friends\",\n \"avatarUri\"\n ];\n const { toChange, newValue } = req.body;\n const { \"X-SessionID\": token } = getValuesFromParams(req.swagger.params);\n\n if (allowedKey.indexOf(toChange) === -1) {\n return res\n .status(403)\n .send({ error: \"you cant change this information\" });\n }\n const sessions = await getSessions(database);\n const id = findKey(sessions, sessionToken => sessionToken === token);\n if (!id) {\n return res.status(401).send({ error: \"token not valid\" });\n }\n const debug = await findUserBy(\"_id\", id, database);\n const { _id } = debug;\n if (toChange === \"friends\") {\n let usersId;\n try {\n usersIdPromises = (newValue === \"\" ? [] : newValue.split(\",\")).map(\n async userMail => {\n const { _id } = await findUserBy(\n \"email\",\n userMail.toLowerCase(),\n database\n );\n if (_id === undefined) throw Error(\"user doesnt exist\");\n return _id;\n }\n );\n usersId = await Promise.all(usersIdPromises);\n usersIdUniq = [...new Set(usersId)];\n } catch (userError) {\n return res.status(403).send({ error: \"a user given doesnt exist\" });\n }\n await updatetUser(_id, { [toChange]: usersIdUniq }, database);\n } else {\n const obj = {\n [toChange]:\n toChange === \"email\"\n ? newValue.toLowerCase()\n : toChange === \"tags\"\n ? newValue === \"\"\n ? []\n : newValue.split(\",\")\n : newValue\n };\n await updatetUser(_id, obj, database);\n }\n const user = await findUserBy(\"_id\", id, database);\n const idCorrespondance = await getAllUsers(database);\n return res.status(200).send(getProfileData(user, idCorrespondance));\n } catch (err) {\n console.log(\"INTER ERROR\", err.message);\n return res.status(500).send({ error: \"internal server error\" });\n }\n}", "title": "" }, { "docid": "5f861cf4cb4fbb5ace901f08d996c1c6", "score": "0.5214784", "text": "undontShowUser(user1,user2){\n let changed=false;\n for(var i=0;i<this.users[user1].friendsDontSee.length;i++){\n if(this.users[user1].friendsDontSee[i].id == user2){\n this.users[user1].friendsDontSee.splice(i,1);\n changed=true;\n break;\n }\n }\n return changed;\n }", "title": "" }, { "docid": "ad62778b3ddc63c33b97fcfc23bf8809", "score": "0.5212557", "text": "function Action_UpdateUser(who,action){\n\t\t\tsocket.emit('update user',{action:action,user:who,data:character[who]});\n\t\t}", "title": "" }, { "docid": "1f25f03db95cd91ced48ed879c80b216", "score": "0.52125233", "text": "update(app, result, intent) {\n\t\t\n\t}", "title": "" }, { "docid": "bf10330ba5ea6f77e10247b9f70902f4", "score": "0.52098984", "text": "function changeMindLikeOrDis(profileToUpdate) {\n // to do : make it good\n let profileToUpdate = JSON.stringify(profileToUpdate);\n //-1 = not found\n if (profileToUpdate.search(\"liked\") !== -1) {\n profileToUpdate = profileToUpdate.replace(\"liked\", \"dis\");\n //console.log(\"Changed to Dis: \" + profileToUpdate);\n localStorage.setItem(\"profile\" + i, profileToUpdate);\n } else {\n profileToUpdate = profileToUpdate.replace(\"dis\", \"liked\");\n //console.log(\"Changed to Liked: \" + profileToUpdate);\n localStorage.setItem(\"profile\" + i, profileToUpdate);\n }\n}", "title": "" }, { "docid": "41da8833087959d79e2bc3f546e5370e", "score": "0.5204441", "text": "function toFriends(container,friend_id) {\n $.ajax(\"/rest/toFriends\",{data:{friend_id : friend_id},headers:jwtHeader(),method:\"PATCH\"})\n .done(function (data) {\n //REST returns \"mate\" if they are mutual friends now or \"noMate\" otherwise\n $(container).closest(\".userEntity\").find(\".friendship\")[0].innerHTML =\n data===\"mate\"?\"<span class=\\\"badge badge-success\\\">Взаимный Друг</span>\":\n \"<span class=\\\"badge badge-primary\\\">ПолуДруг</span>\";\n $(container).find (\".toFriends\")[0].style.display = \"none\";\n $(container).find (\".fromFriends\")[0].style.display = \"\"\n\n })\n .fail(onError)\n}", "title": "" }, { "docid": "f8dfd43cd73675d74604f31416dd98e8", "score": "0.520425", "text": "updateMany(filter,modificationObject){}", "title": "" }, { "docid": "28fc00518223848eba6cda4c3f189192", "score": "0.51992846", "text": "function putVisibility(obj, callback) {\n var data = {\"accessLevel\": obj.updates.accessLevel}; //Ensure only right fields sent to update\n if(Number(obj.updates.accessLevel) < 0 || Number(obj.updates.accessLevel) > 2){\n logger.log(obj.req, obj.res, {type: 'warn', data: 'Insuficient accessLevel'});\n callback(false, \"Wrong accessLevel. Valid are [0, 1, 2]\", false);\n } else {\n sharingRules.changeUserAccessLevel(obj)\n .then(function(response){\n // Update updates object with the right path and data after whole verification\n obj.updates = data;\n obj.auditType = 15;\n doUpdate(obj, function(err, response, success){\n if(err){ callback(true, response, success); } else { callback(false, response, success); }\n });\n })\n .catch(function(err){\n callback(true, err, false);\n });\n }\n}", "title": "" }, { "docid": "b15fc11cc122515b98cfacac628442d2", "score": "0.5191592", "text": "function removeFriendElement(uid) {\n document.getElementById(\"user\" + uid).remove();\n\n friendCount--;\n if(friendCount == 0){\n deployFriendListEmptyNotification();\n }\n }", "title": "" }, { "docid": "7dc67da1a412a32f32de215c4c5f1d0b", "score": "0.51900953", "text": "confirmRequest(uid, first_name, last_name) {\n // create a message room for both people\n firebase.database().ref('/messages').push({ \n texts: [\n {\n _id: 1,\n text: 'Say hi to your new friend!',\n timestamp: firebase.database.ServerValue.TIMESTAMP,\n user: {\n _id: 1,\n name: \"System\"\n },\n system: true\n }\n ],\n group_name: \"\"\n }).then(snap => {\n firebase.database().ref(`/messages/${snap.key}/members/`).update({\n [uid]: {\n first_name: first_name,\n last_name: last_name,\n last_seen: null\n },\n [this.uid]: {\n first_name: `${this.first_name}`,\n last_name: `${this.last_name}`,\n last_seen: null\n },\n });\n // add to friends list\n firebase.database().ref(`users/${this.uid}/friends/`).update({\n [uid]: {\n first_name: first_name,\n last_name: last_name,\n room: snap.key,\n }\n })\n .then(() => {\n // console.log('add user', uid, name, 'to', this.name+'\\'s friends list')\n }).catch((error) => {\n console.log(error)\n })\n // add to friends list\n firebase.database().ref(`users/${uid}/friends/`).update({\n [this.uid]: {\n first_name: `${this.first_name}`,\n last_name: `${this.last_name}`,\n room: snap.key,\n }\n })\n .then(() => {\n // console.log('add current user', this.uid, this.name, 'to', name+'\\'s friends list')\n }).catch((error) => {\n console.log(error)\n })\n })\n\n // remove from requested/requesting lists\n firebase.database().ref(`users/${this.uid}/requestingFriends/${uid}`).remove()\n .then(() => { \n // console.log('remove user ', uid, name, 'from the requesting list')\n }).catch((error) => {\n console.log(error)\n })\n firebase.database().ref(`users/${uid}/requestedFriends/${this.uid}`).remove()\n .then(() => {\n // console.log('remove current user', this.uid, this.name, 'from the requested list')\n }).catch((error) => {\n console.log(error)\n })\n }", "title": "" }, { "docid": "42c91345a67f07ca8a6b86192e37eb91", "score": "0.5188943", "text": "function profUpdate(dataModel, session, method, params, data, ip, id) {\n if(method =='PUT') {\n var message = utils.invalidProfileUpdate(data);\n if(message) return passback(id, message);\n if(data.subscriber_id) return passback(id, msg.notAuthorized());\n dataModel.profile.update(session.subscriber_id, data, function(result) { \n passback(id, result); \n });\n } else return passback(id, msg.methodNotSupported());\n}", "title": "" }, { "docid": "19a073106dd80977efcb04abb59d9040", "score": "0.5178369", "text": "function addFriend() {\n var addBtn = document.getElementById(\"addFriendButton\");\n var rmvBtn = document.getElementById(\"removeFriendButton\");\n addBtn.style.display = \"none\";\n rmvBtn.style.display = \"block\";\n var user = firebase.auth().currentUser;\n var uid = location.search.substring(1);\n db.collection('users').doc(user.uid).update({\n friends: firebase.firestore.FieldValue.arrayUnion(uid)\n });\n}", "title": "" }, { "docid": "f9c9c6a0f702c70617dbe14fa7e1c452", "score": "0.5177883", "text": "function NurseryPlayerCuteRelpy() {\n\tDialogChangeReputation(\"ABDL\", 1);\n\tDialogRemove();\n}", "title": "" }, { "docid": "b1e2503c05eab9279fdee808382e5838", "score": "0.51747125", "text": "function removeFollower(nameA, nameB, type){\r\n let follower = getUser(nameB);\r\n let personToFollow;\r\n\r\n // Checks to make sure the person following exists.\r\n if(follower === null){\r\n console.log(\"follower was resolved to null\")\r\n return false;\r\n }\r\n\r\n // Gets person object based on their type (people vs users)\r\n if(type === \"person\"){\r\n console.log(\"person being followed is a person type\");\r\n personToFollow = getPerson(nameA);\r\n personToFollowName = personToFollow.name\r\n console.log(personToFollowName);\r\n }else if(type === \"user\"){\r\n console.log(\"Person being followed is a user type\");\r\n personToFollow = getUser(nameA);\r\n personToFollowName = personToFollow.username\r\n console.log(personToFollowName);\r\n }\r\n\r\n if(!doesFollowExist(follower.follows, personToFollowName, personToFollow.id)){\r\n console.log(\"person is already not following the person in question\");\r\n return false;\r\n } else{\r\n // update userA's follows list\r\n let indexToRemove = returnFollowIndex(follower.follows, personToFollowName, personToFollow.id)\r\n follower.follows.splice(indexToRemove, 1);\r\n console.log(\"Updated \" + follower.username + \" follows list\");\r\n\r\n // update usersB's followers list\r\n indexToRemove = returnFollowIndex(personToFollow.followers, follower.username, follower.id);\r\n personToFollow.followers.splice(indexToRemove, 1);\r\n console.log(\"Updated \" + personToFollowName + \" followers list\");\r\n }\r\n \r\n // Check if the person is being followed is a user or a person\r\n if(type === \"user\"){\r\n // Send a notification taht this person has been followed\r\n let msg = follower.username + \" has un-followed you.\";\r\n sendNotif(msg, personToFollow);\r\n console.log(\"Sent notification\")\r\n }\r\n\r\n console.log(\"Unfollow successful\");\r\n return true;\r\n}", "title": "" }, { "docid": "f5ebfac64aebf6594931a07b372a2fcc", "score": "0.5173034", "text": "function change_presence(e)\n{\n // Gather data\n var group, person, activity, state;\n group = this.dataset[\"groupId\"];\n person = this.dataset[\"personId\"];\n activity = this.dataset[\"activityId\"];\n rstate = this.dataset[\"newState\"];\n\n var state;\n switch (rstate)\n {\n case \"present\":\n state = true;\n break;\n\n case \"absent\":\n state = false;\n break;\n\n case \"unknown\":\n state = null;\n break;\n }\n\n // Make request\n var req;\n req = $.ajax(`/groups/${group}/activities/${activity}/presence`,\n {\n method: 'PUT',\n data: {person_id: person, attending: state},\n statusCode: {\n 423: function() {\n alert( \"De deadline is al verstreken! Vraag orgi of bestuur of het nog kan.\");\n },\n 403: function() {\n alert( \"Je hebt geen rechten om iemand anders aan te passen!\");\n }\n }\n }\n )\n .done( activity_changed );\n\n // Pack data for success\n req.aardbei_activity_data =\n {\n group: group,\n person: person,\n activity: activity,\n state: state\n };\n}", "title": "" }, { "docid": "628461bedbc4acb5a3c17220c261e738", "score": "0.5169999", "text": "handleRemovedFriend(){\n this.setState({\n wasRemoved: true,\n areFriends: false,\n isFriendable: true,\n })\n }", "title": "" }, { "docid": "b61fab1b6dd85bc628bc7b8d39364072", "score": "0.51667726", "text": "function updateSelf(val) {\n getUser(CHAT.CURRENT_USER_ID).toggle(val);\n }", "title": "" }, { "docid": "77239ab0f951c57980362cafb251c2f4", "score": "0.516196", "text": "function deleteFriend(uid) {\n //Delete on user's side\n var userFriendArrBackup = friendArr;\n var friendFriendArrBackup = [];\n var verifyDeleteBool = true;\n var toDelete = -1;\n\n for (var i = 0; i < friendArr.length; i++){\n if(friendArr[i] == uid) {\n toDelete = i;\n break;\n }\n }\n\n if(toDelete != -1) {\n friendArr.splice(toDelete, 1);\n\n for (var i = 0; i < friendArr.length; i++) {\n if (friendArr[i] == uid) {\n verifyDeleteBool = false;\n break;\n }\n }\n } else {\n verifyDeleteBool = false;\n }\n\n if(verifyDeleteBool){\n removeFriendElement(uid);\n user.friends = friendArr;\n generateAddUserBtn(); //Regenerate the button for new friendArr\n\n firebase.database().ref(\"users/\" + user.uid).update({\n friends: friendArr\n });\n\n //alert(\"Friend Successfully removed from your list!\");\n } else {\n friendArr = user.friends;\n firebase.database().ref(\"users/\" + user.uid).update({\n friends: userFriendArrBackup\n });\n alert(\"Delete failed, please try again later! (user)\");\n return;\n }\n\n\n\n //Delete on friend's side\n verifyDeleteBool = true;\n toDelete = -1;\n var friendFriendArr;//Weird name, I know, but it's the friend's friend Array...\n\n for (var i = 0; i < userArr.length; i++){\n if(userArr[i].uid == uid) {\n friendFriendArr = userArr[i].friends;\n friendFriendArrBackup = friendFriendArr;\n break;\n }\n }\n for (var i = 0; i < friendFriendArr.length; i++){\n if (friendFriendArr[i] == user.uid){\n toDelete = i;\n break;\n }\n }\n\n if(toDelete != -1) {\n friendFriendArr.splice(toDelete, 1);\n\n for (var i = 0; i < friendFriendArr.length; i++) {\n if (friendFriendArr[i] == user.uid) {\n verifyDeleteBool = false;\n break;\n }\n }\n } else {\n verifyDeleteBool = false;\n }\n\n if(verifyDeleteBool){\n firebase.database().ref(\"users/\" + uid).update({\n friends: friendFriendArr\n });\n\n //alert(\"Friend Successfully removed from their list!\");\n } else {\n firebase.database().ref(\"users/\" + uid).update({\n friends: friendFriendArrBackup\n });\n alert(\"Delete failed, please try again later! (friend)\");\n }\n }", "title": "" }, { "docid": "4a405cdd5e54ded30e0a4c37259ffad6", "score": "0.51577157", "text": "function new_friends() {\n page = 0\n allItemsLoaded.loaded = false\n scrollListener.dettach()\n friends_container.html('')\n fillCurrentUserFriends()\n }", "title": "" }, { "docid": "0bfb86fdf6434612e3937ab79350670e", "score": "0.5152127", "text": "function updatePerson(name, type, movieId){\r\n let p = getPerson(name);\r\n\r\n console.log(\"In update person\");\r\n console.log(\"type of person: \" + type);\r\n\r\n if(type != \"directors\" && type != \"actors\" && type != \"writers\"){\r\n return false\r\n }\r\n\r\n if(type === \"directors\"){\r\n p.directed.push(movieId);\r\n } \r\n if (type === \"actors\"){\r\n p.acted.push(movieId);\r\n } \r\n if(type === \"writers\"){\r\n p.written.push(movieId)\r\n } \r\n return true;\r\n}", "title": "" }, { "docid": "9af397147f8cbd5bc2fc6225ef6e24ce", "score": "0.51517314", "text": "function denyWife(wife){\n var deferred = q.defer();\n\n UserModelP.update({_id: wife._id},{$set:{\n roles: ['Fan'],\n }}, function (err, wife) {\n if (err) {\n deferred.reject(err);\n } else {\n\n deferred.resolve(wife);\n }\n });\n\n return deferred.promise;\n\n }", "title": "" }, { "docid": "ef97d163d836ff7c0fd9bf33ca11904e", "score": "0.51481473", "text": "async function addFriend(parent, args, context) {\n const username = await validator.escape(args.username);\n const friend = await validator.escape(args.friend);\n\n\n // Check if user exists\n let user = await users.findOne({username: username})\n let usersFriends = user.friends\n\n // Check if friend exists\n let friendExists = await users.findOne({username: friend})\n if (!friendExists) {\n return [\n {\n path: \"friend\",\n message: \"The user '\" + friend + \"' does not exist\" \n }\n ] \n }\n else if (usersFriends.includes(friend)) {\n return [\n {\n path: \"friend\",\n message: \"You and \" + friend + \" are already friends\"\n }\n ] \n }\n else {\n //add friend and update DB\n usersFriends.push(friend)\n await users.update({username: username}, {$set: { friends: usersFriends }})\n }\n return null;\n}", "title": "" }, { "docid": "21781e920f02af2e27e6d05f51708ca0", "score": "0.5145157", "text": "follow(fid) {\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n const { uid } = yield this.authService.getUser();\n return yield this.firestoreService.set(`friends/${uid}`, {\n friendIds: firebase_app__WEBPACK_IMPORTED_MODULE_3__[\"firestore\"].FieldValue.arrayUnion(fid)\n });\n });\n }", "title": "" }, { "docid": "5c4adae82501def8041575886e6be939", "score": "0.5145013", "text": "function updateBlockedUserNotification(guid, followerGuid) {\n \n console.log(\"updateNotification, guid: \" + guid + \" followerGuid: \" + followerGuid);\n \n connection.query({\n sql: \"UPDATE `notifications` SET type = ? WHERE guid = ? AND fguid = ? AND type = ?\",\n values: [ NotificationType.BlockedUser, guid, followerGuid, NotificationType.BeingFollowed ]\n }, \n function (err, results) {\n if (err) {\n printError(err);\n rollbackErrorResponse();\n }\n if (results.affectedRows == 1) {\n console.log(\"updateNotifications result.affectedRows > 0\");\n connection.commit(function(err) {\n if (err) {\n printError(err);\n rollbackErrorResponse();\n } else {\n console.log('successful commit!'); \n finalAppResponse( friendActionResponse( \n true, Relationship.IsFollowing, BlockedStatus.Blocked)\n );\n }\n });\n } else {\n rollbackErrorResponse();\n }\n });\n }", "title": "" }, { "docid": "dc157b1aaa4c30f22e5a29a152f4e523", "score": "0.5143644", "text": "updateFriend(updateF) {\n axios.put(`http://localhost5000/friends/${updateF.id}`)\n .then(res => {\n this.setState({\n friends: res.data\n })\n //return to friends page\n this.props.history.push('/')\n })\n .catch(err => {\n console.log(err)\n })\n\n }", "title": "" }, { "docid": "a3a1d236f4a125550d0423690b23fdbb", "score": "0.5138116", "text": "function updateFollowers() {\n const alreadyFollowersArray = models.users\n .findById(followingId)\n .then((resultUser) => {\n return resultUser.get({\n plain: true\n }).followers;\n });\n\n return alreadyFollowersArray.then((followersArray) => {\n if (followersArray.indexOf(userId) > -1 && type === 'follow') {\n return Promise.resolve();\n }\n\n if (followersArray.indexOf(userId) === -1 && type === 'unfollow') {\n return Promise.resolve();\n }\n\n return models.users\n .update({\n followers: updateArray(type, followersArray, userId)\n }, {\n where: {\n id: followingId\n },\n returning: true,\n raw: true,\n });\n });\n }", "title": "" }, { "docid": "10e08968e23745d3e609422699f0b209", "score": "0.51370996", "text": "function updateLookingfor() {\n\tconst profile = document.getElementById(\"profile\");\n\tremove(profile);\n}", "title": "" }, { "docid": "3297560c16c6cf5c844a6308e996f0ce", "score": "0.51327074", "text": "function updateRole() {\n\n}", "title": "" }, { "docid": "8a595a60c76df248d1512267bba5f0f2", "score": "0.5127589", "text": "function setFriendRequests() {\n\n LOG(\"Setting friend requests...\")\n var ref = database.ref('friends').orderByChild('acceptor').equalTo(user.uid).limitToFirst(20);\n var requests = []\n\n ref.once('value', function (snap) {\n var tree = snap.val()\n\n for (var prop in tree) {\n if (tree.hasOwnProperty(prop)) {\n var request = tree[prop]\n\n if (request.accepted === false) {\n requests.push(request)\n }\n }\n }\n\n model.HasRequests(requests.length > 0)\n model.FriendRequests(requests)\n\n //TODO bad practice... fix later\n if (model.FriendRequests().length > 0) {\n console.log(\"model.FriendRequests() > 0\")\n $('#friends-icon').removeClass('blue-grey-text')\n $('#friends-icon').addClass('deep-orange-text')\n }\n else {\n console.log(\"model.FriendRequests() < 1\")\n $('#friends-icon').removeClass('deep-orange-text')\n $('#friends-icon').addClass('blue-grey-text')\n }\n })\n}", "title": "" } ]
e7e9b502402b76a1f3676e37f49d46f9
Used 'uni range + named function' from
[ { "docid": "0798ff1421964b5a7ea358631ea6618a", "score": "0.0", "text": "function match(a) {\n return DIACRITICS[a] || a;\n }", "title": "" } ]
[ { "docid": "4cc41fc5d8be19d2f163aa72e421c519", "score": "0.60926735", "text": "function range(start, end) {\n //your code goes here...\n\n}", "title": "" }, { "docid": "5e71dbb89dcad15b58c33eaa98090031", "score": "0.58813125", "text": "static namesRange(template, a, b) {\n return Utils.range(a, b).map(n => {\n return Utils.sprintf(template, n);\n });\n }", "title": "" }, { "docid": "0d4e7510a5cbd66c7e734c04a959738f", "score": "0.58158565", "text": "function range(x,y){\n\n }", "title": "" }, { "docid": "a89d23c90520304b28407ac8b9e5d9b9", "score": "0.5775302", "text": "function u(){}", "title": "" }, { "docid": "f1fe86e06be169e85bbb1d2189b82a15", "score": "0.57225776", "text": "function range(from, to){\n var r = inherit(range.methods);//r is a newly created object that inherits range.methods\n //set properties of r\n r.from = from;\n r.to = to;\n return r;\n}", "title": "" }, { "docid": "9a318367c8b303bccc105bfff2afe758", "score": "0.57048935", "text": "function U(){}", "title": "" }, { "docid": "c466745b74e34af2a56c430be509b1a4", "score": "0.5584574", "text": "function generateRange(L, U) {\nfor (i <= L; i < U; i++) {\n rangeLU.push (i);\n} \nreturn rangeLU + ' ';\n}", "title": "" }, { "docid": "5d00e2d418fe40ada35b9c4ad80146f9", "score": "0.5537701", "text": "function I(U){return function(){return U}}", "title": "" }, { "docid": "6c72a7f92c5539d70a1e3f7101dd2db8", "score": "0.5521642", "text": "function Cu(){return _u.apply(null,arguments)}", "title": "" }, { "docid": "e241df29a285f85974809cc8691e25b1", "score": "0.5518302", "text": "function range(start, end) {\n\n let resultArray = [];\n\n if(end) {\n for(let i = start; i <= end; i++) {\n resultArray.push(i);\n }\n\n return resultArray\n } else {\n return function range(endVal) {\n for(let i = start; i <= endVal; i++) {\n resultArray.push(i);\n }\n\n return resultArray\n }\n }\n}", "title": "" }, { "docid": "91ac6121ffc4f924bb349f4706c8d4d3", "score": "0.55043215", "text": "function diceFn(range) {\n return function() {\n return this.natural(range);\n };\n }", "title": "" }, { "docid": "7b4618ed5ad80ec2d5f48f466ec87cc6", "score": "0.55032593", "text": "function diceFn (range) {\n return function () {\n return this.natural(range);\n };\n }", "title": "" }, { "docid": "7b4618ed5ad80ec2d5f48f466ec87cc6", "score": "0.55032593", "text": "function diceFn (range) {\n return function () {\n return this.natural(range);\n };\n }", "title": "" }, { "docid": "7b4618ed5ad80ec2d5f48f466ec87cc6", "score": "0.55032593", "text": "function diceFn (range) {\n return function () {\n return this.natural(range);\n };\n }", "title": "" }, { "docid": "7b4618ed5ad80ec2d5f48f466ec87cc6", "score": "0.55032593", "text": "function diceFn (range) {\n return function () {\n return this.natural(range);\n };\n }", "title": "" }, { "docid": "7b4618ed5ad80ec2d5f48f466ec87cc6", "score": "0.55032593", "text": "function diceFn (range) {\n return function () {\n return this.natural(range);\n };\n }", "title": "" }, { "docid": "7b4618ed5ad80ec2d5f48f466ec87cc6", "score": "0.55032593", "text": "function diceFn (range) {\n return function () {\n return this.natural(range);\n };\n }", "title": "" }, { "docid": "25b8b2cf33bf09264a323036ca3fce03", "score": "0.5499753", "text": "function printRange(range) {\n\tvar str = \"\";\n\tfor (var i = 0; i < range.length; i++)\n\t\tstr += \"[\" + range[i].inf + \", \" + range[i].sup + \"] \";\n\treturn str;\n}", "title": "" }, { "docid": "1f07b1d48e452270bebc7797ef6c470a", "score": "0.54952836", "text": "function\nats2jspre_list_make_intrange_2(arg0, arg1)\n{\n//\n// knd = 0\n var tmpret0\n var tmplab, tmplab_js\n//\n // __patsflab_list_make_intrange_2\n tmpret0 = ats2jspre_list_make_intrange_3(arg0, arg1, 1);\n return tmpret0;\n} // end-of-function", "title": "" }, { "docid": "177ef01673515b2c5d294a896dee5c9f", "score": "0.547543", "text": "function mapRange(f,a,b) {\n\treturn function (x) {\n\t\treturn f(x)*(b-a)+a;\n\t}\n}", "title": "" }, { "docid": "2913b21447bde6f77409c7295dce31d4", "score": "0.53455836", "text": "function mapWithoutIndex(range){return {start:range.start,end:range.end};}", "title": "" }, { "docid": "843409afc5ddcccd108bba2c0f94b122", "score": "0.53424984", "text": "range(from, to = from) { return new Range(from, to, this); }", "title": "" }, { "docid": "843409afc5ddcccd108bba2c0f94b122", "score": "0.53424984", "text": "range(from, to = from) { return new Range(from, to, this); }", "title": "" }, { "docid": "204905c52c6fcc3e664e2a64b6409da0", "score": "0.5339221", "text": "function\nats2jspre_list_make_intrange_2(arg0, arg1)\n{\n//\n// knd = 0\n var tmpret0\n//\n // __patsflab_list_make_intrange_2\n tmpret0 = ats2jspre_list_make_intrange_3(arg0, arg1, 1);\n return tmpret0;\n} // end-of-function", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.53126514", "text": "function miFuncion(){}", "title": "" }, { "docid": "e96f69fc5ffa44f3bb47cfaa8705bded", "score": "0.52939546", "text": "function range(lo,hi,input)\n{\n var mul = _binaryOpUGen( _BIN_MUL, _binaryOpUGen( _BIN_MINUS, hi, lo ), 0.5 );\n\n\treturn _binaryOpUGen( _BIN_PLUS, _binaryOpUGen( _BIN_MUL, input, mul ) ,lo );\n}", "title": "" }, { "docid": "70591de5a93d972a4f01ac71df4cc7b5", "score": "0.5290929", "text": "changeByRange(f) {\n let sel = this.selection;\n let result1 = f(sel.ranges[0]);\n let changes = this.changes(result1.changes), ranges = [result1.range];\n for (let i = 1; i < sel.ranges.length; i++) {\n let result = f(sel.ranges[i]);\n let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);\n for (let j = 0; j < i; j++)\n ranges[j] = ranges[j].map(newMapped);\n ranges.push(result.range.map(changes.mapDesc(newChanges, true)));\n changes = changes.compose(newMapped);\n }\n return {\n changes,\n selection: EditorSelection.create(ranges, sel.primaryIndex)\n };\n }", "title": "" }, { "docid": "4a697a0172d5a2b47b1a83e820941613", "score": "0.52748585", "text": "function mapWithIndex(range,index){return {start:range.start,end:range.end,index:index};}", "title": "" }, { "docid": "4e8c6ea74ba25a32f47b5014d0cf494c", "score": "0.52548367", "text": "function invertRange(range) {\n var start = __WEBPACK_IMPORTED_MODULE_0__Type__[\"b\" /* getValue */](range.start);\n var end = __WEBPACK_IMPORTED_MODULE_0__Type__[\"b\" /* getValue */](range.end);\n return { start: 1 - end, end: 1 - start };\n}", "title": "" }, { "docid": "4e8c6ea74ba25a32f47b5014d0cf494c", "score": "0.52548367", "text": "function invertRange(range) {\n var start = __WEBPACK_IMPORTED_MODULE_0__Type__[\"b\" /* getValue */](range.start);\n var end = __WEBPACK_IMPORTED_MODULE_0__Type__[\"b\" /* getValue */](range.end);\n return { start: 1 - end, end: 1 - start };\n}", "title": "" }, { "docid": "9a369fda99e67c39ec3276813709a368", "score": "0.5250789", "text": "function u(e,t){this.fun=e,this.array=t}", "title": "" }, { "docid": "a6861e82fd3a0709854623408dcd7795", "score": "0.5230598", "text": "changeByRange(f) {\n let sel = this.selection;\n let result1 = f(sel.ranges[0]);\n let changes = this.changes(result1.changes), ranges = [result1.range];\n for (let i = 1; i < sel.ranges.length; i++) {\n let result = f(sel.ranges[i]);\n let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);\n for (let j = 0; j < i; j++)\n ranges[j] = ranges[j].map(newMapped);\n ranges.push(result.range.map(changes.mapDesc(newChanges, true)));\n changes = changes.compose(newMapped);\n }\n return {\n changes,\n selection: EditorSelection.create(ranges, sel.primaryIndex)\n };\n }", "title": "" }, { "docid": "be4eb9c38e096d26e14ddcf1226960c3", "score": "0.5214316", "text": "function ulang(u, aksi) {\n for (let i = 0; i < u; i++) {\n aksi(i);\n }\n}", "title": "" }, { "docid": "faf1ca6cf738fb425470d9c63f34ffce", "score": "0.5212854", "text": "function invertRange(range) {\n var start = _Type__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"](range.start);\n var end = _Type__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"](range.end);\n return { start: 1 - end, end: 1 - start };\n}", "title": "" }, { "docid": "faf1ca6cf738fb425470d9c63f34ffce", "score": "0.5212854", "text": "function invertRange(range) {\n var start = _Type__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"](range.start);\n var end = _Type__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"](range.end);\n return { start: 1 - end, end: 1 - start };\n}", "title": "" }, { "docid": "9cc58ab1f22552bfec319185ce0fbfe1", "score": "0.51910347", "text": "function range(start, end) { // Initial range function\n var numbersArr = [];\n for (var number = start; number <= end; number ++) {\n numbersArr.push(number);\n }\n return numbersArr;\n}", "title": "" }, { "docid": "14e22438d9c714bf14c73cefc78abe6a", "score": "0.5186148", "text": "function exports(n,lower,upper){if(isUndef(upper)){upper=lower;lower=undefined;}if(!isUndef(lower)&&n<lower)return lower;if(n>upper)return upper;return n;}", "title": "" }, { "docid": "f73a845182c2517a63b7265e64faf5f6", "score": "0.5182851", "text": "function range(start, end, step=1) {\n // Your code here\n var i = start;\n var arr = [];\n for(var i = 0; i <= end; i++){\n arr.push(i);\n }\n\n return arr;\n}", "title": "" }, { "docid": "4db1c33183ee453a32270409ced48753", "score": "0.5170876", "text": "function upperName(people) {\n}", "title": "" }, { "docid": "0fa3d417efe1e03874d6398a1f9bda69", "score": "0.51692563", "text": "function list() {\n var charRangeMarker = new RegExp(/^\\`string\\_\\d+\\`(\\.\\.|\\.\\.\\.)\\`string\\_\\d+\\`$/),\n numRangeMarker = new RegExp(/^\\d+(\\.\\.|\\.\\.\\.)\\d+$/),\n inclusiveMarker = new RegExp(/\\.\\.\\./),\n inclusive,\n compiled,\n begin,\n front,\n back,\n i;\n\n /*\n * Build alphabetical ranges if we have 'em.\n */\n if (this.body.length === 1 && this.body[0].type === 'Value' && charRangeMarker.test(this.body[0].val)) {\n library.push('buildRange');\n compiled = this.body[0].compile();\n if (inclusiveMarker.test(compiled)) {\n inclusive = true;\n }\n front = compiled.match(/^\\`string\\_\\d+\\`/)[0];\n back = compiled.match(/\\`string\\_\\d+\\`$/)[0];\n begin = 'HN.buildRange(' + front + ', ' + back + ', false, ' + (inclusive || 'false') + ')';\n return begin;\n\n /*\n * Build numerical ranges if we have 'em.\n */\n } else if (this.body.length === 1 && this.body[0].type === 'Value' && numRangeMarker.test(this.body[0].val)) {\n library.push('buildRange');\n compiled = this.body[0].compile();\n if (inclusiveMarker.test(compiled)) {\n inclusive = true;\n }\n front = compiled.match(/^\\d+/)[0];\n back = compiled.match(/\\d+$/)[0];\n begin = 'HN.buildRange(' + front + ', ' + back + ', true, ' + (inclusive || 'false') + ')';\n return begin;\n }\n\n /*\n * Otherwise...\n */\n begin = '[';\n loop(this.body, function (each, index) {\n if (index !== 0) {\n begin += ', ';\n }\n begin += each.compile();\n });\n begin += ']';\n return begin;\n}", "title": "" }, { "docid": "4b07fba5aae64e2b7c029758d4a01406", "score": "0.51655585", "text": "function Range (from, to) {\n this.from = from;\n this.to = to;\n this[Symbol.iterator] = rangeIterator;\n}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "7ff47d9b7360f711919389a1976a324d", "score": "0.5159959", "text": "function RangePrototype() {}", "title": "" }, { "docid": "466b36b87e71ad812ab37093e1088163", "score": "0.5158391", "text": "function _u(t,e,n,s=!1){return mu(n,t.Ba(s?4/* ArrayArgument */:3/* Argument */,e));}", "title": "" }, { "docid": "008ec2f945a356a488f426896293095c", "score": "0.515287", "text": "function range(min, max) {\n // god js is awful why is this necessary\n return Array.apply(null,Array(max) ).map(function(_, i) { return i+min; });\n\n}", "title": "" }, { "docid": "8bbdf55cdecb32dededa3fbcf17f1d9c", "score": "0.5139164", "text": "function _bind_for(start0, end, action) /* forall<e> (start : int, end : int, action : (int) -> e ()) -> e () */ {\n function rep(i) /* (i : int) -> 9091 () */ {\n if ($std_core._int_le(i,end)) {\n return $std_core._bind((action(i)),(function(__ /* () */ ) {\n return rep((inc(i)));\n }));\n }\n else {\n return _unit_;\n }\n }\n return rep(start0);\n}", "title": "" }, { "docid": "6b745d450c7a46d2c870920671a75186", "score": "0.5127989", "text": "ui(t,e){const n=this.ai(t);return Fr.$s(n,e);}", "title": "" }, { "docid": "c9a5254a1eb8dc15add333d6af7e4cdb", "score": "0.51185673", "text": "function u(t,e){return e}", "title": "" }, { "docid": "20fbd835da2128c5faa3f2bf192233b6", "score": "0.51183337", "text": "function newFunction(userNames) {\n\tfor(let i in userNames) {\n\t\t\t// outputs correct value for each iteration through loop\n\t\t\tconsole.log('Fetched for ', userNames[i]);\n\t\t}\n}", "title": "" }, { "docid": "d24b84859e26b479bd13002b5dea7a5c", "score": "0.51151574", "text": "function test_data_range(data) {\n // todo\n }", "title": "" }, { "docid": "171e6437fb68dffa186fc119ba002db8", "score": "0.51052797", "text": "function range(start, end)\n{\n var foo = [];\n for (var i = start; i <= end; i++)\n foo.push(i);\n return foo;\n}", "title": "" }, { "docid": "41665925cd8c84eaadbebaf445b95cc9", "score": "0.5099951", "text": "*points(range) {\n yield [range.anchor, 'anchor'];\n yield [range.focus, 'focus'];\n }", "title": "" }, { "docid": "4a2ba76a4c9408e96dbd58992e4da631", "score": "0.509703", "text": "*points(range) {\n yield [range.anchor, 'anchor'];\n yield [range.focus, 'focus'];\n }", "title": "" }, { "docid": "e375a3112ecac834f4299edfb48c0414", "score": "0.50877005", "text": "function invertRange(range) {\n var start = _Type__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"](range.start);\n\n var end = _Type__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"](range.end);\n\n return {\n start: 1 - end,\n end: 1 - start\n };\n }", "title": "" }, { "docid": "8129da4e59dcd1924824d59fe3ffddd2", "score": "0.5083965", "text": "forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n }", "title": "" }, { "docid": "8129da4e59dcd1924824d59fe3ffddd2", "score": "0.5083965", "text": "forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {\n const name = this._scope.toName(nameOrPrefix);\n return this._for(new ForRange(varKind, name, from, to), () => forBody(name));\n }", "title": "" }, { "docid": "a802379116fbf651002aa67b2916f6e2", "score": "0.5072268", "text": "function range(a,b){\n let tab = [];\n let mini = (a < b)? a : b;\n let maxi = (a > b)? a : b; \n\n for (var i = mini; i <= maxi; i++){\n tab.push(i);\n }\n\n return tab;\n}", "title": "" }, { "docid": "c969988384c817898463114b4d79c8f9", "score": "0.5065104", "text": "function $for(start0, end, action) /* forall<e> (start : int, end : int, action : (int) -> e ()) -> e () */ {\n return _bind_for(start0, end, action);\n}", "title": "" }, { "docid": "cb5e57ece1b735c4d416fd9342888f09", "score": "0.50609195", "text": "function uS(t,e){var n=xi()(t);if(bi.a){var r=bi()(t);e&&(r=yi()(r).call(r,(function(e){return vi()(t,e).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "73e94c19728d29d780c0f133b6a1b674", "score": "0.5045883", "text": "forEach(f) {\n let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2\n for (let i = 0, diff = 0; i < this.ranges.length; i += 3) {\n let start = this.ranges[i], oldStart = start - (this.inverted ? diff : 0), newStart = start + (this.inverted ? 0 : diff)\n let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex]\n f(oldStart, oldStart + oldSize, newStart, newStart + newSize)\n diff += newSize - oldSize\n }\n }", "title": "" }, { "docid": "d561cec37545aced9b0ece1448f43311", "score": "0.5045409", "text": "function RangeEnumerable(fromX, toY) {\n var cancelled = false;\n var options = {\n cancel: function () {\n cancelled = true;\n }\n };\n //all logic for this is here\n var range = {\n enumerate: function(callback) {\n for(var x = fromX; x<= toY; x++ ) {\n if(cancelled) {\n break;\n }\n callback(x, options);\n }\n }\n };\n\n return range;\n}", "title": "" }, { "docid": "2bc556dbe266e46002113010db88f25e", "score": "0.50437677", "text": "function range( start, end, step ){\t\r\n\tvar tablica = [];\r\n\tif ( step == null)\r\n\t\tstep = 1; \r\n\tif ( step >= 0 )\r\n\t\twhile (start <= end){\r\n\t\t\ttablica.push(start);\r\n\t\t\tstart +=step;\r\n\t\t}\r\n\telse \r\n\t\twhile (start >= end){\r\n\t\t\ttablica.push(start);\r\n\t\t\tstart +=step;\r\n\t\t}\r\n\treturn tablica;\r\n}", "title": "" }, { "docid": "46edae36e0c0e570b4ea572aefd7e55f", "score": "0.50303227", "text": "function showRange(range, lowstr, highstr, unit, range_concat){\n var result = '';\n var r = range || [];\n if (r.length == 2){\n if (r[0] == null && r[1] > 0){\n return r[1] + highstr;\n } else if (r[0] > 0 && r[1] == null){\n return r[0] + lowstr;\n } else if (r[0] > 0 && r[1] > 0){\n return r[0] + range_concat + r[1] + unit;\n } \n }\n return result;\n}", "title": "" }, { "docid": "0ec8120797300cd64accba97015d3739", "score": "0.50295115", "text": "function nameFunction() {}", "title": "" }, { "docid": "824ffe94dad2b6b3e3c8fbf3f31bf0d0", "score": "0.5026482", "text": "function Uu(t,i){if(!(t instanceof i))throw new TypeError(\"Cannot call a class as a function\")}", "title": "" }, { "docid": "3eaead3a20da2d32cc7567b646ecde3d", "score": "0.50238323", "text": "function range(start, end) {\n const newVariable = [];\n\n for (let i = start; i <= end; i++) {\n newVariable.push(i);\n }\n\n return newVariable;\n}", "title": "" }, { "docid": "51e0ed771674ad8e75cf18d2ebe84da2", "score": "0.50230587", "text": "function addRange(start, finish, scope) {\n var i = 0;\n for (i = start; i <= finish; i++) {\n var item = {\n value: i.toString(),\n liClass: scope.page == i ? scope.activeClass : 'waves-effect',\n action: function() {\n internalAction(scope, this.value);\n }\n };\n\n scope.List.push(item);\n }\n }", "title": "" }, { "docid": "93a84fb415e41a017c598978dcc1f03d", "score": "0.5020328", "text": "function mapRange(value, fromIn, toIn, fromOut, toOut) {\n return fromOut + (toOut - fromOut) * (value - fromIn) / (toIn - fromIn);\n}", "title": "" }, { "docid": "714dd55a3c58011e82bc7845136fda7a", "score": "0.5017269", "text": "function funName (num){\n\t// console.log(num);\n\tfor(var i = 0; i <= num; i++){\n\t\tconsole.log(i);\n\t}\n}", "title": "" }, { "docid": "8a6b9341b68b70a4a7f797a4c85e0edf", "score": "0.5014298", "text": "add(range) {\n return new SubRange(\n Math.min(this.low, range.low),\n Math.max(this.high, range.high)\n );\n }", "title": "" }, { "docid": "8a6b9341b68b70a4a7f797a4c85e0edf", "score": "0.5014298", "text": "add(range) {\n return new SubRange(\n Math.min(this.low, range.low),\n Math.max(this.high, range.high)\n );\n }", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5008762", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5008762", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5008762", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5008762", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5008762", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5008762", "text": "function i(){}", "title": "" }, { "docid": "56281f197e735f29ae48365638de7556", "score": "0.5008762", "text": "function i(){}", "title": "" }, { "docid": "e7b25bd71da894d26e16b4ef4c28e8cc", "score": "0.50071543", "text": "function __f_9() {}", "title": "" }, { "docid": "ab41f91894348c7f54f98bccc661a911", "score": "0.5005183", "text": "rangeOverlap(input: NumberCollection): NumberCollection {\n\t…\n}", "title": "" }, { "docid": "265aedbc0936b3376729092575e3ccd4", "score": "0.5004499", "text": "range(start, end) {\n return new vscode.Range(start, end);\n }", "title": "" }, { "docid": "d4b29d16934974af90d516db1e581406", "score": "0.50024", "text": "range() {\n return { min: Math.min(...this.values), max: Math.max(...this.values) };\n }", "title": "" }, { "docid": "f51ae30271fcc5bf5cfbe16f73106481", "score": "0.49999514", "text": "function RangeSeq(from, to){\n this.sElem = from;\n this.from = from;\n this.to = to;\n}", "title": "" }, { "docid": "6a92a924599f72cfc48780ce7fb41ecd", "score": "0.49904302", "text": "function Range(from, to) {\r\n this.from = from;\r\n this.to = to;\r\n}", "title": "" }, { "docid": "65b6b8e7d513e8971fab5e6adf6efebe", "score": "0.49893114", "text": "function range(start, stop, step){ \n\tif (typeof stop == 'undefined'){ //only one parameter passed\n\t\tstop = start;\n\t\tstart = 0;\n\t}\n\tif (typeof step == 'undefined'){\n\t\tstep = 1;\n\t}\n\tvar result = []\n\tfor (var i = start; step > 0 ? i < stop : i > stop; i+= step){\n\t\tresult.push(i);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "6e4eac2f43bb7bc6243274b0a6c27493", "score": "0.49867806", "text": "function quux10 (foo) {\n\n}", "title": "" }, { "docid": "7b1ffdd971da61d7b00f2f26356e5425", "score": "0.4985327", "text": "function t(e,a){return{start:e.start,end:e.end,index:a}}", "title": "" }, { "docid": "094dc37d3467f04226a3487fab5555f9", "score": "0.49834925", "text": "*[Symbol.iterator]() {\n yield this.id;\n yield this.bounds;\n }", "title": "" }, { "docid": "901bb1133a7803045c8611ea6b58c5bf", "score": "0.49831757", "text": "forRange(\n nameOrPrefix,\n from,\n to,\n forBody,\n varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let\n ) {\n const name = this._scope.toName(nameOrPrefix)\n return this._for(new ForRange(varKind, name, from, to), () =>\n forBody(name)\n )\n }", "title": "" }, { "docid": "30bf0fadb83736a5f9dac287a0a89b93", "score": "0.498032", "text": "function checkTheRange(rangeNum, rangeNum2) {\n\n}", "title": "" }, { "docid": "a59a280adda682a119a912a534c7053a", "score": "0.49786773", "text": "range(from, to = from) {\n return Range.create(from, to, this)\n }", "title": "" }, { "docid": "4f7e195b60cbf4b030945b1eb68cbd80", "score": "0.49781218", "text": "function quux9 () {\n\n}", "title": "" }, { "docid": "b0db06089297c650d8ce02a2a9f3b522", "score": "0.49775055", "text": "function globals() {\n\t\t return {\n\t\t range: function(start, stop, step) {\n\t\t if(!stop) {\n\t\t stop = start;\n\t\t start = 0;\n\t\t step = 1;\n\t\t }\n\t\t else if(!step) {\n\t\t step = 1;\n\t\t }\n\t\n\t\t var arr = [];\n\t\t var i;\n\t\t if (step > 0) {\n\t\t for (i=start; i<stop; i+=step) {\n\t\t arr.push(i);\n\t\t }\n\t\t } else {\n\t\t for (i=start; i>stop; i+=step) {\n\t\t arr.push(i);\n\t\t }\n\t\t }\n\t\t return arr;\n\t\t },\n\t\n\t\t // lipsum: function(n, html, min, max) {\n\t\t // },\n\t\n\t\t cycler: function() {\n\t\t return cycler(Array.prototype.slice.call(arguments));\n\t\t },\n\t\n\t\t joiner: function(sep) {\n\t\t return joiner(sep);\n\t\t }\n\t\t };\n\t\t}", "title": "" }, { "docid": "16c675ba9d84c8d09d95a9299aeadba8", "score": "0.4974291", "text": "static rangeTarget(prop) {\n return (((prop.range & 0x3fe00)!=0) ? 1 : 0) + (((prop.range & 0x001ff)!=0) ? 2 : 0);\n }", "title": "" } ]
4b0b0d2fd75b6b7a69300cab0e936da4
Build and return a TriangleMesh
[ { "docid": "d676e5ba3802e5cc78fda290f6383d0e", "score": "0.7262752", "text": "create(runChecks=false) {\n // TODO: use Float32Array instead of this, so that we can\n // construct directly from points read in from a file\n let delaunator = Delaunator.from(this.points);\n let graph = {\n _r_vertex: this.points,\n _triangles: delaunator.triangles,\n _halfedges: delaunator.halfedges\n };\n\n if (runChecks) {\n checkPointInequality(graph);\n checkTriangleInequality(graph);\n }\n \n graph = addGhostStructure(graph);\n graph.numBoundaryRegions = this.numBoundaryRegions;\n if (runChecks) {\n checkMeshConnectivity(graph);\n }\n\n return new TriangleMesh(graph);\n }", "title": "" } ]
[ { "docid": "e4cc2692e272b51b2ece12ac3030b41b", "score": "0.6984901", "text": "function gen_triangle( size, v1 = new THREE.Vector3(-1, 0, 0), v2 = new THREE.Vector3(1, 0, 0), v3 = new THREE.Vector3(-1, 1, 0) ) {\n var triangle_geometry = new THREE.Geometry();\n var triangle = new THREE.Triangle(v1, v2, v3);\n var normal = triangle.normal();\n triangle_geometry.vertices.push(triangle.a);\n triangle_geometry.vertices.push(triangle.b);\n triangle_geometry.vertices.push(triangle.c);\n triangle_geometry.faces.push(new THREE.Face3(0, 1, 2, normal));\n var triangle = new THREE.Mesh(triangle_geometry, new THREE.MeshNormalMaterial());\n \n triangle.size = size;\n\n return triangle;\n}", "title": "" }, { "docid": "e4cc2692e272b51b2ece12ac3030b41b", "score": "0.6984901", "text": "function gen_triangle( size, v1 = new THREE.Vector3(-1, 0, 0), v2 = new THREE.Vector3(1, 0, 0), v3 = new THREE.Vector3(-1, 1, 0) ) {\n var triangle_geometry = new THREE.Geometry();\n var triangle = new THREE.Triangle(v1, v2, v3);\n var normal = triangle.normal();\n triangle_geometry.vertices.push(triangle.a);\n triangle_geometry.vertices.push(triangle.b);\n triangle_geometry.vertices.push(triangle.c);\n triangle_geometry.faces.push(new THREE.Face3(0, 1, 2, normal));\n var triangle = new THREE.Mesh(triangle_geometry, new THREE.MeshNormalMaterial());\n \n triangle.size = size;\n\n return triangle;\n}", "title": "" }, { "docid": "5c8314d29cab8d8a06c1c75f201cbfb7", "score": "0.6459999", "text": "function TriangulateAndCreate(points, verticeSize)\n{\n if (verticeSize)\n points = Help.ConvertVertexBufferToVectorArray(points, verticeSize);\n\n var indices = Triangulate(points);\n var triangleCount = indices.length / 3;\n\n var triangles = [];\n for(var i = 0; i < triangleCount; ++i)\n {\n var triangleIndices = indices.splice(0, 3);\n var triangle = [];\n for(var j = 0; j < triangleIndices.length; ++j)\n {\n triangle.push( points[triangleIndices[j]] );\n }\n\n triangles.push(triangle);\n }\n\n return triangles;\n}", "title": "" }, { "docid": "1d36508f72acb952d2b4a9c3b0eaecf1", "score": "0.64486164", "text": "function DCELMesh(Vertices){}", "title": "" }, { "docid": "fa658628955e3953032578bc10c146ee", "score": "0.643488", "text": "function createTriangles() {\n // Starts the list of triangles.\n triangles = [];\n\n points[0].used = true;\n points[xPoints - 1].used = true;\n points[points.length - 1].used = true;\n points[(xPoints) * (yPoints - 1)].used = true;\n triangles.push(new Vector3(xPoints - 1, 0, points.length - 1));\n triangles.push(new Vector3(points.length - 1, 0, (xPoints) * (yPoints - 1)));\n\n // Loops through list of all points, adds them, and flips triangles appropriately.\n for(var newPointIndex = 0; newPointIndex < points.length; newPointIndex++) {\n if(!points[newPointIndex].used) {\n const pt = new Vector2(points[newPointIndex].x, points[newPointIndex].y);\n for(var triIndex = 0; triIndex < triangles.length; triIndex++) {\n if(isPointInsideTriangle(pt, triangles[triIndex])) {\n const outTri = triangles[triIndex];\n if(newPointIndex != outTri.x && newPointIndex != outTri.y && newPointIndex != outTri.z) {\n // Subdivides triangle into three new triangles\n const v1 = outTri.x;\n const v2 = outTri.y;\n const v3 = outTri.z;\n \n triangles.splice(triIndex, 1);\n\n var countToFlipCheck = 0;\n\n var newTri = new Vector3(v1, v2, newPointIndex);\n if(!hasZeroArea(newTri)) {\n triangles.push(reorderCounterclockwise(newTri));\n countToFlipCheck++;\n }\n newTri = new Vector3(v1, v3, newPointIndex);\n if(!hasZeroArea(newTri)) {\n triangles.push(reorderCounterclockwise(newTri));\n countToFlipCheck++;\n }\n newTri = new Vector3(v2, v3, newPointIndex);\n if(!hasZeroArea(newTri)) {\n triangles.push(reorderCounterclockwise(newTri));\n countToFlipCheck++;\n }\n \n for(var checker = 0; checker < countToFlipCheck; checker++) {\n recursiveFlip(triangles.length - checker - 1, 0);\n }\n\n break;\n }\n }\n }\n points[newPointIndex].used = true;\n }\n }\n \n for(var triIndx = 0; triIndx < triangles.length; triIndx++) {\n recursiveFlip(triIndx, 0);\n }\n\n for(var triIndx = 0; triIndx < triangles.length; triIndx++) {\n const tri = triangles[triIndx];\n if(hasZeroArea(tri)) {\n triangles.splice(triIndx, 1);\n triIndx--;\n } else if((points[tri.x].x == points[tri.y].x && points[tri.x].x == points[tri.z].x) || (points[tri.x].y == points[tri.y].y && points[tri.x].y == points[tri.z].y)) {\n triangles.splice(triIndx, 1);\n triIndx--;\n }\n }\n\n }", "title": "" }, { "docid": "b6c40628e1200b179a9c2ff933035212", "score": "0.64336693", "text": "function Triangle() {\n this.vertices = []; // a list of 3 vertices\n this.material = null; // a Material object\n}", "title": "" }, { "docid": "3582037379a16ff5112bcf8126a0e8d5", "score": "0.6395306", "text": "function buildMesh() {\n this.vertices = [];\n this.faces = [];\n\n for (i=0, l=this.fileData.length; i<l; i++) {\n currentLine = this.fileData[i];\n\n if (currentLine.match(/^V\\(/)) {\n tempValue = currentLine.substring(2, currentLine.length-1).split(\",\").map(parseFloats);\n this.vertices.push( new vec4D(tempValue[0] || 0, tempValue[1] || 0, tempValue[2] || 0, 1) );\n }\n\n else if (currentLine.match(/^F\\(/)) {\n tempValue = currentLine.substring(2, currentLine.length-1).split(\",\").map(parseInt);\n this.faces.push(tempValue.reverse());\n }\n }\n }", "title": "" }, { "docid": "8d4f471a580d81f6e56e05a40bf1ae7f", "score": "0.6326328", "text": "function createPalm() { return new THREE.Mesh(palmGeometry, material); }", "title": "" }, { "docid": "1583fdcafd779861ef87e164da865a45", "score": "0.6270754", "text": "function make_mesh (verts, faces) {\n var geom = new THREE.Geometry();\n verts.forEach(function (vert) {\n geom.vertices.push(new THREE.Vector3(vert[0], vert[1], vert[2]));\n });\n faces.forEach(function (face) {\n geom.faces.push(new THREE.Face3(face[0], face[1], face[2]));\n });\n geom.computeFaceNormals();\n geom.computeVertexNormals();\n var mesh = new THREE.Object3D();\n //mesh.eulerOrder = \"ZYX\";\n var frontmat = new THREE.MeshLambertMaterial({ color: 0xFFFF00,\n side: THREE.FrontSide,\n shading: THREE.SmoothShading,\n });\n mesh.front = new THREE.Mesh( geom, frontmat );\n mesh.add(mesh.front);\n var backmat = new THREE.MeshLambertMaterial({ color: 0xFF00FF,\n side: THREE.BackSide,\n shading: THREE.SmoothShading\n });\n mesh.back = new THREE.Mesh( geom, backmat );\n mesh.add(mesh.back);\n return mesh;\n }", "title": "" }, { "docid": "a1f4d9d15f1fd0a43c9127dde7e05288", "score": "0.61930215", "text": "function createTrimeshFromModel(object) {\n let mesh = getMesh(object)\n mesh.updateMatrixWorld()\n const geometry = new THREE.Geometry()\n geometry.fromBufferGeometry(mesh.geometry)\n geometry.scale(mesh.scale.x, mesh.scale.y, mesh.scale.x)\n \n // get vertices and faces for cannon\n const vertices = geometry.vertices.map(v => new CANNON.Vec3(v.x, v.y, v.z));\n const faces = geometry.faces.map(f => [f.a, f.b, f.c]);\n \n return new CANNON.ConvexPolyhedron(vertices, faces);\n}", "title": "" }, { "docid": "44dec3f24382fc422b0f15a7454bae01", "score": "0.6188417", "text": "generateTriangles() {\r\n //Your code here\r\n var deltaX = (this.maxX - this.minX) / this.div;\r\n var deltaY = (this.maxY - this.minY) / this.div;\r\n for(var i = 0; i <= this.div; i++) {\r\n for (var j = 0; j <= this.div; j++) {\r\n this.vBuffer.push(this.minX+deltaX*j);\r\n this.vBuffer.push(this.minY+deltaY*i);\r\n this.vBuffer.push(0);\r\n\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n }\r\n }\r\n for(var i = 0; i < this.div; i++) {\r\n for (var j = 0; j < this.div; j++) {\r\n var vid = i*(this.div+1) +j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + 1 + this.div + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n }\r\n }\r\n \r\n //\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n this.setHeightsByPartition(300, 0.005);\r\n this.generateNormals();\r\n }", "title": "" }, { "docid": "40092f04751f9ac6559ebe47f4515c5b", "score": "0.6181806", "text": "generateTriangles()\r\n{\r\n // Calculate the distance between each vertex\r\n var deltaX = (this.maxX-this.minX)/this.div;\r\n var deltaY = (this.maxY-this.minY)/this.div;\r\n\r\n // Push each vertex and normal vector to the buffer\r\n for(var i=0; i<=this.div; i++) {\r\n for(var j=0; j<=this.div; j++) {\r\n this.vBuffer.push(this.minX+deltaX*j);\r\n this.vBuffer.push(this.minY+deltaY*i);\r\n this.vBuffer.push(0);\r\n\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(1);\r\n }\r\n }\r\n\r\n // Loop through each square and split into two triangles\r\n // Push triangle vertices to face buffer\r\n for(var i=0; i<this.div; i++) {\r\n for(var j=0; j<this.div; j++) {\r\n var vid = i*(this.div+1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+1+this.div+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n }\r\n }\r\n\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n}", "title": "" }, { "docid": "083261e9a26a7ac46296890af5ea766b", "score": "0.61774075", "text": "function fillCube(mesh){\n mesh.add(new Triangle(new Vec(0,0,0),new Vec(0,100,0),new Vec(100,100,0)));\n mesh.add(new Triangle(new Vec(0,0,0),new Vec(100,100,0),new Vec(100,0,0)));\n\n mesh.add(new Triangle(new Vec(100,0,0),new Vec(100,100,0),new Vec(100,100,100)));\n mesh.add(new Triangle(new Vec(100,0,0),new Vec(100,100,100),new Vec(100,0,100)));\n\n mesh.add(new Triangle(new Vec(100,0,100),new Vec(100,100,100),new Vec(0,100,100)));\n mesh.add(new Triangle(new Vec(100,0,100),new Vec(0,100,100),new Vec(0,0,100)));\n\n mesh.add(new Triangle(new Vec(0,0,100),new Vec(0,100,100),new Vec(0,100,0)));\n mesh.add(new Triangle(new Vec(0,0,100),new Vec(0,100,0),new Vec(0,0,0)));\n\n mesh.add(new Triangle(new Vec(0,100,0),new Vec(0,100,100),new Vec(100,100,100)));\n mesh.add(new Triangle(new Vec(0,100,0),new Vec(100,100,100),new Vec(100,100,0)));\n\n mesh.add(new Triangle(new Vec(100,0,100),new Vec(0,0,100),new Vec(0,0,0)));\n mesh.add(new Triangle(new Vec(100,0,100),new Vec(0,0,0),new Vec(100,0,0)));\n}", "title": "" }, { "docid": "71262543031e5094f58e1804aebfdb8a", "score": "0.61664087", "text": "function buildTetrahedron(width, height, length, Nu, Nv) {\n width = width/2;\n\n // if the geometry has to change\n if (this.changeGeometry(width, height, length, Nu, Nv)) {\n return;\n }\n\n var angle = 2*Math.PI/3;\n var x = width*2*Math.sqrt(2)/3;\n var y = 0;\n var z = -width*1/3;\n var x0 = x*Math.cos(angle) + y*Math.sin(angle);\n var y0 = -x*Math.sin(angle) + y*Math.cos(angle);\n this.vertices = [ new vec4D( 0, 0, width, 1), //0\n new vec4D(x0, y0, z, 1), //1\n new vec4D(x0, -y0, z, 1), //2\n new vec4D( x, y, z, 1), //3\n ];\n\n this.faces = [[1, 3, 2], [0, 1, 2], [0, 2, 3], [0, 3, 1]];\n\n this.updateValues(width, height, length, Nu, Nv);\n }", "title": "" }, { "docid": "69d56b9caaefbb048d0abe25ef38249a", "score": "0.61211854", "text": "triangulate() {\n this.triangles = [];\n\n // map point objects to length-2 arrays\n var vertices = this.points.map(function(point) {\n return point.getCoords();\n });\n\n // vertices is now an array such as:\n // [ [p1x, p1y], [p2x, p2y], [p3x, p3y], ... ]\n\n // do the algorithm\n var triangulated = Delaunay.triangulate(vertices);\n\n // returns 1 dimensional array arranged in triples such as:\n // [ t1a, t1b, t1c, t2a, t2b, t2c,.... ]\n // where t1a, etc are indeces in the vertices array\n // turn that into array of triangle points\n for (var i = 0; i < triangulated.length; i += 3) {\n var arr = [];\n arr.push(vertices[triangulated[i]]);\n arr.push(vertices[triangulated[i + 1]]);\n arr.push(vertices[triangulated[i + 2]]);\n this.triangles.push(arr);\n }\n\n // map to array of Triangle objects\n this.triangles = this.triangles.map(function(triangle) {\n return new Triangle(new Point(triangle[0]),\n new Point(triangle[1]),\n new Point(triangle[2]));\n });\n}", "title": "" }, { "docid": "e997e6dd8e739870ec416d41e6e446d3", "score": "0.60734105", "text": "function WorkingMesh() {\n\n function NamedVertex(uid, rx, ry, dx, dy) {\n if (dx === undefined) {\n dx = 0;\n }\n if (dy === undefined) {\n dy = 0;\n }\n return { uid, rx, ry, dx, dy };\n }\n\n function Face(a, b, c) {\n return { a, b, c };\n }\n\n\n let include_morph = false;\n\n\n // Map of named vertexes.\n let vertex_map = Object.create(null);\n // List (by insert order) of named vertexes.\n let vertex_arr = [];\n // List of edges (edge between i and i + 1).\n let edge_indexes = [];\n // List of faces.\n let face_indexes = [];\n\n\n\n function getCurrentMeshDetails() {\n return {\n vertex_arr,\n edge_indexes,\n face_indexes\n };\n }\n\n function setIncludeMorph(b) {\n include_morph = b;\n }\n\n\n function getVectorX(v) {\n if (include_morph === true) {\n return v.rx + v.dx;\n }\n return v.rx;\n }\n function getVectorY(v) {\n if (include_morph === true) {\n return v.ry + v.dy;\n }\n return v.ry;\n }\n\n // Returns the closest vertex that is within the given radius of the\n // coordinates x, y.\n const area_manager = AreaManager(getVectorX, getVectorY);\n function nearestVertexUidTo(x, y, radius) {\n return area_manager.nearestPointUidTo(vertex_arr, x, y, radius);\n }\n\n function allVertexUid() {\n return Object.keys(vertex_map);\n }\n\n\n function allVertexUidWithin(polygon) {\n const out = [];\n const len = vertex_arr.length;\n for (let i = 0; i < len; ++i) {\n const v = vertex_arr[i];\n if (pointInsidePolygon(\n getVectorX(v), getVectorY(v), polygon) === true) {\n out.push(v.uid);\n }\n }\n return out;\n }\n\n\n // Adds a vertex at the given location. The x/y coordinates are in\n // document space.\n\n function addVertex(x, y) {\n const uid = uuidv1();\n const v = NamedVertex(uid, x, y);\n vertex_arr.push(v);\n vertex_map[uid] = v;\n return uid;\n }\n\n // Adds an edge between two vertex uids.\n\n function addEdge(vertex1_uid, vertex2_uid, edge_type) {\n\n // If this edge makes a triangle then we fill it,\n const v1_connections = [];\n const v2_connections = [];\n const len = edge_indexes.length;\n for (let i = 0; i < len; i += 2) {\n const ep1 = edge_indexes[i];\n const ep2 = edge_indexes[i + 1];\n\n if (ep1 === vertex1_uid && ep2 === vertex2_uid) {\n // Edge already defined,\n return;\n }\n if (ep2 === vertex1_uid && ep1 === vertex2_uid) {\n return;\n }\n\n if (ep1 === vertex1_uid) {\n v1_connections.push(ep2);\n }\n else if (ep2 === vertex1_uid) {\n v1_connections.push(ep1);\n }\n if (ep1 === vertex2_uid) {\n v2_connections.push(ep2);\n }\n else if (ep2 === vertex2_uid) {\n v2_connections.push(ep1);\n }\n }\n\n const shared_i = [];\n for (let i = 0; i < v1_connections.length; ++i) {\n const p1i = v1_connections[i];\n if (v2_connections.indexOf(p1i) >= 0) {\n shared_i.push(p1i);\n }\n }\n\n edge_indexes.push(vertex1_uid);\n edge_indexes.push(vertex2_uid);\n\n if (shared_i.length > 0) {\n\n shared_i.forEach((vertex3_uid) => {\n const v1 = vertex_map[vertex1_uid];\n const v2 = vertex_map[vertex2_uid];\n const v3 = vertex_map[vertex3_uid];\n\n const tri_faces = earcut([\n v1.rx, v1.ry,\n v2.rx, v2.ry,\n v3.rx, v3.ry\n ]);\n const route_lu = [ vertex1_uid, vertex2_uid, vertex3_uid ];\n\n face_indexes.push(\n Face(route_lu[tri_faces[0]],\n route_lu[tri_faces[1]],\n route_lu[tri_faces[2]] ));\n\n });\n }\n\n }\n\n\n\n function getSingleVertex(uid) {\n const v = vertex_map[uid];\n if (v === undefined) {\n throw Error(\"Vertex not found\");\n }\n return {\n x: v.rx,\n y: v.ry\n };\n }\n\n function getSingleVertexMorph(uid) {\n const v = vertex_map[uid];\n if (v === undefined) {\n throw Error(\"Vertex not found\");\n }\n return {\n x: v.rx + v.dx,\n y: v.ry + v.dy\n };\n }\n\n\n // Moves a single vertex with the given uid,\n\n function moveSingleVertex(uid, rx, ry) {\n const v = vertex_map[uid];\n if (v === undefined) {\n throw Error(\"Vertex not found\");\n }\n v.rx = rx;\n v.ry = ry;\n }\n\n function moveSingleVertexMorph(uid, x, y) {\n const v = vertex_map[uid];\n if (v === undefined) {\n throw Error(\"Vertex not found\");\n }\n v.dx = x - v.rx;\n v.dy = y - v.ry;\n }\n\n function flipFaces(uids) {\n // All faces that contain the given vertex uids,\n face_indexes.forEach((face) => {\n let contains_count = 0;\n contains_count += (uids.indexOf(face.a) >= 0) ? 1 : 0;\n contains_count += (uids.indexOf(face.b) >= 0) ? 1 : 0;\n contains_count += (uids.indexOf(face.c) >= 0) ? 1 : 0;\n if (contains_count === 3) {\n const t = face.a;\n face.a = face.b;\n face.b = t;\n }\n });\n }\n\n function resetToRest(uids) {\n uids.forEach((vuid) => {\n const v = vertex_map[vuid];\n if (v !== undefined) {\n v.dx = 0;\n v.dy = 0;\n }\n });\n }\n\n\n // Removes all named indexes from the given set,\n\n function removeAllVertexesFrom(uid_set) {\n\n const lup_map = Object.create(null);\n uid_set.forEach((uid) => {\n lup_map[uid] = true;\n });\n\n const len = vertex_arr.length;\n for (let i = len - 1; i >= 0; --i) {\n const v = vertex_arr[i];\n if (lup_map[v.uid] === true) {\n vertex_arr.splice(i, 1);\n delete vertex_map[v.uid];\n }\n }\n\n // Update edges,\n const edge_len = edge_indexes.length;\n for (let i = edge_len - 2; i >= 0; i -= 2) {\n const ev1 = edge_indexes[i];\n const ev2 = edge_indexes[i + 1];\n if (lup_map[ev1] === true || lup_map[ev2] === true) {\n edge_indexes.splice(i, 2);\n }\n }\n\n // Kill faces,\n const face_len = face_indexes.length;\n for (let i = face_len - 1; i >= 0; --i) {\n const f = face_indexes[i];\n if ( lup_map[f.a] === true ||\n lup_map[f.b] === true ||\n lup_map[f.c] === true ) {\n face_indexes.splice(i, 1);\n }\n }\n\n }\n\n // Clears the mesh of all vertexes/edges and faces,\n\n function clear() {\n vertex_arr.length = 0;\n vertex_map = Object.create(null);\n edge_indexes.length = 0;\n face_indexes.length = 0;\n }\n\n\n function getVertex(uid) {\n return vertex_map[uid];\n }\n\n\n\n\n\n // Create a set of weighted vertex uid points around the selected uids with\n // the given radius.\n\n function createWeightedSelection(selected_uids, radius) {\n\n const weighted_vs = Object.create(null);\n let affect_count = 0;\n\n vertex_arr.forEach((v) => {\n const vuid = v.uid;\n const x = getVectorX(v);\n const y = getVectorY(v);\n\n let weight = 0;\n if (selected_uids.indexOf(vuid) >= 0) {\n weight = 1;\n }\n else if (radius > 0) {\n // Calculate weight\n selected_uids.forEach((vuid) => {\n const sv = vertex_map[vuid];\n const dx = getVectorX(sv) - x;\n const dy = getVectorY(sv) - y;\n // Early exit,\n if (Math.abs(dx) <= radius || Math.abs(dy) <= radius) {\n // Distance in document pixels,\n const dist = Math.sqrt((dx * dx) + (dy * dy));\n // Number between 0 and 1 away from radius\n const dif = radius - dist;\n if (dif > 0) {\n const tw = dif / radius;\n if (tw > weight) {\n weight = tw;\n }\n }\n }\n });\n }\n if (weight > 0) {\n weighted_vs[vuid] = {\n x, y, weight\n };\n ++affect_count;\n }\n });\n\n // Return weighted vertexes,\n return {\n affect_count,\n weighted_vs,\n };\n\n }\n\n\n\n\n\n\n function convertCopy(a, f) {\n if (a === undefined) {\n return [];\n }\n // Convert,\n if (a.length > 0) {\n const out = [];\n const len = a.length;\n for (let i = 0; i < len; ++i) {\n out.push( f(a[i]) );\n }\n return out;\n }\n return a.slice(0);\n }\n\n function arrCopy(a) {\n if (a === undefined) {\n return [];\n }\n return a.slice(0);\n }\n\n function arrCopyVertexes(v) {\n return convertCopy(v,\n (vt) => NamedVertex( vt.uid, vt.rx, vt.ry, vt.dx, vt.dy )\n );\n }\n\n function arrCopyFaces(f) {\n return convertCopy(f,\n (ft) => Face( ft.a, ft.b, ft.c )\n );\n }\n\n\n\n function loadFrom(ss, mesh_uid) {\n const meshes = ss.getArray('meshes');\n const mesh = meshes.get(mesh_uid);\n vertex_arr = arrCopyVertexes( mesh.get('me_vertices') );\n edge_indexes = arrCopy( mesh.get('me_edge_indexes') );\n face_indexes = arrCopyFaces( mesh.get('me_face_indexes') );\n vertex_map = Object.create(null);\n vertex_arr.forEach((v) => {\n vertex_map[v.uid] = v;\n });\n }\n\n function saveTo(ss, mesh_uid) {\n const meshes = ss.getArray('meshes');\n const mesh = meshes.get(mesh_uid);\n mesh.set('me_vertices', arrCopyVertexes( vertex_arr ));\n mesh.set('me_edge_indexes', arrCopy( edge_indexes ));\n mesh.set('me_face_indexes', arrCopyFaces( face_indexes ));\n console.log(\"SAVE!\");\n }\n\n\n function createTHREEVertex(uid) {\n const v = vertex_map[uid];\n if (v === undefined) {\n return;\n }\n return new THREE.Vector3(getVectorX(v), getVectorY(v), 0);\n }\n\n function toTHREEVertexes(uids) {\n const vts = [];\n uids.forEach((uid) => {\n const v = createTHREEVertex(uid);\n if (v !== undefined) {\n vts.push(v);\n }\n });\n return vts;\n }\n\n\n\n function createTHREEFacesGeometry() {\n const geometry = new THREE.Geometry();\n const len = face_indexes.length;\n const verts = geometry.vertices;\n const faces = geometry.faces;\n for (let n = 0; n < len; ++n) {\n const f = face_indexes[n];\n const p = verts.length;\n\n const va = createTHREEVertex(f.a);\n const vb = createTHREEVertex(f.b);\n const vc = createTHREEVertex(f.c);\n if (va !== undefined && vb !== undefined && vc !== undefined) {\n verts.push(va);\n verts.push(vb);\n verts.push(vc);\n faces.push(new THREE.Face3(p, p + 1, p + 2));\n }\n }\n geometry.computeBoundingSphere();\n return geometry;\n }\n\n function createTHREEEdgesGeometry() {\n const geometry = new THREE.Geometry();\n const len = edge_indexes.length;\n const verts = geometry.vertices;\n for (let n = 0; n < len; ++n) {\n const v = createTHREEVertex(edge_indexes[n]);\n if (v !== undefined) {\n verts.push(v);\n }\n }\n geometry.computeBoundingSphere();\n geometry.computeLineDistances();\n return geometry;\n }\n\n\n return {\n\n setIncludeMorph,\n getCurrentMeshDetails,\n\n allVertexUidWithin,\n nearestVertexUidTo,\n allVertexUid,\n\n addVertex,\n addEdge,\n\n getSingleVertex,\n getSingleVertexMorph,\n moveSingleVertex,\n moveSingleVertexMorph,\n flipFaces,\n\n resetToRest,\n\n removeAllVertexesFrom,\n clear,\n getVertex,\n\n createWeightedSelection,\n\n loadFrom,\n saveTo,\n\n toTHREEVertexes,\n createTHREEFacesGeometry,\n createTHREEEdgesGeometry\n\n };\n\n}", "title": "" }, { "docid": "bf09c42518b46a096cf9d320e0d413b8", "score": "0.60587525", "text": "function createMesh(text) {\n var vertices = [];\n var normals = [];\n var face_indices = [];\n var line_indices = [];\n var vertex_to_normal = new Map();\n var n = 0;\n\n var all_lines = text.split(\"\\n\");\n for (var i = 0; i < all_lines.length; i++) {\n var line = all_lines[i].split(/[ ,]+/);\n switch (line[0]) {\n case 'v':\n vertices.push(parseFloat(line[1]));\n vertices.push(parseFloat(line[2]));\n vertices.push(parseFloat(line[3]));\n n++;\n break;\n case 'vn':\n normals.push(parseFloat(line[1]));\n normals.push(parseFloat(line[2]));\n normals.push(parseFloat(line[3]));\n break;\n case 'f':\n var idx1 = line[1].split(\"//\"); // [v1, n1]\n var idx2 = line[2].split(\"//\"); // [v2, n2]\n var idx3 = line[3].split(\"//\"); // [v3, n3]\n // map v1 -> n1\n vertex_to_normal.set(parseInt(idx1[0]), parseInt(idx1[1])); \n // map v2 -> n2\n vertex_to_normal.set(parseInt(idx2[0]), parseInt(idx2[1])); \n // map v3 -> n3\n vertex_to_normal.set(parseInt(idx3[0]), parseInt(idx3[1])); \n // edge (v1,v2)\n line_indices.push(parseInt(idx1[0]),parseInt(idx2[0]));\n // edge (v2,v3)\n line_indices.push(parseInt(idx2[0]),parseInt(idx3[0]));\n // edge (v3,v1)\n line_indices.push(parseInt(idx3[0]),parseInt(idx1[0]));\n // face (v1, v2, v3)\n face_indices.push(parseInt(idx1[0]));\n face_indices.push(parseInt(idx2[0]));\n face_indices.push(parseInt(idx3[0]));\n break;\n }\n }\n var exp = Math.ceil(Math.log2(n));\n return {\n sample_number: Math.pow(2,exp),\n vertices: vertices,\n normals: normals,\n line_indices: line_indices,\n face_indices: face_indices,\n vertex_to_normal: vertex_to_normal\n };\n}", "title": "" }, { "docid": "b29f62640062fa5ea7333712c00b5fa2", "score": "0.59885275", "text": "function makeVertex(p) {\n return new THREE.Vector3(p[0],p[1],p[2]);\n}", "title": "" }, { "docid": "87e9965fd5fdf9bf9be51b94d63a594b", "score": "0.597782", "text": "constructor(init) {\n if ('points' in init) {\n // Construct a new TriangleMesh from points + delaunator data\n this.numBoundaryRegions = init.numBoundaryPoints ?? 0;\n this.numSolidSides = init.numSolidSides ?? 0;\n this._vertex_t = [];\n this.update(init);\n }\n else {\n // Shallow copy an existing TriangleMesh data\n Object.assign(this, init);\n }\n }", "title": "" }, { "docid": "14a55b1e5e8e6566a976c7a6ae53919e", "score": "0.5937967", "text": "function buildMeshObject(gl, mode, numElements, elements, attributes) {\n if(numElements === 0) {\n return new EmptyMesh(gl)\n }\n var vao = createVAO(gl, elements, attributes.values)\n return new Mesh(gl, mode, numElements, vao, elements, attributes.values, attributes.names)\n}", "title": "" }, { "docid": "b053a6577eeb5d1d04cfaf4938ccd323", "score": "0.59003884", "text": "static createMesh( spec = {} ) {\n\n const { \n color = '#0000FF', \n radius = 1, \n detail = 0, // > 1, it's effectively a sphere. \n wireframe = true\n } = spec;\n \n // Use ThreeJS to define a 3D shape\n var geometry = new THREE.IcosahedronGeometry(radius, detail);\n var material = new THREE.MeshBasicMaterial({ \n color,\n wireframe \n });\n\n return {\n geometry,\n material\n }\n }", "title": "" }, { "docid": "3215ad691f87b5e77c50c0a9ad137d1f", "score": "0.58992", "text": "function tetrahedron(n) {\n const points = [];\n const texCoords = [];\n\n const a = [0.0, 0.0, -1.0];\n const b = [0.0, 0.942809, 0.333333];\n const c = [-0.816497, -0.471405, 0.333333];\n const d = [0.816497, -0.471405, 0.333333];\n\n divideTriangle(a, b, c, n);\n divideTriangle(d, c, b, n);\n divideTriangle(a, d, b, n);\n divideTriangle(a, c, d, n);\n\n return {\n points: points,\n normals: points,\n texCoords: texCoords\n };\n\n function divideTriangle(a, b, c, count) {\n if (count-- > 0) {\n let ab = [];\n vec3.lerp(ab, a, b, 0.5);\n vec3.normalize(ab, ab);\n let ac = [];\n vec3.lerp(ac, a, c, 0.5);\n vec3.normalize(ac, ac);\n let bc = [];\n vec3.lerp(bc, b, c, 0.5);\n vec3.normalize(bc, bc);\n\n divideTriangle(a, ab, ac, count);\n divideTriangle(ab, b, bc, count);\n divideTriangle(bc, c, ac, count);\n divideTriangle(ab, bc, ac, count);\n } else {\n triangle(a, b, c);\n }\n }\n\n function triangle(a, b, c) {\n points.push(...a);\n points.push(...b);\n points.push(...c);\n\n const uva = worldToSpherical(a);\n const uvb = worldToSpherical(b);\n const uvc = worldToSpherical(c);\n /* TODO (Optional) get rid of the seam by checking if this\n triangle crosses the s-coordinate's 1-to-0 boundary, and\n if so then push the lower coordinates 1 unit to the right */\n texCoords.push(...uva);\n texCoords.push(...uvb);\n texCoords.push(...uvc);\n }\n\n /* TODO #14 Implement the spherical mapping for texture coordinates. */\n function worldToSpherical(p) {\n const s = (Math.atan2(p[0],p[2]) + Math.PI) / (2 * Math.PI) /* TODO how do we find s from x,y,z? */ ;\n const t = (Math.asin(p[1]) + (Math.PI/2)) / Math.PI /* TODO how do we find t from x,y,z? */ ;\n return [s, t];\n }\n}", "title": "" }, { "docid": "f8ffec40f6427af43843cb63d202afd1", "score": "0.5891335", "text": "constructor() {\n // create geometry\n const geometry = new T.PlaneGeometry(30.0, 30.0)\n const material = new T.MeshStandardMaterial({\n color: 0xaaffaa,\n emissive: 0xaaffaa,\n emissiveIntensity: 0.5,\n })\n\n // build mesh\n const mesh = new T.Mesh(geometry, material)\n mesh.position.set(0.0, -0.5, 0.0)\n mesh.rotation.set(-Math.PI / 2, +0.0, 0.0)\n\n // add mesh shadows\n mesh.castShadow = false\n mesh.receiveShadow = true\n\n // store mesh\n this.mesh = mesh\n }", "title": "" }, { "docid": "eb79c5759c2e1a177375b5be267b7d49", "score": "0.58841574", "text": "function getMeshGeometry (data, vertexArray) {\n\n const offsets = [{\n count: data.indices.length,\n index: 0,\n start: 0}\n ]\n\n for (var oi = 0, ol = offsets.length; oi < ol; ++oi) {\n\n var start = offsets[oi].start\n var count = offsets[oi].count\n var index = offsets[oi].index\n\n for (var i = start, il = start + count; i < il; i += 3) {\n\n const a = index + data.indices[i]\n const b = index + data.indices[i + 1]\n const c = index + data.indices[i + 2]\n\n const vA = new THREE.Vector3()\n const vB = new THREE.Vector3()\n const vC = new THREE.Vector3()\n\n vA.fromArray(data.positions, a * data.stride)\n vB.fromArray(data.positions, b * data.stride)\n vC.fromArray(data.positions, c * data.stride)\n\n vertexArray.push(vA)\n vertexArray.push(vB)\n vertexArray.push(vC)\n }\n }\n}", "title": "" }, { "docid": "b8c49339af2edf9429c7f462360fde10", "score": "0.5880844", "text": "createMesh(geometry, material) {\n const mesh = new THREE.Mesh(geometry, material);\n this._scene.add(mesh);\n this._meshes.push(mesh);\n return mesh;\n }", "title": "" }, { "docid": "fec7ee7c3670f6ee497e2377fbe92949", "score": "0.5879699", "text": "function setupBuffers() {\r\n vertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffer);\r\n /*\r\n * Your code goes here\t\r\n * Edit the L shaped mesh definition below.\r\n * Make it into an I.\r\n * Don't forget to update the buffer parameters below,\r\n * if you change the number of elements.\r\n */\r\n var triangleVertices = [\r\n -0.90, 0.95, 0.0, //illini logo\r\n 0.88, 0.95, 0.0,\r\n 0.88, 0.64, 0.0,\r\n 0.88, 0.64, 0.0,\r\n\t\t -0.9, 0.64, 0.0,\r\n -0.90, 0.95, 0.0,\r\n\t\t \r\n 0.71, 0.64, 0.0,\r\n 0.71, -0.29, 0.0,\r\n 0.32, -0.29, 0.0,\r\n 0.32, -0.29, 0.0,\r\n 0.32, 0.65, 0.0,\r\n\t\t 0.71, 0.64, 0.0,\r\n\t\t \r\n 0.32, -0.04, 0.0,\r\n\t\t 0.18, -0.04, 0.0,\r\n 0.18, 0.38, 0.0,\r\n 0.18, 0.38, 0.0,\r\n\t\t 0.32, 0.38, 0.0,\r\n 0.32, -0.04, 0.0,\r\n\t\t \r\n -0.34, 0.65, 0.0,\r\n\t\t -0.34, -0.29, 0.0,\r\n\t\t -0.72, -0.29, 0.0,\r\n\t\t -0.72, -0.29, 0.0,\r\n\t\t -0.72, 0.64, 0.0,\r\n -0.34, 0.65, 0.0,\r\n\t\t \r\n\t\t -0.34, 0.38, 0.0,\r\n\t\t -0.2, 0.38, 0.0,\r\n\t\t -0.2, -0.04, 0.0,\r\n\t\t -0.2, -0.04, 0.0,\r\n\t\t -0.34, -0.04, 0.0,\r\n\t\t -0.34, 0.38, 0.0,\r\n\t\t \r\n\t\t -0.72, -0.37, 0.0,\r\n\t\t -0.72, -0.49, 0.0,\r\n\t\t -0.6, -0.56, 0.0,\r\n\t\t -0.6, -0.56, 0.0,\r\n\t\t -0.6, -0.37, 0.0,\r\n\t\t -0.72, -0.37, 0.0,\r\n\t\t \r\n\t\t -0.46, -0.37, 0.0,\r\n\t\t -0.46, -0.66, 0.0,\r\n\t\t -0.34, -0.72, 0.0,\r\n\t\t -0.34, -0.72, 0.0,\r\n\t\t -0.34, -0.37, 0.0,\r\n\t\t -0.46, -0.37, 0.0,\r\n\t\t \r\n\t\t -0.2, -0.37, 0.0,\r\n\t\t -0.2, -0.82, 0.0,\r\n\t\t -0.08, -0.88, 0.0,\r\n\t\t -0.08, -0.88, 0.0,\r\n\t\t -0.08, -0.37, 0.0,\r\n\t\t -0.2, -0.37, 0.0,\r\n\t\t \r\n\t\t 0.07, -0.37, 0.0,\r\n\t\t 0.07, -0.88, 0.0,\r\n\t\t 0.18, -0.82, 0.0,\r\n\t\t 0.18, -0.82, 0.0,\r\n\t\t 0.18, -0.37, 0.0,\r\n\t\t 0.07, -0.37, 0.0,\r\n\t\t \r\n\t\t 0.32, -0.37, 0.0,\r\n\t\t 0.32, -0.72, 0.0,\r\n\t\t 0.44, -0.66, 0.0,\r\n\t\t 0.44, -0.66, 0.0,\r\n\t\t 0.44, -0.37, 0.0,\r\n\t\t 0.32, -0.37, 0.0,\r\n\t\t \r\n\t\t 0.58, -0.37, 0.0,\r\n\t\t 0.58, -0.57, 0.0,\r\n\t\t 0.71, -0.49, 0.0,\r\n\t\t 0.71, -0.49, 0.0,\r\n\t\t 0.71, -0.37, 0.0,\r\n\t\t 0.58, -0.37, 0.0,\r\n\t\t \r\n\t\t 0.0, 1.0, 0.0, //A\r\n\t\t 1.0, -1.0, 0.0,\r\n\t\t 0.7, -1.0, 0.0,\r\n\t\t 0.7, -1.0, 0.0,\r\n\t\t 0.0, 0.7, 0.0,\r\n\t\t 0.0, 1.0, 0.0,\r\n\t\t \r\n\t\t 0.0, 1.0, 0.0,\r\n\t\t -1.0, -1.0, 0.0,\r\n\t\t -0.7, -1.0, 0.0,\r\n\t\t -0.7, -1.0, 0.0,\r\n\t\t 0.0, 0.7, 0.0,\r\n\t\t 0.0, 1.0, 0.0,\r\n\t\t \r\n\t\t -0.3, -0.029,0.0,\r\n\t\t 0.3, -0.029, 0.0,\r\n\t\t -0.4, -0.27, 0.0,\r\n\t\t -0.4, -0.27, 0.0,\r\n\t\t 0.4, -0.27, 0.0,\r\n\t\t 0.3, -0.029, 0.0\r\n ];\r\n \r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVertices), gl.STATIC_DRAW);\r\n vertexPositionBuffer.itemSize = 3;\r\n vertexPositionBuffer.numberOfItems = 78;\r\n \r\n vertexColorBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\r\n /*\r\n * Your code goes here\t\r\n * Change and edit the colors here.\r\n * Make sure to match the edits you made to the positions above.\r\n * Don't forget to update the buffer parameters below,\r\n * if you change the number of elements.\r\n */\r\n var colors = [\r\n\t\t0.0745, 0.1569, 0.294, 1.0, //\"illini blue\" parts\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t0.0745, 0.1569, 0.294, 1.0,\r\n\t\t\r\n\t\t0.9137, 0.2902, 0.215686, 1.0, //\"illini orange\" parts\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t0.9137, 0.2902, 0.215686, 1.0,\r\n\t\t\r\n\t\t1.0, 0.0, 0.0, 1.0, //red parts\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0,\r\n\t\t1.0, 0.0, 0.0, 1.0\r\n ];\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\r\n vertexColorBuffer.itemSize = 4;\r\n vertexColorBuffer.numItems = 78; \r\n}", "title": "" }, { "docid": "1d1f77047be0dbe30029287a05655423", "score": "0.5876011", "text": "function eval_control_mesh(type, degs,vecs){\n\tvar size;\n\tvar sizeu, sizev, bigstepu, bigstepv, degu, degv;\n\n\t// different for each type\n\tvar geo = new THREE.Geometry();\n\n\tif (type == 3) {\t// Triangular Bezier\n\t\tdeg = degs;\n\t\t\n\t\tsize = ( (deg+1)*(deg+2) )/2;\n\t\tfor (var i = 0; i < size; i++)\n\t\t\tgeo.vertices.push(new THREE.Vertex(vecs[i].clone()));\n\t\t\n\t\td = deg - 1;\n\n\t\tfor(i=0; i<=d;i++) {\n\t\t\tfor(j=0; j<=d-i;j++) {\n\t\t\t\tk = d-i-j;\n\t\t\t\tvar v1 = b2i_i(i+1,j,k,deg);\n\t\t\t\tvar v2 = b2i_i(i,j+1,k,deg);\n\t\t\t\tvar v3 = b2i_i(i,j,k+1,deg);\n\t\t\t\t\n\t\t\t\tgeo.faces.push(new THREE.Face3(v1,v2,v3));\n\t\t\t}\n\t\t}\n\t} \n\telse {\n\t\tdegu = degs[0];\n\t\tdegv = degs[1];\n\n\t\tsize = (degu+1)*(degv+1);\n\t\tfor(var i = 0; i < size; i++){\n\t\t\tif(type == 8) // rationize the vertice\n\t\t\t\tgeo.vertices.push(new THREE.Vertex(vecs[i].clone().divideScalar(vecs[i].w)));\n\t\t\telse\n\t\t\t\tgeo.vertices.push(new THREE.Vertex(vecs[i].clone()));\n\t\t}\n\n\t\tvar stepu = degu+1;\n\t\tfor(var i = 0; i < degu; i++){\n\t\t\tfor(var j = 0; j < degv; j++){\n\t\t\t\tvar v1 = i*stepu+j;\n\t\t\t\tvar v2 = (i+1)*stepu+j;\n\t\t\t\tvar v3 = (i+1)*stepu+j+1;\n\t\t\t\tvar v4 = i*stepu+j+1;\n\t\t\t\tgeo.faces.push(new THREE.Face4(v1,v2,v3,v4));\n\t\t\t\t// console.log(v1,v2,v3,v4);\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn geo;\n\n}", "title": "" }, { "docid": "55a680c29ff808b82d79031f0bab6185", "score": "0.58592945", "text": "function createMesh(geom) {\n\n geom.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, 0));\n\n // create a mesh material\n const meshMaterial = new THREE.MeshNormalMaterial({\n transparent: false,\n// opacity: 1.0\n });\n\n // create a mesh\n const mesh = THREE.SceneUtils.createMultiMaterialObject(geom, [meshMaterial]);\n\n return mesh;\n}", "title": "" }, { "docid": "c0ccafec01c8be4353c541252dbf2eec", "score": "0.58347565", "text": "function Triangle(sOne, sTwo, sThree) {\n\n if(!(this instanceof Triangle)){\n return new Triangle(sOne, sTwo, sThree);\n }\n\n this.type= \"Triangle\";\n\n this.sOne = sOne;\n this.sTwo = sTwo;\n this.sThree = sThree;\n \n }", "title": "" }, { "docid": "2f24549cee6967a0554028236dc05c9d", "score": "0.58328956", "text": "function Triangle(p0, p1, p2) {\n this.p0 = p0;\n this.p1 = p1;\n this.p2 = p2;\n this.edges = [\n new Edge(this.p0, this.p1),\n new Edge(this.p1, this.p2),\n new Edge(this.p2, this.p0)\n ];\n this.neighbors = {};\n this.id = tId++;\n}", "title": "" }, { "docid": "50b12dc68b563ecd55955029b0a9ba53", "score": "0.5832496", "text": "createPrimitiveMesh(name, definition) {\n const mesh = new __1.Mesh(this, {\n id: __1.newGuid(),\n name,\n mesh: {\n primitiveDefinition: definition\n }\n });\n mesh.setLoadedPromise(this.sendCreateAsset(mesh));\n return mesh;\n }", "title": "" }, { "docid": "6098883c52e7181a6092f64123075ff0", "score": "0.5824092", "text": "generateMesh() {\n \n this.geometry = new THREE.BoxBufferGeometry( this.size.x, this.size.y, this.size.z );\n this.material = new THREE.MeshLambertMaterial({ color: 0xffffff });\n }", "title": "" }, { "docid": "9646faf680ccd56354d35da55b21d493", "score": "0.58189356", "text": "function Triangle(a, b, c) {\n this.a = a\n this.b = b\n this.c = c\n this.type = 'triunghi'\n}", "title": "" }, { "docid": "32cb5cd64fdc307b73af74b32df8fe41", "score": "0.58166647", "text": "function InitTerrain() {\n\tnumVertices = (divisions + 1) * (divisions + 1);\n\tvertices = new Vector3[numVertices];\n\n\tvar UVs : Vector2[] = new Vector2[numVertices];\n\tvar triangles : int[] = new int[divisions * divisions * 6];\n\n\tvar halfTerrainSize : float = size / 2;\n\tvar divisionSize : float = size / divisions;\n\n\tvar mesh : Mesh = new Mesh();\n\tGetComponent.<MeshFilter>().mesh = mesh;\n\t//GetComponent.<MeshCollider>().sharedMesh = mesh;\n//\tGetComponent.<MeshCollider>().sharedMesh = meshCollider;\n\tGetComponent.<MeshCollider>().isTrigger = true;\n\n\tmeshObject = new GameObject(\"Terrain\");\n//\tmeshRenderer = meshObject.AddComponent<MeshRenderer>();\n//\tmeshFilter = meshObject.AddComponent<MeshFilter>();\n//\tmeshCollider = meshObject.AddComponent<MeshCollider>();\n\n\tvar triangleOffset : int = 0;\n\n\tfor (var i = 0; i <= divisions; i++) {\n\t\tfor (var j = 0; j <= divisions; j++) {\n\t\t\tvertices[i * (divisions+1) + j] = new Vector3(-halfTerrainSize + j * divisionSize, 0.0f, halfTerrainSize - i * divisionSize);\n\t\t\tUVs[i * (divisions+1) + j] = new Vector2(parseFloat(i / divisions), parseFloat(j / divisions));\n\n\t\t\tif (i < divisions && j < divisions) {\n\t\t\t\tvar topLeft : int = i * (divisions + 1) + j;\n\t\t\t\tvar bottomLeft : int = (i + 1) * (divisions + 1) + j;\n\n\t\t\t\t// First triangle of square\n\t\t\t\ttriangles[triangleOffset] = topLeft;\n\t\t\t\ttriangles[triangleOffset + 1] = topLeft + 1;\n\t\t\t\ttriangles[triangleOffset + 2] = bottomLeft + 1;\n\n // Second triangle of square\n\t\t\t\ttriangles[triangleOffset + 3] = topLeft;\n\t\t\t\ttriangles[triangleOffset + 4] = bottomLeft + 1;\n\t\t\t\ttriangles[triangleOffset + 5] = bottomLeft;\n\n\t\t\t\ttriangleOffset += 6;\n\t\t\t}\n\t\t}\n\t}\n\n\tinitDiamondSquareCornerVertices();\n\n\tperformDiamondSquare();\n\n\tmesh.vertices = vertices;\n\tmesh.uv = UVs;\n\tmesh.triangles = triangles;\n\n\tmesh.RecalculateBounds();\n\tmesh.RecalculateNormals();\n\n\t//meshCollider.sharedMesh = mesh;\n\n\n//\ttextureData.UpdateMeshHeights (terrainMaterial, terrainData.minHeight, terrainData.maxHeight);\n\n}", "title": "" }, { "docid": "dbb7a4f36c4133040d8984dda1207b01", "score": "0.58158755", "text": "function buildLeafGeometry_v2(){\n\n var leafShape = new THREE.Shape();\n leafShape.moveTo(0,0);\n\n leafShape.bezierCurveTo( 0, 0, 0.05, 0.25, 0.02, 0.65);\n leafShape.bezierCurveTo( 0.02, 0.65, 1, 0, 0, 1.5);\n leafShape.bezierCurveTo( 0, 1.5, -1, 0, -0.02, 0.65 );\n leafShape.bezierCurveTo( -0.02, 0.65, -0.02, 0.25, 0, 0);\n\n\n let leafGeometry = new THREE.ShapeGeometry(leafShape);\n\n return leafGeometry;\n}", "title": "" }, { "docid": "29d1a3de8a010eb7d9c69255f5d444e8", "score": "0.581446", "text": "function createNew()\n{\n randomDistance = getRandomIntInclusive(2.0, 5.0);\n\n randomSize = (getRandomIntInclusive(1.0, 10.0)/10.0);\n\n randomColor1 = colorPalette[getRandomIntInclusive(0.0, 8.0)];\n\n randomColor2 = colorPalette[getRandomIntInclusive(0.0, 8.0)];\n\n randomColor3 = colorPalette[getRandomIntInclusive(0.0, 8.0)];\n\n return tetrahedron(va, vb, vc, vd, numTimesToSubdivide, randomColor1, randomColor2, randomColor3, 3.0);\n\n}", "title": "" }, { "docid": "a8df4734ba277357e11ef6c9e2c1ffa4", "score": "0.5814227", "text": "function Triangle(p0, p1, p2) {\n var vec0 = CSG.V(p0);\n var vec1 = CSG.V(p1);\n var vec2 = CSG.V(p2);\n\n this.plane = CSG.Plane.fromPoints(vec0, vec1, vec2);\n\n var vert0 = new CSG.Vertex(vec0, this.plane.normal);\n var vert1 = new CSG.Vertex(vec1, this.plane.normal);\n var vert2 = new CSG.Vertex(vec2, this.plane.normal);\n\n this.vertices = [vert0, vert1, vert2];\n this.shared = null;\n}", "title": "" }, { "docid": "6aa29fa80c089ab04aec08387577e5d3", "score": "0.5802455", "text": "function generateGeometry(triangles)\r\n\t{\r\n\t\tvar uvs = [];\r\n\t\tvar vertices = [];\r\n\t\tvar normals = [];\r\n\t\tvar faces = [];\r\n\r\n\t\tfunction addVector(vector)\r\n\t\t{\r\n\t\t\tvar scale = image.naturalWidth;\r\n\r\n\t\t\tif(self\t.mode === ImageGeometry.VERTICAL)\r\n\t\t\t{\r\n\t\t\t\tvertices.push(vector.y / scale, vector.x / scale, vector.z / scale);\r\n\t\t\t\tuvs.push(vector.y / image.naturalHeight, vector.x / image.naturalWidth);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvertices.push(vector.x / scale, (image.naturalHeight - vector.y) / scale, vector.z / scale);\r\n\t\t\t\tuvs.push(vector.x / image.naturalWidth, (image.naturalHeight - vector.y) / image.naturalHeight);\r\n\t\t\t}\r\n\t\t\tnormals.push(0, -1, 0);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < triangles.length; i++)\r\n\t\t{\r\n\t\t\taddVector(triangles[i].a);\r\n\t\t\taddVector(triangles[i].b);\r\n\t\t\taddVector(triangles[i].c);\r\n\t\t}\r\n\r\n\t\tself.addAttribute(\"position\", new THREE.Float32BufferAttribute(vertices, 3));\r\n\t\tself.addAttribute(\"normal\", new THREE.Float32BufferAttribute(normals, 3));\r\n\t\tself.addAttribute(\"uv\", new THREE.Float32BufferAttribute(uvs, 2));\r\n\t}", "title": "" }, { "docid": "c7a22f5fdc93d17d476f6d9a0fbcc892", "score": "0.5789376", "text": "function Triangle (side1, side2, side3){\n\n\t// if the user forgets to add keyword \"new\"\n\t// adds the \"new\" keyword\n\tif ( !(this instanceof Triangle) ) {\n\n\t\treturn new Triangle(side1, side2, side3);\n\t\n\t}\n\n\t//assigns the input argument as properties of an object\n\tthis.side1 = side1;\n\tthis.side2 = side2;\n\tthis.side3 = side3;\n\tthis.type = \"Triangle\";\n\t\n}", "title": "" }, { "docid": "b74d1e3b364ac0f733a2c305f77b1c60", "score": "0.5787534", "text": "function initTriangleVertice() {\n\n\t// the 3 points of the triangle\n\tvar vertex = [-0.5, 0.5, 0.0, 0.5, 0.5, 0.0, 0.0, -0.5, 0.0];\n\n\t// create a buffer then bind it (create memory in the webgl context)\n\tvar vertexBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n\n\t// then fill the buffer with the vertex array\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertex), gl.STATIC_DRAW);\n\n\t// return the created buffer\n\treturn vertexBuffer;\n}", "title": "" }, { "docid": "51e28817d4d4f9c3a24e08c94827eb97", "score": "0.57763016", "text": "function Tri() {\n Triangle.apply( this, arguments );\n this.target = {vec: null, t: 0};\n this.vertices = [\"p0\",\"p1\",\"p2\"];\n this.colorId = 1 + (colorToggle % 3);\n}", "title": "" }, { "docid": "093b9c5ad282e272bbab10fccf633b73", "score": "0.5773286", "text": "function createTrianglePM(vertices, colors, normals, colorChoice, x1, y1, z1, x2, y2, z2, x3, y3, z3) {\n vertices.push(x1, y1, z1, x2, y2, z2, x3, y3, z3);\n [].push.apply(colors, colorChoice);\n const normal = calcNormal(x1, y1, z1, x2, y2, z2, x3, y3, z3);\n normals.push(normal[0], normal[1], normal[2], normal[0], normal[1], normal[2], normal[0], normal[1], normal[2]);\n}", "title": "" }, { "docid": "6f705063c0f38381d882c71a86f88a3d", "score": "0.57619596", "text": "function Triangle (side1, side2, side3){\n\t//if this fucntion is called with out the word new then it will force the fucntion to be called with the word new\n\tif (!(this instanceof Triangle)) {\n\treturn new Triangle (side1, side2, side3);\n\t}\n\n\tthis.side1 = side1;\n\tthis.side2 = side2;\n\tthis.side3 = side3;\n\tthis.type = 'Triangle';\n\n\n}", "title": "" }, { "docid": "d3f3b8d0d655c8983021ac2347472b3f", "score": "0.57539606", "text": "function createFinger() { return new THREE.Mesh(fingerGeometry, material); }", "title": "" }, { "docid": "fca2d2add5647c91a67002907665efd3", "score": "0.5737924", "text": "function triangle(v1, v2, v3) {\n\tconst normal = normalize(cross(sub(v1, v3), sub(v2, v3)));\n\t// Note (Peter) use better rng source or deterministic ids in the future\n\tconst id = Math.floor(Math.random() * 100000000);\n\treturn {\n\t\tid,\n\t\tv1: v1,\n\t\tv2: v2,\n\t\tv3: v3,\n\t\tnormal,\n\t\tedges: [{\n\t\t\tanchor: v2,\n\t\t\ttestPoint: v3,\n\t\t\tv: normalize(sub(v1, v2)),\n\t\t\tlen: len(sub(v1, v2)),\n\t\t\tn: normalize(cross(sub(v1, v2), normal)),\n\t\t}, {\n\t\t\tanchor: v3,\n\t\t\ttestPoint: v1,\n\t\t\tv: normalize(sub(v2, v3)),\n\t\t\tlen: len(sub(v2, v3)),\n\t\t\tn: normalize(cross(sub(v2, v3), normal)),\n\t\t}, {\n\t\t\tanchor: v1,\n\t\t\ttestPoint: v2,\n\t\t\tv: normalize(sub(v3, v1)),\n\t\t\tlen: len(sub(v3, v1)),\n\t\t\tn: normalize(cross(sub(v3, v1), normal)),\n\t\t}]\n\t}\n}", "title": "" }, { "docid": "c50e0a0f022aeb574b2eb2953124135b", "score": "0.57370824", "text": "function init() {\n \n //Fill the arrays\n for (var r = 0; r < n; r++)\n for (var c = 0; c < n; c++){\n var x = ((2 * c) / (n - 1)) - 1;\n var z = ((2 * r) / (n - 1)) - 1;\n var y = 1 - (x * x) - (z * z);\n \n vertices[(r * n + c) * 3] = x; // x\n vertices[(r * n + c) * 3 + 1] = y; // y\n vertices[(r * n + c) * 3 + 2] = z; // z\n }\n for (var r = 0; r < (n - 1); r++)\n for (var c = 0; c < (n - 1); c++){\n var izero = (r + 0) * n + (c + 0);\n var ione = (r + 1) * n + (c + 0);\n var itwo = (r + 0) * n + (c + 1);\n var ithree = (r + 1) * n + (c + 1);\n \n triangles [(r * (n-1) + c) * 6 ] = izero; //i0\n triangles [(r * (n-1) + c) * 6 + 1] = ione; //i1\n triangles [(r * (n-1) + c) * 6 + 2] = itwo; //i2\n triangles [(r * (n-1) + c) * 6 + 3] = itwo; //i3\n triangles [(r * (n-1) + c) * 6 + 4] = ione; //i4\n triangles [(r * (n-1) + c) * 6 + 5] = ithree; //i5\n }\n \n for (var r = 0; r < n; r++)\n for (var c = 0; c < (n - 1); c++){\n rowLines[(r * n + c) * 2] = (r + 0) * n + (c + 0); //i0\n rowLines[(r * n + c) * 2 + 1] = (r + 0) * n + (c + 1); //i2\n }\n \n for (var r = 0; r < (n - 1); r++)\n for (var c = 0; c < n; c++){\n columnLines[(r * n + c) * 2] = (r + 0) * n + (c + 0); //i0\n columnLines[(r * n + c) * 2 + 1] = (r + 1) * n + (c + 0); //i1\n }\n \n \n // Initialize the WebGL context.\n canvas = document.getElementById('webgl');\n gl = getWebGLContext(canvas, false);\n \n // Initialize the program object and its uniforms.\n initShaders(gl, vertex_shader_source, fragment_shader_source);\n \n // Initialize vertex and index buffer objects.\n vertexBuffer = gl.createBuffer();\n trianglesBuffer = gl.createBuffer();\n rowLinesBuffer = gl.createBuffer();\n columnLinesBuffer = gl.createBuffer();\n \n LightLocation = gl.getUniformLocation(gl.program, 'light');\n \n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n \n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, rowLinesBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, rowLines, gl.STATIC_DRAW);\n \n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, columnLinesBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, columnLines, gl.STATIC_DRAW);\n \n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, trianglesBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, triangles, gl.STATIC_DRAW);\n \n \n // Link the shader attributes to the vertex buffer object.\n var vPositionLocation = gl.getAttribLocation(gl.program, 'vPosition');\n \n gl.vertexAttribPointer(vPositionLocation, 3, gl.FLOAT, false, 0, 0);\n \n gl.enableVertexAttribArray(vPositionLocation);\n \n // Set up to render.\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n \n rotateY = 0;\n rotateX = 0;\n \n draw();\n}", "title": "" }, { "docid": "7c83b0ef4b26edef3577a866380e93b3", "score": "0.5723954", "text": "function generateTriangle() {\n\t\tconsole.log(\"Generate Points\");\n\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\tvar point = {\n\t\t\t\tid: letters[i],\n\t\t\t\tx: getRandomInt(-X_MAX, X_MAX),\n\t\t\t\ty: getRandomInt(-Y_MAX, Y_MAX),\n\t\t\t\ttype: VERTEX,\n\t\t\t}\n\n\t\t\ttrianglePoints.push(point)\n\t\t}\n\n\t\ttriangleLines.push({\n\t\t\tid: \"A-B\",\n\t\t\ta: trianglePoints[0],\n\t\t\tb: trianglePoints[1]\n\t\t})\n\n\t\ttriangleLines.push({\n\t\t\tid: \"B-C\",\n\t\t\ta: trianglePoints[1],\n\t\t\tb: trianglePoints[2]\n\t\t})\n\n\t\ttriangleLines.push({\n\t\t\tid: \"A-C\",\n\t\t\ta: trianglePoints[0],\n\t\t\tb: trianglePoints[2]\n\t\t})\n\t\tconsole.log(\"Points: \", trianglePoints)\n\t\tconsole.log(\"Points: \", triangleLines)\n\n\t\tcalculateLineProperties();\n\n\t}", "title": "" }, { "docid": "1ebe90df93e91c8d87d00b7eae6aae25", "score": "0.5721975", "text": "function recomputeMeshGeometry (){\n\tvar letterData = getIMeshVerts(\n\t\t\toptions.width,\n\t\t\toptions.height,\n\t\t\toptions.trunkWidth,\n\t\t\toptions.trunkHeight,\n\t\t\t-options.extrusion / 2,\n\t\t\toptions.extrusion / 2);\n\tvar subdata = letterData;\n\tfor (var i=0; i<options.subdivide; i++){\n\t\tsubdata = subdivide(subdata);\n\t}\n\tvar data = getTrianglesFromQuads(subdata);\n\tvar normals = getNormalsFromTriangles(data);\n\tif (options['random normals']){\n\t\tnormals = normals.map(function (el){\n\t\t\treturn (Math.random()-0.5)*0.3+0.7*el\n\t\t});\n\t}\n\n\t// Change the value of the global meshData variable.\n\tmeshData = {\n\t\tvertices: data,\n\t\tnormals: normals\n\t}\n\n\t// Reset buffers.\n\tinitBuffers();\n}", "title": "" }, { "docid": "d50d812bc2a555fd3f90ab2ebad8429e", "score": "0.5715542", "text": "generateTriangles()\r\n{\r\n var deltaX = (this.maxX - this.minX) / this.div;\r\n var deltaY = (this.maxY - this.minY) / this.div;\r\n for (var j = 0; j <= this.div; j++) {\r\n for (var i = 0; i <= this.div; i++) {\r\n // vertex\r\n this.vBuffer.push(this.minX + deltaX * i);\r\n this.vBuffer.push(this.minY + deltaY * j);\r\n this.vBuffer.push(0);\r\n //this.vBuffer.push(j / this.div);\r\n //var curr_index = j * (this.div+1) + i;\r\n //this.vBuffer.push(heightMap[curr_index]);\r\n //console.log(heightMap[curr_index]);\r\n\r\n // normals\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(1);\r\n }\r\n }\r\n\r\n for (var i = 0; i < this.div; i++) {\r\n for (var j = 0; j < this.div; j++) {\r\n var vid = i*(this.div+1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+1+this.div+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n }\r\n }\r\n //\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n}", "title": "" }, { "docid": "6aab613100de253248f17bbe11d8adf8", "score": "0.56726086", "text": "MakeModel () {\n\t\t\tthis.mesh = [\n\t\t\t\t// Front\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\n\t\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\n\t\t\t\t// Right\n\t\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\n\t\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\n\t\t\t\t// Back\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\n\t\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\n\t\t\t\t// Left\n\t\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\n\t\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\n\t\t\t\t// Bottom\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\t\t\tthis.from.x*(1/2), this.from.y, this.from.z*(1/2),\n\t\t\t\tthis.to.x*(1/2), this.from.y, this.to.z*(1/2),\n\t\n\t\t\t\t// Top\n\t\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\n\t\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\t\tthis.to.x, this.to.y, this.to.z\n\t\t\t]\n\t\n\t\t\tfor (let i = 0; Math.floor(i/6) < 6; i++) {\n\t\n\t\t\t\tthis.colors = this.colors.concat(Object.values(this.sideColors)[Math.floor(i/6)]);\n\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1cbdfa4d7699f75cb04ab8cea2976dce", "score": "0.5669075", "text": "_update() {\n let { _triangles, _halfedges, _vertex_r, _vertex_t } = this;\n this.numSides = _triangles.length;\n this.numRegions = _vertex_r.length;\n this.numSolidRegions = this.numRegions - 1; // TODO: only if there are ghosts\n this.numTriangles = this.numSides / 3;\n this.numSolidTriangles = this.numSolidSides / 3;\n if (this._vertex_t.length < this.numTriangles) {\n // Extend this array to be big enough\n const numOldTriangles = _vertex_t.length;\n const numNewTriangles = this.numTriangles - numOldTriangles;\n _vertex_t = _vertex_t.concat(new Array(numNewTriangles));\n for (let t = numOldTriangles; t < this.numTriangles; t++) {\n _vertex_t[t] = [0, 0];\n }\n this._vertex_t = _vertex_t;\n }\n // Construct an index for finding sides connected to a region\n this._s_of_r = new Int32Array(this.numRegions);\n for (let s = 0; s < _triangles.length; s++) {\n let endpoint = _triangles[TriangleMesh.s_next_s(s)];\n if (this._s_of_r[endpoint] === 0 || _halfedges[s] === -1) {\n this._s_of_r[endpoint] = s;\n }\n }\n // Construct triangle coordinates\n for (let s = 0; s < _triangles.length; s += 3) {\n let t = s / 3, a = _vertex_r[_triangles[s]], b = _vertex_r[_triangles[s + 1]], c = _vertex_r[_triangles[s + 2]];\n if (this.is_ghost_s(s)) {\n // ghost triangle center is just outside the unpaired side\n let dx = b[0] - a[0], dy = b[1] - a[1];\n let scale = 10 / Math.sqrt(dx * dx + dy * dy); // go 10units away from side\n _vertex_t[t][0] = 0.5 * (a[0] + b[0]) + dy * scale;\n _vertex_t[t][1] = 0.5 * (a[1] + b[1]) - dx * scale;\n }\n else {\n // solid triangle center is at the centroid\n _vertex_t[t][0] = (a[0] + b[0] + c[0]) / 3;\n _vertex_t[t][1] = (a[1] + b[1] + c[1]) / 3;\n }\n }\n }", "title": "" }, { "docid": "4d1140819768ce24b16728992b01abbe", "score": "0.56667924", "text": "MakeModel () {\n\t\tthis.mesh = [\n\t\t\t// Front\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Right\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Back\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Left\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\t// Bottom\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Top\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z\n\t\t]\n\n\t\tfor (let i = 0; Math.floor(i/6) < 6; i++) {\n\n\t\t\tthis.colors = this.colors.concat(Object.values(this.sideColors)[Math.floor(i/6)]);\n\n\t\t}\n\t}", "title": "" }, { "docid": "512940a74fdef3b0616ed28d03694999", "score": "0.56667924", "text": "MakeModel () {\n\t\tthis.mesh = [\n\t\t\t// Front\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Right\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Back\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Left\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\t// Bottom\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Top\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z\n\t\t]\n\n\t\tthis.normals = [\n\t\t\t// Front\n\t\t\t0.0, 0.0, 1.0,\n\t\t\t0.0, 0.0, 1.0,\n\t\t\t0.0, 0.0, 1.0,\n\n\t\t\t0.0, 0.0, 1.0,\n\t\t\t0.0, 0.0, 1.0,\n\t\t\t0.0, 0.0, 1.0,\n\n\t\t\t// Right\n\t\t\t1.0, 0.0, 0.0,\n\t\t\t1.0, 0.0, 0.0,\n\t\t\t1.0, 0.0, 0.0,\n\t\t\t\n\t\t\t1.0, 0.0, 0.0,\n\t\t\t1.0, 0.0, 0.0,\n\t\t\t1.0, 0.0, 0.0,\n\n\t\t\t// Back\n\t\t\t0.0, 0.0, -1.0,\n\t\t\t0.0, 0.0, -1.0,\n\t\t\t0.0, 0.0, -1.0,\n\n\t\t\t0.0, 0.0, -1.0,\n\t\t\t0.0, 0.0, -1.0,\n\t\t\t0.0, 0.0, -1.0,\n\n\t\t\t// Left\n\t\t\t-1.0, 0.0, 0.0,\n\t\t\t-1.0, 0.0, 0.0,\n\t\t\t-1.0, 0.0, 0.0,\n\n\t\t\t-1.0, 0.0, 0.0,\n\t\t\t-1.0, 0.0, 0.0,\n\t\t\t-1.0, 0.0, 0.0,\n\n\t\t\t// Bottom\n\t\t\t0.0, -1.0, 0.0,\n\t\t\t0.0, -1.0, 0.0,\n\t\t\t0.0, -1.0, 0.0,\n\n\t\t\t0.0, -1.0, 0.0,\n\t\t\t0.0, -1.0, 0.0,\n\t\t\t0.0, -1.0, 0.0,\n\n\t\t\t// Top\n\t\t\t0.0, 1.0, 0.0,\n\t\t\t0.0, 1.0, 0.0,\n\t\t\t0.0, 1.0, 0.0,\n\n\t\t\t0.0, 1.0, 0.0,\n\t\t\t0.0, 1.0, 0.0,\n\t\t\t0.0, 1.0, 0.0\n\t\t];\n\n\t\tthis.textureCoordinates = [\n\t\t\t// Front\n\t\t\t1.0, 0.0,\n\t\t\t0.0, 0.0,\n\t\t\t1.0, 1.0,\n\n\t\t\t0.0, 1.0,\n\t\t\t1.0, 1.0,\n\t\t\t0.0, 0.0,\n\n\t\t\t// Right\n\t\t\t1.0, 1.0,\n\t\t\t1.0, 0.0,\n\t\t\t0.0, 0.0,\n\n\t\t\t0.0, 1.0,\n\t\t\t1.0, 1.0,\n\t\t\t0.0, 0.0,\n\n\t\t\t// Back\n\t\t\t0.0, 0.0,\n\t\t\t1.0, 0.0,\n\t\t\t0.0, 1.0,\n\n\t\t\t1.0, 1.0,\n\t\t\t0.0, 1.0,\n\t\t\t1.0, 0.0,\n\n\t\t\t// Left\n\t\t\t0.0, 1.0,\n\t\t\t0.0, 0.0,\n\t\t\t1.0, 0.0,\n\n\t\t\t1.0, 1.0,\n\t\t\t0.0, 1.0,\n\t\t\t1.0, 0.0,\n\n\t\t\t// Bottom\n\t\t\t0.0, 1.0,\n\t\t\t0.0, 0.0,\n\t\t\t1.0, 1.0,\n\n\t\t\t1.0, 0.0,\n\t\t\t0.0, 0.0,\n\t\t\t1.0, 1.0,\n\n\t\t\t// Top\n\t\t\t0.0, 1.0,\n\t\t\t0.0, 0.0,\n\t\t\t1.0, 1.0,\n\n\t\t\t1.0, 0.0,\n\t\t\t0.0, 0.0,\n\t\t\t1.0, 1.0\n\t\t];\n\t}", "title": "" }, { "docid": "b034cf3f2b0f3bceb7d0fb95b783e319", "score": "0.5660617", "text": "function Triangle(vertices, colors){\n\treturn new Cone(null,null,2, vertices, colors);\n}", "title": "" }, { "docid": "e07369697f0e294a4e17e084cf99ae3e", "score": "0.5657816", "text": "function triangle(a, b, c) {\n\n var t1 = subtract(b, a);\n var t2 = subtract(c, a);\n var normal = normalize(cross(t1, t2));\n normal = vec4(normal);\n\n normalsArray.push(normal);\n normalsArray.push(normal);\n normalsArray.push(normal);\n \n pointsArray.push(a);\n pointsArray.push(b); \n pointsArray.push(c);\n\n index += 3;\n}", "title": "" }, { "docid": "b1c83ffcca68d005d1532ea24e2cb674", "score": "0.56483376", "text": "function addTriangle() {\n\t\tlet size = document.getElementById('triangleH').value;\n\t\tlet xValue = randomValue(0, 600-size);\n\t\tlet yValue = randomValue(0, 600-size);\n\t\tlet newTriangle = new Triangle(xValue, yValue, size);\n\t}", "title": "" }, { "docid": "fdf2f179eb4c442a93d7645e4b712d85", "score": "0.56481624", "text": "function mesh(n) {\n var a = new Float32Array(2*(2*(n*(n+1)) + 2*(n-1) ));\n var i, j, len = 0;\n var delta = 2.0 / n + 0.000000000000001;\n\n var x, y = -1.0;\n for (j = 0; j < n; j++, y+=delta) {\n if (j > 0) {\n /* Degenerate triangles */\n a[len++] = 1.0; // x value\n a[len++] = y; // y value\n a[len++] = -1.0; // x value\n a[len++] = y; // y value\n }\n\n for (i = 0, x = -1.0; i <= n; i++, x+=delta) {\n a[len++] = x; // x value\n a[len++] = y; // y value\n a[len++] = x; // x value\n a[len++] = y+delta; // y value\n }\n }\n return a;\n}", "title": "" }, { "docid": "60dd6b49d28c90a818743a83555c7896", "score": "0.564748", "text": "function buildTriangle(length) {\r\n var triangle = \"\";\r\n for (var i = 1; i <= length; i++) {\r\n triangle += makeLine(i);\r\n }\r\n return triangle;\r\n}", "title": "" }, { "docid": "d4648f4c7e06039976b96ecaf91f64b5", "score": "0.5645321", "text": "MakeModel () {\n\t\tthis.mesh = [\n\t\t\t// Front\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Right\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Back\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Left \n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\t// Bottom\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Top\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z\n\t\t]\n\n\t\tfor (let i = 0; Math.floor(i/6) < 6; i++) {\n\n\t\t\tthis.colors = this.colors.concat(Object.values(this.sideColors)[Math.floor(i/6)]);\n\n\t\t}\n\t}", "title": "" }, { "docid": "d4648f4c7e06039976b96ecaf91f64b5", "score": "0.5645321", "text": "MakeModel () {\n\t\tthis.mesh = [\n\t\t\t// Front\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Right\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Back\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Left \n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\t// Bottom\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Top\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z\n\t\t]\n\n\t\tfor (let i = 0; Math.floor(i/6) < 6; i++) {\n\n\t\t\tthis.colors = this.colors.concat(Object.values(this.sideColors)[Math.floor(i/6)]);\n\n\t\t}\n\t}", "title": "" }, { "docid": "d4648f4c7e06039976b96ecaf91f64b5", "score": "0.5645321", "text": "MakeModel () {\n\t\tthis.mesh = [\n\t\t\t// Front\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Right\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Back\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\n\t\t\t// Left \n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\n\t\t\t// Bottom\n\t\t\tthis.from.x, this.from.y, this.to.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\tthis.to.x, this.from.y, this.from.z,\n\t\t\tthis.from.x, this.from.y, this.from.z,\n\t\t\tthis.to.x, this.from.y, this.to.z,\n\n\t\t\t// Top\n\t\t\tthis.from.x, this.to.y, this.to.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z,\n\n\t\t\tthis.to.x, this.to.y, this.from.z,\n\t\t\tthis.from.x, this.to.y, this.from.z,\n\t\t\tthis.to.x, this.to.y, this.to.z\n\t\t]\n\n\t\tfor (let i = 0; Math.floor(i/6) < 6; i++) {\n\n\t\t\tthis.colors = this.colors.concat(Object.values(this.sideColors)[Math.floor(i/6)]);\n\n\t\t}\n\t}", "title": "" }, { "docid": "88a75d729e873330557b84aacefe8a3c", "score": "0.5642757", "text": "function cubeGeometry() {\r\n const vertices = [\r\n // Front face: white \r\n -1.0, -1.0, 1.0, /* */ 1.0, 1.0, 1.0, /* */ 0.0, 0.0, 1.0, /* */ 0.0, 0.0, /* */ 1, 0, 0,\r\n +1.0, -1.0, 1.0, /* */ 1.0, 1.0, 1.0, /* */ 0.0, 0.0, 1.0, /* */ 1.0, 0.0, /* */ 1, 0, 0,\r\n +1.0, +1.0, 1.0, /* */ 1.0, 1.0, 1.0, /* */ 0.0, 0.0, 1.0, /* */ 1.0, 1.0, /* */ 1, 0, 0,\r\n -1.0, +1.0, 1.0, /* */ 1.0, 1.0, 1.0, /* */ 0.0, 0.0, 1.0, /* */ 0.0, 1.0, /* */ 1, 0, 0,\r\n\r\n // Back face: red\r\n -1.0, -1.0, -1.0, /* */ 1.0, 0.0, 0.0, /* */ 0.0, 0.0, -1.0, /* */ 1.0, 0.0, /* */ -1, 0, 0,\r\n -1.0, +1.0, -1.0, /* */ 1.0, 0.0, 0.0, /* */ 0.0, 0.0, -1.0, /* */ 1.0, 1.0, /* */ -1, 0, 0,\r\n +1.0, +1.0, -1.0, /* */ 1.0, 0.0, 0.0, /* */ 0.0, 0.0, -1.0, /* */ 0.0, 1.0, /* */ -1, 0, 0,\r\n +1.0, -1.0, -1.0, /* */ 1.0, 0.0, 0.0, /* */ 0.0, 0.0, -1.0, /* */ 0.0, 0.0, /* */ -1, 0, 0,\r\n\r\n // Top face: green\r\n -1.0, 1.0, -1.0, /* */ 1.0, 0.0, 0.0, /* */ 0.0, 1.0, 0.0, /* */ 0.0, 1.0, /* */ 1, 0, 0,\r\n -1.0, 1.0, +1.0, /* */ 0.0, 1.0, 0.0, /* */ 0.0, 1.0, 0.0, /* */ 0.0, 0.0, /* */ 1, 0, 0,\r\n +1.0, 1.0, +1.0, /* */ 0.0, 0.0, 1.0, /* */ 0.0, 1.0, 0.0, /* */ 1.0, 0.0, /* */ 1, 0, 0,\r\n +1.0, 1.0, -1.0, /* */ 0.0, 0.0, 0.0, /* */ 0.0, 1.0, 0.0, /* */ 1.0, 1.0, /* */ 1, 0, 0,\r\n\r\n // Bottom face: blue\r\n -1.0, -1.0, -1.0, /* */ 0.0, 0.0, 1.0, /* */ 0.0, -1.0, 0.0, /* */ 0.0, 0.0, /* */ 1, 0, 0,\r\n +1.0, -1.0, -1.0, /* */ 0.0, 0.0, 1.0, /* */ 0.0, -1.0, 0.0, /* */ 1.0, 0.0, /* */ 1, 0, 0,\r\n +1.0, -1.0, +1.0, /* */ 0.0, 0.0, 1.0, /* */ 0.0, -1.0, 0.0, /* */ 1.0, 1.0, /* */ 1, 0, 0,\r\n -1.0, -1.0, +1.0, /* */ 0.0, 0.0, 1.0, /* */ 0.0, -1.0, 0.0, /* */ 0.0, 1.0, /* */ 1, 0, 0,\r\n\r\n // Right face: yellow\r\n 1.0, -1.0, -1.0, /* */ 1.0, 1.0, 0.0, /* */ 1.0, 0.0, 0.0, /* */ 1.0, 0.0, /* */ 0, 0, -1,\r\n 1.0, +1.0, -1.0, /* */ 1.0, 1.0, 0.0, /* */ 1.0, 0.0, 0.0, /* */ 1.0, 1.0, /* */ 0, 0, -1,\r\n 1.0, +1.0, +1.0, /* */ 1.0, 1.0, 0.0, /* */ 1.0, 0.0, 0.0, /* */ 0.0, 1.0, /* */ 0, 0, -1,\r\n 1.0, -1.0, +1.0, /* */ 1.0, 1.0, 0.0, /* */ 1.0, 0.0, 0.0, /* */ 0.0, 0.0, /* */ 0, 0, -1,\r\n\r\n // Left face: purple\r\n -1.0, -1.0, -1.0, /* */ 1.0, 0.0, 1.0, /* */ -1.0, 0.0, 0.0, /* */ 0.0, 0.0, /* */ 0, 0, 1,\r\n -1.0, -1.0, +1.0, /* */ 1.0, 0.0, 1.0, /* */ -1.0, 0.0, 0.0, /* */ 1.0, 0.0, /* */ 0, 0, 1,\r\n -1.0, +1.0, +1.0, /* */ 1.0, 0.0, 1.0, /* */ -1.0, 0.0, 0.0, /* */ 1.0, 1.0, /* */ 0, 0, 1,\r\n -1.0, +1.0, -1.0, /* */ 1.0, 0.0, 1.0, /* */ -1.0, 0.0, 0.0, /* */ 0.0, 1.0, /* */ 0, 0, 1\r\n ];\r\n\r\n const indices = [\r\n 0, 1, 2, 0, 2, 3, // front\r\n 4, 5, 6, 4, 6, 7, // back\r\n 8, 9, 10, 8, 10, 11, // top\r\n 12, 13, 14, 12, 14, 15, // bottom\r\n 16, 17, 18, 16, 18, 19, // right\r\n 20, 21, 22, 20, 22, 23, // left\r\n ];\r\n\r\n let vv = [], tt = [], nn = [], bb = [];\r\n for (let i = 0; i < vertices.length; i += 14) {\r\n vv.push([vertices[i], vertices[i + 1], vertices[i + 2]]);\r\n tt.push([vertices[i + 11], vertices[i + 12], vertices[i + 13]]);\r\n nn.push([vertices[i + 6], vertices[i + 7], vertices[i + 8]]);\r\n bb.push(cross([vertices[i + 11], vertices[i + 12], vertices[i + 13]], [vertices[i + 6], vertices[i + 7], vertices[i + 8]]));\r\n }\r\n const frames = tangentFrameGeometry(vv, tt, bb, nn);\r\n\r\n const edges = getEdges(indices);\r\n const stride = 14 * Float32Array.BYTES_PER_ELEMENT;\r\n return { vertices, indices, edges, frames, stride, hasTangents: true };\r\n}", "title": "" }, { "docid": "28776b2a7f16f62cb4102da4e746b543", "score": "0.56319094", "text": "constructor ({numBoundaryRegions, numSolidSides, _r_vertex, _triangles, _halfedges}) {\n Object.assign(this, {numBoundaryRegions, numSolidSides,\n _r_vertex, _triangles, _halfedges});\n\n this.numSides = _triangles.length;\n this.numRegions = _r_vertex.length;\n this.numSolidRegions = this.numRegions - 1;\n this.numTriangles = this.numSides / 3;\n this.numSolidTriangles = this.numSolidSides / 3;\n \n // Construct an index for finding sides connected to a region\n this._r_any_s = new Int32Array(this.numRegions);\n for (let s = 0; s < _triangles.length; s++) {\n this._r_any_s[_triangles[s]] = this._r_any_s[_triangles[s]] || s;\n }\n\n // Construct triangle coordinates\n this._t_vertex = new Array(this.numTriangles);\n for (let s = 0; s < _triangles.length; s += 3) {\n let a = _r_vertex[_triangles[s]],\n b = _r_vertex[_triangles[s+1]],\n c = _r_vertex[_triangles[s+2]];\n if (this.s_ghost(s)) {\n // ghost triangle center is just outside the unpaired side\n let dx = b[0]-a[0], dy = b[1]-a[1];\n this._t_vertex[s/3] = [a[0] + 0.5*(dx+dy), a[1] + 0.5*(dy-dx)];\n } else {\n // solid triangle center is at the centroid\n this._t_vertex[s/3] = [(a[0] + b[0] + c[0])/3,\n (a[1] + b[1] + c[1])/3];\n }\n }\n }", "title": "" }, { "docid": "0beb64e6c87ffc0447380ffb3fcd4f4d", "score": "0.56308645", "text": "makeVertexTemplate(style, mesh) {\n let i = 0;\n\n // a_position.xyz - vertex position\n // a_position.w - layer order\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = style.z || 0;\n this.vertex_template[i++] = this.scaleOrder(style.order);\n\n // a_extrude.xy - extrusion vector\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n\n // a_offset.xy - normal vector\n // offset can be static or dynamic depending on style\n if (mesh.variant.offset) {\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n }\n\n // a_scaling.xy - scaling to previous and next zoom\n this.vertex_template[i++] = style.width_scale * 1024; // line width\n this.vertex_template[i++] = style.offset_scale * 1024; // line offset\n\n // Add texture UVs to template only if needed\n if (mesh.variant.texcoords) {\n // a_texcoord.uv\n this.vertex_template[i++] = 0;\n this.vertex_template[i++] = 0;\n }\n\n // a_color.rgba\n this.vertex_template[i++] = style.color[0] * 255;\n this.vertex_template[i++] = style.color[1] * 255;\n this.vertex_template[i++] = style.color[2] * 255;\n this.vertex_template[i++] = style.color[3] * 255;\n\n // selection color\n if (this.selection) {\n // a_selection_color.rgba\n this.vertex_template[i++] = style.selection_color[0] * 255;\n this.vertex_template[i++] = style.selection_color[1] * 255;\n this.vertex_template[i++] = style.selection_color[2] * 255;\n this.vertex_template[i++] = style.selection_color[3] * 255;\n }\n\n return this.vertex_template;\n }", "title": "" }, { "docid": "6ab7b00e9eb4cac767f55f87a8215f58", "score": "0.56256574", "text": "function Triangle(s1,s2,s3){\n Polygon.call(this, [new Side(s1), new Side(s2), new Side(s3)]);\n}", "title": "" }, { "docid": "9ea23777010b8c2c69047a0d42c06ed7", "score": "0.5623064", "text": "function createTriangle() {\n const range = parseInt(rangeControl.value, 10);\n const newSize = MAX_SIZE / 2 ** range;\n\n main.innerHTML = '';\n main.style.setProperty('--size', `${newSize}px`);\n\n rangeDisplay.textContent = range;\n\n const block = document.createElement('div');\n\n if (range === 0) {\n block.classList.add('triangle');\n } else {\n const row = document.createElement('div');\n let triangle = document.createElement('div');\n\n block.classList.add('block');\n row.classList.add('row');\n triangle.classList.add('triangle');\n\n for (let i = 0; i < range; i++) {\n const newTriangle = triangle.cloneNode(true);\n\n const topRow = row.cloneNode();\n topRow.appendChild(newTriangle);\n\n const bottomRow = topRow.cloneNode(true);\n bottomRow.appendChild(newTriangle.cloneNode(true));\n\n block.innerHTML = '';\n block.appendChild(topRow);\n block.appendChild(bottomRow);\n\n triangle = block;\n }\n }\n main.appendChild(block);\n }", "title": "" }, { "docid": "75d10fc39dcdb65dd209b97b3ab81bcd", "score": "0.56229466", "text": "function buildComponentMesh (data) {\n // data passed in controls numbers of meshes rendered\n const vertexArray = []\n\n for (let idx=0; idx < data.nbMeshes; ++idx) {\n\n // get mesh meta data on position indices and stride\n const meshData = {\n positions: data['positions' + idx],\n indices: data['indices' + idx],\n stride: data['stride' + idx]\n }\n\n getMeshGeometry (meshData, vertexArray)\n }\n\n // create holder for geometry\n const geometry = new THREE.Geometry()\n\n // populate the geometry holder\n for (var i = 0; i < vertexArray.length; i += 3) {\n\n geometry.vertices.push(vertexArray[i])\n geometry.vertices.push(vertexArray[i + 1])\n geometry.vertices.push(vertexArray[i + 2])\n\n const face = new THREE.Face3(i, i + 1, i + 2)\n\n geometry.faces.push(face)\n }\n\n // transform the mesh in world position\n const matrixWorld = new THREE.Matrix4()\n\n if(data.matrixWorld) {\n\n matrixWorld.fromArray(data.matrixWorld)\n }\n\n // create mesh based on meta data\n const mesh = new THREE.Mesh(geometry)\n\n mesh.applyMatrix(matrixWorld)\n\n // save bounding box for the mesh\n mesh.boundingBox = data.boundingBox\n\n // transform the mesh into Binary Space Partitioning (BSP)\n // create construction solid geometry from mesh\n mesh.bsp = new ThreeBSP(mesh)\n\n mesh.dbId = data.dbId\n\n return mesh\n}", "title": "" }, { "docid": "c2167ea3b248dc0cd1fee20d2c751245", "score": "0.56219757", "text": "function cubeGeometry() {\r\n const vertices = [\r\n // Front face: white\r\n -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\r\n 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0,\r\n 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0,\r\n\r\n // Back face: red\r\n -1.0, -1.0, -1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 1.0, -1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 1.0, 0.0,\r\n 1.0, 1.0, -1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 1.0, 1.0,\r\n 1.0, -1.0, -1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0,\r\n\r\n // Top face: green\r\n -1.0, 1.0, -1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, -1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0,\r\n 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0,\r\n 1.0, 1.0, -1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\r\n\r\n // Bottom face: blue\r\n -1.0, -1.0, -1.0, 0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0,\r\n 1.0, -1.0, -1.0, 0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, 0.0,\r\n 1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, 1.0, -1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 1.0,\r\n\r\n // Right face: yellow\r\n 1.0, -1.0, -1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0,\r\n 1.0, 1.0, -1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\r\n 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0,\r\n 1.0, -1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0,\r\n\r\n // Left face: purple\r\n -1.0, -1.0, -1.0, 1.0, 0.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0, -1.0, -1.0, 1.0, 1.0, 0.0, 1.0, -1.0, 0.0, 0.0, 1.0, 0.0, -1.0, 1.0, 1.0, 1.0, 0.0, 1.0, -1.0, 0.0, 0.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, 0.0, 1.0, -1.0, 0.0, 0.0, 0.0, 1.0,\r\n ];\r\n\r\n const indices = [\r\n 0, 1, 2, 0, 2, 3, // front\r\n 4, 5, 6, 4, 6, 7, // back\r\n 8, 9, 10, 8, 10, 11, // top\r\n 12, 13, 14, 12, 14, 15, // bottom\r\n 16, 17, 18, 16, 18, 19, // right\r\n 20, 21, 22, 20, 22, 23, // left\r\n ];\r\n\r\n const stride = 11 * Float32Array.BYTES_PER_ELEMENT;\r\n return { vertices, indices, stride };\r\n}", "title": "" }, { "docid": "b0135329aeb38a1d4a58163a825a2491", "score": "0.561787", "text": "function createMeshData(input, model) {\n model.vtx = [];\n model.bbox = { min: vec3.create([99, 99, 99]), max: vec3.create([-99, -99, -99]) };\n for (var i = 0; i < input.vertexPositions.length; i += 3) {\n p = vec3.create([input.vertexPositions[i], input.vertexPositions[i + 1], input.vertexPositions[i + 2]]);\n model.vtx.push(p);\n vec3.minwith(model.bbox.min, p);\n vec3.maxwith(model.bbox.max, p);\n }\n\n model.bbox.size = vec3.distance(model.bbox.min, model.bbox.max);\n writeDebug(model.vtx.length + \" vertices in world bbox=\" + model.bbox.size);\n model.normals = [];\n if (input.vertexNormals) {\n for (var i = 0; i < input.vertexNormals.length; i += 3) {\n model.normals.push(vec3.create([input.vertexNormals[i], input.vertexNormals[i + 1], input.vertexNormals[i + 2]]));\n }\n }\n model.nei = []; // for every vertex, map a list of neighboring vertices\n var nei = new Array(model.vtx.length);\n for (var i = 0; i < nei.length; ++i) \n nei[i] = { d:{}, t:{}, nc:0 };\n // d: distances by point index,\n // t: order of neighbors going clockwise,\n // nc: neighbor count\n // r: in case of nc!=4, same as t but with negatives as well maybe (to avoid loops)\n \n if (!input.quads)\n throw new Error(\"not supported\"); //(input.lines) {\n\n var distSum = 0, distCount = 0, d;\n\n for (var i = 0; i < input.quads.length; i += 4) {\n var a = input.quads[i], b = input.quads[i+1], c = input.quads[i+2]; d = input.quads[i+3];\n ds = indexDist(model, a, b); nei[a].d[b] = ds; nei[b].d[a] = ds; distSum += ds;\n ds = indexDist(model, b, c); nei[b].d[c] = ds; nei[c].d[b] = ds; distSum += ds;\n ds = indexDist(model, c, d); nei[c].d[d] = ds; nei[d].d[c] = ds; distSum += ds;\n ds = indexDist(model, d, a); nei[d].d[a] = ds; nei[a].d[d] = ds; distSum += ds;\n distCount += 4;\n // add pairs of corners to sort out the order of the neighbors later\n nei[a].t[b] = d; // point a sees neighbors from b to d\n nei[b].t[c] = a;\n nei[c].t[d] = b;\n nei[d].t[a] = c;\n }\n \n // count neightbors. need this for the allocation of the neighbor vertices\n var totalNeiCount = 0; \n for (var i = 0; i < nei.length; ++i) {\n var myNeiList = Object.keys(nei[i].t);\n nei[i].nc = myNeiList.length;\n totalNeiCount += myNeiList.length;\n }\n \n // nei[i].d[j] - the distance fromo i to to neighbor j\n // nei[i].t[j] - the index of the next neighbor of i on the right of j\n \n model.totalNeiCount = totalNeiCount;\n model.distAvg = distSum/distCount;\n model.scale = worldScales(model.distAvg);\n\n writeDebug(model.distAvg)\n \n model.nei = nei;\n \n}", "title": "" }, { "docid": "65c2322b4a4bd6a617a26c9186997cfe", "score": "0.5606412", "text": "generateTriangles()\r\n{\r\n //Your code here\r\n var deltaX = (this.maxX - this.minX)/this.div;\r\n var deltaY = (this.maxY - this.minY)/this.div;\r\n \r\n for(var i=0;i<=this.div;i++)\r\n {\r\n for(var j=0;j<=this.div;j++)\r\n {\r\n this.vBuffer.push(this.minX+deltaX*j);\r\n this.vBuffer.push(this.minY+deltaY*i);\r\n this.vBuffer.push(0);\r\n \r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n }\r\n }\r\n \r\n for (var i=0;i<this.div;i++)\r\n {\r\n for(var j=0;j<this.div;j++)\r\n {\r\n var vid = i*(this.div+1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n \r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+1+this.div+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n }\r\n }\r\n \r\n //\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n}", "title": "" }, { "docid": "6bfeed4770f47453298402ab01638608", "score": "0.56024355", "text": "function make( v1, v2, v3, detail ) {\n\n\t\tif ( detail < 1 ) {\n\n\t\t\tvar face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] );\n\t\t\tface.centroid.add( v1 ).add( v2 ).add( v3 ).divideScalar( 3 );\n\t\t\tface.normal = face.centroid.clone().normalize();\n\t\t\tthat.faces.push( face );\n\n\t\t\tvar azi = azimuth( face.centroid );\n\t\t\tthat.faceVertexUvs[ 0 ].push( [\n\t\t\t\tcorrectUV( v1.uv, v1, azi ),\n\t\t\t\tcorrectUV( v2.uv, v2, azi ),\n\t\t\t\tcorrectUV( v3.uv, v3, azi )\n\t\t\t] );\n\n\t\t} else {\n\n\t\t\tdetail -= 1;\n\n\t\t\t// split triangle into 4 smaller triangles\n\n\t\t\tmake( v1, midpoint( v1, v2 ), midpoint( v1, v3 ), detail ); // top quadrant\n\t\t\tmake( midpoint( v1, v2 ), v2, midpoint( v2, v3 ), detail ); // left quadrant\n\t\t\tmake( midpoint( v1, v3 ), midpoint( v2, v3 ), v3, detail ); // right quadrant\n\t\t\tmake( midpoint( v1, v2 ), midpoint( v2, v3 ), midpoint( v1, v3 ), detail ); // center quadrant\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "327d706d29256d4f6c58a093b2ec7645", "score": "0.5600141", "text": "function getHexagonMesh() {\n var hex = new THREE.Shape(hexPoints);\n var hexGeo = hex.makeGeometry();\n var hexMaterial = new THREE.MeshNormalMaterial();\n var hexagon = new THREE.Mesh(hexGeo, hexMaterial);\n //hexagon.scale.set(10,10,10);\n return hexagon;\n}", "title": "" }, { "docid": "08d8fc72acc9e170ecd4ed4bf04d2459", "score": "0.55864173", "text": "function drawTriangleFace(vertices) { \n geometry = new THREE.Geometry();\n geometry.vertices = vertices;\n geometry.faces.push(new THREE.Face3(0, 1, 2));\n geometry.computeFaceNormals();\n}", "title": "" }, { "docid": "90de9b48fff0f96157d3f7d25f89a4f9", "score": "0.55857617", "text": "function make( v1, v2, v3, detail ) {\r\n\r\n\t\tif ( detail < 1 ) {\r\n\r\n\t\t\tvar face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] );\r\n\t\t\tface.centroid.add( v1 ).add( v2 ).add( v3 ).divideScalar( 3 );\r\n\t\t\tface.normal = face.centroid.clone().normalize();\r\n\t\t\tthat.faces.push( face );\r\n\r\n\t\t\tvar azi = azimuth( face.centroid );\r\n\t\t\tthat.faceVertexUvs[ 0 ].push( [\r\n\t\t\t\tcorrectUV( v1.uv, v1, azi ),\r\n\t\t\t\tcorrectUV( v2.uv, v2, azi ),\r\n\t\t\t\tcorrectUV( v3.uv, v3, azi )\r\n\t\t\t] );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdetail -= 1;\r\n\r\n\t\t\t// split triangle into 4 smaller triangles\r\n\r\n\t\t\tmake( v1, midpoint( v1, v2 ), midpoint( v1, v3 ), detail ); // top quadrant\r\n\t\t\tmake( midpoint( v1, v2 ), v2, midpoint( v2, v3 ), detail ); // left quadrant\r\n\t\t\tmake( midpoint( v1, v3 ), midpoint( v2, v3 ), v3, detail ); // right quadrant\r\n\t\t\tmake( midpoint( v1, v2 ), midpoint( v2, v3 ), midpoint( v1, v3 ), detail ); // center quadrant\r\n\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "f171538a52caea0941375ce664cae9ef", "score": "0.5583781", "text": "function createTriangles(seed) {\n // set first two triangles manually\n triangles.push(new Triangle(margin, areaSize - margin, \n margin, margin, \n areaSize - margin, areaSize - margin));\n triangles.push(new Triangle(areaSize - margin, margin, \n areaSize - margin, areaSize - margin, \n margin, margin));\n // number of triangles that are generated right before each loop\n // This count should incease exponentially as one triangle produces two triangles inside\n let triCount = 2;\n // loop of how many times we repeat the process of... \n // \"a parent generates two children,\n // and the children produce thier children...\"\n for(let i=triCount; i<numDivide; i++) {\n let temp = []\n // process of parents generating children\n // store generated children triangles \n // in a temporal array to wait all parents finish generating\n for (let j=1; j<=triCount; j++) {\n let generated = triangles[triangles.length - j].generateNew(seed);\n temp.push(generated);\n }\n // Once all parents has finished generating children,\n // it's time to store children into triangles list.\n // In the next loop, these children will be considered as parents\n for(let t=0; t<temp.length; t++){\n for(let u=0; u<temp[t].length; u++){\n triangles.push(temp[t][u]); \n } \n }\n // number of triangles increases exponentially.\n triCount = pow(2, i);\n }\n \n}", "title": "" }, { "docid": "cc9d5847a3969cc252759fe3aa206e96", "score": "0.5580413", "text": "function loadTriangles()\n{\n // var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n // var inputSpheres = getJSONFile(INPUT_SPHERES_URL,\"spheres\");\n var xyz = [0,0,0];\n var rotate = [0,0,0];\n\n // console.log(\"coordinates: \"+coordArray.toString());\n // console.log(\"numverts: \"+vtxBufferSize);\n // console.log(\"indices: \"+indexArray.toString());\n // console.log(\"numindices: \"+triBufferSize);\n\n /**\n\n Create meteors\n\n 1. Generate spheres along x, y, z axes that are some d offset from eye that will collide\n 2. Generate spheres along x, y, z axes that are some d offset from eye but isn't going to collide\n 3. Randomize size of spheres from r = [0.08, 0.15]\n 4. Randomize the axis chosen for the particular sphere (0-3 for front, behind, left, right, above, below)\n\n Logic for meteors\n\n 1. Move meteors each second towards eye according to whichever axis they're on\n 2. When meteors get some distance d close to the eye, signal a warning by flashing a red triangle (alpha to 0.5)\n\n **/\n\n // if(inputSpheres != String.null){\n // var textureCoordData = [];\n var latitudeBands = 30;\n var longitudeBands = 30;\n var numSpheres = 3;\n for(var s = 0; s < numSpheres; s++){\n var xyz = new vec3.fromValues(0.5, 0.5, -0.5);\n // Random xyz\n var direction = Math.round(getRandom(0, 6));\n // var direction = 0;\n // var distance = getRandom(2, 5);\n var distance = 10;\n console.log(\"direction: \"+direction);\n console.log(\"distance: \"+distance);\n switch (direction) {\n case states.FRONT:\n // hitable (concerns z)\n vec3.multiply(xyz, xyz, vec3.fromValues(1, 1, -1*distance*(s+1)));\n // unhitable (offset the x or y)\n // vec3.multiply(xyz, xyz, vec3.fromValues(1, 1, -1));\n break;\n case states.BEHIND:\n // hitable (concerns z)\n vec3.multiply(xyz, xyz, vec3.fromValues(1, 1, 1*distance*(s+1)));\n // unhitable (offset the x or y)\n // vec3.multiply(xyz, xyz, vec3.fromValues(1, 1, 1));\n break;\n case states.RIGHT:\n // hitable (min val for x < -1.0)\n vec3.multiply(xyz, xyz, vec3.fromValues(-1*distance*(s+1), 1, 1));\n // unhitable (offset the x or y)\n // vec3.multiply(xyz, xyz, vec3.fromValues(-1, 1, 1));\n break;\n case states.LEFT:\n // hitable (min val for x > 1.0)\n vec3.multiply(xyz, xyz, vec3.fromValues(1*distance*(s+1), 1, 1));\n // unhitable (min val for x > 1.0)\n break;\n case states.ABOVE:\n // hitable (min val for y > 1.0)\n vec3.multiply(xyz, xyz, vec3.fromValues(1, 1*distance*(s+1), 1));\n break;\n case states.BELOW:\n vec3.multiply(xyz, xyz, vec3.fromValues(1, -1*distance*(s+1), 1));\n break;\n default:\n console.log(\"unknown state!\");\n }\n console.log(\"distance: \"+JSON.stringify(xyz));\n var sCoordArray = [];\n var sColorArray = [];\n var sColorHighlightArray = [];\n var sIndexArray = [];\n var sNormalArray = [];\n var sphereBufferSize = 0;\n var sphere = inputSpheres[s];\n var radius = sphere.r;\n var coherence = sphere.n;\n for (var latNumber = 0; latNumber <= latitudeBands; latNumber++) {\n var theta = latNumber * Math.PI / latitudeBands;\n var sinTheta = Math.sin(theta);\n var cosTheta = Math.cos(theta);\n for (var longNumber = 0; longNumber <= longitudeBands; longNumber++) {\n var phi = longNumber * 2 * Math.PI / longitudeBands;\n var sinPhi = Math.sin(phi);\n var cosPhi = Math.cos(phi);\n var x = cosPhi * sinTheta;\n var y = cosTheta;\n var z = sinPhi * sinTheta;\n // var u = 1 - (longNumber / longitudeBands);\n // var v = 1 - (latNumber / latitudeBands);\n sNormalArray.push(x);\n sNormalArray.push(y);\n sNormalArray.push(z);\n // textureCoordData.push(u);\n // textureCoordData.push(v);\n sCoordArray.push(xyz[0] - radius * x);\n sCoordArray.push(xyz[1] - radius * y);\n sCoordArray.push(xyz[2] - radius * z);\n // console.log(JSON.stringify([radius*x, radius*y, radius*z]));\n sColorArray.push(sphere.diffuse[0], sphere.diffuse[1], sphere.diffuse[2], 1.0);\n sColorHighlightArray.push(hDiffuse[0], hDiffuse[1], hDiffuse[2], 1.0);\n }\n }\n\n for (var latNumber=0; latNumber < latitudeBands; latNumber++) {\n for (var longNumber=0; longNumber < longitudeBands; longNumber++) {\n var first = (latNumber * (longitudeBands + 1)) + longNumber;\n var second = first + longitudeBands + 1;\n sIndexArray.push(first);\n sIndexArray.push(second);\n sIndexArray.push(first + 1);\n sIndexArray.push(second);\n sIndexArray.push(second + 1);\n sIndexArray.push(first + 1);\n sphereBufferSize += 6;\n }\n }\n\n // Sphere vertices\n var spherePositionBuffer = createBindBuffer(gl, gl.ARRAY_BUFFER, sCoordArray);\n // Sphere indices\n var sphereIndexBuffer = createBindBuffer(gl, gl.ELEMENT_ARRAY_BUFFER, sIndexArray);;\n // Sphere colors\n var sphereColorBuffer = createBindBuffer(gl, gl.ARRAY_BUFFER, sColorArray);\n // Sphere highlight color\n var sphereHighlightColorBuffer = createBindBuffer(gl, gl.ARRAY_BUFFER, sColorHighlightArray);\n // Sphere normals\n var sphereNormalBuffer = createBindBuffer(gl, gl.ARRAY_BUFFER, sNormalArray);\n\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // clear frame/depth buffers\n\n var rotate = [0,0,0];\n // Projection and View transforms\n var newSphere = new Sphere(s, sphere.x, sphere.y, sphere.z, spherePositionBuffer, sphereIndexBuffer, sphereBufferSize, sphereNormalBuffer, sphereColorBuffer, sphereHighlightColorBuffer, AmbientR, SpecularR, coherence, false, mvMatrix, pMatrix, xyz, rotate);\n newSphere.draw = function()\n {\n // Projection and View transforms\n mat4.perspective(pMatrix, 45, gl.viewportWidth / gl.viewportHeight, 0.1, 100);\n mat4.identity(mvMatrix)\n mat4.lookAt(mvMatrix, Eye, Center, LookUp);\n\n // Do global transformation then the local\n var xyzTotal = new vec3.fromValues(this.xyz[0], this.xyz[1], this.xyz[2]);\n mat4.translate(this.pMatrix, this.pMatrix, xyzTotal);\n mat4.rotateX(pMatrix, pMatrix, rotateX);\n mat4.rotateY(pMatrix, pMatrix, rotateY);\n mat4.rotateZ(pMatrix, pMatrix, rotateZ);\n this.mvMatrix = mvMatrix;\n this.pMatrix = pMatrix;\n\n // console.log(JSON.stringify(mvMatrix));\n /* Vertex buffer: activate and feed into vertex shader */\n // set the light direction.\n gl.uniform4fv(shaderProgram.colorUniform, LightColor); // white light\n // Set the color to use\n gl.uniform3fv(shaderProgram.lightingDirectionUniform, LightLocation); // light location\n\n // Set default or hightlighted ambient, specular, diffuse Rs\n var amb = this.ambient;\n var spec = this.specular;\n if(this.highlighted){\n amb = hAmbient;\n spec = hSpecular;\n gl.uniform1i(shaderProgram.useHighlightUniform, true);\n } else{\n gl.uniform1i(shaderProgram.useHighlightUniform, false);\n }\n // console.log(\"color diff: \"+diff);\n gl.uniform3fv(shaderProgram.ambientUniform, amb);\n gl.uniform3fv(shaderProgram.specularUniform, spec);\n // Set the specular coherence\n gl.uniform1f(shaderProgram.specularCoherenceUniform, this.coherence);\n\n // Position buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, this.positionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n\n // Bind the color buffer.\n gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);\n // Tell the color attribute how to get data out of colorBuffer (ARRAY_BUFFER)\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute, 4, gl.FLOAT, false, 0, 0);\n\n // Bind the color buffer.\n gl.bindBuffer(gl.ARRAY_BUFFER, this.highlightBuffer);\n // Tell the color attribute how to get data out of colorBuffer (ARRAY_BUFFER)\n gl.vertexAttribPointer(shaderProgram.vertexHighlightColorAttribute, 4, gl.FLOAT, false, 0, 0);\n\n // Bind the normal buffer.\n gl.bindBuffer(gl.ARRAY_BUFFER, this.normalBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, 3, gl.FLOAT, false, 0, 0); // feed\n\n // Set the uniform vars for the projections and model-view\n var normalMatrix = mat3.create();\n setMatrixUniforms(this.mvMatrix, this.pMatrix, normalMatrix);\n\n // Finally, draw the elements.\n gl.uniform1i(shaderProgram.useTriangleUniform, false);\n gl.drawElements(gl.TRIANGLES, this.bufferSize, gl.UNSIGNED_SHORT, 0); // render\n };\n spheres.push(newSphere);\n } // end spheres for\n // } // end spheres found\n\n} // end load triangles", "title": "" }, { "docid": "2046a0eb6e7b1a6e8c14211206b8e109", "score": "0.5567945", "text": "function Triangle(sideOneLength, sideTwoLength, sideThreeLength) {\r\n Polygon.call(this, [new Side(sideOneLength), new Side(sideTwoLength), new Side(sideThreeLength)]);\r\n}", "title": "" }, { "docid": "44f84e4e4d633d1a6c5063c663cb1ae1", "score": "0.55580485", "text": "function triangle(a, b, c, shading) {\n pointsArray.push(a);\n pointsArray.push(b); \n pointsArray.push(c);\n \n if (shading == shading_flat) {\n var t1 = subtract(a,b);\n var t2 = subtract(c,b);\n\n var n = vec4(normalize(cross(t1,t2)));\n normalsArray.push(-n[0], -n[1], -n[2], 0.0);\n normalsArray.push(-n[0], -n[1], -n[2], 0.0);\n normalsArray.push(-n[0], -n[1], -n[2], 0.0);\n index += 3;\n } \n else if (shading == shading_smooth) {\n normalsArray.push(a[0], a[1], a[2], 0.0);\n normalsArray.push(b[0], b[1], b[2], 0.0);\n normalsArray.push(c[0], c[1], c[2], 0.0);\n index += 3;\n }\n}", "title": "" }, { "docid": "73ca049963bc1635295a54293b72fd15", "score": "0.55522287", "text": "function createMeshObject(surface) {\n var geometry = new THREE.Geometry();\n\n var vertexTransform = new THREE.Matrix4();\n vertexTransform.fromArray(surface.originToSurfaceTransform);\n\n var normalTransform = new THREE.Matrix4();\n normalTransform.fromArray(surface.normalTransform);\n\n var vertexIndex = 0;\n // Iterate over vertices, normals and indices and add them to the new geometry object\n for (vertexIndex = 0; vertexIndex <= surface.vertices.length - 3; vertexIndex += 3) {\n geometry.vertices.push(new THREE.Vector3(\n surface.vertices[vertexIndex],\n surface.vertices[vertexIndex + 1],\n surface.vertices[vertexIndex + 2]\n ));\n }\n\n geometry.applyMatrix(vertexTransform);\n\n for (var indiceIndex = 0; indiceIndex <= surface.indices.length - 3; indiceIndex += 3) {\n var vertexNormals = [];\n for (var normalIndex = 0; normalIndex < 3; normalIndex++) {\n vertexNormals[normalIndex] = new THREE.Vector3(\n surface.normals[surface.indices[indiceIndex + normalIndex]],\n surface.normals[surface.indices[indiceIndex + normalIndex] + 1],\n surface.normals[surface.indices[indiceIndex + normalIndex] + 2]\n );\n vertexNormals[normalIndex].applyMatrix4(normalTransform);\n }\n geometry.faces.push(\n //Data passed back from surface reconstruction uses front CW winding order\n new THREE.Face3(\n surface.indices[indiceIndex],\n surface.indices[indiceIndex + 1],\n surface.indices[indiceIndex + 2],\n vertexNormals));\n }\n\n return { id: surface.id, mesh: new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({ color: 0xFFFFFF })) };\n }", "title": "" }, { "docid": "bd1d3e4d4d0f4465e17ac9f9950ed93c", "score": "0.55405915", "text": "function getInitTriangle(reader, decoder, output) {\r\n const vertex = _math_vector3__WEBPACK_IMPORTED_MODULE_0__[\"create\"](0, 0, 0);\r\n const ring = new Array(3);\r\n for (let i = 0; i < 3; i++) {\r\n const command = reader.readCommand();\r\n if (command.type === 1 /* HOLE */) {\r\n ring[i] = new _node__WEBPACK_IMPORTED_MODULE_2__[\"HoleNode\"](command.valence);\r\n }\r\n else if (command.type === 0 /* ADD */) {\r\n reader.readDiff(tmpDiff);\r\n _math_vector3__WEBPACK_IMPORTED_MODULE_0__[\"add\"](vertex, tmpDiff, vertex);\r\n ring[i] = new _node__WEBPACK_IMPORTED_MODULE_2__[\"default\"](command.valence, _math_vector3__WEBPACK_IMPORTED_MODULE_0__[\"copy\"](vertex), output.writeVertex(decoder.decode(vertex)));\r\n }\r\n }\r\n for (let i = 0; i < ring.length; i++) {\r\n ring[i].setNeighbors(Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cyclicNext\"])(ring, i), Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"cyclicPrev\"])(ring, i));\r\n }\r\n writeTriangle(ring[0], ring[1], ring[2], output);\r\n return ring;\r\n}", "title": "" }, { "docid": "88c63c23f63c234374ecd900eae84dc2", "score": "0.5538998", "text": "function getHugeTriangle(points){\r\n var rect = getRectForPoints(points);\r\n \r\n var center = new Point((rect.left + rect.right) / 2,\r\n (rect.top + rect.bottom) / 2);\r\n var topleft = new Point(rect.left, rect.top);\r\n var radius = center.dist(topleft);\r\n \r\n var x1 = center.x - Math.sqrt(3) * radius;\r\n var y1 = center.y + radius;\r\n var p1 = new Point(x1, y1, -1);\r\n \r\n var x2 = center.x + Math.sqrt(3) * radius;\r\n var y2 = center.y + radius;\r\n var p2 = new Point(x2, y2, -2);\r\n \r\n var x3 = center.x;\r\n var y3 = center.y - 2 * radius;\r\n var p3 = new Point(x3, y3, -3);\r\n \r\n return new Triangle(p1, p2, p3);\r\n }", "title": "" }, { "docid": "fb0138cdbc0ed10f53fbfac213994875", "score": "0.55241746", "text": "async function createMesh(width, height, segmentsX, segmentsY) {\n const mapOptions = {\n noLabels: options.labels3d,\n noWater: options.extendedWater,\n fullMap: true\n };\n const url = await getMapURL(\"mesh\", mapOptions);\n window.setTimeout(() => window.URL.revokeObjectURL(url), 5000);\n\n if (texture) texture.dispose();\n texture = new THREE.TextureLoader().load(url, render);\n texture.needsUpdate = true;\n\n if (material) material.dispose();\n material = new THREE.MeshLambertMaterial();\n material.map = texture;\n material.transparent = true;\n\n if (geometry) geometry.dispose();\n geometry = new THREE.PlaneGeometry(width, height, segmentsX - 1, segmentsY - 1);\n geometry.vertices.forEach((v, i) => (v.z = getMeshHeight(i)));\n geometry.computeVertexNormals();\n\n if (mesh) scene.remove(mesh);\n mesh = new THREE.Mesh(geometry, material);\n mesh.rotation.x = -Math.PI / 2;\n mesh.castShadow = true;\n mesh.receiveShadow = true;\n scene.add(mesh);\n\n if (options.labels3d) {\n render();\n await createLabels();\n }\n }", "title": "" }, { "docid": "fbaf26e1850687185da1dc3e4600d418", "score": "0.5511321", "text": "function CreateBoundingTriangle( vertices ) {\n\t// NOTE: There's a bit of a heuristic here. If the bounding triangle \n\t// is too large and you see overflow/underflow errors. If it is too small \n\t// you end up with a non-convex hull.\n\t\n\tvar minx, miny, maxx, maxy;\n\tfor( var i in vertices ) {\n\t\tvar vertex = vertices[i].point3D;\n\t\tif( minx === undefined || vertex.x < minx ) { minx = vertex.x; }\n\t\tif( miny === undefined || vertex.y < miny ) { miny = vertex.y; }\n\t\tif( maxx === undefined || vertex.x > maxx ) { maxx = vertex.x; }\n\t\tif( maxy === undefined || vertex.y > maxy ) { maxy = vertex.y; }\n\t}\n\n\tvar dx = ( maxx - minx ) * 10;\n\tvar dy = ( maxy - miny ) * 10;\n\t\n\tvar stv0 = new Point( minx - dx, miny - dy*3 );\n\tvar stv1 = new Point( minx - dx, maxy + dy );\n\tvar stv2 = new Point( maxx + dx*3, maxy + dy );\n\n\treturn new Triangle( stv0, stv1, stv2 );\n\t\n} // end CreateBoundingTriangle", "title": "" }, { "docid": "cfea2bc07769532851fb3f62a67d6a61", "score": "0.5502789", "text": "addTriangleFacet(points, params, normals) {\n let idx0;\n let idx1;\n let idx2;\n // Add params if needed\n if (this._options.needParams) {\n if (params && params.length >= 3) { // Params were given\n idx0 = this._polyface.addParam(params[0]);\n idx1 = this._polyface.addParam(params[1]);\n idx2 = this._polyface.addParam(params[2]);\n }\n else { // Compute params\n const paramTransform = this.getUVTransformForTriangleFacet(points[0], points[1], points[2]);\n idx0 = this._polyface.addParam(Point2dVector2d_1.Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(points[0]) : undefined));\n idx1 = this._polyface.addParam(Point2dVector2d_1.Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(points[1]) : undefined));\n idx2 = this._polyface.addParam(Point2dVector2d_1.Point2d.createFrom(paramTransform ? paramTransform.multiplyPoint3d(points[2]) : undefined));\n }\n this.addIndexedTriangleParamIndexes(idx0, idx1, idx2);\n }\n // Add normals if needed\n if (this._options.needNormals) {\n if (normals !== undefined && normals.length > 2) { // Normals were given\n idx0 = this._polyface.addNormal(normals[0]);\n idx1 = this._polyface.addNormal(normals[1]);\n idx2 = this._polyface.addNormal(normals[2]);\n }\n else { // Compute normals\n const normal = this.getNormalForTriangularFacet(points[0], points[1], points[2]);\n idx0 = this._polyface.addNormal(normal);\n idx1 = this._polyface.addNormal(normal);\n idx2 = this._polyface.addNormal(normal);\n }\n this.addIndexedTriangleNormalIndexes(idx0, idx1, idx2);\n }\n // Add point and point indexes last (terminates the facet)\n idx0 = this.findOrAddPoint(points[0]);\n idx1 = this.findOrAddPoint(points[1]);\n idx2 = this.findOrAddPoint(points[2]);\n this.addIndexedTrianglePointIndexes(idx0, idx1, idx2);\n }", "title": "" }, { "docid": "4e2440542e860b0c091e3de530db66e7", "score": "0.54964316", "text": "async function newMesh(canvas) {\n const loaded = await loadTHREE();\n if (!loaded) {\n tip(\"Cannot load 3d library\", false, \"error\", 4000);\n return false;\n }\n\n scene = new THREE.Scene();\n\n // light\n ambientLight = new THREE.AmbientLight(0xcccccc, options.lightness);\n scene.add(ambientLight);\n spotLight = new THREE.SpotLight(0xcccccc, 0.8, 2000, 0.8, 0, 0);\n spotLight.position.set(options.sun.x, options.sun.y, options.sun.z);\n spotLight.castShadow = true;\n scene.add(spotLight);\n //scene.add(new THREE.SpotLightHelper(spotLight));\n\n // Rendered\n Renderer = new THREE.WebGLRenderer({canvas, antialias: true, preserveDrawingBuffer: true});\n Renderer.setSize(canvas.width, canvas.height);\n Renderer.shadowMap.enabled = true;\n if (options.extendedWater) extendWater(graphWidth, graphHeight);\n createMesh(graphWidth, graphHeight, grid.cellsX, grid.cellsY);\n\n // camera\n camera = new THREE.PerspectiveCamera(70, canvas.width / canvas.height, 0.1, 2000);\n camera.position.set(0, rn(svgWidth / 3.5), 500);\n\n // controls\n controls = await OrbitControls(camera, canvas);\n controls.enableKeys = false;\n controls.minDistance = 10;\n controls.maxDistance = 1000;\n controls.maxPolarAngle = Math.PI / 2;\n controls.autoRotate = Boolean(options.rotateMesh);\n controls.autoRotateSpeed = options.rotateMesh;\n if (controls.autoRotate) animate();\n\n controls.addEventListener(\"change\", render);\n\n return true;\n }", "title": "" }, { "docid": "0fdea687a0cab1e209df93e1e8d49ea0", "score": "0.54901683", "text": "function meshBlade4(w,h){\n\n var hw = w / 2; // half width\n var th = tombola.rangeFloat((h*0.6),h*1.2); // top height\n var tx = tombola.rangeFloat(-(h/4),h/4); // top x offset\n var tz = tombola.rangeFloat(-(h/8),h/6); // top z offset\n var xo = tx / 3; // base x offset\n\n\n var geometry = new THREE.Geometry();\n geometry.vertices.push(\n new THREE.Vector3( xo + tx, th, tz), // top\n new THREE.Vector3( xo - hw, 0, 0), // base left\n new THREE.Vector3( xo, 0, hw), // base center\n new THREE.Vector3( xo + hw, 0, 0) // base right\n );\n\n geometry.faces.push( new THREE.Face3( 0, 1, 2 ) );\n geometry.faces.push( new THREE.Face3( 0, 2, 3 ) );\n\n geometry.computeBoundingSphere();\n geometry.computeFaceNormals();\n return geometry;\n}", "title": "" }, { "docid": "0d38e9dfcb847665799cbdb82dc3ab4f", "score": "0.54874235", "text": "getMeshFromRenderProxy( render_proxy, floor_normal, top_face_z, debug_draw )\n {\n var matrix = render_proxy.matrixWorld;\n var geometry = render_proxy.geometry;\n var attributes = geometry.attributes;\n\n var vA = new THREE.Vector3();\n var vB = new THREE.Vector3();\n var vC = new THREE.Vector3();\n\n var geo = new THREE.Geometry();\n var iv = 0;\n\n if (attributes.index !== undefined)\n {\n var indices = attributes.index.array || geometry.ib;\n var positions = geometry.vb ? geometry.vb : attributes.position.array;\n var stride = geometry.vb ? geometry.vbstride : 3;\n var offsets = geometry.offsets;\n\n if (!offsets || offsets.length === 0) {\n offsets = [{start: 0, count: indices.length, index: 0}];\n }\n\n for (var oi = 0, ol = offsets.length; oi < ol; ++oi) {\n\n var start = offsets[oi].start;\n var count = offsets[oi].count;\n var index = offsets[oi].index;\n\n for (var i = start, il = start + count; i < il; i += 3) {\n\n var a = index + indices[i];\n var b = index + indices[i + 1];\n var c = index + indices[i + 2];\n\n vA.fromArray(positions, a * stride);\n vB.fromArray(positions, b * stride);\n vC.fromArray(positions, c * stride);\n\n vA.applyMatrix4(matrix);\n vB.applyMatrix4(matrix);\n vC.applyMatrix4(matrix);\n\n var n = THREE.Triangle.normal(vA, vB, vC);\n\n if( null === floor_normal\n || this.isEqualVectorsWithPrecision( n, floor_normal ))\n {\n if( debug_draw )\n {\n this.drawVertex (vA);\n this.drawVertex (vB);\n this.drawVertex (vC);\n\n this.drawLine(vA, vB);\n this.drawLine(vB, vC);\n this.drawLine(vC, vA);\n }\n geo.vertices.push(new THREE.Vector3(vA.x, vA.y, null===top_face_z?vA.z:top_face_z));\n geo.vertices.push(new THREE.Vector3(vB.x, vB.y, null===top_face_z?vB.z:top_face_z));\n geo.vertices.push(new THREE.Vector3(vC.x, vC.y, null===top_face_z?vC.z:top_face_z));\n geo.faces.push( new THREE.Face3( iv, iv+1, iv+2 ) );\n iv = iv+3;\n }\n }\n }\n }\n else\n {\n throw 'Is this section of code ever called?'\n\n var positions = geometry.vb ? geometry.vb : attributes.position.array;\n var stride = geometry.vb ? geometry.vbstride : 3;\n\n for (var i = 0, il = positions.length; i < il; i += 3) {\n\n var a = i;\n var b = i + 1;\n var c = i + 2;\n\n // copy code from above if this `else` clause is ever required\n }\n }\n // var geo = new THREE.Geometry();\n // var holes = [];\n // var triangles = ShapeUtils.triangulateShape( floor_top_vertices, holes );\n // for( var i = 0; i < triangles.length; i++ ){\n // geo.faces.push( new THREE.Face3( triangles[i][0], triangles[i][1], triangles[i][2] ));\n // }\n\n geo.computeFaceNormals();\n geo.computeVertexNormals();\n geo.computeBoundingBox();\n //geo.computeBoundingSphere();\n var mesh = new THREE.Mesh( geo, this._shaderMaterial );\n return mesh;\n }", "title": "" }, { "docid": "5f294a8f8078ef0912ac47a802535eee", "score": "0.54803616", "text": "function Triangulate( vertices ) {\n\tvar triangles = [];\n\n\t//\n\t// First, create a \"supertriangle\" that bounds all vertices\n\t//\n\tvar st = CreateBoundingTriangle( vertices );\n\n\ttriangles.push( st );\n\n\t//\n\t// Next, begin the triangulation one vertex at a time\n\t//\n\tvar i;\n\tfor( i in vertices ) {\n\t\t// NOTE: This is O(n^2) - can be optimized by sorting vertices\n\t\t// along the x-axis and only considering triangles that have \n\t\t// potentially overlapping circumcircles\n\n\t\tvar vertex = vertices[i];\n\t\tAddVertex( vertex, triangles );\n\t}\n\n\t//\n\t// Remove triangles that shared edges with \"supertriangle\"\n\t//\n\tfor( i in triangles ) {\n\t\tvar triangle = triangles[i];\n\n\t\tif( triangle.v0 == st.v0 || triangle.v0 == st.v1 || triangle.v0 == st.v2 ||\n\t\t\ttriangle.v1 == st.v0 || triangle.v1 == st.v1 || triangle.v1 == st.v2 ||\n\t\t\ttriangle.v2 == st.v0 || triangle.v2 == st.v1 || triangle.v2 == st.v2 )\n\t\t{\n\t\t\tdelete triangles[i];\n\t\t}\n\t}\n\n\treturn triangles;\n\t\n} // Triangulate", "title": "" }, { "docid": "f197404865acae7a53e3911191c34928", "score": "0.54687804", "text": "function v(x,y,z){ \n return new THREE.Vertex(new THREE.Vector3(x,y,z)); \n }", "title": "" }, { "docid": "0f96d28cdb3a4063b2df71de2f8c7a29", "score": "0.54593104", "text": "function tetrahedron (a, b, c, d, n, type) {\n\tdivideTriangle (a, b, c, n, type);\n\tdivideTriangle (d, c, b, n, type);\n\tdivideTriangle (a, d, b, n, type);\n\tdivideTriangle (a, c, d, n, type);\n}", "title": "" }, { "docid": "42d96dd10b9ac0a7b1899276a8a980e2", "score": "0.5456206", "text": "function createFlatCube(x, y, z, size, material) {\n 'use strict'\n\t\n\tgeometry = new THREE.CubeGeometry(size, size, THICKNESS);\n\n\tmesh = new THREE.Mesh(geometry, material);\n\t\n\tmesh.position.set(x, y, z);\n\n\tmesh.rotation.z += Math.PI/4;\n\t\n\ttertiary_segment.add(mesh);\n}", "title": "" }, { "docid": "ae9da67d8e4cd7bca7aa5c0a2c3beb30", "score": "0.545325", "text": "function BoundingVolumeMeshBuilder() {}", "title": "" }, { "docid": "34a67ea6c43557e4380ad7d2292e5797", "score": "0.54509884", "text": "function makeMesh(geometry, color) {\n const material = new THREE.MeshBasicMaterial({color});\n const mesh = new THREE.Mesh(geometry, material);\n\n return mesh;\n}", "title": "" }, { "docid": "80d292b21c7ca60b46f95971f7c2decd", "score": "0.54413974", "text": "function buildLeafGeometry() {\n let leafGeometry = new THREE.Geometry();\n\n let stem = new THREE.CylinderGeometry(0.01, 0.15, 3, 8);\n let stemMesh = new THREE.Mesh(stem);\n stemMesh.position.set(0, 1.5, 0);\n\n leafGeometry.mergeMesh(stemMesh);\n\n let leafBody = new THREE.Geometry();\n\n leafBody.vertices.push( new THREE.Vector3(0,0,0) );\n leafBody.vertices.push( new THREE.Vector3(-1.5,1.5,1) );\n leafBody.vertices.push( new THREE.Vector3(1.5,1.5,1) );\n leafBody.vertices.push( new THREE.Vector3(-1,4,0.5) );\n leafBody.vertices.push( new THREE.Vector3(1,4,0.5) );\n leafBody.vertices.push( new THREE.Vector3(0,5.5,-1) ) ;\n\n leafBody.faces.push( new THREE.Face3( 0, 1, 3 ) );\n leafBody.faces.push( new THREE.Face3( 0, 3, 5 ) );\n leafBody.faces.push( new THREE.Face3( 0, 5, 4 ) );\n leafBody.faces.push( new THREE.Face3( 0, 4, 2 ) );\n leafBody.faces.push( new THREE.Face3( 3, 1, 0 ) );\n leafBody.faces.push( new THREE.Face3( 5, 3, 0 ) );\n leafBody.faces.push( new THREE.Face3( 4, 5, 0 ) );\n leafBody.faces.push( new THREE.Face3( 2, 4, 0 ) );\n\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(1, .5),new THREE.Vector2(.6, 1),new THREE.Vector2(.15, 1)]);\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(1, .5),new THREE.Vector2(.15, 1),new THREE.Vector2(0, .5)]);\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(1, .5),new THREE.Vector2(0, .5),new THREE.Vector2(.15, 0)]);\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(1, .5),new THREE.Vector2(.15, 0),new THREE.Vector2(.6, 0)]);\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(.15, 1),new THREE.Vector2(.6, 1),new THREE.Vector2(1, .5)]);\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(0, .5),new THREE.Vector2(.15, 1),new THREE.Vector2(1, .5)]);\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(.15, 0),new THREE.Vector2(0, .5),new THREE.Vector2(1, .5)]);\n leafBody.faceVertexUvs[0].push([new THREE.Vector2(.6, 0),new THREE.Vector2(.15, 0),new THREE.Vector2(1, .5)]);\n leafBody.computeFaceNormals();\n\n let leafMesh = new THREE.Mesh(leafBody);\n leafMesh.position.set(0, 1.5, 0);\n\n leafGeometry.mergeMesh(leafMesh);\n return leafGeometry;\n}", "title": "" }, { "docid": "101441170c5d0651a3020b398955fff3", "score": "0.5439967", "text": "constructor(startPoint, endPoint, shape, lineMaterial, meshMaterial, direction, rotation, length, sectionName) {\n this.direction = direction;\n this.wireframe = createWireframe(startPoint, endPoint, lineMaterial, rotation);\n this.extruded = createExtrudedMesh(shape, length, meshMaterial);\n this.mesh = this.wireframe; //Currently rendered mesh\n this.unusedMesh = this.extruded; // not rendered currently\n this.unusedMesh.userData = this.mesh.userData; //to save the same data at toggle view\n this.temp = null; //Used to Swap Meshes at tougle view\n this.endPoint = endPoint;\n this.sectionName = sectionName;\n }", "title": "" }, { "docid": "0d2ca0a803c1f73b65d5a1d5beec630b", "score": "0.54383856", "text": "function addMesh(t) { // color, url, caption\n var _mesh = new X.mesh();\n _mesh.color = t['color'];\n _mesh.file = encodeURI(t['url']);\n _mesh.caption = t['label']\n// _mesh.caption = t['caption'];\n// _mesh.label = t['label'];\n// _mesh.id= t['id'];\n ren3d.add(_mesh);\n\n// meshs[0] is the _mesh, meshs[1] is the original object\n var _cnt=meshs.push([_mesh,t]);\n var _name=t['id'];\n var _label=t['label'];\n \n var _href=getHref(t);\n if(TESTMODE) {\n addTESTMeshListEntry(_label,_name,_cnt-1,t['color']);\n } else {\n addMeshListEntry(_label,_name,_cnt-1,t['color'],_href);\n }\n}", "title": "" }, { "docid": "8025140aa84bba92712c6d3b467d5104", "score": "0.5430091", "text": "function v(x,y,z){ \n\t return new THREE.Vertex(new THREE.Vector3(x,y,z)); \n\t }", "title": "" }, { "docid": "65ba90d70aa5b1c71f8d8af302bd52ed", "score": "0.54222935", "text": "createGeometry()\n {\n let points = this.executeMidpoint();\n this.pushPointsIntoVertices(points);\n\n // Prepare specifics buffers for WebGL\n this.getBufferWithVertices();\n }", "title": "" }, { "docid": "5a0912d0d0aac87d79a19bdf5ba9b412", "score": "0.54185885", "text": "function createPrimitive(data) {\n\n var mesh = undefined;\n var geometry = undefined;\n var material = undefined;\n\n var materialProperties;\n if (data.attributes !== undefined) {\n materialProperties = data.attributes.materialProperties;\n }\n materialProperties = materialProperties || data.materialProperties || {};\n// materialProperties = _.defaults(materialProperties, {side: THREE.DoubleSide});\n\n switch (data.primitive) {\n case 'cone':\n geometry = new THREE.CylinderGeometry(0, data.radius, data.height, 32);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n moveGeometry(mesh, new THREE.Vector3(0, data.height / 2, 0));\n rotateGeometry(mesh, new THREE.Vector3(Math.PI / 2, Math.PI / 2, 0));\n break;\n\n case 'cylinder':\n geometry = new THREE.CylinderGeometry(data.radius, data.radius, data.height, 32);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n moveGeometry(mesh, new THREE.Vector3(0, data.height / 2, 0));\n rotateGeometry(mesh, new THREE.Vector3(Math.PI / 2, Math.PI / 2, 0));\n break;\n\n case 'sphere':\n geometry = new THREE.SphereBufferGeometry(data.radius, 12, 8);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n rotateGeometry(mesh, new THREE.Vector3(Math.PI / 2, Math.PI / 2, 0));\n break;\n\n case 'torus':\n geometry = new THREE.TorusGeometry(data.major_radius, data.minor_radius, 24, 24);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n break;\n\n case 'block':\n geometry = new THREE.BoxGeometry(data.dimensions[0], data.dimensions[1], data.dimensions[2]);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n rotateGeometry(mesh, new THREE.Vector3(0, 0, 0));\n break;\n\n case 'circle':\n geometry = new THREE.CircleGeometry(data.radius, 32);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n break;\n\n case 'rectangle':\n geometry = new THREE.PlaneBufferGeometry(data.dimensions[0], data.dimensions[1], 1, 1);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n break;\n\n case 'plane':\n geometry = new THREE.PlaneBufferGeometry(10000, 10000, 100, 100);\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n break;\n\n case 'point':\n case 'point-2d':\n var positions = new Float32Array(3);\n geometry = new THREE.BufferGeometry();\n positions[0] = data.point[0];\n positions[1] = data.point[1];\n positions[2] = data.point[2] || 0;\n geometry.addAttribute('position',\n new THREE.BufferAttribute(positions, 3));\n geometry.computeBoundingBox();\n material = new THREE.PointsMaterial(materialProperties);\n mesh = new THREE.Points(geometry, material);\n break;\n\n case 'vector':\n var dir = new THREE.Vector3(data.coords[0], data.coords[1], data.coords[2] );\n var length = dir.length();\n var origin = new THREE.Vector3( 0, 0, 0 );\n if (length > 0) {\n dir.normalize();\n } else {\n console.warn(\"Vector primitive has length zero.\")\n }\n // ArrowHelper handles creation of THREE Geometry and Material objects\n // and wraps them up in an Object3D\n mesh = new THREE.ArrowHelper( dir, origin, length);\n break;\n\n case 'line':\n geometry = new THREE.Geometry();\n geometry.vertices.push(new THREE.Vector3(\n data.start[0],\n data.start[1],\n data.start[2]\n ));\n geometry.vertices.push(new THREE.Vector3(\n data.end[0],\n data.end[1],\n data.end[2]\n ));\n material = new THREE.LineBasicMaterial(materialProperties);\n mesh = new THREE.Line(geometry, material);\n break;\n\n case 'curve':\n // TODO(aki): Test with more complex parasolid curves\n var nurbsControlPoints = [];\n var cp = data.controlPoints;\n for (var i = 0; i < cp.length; i++) {\n var w = 1;\n if (data.weights !== undefined) {\n w = data.weights[i];\n }\n nurbsControlPoints.push(\n new THREE.Vector4(\n cp[i][0],\n cp[i][1],\n cp[i][2],\n w // weight of control point: higher means stronger attraction\n )\n );\n }\n\n // Respect the incoming parasolid knot vector length, which is\n // N + D + 1. See: http://www.rhino3d.com/nurbs/\n if (data.knots.length !== nurbsControlPoints.length + data.degree + 1) {\n console.warn('Number of uKnots in a NURBS curve should eaqual degree + N + 1, where N is the number of control points.');\n }\n\n var nurbsCurve = new THREE.NURBSCurve(\n data.degree, data.knots, nurbsControlPoints);\n geometry = new THREE.Geometry();\n // Set resolution of polyline for given number of control points and degree.\n var numPoints = cp.length * data.degree * 4;\n // Sample points for curves of degree >1, else render control points\n if (data.degree > 1) {\n geometry.vertices = nurbsCurve.getPoints(numPoints);\n } else {\n geometry.vertices = nurbsControlPoints;\n }\n material = new THREE.LineBasicMaterial(materialProperties);\n mesh = new THREE.Line(geometry, material);\n break;\n\n case 'mesh':\n geometry = new THREE.Geometry();\n\n data.vertices.forEach(function(vertex) {\n geometry.vertices.push(\n new THREE.Vector3(vertex[0], vertex[1], vertex[2])\n );\n });\n\n data.faces.forEach(function(face) {\n if (face.length === 3) {\n geometry.faces.push(\n new THREE.Face3(face[0], face[1], face[2])\n );\n } else if (face.length === 4) {\n geometry.faces.push(\n new THREE.Face3(face[0], face[1], face[2])\n );\n geometry.faces.push(\n new THREE.Face3(face[0], face[2], face[3])\n );\n }\n });\n\n geometry.computeBoundingSphere();\n geometry.computeFaceNormals();\n\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n break;\n\n // 'polygon-set' is deprecated, but we'll keep it around because\n // old projects may still generate data that uses it.\n// case 'polygon-set':\n// case 'polygonSet':\n// var allPolygons = new THREE.Geometry();\n// data.polygons.forEach(function(polygon) {\n// mesh = makeShapeFromPolygon_(polygon);\n// allPolygons.merge( mesh.geometry, mesh.matrix );\n// }.bind(this));\n// material = new THREE.MeshPhongMaterial(materialProperties);\n// mesh = new THREE.Mesh(allPolygons, material);\n// break;\n\n case 'polyline':\n geometry = new THREE.Geometry();\n for(var i = 0; i < data.points.length; i++) {\n geometry.vertices.push(new THREE.Vector3(\n data.points[i][0],\n data.points[i][1],\n data.points[i][2]));\n }\n material = new THREE.LineBasicMaterial(materialProperties);\n mesh = new THREE.Line(geometry, material);\n break;\n\n case 'surface':\n var nsControlPoints = [];\n\n var cp = data.controlPoints;\n cp.forEach(function(cpRow, j) {\n var array = [];\n nsControlPoints.push(array);\n cpRow.forEach(function(point, k) {\n var w = 1;\n if (data.weights !== undefined) {\n w = data.weights[k*cp.length + j];\n }\n array.push(\n new THREE.Vector4(\n point[0],\n point[1],\n point[2],\n w // weight of control point: higher means stronger attraction\n )\n );\n });\n });\n\n\n // Respect the incoming parasolid knot vector length, which is\n // N + D + 1. See: http://www.rhino3d.com/nurbs/\n if (data.uKnots.length !== nsControlPoints[0].length + data.uDegree + 1) {\n console.warn('Number of uKnots in a NURBS surface should eaqual uDegree + N + 1, where N is the number of control points along U direction.');\n }\n if (data.vKnots.length !== nsControlPoints.length + data.vDegree + 1) {\n console.warn('Number of vKnots in a NURBS surface should eaqual vDegree + N + 1, where N is the number of control points along V direction.');\n }\n\n // nsControlPoints matrix has rows and columns swapped compared to three.js NURBSSurface.\n var nurbsSurface = new THREE.NURBSSurface(data.vDegree, data.uDegree, data.vKnots, data.uKnots, nsControlPoints);\n\n var getSurfacePoint = function(u, v) {\n return nurbsSurface.getPoint(u, v);\n };\n\n geometry = new THREE.ParametricGeometry(\n getSurfacePoint,\n // Set resolution of polyline for given number of control points and degree.\n data.vDegree * nsControlPoints.length * 4,\n data.uDegree * nsControlPoints[0].length * 4\n );\n geometry.computeFaceNormals();\n material = new THREE.MeshPhongMaterial(materialProperties);\n mesh = new THREE.Mesh(geometry, material);\n break;\n\n // TODO(aki): this is temporary\n // Note that the text is not a primitive supported by parasolid.\n case 'text':\n mesh = new THREE.TextHelper(data.text, {size: data.size, resolution: data.resolution, color: data.color, align: data.align});\n break;\n }\n\n if (mesh) {\n convertToZUp(mesh);\n if (data.origin) {\n mesh.position.set(\n data.origin[0],\n data.origin[1],\n data.origin[2] || 0\n );\n }\n // Note: Axis, direction and normal appear to be the same except\n // that the 'normal' keyword is used in the context of the plane\n // primitive.\n // Direction is 'legacy' support for old values that may be hanging\n // out in people's data -- usage of the key is deprecated.\n // TODO(andrew): remove support for it.\n var axis = data.axis || data.direction || data.normal;\n if (axis) {\n mesh.lookAt(mesh.position.clone().add(\n new THREE.Vector3(\n axis[0],\n axis[1],\n axis[2]\n )\n ));\n }\n\n if (data.attributes && data.attributes.tag) {\n mesh.userData.tag = data.attributes.tag;\n }\n\n // Attach materialProperties to mesh so that flux-materialUtil can\n // find it and update the material object with those parsed values.\n mesh.materialProperties = materialProperties;\n return mesh;\n }\n else {\n console.warn(\"Unsupported geometry type: \" + data.primitive);\n }\n}", "title": "" }, { "docid": "0ebf1e9fb6a4584b2915238697628026", "score": "0.54148245", "text": "function Mesh(options) {\r\n options = options || {};\r\n this.vertexBuffers = {};\r\n this.indexBuffers = {};\r\n this.addVertexBuffer('vertices', 'gl_Vertex');\r\n if (options.coords) this.addVertexBuffer('coords', 'gl_TexCoord');\r\n if (options.normals) this.addVertexBuffer('normals', 'gl_Normal');\r\n if (options.colors) this.addVertexBuffer('colors', 'gl_Color');\r\n if (!('triangles' in options) || options.triangles) this.addIndexBuffer('triangles');\r\n if (options.lines) this.addIndexBuffer('lines');\r\n}", "title": "" } ]
3d517134c0f63110767cae920af70ce8
Starts a brand new search for a particular subreddit Parameters: subredditName, the name of the subreddit to search ignoreWaiting, whether this function should ignore the fact that the progress bar is shown(presumably a request is waited on) afterParam, the parameter to send to reddit to get paginated results Returns: Nothing
[ { "docid": "cd0a3cfd45e2cb2a9c0b7ce2f50082f7", "score": "0.85951895", "text": "function searchSubreddit( subredditName, ignoreWaiting, afterParam )\n{\n // if the progress bar is being shown, then a search is currently being done so return(unless ignoreWaiting is true)\n if ( !ignoreWaiting && $( \"#waiting\" ).css( \"display\" ) != \"none\" )\n {\n return;\n }\n\n //set the progress bar down to zero,and show the progress bar(allowing for it to be updated ny setting canUpdateProgress to true)\n setProgress( 0 );\n canUpdateProgress = true;\n $( \"#waiting\" ).css( \"display\" , \"flex\" );\n //clear out any old results/text in the mainBody\n clearBody( \"#mainBodyDown\" );\n //send a request for the subreddit given\n requestSubreddit( subredditName, afterParam );\n}", "title": "" } ]
[ { "docid": "9e150d0af4b50a35585d3cb3ce1eac4b", "score": "0.7175046", "text": "function requestSubreddit( subredditName, afterParam )\n{\n currentSubreddit = subredditName;\n var paramObj = { \"limit\" : 100 };\n if ( afterParam != undefined )\n {\n paramObj[ \"after\" ] = afterParam;\n }\n\n updateProgress();\n //escape any characters in the subreddit name so as to send in url\n var urlGet = \"https://www.reddit.com/r/\" + encodeURIComponent( subredditName ) + \"/new/.json\" \n $.get( urlGet, paramObj, handleSubreddit ).fail( failSearch );\n}", "title": "" }, { "docid": "ad623a230606e61df826bdabcfc6936b", "score": "0.6369862", "text": "function searchForSubreddit() {\n\n\tif (searchBox.val().length != 0) {\n\t\t//If the search box has an entry\n\t\tresultsStatus.show();\n\t\tresultsStatus.text(\"Loading...\");\n\n\t\t$.getJSON('https://reddit.com/r/' + searchBox.val() + '.json').then(function(results) {\n\n\t\t\tif (results.data.children.length == 0) {\n\t\t\t\tresultsStatus.text(searchBox.val() + \" is not a subreddit\");\n\t\t\t} else {\n\t\t\t\tresultsStatus.hide();\n\t\t\t\tconsole.log(results);\n\n\t\t\t\tcompileSearchResults(results);\n\n\t\t\t}\n\n\t\t}, function(error) {\n\t\t\t// If we got an error on the API request\n\t\t\tresultsStatus.text(searchBox.val() + \" is not a subreddit\");\n\t\t});\n\t} else {\n\t\t// If the search box is empty\n\n\t\tresultsStatus.show();\n\t\tresultsStatus.text(\"Enter a subreddit above\");\n\t}\n\n}", "title": "" }, { "docid": "2ab9a5fa3f6809694564c7c427d75a68", "score": "0.58347493", "text": "function searchSubredditByForm()\n{\n searchSubreddit( $( \"#redditSearch\" ).val(), false );\n}", "title": "" }, { "docid": "55a99cf9f583daf2013027f1c9953516", "score": "0.5705899", "text": "async addSearch(info) {\n const subreddit = info[0].toLowerCase();\n const term = info[1].toLowerCase();\n let response;\n\n try {\n response = await axios.get(`http://oauth.reddit.com/r/${subreddit}/new.json`, postConfig);\n } catch {\n this.channel.send(\"Invalid subreddit\")\n return\n };\n\n if (this.posts[subreddit]) {\n this.posts[subreddit].push(term);\n this.channel.send(`Tracking ${term} in ${subreddit}`)\n }\n else {\n this.posts[subreddit] = [term]\n this.channel.send(`Tracking ${term} in ${subreddit}`)\n };\n }", "title": "" }, { "docid": "c78c3e854f4767c861cbc6dfe57ca3e0", "score": "0.56307495", "text": "function queryReddit(after, count){\n\tupdateInfo(\"searching reddit...\");\n\t$.getJSON(queryURL, {\n\t\t'after':after,\n\t\t'count':count\n\t}, function(data) {\n\t\tlogResult(data, count);\n\t});\n\n\tsetTimeout(function() {\n\t\tif (rawCommentArray.length == 0 && $(\"#info\").html() == \"searching reddit...\"){\n\t\t \tupdateInfo(\"No response from reddit - either the username is incorrect or servers are down\");\n\t\t \tcurrentlyQuerying = false;\n\t\t}\n\t}, 4000);\n}", "title": "" }, { "docid": "6e8647792d132f3b290882ccfa431f91", "score": "0.55584306", "text": "function searchSubredditByClick()\n{\n searchSubreddit( $( this ).text(), false );\n}", "title": "" }, { "docid": "6449043acbf59119d9f0090c4c069146", "score": "0.5527151", "text": "function newSearch(){\r\n //if search query has changed and is not empty...\r\n var query = document.getElementById('search-bar').value;\r\n if( query !== activeSearch && query !== ''){\r\n\r\n //disable the load more button (because it might be\r\n //enabled from a previous search)\r\n document.getElementById('load-more').disabled = true;\r\n\r\n //success callback for ajax request\r\n var success = function(result){\r\n //store current query so it can be used to load more results\r\n activeSearch = query;\r\n\r\n //if api call returns no results, display this to user\r\n if( result.query.search.length === 0){\r\n document.getElementById('results').innerHTML = '<p>No Results Match Your Search</p>'\r\n }\r\n //otherwise display the results to user\r\n else{\r\n document.getElementById('results').innerHTML = resultsToHtml(result.query.search);\r\n //update results offset for next api call\r\n //and re-enable load more button if the api call says \r\n //that there are more results available\r\n if( result['continue'] ){\r\n nextOffset = result['continue'].sroffset;\r\n document.getElementById('load-more').disabled = false;\r\n }\r\n //otherwise, tell the user there are no more results \r\n //(keep load more button disabled )\r\n else{\r\n document.getElementById('results').innerHTML += '<p>No More Results</p>';\r\n }\r\n }\r\n }\r\n //error callback for ajax request:\r\n //tell the user there was an error loading more results\r\n var error = function(){\r\n document.getElementById('results').innerHTML = \r\n 'There was an error while attempting your search';\r\n }\r\n\r\n //send request to wiki api\r\n searchWiki(query, 0, success, error);\r\n }\r\n}", "title": "" }, { "docid": "e176355628de65270b1ce704cbae79cd", "score": "0.55175334", "text": "function search(url, params, mode, card_generator, divToUse) {\n // mode should be 'OVERWRITE', 'APPEND', or 'MODAL'\n mode = mode || 'OVERWRITE';\n\n if (requesting !== null) {\n window.requesting.abort();\n }\n\n if (params === null) {\n return;\n }\n\n if (mode == 'OVERWRITE') {\n params = add_elastic_params(params);\n }\n\n window.lastQuery = params;\n let newReq = $.get(url, params);\n window.requesting = newReq;\n\n if (mode == 'OVERWRITE' || mode == 'APPEND') {\n change_next_page_text('Loading...');\n }\n\n if (mode == 'OVERWRITE') {\n update_filter_summary(params);\n display_loading_bar(true);\n display_confused(false);\n update_results_header(null);\n clear_search_results();\n }\n\n newReq.done(data => {\n console.log(data);\n if (mode == 'OVERWRITE') {\n clear_search_results();\n }\n let num_results = display_query(data, divToUse, card_generator);\n if (mode == 'OVERWRITE' || mode == 'APPEND') {\n update_results_header(num_results);\n }\n })\n .fail(e => {\n if (e.statusText != 'abort') {\n display_error();\n }\n })\n .always(() => {\n if (mode == 'OVERWRITE') {\n display_loading_bar(false);\n }\n\n if (mode == 'OVERWRITE' || mode == 'APPEND') {\n change_next_page_text('Next Page');\n }\n // disable_search_buttons(false);\n window.requesting = null;\n });\n}", "title": "" }, { "docid": "ce42120c12959c536c9dc101d36bc19b", "score": "0.548087", "text": "function performSearch() {\n var url = siteUrl + 'book',\n data = {\n 'quick': $fields.quick.val(),\n 'title': $fields.title.val(),\n 'subtitle': $fields.subtitle.val(),\n 'author': $fields.author.val(),\n 'series': $fields.series.val(),\n 'publisher': $fields.publisher.val(),\n 'isbn': $fields.isbn.val(),\n },\n method = 'GET',\n returning = 'json';\n\n $runBtn.addClass('hidden');\n $searchingBtn.removeClass('hidden');\n $.ajax({'url': url, 'data': data, 'type': method, 'dataType': returning})\n .always(function () {\n $searchingBtn.addClass('hidden');\n $runBtn.removeClass('hidden');\n })\n .done(handleSearchData)\n .fail(onLibrary.handleAjaxError);\n }//end performSearch()", "title": "" }, { "docid": "5cf4288c425697d7a5fb8b2ed09095b0", "score": "0.5427154", "text": "function startSearch(searchType, searchString){\n\n currentSearchTerm=searchString; //set the global vars\n currentSelectedSearchType=searchType; //override the global var again incase startSearch is called another way\n\n if(searchString !=\"\"){\n switch(searchType){\n case \"Party\":\n //for the future\n break;\n case \"Patent Number\": //do a patent number search\n searchString = searchString.split(\",\").join(\"\"); //take out the commas if entered;\n httpGetAsync('https://ptabdata.uspto.gov/ptab-api/trials?patentNumber='+searchString,parsePTABSearch);\n break;\n\n case \"Trial Number\": //do a trial number search, note we can search directly for the documents here. returns 400 if nothing is found.\n httpGetAsync('https://ptabdata.uspto.gov/ptab-api/trials?trialNumber='+searchString,parsePTABSearch,searchString);\n //httpGetAsync('https://ptabdata.uspto.gov/ptab-api/trials/'+searchString+'/documents',parsePTABDocuments);\n break;\n default:\n //httpGetAsync('https://ptabdata.uspto.gov/ptab-api/trials/'+searchString+'/documents',parsePTABDocuments);\n httpGetAsync('https://ptabdata.uspto.gov/ptab-api/trials?trialNumber='+searchString,parsePTABSearch,searchString);\n\n break;\n }\n }\n\n\n}", "title": "" }, { "docid": "e63d954cb739d06bc6c25a4b9a0cae60", "score": "0.5368287", "text": "function processSearch( ){\n\trequire( [ \"dijit/registry\" ], function( registry ){\n\t\tvar widget = registry.byId( \"mainSearch\" );\n\t\t\n\t\tif( !widget.item ){\n\t\t\tif( widget.get( \"value\" ).length > 0 ){\n\t\t\t\tbackupSearch( widget.get( \"value\" ) );\t\n\t\t\t}\t\n\t\t}else{\n\t\t\tdocument.querySelector( \"#searchclear\" ).classList.add( \"hidden\" );\n\t\t\tdocument.querySelector( \"#searchprogress\" ).classList.remove( \"hidden\" );\n\t\t\tfinder( widget.item.i, \"searchresults\" );\t\n\t\t\tlastSearch = \"main\";\n\t\t}\n\t} );\n}", "title": "" }, { "docid": "21d8f8802ef80141bf4d0f136424d026", "score": "0.53147095", "text": "function gotoSubreddit(query) {\n\tmySearch.goto(`http://reddit.com/r/${query}`);\n}", "title": "" }, { "docid": "c821e2e38fd29041a8f9e3d608f9d191", "score": "0.5296582", "text": "function inputCheck(){\nvar searchtype = \"Fast\";\nvar subreddit = document.getElementById(\"subreddit\").value;\nvar flag=true;\n\nvar xmlhttp=httpObject();\n\nfor(var i=0; i <= subreddit.length; i++){\n if((subreddit.charCodeAt(i) >= 65 && subreddit.charCodeAt(i) <= 90) || (subreddit.charCodeAt(i) >= 97 && subreddit.charCodeAt(i) <= 122)){\n flag=false;\n break;\n }\n}\n\nif(flag){\n var warning = document.getElementById(\"warning-container\");\n warning.style.visibility = \"visible\";\n return;\n}\nelse{\n xmlhttp.open(\"GET\", \"https://www.reddit.com/subreddits/search.json?q=\" + subreddit +\"&limit=1\", true);\n xmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n xmlhttp.send();\n\n xmlhttp.onreadystatechange = function(){\n\n if(xmlhttp.readyState == 4 && xmlhttp.status == 200){\n var validSub = JSON.parse(xmlhttp.responseText);\n try{\n if(validSub.data.children[\"0\"].kind ===\"t5\" && validSub.data.children[\"0\"].data.public_traffic === true){\n var subreddit = document.getElementById(\"subreddit\").value;\n runAJAX(subreddit);\n }\n }\n catch(err){\n var warning = document.getElementById(\"warning-container\");\n warning.style.visibility = \"visible\";\n return;\n }\n if(!validSub.data.children[\"0\"].data.public_traffic){\n var warning = document.getElementById(\"warning-container\");\n warning.style.visibility = \"visible\";\n return;\n }\n }\n }\n\n}\n}", "title": "" }, { "docid": "a5863b57917f70c84461d6e5127e7a26", "score": "0.5271434", "text": "async function search(pageCounter = 1 ) {\n \n let request;\n \n if (e.searchResults.style.color === 'black') {\n // searching for 'q' string request\n request = gapi.client.youtube.search.list({\n q: e.searchInput.value,\n part: 'snippet',\n maxResults: '9',\n pageToken: pageToken,\n order: e.order.value,\n videoDefinition: e.videoDefinition.value,\n publishedAfter: formatDateTimeForSearch(e.timeAfter.value),\n publishedBefore: formatDateTimeForSearch(e.timeBefore.value),\n type: 'video'\n });\n requestType = 'searchResults'\n } else {\n // searching for related videos to chosen one\n request = gapi.client.youtube.search.list({\n part: 'snippet',\n maxResults: '9',\n pageToken: pageToken,\n order: e.order.value,\n videoDefinition: e.videoDefinition.value,\n publishedAfter: formatDateTimeForSearch(e.timeAfter.value),\n publishedBefore: formatDateTimeForSearch(e.timeBefore.value),\n relatedToVideoId: chosenVideoId,\n type: 'video'\n });\n requestType = 'relatedVideos'\n};\n\n// Saved response checking\n\n if (requestType === 'searchResults' && searchResultsResponse) {\n response = searchResultsResponse;\n workingWithResponse(response)\n } else {\n await request.execute( response => workingWithResponse(response))\n };\n \n if (requestType === 'relatedVideos' && relatedVideosResponse) {\n response = relatedVideosResponse;\n workingWithResponse(response)\n } else {\n await request.execute( response => workingWithResponse(response))\n };\n \n function workingWithResponse(response) {\n \n // request results checking\n if (response.items.length !== 0) {\n e.page.style.visibility = e.pageBottom.style.visibility = 'visible';\n e.videoList.innerHTML = '';\n \n // saving response to local variables\n if (requestType === 'searchResults') {\n searchResultsResponse = response;\n };\n if (requestType === 'relatedVideos') {\n relatedVideosResponse = response;\n };\n\n } else {\n e.videoList.innerHTML = `<h3>No results for: \"<i>${searchInput.value}</i>\"</h3>`;\n e.page.style.visibility = e.pageBottom.style.visibility = 'hidden';\n };\n\n // Page navigating\n if (requestType !== 'relatedVideos') {\n e.page.style.visibility = e.pageBottom.style.visibility = 'visible'\n } else {\n e.page.style.visibility = e.pageBottom.style.visibility = 'hidden'\n };\n e.page.innerHTML = e.pageBottom.innerHTML = 'Page ' + pageCounter;\n \n if (response.nextPageToken) {\n e.next.style.display = e.nextBottom.style.display = 'inline';\n e.next.onclick = e.nextBottom.onclick = () => {\n if (requestType === 'searchResults') {\n pageCounter++;\n savedPageCounter = pageCounter;\n searchResultsPageToken = response.nextPageToken;\n };\n if (requestType === 'relatedVideos') {\n relatedVideosPageToken = response.nextPageToken;\n };\n pageToken = response.nextPageToken;\n search(pageCounter)\n }\n } else {\n e.next.style.display = e.nextBottom.style.display = 'none'\n }\n\n if (response.prevPageToken) {\n e.prev.style.display = e.prevBottom.style.display = 'inline';\n e.page.style.marginLeft = e.pageBottom.style.marginLeft = '0';\n e.prev.onclick = e.prevBottom.onclick = () => {\n if (requestType === 'searchResults') {\n pageCounter--;\n savedPageCounter = pageCounter;\n searchResultsPageToken = response.prevPageToken;\n };\n if (requestType === 'relatedVideos') {\n relatedVideosPageToken = response.prevPageToken;\n };\n pageToken = response.prevPageToken;\n search(pageCounter)\n }\n } else {\n e.prev.style.display = e.prevBottom.style.display = 'none';\n e.page.style.marginLeft = e.pageBottom.style.marginLeft = '2.25em'\n };\n\n if (pageCounter > 1 && requestType !== 'relatedVideos') {\n e.firstPage.style.display = e.firstPageBottom.style.display = 'inline';\n e.firstPage.onclick = e.firstPageBottom.onclick = () => {\n pageToken = '';\n search()\n };\n } else {\n e.firstPage.style.display = e.firstPageBottom.style.display = 'none';\n }\n\n // Building results grid\n response.items.forEach( item => {\n e.videoList.innerHTML += videoListGridOptions(\n item.etag,\n item.snippet.thumbnails.medium.url,\n item.snippet.title\n );\n });\n \n if (e.videoChosen.style.display) {\n sideClassAdd()\n };\n \n // Showing chosen video\n showChosenVideo = (id) => {\n response.items.forEach( item => {\n if (item.etag === '\"'+id+'\"') {\n e.relatedVideos.style.display = 'inline';\n chosenVideoId = item.id.videoId;\n e.chosenTitle.innerHTML = item.snippet.title;\n e.chosenIframe.src = `https://www.youtube.com/embed/${chosenVideoId}`;\n e.chosenChannel.innerHTML = `\n <span>${item.snippet.channelTitle}</span> - Channel`;\n\n if (e.chosenDescription.innerHTML !== 'Description') {\n e.chosenDescription.innerHTML = item.snippet.description;\n };\n // Handling description click\n e.chosenDescription.onclick = () => {\n if (e.chosenDescription.innerHTML === 'Description') {\n e.chosenDescription.style.color = 'black';\n e.chosenDescription.innerHTML = item.snippet.description;\n } else {\n e.chosenDescription.innerHTML = 'Description';\n e.chosenDescription.style.color = 'rgb(100,100,100)';\n }\n };\n // First time video choosing checking\n if (!e.videoChosen.style.display) {\n sideClassAdd();\n e.searchResultsDiv.classList.remove('search-results-width');\n e.searchResultsDiv.classList.add('search-results-width-side');\n e.videoList.classList.remove('video-list-grid');\n e.videoList.classList.add('video-list-grid-side');\n e.searchResults.style.opacity = '0.9';\n setTimeout(() => {e.videoChosen.style.display = 'block'},200);\n setTimeout(() => {e.searchResults.style.opacity = '1'},200);\n setTimeout(() => {e.videoChosen.style.opacity = '1'},200);\n setTimeout(() => {e.videoChosen.style.filter = 'blur(0)'},300);\n };\n e.chosenIframe.style.filter = 'blur(5px)';\n setTimeout(() => {e.chosenIframe.style.filter = 'blur(0)'},300);\n \n if (requestType === 'relatedVideos') {\n search()\n }\n }\n });\n };\n };\n}", "title": "" }, { "docid": "571849ccfb5b891404a09519da561094", "score": "0.52519983", "text": "function runWebsiteSearch(){\n\t\tvar searchString = s.websiteSearchUrl + s.query;\n\t\t// log('running search');\n\t\t$.getJSON(searchString, function (data) {\n\t\t\tif (data.items || data.promotions){\n\t\t\t\t// log('we've got results');\n\t\t\t\ts.totalResults = data.searchInformation.totalResults;\n\t\t\t\tif (data.items){ /*[1]*/\n\t\t\t\t\ts.pageResults = formatWebsiteResults(data.items);\n\t\t\t\t\taddResults();\n\t\t\t\t}\n\t\t\t\tif (data.promotions){ /*[2]*/\n\t\t\t\t\ts.totalResults += data.promotions.length;\n\t\t\t\t\ts.promoResults = formatWebsitePromos(data.promotions);\n\t\t\t\t\taddPromotions();\n\t\t\t\t}\n\t\t\t\tpopulateList(s.combinedResults); /*[3]*/\n\t\t\t\tif (s.totalResults > s.resCount){\n\t\t\t\t\taddMoreLink(); /*[4]*/\n\t\t\t\t}\n\t\t\t\ts.loader.css({'display':'none'});\n\t\t\t\tdone();\n\t\t\t}\n\t\t\telse{\n\t\t\t\thideAll();\n\t\t\t\tdone();\n\t\t\t\t// log('no results found');\n\t\t\t}\n\t\t}).error(function() {\n\t\t\thideAll();\n\t\t\tdone();\n\t\t});\n\t}", "title": "" }, { "docid": "836d7579b07b32bb72a854fd03835ed5", "score": "0.52435267", "text": "function wchcontentSearch(searchParams) {\r\n $(\"#main-page-loader\").css(\"display\", \"block\");\r\n var spl = searchParams.split(\",\");\r\n //var obj=JSON.stringify(spl);\r\n //var finalParams= obj.replace(/[\\[\\]']+/g,'');\r\n var str = \"\";\r\n for(var i=0; i < spl.length ; i++){\r\n if(i == 0)\r\n str = str + \"\\\"\" + spl[i] + \"\\\"\";\r\n else\r\n str = str + \",\\\"\" + spl[i] + \"\\\"\";\r\n }\r\n \r\n //alert(finalParams);\r\n var searchURL = baseTenantAPIURL + '/' + searchService + \"?q=*:*&defType=edismax&indent=on&qf=name+type+description+creator+locale+lastModifier+tags+categories+text&wt=json&fq=classification:(content)&fq=tags:(\"+str+\")&fq=type:(%22dsgtemplate%22)&&fl=*&document:[json]&wt=json&rows=50\";\r\n \r\n var reqOptions = {\r\n xhrFields: {\r\n withCredentials: true\r\n },\r\n dataType: \"json\",\r\n async: false,\r\n global: false,\r\n withCredentials:false,\r\n url: searchURL,\r\n };\r\n //console.log(searchURL);\r\n $.ajax(reqOptions).then(function(json) {\r\n console.log(\"jaon : \",json);\r\n searchItem(json)\r\n \r\n });\r\n $(\"#main-page-loader\").css(\"display\",\"none\");\r\n}", "title": "" }, { "docid": "b5750461ff8707b288e3842e13168e21", "score": "0.5226563", "text": "function startSearch(res, params) {\n //console.log(\"Entered startSearch, locationsFound = \" + locationsFound);\n if (locationsFound === 1) {\n routeSearch(res, params);\n } else {\n locationsFound++;\n }\n}", "title": "" }, { "docid": "c1360161ab420c314c4f60d8fddad86c", "score": "0.5223206", "text": "performSearch() {\n this.debouncer(() => {\n this.updateQueryString({\n [this.pageParameter]: 1,\n [this.searchParameter]: this.search,\n })\n })\n }", "title": "" }, { "docid": "596319d72f7ca7378cd592d4a1670ae9", "score": "0.51881105", "text": "function initSearch () {\n reset()\n\n // Default Parameters\n searchParameters = {\n q: '',\n order: service.sortOrder,\n videoDuration: service.durationFilter,\n part: 'snippet',\n type: 'video',\n maxResults: service.default_max_results,\n pageToken: '',\n key: youtubeApiKey\n }\n }", "title": "" }, { "docid": "3ffbe346a7046ed1c7174700ffabe3a9", "score": "0.5142657", "text": "function _searchSubmission() {\r\n vm.sindex = 0;\r\n var params = {index: vm.sindex, criteria: vm.criteria};\r\n restApi.searchSubmission(params).\r\n success(function (data, status, headers, config) {\r\n vm.smaxIndex = data.maxIndex;\r\n if (vm.smaxIndex == 0) {\r\n vm.sindex = 0;\r\n vm.submissionsList = [];\r\n }\r\n else if (vm.sindex >= vm.smaxIndex) {\r\n vm.sindex = vm.smaxIndex - 1;\r\n _searchSubmission(vm.sindex);\r\n }\r\n else {\r\n vm.submissionsList = data.results;\r\n }\r\n vm.submissionsList.forEach(function (sub, index2) {\r\n sub.acceptanceStatus = sub.status;\r\n });\r\n }).\r\n error(function (data, status, headers, config) {\r\n vm.toggleModal(\"error\");\r\n });\r\n }", "title": "" }, { "docid": "286e4d4f223164ed820c7491913fb34c", "score": "0.5107724", "text": "function renderSubreddit(event){\n $('#content').remove();\n var subreddit = $('input').val();\n $('#side').remove();\n $('#searchPage').remove();\n $.ajax({\n method: 'GET',\n url: \"https://www.reddit.com/r/\" + subreddit + \".json\",\n dataType: \"json\"\n }).done(function(result){\n makeContent(result);\n makeSide();\n }).fail(function(result){\n alert(subreddit + ' does not exist. Choose another Subreddit.');\n searchPage();\n });\n}", "title": "" }, { "docid": "2f9adbad9cfe96ee0e6823bff2305a28", "score": "0.5107019", "text": "function searchPage(){\n var $pageElement = $('<div/>');\n $('body').append($pageElement);\n $($pageElement).append($('<div/>').text(\"Search for a Subreddit\"));\n $pageElement.attr('id', 'searchPage');\n\n //creates search bar\n var $searchBar = $('<div/>');\n $($pageElement).append($searchBar);\n\n //creates form\n var $inputForm = $('<form/>');\n $inputForm.attr('class', 'search');\n $($searchBar).append($inputForm);\n var $inputSearch = $('<input/>');\n $($inputForm).append($inputSearch);\n $inputSearch.attr('class', 'submit');\n\n //creates submit button\n $submitButton = $('<button/>');\n $submitButton.text('Submit');\n $submitButton.attr('class', 'submitButton');\n $submitButton.click(renderSubreddit);\n $($searchBar).append($submitButton);\n\n //check if the user presses the enter key\n //if so, change the subreddit\n $('input').keypress(function(event){\n if(event.which === 13){\n event.preventDefault();\n $($submitButton).click();\n }\n });\n}", "title": "" }, { "docid": "6d8d46dfa5110853dfb94a60c25efe9e", "score": "0.50804967", "text": "function run_search(){\n // fetch search value\n search_value = document.getElementById('search').value;\n\n // check if searching by score / title or if search is empty\n if(search_value == \"\" || search_value == null){\n // if empty then fetch all books\n render_all();\n } else if(isNaN(search_value)){\n // if search is not a number then search by title\n search_title(search_value);\n } else {\n // if search is a number then search by score\n search_score(search_value);\n }\n}", "title": "" }, { "docid": "831d69baa7c2293652e61fcdd08f5a59", "score": "0.50788105", "text": "_startNewSearch() {\n if (!this.isOnline || !this.searchQuery) {\n return;\n }\n this.clearSearchPage();\n this.dispatch('initiateSearch', {\n limit: this.resultsPerLoad,\n query: this.searchQuery,\n language: this.language,\n restrict: this.currentFilter\n });\n this._generateRequest();\n }", "title": "" }, { "docid": "dc6bbe40cafbb062dee97172616be3a6", "score": "0.5074969", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"try_count: \"+my_query.try_count+\", Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "91fda7537fe18b3b3fc9b6f09fbdf771", "score": "0.5056265", "text": "function run(searchTerm) {\n // Declare a string to hold information returned from the search (begin the string by stating the search being ran).\n let resultsString = \"-\".repeat(45) + \"\\nnode liri.js {spotify-this-song}\";\n resultsString += searchTerm ? ' \"' + searchTerm + '\"\\n' + \" -\".repeat(18) : \"\\n\" + \" -\".repeat(18);\n // If an song name was given...\n if (searchTerm) {\n // Search the Spotify API for that song (function defined below).\n search(searchTerm, resultsString);\n }\n // If no artist/band was given, alert the user that they must provide an artist/band name.\n else {\n // Search the Spotify API for the song \"The Sign\" by 'Ace of Base'.\n search(\"the sign ace of base\", resultsString);\n }\n}", "title": "" }, { "docid": "17093a3d35c164703d736cd7c5a90070", "score": "0.5053654", "text": "function runSearch(query){\n console.log('running search');\n objectsQuery = query;\n objectsOffset = 0;\n objectsRetrieved = 0;\n // show spinner, but only if search hasn't returned within 100 ms\n if (!settings.isDefault){\n showSpinner = setTimeout(function(){\n settings.searchInput.siblings('.glyphicon-refresh').show();\n }, 400);\n }\n if (settings.type == 'quotes'){\n makeQuotesQuery(objectsQuery);\n } else if (settings.type == 'authors'){\n makeAuthorsQuery(objectsQuery);\n } else if (settings.type == 'works'){\n makeWorksQuery(objectsQuery);\n }\n }", "title": "" }, { "docid": "4f605a3679f25414892dda304a0c05ae", "score": "0.50492173", "text": "async removeSearch(info) {\n const subreddit = info[0].toLowerCase();\n const term = info[1].toLowerCase();\n\n if (!Object.keys(this.posts).includes(subreddit)) {\n this.channel.send(\"Subreddit is not being tracked\");\n return;\n };\n\n if (term) {\n let index = this.posts[subreddit].indexOf(term);\n this.posts[subreddit].splice(index, 1);\n if (this.posts[subreddit].length === 0) {\n delete this.posts[subreddit];\n }\n }\n else {\n delete this.posts[subreddit];\n };\n }", "title": "" }, { "docid": "320f2e5dba8f490ff50c9e86d22c6a3d", "score": "0.5046085", "text": "function runSearch(searchVal) {\n cycleCount++;\n setStatusText(`Search cycle #${cycleCount}`);\n halfCount = Math.round(vals.length / 2);\n midVal = vals[halfCount - 1];\n if (searchVal == midVal || vals.length == 1) {\n finishSearch();\n }\n else {\n jQuery(`.container #${midVal}`).addClass('checking');\n if (searchVal > midVal) {\n // keep the 2nd half\n vals = vals.slice(halfCount);\n }\n else {\n // keep the 1st half\n vals = vals.slice(0, halfCount - 1);\n }\n setTimeout(function() {\n updateNumbers();\n }, delay);\n setTimeout(function() {\n runSearch(searchVal);\n }, (delay * 2));\n }\n}", "title": "" }, { "docid": "45aec2c621e1d601ffcc1867da4a8c29", "score": "0.501804", "text": "function getSubreddit() {\r\n var subReddit = document.getElementById(\"search\").value;\r\n //in case that there is no input from the user\r\n\r\n if (subReddit == undefined || subReddit == \"\") {\r\n //define a default subreddit\r\n subReddit = 'funny';\r\n }\r\n return subReddit;\r\n}", "title": "" }, { "docid": "773f48106b456fc08cd45c68c1064bf6", "score": "0.49997345", "text": "function search()\n{\n\t//Clear the results\n\t$('#results').html('');\n\t$('#buttons').html('');\n\t//Get form input\n\tquery=$('#searchbox').val();\t\n\n\t//Run ajax request on api\n\t$.ajax({\n\t\turl:\"https://www.googleapis.com/youtube/v3/search\",\n\t\ttype:'GET',\n\t\tdata:{part:'snippet,id', q:query, type:'video', key:'AIzaSyARJaiiUpn8_tHaVeD-3mXfWPcUScN4IJg'},\n\t\tsuccess: function(data)\n\t\t{\n\t\n\t\t\tvar nextPageToken = data.nextPageToken;\n\t\t\tvar prevPageToken = data.prevPageToken;\n\n\t\t\tconsole.log(\"next page token is \"+nextPageToken);\n\n\t\t\t$.each(data.items,function(i,item){\n\n\t\t\t\tvar op=getOutput(item);\n\t\t\t\t//Display results\n\n\t\t\t\t$('#results').append(op);\n\n\t\t\t});\n\n\t\t\tvar buttons = getButtons(prevPageToken,nextPageToken);\n\t\t\t//Display buttons\n\t\t\t$('#buttons').append(buttons);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "231e6c750679670ada252116b1d42fcd", "score": "0.49939376", "text": "doInitialQuery() {\n\n let initialParams = GSearchURLUtil.parseURLParameters();\n if (!GSearchCommonUtil.isEmptyObject(initialParams)) {\n this.props.getSearchResults(initialParams)\n }\n }", "title": "" }, { "docid": "ff5cad927acc38652dabe32ef6e22269", "score": "0.4989933", "text": "function executeSearch() {\n\n var queryObj = {\n facetFields: parseFacetsForQueryFilter(),\n filters: sctrl.filtersQueryString, //\"{http://www.alfresco.org/model/content/1.0}creator|abeecher\"\n maxResults: 0,\n noCache: new Date().getTime(),\n pageSize: 25,\n query: \"\",\n repo: true,\n rootNode: \"openesdh://cases/home\",\n site: \"\",\n sort: \"\",\n spellcheck: true,\n startIndex: 0,\n tag: \"\",\n term: sctrl.searchTerm+'*'\n };\n var objQuerified = objectToQueryString(queryObj);\n getSearchQuery(objQuerified);\n }", "title": "" }, { "docid": "8cebbd149fb590fde4f1fdb2522c025c", "score": "0.49597597", "text": "function globalSearche(searchInput) {\n let progress = document.getElementById('progressSearch'),\n findsZone = document.getElementById('global-search-finds'),\n searchType = document.getElementById('search-type');\n\n //on annule la frappe précédente\n clearTimeout(timToGlobalSearch);\n\n //si la recherche est la même qu'avant on ne la relance pas\n if(searchInput.value === saveSearch) return false;\n\n //on affiche la progresse barre\n progress.style.opacity = '1';\n\n //si notre champs de recherche est vide, on s'arrête (ou si on à que 2 lettres\n if(searchInput.value === '' || searchInput.value.length < 3){\n progress.style.opacity = '0';\n return false;\n }\n\n //on lance la fonction AJAX de recherche\n timToGlobalSearch = setTimeout(function () {\n axios.get('/API/search/10/0/' + searchType.value + '/' + searchInput.value).then(function (response) {\n\n let data = response.data;\n\n //sauvegarde de la recherche\n saveSearch = searchInput.value;\n\n //RÉSULTAT SUR LES FALAISES\n findsZone.innerHTML = response.data;\n\n //anime les résulats\n rideau(document.querySelectorAll('#global-search-finds .rideau-animation'));\n\n //séléctionne l'onglet de résultat\n $('ul.tabs').tabs('select_tab', 'global-search-finds');\n\n //initialise l'opener de ligne\n initRouteOpener();\n\n //on cache la progress barre\n progress.style.opacity = '0';\n });\n },300);\n}", "title": "" }, { "docid": "0b2ba519b3597514a2c6376be2746e3a", "score": "0.49441683", "text": "function query_search(search_str, resolve,reject, callback) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n\t encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n\tGM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject); },\n onerror: function(response) { reject(\"Fail\"); },\n ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "bbedb6be90fcfc166956fcdf2d136a65", "score": "0.49353668", "text": "function runsearch(preprint_id) {\n // fetch for DOIs in DB\n fetch(`/data/preprints/doi/${preprint_id}`, {\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n }\n })\n .then(results => results.json())\n .then(data => {\n // check if DOI was found else search for arXiv\n if (data) {\n return handleSearchResponse(data)\n } else {\n // search for arXivs in DB\n return fetch(`/data/preprints/arxiv/${preprint_id}`, {\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n }\n })\n .then(data => data.json())\n .then(handleSearchResponse)\n }\n })\n .catch(console.log)\n }", "title": "" }, { "docid": "4edbcdeba3aa1fa31dbeea93cc08e840", "score": "0.49291897", "text": "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "4edbcdeba3aa1fa31dbeea93cc08e840", "score": "0.49291897", "text": "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "4edbcdeba3aa1fa31dbeea93cc08e840", "score": "0.49291897", "text": "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "4edbcdeba3aa1fa31dbeea93cc08e840", "score": "0.49291897", "text": "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "4edbcdeba3aa1fa31dbeea93cc08e840", "score": "0.49291897", "text": "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "4edbcdeba3aa1fa31dbeea93cc08e840", "score": "0.49291897", "text": "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "f86b7c2b968e3ba3691687477a7110c3", "score": "0.4919244", "text": "function executeSearch( field ){\n $('#dim').css(\"display\", \"none\");\n var squery = $(\".search-field\").val();//test\n if(!squery){\n //alert for empty string\n alert(\"Please enter your query\");\n }else{\n //clean previus search result\n $(\".list-unstyled\").empty();\n //perform search\n console.log( \"Search query is: \" + $(\".search-field\").val() );\n //make ajax call\n $.ajax({\n url: proxy + apiUrl,\n method: 'GET',\n data : {\n action: 'query',format: 'json',prop: 'extracts|pageimages',\n continue: '||pageprops|info', generator: 'search',\n utf8: 1, ascii: 1, exchars: 250, exlimit:10, exintro: 1, explaintext: 1,\n exsectionformat: 'plain', piprop: 'thumbnail', pithumbsize: 100, pilimit: 6,\n pilicense: 'any', gsrsearch: squery, gsrlimit: 10, gsrwhat: 'text'\n },\n error: function(e){\n console.log(e);//show error\n },\n complete: function(e){\n //check if results have query object\n if(!e.responseJSON.hasOwnProperty('query')){\n alert('Nothing Found... Please try a different query'); \n }\n },\n success: function(data){\n // console.log(data);//test\n var queryRestuls = data.query;\n //loop through the results\n $.each(queryRestuls, function(index) {\n var results = queryRestuls[index];\n $.each(results, function(index) {\n var result = results[index];\n //create article url with unique pageid\n var url = listingUrl + result.pageid;\n //if we have thumbnail image add it as well\n if(result.hasOwnProperty('thumbnail')){\n var thumbnail = result.thumbnail;\n //create results html wth thumbnail\n $('.list-unstyled').append(\n '<li><div class=\"panel panel-default\"><div class=\"panel-heading\"><a href=\"'+ url +'\" target=\"_blank\"><h4>' + result.title +'</h4></a></div><div class=\"panel-body\"><img src=\"'+ thumbnail.source +'\" alt=\"article Image\" /><p>'+ result.extract +'</p></div></div></li>'\n );\n }else{//create results html wthout thumbnail\n $('.list-unstyled').append(\n '<li><div class=\"panel panel-default\"><div class=\"panel-heading\"><a href=\"'+ url +'\" target=\"_blank\"><h4>' + result.title +'</h4></a></div><div class=\"panel-body\"><p>'+ result.extract +'</p></div></div></li>');\n }\n });//innder each\n });//outer each\n }//success\n });//ajax 1\n }//end else\n}//executeSearch function", "title": "" }, { "docid": "305b3be9c4ca0350491bd9140ffd789f", "score": "0.49132717", "text": "function queryMain() {\n var facet = searchParams.getParam('facet');\n var query;\n var top = $('.j-column-l').offset().top;\n if ($(window).scrollTop() > top) {\n $(window).scrollTop(top);\n }\n\n if (loading[facet]) {\n metrics.getQuery('main').abort();\n loading[facet].abort();\n }\n\n if (searchParams.getParam('q').replace(/\\s+/, '') === '') {\n $('#j-main-results ol').html(jive.search.noResults({}));\n return;\n }\n\n $('#j-main-results ol').html(jive.search.loadingBar());\n var spinner = new jive.loader.LoaderView({size: 'small', showLabel: false});\n spinner.appendTo('#j-main-results li.j-loading-bar .j-loading-content');\n\n\n var promise = search.query(facet, searchParams.getSearchParams()).then(function(results) {\n pages = 1;\n\n if (results.suggestedQuery) {\n results.suggestedQuery = results.suggestedQuery.replace(/^search\\(|\\)$/g, '');\n }\n\n loading[facet] = null;\n\n query.addResults(results.list.map(toMetricInfo)).setReturnedDate(promise.returnedDate);\n\n try {\n var viewParams = packageResults(facet, results);\n var html = jive.search.searchResults(viewParams); // soy template\n $('#j-main-results').html(html);\n } catch(e) {\n errorHandler(null, null, e);\n $('#j-main-results ol').html({});\n }\n\n updateRssLink();\n\n if ($('#j-main-results li').length) {\n if (page.next) {\n $('#j-main-results li.j-loading-bar').html(jive.search.loadMore());\n } else {\n $('#j-main-results li.j-loading-bar').html(jive.search.noMore());\n \n if (pages === 1 && results.suggestedQuery) {\n $('#j-main-results ol').prepend(jive.search.noResults(results));\n }\n }\n } else {\n $('#j-main-results ol').html(jive.search.noResults(results));\n }\n\n }, function(jqXHR, status, error) {\n if (error !== 'abort') {\n $('#j-main-results ol').html(jive.search.noResults({}));\n errorHandler(jqXHR, status, error);\n }\n });\n\n loading[facet] = page = promise;\n\n // create and add query, we want to log it even if it never returns\n query = new MetricsQuery(promise.query, promise.sentDate);\n metrics.addQuery(query, 'main');\n }", "title": "" }, { "docid": "96e018f44657f683775acede8e6ccdf5", "score": "0.48868307", "text": "function customGoogleSearch(uule, query, websiteRoot) {\n\n rootUrl = websiteRoot.split('//');\n var rank = 99;\n\n var GoogleSearch = 'http://www.google.com/search?q=' + query + '&uule=' + uule;\n\n request(GoogleSearch, function(error, response, body) {\n console.log(\"Running google search at: \" + GoogleSearch);\n if (error) {\n console.log(error);\n }\n var $ = cheerio.load(body);\n\n\n var googleSearchCiteResults = [];\n $('div[class=g]').each(function(i, elem) {\n googleSearchCiteResults[i] = $(this).text();\n })\n\n setTimeout(function() {\n for (var i = 0; i < googleSearchCiteResults.length; i++) {\n if (googleSearchCiteResults[i].includes(rootUrl[1])) {\n var realRank = i + 1;\n\n var newResult = ({\n websiteRoot: websiteRoot,\n rank: realRank,\n websiteFound: googleSearchCiteResults[i],\n keyword: query,\n dateFound: moment().format('MMM Do YYYY, h:mm:ss a')\n });\n console.log(newResult);\n Results.create(newResult, function(err, newResultAdded) {\n if (err) {\n console.log(err);\n }\n\n console.log(\"New Result Added Successfully\");\n });\n\n console.log(query + \" ranks at \" + realRank + \". The site found: \" + googleSearchCiteResults[i]);\n }\n }\n }, 5000);\n\n })\n}", "title": "" }, { "docid": "eb1bfba6e4999cbe93490872185fc66d", "score": "0.48829946", "text": "search(searchParameters, context, callback=null) {\n let newParams = Object.assign(this.currentSearchParameters(), searchParameters);\n this.props.fetchSearchResults(context, newParams);\n if (callback) {\n callback(newParams);\n }\n newParams.page = 1;\n this.setState(newParams);\n }", "title": "" }, { "docid": "c08114049ccd05ebe7234bc67a7a197f", "score": "0.4880092", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type,search_str); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "e449637a0dea6ab5553db6cfd60e9400", "score": "0.4874726", "text": "function handleAPILoaded() {\n\n var query = getParameterByName(\"query\");\n var pageToken = getParameterByName(\"pageToken\");\n if(query != null && query != \"\"){\n searchData(query, pageToken);\n }\n $('.search-button').attr('disabled', false);\n $(\".search-button\").click(function (){\n var q = $(this).parent().prevAll(\".query\").val();\n if(q != null && q != \"\"){\n insertParam(\"query\", q);\n }else{\n alert(\"Please input anything..\");\n }\n }\n );\n}", "title": "" }, { "docid": "7bc8452c159d0a35d0fbf82c2af02938", "score": "0.4872363", "text": "function passSearchQuery(){\n\n $inputVal = $searchFormInput.val();\n\n if (!$.trim($inputVal).length){\n $searchResults.empty();\n searchQueryFinish();\n } else {\n searchQueryBegin();\n fetch($inputVal);\n }\n\n }", "title": "" }, { "docid": "d83cf57abe8057d7b5e7d158b836deba", "score": "0.48677465", "text": "function startSearch (searchString) {\n\n\tlet search = userInput.search = searchString || '';\n\tlet searchEncoded = encodeURIComponent(search);\n\tlet url = `${URL}/search/${searchEncoded}`;\n\n\t// PROMPT\n\tconsole.log(`\\r\\nSearching piratebay for: \"${search.italic}\"`.cyan);\n\n\tshowLoading();\n\tsearchRequest(url);\n}", "title": "" }, { "docid": "2df2bed105b19a5a3cba01b44c72c417", "score": "0.48622963", "text": "function executeSearch(searchTermField, url, optionsDiv) {\n\t\t\n\t\tvar twitterSearchTerm;\n\t\tvar input = $.trim($(searchTermField).val());\n\n\t\t// Execute the search only if there is something in the input field\n\t\tif (input.length > 0) {\n\n\t\t\tclearTweetTags();\n\t\t\ttwitterSearchTerm = getTwitterSearchTerm(searchTermField);\n\t\t\teraseAllFieldsButOne('.inputField', searchTermField);\n\t\t\tdisplayOptions(optionsDiv);\n\t\t\tsearch(twitterSearchTerm, url);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.48614016", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.48614016", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.48614016", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.48614016", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.48614016", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.48614016", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "1d832ffcec89585c560879e027924cdd", "score": "0.48614016", "text": "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "77756602d0fe8796983b59e6788415e7", "score": "0.4860513", "text": "function eventAdvFindStartSearch(moduleObject, element, event) {\n\n\t// enable search indicator\n\tif(typeof moduleObject.selectedFolders != \"undefined\") {\n\t\t// get any folder property and check it supports search folders or not\n\t\tvar selectedFolderProps = parentWebclient.hierarchy.getFolder(moduleObject.selectedFolders[0][\"folderentryid\"]);\n\t\tif(selectedFolderProps && (selectedFolderProps[\"store_support_mask\"] & STORE_SEARCH_OK) == STORE_SEARCH_OK) {\n\t\t\tmoduleObject.useSearchFolder = true;\n\t\t} else {\n\t\t\tmoduleObject.useSearchFolder = false;\n\t\t}\n\t}\n\n\tif(moduleObject.useSearchFolder) {\n\t\tmoduleObject.enableSearchIndicator();\n\t}\n\n\t// enable stop button and disable other buttons\n\tmoduleObject.toggleActionButtons(\"search_start\");\n\n\t// reset table widget\n\tmoduleObject.advFindTableWidget.resetWidget();\n\n\t// show loader in table widget\n\tmoduleObject.advFindTableWidget.showLoader();\n\n\t// remove paging stuff\n\tadvFindRemovePagingElement(this);\n\n\t// set item count to zero initially\n\tadvFindUpdateItemCount(0, false);\n\n\t// set variables\n\tmoduleObject.searchInProgress = true;\n\tmoduleObject.searchFolderEntryID = false;\n\tmoduleObject.tableGenerated = false;\n\n\t// send data to server to start search\n\tif(!moduleObject.search()) {\n\t\t// error occured in sending request to server\n\t\tmoduleObject.clearSearch();\n\t}\n}", "title": "" }, { "docid": "e7d5d3c30622808bd46c4e38d0b4e24e", "score": "0.48559272", "text": "function search() {\n gapi.client.youtube.search.list({\n q: $('#query').val(),\n part: 'snippet',\n maxResults: 20\n }).execute(buildSearchList); \n}", "title": "" }, { "docid": "08d43586762faa00794869ad25f8c4d0", "score": "0.4845982", "text": "function getInformation(subreddit){\n$.getJSON(\"https://ajax.googleapis.com/ajax/services/search/web?v=1.0&hl=en&gl=en&userip=&q=\" + subreddit + \" en.wikipedia&start=0&rsz=1&callback=?\", subreddit, function (data) {\n if(data!==undefined){\n if(data.responseData.results.length !== 0){\n $.getJSON(\"https://en.wikipedia.org/w/api.php?&format=json&action=query&generator=search&gsrsearch=\" + data.responseData.results[\"0\"].url.slice(30) + \"&utf8&gsrlimit=1&gsrwhat=nearmatch&prop=extracts&exintro&redirects&exchars=1059&callback=?\", subreddit, function(data){\n setInformation(subreddit,data);\n });\n }\n else\n wikiDict[subreddit]=\"No preview available\";\n }\n else{\n $.getJSON(\"https://en.wikipedia.org/w/api.php?&format=json&action=query&generator=search&gsrsearch=\" + subreddit + \"&utf8&gsrlimit=1&gsrwhat=nearmatch&prop=extracts&exintro&redirects&exchars=1059&callback=?\", subreddit, function(data){\n if(data.hasOwnProperty(\"query\")===false){\n $.getJSON(\"https://en.wikipedia.org/w/api.php?&format=json&action=query&generator=search&gsrsearch=\" + subreddit + \"&utf8&gsrlimit=1&gsrwhat=text&prop=extracts&exintro&exchars=1059&callback=?\",subreddit, function(data){\n if(data.hasOwnProperty(\"query\")===false){\n $.getJSON(\"https://en.wikipedia.org/w/api.php?&format=json&action=query&list=search&srsearch=\" + subreddit + \"&exchars=1059&callback=?\",subreddit, function(data){\n $.getJSON(\"https://en.wikipedia.org/w/api.php?&format=json&action=query&generator=search&gsrsearch=\" + data.query.searchinfo.suggestion + \"&utf8&gsrlimit=1&gsrwhat=text&prop=extracts&exintro&exchars=1059&callback=?\",subreddit, function(data){\n setInformation(subreddit, data);\n });\n });\n }\n else{\n setInformation(subreddit, data);\n }\n });\n }\n else{\n setInformation(subreddit, data);\n }\n\n });\n }\n});\n}", "title": "" }, { "docid": "a297139f75cb73068725d4b04b585866", "score": "0.48452944", "text": "function delayedSearch() {\n let delayTimer;\n clearTimeout(delayTimer);\n delayTimer = setTimeout(function() {\n findRecipe(1);\n }, 500);\n \n}", "title": "" }, { "docid": "89ff0867402643e1bd8d5570dec7561d", "score": "0.4844578", "text": "function searchOnLiricWiki(title) {\n searchElement = document.createElement('div');\n contentDiv.innerHTML = contentDiv.innerHTML\n + '<br><br><b>Possible Matches</b>';\n contentDiv.appendChild(searchElement);\n searchElement.innerHTML = 'Searching with \"' + title + '\" ...';\n\n callBackgroundScript(\"sendSearchRequest\", [title]);\n}", "title": "" }, { "docid": "83cefd4319b1ada47841a8740ee728f8", "score": "0.48413926", "text": "function runAJAX(subreddit){\nvar searchtype = \"Fast\";\nvar xmlhttp=httpObject();\n\nxmlhttp.open(\"POST\",\"http://127.0.0.1:8000/data/\",true);\nxmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\nxmlhttp.send(\"searchtype=\" + searchtype + \"&subreddit=\" + subreddit);\n\nvar pbar = document.getElementById(\"pbar\");\npbar.style.visibility = \"visible\";\n\ninterval = setInterval(function () {\nvar xmlhttp=httpObject();\n\nxmlhttp.open(\"GET\",\"http://127.0.0.1:8000/data/?searchtype=\" + searchtype + \"&subreddit=\" + subreddit,true);\nxmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\nxmlhttp.send();\n\nxmlhttp.onreadystatechange=function(){\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\n {\n document.getElementById(\"part4a\").innerHTML=\"Related Subreddits of \" + subreddit;\n var svalue = xmlhttp.responseText;\n var evalue = svalue.indexOf(\".\");\n if(isNaN(svalue)){\n\n var parent = document.getElementById(\"part4b\");\n var childrens = document.getElementsByClassName(\"Ograph\");\n if(childrens.length > 0){\n var clength = childrens.length;\n for(var c=0; c<clength;c++){\n parent.removeChild(childrens[0]);\n }\n }\n var jList = JSON.parse(svalue)['subreddits'];\n if(jList.length < 26)\n var jLength = jList.length;\n else\n var jLength = 26;\n for(var i=0; i<jLength; i+=2){\n createGraph(jList, i);\n }\n scrollToGraph();\n clearInterval(interval);\n pbar.style.visibility = \"hidden\";\n var pdone = document.getElementById(\"pdone\");\n\n }\n else{\n var pvalue = svalue.substring(0,evalue);\n var pdone = document.getElementById(\"pdone\");\n pdone.innerHTML=pvalue + \"%\";\n pdone.style.width=pvalue + \"%\";\n }\n }\n}\n}, 2000) ;\n}", "title": "" }, { "docid": "6d8e9fb1cf11508df60508b8b62ffc27", "score": "0.48357347", "text": "function search() {\n\t\tvar query_value = $('input#search').val();\n var rank = $(\".currentrank b\").eq(0).html();\n\t\t$('b#search-string').html(query_value);\n\t\tif(query_value !== ''){\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\t// call on server\n\t\t\t\t// url: \"http://severtsonscreens.com/cse360/LMS/book_search.php\",\n\t\t\t\t// Localhost\n\t\t\t\turl: \"/LMS/LMS/book_search.php\", \n\t\t\t\tdata: { query: query_value, rank: rank },\n\t\t\t\tcache: false,\n\t\t\t\tsuccess: function(html){\n\t\t\t\t\t$(\"table#results\").html(html);\n\t\t\t\t}\n\t\t\t});\n\t\t}return false;\n\t}", "title": "" }, { "docid": "3e3808b5ccc420ee270c8b69780290d3", "score": "0.48313975", "text": "function startSearching(query){\n var $results = $(\"#search-results\");\n\n if($.trim(query) === \"\"){\n $results.hide();\n return;\n }\n\n $results.html(\"<div class='searching'>Searching...</div>\");\n $results.show();\n\n\n ensureIndexDataThen(function(){\n var results = searchDocuments(query);\n renderResults(results);\n });\n }", "title": "" }, { "docid": "0204ae84366d0ed238bd377851648a3e", "score": "0.48292243", "text": "function makeRequest(searchTerm, callback) {\nvar settings = {\n\turl: youtube_base_url,\n\tdata: {\n\t\tkey: \"AIzaSyC8vg9sZggTKGAiYvX4wGs9H46pR2_spPM\",\n\t\tq:searchTerm,\n\t\tr:\"json\",\n\t\tpart: \"snippet\",\n\t},\n\tdataType: 'json',\n\tsuccess: callback\n\t};\n$.ajax(settings);\nconsole.log();\n}", "title": "" }, { "docid": "ccdd74d96d53b123f00f6c4d8371b233", "score": "0.48289192", "text": "function query_search(search_str, resolve,reject, callback,site) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,site); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "f01f1392679642091a798250ea93744e", "score": "0.4821835", "text": "function query_search(search_str, resolve,reject, callback) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject); },\n onerror: function(response) { reject(\"Fail\"); },\n ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "f01f1392679642091a798250ea93744e", "score": "0.4821835", "text": "function query_search(search_str, resolve,reject, callback) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject); },\n onerror: function(response) { reject(\"Fail\"); },\n ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "title": "" }, { "docid": "0097c111238f2d5ec9b764d6cc6084e2", "score": "0.48187637", "text": "async function searchBarCallback() {\n let temporarySearchResults = await filterSearchResults();\n searchResults = {};\n for (let key in temporarySearchResults) {\n searchResults[key] = temporarySearchResults[key];\n }\n sortTasks();\n}", "title": "" }, { "docid": "5c4567abe37047994ff6b78904b33294", "score": "0.48182988", "text": "function setupSearch() {\n var searchBox = document.getElementById(\"main-search\");\n searchBox.addEventListener(\"input\", function() {\n var split = this.value.split(\" \");\n var result = []\n var theValue = this.value\n var ids = window.location.hash.split('/')[1];\n if (window.location.hash === \"#library\" || window.location.pathname === \"/library\") {\n doJSONRequest(\"GET\", \"/tracks\", null, null, function(tracks) {\n result = fuzzyFind(tracks, \"name\", theValue);\n\n if (theValue.trim() === \"\") {\n drawLibrary();\n return;\n }\n drawLibrary(null, null, null, result);\n })\n }\n if (window.location.hash === \"#artists\") {\n doJSONRequest(\"GET\", \"/artists\", null, null, function(artists) {\n result = fuzzyFind(artists, \"name\", theValue);\n if (theValue.trim() === \"\") {\n drawArtists();\n return;\n }\n drawArtists(null, null, result);\n });\n }\n if (window.location.hash === \"#albums\") {\n doJSONRequest(\"GET\", \"/albums\", null, null, function(albums) {\n result = fuzzyFind(albums, \"name\", theValue);\n\n if (theValue.trim() === \"\") {\n drawAlbums();\n return;\n }\n drawAlbums(null, null, null, null, result);\n });\n }\n if (window.location.hash === \"#playlist/\" + playlistId) {\n doJSONRequest(\"GET\", \"/users/\" + userid + \"/playlists/\" + playlistId, null, null, function(playlist) {\n\n var tracks = []\n\n if (playlist.tracks.length == 0) {\n renderPlaylist({\n \"playlist\": playlist\n })\n } else {\n for (var i = 0; i < playlist.tracks.length; i++) {\n doJSONRequest(\"GET\", \"tracks/\" + playlist.tracks[i], null, null, function(track) {\n tracks.push(track)\n result = fuzzyFind(tracks, \"name\", theValue);\n\n if (theValue.trim() === \"\") {\n drawPlaylist(null, null, null, playlistId);\n return;\n }\n drawPlaylist(null, null, null, playlistId, result);\n })\n }\n }\n })\n }\n if (window.location.hash === \"#artists/\" + ids) {\n doJSONRequest(\"GET\", \"/artists/\" + ids, null, null, function(artist) {\n doJSONRequest(\"GET\", \"/tracks?filter=\" + encodeURIComponent(JSON.stringify({\n 'artist': artist._id\n })), null, null, function(tracks) {\n result = fuzzyFind(tracks, \"name\", theValue);\n\n if (theValue.trim() === \"\") {\n drawArtist(\"artists/\" + ids);\n return;\n }\n\n drawArtist(\"artists/\" + ids, null, result);\n });\n });\n }\n if (window.location.hash === \"#albums/\" + ids) {\n doJSONRequest(\"GET\", \"/albums/\" + ids, null, null, function(album) {\n doJSONRequest(\"GET\", \"/tracks?filter=\" + encodeURIComponent(JSON.stringify({\n 'album': album._id\n })), null, null, function(tracks) {\n result = fuzzyFind(tracks, \"name\", theValue);\n\n if (theValue.trim() === \"\") {\n drawAlbum(\"albums/\" + ids);\n return;\n }\n\n drawArtist(\"albums/\" + ids, null, result);\n });\n });\n }\n });\n\n}", "title": "" }, { "docid": "5d14526630cde339c1c3a3196b42d0d1", "score": "0.4817786", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n //hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "1cfa963b5aab7bf362e58cf08bc626a5", "score": "0.48025325", "text": "function handleSubreddit( data, status )\n{\n if ( status != \"success\" )\n {\n console.log( status );\n prependAlert( \"Something went wrong.\" );\n setProgress( 0 );\n return;\n }\n\n // get the data needed out from the response and call outputSubreddit\n var responseObjAll = data;\n var responseObj = responseObjAll.data.children;\n updateProgress();\n outputSubreddit( responseObj,responseObjAll.data.after );\n}", "title": "" }, { "docid": "510f65368407225638d5e5e2b82c85c7", "score": "0.47975865", "text": "function search() {\t\t\t\t\n\t\t\tconsole.log(\"search()\");\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tGxdIndexSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n else {\n clear()\n }\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\n\t\t\t}, function(err) { // server exception\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: GxdIndexSearchAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "149f98fa161381d116c0f739caff62f4", "score": "0.47924316", "text": "function do_search() {\n var query = input_box.val();\n\n if (query && query.length) {\n if (selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if (query.length >= $(input).data(\"settings\").minChars || query.length > 0 && (query[0] === '?' || query[0] === '.')) {\n show_dropdown_message(\"Searching\");\n clearTimeout(timeout);\n\n timeout = setTimeout(function () {\n run_search(query);\n }, $(input).data(\"settings\").searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "be0c80da618919780b65c33048e1c2eb", "score": "0.4784041", "text": "function getSortedSubreddit2(subreddit, callback) {\n var address = \"https://www.reddit.com\" + subreddit;\n request(address, function(err, result) {\n var resultObject = JSON.parse(result.body);\n if(resultObject.error) {\n console.log(\"Sorry, there is no subreddit with that name\");\n reddit();\n }\n if(resultObject.data.children.length === 0) {\n console.log(\"Sorry, there is no subreddit with that name\");\n reddit();\n }\n if(resultObject.data.children.length > 0) { \n var myOBJ = {};\n resultObject.data.children.forEach(function(post){\n myOBJ[post.data.title] = {\n score: post.data.score,\n author: post.data.author,\n url: post.data.url\n };\n \n });\n callback(myOBJ);\n reddit();\n }\n }\n);\n}", "title": "" }, { "docid": "6605dd926c422078ec7467b35796ab67", "score": "0.4771614", "text": "function queueSearch(query){\n if (searching){\n clearTimeout(pendingSearch);\n pendingSearch = setTimeout(function(){checkTimer(query)}, 100);\n } else {\n searching = true;\n setTimeout(function(){searching=false;}, 400);\n lastSearched = query;\n runSearch(query);\n }\n }", "title": "" }, { "docid": "771b132bb4d7d85cd1c9dd87c1bd7d3c", "score": "0.47710642", "text": "function search() {\n\n\t$scope.data.searchLoading = true;\n\tsearchService.globalSearch($scope.data.globalSearch, true)\n\t\t.then(function(results){\n\t\t\tconsole.log(results);\n\t\t\t//prevents flashing\n\t\t\t$timeout(function(){\n\t\t\t\t$scope.data.searchLoading = false;\n\t\t\t\t$scope.data.searchResults = results;\n\t\t\t\t$scope.data.resultsCount = _.flattenDeep(_.map(results, 'results')).length;\n\n\t\t\t}, 250)\n\t\t})\n\t\t.catch(function(err){\n\t\t\tconsole.log('error searching');\n\t\t\tconsole.log(err);\n\t\t})\n\n}", "title": "" }, { "docid": "a8c08627b7df56aca90a0d557cdcab33", "score": "0.47669214", "text": "function newsResults(){\n$.ajax(\n \"https://www.reddit.com//r/\" + searchTerm + \".json\",\n {\n success: function(responseData) {\n if (responseData.data.children.length > 0) {\n $.each(responseData.data.children, function(idx, searchResult) {\n var title = searchResult.data.title;\n if (searchResult.data.thumbnail != \"self\" && searchResult.data.thumbnail != \"default\") {\n $('#newsLinks').prepend('<div class=\"redditResult text-center\"><div class=\"redditImage\"><a href=\"' + searchResult.data.url + '\" target=\"_blank\">' + '<img src=\"' + searchResult.data.thumbnail + '\"/></a></div>' + '<div class=\"redditLink\"><a class=\"LINK\" href=\"' + searchResult.data.url + '\" target=\"_blank\">' + title + '</a></div></div>' + '<br>');\n };\n });\n } else {\n throw new Error(\"No subreddits match the search query!\");\n }\n },\n error: function() {\n $(\"#wells\").append(\"<strong>Warning!!!</strong> We were not able to retrieve news for that selection. Try another selection!\");\n $(\"#wells\").css(\"display\",\"block\");\n }\n })\n}", "title": "" }, { "docid": "cf0b939e411bad689fa386ca37ec86a7", "score": "0.47650182", "text": "function searchSubmit(e) {\n\t\tsetPage(\n\t\t\t`https://rickandmortyapi.com/api/character/${searchMethod}${searchParams}`\n\t\t);\n\t\tsetSearchParams('');\n\t}", "title": "" }, { "docid": "b0f43b1f1adb07c73f388af2d672c063", "score": "0.47601518", "text": "function doSearch(searchTerm, injectResultsIntoSelector) {\r\n\t$(injectResultsIntoSelector).html(loadingMarkup());\r\n\t\r\n\tProvenance().search({\r\n\t\tsearchTerm : searchTerm,\r\n\t\tsuccess : function(g) { \r\n\t\t\ttableInject(injectResultsIntoSelector, generateObjectTable(g, \"Search: \" + searchTerm, injectResultsIntoSelector));\r\n\t\t},\r\n\t\terror: genericError(\"Search (\" + searchTerm + \") \")\r\n\t});\r\n\t\r\n\treturn true;\r\n} // End doSearch", "title": "" }, { "docid": "9d5a738e526d415d21e252409c11b318", "score": "0.4759339", "text": "function executeQuery(){\r\n\treadRequest(urlBuilder.getSearchURL());\r\n}", "title": "" }, { "docid": "c2f0e56b5e664f3d104e690172042d34", "score": "0.47557846", "text": "function search() {\n var q = $('#query').val();\n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet'\n });\n\n request.execute(showFirstID);\n// request.execute(function(response) {\n//\t var str = JSON.stringify(response.result);\n//\t $('#search-container').html('<pre>' + str + '</pre>');\n// });\n}", "title": "" }, { "docid": "e19175ac3044344bf16acedbab4bf9cd", "score": "0.4749672", "text": "function delayedAutoCompleteSearch(){\n \t// WIP LOG\n \tconsole.log('delayedAutoCompleteSearch Fcn executed ..');\n \t\n \t// get the search criterias entered by the user ( > represented by the value held by the 'ajaxSearchInputField' )\n \tvar ajaxSearchData = ajaxSearchInputField.value; // the current value of the input field wich has an 'onkeyup' event attached to it (..)\n \t// WIP trickery :/\n \t//ajaxSearchData = 'Rails';\n \t// setup an XMLHttpRequest ( xhr ) to send the query to the Rails server and get the response to append it in the page in an 'ajaxy-way' ;p\n \tvar xhr = new XMLHttpRequest(); // we create a new xhr object\n \t// var railsAjaxSearchPath = 'http://localhost:3000/ajaxsearch?lookingfor='; /* [ MOVED UPWARDS FOR EASIER ACCESS (..) ] */\n \t// create the path we 'll use to make the ajax ( xhr ) request\n \tvar ajaxSearchPath = railsAjaxSearchPath + ajaxSearchData; // append the content of the input text field parameters, to form a new 'path' used to query the Rails server\n \t// configure the request to fit our needs (..)\n \txhr.open(\"GET\", ajaxSearchPath, true); // configure the XMLHttpRequest ( > IMPORTANT : the last parameter (\"I think I remember\" (..) stands for ASYNCHRONOUS requests ( ~non-blocking (..) ) ) )\n \t// define the Fcn/code to be called once a response is received from the Rails server\n \txhr.onreadystatechange = function(){ // we specify what to do when we actually receive data from the [above] request coming from the Rails server\n \t// WIP LOG\n \tconsole.log('xhr.onreadystatechange just called ..');\n \t\tif( xhr.status == 200 && xhr.readyState == 4 ){ // if we did actually receive something without error\n \t\t// WIP LOG\n \t\tconsole.log('xhr.status == 200 && xhr.readyState == 4 just called ..');\n \t\t\tif( xhr.responseText ){ // if what we received contains the 'well-known' responseText ( > the data, in html or json, rendered by the Rails server for us ;p)\n \t\t\t\t// WIP LOG\n \t\t\t\tconsole.log('xhr.responseText just called ..');\n \t\t\t\t//console.log('xhr.responseText: ' + xhr.responseText);\n \t\t\t\t\n \t\t\t\t// call a Fcn that uses CSS animations to fade out the 'searchResultsDiv' if it was already visible to the user (..)\n \t\t\t\t//var searchResultsDiv = document.getElementById('ajax-search-results'); /* [ MOVED UPWARDS FOR EASIER ACCESS (..) ] */\n \t\t\t\t\n \t\t\t\t/* WIP > get the content returned from the request */\n \t\t\t\tvar queryResultsHTMLContent = document.createElement('div'); // var that 'll hold the fetched content ( > it's a DOM element, created, but not added to the DOM )\n \t\t\t\tqueryResultsHTMLContent.innerHTML = xhr.responseText; // append the content of the 'responseText' ( > containing the results of our query for mthe Rails server ) to the freshly-created div 'queryResultsHTMLContent'\n \t\t\t\t// WIP LOG\n \t\t\t\tconsole.log('queryResultsHTMLContent content: ' + queryResultsHTMLContent.innerHTML);\n \t\t\t\t\n \t\t\t\t// digg a littl' bit through the fetched content to find the first div\n \t\t\t\tvar queryResultsDivs = queryResultsHTMLContent.getElementsByTagName('div'); // as the 'queryResultsHTMLContent' is a DOM element, we can use the DOM fcns on it ;p\n \t\t\t\tconsole.log('queryResultsDivs contains ' + queryResultsDivs.length + 'elements');\n \t\t\t\t//console.log('queryResultsDivs[0] contains ' + queryResultsDivs[0].innerHTML ); // contains ' <!-- div#app-header --> this is the App header '\n \t\t\t\t//console.log('queryResultsDivs[1] contains ' + queryResultsDivs[1].innerHTML ); // contains ' <!-- div#app-search [ > 'logHello();' onkeyup works ] --> <input id=\"ajax-search-input\" (..) > '\n \t\t\t\t//console.log('queryResultsDivs[2] contains ' + queryResultsDivs[2].innerHTML ); // contains ' <!-- div#app-body --> (..) '\n \t\t\t\t//console.log('queryResultsDivs[3] contains ' + queryResultsDivs[3].innerHTML ); // contains ' div#app-content (..) '\n \t\t\t\tconsole.log('queryResultsDivs[4] contains ' + queryResultsDivs[4].innerHTML ); // THE RIGHT ONE ;D\n \t\t\t\t\n \t\t\t\t// append the content of the 'responseText' ( > containing the results of our query for mthe Rails server ) to the 'searchResultsDiv' (..\n \t\t\t\t//searchResultsDiv.innerHTML = 'Hello there !';\n \t\t\t\tsearchResultsDiv.innerHTML = queryResultsDivs[4].innerHTML; // get the fourth-DIV-found's inner HTML & use it as the innerHTML of our 'searchResultsDiv' (..)\n \t\t\t\t\n \t\t\t\t// call a Fcn that uses CSS animations to fade in the 'searchResultsDiv' if it was previously hidden to the user (..) \n \t\t\t} // end of 'if( xhr.responseText )' Fcn\n \t\t\t// RE-INIT(S) HERE ( > in case of having elements loaded using ajax needing to have event listeners attached to them ( after an 'ajax page change' for example (..) ) )\n \t\t\t// call a Fcn that will apply CSS classes to animate the 'searchResults' div, sliding it up & fading it in\n \t\t\t\n \t\t\treturn true; // [ I'm quite sure I remember it's ] needed for the asynchronous request (..)\n \t\t} // end of 'if( xhr.status == 200 && xhr.readyState == 4 )' fcn\n \t}; // end of 'xhr.onreadystatechange = function()' Fcn\n \t// actually send the request to the Rails server in an asynchronous manner ( > don't block while waiting the responseText that'll be received from the Rials server )\n \txhr.send(null); // use 'null' as parameter ( > necessary for the request to be asynchronous (..) )\n \t// WIP LOG\n \tconsole.log('XMLHttpRequest just sent ..');\n \t\n \treturn false; // [ I'm quite sure I remember it's ] needed for the asynchronous request (..)\n }", "title": "" }, { "docid": "e0915381c2cd7e046c0e6a0e95bd02e0", "score": "0.47493717", "text": "function startSearch() { // searches for last tweet/retweet from @arielengle & calls retweetAriel()\n console.log(\"startSearch: Initialized\");\n eventParams = {\n q: \"arielengle\",\n count: 1\n }\n\n T.get(\"search/tweets\", eventParams, startData);\n\n function startData(err, data, response) {\n var tweetText = data.statuses;\n var tweetId;\n var screenName;\n for(var i = 0; i < tweetText.length; i++) {\n firstTweet = tweetText[i].text;\n tweetId = tweetText[i].id_str;\n screenName = tweetText[i].retweeted_status.user.screen_name;\n }\n\n var params = {\n id: tweetId\n }\n retweeted(params, screenName);\n console.log(\"startSearch: Completed\");\n }\n}//end of search()", "title": "" }, { "docid": "e6dc5e356270283fc2b0b5c0ad4fa7c2", "score": "0.47481635", "text": "function getAllResults(type, after) {\r\n \r\n if(!modal_open) {\r\n modal_open = true;\r\n showLoadingMsg();\r\n showModal();\r\n } else {\r\n $(\"#loading-message\").html(\"Loading posts after \" + after); \r\n }\r\n\r\n if(type == \"saved\") {\r\n url = \"https://oauth.reddit.com/user/\" + user_name + \"/saved?limit=100&after=\"\r\n } else {\r\n url = \"https://oauth.reddit.com/user/\" + user_name + \"/upvoted?limit=100&after=\"\r\n }\r\n \r\n //TODO: Update Message \"Getting results after + after\r\n\r\n //make call to the reddit api to grab the next 100 saved posts\r\n $.ajax({\r\n type: \"GET\",\t\r\n url: url + after,\r\n dataType: 'json',\r\n beforeSend: function (request) {\r\n request.setRequestHeader(\"Authorization\", \"bearer \" + access_token);\r\n },\r\n success: function(data, status) {\t\t\t\r\n var children = data.data.children;\r\n var the_id;\r\n var the_style;\r\n var the_html;\r\n \r\n //console.log(data);\r\n \r\n for(i=0; i<children.length; i++) {\r\n if((scope == \"O18\" && children[i].data.over_18 == true) || (scope == \"U18\" && children[i].data.over_18 == false) || scope == \"All\") {\r\n counter += 1;\r\n \r\n the_id = \"cnt_\" + counter;\r\n post_array.push(the_id);\r\n \r\n post_info[the_id] = new Object();\r\n post_info[the_id].id = children[i].data.id;\r\n post_info[the_id].url = children[i].data.url;\r\n post_info[the_id].thumb = children[i].data.thumbnail; \r\n post_info[the_id].name = children[i].data.name;\r\n post_info[the_id].permalink = children[i].data.permalink; \r\n post_info[the_id].subreddit = children[i].data.subreddit;\r\n post_info[the_id].preview = children[i].data.preview;\r\n post_info[the_id].title = children[i].data.title;\r\n post_info[the_id].thumb_loaded = false;\r\n \r\n //if(children[i].data.preview != undefined) {\r\n // if(children[i].data.preview.images[\"0\"].resolutions[0] != undefined) {\r\n // post_info[the_id].thumb = children[i].data.preview.images[\"0\"].resolutions[0].url;\r\n // }\r\n //}\r\n }\r\n }\r\n\r\n var after_name = data.data.after;\r\n if(type == \"saved\" && after_name != null) {\r\n getAllResults(\"saved\", after_name);\r\n //} else if(type == \"upvoted\" && after_name != null) {\r\n //\tgetAllResults(\"upvoted\", after_name)\r\n //} else if(type == \"saved\") {\r\n //\tgetAllResults(\"upvoted\", \"\")\r\n } else {\r\n //console.log(data);\r\n hideModal();\r\n hideLoadingMsg();\r\n loadGrid();\r\n enableButtons();\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "ce8554930c82e55d1808b4f82a08c5c0", "score": "0.47459805", "text": "function run_search(query) {\n var cache_key = query + computeURL();\n var cached_results = cache.get(cache_key);\n if (cached_results) {\n if ($.isFunction($(input).data(\"settings\").onCachedResult)) {\n cached_results = $(input).data(\"settings\").onCachedResult.call(hiddenInput, cached_results);\n }\n populateDropdown(query, cached_results);\n } else {\n // Are we doing an ajax search or local data search?\n if($(input).data(\"settings\").url) {\n var url = computeURL();\n // Extract existing get params\n var ajax_params = {};\n ajax_params.data = {};\n if(url.indexOf(\"?\") > -1) {\n var parts = url.split(\"?\");\n ajax_params.url = parts[0];\n\n var param_array = parts[1].split(\"&\");\n $.each(param_array, function (index, value) {\n var kv = value.split(\"=\");\n ajax_params.data[kv[0]] = kv[1];\n });\n } else {\n ajax_params.url = url;\n }\n\n // Prepare the request\n ajax_params.data[$(input).data(\"settings\").queryParam] = query;\n ajax_params.type = $(input).data(\"settings\").method;\n ajax_params.dataType = $(input).data(\"settings\").contentType;\n if ($(input).data(\"settings\").crossDomain) {\n ajax_params.dataType = \"jsonp\";\n }\n\n // exclude current tokens?\n // send exclude list to the server, so it can also exclude existing tokens\n if ($(input).data(\"settings\").excludeCurrent) {\n var currentTokens = $(input).data(\"tokenInputObject\").getTokens();\n var tokenList = $.map(currentTokens, function (el) {\n if(typeof $(input).data(\"settings\").tokenValue == 'function')\n return $(input).data(\"settings\").tokenValue.call(this, el);\n\n return el[$(input).data(\"settings\").tokenValue];\n });\n\n ajax_params.data[$(input).data(\"settings\").excludeCurrentParameter] = tokenList.join($(input).data(\"settings\").tokenDelimiter);\n }\n\n // Attach the success callback\n ajax_params.success = function(results) {\n cache.add(cache_key, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hiddenInput, results);\n }\n\n // only populate the dropdown if the results are associated with the active search query\n if(input_box.val() === query) {\n populateDropdown(query, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n }\n };\n\n // Provide a beforeSend callback\n if (settings.onSend) {\n settings.onSend(ajax_params);\n }\n\n // Make the request\n $.ajax(ajax_params);\n } else if($(input).data(\"settings\").local_data) {\n // Do the search through local data\n var results = $.grep($(input).data(\"settings\").local_data, function (row) {\n return row[$(input).data(\"settings\").propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;\n });\n\n cache.add(cache_key, results);\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hiddenInput, results);\n }\n populateDropdown(query, results);\n }\n }\n }", "title": "" }, { "docid": "d20c31fa8d15bfab70a6eeb24be1652f", "score": "0.47391257", "text": "function sendSearchRequest(query) {\n\tvar request = makeHttpObject();\n\tstatusbar('<img src=\"images/spinner_dark.gif\"/> searching...');\n\tsetTimeout( function() {\n\t\tvar status = gebi(\"status\");\n\t\tif (status.innerHTML.indexOf('searching...') >= 0) {\n\t\t\tstatus.innerHTML += '<br>some searches may take up to 20 seconds. please be patient.';\n\t\t\tvar url = gebi('url').value.replace(/</g, '').replace(/>/g, '');\n\t\t\tif (url.indexOf('imgur.com/a/') == -1 && url.indexOf('text:') == -1 && url.indexOf('user:') == -1 && url.indexOf('cache:') == -1) {\n\t\t\t\tvar out = getExternalSearchLinks(url);\n\t\t\t\tstatus.innerHTML += out;\n\t\t\t}\n\t\t} \n\t}, 5000);\n\tgebi(\"output\").innerHTML = '';\n\toutput_posts('');\n\toutput_comments('');\n\trequest.open(\"GET\", query, true);\n\trequest.send(null);\n\trequest.onreadystatechange = function() {\n\t\tif (request.readyState == 4) { \n\t\t\tif (request.status == 200) {\n\t\t\t\t// success\n\t\t\t\thandleSearchResponse(request.responseText);\n\t\t\t} else {\n\t\t\t\t// error\n\t\t\t\tstatusbar('<span class=\"search_count_empty\">error: status ' + request.status + '</span>');\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "497f50aeaf83a1cedb0b730a0cb5d243", "score": "0.47379538", "text": "function startSearch() {\r\n\tif (window.location.hash.indexOf('#search=') > -1) {\r\n\t\tsearchInput.value = window.location.hash.substring(8);\r\n\t\tsearchPosts(searchInput.value.toLowerCase());\r\n\t} else {\r\n\t\tsearchInput.value = '';\r\n\t\tsearchPosts('');\r\n\t}\r\n}", "title": "" }, { "docid": "642abd07dd74493918174dfdbe8b91de", "score": "0.47364643", "text": "function secondarySearch(searchString) {\n queryURL = `https://www.thecocktaildb.com/api/json/v1/1/filter.php?i=${searchString}`;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(res) {\n let searchArray = [];\n\n if (res.drinks !== \"\") {\n let len = res.drinks.length;\n for (let i = 0; i < len; i++) {\n if (searchArray.indexOf(res.drinks[i].idDrink) === -1) {\n searchArray.push(res.drinks[i].idDrink);\n }\n }\n }\n\n // drinkArray is an array of drinkID's\n let arrayLength = searchArray.length;\n\n // if array is empty, just return\n if (arrayLength === 0) {\n return;\n }\n\n // empty out the result section first\n $(\"#results\").empty();\n\n // for each drink ID, build and append to the result the drink listing\n for (drinkID of searchArray) {\n $(\"#results\").append(generateDrinkListing(drinkID));\n }\n\n $(\".ui.accordion\").accordion();\n });\n }", "title": "" }, { "docid": "16b868ce2616dc8118c5fab174c44c08", "score": "0.47301272", "text": "async function handleSubmit(searchTerm) {\r\n const { data: { items: videos } } = await youtube.get(\"search\", {\r\n params: {\r\n part: \"snippet\",\r\n maxResults: 8, // fetch maximum results\r\n key: 'AIzaSyAFi7TyKlmGjt_8jGnj8emLid4ZqeyTUwY', // api key it is unique for every one\r\n q: searchTerm,\r\n }\r\n });\r\n\r\n setVideos(videos);\r\n setSelectedVideo(videos[0]);\r\n }", "title": "" }, { "docid": "917eea746497049b16389e40bebecc21", "score": "0.47275943", "text": "function search(){\n $.ajax({\n type: \"GET\",\n url: \"https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0|1&gsrlimit=20&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=3&exlimit=max&pithumbsize=400&gsrsearch=\" + title + \"&callback=?\",\n contentType: \"application/json; charset=utf-8\",\n async: false,\n dataType: \"json\",\n success: function (data, textStatus, jqXHR) {\n var paging = data.query.pages;\n hit(paging);\n },\n error: function (errorMessage) {\n alert(\"There was an error getting the content.\")\n }\n });\n }", "title": "" }, { "docid": "03c12666085b7339b8d4f9ef61fb481f", "score": "0.4722215", "text": "function search(searchString) {\n let queryURL = `https://www.thecocktaildb.com/api/json/v1/1/search.php?s=${searchString}`;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n if (response.drinks !== null) {\n let searchArray = [];\n let len = response.drinks.length;\n for (let i = 0; i < len; i++) {\n searchArray.push(response.drinks[i].idDrink);\n }\n\n // drinkArray is an array of drinkID's\n let arrayLength = searchArray.length;\n\n // if array is empty, just return\n if (arrayLength === 0) {\n return;\n }\n\n // empty out the result section first\n $(\"#results\").empty();\n\n // for each drink ID, build and append to the result the drink listing\n for (drinkID of searchArray) {\n $(\"#results\").append(generateDrinkListing(drinkID));\n }\n\n $(\".ui.accordion\").accordion();\n }\n\n secondarySearch(searchString);\n });\n }", "title": "" }, { "docid": "59cbb44063d44ba7766965adf151a529", "score": "0.47218758", "text": "function searchRecipes(search, includes, excludes) {\n let params = {\n '_app_id': apiId,\n '_app_key': apiKey,\n q: search,\n };\n console.log(includes);\n console.log(excludes);\n\n const queryString = formatQueryParams(params, includes, excludes);\n const url1 = searchUrl + '?' + queryString;\n\n console.log(url1);\n fetch(url1)\n .then(response => {\n if (response.ok) {\n return response.json();\n } throw new Error(response.statusText);\n })\n .then(responseJson => displayResults(responseJson))\n .catch(err => {\n $('.error-message').text(`Something went wrong: ${err.message}`);\n });\n}", "title": "" }, { "docid": "5d0a027c74ded30a12098664a9068498", "score": "0.47214025", "text": "function search(searchTerms){\t\t\n\t\tvar test = getDocumentFolder();\n\n\t\t$.get(getDocumentFolder() + \"ghostsearch.php?s=\" + searchTerms, function( data ) {\n\t\t\trenderSearchResult(data);\t\t\n\t\t}, \"json\");\n\t}", "title": "" }, { "docid": "78213cf2448787c5f2cdddd9f7a31254", "score": "0.47135195", "text": "function handleSearchClicked (){\n $('.search').submit(event => {\n event.preventDefault();\n let searchTerm = $('#js-searchfield').val(); \n $('html, body').animate({ scrollTop: $('main').offset().top - 100});\n clearSearchResults();\n getYoutubeResults(searchTerm);\n getWikiResults(searchTerm); \n });\n}", "title": "" }, { "docid": "46bfe8f29f500e4b1a140fa75314661d", "score": "0.4713427", "text": "function searchDepartments() {\n if($(\"#department\").val() == \"\") { return; }\n\n if(isProcessing) {\n ajaxQueue.push(searchDepartments);\n return;\n }\n\n isProcessing = true;\n $.ajax({\n type: 'post',\n url: '/lecturer/requests/searchDepartments',\n data: {searchTerm: $(\"#department\").val(), university: $(\"#university\").val()},\n success: searchDepartmentsCallback\n });\n}", "title": "" }, { "docid": "7507fa0a9425c239d5c147f58b1f8175", "score": "0.47098485", "text": "function getRandomQuery(){\n // if already searching prevent multiple async calls\n if (searching) {\n console.log('stop');\n return;\n }\n searching = true;\n\n // remove current results and communicate with the user that we are searching\n removeResults();\n displayMessage('Let\\'s see what we can find.');\n \n const request = new Request('https://api.wordnik.com/v4/words.json/randomWords?limit=1&api_key=087c20e93577cfed4f10000525a09c1bceb25388be80f712d');\n\n // fetch request from wordnik api\n fetch(request).then(function(response){\n return response.json().then(function(data){\n setTimeout(() => {\n // delay search for the random word to give old results time to animate out\n getQuery(data[0].word);\n }, 1000);\n })\n }).catch(error => {\n displayMessage('Sorry there was an error or no results from your query, try searching again!');\n removeResults();\n searching = false; \n console.log(error);\n })\n }", "title": "" }, { "docid": "28933099f6a244a98a4a8078012994ce", "score": "0.4697086", "text": "function getRedditApi () {\n //Takes a keyword (if existing and greater than a length of one) and adds it to the searchLocation, the reddit query allows for 250 chracters in the q= parameter\n if(redditKeyWord && redditKeyWord.length >1) {\n redditSearchLocation = redditSearchLocation + \" \" + redditKeyWord;\n }\n \n //THIS PATH HAS AN S ALTHOUGH REDDIT CLAIMED IT DIDN'T WANT IT BUT I ADDED IT ANYWAY\n var redditQueryUrl = \"https://www.reddit.com/search.json?q=\" + redditSearchLocation + \"&limit=\" + redditSearchLimit;\n \n fetch(redditQueryUrl)\n .then(function(res) {\n return res.json(); // Convert the data into JSON\n })\n .then(function(data) {\n\n //if there is no return from Reddit for the search item\n if (data.data.children.length === 0) {\n emptyRedditReturn();\n return;\n }\n\n //before we enter the loop to create and append elements to the redditList\n //we need to clean it of any previously attached elements\n clearRedditContainer();\n\n for(var i =0; i < data.data.children.length; i++) {\n var title = data.data.children[i].data.title;\n //More amazingness, some reddit urls are links to posts, some are links to images, its not reliable we need to use the permalink data\n //So permalink should give an address fragment to which we can attach the prefix https://www.reddit.com and then get a useable link for each item\n var permalinkHttp = \"https://www.reddit.com\" + data.data.children[i].data.permalink\n //some descriptions are very long on reddit and we need to reduce them for our post\n var description = data.data.children[i].data.selftext;\n // make an array of the description string, split on spaces between words\n var descriptionArray = description.split(\" \");\n // reduce the length to 50 words\n descriptionArray.length = 50;\n //set the description to the new shortened descriptionArray\n description = descriptionArray.join(\" \");\n //Thumbnail can be an image or a self reference it depends on how the user posted, it's not reliable enough for image population\n //Some posts do not have an image which leaves the preview parameter empty so we only get the thumbnail image if it exists\n if(data.data.children[i].data.preview) {\n //And of course it has to be encoded because reddit so we can't use it unless we decoded it. If we try to follow it we get a 403 error.\n var imageUrlEncoded = data.data.children[i].data.preview.images[0].source.url;\n //in order to decode we need to replace \"amp;s\" with \"s\"\n var imageUrlDecoded = imageUrlEncoded.replace(\"amp;s\", \"s\");\n //This url can now be used as a link to display an image\n } else {\n var imageUrlDecoded = \"https://static.techspot.com/images2/downloads/topdownload/2014/05/reddit.png\";\n }\n //After fetching from the api endpoints, run the function to create and append the data\n createAppendReddit (imageUrlDecoded, title, description, permalinkHttp);\n }\n })\n .catch(function(err) {\n console.log(err); // Log error if any\n });\n }", "title": "" } ]
f41a00fd376c5fd66b3c8a163f2ab8c1
Changes the state with the new rating
[ { "docid": "64f70d03e4979023ea89fb38856606e7", "score": "0.71054816", "text": "onStarRatingPress(rating) {\n this.setState({\n starCount: rating\n });\n }", "title": "" } ]
[ { "docid": "530c3fb1fecb51c6c2a2a349510fed04", "score": "0.7572421", "text": "function setRating(rating) {\n newReview.rating = rating;\n let elements = $('.rating-list .col.d-inline');\n elements[rating-1].classList.add('active-rating');\n if (lastRating)\n lastRating.classList.remove('active-rating')\n lastRating = elements[rating-1];\n document.getElementById('selectedRating').innerHTML = rating;\n}", "title": "" }, { "docid": "4232d19cbce00692974a456e5b0b2313", "score": "0.7548124", "text": "function setRating(newRating) {\n\t\trating = newRating;\n\t\t\n\t\tinstance.fireEvent('ratingChanged',{\n\t\t\tcurrentValue:rating\n\t\t});\n\t\t\n\t\ttextValue.text = String(rating).replace('.0','');\n\t\tfor (var i = 0, l = stars.length; i < l; i++) {\n\t\t\tif (i >= rating) {\n\t\t\t\tstars[i].image = 'images/star_off.png';\n\t\t\t}\n\t\t\telse if (rating > i && rating < i+1) {\n\t\t\t\tstars[i].image = 'images/star_half.png';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tstars[i].image = 'images/star.png';\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f5661b9493d1b314d49e70c890bb0309", "score": "0.7473864", "text": "activate() {\n this.original = this.rating;\n this.rating = 3;\n }", "title": "" }, { "docid": "ad793dfaeccc57443d788085f4ff0103", "score": "0.73967093", "text": "onStarClick(rating) {\n this.setState({ rating });\n }", "title": "" }, { "docid": "adf774db4c82dfbcb7699fa1f674b326", "score": "0.7336679", "text": "updateRating(event,value){\n\t\tthis.setState({\n\t\t\tnumRatings: this.state.numRatings + 1,\n\t\t\tsumRatings: this.state.sumRatings + value,\n\t\t}, ()=>{\n\t\t\t\n\t\t\tif(this.state.viewed){\n\t\t\t\t//If user has never rated the resource allow them to rate it\n\t\t\t\tif(!this.state.rated){\n\n\t\t\t\t\tlet resourceRef = fire.database().ref(this.props.path);\n\t\t\t\t let userPath = \"users.\" + this.props.userId;\n\t\t\t\t resourceRef.update({\n\t\t\t\t \tnumRatings: this.state.numRatings,\n\t\t\t\t sumRatings: this.state.sumRatings,\n\t\t\t\t });\n\t\t\t\t \n\t\t\t\t resourceRef.child(\"users\").child(this.props.userId).child('rate').set(true);\n\n\t\t\t\t this.setState({\n\t\t\t\t \trated:true,\n\t\t\t\t \trating: Math.round(this.state.sumRatings/this.state.numRatings)\n\t\t\t\t });\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2189bc10e7b91e4426f58808de55cdea", "score": "0.72360206", "text": "setRating(event, index, value) {\n this.setState({\n userRating: value\n })\n }", "title": "" }, { "docid": "0aefb8befe752744c8a53cd4835cb86b", "score": "0.7211355", "text": "function updateRating() {\n if (score >= 1000) {\n stars = 3;\n } else if (score <= 999 && score >= 500) {\n stars = 2;\n } else {\n stars = 1;\n }\n genStars(stars);\n}", "title": "" }, { "docid": "4092cf0680caef3c5e430b1a17bc004c", "score": "0.71641064", "text": "onStarClick(nextValue, prevValue, name) {\n this.setState({rating: nextValue});\n }", "title": "" }, { "docid": "f9f2f3f0ea2438e91c952aa69b38cd5b", "score": "0.7150876", "text": "function setRating(ev) {\n let span = ev.currentTarget;\n let match = false;\n let num = 0;\n stars.forEach(function (star, index) {\n if (match) {\n star.classList.remove('rated');\n } else {\n star.classList.add('rated');\n }\n if (star === span) {\n match = true;\n num = index + 1;\n }\n });\n document.querySelector('.stars').setAttribute('data-rating', num);\n }", "title": "" }, { "docid": "974c9b41f3b95975cee43cf70c4e50fa", "score": "0.7105441", "text": "setRating(rating) {\n AppDispatcher.dispatch({\n actionType: ProductConstants.SET_RATING,\n rating,\n });\n }", "title": "" }, { "docid": "a01b839d20d77c2651c13a22090b8329", "score": "0.70318764", "text": "onStarRatingPress(rating) {\n this.setState({\n starCount: rating\n });\n }", "title": "" }, { "docid": "e74acdb01eb4f8829f5188f2eed4213e", "score": "0.69187725", "text": "function updateRate() {\n let data = document.querySelector('.stars').innerHTML;\n current.initialRate = data;\n document.querySelector('#result .stars').innerHTML = data;\n }", "title": "" }, { "docid": "fdb65770affdc1d74bd2a608da3c365d", "score": "0.6864113", "text": "handleComfort(rating) {\r\n this.setState({\r\n comfortRating: rating\r\n });\r\n }", "title": "" }, { "docid": "fa587ad5cf1ac281dc32b99a3d1d03e5", "score": "0.68601424", "text": "onStarClick(nextValue, prevValue, name) {\n this.setState({yourRating: nextValue}, () => {\n fetch(`/talks/rate/${this.props.talk.id}/${this.state.yourRating}`).then(res => res.json()).then(talk => this.setState({talk}, ()=> {\n this.setState({success: 'You have successfully added a rating to this talk. Next time you visit this page the average will be updated'})\n console.log(this.state.talk.ratings);\n }));\n });\n }", "title": "" }, { "docid": "ef3d80652b364645647474b51dfc87b9", "score": "0.6824096", "text": "handleFood(rating) {\r\n this.setState({\r\n foodRating: rating\r\n });\r\n }", "title": "" }, { "docid": "77f5bfa9e5e2df7f6d7f6ed886d709bd", "score": "0.6798433", "text": "function activateRating(){\n\t$('.stars').click(function(){\n\t\tvar rate = parseInt($(this).data('star'));\n\n\t\t$('.stars').each(function(){\n\t\t\tif(parseInt($(this).data('star')) <= rate) $(this).addClass('rated');\n\t\t\telse $(this).removeClass('rated');\n\t\t});\n\n\t\t$('#review_rating').val(parseFloat($(this).data('star')));\n\t});\n}", "title": "" }, { "docid": "5aa56a597a07d91d6fac92141d83371b", "score": "0.6720371", "text": "handleCoffee(rating) {\r\n this.setState({\r\n coffeeRating: rating\r\n });\r\n }", "title": "" }, { "docid": "bd4e76617a9c4189ce731c82586790ed", "score": "0.67196757", "text": "function setRating(ev) {\n let span = ev.currentTarget;\n let stars = document.querySelectorAll('.star');\n let match = false;\n let num = '';\n stars.forEach(function (star, index) {\n if (match) {\n star.classList.remove('rated');\n } else {\n star.classList.add('rated');\n }\n\n if (star === span) {\n match = true;\n num = index + 1;\n }\n\n });\n document.querySelector('.stars').setAttribute('data-rating', num);\n\n}", "title": "" }, { "docid": "088127ab6326ddc92f7d98a79a79567f", "score": "0.67185175", "text": "function updateRating(difference) {\n var newRating = gCurrBook.rating + difference;\n if (newRating >= 0 && newRating <= 10) {\n gCurrBook.rating += difference;\n }\n\n}", "title": "" }, { "docid": "1a5fbbb74e73f9725fc74ee92581010b", "score": "0.6702775", "text": "handleAtmosphere(rating) {\r\n this.setState({\r\n atmosphereRating: rating\r\n });\r\n }", "title": "" }, { "docid": "74772768c753858b4e4f25f4742f19c2", "score": "0.6679789", "text": "handleClick(ratingValue) {\n this.setState({ rating: ratingValue });\n }", "title": "" }, { "docid": "3ca4018e830b99a7c05eef351ad05941", "score": "0.66791654", "text": "function rate(starNum){\n starNum++;\n //starNum incremented, to account for the index numbers being different than the number of the star\n var {id, name, job, image, text} = Reviews[Id];\n //Reviews variables deconstructed\n (starNum !== Math.ceil(rating)) ? setReviews(Reviews.map(review => review = (review.id !== id) ? review : {id, rating: starNum, name, job, image, text})) : (rating === starNum - 0.5) ? setReviews(Reviews.map(review => review = (review.id !== id) ? review : {id, rating: starNum - 1, name, job, image, text})): setReviews(Reviews.map(review => review = (review.id !== id) ? review : {id, rating: starNum - 0.5, name, job, image, text}));\n //if the starNum is not the rating rounded up, setReviews will change the current review's rating in the Reviews array starNum. If the rating is 0.5 less than the starNum, the rating will be 1 less than the starNum, otherwise, it will be 0.5 less than the starNum\n }", "title": "" }, { "docid": "c83b85997284c7be76099eb38cd91514", "score": "0.66706795", "text": "updateStars() {\n if (gameState.currentMeal.fullnessValue === gameState.currentCustomer.fullnessCapacity) {\n gameState.currentCustomer.list[0].setTint(0x3ADB40);\n gameState.sfx.servingCorrect.play();\n \n gameState.score += 100;\n gameState.scoreText.setText(gameState.score);\n \n if (gameState.starRating < 5) {\n gameState.starRating += 1;\n }\n\n if (gameState.starRating === 5) {\n gameState.sfx.fiveStars.play();\n }\n\n } else if (gameState.starRating > 1) {\n if (gameState.fullnessValue > 0) {\n gameState.starRating -= 1;\n gameState.currentCustomer.list[0].setTint(0xDBD53A);\n gameState.sfx.servingIncorrect.play();\n } else {\n gameState.currentCustomer.list[0].setTint(0xDB533A);\n gameState.sfx.servingEmpty.play();\n gameState.starRating -= 2;\n }\n \n if (gameState.starRating < 1) {\n this.scene.stop('GameScene');\n this.scene.start('LoseScene');\n }\n } else {\n this.scene.stop('GameScene');\n this.scene.start('LoseScene');\n }\n this.drawStars();\n }", "title": "" }, { "docid": "aea4a61ce470545bf7a5ed97698e30ea", "score": "0.66576505", "text": "function changeRating(newRating) {\n setRating(newRating);\n setId(window.location.href.split(\"/\").pop());\n getProduct();\n console.log(id);\n }", "title": "" }, { "docid": "4834c607a3e2c38196fa5d66341ba456", "score": "0.6611573", "text": "UpdateRatingB() {\n\n if (this.state.FavLocationB == 0) {\n this.setState({ FavLocationB: 1, });\n } else {\n this.setState({ FavLocationB: 0, });\n }\n }", "title": "" }, { "docid": "63f0b17c8af943580c3404b23d950353", "score": "0.659912", "text": "update() {\n let totalRating = this.getTotalRating_();\n\n totalRating.score = totalRating.score.map((grade, i) =>\n totalRating.scoreCount[i] >= MIN_SCORE_COUNT ?\n grade :\n 0\n );\n\n if (totalRating.score.every(grade => grade) &&\n totalRating.reviewCount >= MIN_REVIEW_COUNT\n ) {\n totalRating.totalScore = ratingService.calculateTotalScore(\n totalRating.score\n );\n } else {\n totalRating.totalScore = 0;\n }\n\n this.updateTable_(totalRating);\n }", "title": "" }, { "docid": "55a55751d9db258fde73c005fcbc6631", "score": "0.6553357", "text": "handleChange(event, number) {\n console.log(this.props.reduxState);\n this.setState({\n ...this.state,\n [number]: event.target.value,\n ready: true, \n });\n console.log(\"rating:\", event.target.value);\n }", "title": "" }, { "docid": "91572263b081dade490a9a5eec635308", "score": "0.6516468", "text": "function tmm_star_rating() {\n\t\t\t//remove all background star related classes each time and radio button is clicked\n\t\t\t$('.review-selected').removeClass('per20 per40 per60 per80 per100');\n\t\t\t\n\t\t\t//check which radio button is checked and apply class to show correct number of selected stars\t\n\t\t\tswitch ( $('#input_2_4 input:checked').attr('id') ) {\n\t\t\t\tcase 'choice_4_0': \n\t\t\t\t\t$('.review-selected').addClass('per20');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'choice_4_1': \n\t\t\t\t\t$('.review-selected').addClass('per40');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'choice_4_2': \n\t\t\t\t\t$('.review-selected').addClass('per60');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'choice_4_3': \n\t\t\t\t\t$('.review-selected').addClass('per80');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'choice_4_4': \n\t\t\t\t\t$('.review-selected').addClass('per100');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b7d923a8de6903a015b200de226f7762", "score": "0.65041906", "text": "onStarRatingPress(rating) {\n const isRated = this.props.ratedIds.includes(this.props.item.id);\n if (isRated) {\n Alert.alert(' ', 'This restaurant is already rated');\n } else {\n this.setState({\n starCount: rating\n });\n this.props.addRatedRestaurants(this.props.item.id);\n this.props.storeEvaluation(this.props.item.id, rating);\n }\n }", "title": "" }, { "docid": "b7d923a8de6903a015b200de226f7762", "score": "0.65041906", "text": "onStarRatingPress(rating) {\n const isRated = this.props.ratedIds.includes(this.props.item.id);\n if (isRated) {\n Alert.alert(' ', 'This restaurant is already rated');\n } else {\n this.setState({\n starCount: rating\n });\n this.props.addRatedRestaurants(this.props.item.id);\n this.props.storeEvaluation(this.props.item.id, rating);\n }\n }", "title": "" }, { "docid": "5c061f0b9128a86dc4a4cb9534913c85", "score": "0.64901173", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "5c061f0b9128a86dc4a4cb9534913c85", "score": "0.64901173", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "06f3c8fb3387994b4b6e5f52716cf803", "score": "0.64639133", "text": "_onRating(rating) {\n }", "title": "" }, { "docid": "440f7888859c2c963e611cf540da72f1", "score": "0.64355975", "text": "function updateRating() {\n if (moves > 16 && moves <= 24) {\n // replace 3rd li with empty star icon if not already there\n if (!stars.children[2].classList.contains(\"fa-star-o\")) {\n modifyStars(stars.children[2], 2);\n }\n }\n else if (moves > 24) {\n // replace 2nd li so that there will be 1 full and 2 empty stars\n if (!stars.children[1].classList.contains(\"fa-star-o\")) {\n modifyStars(stars.children[1], 1);\n }\n }\n}", "title": "" }, { "docid": "98134f2caa2e3023face8d17713b8749", "score": "0.6410609", "text": "constructor(props) /* A. */ {\n super(props);\n this.state = {rating: this.props.rating};\n }", "title": "" }, { "docid": "94814b16068782a5d4188af5c2af3a8d", "score": "0.63857865", "text": "function handleClick(rating) {\r\n let currentDate = new Date();\r\n let newDate = new Date(\r\n currentDate.getTime() +\r\n 7 *\r\n (rating === \"easy\" ? 86400000 : rating === \"medium\" ? 3600000 : 60000)\r\n );\r\n props.handleRate(newDate);\r\n }", "title": "" }, { "docid": "f3e7ecb8845d28fcd7d620bb9fa859c5", "score": "0.63807595", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "5c63d70678c28ffec5dad95796337310", "score": "0.63658255", "text": "ratingCompleted(rating, name) {\n let stateObject = () => {\n let returnObject = {};\n returnObject[name] = rating;\n return returnObject;\n };\n this.setState(stateObject)\n}", "title": "" }, { "docid": "7a1011c2a3d6ae4b3c5c5071e7820de5", "score": "0.63635963", "text": "function setStar(i){\n stars[i] = (rating > i) ? (rating - i === 0.5)\n ? <BsStarHalf key={i} onClick={()=>rate(i)}/> : <BsStarFill key={i} onClick={()=>rate(i)}/>\n : <BsStar key={i} onClick={()=>rate(i)}/>; \n }", "title": "" }, { "docid": "cfa9f7de283929a1e3a83bb334b0e33b", "score": "0.6357867", "text": "handleRatingChange(newRating) {\n // use spread notation on object to built an object with field with same values than 'this.props' and then a new rating is set\n let book = { ...this.props, rating : newRating};\n // call function given by parent component in order to change state\n this.props.onBookChange(book);\n }", "title": "" }, { "docid": "f8046dc5df3ecf8448de144804346854", "score": "0.6331111", "text": "function starRating() {\n if (moves > 15 && moves < 21) {\n starCounter = 2;\n } else if (moves > 22) {\n starCounter = 1;\n }\n showStars(starCounter);\n }", "title": "" }, { "docid": "39bd867507ba16f7cb5b25779e2f00a4", "score": "0.63259554", "text": "function setStar(i, rating){\r\n rating = rating/2;\r\n if( rating == null)\r\n rating = 0;\r\n\r\n $(function () {\r\n \r\n $(\"#star\" + i).rateYo({\r\n rating: rating,\r\n readOnly: true,\r\n starWidth: \"20px\"\r\n });\r\n });\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "20e2ef77049ecd5ff30fc3bea18aec92", "score": "0.6308336", "text": "setStarCount(count) {\n this.starsCount = count;\n }", "title": "" }, { "docid": "7b1bc1f13434dd1b3cae849f8abb81fe", "score": "0.63069654", "text": "function change_article_rate( rate ) {\n\n\tif ( article_voted ) {\n\t\treturn false;\n\t}\n\t\n\tarticle_voted = true;\n\t\n\tvar rating = $('.article-like-num').text();\n\t\n\tdata = 'rate='+rate+'&article_id='+article_id+'&rating='+rating;\n\t$.ajax({\n\t\turl: 'ajax/ArticlesRating.php',\n\t\ttype: 'post',\n\t\tdata: data,\n\t\tdataType: 'text',\n\t\tsuccess: function(data){\n\t\t\t$('.article-like-num').text(data);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "621fdc0e4d39ccf9aaa5ac2dc03b8919", "score": "0.6221544", "text": "updateTaxRate(rate) {\n this.setState({tax: rate});\n }", "title": "" }, { "docid": "834024d4aa013923e9bb6be20b5cb8fe", "score": "0.62212265", "text": "changeStars() {\n\n switch(this.state.rating) {\n case '0':\n return \"stars-interactive\";\n break;\n\n case '1':\n return \"one-stars-big\";\n break;\n\n case '2':\n return \"two-stars-big\";\n break;\n\n case '3':\n return \"three-stars-big\";\n break;\n\n case '4':\n return \"four-stars-big\";\n break;\n\n case '5':\n return \"five-stars-big\";\n break;\n\n default:\n return \"stars-interactive\";\n break;\n }\n}", "title": "" }, { "docid": "b54ae00eec79d56a2c5424ca51d812ed", "score": "0.6199567", "text": "function RatingStars() {\n return (\n <div>\n {isRating ? (\n <div>\n <span>Add your rate</span>\n <Rating\n name=\"simple-controlled\"\n onClick={handleHasRated}\n emptyIcon={<StarBorderIcon fontSize=\"inherit\"/>}\n />\n </div>\n ) : (\n <div>\n <Rating\n name=\"simple-controlled\"\n value={averageRate} precision={0.5}\n emptyIcon={<StarBorderIcon fontSize=\"inherit\"/>}\n readOnly/>\n <span id=\"totalReview\">({totalReview})</span>\n <Button\n id=\"rateButton\"\n onClick={handleToRate}\n variant=\"contained\"\n color=\"secondary\"\n startIcon={<RateReviewIcon/>}\n >\n Rate\n </Button>\n </div>\n )}\n </div>\n );\n }", "title": "" }, { "docid": "8dcaf9e1ff267fe40b65b003bb04f5c6", "score": "0.6199232", "text": "function setRating(ratingPass){\n\trating = ratingPass;\n\tif (ratingPass == \"position\")\n\t{rating = \"(number(@position='C') * 1) + (number(@position='LW') * 2) + (number(@position='RW') * 3) + (number(@position='D') * 4) + (number(@position='G') * 5)\";}\n\tif (rating == \"number\" || rating == \"name\" || rating == \"hand\" || ratingPass == \"position\")\n\t{sortOrder = 'ascending';} else {sortOrder = 'descending';}\n}", "title": "" }, { "docid": "7bd7358320fc4deec6bb057a6d0de8e9", "score": "0.61961627", "text": "increaseScore(){\n let oldScore = this.state.score;\n newScore = oldScore + 1;\n this.setState({score: newScore})\n ScoreManager.saveTaskScore(newScore.toString());\n }", "title": "" }, { "docid": "d808ebb0dac046480ac317fa8b500350", "score": "0.6192929", "text": "function switchRated() {\n vm.rated = !vm.rated;\n loadDataInDiagram();\n }", "title": "" }, { "docid": "f4bebbf3bfcba7105ca7ec4003d33ccc", "score": "0.6186404", "text": "function updateUserStarStyle() {\n $('div.ipl-rating-widget > div.ipl-rating-star svg.ipl-star-icon').each(function(i, svg) {\n var ratingDiv = $(svg).parent().siblings(\"span.ipl-rating-star__rating\")[0];\n if (ratingDiv === undefined) {\n return;\n }\n var rating = parseInt(ratingDiv.textContent);\n starSetStyle(svg, rating, { light: true });\n });\n }", "title": "" }, { "docid": "209afeb6c524d4e5376b8131a2c91b09", "score": "0.61450964", "text": "function updateIcons(currentRating) {\n currentRating = parseInt(currentRating, 10);\n $scope.lerater.icons.forEach(function(icon) {\n icon.color = (icon.rating < currentRating)\n ? $scope.model.config.icon.onColor\n : $scope.model.config.icon.offColor;\n });\n }", "title": "" }, { "docid": "80fe77d61eb8faf74b2e01cd9548661a", "score": "0.6136667", "text": "function setRating(){\n\tvar stars = document.getElementById('stars');\n\tif (numberOfMoves > 15 && numberOfMoves <=20){\n\t\tstars.innerHTML='Your Rating: &bigstar; &bigstar; <span style=\"color:grey\">&bigstar;</span>';\n\t\trating = \"Your rating is 2 stars.\";// these strings are used in the modal.\n\t\tnumberOfStars = 2;\n\t} ;\n\tif (numberOfMoves > 20){\n\t\tstars.innerHTML='Your Rating: &bigstar; <span style=\"color:grey\">&bigstar;</span> <span style=\"color:grey\">&bigstar;</span>';\n\t\trating = \"Your rating is 1 star.\"\n\t\tnumberOfStars = 1;\n\t} ;\n}", "title": "" }, { "docid": "2f874a27751ad34d4e32aabd0f5d2148", "score": "0.6130454", "text": "function modify_existing_rating(ratingChild, image_srcArr, starNum, image_id){\n\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Point to the image under \"rating\" in our database. Get the val which \n\t\t\t\t * includes its avg rating - index 0, comments- index 1, and total num of rating -index 3.\n\t\t\t\t * Calculation and round to nearest whole of the avg (Math.round) and then store it in an array\n\t\t\t\t * to be pushed back and stored again in the database.\n\t\t\t\t */\n\t\t\t\t \n\t\t\t\tvar image_that_got_rated = ratingChild.child(image_srcArr[0]);\n\t\t\t\timage_that_got_rated.once(\"value\", function(snap) {\n\t\t\t\t\tvar ratingArray = new Array();\n\t\t\t\t\tratingArray = snap.val();\n\t\t\t\t\n\t\t\t\t\tif(ratingArray[2] == 0){\n\t\t\t\t\t\tvar round = starNum;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tvar avg = (ratingArray[0] + starNum)/2;\n\t\t\t\t\t\tvar round = Math.round(avg);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tratingArray[0] = round;\n\t\t\t\t\tratingArray[2] += 1;\n\t\t\t\t\timage_that_got_rated.set(ratingArray);\n\t\t\t\t\tinitialStars(image_id, round);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "b2c049f2d7c7dbb55130004487385803", "score": "0.61268914", "text": "rate(num_stars) {\n\n let this_obj = this;\n\n call_api(lambda_apis.rate,\n {\n \"user_id\": user_id,\n \"op\": \"add_rating\",\n \"movie_id\": this.movie_id,\n \"rating\": num_stars\n },\n function(response) { // handler\n if(response.error === \"None\") {\n this_obj.rating = num_stars;\n this_obj.render_rating(num_stars);\n }\n else\n alert(\"Unable to write new movie rating into database.\");\n });\n\n if (this.hide_after_rate)\n this.parent_tag.style.visibility = \"collapse\";\n }", "title": "" }, { "docid": "7eb26b54e0d582ef4b1d95bbb34024ab", "score": "0.6118908", "text": "function onIncreaseBookRating(id) {\n increaseBookRating(id)\n $('.rate').html(gBooks[id - 1].rating)\n renderBooks()\n}", "title": "" }, { "docid": "1e50b817b0e9b94f919b3037b40b2e3d", "score": "0.61146885", "text": "function moveAndRating() {\n\n\t//To Update Moves Counter\n\tnumOfMoves++;\n\t$(\".moves\").text(numOfMoves);\n\n\t//To Update Rating Counter\n\tif (numOfMoves === twoStar || numOfMoves === threeStar ) {\n\t\tlet stars = $(\".fa-star\");\n\t\t$(stars[stars.length-1]).toggleClass(\"fa-star fa-star-o\");\n\t}\n}", "title": "" }, { "docid": "b5607c21474aba06f5a8e8d497a004a2", "score": "0.6102323", "text": "_setRatio(ratio) {\n this.setState({ ratio });\n }", "title": "" }, { "docid": "27adafc8ae705f99ce15cfccdc832e48", "score": "0.610165", "text": "function rating(num) {\n sMax = 0; // Isthe maximum number of stars\n for (n = 0; n < num.parentNode.childNodes.length; n++) {\n if (num.parentNode.childNodes[n].nodeName === \"A\") {\n sMax++;\n }\n }\n\n if (!rated) {\n s = num.id.replace(\"_\", ''); // Get the selected star\n stars = s;\n a = 0;\n for (i = 1; i <= sMax; i++) {\n if (i <= s) {\n document.getElementById(\"_\" + i).className = \"on\";\n document.getElementById(\"rateStatus\").innerHTML = num.title;\n holder = a + 1;\n a++;\n } else {\n document.getElementById(\"_\" + i).className = \"\";\n }\n }\n }\n}", "title": "" }, { "docid": "fbfcae9f5f4c4a28619161b224ce6509", "score": "0.60825723", "text": "handleIncreaseScore() {\n this.setState(function(state) {\n return {\n score: state.score === 10 ? 0 : state.score + 1\n };\n });\n }", "title": "" }, { "docid": "760ec0e4095bb41e211cb2a10b20f1a6", "score": "0.60785174", "text": "function setRating(moves) {\n\tlet rating = 3;\n\tif (moves > 10 && moves < 16) {\n\t\t$starRating.eq(2).removeClass('fa-star').addClass('fa-star-o');\n\t\trating = 2;\n\t} else if (moves > 16 && moves < 20) {\n\t\t$starRating.eq(1).removeClass('fa-star').addClass('fa-star-o');\n\t\trating = 1;\n\t} else if (moves > 20) {\n\t\t$starRating.eq(0).removeClass('fa-star').addClass('fa-star-o');\n\t\trating = 1;\n\t}\n\treturn { score: rating };\n}", "title": "" }, { "docid": "ef5ef9f6923f92cf7b6369122b4b87c2", "score": "0.60510206", "text": "function updateStarRating() {\n var htmlListItem = '<li><i class=\"fa fa-star\"></i></li>';\n var $stars = $(\"#stars\");\n $stars.empty();\n\n switch (true) {\n case (numberOfMoves >= 20):\n numberOfStars = 1;\n break;\n case (numberOfMoves >= 15):\n numberOfStars = 2;\n break;\n case (numberOfMoves < 15):\n numberOfStars = 3;\n break;\n }\n\n for (var i = 1; i <= numberOfStars; i++) {\n $stars.append(htmlListItem);\n }\n}", "title": "" }, { "docid": "bfa6acbbb73f36a8953772ae71d8778d", "score": "0.6050096", "text": "function rateIt(me) {\n if (!rated) {\n document.getElementById(\"rateStatus\").innerHTML = document.getElementById(\"ratingSaved\").innerHTML;\n preSet = me;\n rated = 1;\n sendRate();\n rating(me);\n }\n}", "title": "" }, { "docid": "a4a69f2c7eb586edf935a9a17479aa9f", "score": "0.60002816", "text": "render() {\n const { review: {\n name = '',\n email = '',\n comments = '',\n rating = 1,\n },\n } = this.state;\n this.nameEl.value = name;\n this.emailEl.value = email;\n this.commentsEl.innerText = comments;\n // this.ratingEl.value = rating - 1;\n this.ratingEl.setAttribute('data-rating', rating || 1);\n }", "title": "" }, { "docid": "65e01447c5362e5b202d40f3bfe71b7b", "score": "0.5996738", "text": "handleOptionChange(changeEvent) {\n this.setState({\n rating: changeEvent.target.value\n });\n // console.log(this.state);\n}", "title": "" }, { "docid": "c736f7c359c5be896d1c1ce31bacd343", "score": "0.5972351", "text": "function setRating(event){\n let clickedIcon = event.currentTarget;\n let arrIcons = document.querySelectorAll('.star');\n let match = false;\n let num = 0;\n for (i = 4 ; i >= 0 ; i--){\n if(match){\n arrIcons[i].classList.remove('rated');\n }else{\n arrIcons[i].classList.add('rated');\n }\n //looking for the clickedIcon\n if (arrIcons[i] === clickedIcon){\n match = true;\n num = arrIcons[i] + 1;\n }\n }\n}", "title": "" }, { "docid": "05a1d3eb820735ebed82ea821ab26601", "score": "0.59529203", "text": "updateScore() {\n let newVal = 3;\n if (this.moves < 15) {\n newVal = 3;\n } else if (this.moves < 25) {\n newVal = 2;\n } else {\n newVal = 1;\n }\n if (this.stars !== newVal) {\n const starsElem = $('.stars');\n starsElem.empty();\n for (let i = 0 ; i < newVal; i++) {\n starsElem.append('<li><i class=\"fa fa-star\"></i></li>');\n }\n this.stars = newVal;\n }\n $('.moves').text(this.moves);\n }", "title": "" }, { "docid": "36fc55c612848e12612f31e9b74a0bbd", "score": "0.5936225", "text": "function updateMyStarStyle(firstTime = false) {\n $('label.ipl-rating-interactive__star-container svg.ipl-star-icon').each(function(i, svg) {\n if (firstTime) { // first time (element creation)? add style change observer\n scObserver.observe($(svg).closest('label')[0], { attributes : true, attributeFilter : ['style'] });\n }\n var ratingDiv = $(svg).parent().siblings(\"span.ipl-rating-star__rating\")[0];\n if (ratingDiv === undefined) {\n return;\n }\n var rating = parseInt(ratingDiv.textContent);\n starSetStyle(svg, rating);\n });\n }", "title": "" }, { "docid": "bd1d83e0c5993bdb3ad3d6c3923896cf", "score": "0.5934892", "text": "ratingCompleted(rating) {\r\n console.log(\"Rating is: \" + rating)\r\n }", "title": "" }, { "docid": "4e42b393c93917a7434107bb5ff7fd84", "score": "0.59194326", "text": "handleWeightedChange(isWeighted) {\n this.setState({\n isWeighted,\n });\n }", "title": "" }, { "docid": "9101d873dcf56d85faf17f05c42c92ea", "score": "0.59149927", "text": "function changeRating(element, changeElement, value, textPrefix) {\n var ratingArr = $(element).data('rating');\n var newValue = parseInt(value);\n\n if (ratingArr == \"undefined\" || ratingArr == undefined) {\n var arr = [];\n arr.push(newValue);\n $(element).data('rating', arr);\n } else {\n ratingArr.push(newValue);\n $(element).data('rating', ratingArr);\n }\n\n var newRating = averageOfArray($(element).data('rating'));\n $(changeElement).text(textPrefix + newRating.toFixed(0) + ' / 10');\n }", "title": "" }, { "docid": "5f35fc0d73097593d0a1d4f33de7d8e5", "score": "0.59088606", "text": "set powerRating(value) { this[data].powerRating = value; }", "title": "" }, { "docid": "5b25682b301f52b880d71511911537dc", "score": "0.588322", "text": "function updateRating(ratingInfo, callback){\n pool.query(SQL`UPDATE gururatings SET Rating = ${ parseInt(ratingInfo.rating) }, \n Certified = ${ parseInt(ratingInfo.cert) },\n Last_Modified = current_timestamp \n WHERE GuruId = ${ parseInt(ratingInfo.guruId) }`, (err, res)=> {\n if(err) {\n callback(err);\n } else {\n callback(null);\n }\n })\n}", "title": "" }, { "docid": "e6a31a78f4388b1d75d11163de755cd6", "score": "0.5875041", "text": "function MyRatings({breweryId, origin, rating}) {\n const dispatch = useDispatch();\n // create a unique name for the Material-UI Rating component using the breweryId\n const componentName = `rating${breweryId}`; \n\n // change handler for whenever a user clicks on a different rating star to change their rating\n const handleChange = (event) => {\n dispatch({ type: 'SET_RATING_VALUE', payload: {\n newRating: Number(event.target.value), \n breweryId: breweryId,\n // origin are props that contain a string with the name of the component that the rating is a child of to assist in saga refresh after updates\n origin: origin\n }})\n }\n\n\n return (\n <div>\n <Box component=\"fieldset\" mb={0} borderColor=\"transparent\">\n <Typography component=\"legend\">Your Rating:</Typography>\n <Rating\n name={componentName}\n size=\"large\"\n value={rating}\n // precision={0.5} : Option to allow users to rate in half-star increments. Stars are too small to be UI friendly on a \n // mobile device for half ratings\n onChange={() => handleChange(event)}\n />\n </Box>\n </div>\n )\n}", "title": "" }, { "docid": "d43600507b17d05dc1a49967d917bf13", "score": "0.5865133", "text": "constructor(props) {\n super();\n this.state = {\n editing: false,\n rating: props.dog.rating\n\n };\n // Bind function (used in button)\n }", "title": "" }, { "docid": "c3f338d30737b4771d62709c5fcf13e8", "score": "0.585876", "text": "createRating(rating){\r\n const starStyle = {\r\n float: \"left\",\r\n height: \"inherit\",\r\n }\r\n //rating\r\n return(\r\n <div style={{height: \"13px\"}}>\r\n <img style={starStyle} src={rating > 0 ? \"./img/ic_star_white_18dp.png\" : \"./img/ic_star_border_white_18dp.png\"}></img>\r\n <img style={starStyle} src={rating > 1 ? \"./img/ic_star_white_18dp.png\" : \"./img/ic_star_border_white_18dp.png\"}></img>\r\n <img style={starStyle} src={rating > 2 ? \"./img/ic_star_white_18dp.png\" : \"./img/ic_star_border_white_18dp.png\"}></img>\r\n <img style={starStyle} src={rating > 3 ? \"./img/ic_star_white_18dp.png\" : \"./img/ic_star_border_white_18dp.png\"}></img>\r\n <img style={starStyle} src={rating > 4 ? \"./img/ic_star_white_18dp.png\" : \"./img/ic_star_border_white_18dp.png\"}></img>\r\n </div>\r\n )\r\n }", "title": "" }, { "docid": "9415e8e96c03aac5b23b84df8d109bfb", "score": "0.5839063", "text": "function setStarRating(numRating, ratingDiv) {\n var maxStars = 5;\n var roundedRating = Math.floor(numRating);\n var remainingStars = Math.floor(maxStars - numRating);\n var previousStar;\n var newStar;\n\n for (i = 0; i < numRating; i++) {\n newStar = document.createElement(\"i\");\n\n if (numRating == 0.5) {\n newStar.className = \"fas fa-star-half-alt\"; // half-star icon\n } else {\n newStar.className = \"fas fa-star\"; // full star icon\n }\n\n if (i == 0) { // if it's the first star, add it to the ratingDiv\n ratingDiv.append(newStar);\n previousStar = newStar;\n } else { // add new star as child to previous star\n previousStar.append(newStar);\n }\n }\n\n if (numRating % roundedRating == 0.5) {\n newStar.className = \"fas fa-star-half-alt\";\n previousStar.append(newStar);\n previousStar = newStar;\n }\n\n /*\n * Adds empty stars for difference comparing rating to maxStars \n * There should always be 5 star icons total\n */\n if (remainingStars > 0) {\n for (i = 0; i < remainingStars; i++) {\n newStar = document.createElement(\"i\");\n newStar.className = \"far fa-star\";\n previousStar.append(newStar);\n previousStar = newStar;\n }\n }\n}", "title": "" }, { "docid": "e7f451b12bba1938b58d7f52c6fdc242", "score": "0.5836753", "text": "function showRating() {\n switch (moveCounter) {\n // If number of moves >= 16, it changes to a 2 star rating\n case 16:\n starsPanel.innerHTML = starItem + starItem;\n break;\n // If number of moves >= 24, it changes to a 1 star rating\n case 24:\n starsPanel.innerHTML = starItem;\n }\n}", "title": "" }, { "docid": "fbe90c49b2aaa6394763fb1254d6aaab", "score": "0.5819291", "text": "rateTrack(e, rating) {\n let id = this.props.track._id;\n\n axios\n .put(\"/api/rate-track/\" + id + \"/rating/\" + rating)\n // handle success\n .then(response => {\n console.log(response);\n })\n // handle error\n .catch(error => {\n console.log(\"Error\", error);\n })\n // always executed\n .then(() => {\n this.setState({ trackRated: true });\n console.log(\"track liked\");\n });\n }", "title": "" }, { "docid": "c23722d5ed3086b8039d9eef81dc9ce5", "score": "0.5816934", "text": "vote(type) {\r\n this.setState(state => ({\r\n vote: state.vote === type ? 0 : type\r\n }));\r\n }", "title": "" }, { "docid": "dc214aea361104c9eff73c9ecdeb3b6d", "score": "0.57793325", "text": "changeVote(jkID, delta) {\n // delta +1/-1\n this.setState( st => {\n const updateScore = st.jokes.map(jk => {\n if (jk.id === jkID) {\n return { ...jk, score: (jk.score + delta) };\n }\n return jk;\n });\n return { jokes: updateScore };\n });\n }", "title": "" }, { "docid": "2ccbcf976708acc6d221e6603b87cbfe", "score": "0.57693017", "text": "addTenToScore() {\n let score = this.state.score;\n score += 10;\n this.setState({ score: score });\n }", "title": "" }, { "docid": "032737326158a5eb2effd639e015057e", "score": "0.5768236", "text": "updateScore() {\n this.currentScore = this.currentScore + 600;\n }", "title": "" }, { "docid": "b98cf3b62d5af9e1424ba9e8e4dae582", "score": "0.57609516", "text": "function updateMoves() {\n\n $(\"#moves\").text(moves.toString());\n if (moves > 0 && moves < 12) {\n starRating = starRating;\n } else if (moves >= 12 && moves <= 18) {\n $(\"#starOne\").removeClass(\"fa-star\");\n starRating = \"2\";\n } else if (moves > 19) {\n $(\"#starTwo\").removeClass(\"fa-star\");\n starRating = \"1\";\n }\n}", "title": "" }, { "docid": "ea757a3fb28dda14a6d5d0026be891db", "score": "0.5757851", "text": "function rateUpdate(rate) { $(\"#rate\").text(rate + \"\"); }", "title": "" }, { "docid": "35ae2f174afa7692e8b0e6b14f2964ea", "score": "0.5750233", "text": "function rating() {\n if (movesCount == 15) {\n starCount[4].classList.remove(\"fa-star\");\n starCount[4].classList.add(\"fa-star-o\");\n } else if (movesCount == 21) {\n starCount[3].classList.remove(\"fa-star\");\n starCount[3].classList.add(\"fa-star-o\");\n\n } else if (movesCount == 27) {\n starCount[2].classList.remove(\"fa-star\");\n starCount[2].classList.add(\"fa-star-o\");\n } else if (movesCount == 33) {\n starCount[1].classList.remove(\"fa-star\");\n starCount[1].classList.add(\"fa-star-o\");\n }\n}", "title": "" }, { "docid": "05c9dfb11383baae0e1789e3f3f1c726", "score": "0.57446396", "text": "constructor(props) {\n super(props);\n this.state = {\n starCount: 2\n };\n }", "title": "" }, { "docid": "0a8b7454707d7e40125bdacb85e7ae92", "score": "0.5741056", "text": "function changeCardQuality() {\n var cardId = $(this).parent().parent().attr('id');\n var clickedBtn = $(this).attr('class');\n var currentCard = decodeIdea(cardId);\n if ((currentCard.quality !== 'genius') && (clickedBtn === 'button__upvote')) {\n currentCard.quality = getNewCardQuality(currentCard.quality, clickedBtn);\n } else if ((currentCard.quality !== 'swill') && (clickedBtn === 'button__downvote')) {\n currentCard.quality = getNewCardQuality(currentCard.quality, clickedBtn);\n }\n encodeIdea(cardId, currentCard)\n $(this).siblings('.quality--status').text(currentCard.quality);\n}", "title": "" }, { "docid": "84d57c81b4b3fee6532a055a49d06ba9", "score": "0.5735805", "text": "function updateStars(){\n scope.stars = [];\n for(var i = 0; i < scope.max; i++) {\n scope.stars.push({\n filled: i < scope.ratingValue,\n });\n }\n }", "title": "" }, { "docid": "33e870038a03da87d624061a15bf73cc", "score": "0.5731238", "text": "function updateMoves() {\n if (moves === 1) {\n $(\"#moves-text\").text(\" Move\");\n } else {\n $(\"#moves-text\").text(\" Moves\");\n }\n $(\"#moves\").text(moves.toString());\n\n if (moves > 0 && moves < 10) {\n playerRating = playerRating;\n } else if (moves >= 10 && moves <= 18) {\n $(\"#starOne\").removeClass(\"fa-star\");\n playerRating = \"2\";\n } else if (moves > 18) {\n $(\"#starTwo\").removeClass(\"fa-star\");\n playerRating = \"1\";\n }\n}", "title": "" }, { "docid": "89bbb1abdf618cca07991bf284cd07e0", "score": "0.57274485", "text": "starClicked(starValue) \n {\n //Input is the value of the coresponding radio button for that star\n //TODO, method seems redundant given we already have set star, but we'll keep here incase other use for star rating be clicked\n\n this.selectedOption = starValue;\n\n }", "title": "" }, { "docid": "a88cc7fd87e0b18069772db3a8d161b0", "score": "0.572459", "text": "handleChange(e) {\n let rate = $(':active').prevObject[0].activeElement.attributes[1].value\n $.ajax({\n url: '/update/ratings',\n method: 'PATCH',\n data: {\n rating: rate,\n id: this.props.data._id\n }\n })\n }", "title": "" }, { "docid": "cc905951a38326200ed774515367170b", "score": "0.5719322", "text": "function starRating() {\n if (count < 14) {\n document.getElementById(\"star-rating\").innerHTML = \"Rating: * * *\";\n numberOfStars = 3;\n } else if (count >= 14 && count <= 19) {\n document.getElementById(\"star-rating\").innerHTML = \"Rating: * *\";\n numberOfStars = 2;\n } else {\n document.getElementById(\"star-rating\").innerHTML = \"Rating: *\";\n numberOfStars = 1;\n }\n}", "title": "" }, { "docid": "8dc83e20dc9f2b0fad9924d14c4f5e74", "score": "0.5716674", "text": "function updateStars() {\n let stars = $(\".fa-star\");\n $(stars[stars.length - 1]).toggleClass(\"fa-star fa-star-o\");\n }", "title": "" }, { "docid": "a4ca0ea419af8b22a3e4b612a3d5a910", "score": "0.5686629", "text": "addRating(rating, rating2=null) {\n const { user, ratings, userRatings, contentCreator } = this.state;\n const timestamp = Math.round((new Date()).getTime() / 1000)\n const id = getNextId()\n const uid = rating.uid\n\n rating.timestamp = timestamp\n\n db.doCreateRating(id, rating)\n .then(data => {\n console.log(`Added rating (id: ${id}) to Firebase database`)\n this.rewardUser(contentCreator, user, \"RewardRating\")\n const ratings1 = this.getRatingsNewestVersion([{ ...rating, id: id }, ...ratings]);\n const userRatings1 = this.getRatingsNewestVersion([{ ...rating, id: id }, ...userRatings]);\n\n this.setState(() => ({\n ratings: ratings1,\n userRatings: userRatings1\n }));\n\n // Also add rating irrelevant for other facet, as 1 entity does usually not belong to both facets\n if (rating2) {\n this.addRating(rating2)\n }\n })\n .catch(error => {\n console.log('Error:', error);\n });\n }", "title": "" }, { "docid": "bd6b7e35779dbce71fc89af12e0228c1", "score": "0.5684663", "text": "function updateStarRating() {\n if (numOfMoves > 16 && numOfMoves <=20) {\n fifthStar.classList.remove('checked');\n }\n else if (numOfMoves > 20 && numOfMoves <= 24) {\n fourthStar.classList.remove('checked');\n }\n else if (numOfMoves > 24 && numOfMoves <= 28) {\n thirdStar.classList.remove('checked');\n }\n else if (numOfMoves > 28 && numOfMoves <= 32) {\n secondStar.classList.remove('checked');\n }\n}", "title": "" }, { "docid": "bd16a36a079cc4a75b1a4270ef9db56a", "score": "0.5676452", "text": "function starRatingChange() {\n var starRatingElement = document.getElementsByClassName(\"fa fa-star\");\n if ( 16 < currentMoves && currentMoves == 17) {\n starRatingElement[0].setAttribute(\"class\", \"''\");\n }\n\n if (24 < currentMoves && currentMoves == 25) {\n starRatingElement[1].setAttribute(\"class\", \"''\");\n }\n}", "title": "" }, { "docid": "b8fe2a2e1036897f0cc35dfe8611f9e3", "score": "0.56742966", "text": "function updateStarRating() {\n let topStars = document.querySelector('.stars');\n let scoreboardStars = document.querySelector('#star-rating');\n\n if (moveCount > 15) { // minimum possible moves\n if (moveCount < WRONG_MOVE_3_STAR_LIMIT) {\n topStars.innerHTML = '<i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i>';\n scoreboardStars.innerHTML = '<i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i>';\n } else if (moveCount < WRONG_MOVE_2_STAR_LIMIT) {\n topStars.innerHTML = '<i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i>';\n scoreboardStars.innerHTML = '<i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i>';\n } else if (moveCount < WRONG_MOVE_1_STAR_LIMIT) {\n topStars.innerHTML = '<i class=\"fa fa-star\"></i>';\n scoreboardStars.innerHTML = '<i class=\"fa fa-star\"></i>';\n }\n } else if (moveCount === 0) {\n topStars.innerHTML = '<i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i>';\n scoreboardStars.innerHTML = '<i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i><i class=\"fa fa-star\"></i>';\n }\n}", "title": "" }, { "docid": "871ae081e4cc1604c1f28ce6a4815f7d", "score": "0.5673599", "text": "render_rating(rating) {\n // apply solid stars to index 0 through (rating-1)\n for (let i = 0; i < rating; i++) {\n this.star_tags[i].textContent = \"★\";\n this.star_tags[i].style.color = \"gold\";\n }\n\n // apply empty stars to index (rating) through 4\n for (let i = rating; i < 5; i++) {\n this.star_tags[i].textContent = \"☆\";\n this.star_tags[i].style.color = \"goldenrod\";\n }\n }", "title": "" }, { "docid": "ed43abff9000ee6ec4ce076922c99764", "score": "0.56715846", "text": "function onStarClick(nextValue, prevValue, name, e) {\n //stop propagating to the parent onClick function (not working, must check why)\n e.preventDefault();\n setGivenRating(true);\n props.saveReview(id, nextValue);\n }", "title": "" } ]
d183bd510d51618570e1838a68fc3647
Normalizes the path separators and trims the trailing separator (when safe). For example, `/foo/ => /foo` but `/ => /`
[ { "docid": "713b0dd6f35804b0dc4979a793c51847", "score": "0.71360266", "text": "function safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}", "title": "" } ]
[ { "docid": "d3bcefcd1f496392ac7f9e1f387cad77", "score": "0.7493733", "text": "function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}", "title": "" }, { "docid": "d3bcefcd1f496392ac7f9e1f387cad77", "score": "0.7493733", "text": "function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}", "title": "" }, { "docid": "d3bcefcd1f496392ac7f9e1f387cad77", "score": "0.7493733", "text": "function normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}", "title": "" }, { "docid": "95165fed7f6a15f06bb4cf22b3c1c626", "score": "0.7165772", "text": "function unifyPath(path){\r\n if(path[0] !== '/') path = '/' + path;\r\n if(path[ path.length-1 ] !== '/') path += '/';\r\n return path;\r\n}", "title": "" }, { "docid": "dc601bd51f0dd0e1024235de73f61b79", "score": "0.7143909", "text": "function normalizePath(path) {\n return path.split('/').map(normalizeSegment).join('/');\n }", "title": "" }, { "docid": "cbd8d91d90a1587ef93202d6be436e01", "score": "0.71430063", "text": "function NormalizePath(path) {\n return path.replace(/\\\\/g, \"/\"); // normalize path to have \"/\" separators\n}", "title": "" }, { "docid": "a9a9005aee5873560ff6e45fd7cac70b", "score": "0.71255946", "text": "function _normalize_path(p) {\n if (p[0] !== \"/\") {\n p = \"/\" + p;\n }\n if (p.length > 0 && p[p.length - 1] === \"/\") {\n p = p.slice(0, -1);\n }\n return p;\n}", "title": "" }, { "docid": "4931d9139593814b4075a3ab1816300b", "score": "0.71086115", "text": "function fixPathSeparator(path) {\n\treturn path.replace(/\\\\/g, fs.separator).replace(/\\//g, fs.separator);\n}", "title": "" }, { "docid": "14c634403db3925a3a56e346192c22c6", "score": "0.7105684", "text": "function normalizePath(path) {\n return path.replace(/[\\\\\\/]+/g, '/');\n}", "title": "" }, { "docid": "8a0edbb3b4744bd4608fcec003f50572", "score": "0.70972264", "text": "function normalize(path) {\n\n var DOT_RE = /\\/\\.\\//g,\n DOUBLE_DOT_RE = /\\/[^/]+\\/\\.\\.\\//,\n DOUBLE_SLASH_RE = /([^:/])\\/\\//g;\n\n // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(DOT_RE, \"/\");\n\n // a/b/c/../../d ==> a/b/../d ==> a/d\n while (path.match(DOUBLE_DOT_RE)) {\n path = path.replace(DOUBLE_DOT_RE, \"/\");\n }\n\n // a//b/c ==> a/b/c\n path = path.replace(DOUBLE_SLASH_RE, \"$1/\");\n\n return path;\n }", "title": "" }, { "docid": "a23a6e734d5b2c8bf4c37580382c1d11", "score": "0.70826364", "text": "function normalizePath (str, stripTrailing) {\n if (typeof str !== 'string') throw new TypeError('expected a string')\n\n str = str.replace(/[\\\\\\/]+/g, '/')\n if (stripTrailing !== false) str = str.replace(/\\/$/, '')\n\n return str\n}", "title": "" }, { "docid": "66fa42b6f7323ad72b8be6a5ea5fe271", "score": "0.7045373", "text": "function normalizePath(path) {\n if (!path.endsWith(\"/\") && !path.endsWith(\"\\\\\")) {\n return path + \"/\";\n }\n return path;\n}", "title": "" }, { "docid": "0a6d46d723147776a6b13d11b85d1ddb", "score": "0.6958799", "text": "function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code;\n for (let i = 0, len = path.length; i <= len; ++i) {\n if (i < len)\n code = path.charCodeAt(i);\n else if (isPathSeparator(code))\n break;\n else\n code = constants_ts_1.CHAR_FORWARD_SLASH;\n if (isPathSeparator(code)) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n }\n else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 ||\n lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== constants_ts_1.CHAR_DOT ||\n res.charCodeAt(res.length - 2) !== constants_ts_1.CHAR_DOT) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(separator);\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n else if (res.length === 2 || res.length === 1) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += `${separator}..`;\n else\n res = \"..\";\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0)\n res += separator + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === constants_ts_1.CHAR_DOT && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n }", "title": "" }, { "docid": "6dd0bc24df964c8509a136dd4c94e29c", "score": "0.69444466", "text": "function normalizePath(path) {\n return path.split(\"/\")\n .map(normalizeSegment)\n .join(\"/\");\n}", "title": "" }, { "docid": "6dd0bc24df964c8509a136dd4c94e29c", "score": "0.69444466", "text": "function normalizePath(path) {\n return path.split(\"/\")\n .map(normalizeSegment)\n .join(\"/\");\n}", "title": "" }, { "docid": "6dd0bc24df964c8509a136dd4c94e29c", "score": "0.69444466", "text": "function normalizePath(path) {\n return path.split(\"/\")\n .map(normalizeSegment)\n .join(\"/\");\n}", "title": "" }, { "docid": "6dd0bc24df964c8509a136dd4c94e29c", "score": "0.69444466", "text": "function normalizePath(path) {\n return path.split(\"/\")\n .map(normalizeSegment)\n .join(\"/\");\n}", "title": "" }, { "docid": "38cdd02d6efe674174b799f738e6088b", "score": "0.6893238", "text": "function normalizePath(path) {\n return path.replace(/\\\\/g, \"/\");\n}", "title": "" }, { "docid": "20b062f93a0f728ed66b104369d7d3e0", "score": "0.6888657", "text": "function removePathTrailingSlash(path){return path.endsWith('/')&&path!=='/'?path.slice(0,-1):path;}", "title": "" }, { "docid": "21c91a6b0154927d865c31704b3e3381", "score": "0.6869984", "text": "function normalizePath(path) {\n return `/${path}/`.replace(rootStripper, '/')\n}", "title": "" }, { "docid": "b21d7061222e91a655419dd3d6abf9ba", "score": "0.6862175", "text": "function collapseLeadingSlashes(str){for(var i=0;i < str.length;i++) {if(str[i] !== '/'){break;}}return i > 1?'/' + str.substr(i):str;}", "title": "" }, { "docid": "3e6e129b48fbd7cc6633eba7b5f30b16", "score": "0.6816695", "text": "function normalize (p) {\n return p.replace(/\\/+/g, '/').replace(/^\\//, '');\n }", "title": "" }, { "docid": "42e63e1c6764bfde404b672965748494", "score": "0.6796038", "text": "function _normalizePath(p) {\n p = p.replace(/[\\/\\\\]/g, path.sep);\n p = p.replace(/[\\/\\\\]+$/, '');\n p = path.resolve(p);\n\n return p;\n}", "title": "" }, { "docid": "da0c9b3e54845c53d8b044845440a43e", "score": "0.67767197", "text": "function normalizePathname (pathname) {\n return pathname.replace(/^\\/+|\\/+$/g, '')\n}", "title": "" }, { "docid": "6accc77e51c1c06af03f0c8b86b091ab", "score": "0.6764347", "text": "function normalizePath(path) {\n // Separate the path into parts (delimited by slashes)\n let parts = [\"\"];\n for (let char of path) {\n if (char === \"/\" || char === \"\\\\\") {\n if (parts[parts.length - 1].length) {\n parts.push(\"\");\n }\n }\n else {\n parts[parts.length - 1] += char;\n }\n }\n // Special case for when the entire path was \".\"\n if (parts.length === 1 && parts[0] === \".\") {\n return \".\";\n }\n // Resolve \".\" and \"..\"\n let i = 0;\n while (i < parts.length) {\n if (parts[i] === \".\") {\n parts.splice(i, 1);\n }\n else if (i > 0 && parts[i] === \"..\") {\n parts.splice(i - 1, 2);\n i--;\n }\n else {\n i++;\n }\n }\n // Build the resulting path\n let result = \"\";\n for (let part of parts) {\n if (part && part.length) {\n if (result.length) {\n result += \"/\";\n }\n result += part;\n }\n }\n // Retain a slash at the beginning of the string\n if (path[0] === \"/\" || path[0] === \"\\\\\") {\n result = \"/\" + result;\n }\n // All done!\n return result;\n}", "title": "" }, { "docid": "fe58253eb0a3dd94bb7fa601870d8232", "score": "0.67159295", "text": "function _normalizePath(path) {\n var up = 0,\n i,\n parts = path.split(\"/\").filter(function (part, index) {\n return !!part;\n });\n\n for (i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === \".\") {\n parts.splice(i, 1);\n } else if (last === \"..\") {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n while (up--) {\n parts.unshift(\"..\");\n }\n\n return parts.join(\"/\");\n }", "title": "" }, { "docid": "6d2f7fe595112a2cb6ee30136abd2a32", "score": "0.6697654", "text": "function normalize(path) {\n var isPathAbsolute = isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isPathAbsolute).join('/');\n\n if (!path && !isPathAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + path;\n}", "title": "" }, { "docid": "a09d88c2af66203d17bd34d9c0f1766f", "score": "0.66738546", "text": "function collapseLeadingSlashes(str) {\n for (var i = 0; i < str.length; i++) {\n if (str[i] !== '/') {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "title": "" }, { "docid": "31475721c0793a02437f9e7a32217d02", "score": "0.6668223", "text": "function collapseLeadingSlashes(str) {\n\t for (var i = 0; i < str.length; i++) {\n\t if (str[i] !== '/') {\n\t break\n\t }\n\t }\n\n\t return i > 1\n\t ? '/' + str.substr(i)\n\t : str\n\t}", "title": "" }, { "docid": "48ad6b62e130168016b846945f2b1d74", "score": "0.66659445", "text": "normalizePath(wfsPath) {\n if (wfsPath[0] === '/') {\n wfsPath = wfsPath.slice(1);\n }\n if (wfsPath.length > 0 && wfsPath[wfsPath.length - 1] === '/') {\n wfsPath = wfsPath.slice(0, -1);\n }\n return wfsPath;\n }", "title": "" }, { "docid": "bfd7df47b28ef14235714596054223b2", "score": "0.66486067", "text": "function removeTrailingDirectorySeparator(path) {\n if (path.charAt(path.length - 1) === ts.directorySeparator) {\n return path.substr(0, path.length - 1);\n }\n return path;\n }", "title": "" }, { "docid": "cc588f7b7ac620b4243679203c8f8100", "score": "0.6634143", "text": "function normalizePath(path) {\n var isPathAbsolute = isAbsolute(path);\n var trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/');\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}", "title": "" }, { "docid": "cc588f7b7ac620b4243679203c8f8100", "score": "0.6634143", "text": "function normalizePath(path) {\n var isPathAbsolute = isAbsolute(path);\n var trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/');\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}", "title": "" }, { "docid": "cc588f7b7ac620b4243679203c8f8100", "score": "0.6634143", "text": "function normalizePath(path) {\n var isPathAbsolute = isAbsolute(path);\n var trailingSlash = path.substr(-1) === '/';\n // Normalize the path\n var normalizedPath = normalizeArray(path.split('/').filter(function (p) { return !!p; }), !isPathAbsolute).join('/');\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}", "title": "" }, { "docid": "97354005a47084c43d920f178a1e26fd", "score": "0.66258395", "text": "function fix_slashes(pathname) {\n if (pathname.slice(-1) != '/') {\n return pathname + '/';\n }\n return pathname;\n}", "title": "" }, { "docid": "c0e687113929db51294acaa95d315265", "score": "0.66140234", "text": "function normalizePath(path) {\n const result = path.replace(/\\\\/g, '/');\n return result.startsWith('.') ? result : `./${result}`;\n }", "title": "" }, { "docid": "25235e7f131f3c6160fc17377618be8c", "score": "0.66038567", "text": "function ensureTrailingDirectorySeparator(path) {\n if (path.charAt(path.length - 1) !== ts.directorySeparator) {\n return path + ts.directorySeparator;\n }\n return path;\n }", "title": "" }, { "docid": "c4e9d680f40a62b76c90683373a45384", "score": "0.6588253", "text": "function normalize(path) {\n // edge case: '/txt' & '\\txt' are not resolveable\n if (/[\\\\/][^\\\\/.]+$/.test(path)) { return; }\n\n return '.' + path.replace(/.*[\\.\\/\\\\]/, '').toLowerCase();\n}", "title": "" }, { "docid": "c7ad69919879b8715f3ea3c2d30cf9f4", "score": "0.6563112", "text": "function forwardSlash(input) {\n return path_1.default.normalize(input).replace(/\\\\+/g, '/');\n}", "title": "" }, { "docid": "b7d309230855207b11c4304aded87c09", "score": "0.65421623", "text": "_stripLeadingSlash(path) {\n if (path[0] === '/') {\n return path.slice(1);\n }\n return path;\n }", "title": "" }, { "docid": "5a22c5ae81a97ca081456afe07e74504", "score": "0.6537069", "text": "function dropSlash(input) {\n if (input === '/') {\n return '/';\n }\n return `/${input.replace(/^\\//, '').replace(/\\/$/, '')}`;\n}", "title": "" }, { "docid": "7ee33dc52140396439341b8bbd43d60d", "score": "0.65314597", "text": "function normalize(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "title": "" }, { "docid": "7ee33dc52140396439341b8bbd43d60d", "score": "0.65314597", "text": "function normalize(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "title": "" }, { "docid": "f543b1d9618d3698264dbebdcb855aec", "score": "0.65265054", "text": "function sanitizePath(path) {\n var transformedPath = path.replace(/^\\/?(.+)\\/?$/, '/$1');\n return transformedPath;\n }", "title": "" }, { "docid": "ab649d6124290620fc5803c54a9a40a6", "score": "0.6508069", "text": "function fixPath (path) {\n if (!path || path.length === 0) {\n return '/';\n }\n if (path[0] !== '/') {\n path = '/' + path;\n }\n if (path[path.length - 1] !== '/') {\n path = path + '/';\n }\n return path;\n}", "title": "" }, { "docid": "8e2ba4e8e0ef667e9b43df9757072bbe", "score": "0.6483293", "text": "function canonicalize(path) {\n if(path == \"/\")\n return \"/\"\n \n let components = path.split(\"/\")\n \n if (components[0] == \"\") {\n // path is absolute\n components.shift()\n }\n // path is relative; resolve with current directory\n else {\n let cwd = env[\"cwd\"]\n if(!cwd.endsWith('/')) cwd += '/'\n components = (cwd + path).split('/')\n components.shift()\n }\n\n // remove any double-dots\n for (let i = 0; i < components.length;) {\n if (components[i] == \"..\") {\n if (i == 0) {\n // just remove any double-dot immediately after root\n components.shift()\n }\n else {\n // convert each [\"dirname\", \"..\"] to []\n components.splice(i - 1, 2)\n i -= 1 // bc we rm prev pos\n }\n continue\n }\n i += 1\n }\n \n return \"/\" + components.join('/')\n}", "title": "" }, { "docid": "1b14f842a7a8b3dee041261a327e1816", "score": "0.6477298", "text": "normalizePath(pathStr) {\n if (pathStr == null) {\n return;\n }\n if (process.platform === 'win32') {\n return pathStr.split(path.sep).join(\"/\");\n }\n return pathStr;\n }", "title": "" }, { "docid": "8d47fac781afa003713633ca6816b956", "score": "0.64745444", "text": "function normalizePath(path) {\n return path.split(\"/\").map(normalizeSegment).join(\"/\");\n } // We want to ensure the characters \"%\" and \"/\" remain in percent-encoded", "title": "" }, { "docid": "9b70e1b0325cea0831365c83eb182efe", "score": "0.6443464", "text": "function slashit(path) {\r\n if (path.charAt(path.length-1) === \"/\") return path;\r\n return path + \"/\";\r\n }", "title": "" }, { "docid": "92755c715ae10e54da2186f87e95f433", "score": "0.64223814", "text": "_rtrimSlashes(string) {\n return string.replace(/\\/+$/, '');\n }", "title": "" }, { "docid": "64f6b71455a449c4192b2f1882204b1c", "score": "0.64098185", "text": "function handlePathSlashes(path) {\n var cutIndex = 0;\n for (var i = 0; i < path.length - 1; i++) {\n if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {\n cutIndex = i + 1;\n } else break;\n }\n\n return path.substr(cutIndex);\n }", "title": "" }, { "docid": "1d9293cbf02349ac49604917666b1c66", "score": "0.6385381", "text": "static normalize(path) {\n if (path.length > 0) {\n const pieces = path.split(this.separator);\n const length = pieces.length;\n const newer = [];\n let last;\n for (let offset = 0; offset < length; ++offset) {\n const part = pieces[offset];\n if (newer.length === 0) {\n newer.push((last = part));\n }\n else if (part !== '.') {\n if (part === '..' && part !== last) {\n if (last !== '') {\n newer.pop();\n last = newer[newer.length - 1];\n }\n }\n else if (part.length > 0) {\n if (last === '.') {\n newer[newer.length - 1] = last = part;\n }\n else {\n newer.push((last = part));\n }\n }\n else if (offset + 1 === length) {\n newer.push((last = part));\n }\n }\n }\n return newer.join(this.separator);\n }\n return '.';\n }", "title": "" }, { "docid": "90bc414716e6fd6c784ea54b7ba646ca", "score": "0.6362354", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n \n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n \n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n \n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "d75b3a58dbee3815231a1ae1f624858d", "score": "0.63391846", "text": "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = (path.charAt(0) === '/');\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t }", "title": "" }, { "docid": "4f1c260affa462c9d94c949f07084b9a", "score": "0.6338583", "text": "function removeTrailingSlash(s) {\n return s.replace(/\\/$/, '');\n}", "title": "" }, { "docid": "b5751ddb96c93598dfa7ef7bc5ff8478", "score": "0.6325529", "text": "function drop_double_slashes(pathname) {\n return pathname.replace(/\\/\\//g,'/');\n}", "title": "" }, { "docid": "c93887e1eea013557e428149e3559726", "score": "0.63211596", "text": "function stripTrailingSlash(str) {\n return String(str || \"\").replace(/\\/+$/, \"\");\n}", "title": "" }, { "docid": "5180c21d6fc5c34e624ad153f8d4797c", "score": "0.63194424", "text": "function removePathTrailingSlash(path) {\n return path.endsWith(\"/\") && path !== \"/\" ? path.slice(0, -1) : path;\n }", "title": "" }, { "docid": "6d119b5ee1f8bdbfc4926fa3f02562f8", "score": "0.6303334", "text": "function correctPath(path) {\n\t\tpath = path.split('?')[0];\n\t\t\n\t\tif (path.substr(path.length - 1) !== '/') {\n\t\t\tpath += '/';\n\t\t}\n\t\t\n\t\tif (path.substr(0, 1) !== '/') {\n\t\t\tpath = '/' + path;\n\t\t}\n\t\t\t\n\t\treturn path;\n\t}", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "4f6c324d312eda0f858ac43bd6ba6797", "score": "0.62996185", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "0f5411a52c48faaac6e34fc7105619f7", "score": "0.62984097", "text": "function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }", "title": "" }, { "docid": "a38f40c0006e91bd461ac5fa94630a09", "score": "0.6297737", "text": "function normalize(aPath) {\r\n var path = aPath\r\n var url = urlParse(aPath)\r\n if (url) {\r\n if (!url.path) {\r\n return aPath\r\n }\r\n path = url.path\r\n }\r\n var isAbsolute = exports.isAbsolute(path)\r\n\r\n var parts = path.split(/\\/+/)\r\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\r\n part = parts[i]\r\n if (part === '.') {\r\n parts.splice(i, 1)\r\n } else if (part === '..') {\r\n up++\r\n } else if (up > 0) {\r\n if (part === '') {\r\n // The first part is blank if the path is absolute. Trying to go\r\n // above the root is a no-op. Therefore we can remove all '..' parts\r\n // directly after the root.\r\n parts.splice(i + 1, up)\r\n up = 0\r\n } else {\r\n parts.splice(i, 2)\r\n up--\r\n }\r\n }\r\n }\r\n path = parts.join('/')\r\n\r\n if (path === '') {\r\n path = isAbsolute ? '/' : '.'\r\n }\r\n\r\n if (url) {\r\n url.path = path\r\n return urlGenerate(url)\r\n }\r\n return path\r\n }", "title": "" }, { "docid": "c6cdc75faa7cb031cc8e96e2d50d3dda", "score": "0.62904525", "text": "function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath;}path=url.path;}var isAbsolute=exports.isAbsolute(path);var parts=path.split(/\\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==='.'){parts.splice(i,1);}else if(part==='..'){up++;}else if(up>0){if(part===''){// The first part is blank if the path is absolute. Trying to go\n// above the root is a no-op. Therefore we can remove all '..' parts\n// directly after the root.\nparts.splice(i+1,up);up=0;}else{parts.splice(i,2);up--;}}}path=parts.join('/');if(path===''){path=isAbsolute?'/':'.';}if(url){url.path=path;return urlGenerate(url);}return path;}", "title": "" }, { "docid": "372cbc93be67cb4ae39d3efd92309fdd", "score": "0.6288021", "text": "function denormalizeKey (key) {\n return replaceAll(key, '/', path.sep)\n}", "title": "" }, { "docid": "2fa3d8232f8d1191506859f9b96961eb", "score": "0.62738353", "text": "function normalizePagePath(path) {\n if (path === undefined) {\n return path;\n }\n\n if (path === `/`) {\n return `/`;\n }\n\n if (path.charAt(path.length - 1) === `/`) {\n return path.slice(0, -1);\n }\n\n return path;\n}", "title": "" }, { "docid": "df6f82f59ea180bf38a9843f38dc9a70", "score": "0.62713754", "text": "function normalizeKey (key) {\n return replaceAll(key, path.sep, '/')\n}", "title": "" }, { "docid": "eb6dfa7a9a3a3b1f605bdb6378fa875f", "score": "0.62574965", "text": "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "title": "" }, { "docid": "eb6dfa7a9a3a3b1f605bdb6378fa875f", "score": "0.62574965", "text": "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "title": "" }, { "docid": "eb6dfa7a9a3a3b1f605bdb6378fa875f", "score": "0.62574965", "text": "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "title": "" }, { "docid": "eb6dfa7a9a3a3b1f605bdb6378fa875f", "score": "0.62574965", "text": "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "title": "" }, { "docid": "eb6dfa7a9a3a3b1f605bdb6378fa875f", "score": "0.62574965", "text": "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "title": "" }, { "docid": "eb6dfa7a9a3a3b1f605bdb6378fa875f", "score": "0.62574965", "text": "function collapseLeadingSlashes (str) {\n for (var i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) !== 0x2f /* / */) {\n break\n }\n }\n\n return i > 1\n ? '/' + str.substr(i)\n : str\n}", "title": "" }, { "docid": "bf421a9ceaf8f0b10a8921a9e09a33ba", "score": "0.6257493", "text": "function normalize(aPath) {\r\n var path = aPath;\r\n var url = urlParse(aPath);\r\n if (url) {\r\n if (!url.path) {\r\n return aPath;\r\n }\r\n path = url.path;\r\n }\r\n var isAbsolute = (path.charAt(0) === '/');\r\n\r\n var parts = path.split(/\\/+/);\r\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\r\n part = parts[i];\r\n if (part === '.') {\r\n parts.splice(i, 1);\r\n } else if (part === '..') {\r\n up++;\r\n } else if (up > 0) {\r\n if (part === '') {\r\n // The first part is blank if the path is absolute. Trying to go\r\n // above the root is a no-op. Therefore we can remove all '..' parts\r\n // directly after the root.\r\n parts.splice(i + 1, up);\r\n up = 0;\r\n } else {\r\n parts.splice(i, 2);\r\n up--;\r\n }\r\n }\r\n }\r\n path = parts.join('/');\r\n\r\n if (path === '') {\r\n path = isAbsolute ? '/' : '.';\r\n }\r\n\r\n if (url) {\r\n url.path = path;\r\n return urlGenerate(url);\r\n }\r\n return path;\r\n }", "title": "" }, { "docid": "72e5c2e16d3aeb2a8bb3776fd6453df2", "score": "0.6233873", "text": "function normalize(aPath) {\n\t\t var path = aPath;\n\t\t var url = urlParse(aPath);\n\t\t if (url) {\n\t\t if (!url.path) {\n\t\t return aPath;\n\t\t }\n\t\t path = url.path;\n\t\t }\n\t\t var isAbsolute = exports.isAbsolute(path);\n\n\t\t var parts = path.split(/\\/+/);\n\t\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t\t part = parts[i];\n\t\t if (part === '.') {\n\t\t parts.splice(i, 1);\n\t\t } else if (part === '..') {\n\t\t up++;\n\t\t } else if (up > 0) {\n\t\t if (part === '') {\n\t\t // The first part is blank if the path is absolute. Trying to go\n\t\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t\t // directly after the root.\n\t\t parts.splice(i + 1, up);\n\t\t up = 0;\n\t\t } else {\n\t\t parts.splice(i, 2);\n\t\t up--;\n\t\t }\n\t\t }\n\t\t }\n\t\t path = parts.join('/');\n\n\t\t if (path === '') {\n\t\t path = isAbsolute ? '/' : '.';\n\t\t }\n\n\t\t if (url) {\n\t\t url.path = path;\n\t\t return urlGenerate(url);\n\t\t }\n\t\t return path;\n\t\t}", "title": "" }, { "docid": "d3504224be0cc96ff898453479b2f844", "score": "0.62323093", "text": "function normalize(path) {\n var absolute\n var value\n\n assertPath(path)\n\n absolute = path.charCodeAt(0) === 47 /* `/` */\n\n // Normalize the path according to POSIX rules.\n value = normalizeString(path, !absolute)\n\n if (!value.length && !absolute) {\n value = '.'\n }\n\n if (value.length && path.charCodeAt(path.length - 1) === 47 /* / */) {\n value += '/'\n }\n\n return absolute ? '/' + value : value\n}", "title": "" }, { "docid": "ffcb8d16e5dad0b5d1d244e981cc9c5c", "score": "0.6230782", "text": "function trimSlash(str) {\n if (str.includes(\"/\")) {\n var n = str.split(\"/\").pop(-1);;\n return n;\n } else {\n return str;\n }\n }", "title": "" }, { "docid": "742d671028f3d5db34fb6c81b2fb1e98", "score": "0.6226151", "text": "function normalize(path) {\n const input = path.split('/');\n const output = [];\n for (let i = 0; i < input.length; ++i) {\n const directory = input[i];\n if (i === 0 || (directory.length && directory !== '.')) {\n if (directory === '..') {\n output.pop();\n } else {\n output.push(directory);\n }\n }\n }\n return output.join('/');\n }", "title": "" }, { "docid": "cfa68d45d2613e4e4a0beaaef9926ff9", "score": "0.6223278", "text": "function trimForwardSlash(str) {\n return trimPrefix(trimSuffix(str, \"/\"), \"/\");\n}", "title": "" }, { "docid": "75be6a3eca23488f54404412d05b0a34", "score": "0.6220943", "text": "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "title": "" }, { "docid": "75be6a3eca23488f54404412d05b0a34", "score": "0.6220943", "text": "function normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}", "title": "" } ]
7b892089a6b3102fa1856f8067206e71
Overridden to notify STM about flat insert action
[ { "docid": "406c96dd6f4c455b59c11f289b7d40df", "score": "0.58933204", "text": "insert(index, records, silent = false) {\n let result;\n const stm = this.stm; // Tree inserting is routed via rootNode.insertChild() it has it's own\n // STM override thus if the store is tree we ignore the action\n\n if (!this.tree && stm && !stm.disabled) {\n // Flat inserting here only, the only data needed to undo/redo the action is:\n // - the list of record inserted\n // - index they are inserted at\n // - index they have been at if they are part of this store already and are moved\n // Here we are getting indexes of records which are in this store already\n // not all records might be from this store, some might be new or from another store\n const context = (Array.isArray(records) ? records : [records]).reduce((context, r) => {\n const index = r instanceof Model ? this.indexOf(r) : undefined;\n\n if (index !== undefined && index !== -1) {\n context.set(r, index);\n }\n\n return context;\n }, new Map()); // Result here is the array of Models inserted or undefined,\n // and it might be different from `records` we received as argument.\n\n result = super.insert(index, records); // Here we check if anything has been actually inserted.\n // The insertion action might be vetoed by event handler or something\n\n if (result && result.length) {\n // We can't rely on `index` we've got as argument since `result` might\n // differ from records.\n index = this.indexOf(result[0]); // Notifying STM manager about the insertion action providing all\n // the required data to undo/redo.\n\n stm.onStoreModelInsert(this, index, result, context, silent);\n }\n } else {\n result = super.insert(index, records, silent);\n }\n\n return result;\n }", "title": "" } ]
[ { "docid": "b5cc16f1246f91e3ad00746afd02bc64", "score": "0.610334", "text": "insert() {\n this.runLocalHooks('change');\n }", "title": "" }, { "docid": "9670a3170c5bc1b2fee06787ebc0ba1c", "score": "0.60799724", "text": "localInsert(val, index, connections) {\n this.list.incCounter();\n console.log(this.list);\n const char = this.createChar(val, index);\n this.struct.splice(index, 0, char);\n this.insertChar(char.value, index);\n //Broadcast the insert to all my connections\n this.broadcast(char, connections, \"insert\"); \n }", "title": "" }, { "docid": "4aa5209e5beae83ef9d73c3d198b9abc", "score": "0.5837882", "text": "insert(callback) {\n return this.insertCall().send(() => {\n if (latte._isFunction(callback)) {\n callback();\n }\n });\n }", "title": "" }, { "docid": "1c20d46886fd22f61ebf101ce7c453cf", "score": "0.5708523", "text": "function oninsert(result) {\n count.increase(result.inserted);\n\n if (count.getCount() % 10000 === 0) {\n logger.info(`\\nInserted ${count.getCount()} nodes.\\n\\n`);\n }\n\n return;\n}", "title": "" }, { "docid": "ab07a10b017640852fde99984632c682", "score": "0.5566577", "text": "execute(params, context) {\n if(params.tx) {\n this._handleInsert(params.tx, params)\n } else {\n context.editorSession.transaction((tx) => this._handleInsert(tx, params))\n }\n }", "title": "" }, { "docid": "696cf272224bf2bfe5b0a9b995c8465f", "score": "0.5554886", "text": "function MInsertOperation(insert, origin){\n this.type = \"MInsertOperation\";\n this.insert = insert;\n this.origin = origin;\n}", "title": "" }, { "docid": "70b9109d0e41836850093744e04efe5b", "score": "0.5478668", "text": "onInsertRowBefore() {\n\t\tthis.onInsertRow( 0 );\n\t}", "title": "" }, { "docid": "c25e4b7d28b523550cc042f92813bd88", "score": "0.54507357", "text": "onTaskDataGenerated() {}", "title": "" }, { "docid": "4f010d4200d53c7ac64e88110923de44", "score": "0.5438452", "text": "insert(insertIndex, component, componentProps, opts, done) {\n return this.queueTrns({\n insertStart: insertIndex,\n insertViews: [{ component, componentProps }],\n opts\n }, done);\n }", "title": "" }, { "docid": "b0256343781642ce3b4a604fcfe508b8", "score": "0.5431153", "text": "function insert(){\r\n var val = xRTML.Sizzle(\"#message-source\")[0].value;\r\n var message = xRTML.MessageManager.create({\r\n trigger: \"myTrigger\",\r\n action: \"insert\",\r\n data: {\r\n content:{\r\n value : val\r\n }\r\n }\r\n });\r\n xRTML.ConnectionManager.sendMessage({ connections: [\"myConnection\"], channel: \"myChannel\", content: message });\r\n}", "title": "" }, { "docid": "29e9cef02108d08cb91074e59ccc506c", "score": "0.5431029", "text": "function _inserted(element) {\r\n // TODO(sjmiles): it's possible we were inserted and removed in the space\r\n // of one microtask, in which case we won't be 'inDocument' here\r\n // But there are other cases where we are testing for inserted without\r\n // specific knowledge of mutations, and must test 'inDocument' to determine\r\n // whether to call inserted\r\n // If we can factor these cases into separate code paths we can have\r\n // better diagnostics.\r\n // TODO(sjmiles): when logging, do work on all custom elements so we can\r\n // track behavior even when callbacks not defined\r\n //console.log('inserted: ', element.localName);\r\n if (element.enteredViewCallback || (element.__upgraded__ && logFlags.dom)) {\r\n logFlags.dom && console.group('inserted:', element.localName);\r\n if (inDocument(element)) {\r\n element.__inserted = (element.__inserted || 0) + 1;\r\n // if we are in a 'removed' state, bluntly adjust to an 'inserted' state\r\n if (element.__inserted < 1) {\r\n element.__inserted = 1;\r\n }\r\n // if we are 'over inserted', squelch the callback\r\n if (element.__inserted > 1) {\r\n logFlags.dom && console.warn('inserted:', element.localName,\r\n 'insert/remove count:', element.__inserted)\r\n } else if (element.enteredViewCallback) {\r\n logFlags.dom && console.log('inserted:', element.localName);\r\n element.enteredViewCallback();\r\n }\r\n }\r\n logFlags.dom && console.groupEnd();\r\n }\r\n}", "title": "" }, { "docid": "9d0966bbb814746db51416f9ff7a19fb", "score": "0.54238605", "text": "addTransaction() {\n\t\tthis.table.ctrlN();\n\t}", "title": "" }, { "docid": "3767c7f7b196d499015ea1ba113370e1", "score": "0.5413968", "text": "@action\n async insert() {\n const rdfa = this.serializer.serializeQuads([...this.selectedQuads], this.pred_metadata);\n this.args.onClose(rdfa);\n }", "title": "" }, { "docid": "96d575864a03f34c578ee113e57cf3db", "score": "0.54115736", "text": "function _inserted(element) {\n // TODO(sjmiles): it's possible we were inserted and removed in the space\n // of one microtask, in which case we won't be 'inDocument' here\n // But there are other cases where we are testing for inserted without\n // specific knowledge of mutations, and must test 'inDocument' to determine\n // whether to call inserted\n // If we can factor these cases into separate code paths we can have\n // better diagnostics.\n // TODO(sjmiles): when logging, do work on all custom elements so we can\n // track behavior even when callbacks not defined\n //console.log('inserted: ', element.localName);\n if (element.enteredViewCallback || (element.__upgraded__ && logFlags.dom)) {\n logFlags.dom && console.group('inserted:', element.localName);\n if (inDocument(element)) {\n element.__inserted = (element.__inserted || 0) + 1;\n // if we are in a 'removed' state, bluntly adjust to an 'inserted' state\n if (element.__inserted < 1) {\n element.__inserted = 1;\n }\n // if we are 'over inserted', squelch the callback\n if (element.__inserted > 1) {\n logFlags.dom && console.warn('inserted:', element.localName,\n 'insert/remove count:', element.__inserted)\n } else if (element.enteredViewCallback) {\n logFlags.dom && console.log('inserted:', element.localName);\n element.enteredViewCallback();\n }\n }\n logFlags.dom && console.groupEnd();\n }\n}", "title": "" }, { "docid": "5f75fc3d2ddcb7f421b2901eb83c9ca8", "score": "0.53767496", "text": "function goInsert() {\n var db = connectDB();\n db.transaction(insertDB, errorCB, successCBFront);\n}", "title": "" }, { "docid": "9868e9d13ebfd21318c1cf8f487e13ee", "score": "0.53677857", "text": "insert(sql, callback) {\n const meth = 'adapter-insert';\n const origin = `${this.id}-${meth}`;\n log.trace(origin);\n log.trace(`mysql insert started with sql: ${sql}`);\n\n try {\n // verify the required data has been provided\n if (!sql) {\n const errorObj = formatErrorObject(origin, 'Missing Data', ['sql'], null, null, null);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n if (!sql.toLowerCase().startsWith('insert')) {\n return callback(null, 'SQL statement must start with \"INSERT\"');\n }\n\n this.query(sql, callback);\n } catch (ex) {\n const errorObj = formatErrorObject(origin, 'Caught Exception', null, null, null, ex);\n log.error(`${origin}: ${errorObj.IAPerror.displayString}`);\n return callback(null, errorObj);\n }\n }", "title": "" }, { "docid": "1c83e1731b5ea10198d38f0d484aa5dd", "score": "0.5349767", "text": "inserts() {\n console.log(\"TC.inserts()\");\n this.tableName = this.params('name');\n this.table = this.primary.getTable(this.tableName);\n return this.primary.query(`SELECT * FROM ${this.table.name} WHERE ${this.table.primaryKey} NOT IN (SELECT record_id FROM ${snapshot.path}.changes WHERE table_id = ${this.table.id});`).then((data) => {\n console.log(\"Got data\");\n this.table.data = data;\n return this.render(\"show\");\n });\n }", "title": "" }, { "docid": "a0222316f3f8d0c7a232a8c23a1fd201", "score": "0.5340487", "text": "function insertDataItem(){transaction.executeSql(insertStatementTemplate, createTuple(insertColumnNameArray, dataArray[i].value), advance, handleInsertFailure);}", "title": "" }, { "docid": "78c3c1987536367a37cef796e85104da", "score": "0.5301561", "text": "function insertA(client, done) {\n insertRow(client, 'Fallout', 8, () => {\n insertB(client, done);\n });\n}", "title": "" }, { "docid": "3d8deccf7c0c0644c93932b56525ed06", "score": "0.5289819", "text": "function insertBulk(mBulk, mFinal) {\r\n mBulk.execute({}, function bulk_executeCallback(err, res) {\r\n if (err) {\r\n console.log(\"insertappxtabledata.insertBulk mBulk.execute error: \" + err);\r\n }\r\n if (mFinal) {\r\n appxprocessor.pendingInserts--;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "c98fb6db832974bc478b2a4dd5bba5c2", "score": "0.52711093", "text": "insert() { return true; }", "title": "" }, { "docid": "c98fb6db832974bc478b2a4dd5bba5c2", "score": "0.52711093", "text": "insert() { return true; }", "title": "" }, { "docid": "ff8102a5a371671d5951815962bb159a", "score": "0.52655154", "text": "function doTransactioninsertData() {\n if (webSQLFlag == 0) {\n frmWebSQL.lblSqlUpdate.text = \"Please create the database and then try inserting data\"\n return;\n }\n kony.db.transaction(baseObjectId, insertFirstData, commonErrorCallback, commonVoidcallback);\n}", "title": "" }, { "docid": "802a5c725aa6e2783cab327ef6e38b0c", "score": "0.5256382", "text": "_insert() {\n this._collection.insertOne({\n \"unitId\": this._id,\n \"name\": \"Unit \" + this._id,\n \"settings\": defaultUnit.settings,\n \"createdAt\": new Date()\n })\n .then(() => {\n this._emitter.emit(\n EVENTS.TRANSACTION_COMPLETED,\n TRANSACTION_TYPES.UNIT_EXISTS\n );\n }).catch((err) => { throw err; });\n }", "title": "" }, { "docid": "0e904c097c62a68bb8d2483c61a12317", "score": "0.52471507", "text": "function insert() {\n mode = \"insert_new\";\n }", "title": "" }, { "docid": "3b9cc8334c06aa40113df5c4189872f6", "score": "0.52320683", "text": "tables__insert_row_local(state, insert_object){\n let table_selected = state.tables[insert_object.table_name];\n let rows = table_selected.row_object_mapper[insert_object.foreign_key];\n rows.push(insert_object);\n }", "title": "" }, { "docid": "47e998abddede20bcca7049740c06ccc", "score": "0.5225875", "text": "function startSyncTransaction() {\n _syncRuns = true;\n }", "title": "" }, { "docid": "cfeb8a0311208c0646ec7624935fc195", "score": "0.521654", "text": "bulkInsert(tuples) {\n tuples.sort((a, b) => a.record.currentIndex - b.record.currentIndex);\n tuples.forEach((tuple) => {\n // If we already have a view present in our change record, we know that we're dealing with a moved view\n if (tuple.view) {\n // We're inserting back the detached view at the new position within the view container\n this.viewContainerRef.insert(tuple.view, tuple.record.currentIndex);\n } else {\n // We're dealing with a newly created view so we create a new embedded view on the view container and store it in the change record\n tuple.view =\n this.viewContainerRef.createEmbeddedView(this.templateRef, {}, tuple.record.currentIndex);\n }\n });\n return tuples;\n }", "title": "" }, { "docid": "72a9cc2660535b8cacc374b5fe796f75", "score": "0.5216363", "text": "insert(support, callback) {\n return super.insert(support, callback);\n }", "title": "" }, { "docid": "e69c478c7d0ae7ff422cfcd0f7fe3665", "score": "0.5214791", "text": "insert(u, t) {\n\t\treturn super.insert(u, t, u => this.refresh(u));\n\t}", "title": "" }, { "docid": "d7efb2462bec3b6da1d5e8ce251fe19f", "score": "0.5209768", "text": "insert(article, callback) {\n return super.insert(article, callback);\n }", "title": "" }, { "docid": "ae5f93bc7e6384323127badc50e27aa9", "score": "0.5188401", "text": "insert(doc, callback) {\n return super.insert(doc, callback)\n }", "title": "" }, { "docid": "3877f62357f5ecee431b90f830a68098", "score": "0.5183454", "text": "onInsertRowAfter() {\n\t\tthis.onInsertRow( 1 );\n\t}", "title": "" }, { "docid": "c35e34817c35cc95f5c69187ee873676", "score": "0.51535684", "text": "handleInsert(){\n\n //console.log(\"chegou insert\")\n\n const ent = {\n ientt: this.ientt.current.value,\n ient: this.ient.current.value,\n name: this.name.current.value,\n unitnum: this.unitnum.current.value,\n streetnum: this.streetnum.current.value,\n street: this.street.current.value,\n suburb: this.suburb.current.value,\n postcode: this.postcode.current.value \n }\n\n console.log(ent)\n\n this.props.postEnt(ent);\n\n this.setState({ show: false });\n }", "title": "" }, { "docid": "43df4b129d145d97925878b24a5d9928", "score": "0.5138639", "text": "handleOperationSendSuccess_(op) {\r\n debug('Local operation accepted');\r\n debug(op);\r\n this.pendingLocalOperations_.shift();\r\n if (state.getLastOpNum() < op.num) {\r\n state.setLastOpNum(op.num);\r\n }\r\n // Immediately try updating with the next pending operation (if any).\r\n this.continueSendingPendingLocalOperations_();\r\n // And concurrently, actually write the operation in its place.\r\n const opPath = `/maps/${state.getMid()}/payload/operations/${op.num}`;\r\n firebase.database().ref(opPath).set(op.data).then(() => {\r\n this.rewriteIfRequired_(op);\r\n });\r\n }", "title": "" }, { "docid": "14f53001e3f3716381f91f924ee86d46", "score": "0.51235807", "text": "[importHandler]() {\n const data = this.collectData();\n this.dispatchEvent(new CustomEvent('import', {\n composed: true,\n detail: data\n }));\n }", "title": "" }, { "docid": "c2f0bcb08c924b66e94e4e422fa4c675", "score": "0.5105558", "text": "function startBatchTransaction() {}", "title": "" }, { "docid": "e4720821659d33b996a030d273e4f1dd", "score": "0.5103481", "text": "onInsertColumnBefore() {\n\t\tthis.onInsertColumn( 0 );\n\t}", "title": "" }, { "docid": "d622ce2278f21f80dc2763dc4a4dc92f", "score": "0.5090244", "text": "function insertData(toInsert) {\n\t\tvar fooditem = toInsert; \n\t\t//console.log(toInsert);\n\t\trequestCounter++;\n\t\tconsole.log(\"\" + requestCounter + \" -> calling db insert\");\n\t\t\n\t\tclient.query('INSERT INTO menus (data) VALUES ($1)', [fooditem], function(err, result) {\n\t\t\trequestCounter--;\n\t\t\tconsole.log(\"\" + requestCounter + \" -> inserted\");\n\n\t\t\t// no more database requests to be filled, disconnect\n\t\t\tif(requestCounter===0) {\n\t\t\t\tdisconnect();\n\t\t\t}\n\n\t\t\tif(err) {\n\t\t\t\treturn console.error('error running query', err);\n\t\t\t}\t\t\n\t\t\t//console.log(requestCounter);\n\t\t\t//console.log(result);\n\t\t});\n\t}", "title": "" }, { "docid": "65ad3be28057870769271c0666edbf9a", "score": "0.50706244", "text": "function insertTaskInTable() {\n modifyScheduleTask(gClickResult.task.task.id,\n gDragResult.clickedDay,\n gDragResult.clickedHour,\n gDropResult.clickedHour);\n}", "title": "" }, { "docid": "2a1ef8fadb48024e8acb4bc222459718", "score": "0.5066179", "text": "'actions.insert'( o ){\n Articles.fn.check( o, [ R_OBJ_ACTION ]);\n csfns.takeOwnership( o );\n Articles.sofns.doneConsistent( o );\n const item = Articles.sofns.cleanup( o );\n const ret = Articles.insert( item.set );\n console.log( 'Articles.actions.insert \"'+o.name+'\" returns '+ret );\n if( !ret ){\n throw new Meteor.Error(\n 'articles.actions.insert',\n 'Unable to insert \"'+o.name+'\" action' );\n }\n return ret;\n }", "title": "" }, { "docid": "2c7b14d8c16e0703a3bd0bb9c33ea1e1", "score": "0.5048625", "text": "insertCallback(error) {\n if (error) {\n Bert.alert({ type: 'danger', message: `Add failed: ${error.message}` });\n } else {\n Bert.alert({ type: 'success', message: 'Add succeeded' });\n this.formRef.reset();\n }\n }", "title": "" }, { "docid": "2c7b14d8c16e0703a3bd0bb9c33ea1e1", "score": "0.5048625", "text": "insertCallback(error) {\n if (error) {\n Bert.alert({ type: 'danger', message: `Add failed: ${error.message}` });\n } else {\n Bert.alert({ type: 'success', message: 'Add succeeded' });\n this.formRef.reset();\n }\n }", "title": "" }, { "docid": "8c149799f96064dfb84b8141d3b056cc", "score": "0.50391686", "text": "function checkInsertFlag() {\n if(insertDone() == false) {\n window.setTimeout(checkInsertFlag, 100); /* this checks the flag every 100 milliseconds*/\n } else {\n $(\"#operation\").text(\"none\");\n $(\"#status\").text(\"idle\");\n workingSetHtml = getWorkingSetHtml(workingSet)\n container.html(workingSetHtml);\n }\n }", "title": "" }, { "docid": "7ea4590f42e3522bb0c3372210f905b7", "score": "0.50342584", "text": "function insertPhase2(callback){\n instance.version = 0;\n instance.name = wunderlist.helpers.utils.convertString(instance.name, 255);\n\n var obj = {};\n for (var property in instance) {\n var value = instance[property];\n if ((typeof value).match(/^(number|string|boolean)$/)) {\n if (wunderlist.helpers.utils.in_array(property, properties) === true) {\n obj[property] = value;\n }\n }\n }\n\n if(type === 'list') {\n wunderlist.database.createListByOnlineId(0, obj.name, 0, obj.position, 0, 0, 0, callback);\n } else if(type === 'task') {\n wunderlist.database.createTaskByOnlineId(0, obj.name, 0, 0, obj.list_id, obj.position, 0, 0, 0, 0, '', callback);\n }\n }", "title": "" }, { "docid": "8c59198f0506bd9c9f312d16ca1bec23", "score": "0.50092894", "text": "record(action) {\n this.socket.emit('actions', action);\n }", "title": "" }, { "docid": "8c59198f0506bd9c9f312d16ca1bec23", "score": "0.50092894", "text": "record(action) {\n this.socket.emit('actions', action);\n }", "title": "" }, { "docid": "9f8f1efe78916de25d465cd8dfc8e6ec", "score": "0.4968315", "text": "insert (data, returning) {\n data = arrayify(data).map(row => mapFieldsToDb(this.fields, row))\n return super.insert(data, returning)\n }", "title": "" }, { "docid": "773f537114e4cdb5c3ae1a440158bf98", "score": "0.4966161", "text": "function doInsert(){\r\n\t\r\n\tvar value = Number(textInsert.property(\"value\"));\r\n\tif( isNumber(value) ){\r\n\t\ttreap.insert(value);\r\n\t\tupdate();\r\n\t}\r\n}", "title": "" }, { "docid": "88aec690c165d6d16499093992358166", "score": "0.49465743", "text": "willCommit() {}", "title": "" }, { "docid": "88aec690c165d6d16499093992358166", "score": "0.49465743", "text": "willCommit() {}", "title": "" }, { "docid": "88aec690c165d6d16499093992358166", "score": "0.49465743", "text": "willCommit() {}", "title": "" }, { "docid": "88aec690c165d6d16499093992358166", "score": "0.49465743", "text": "willCommit() {}", "title": "" }, { "docid": "88aec690c165d6d16499093992358166", "score": "0.49465743", "text": "willCommit() {}", "title": "" }, { "docid": "88aec690c165d6d16499093992358166", "score": "0.49465743", "text": "willCommit() {}", "title": "" }, { "docid": "8ccf342b2da66ef14694ea0a2000ff0f", "score": "0.49412492", "text": "insertCallback(error) {\n if (error) {\n Bert.alert({ type: 'danger', message: `Add failed: ${error.message}`, style: 'growl-bottom-right' });\n } else {\n Bert.alert({ type: 'success', message: 'Add succeeded', style: 'growl-bottom-right' });\n this.formRef.reset();\n }\n }", "title": "" }, { "docid": "f054af63f85a4f958da3c6b46a4d6a86", "score": "0.49376994", "text": "static async insertData() {\n try {\n await usersTable.insert({ data: user1 });\n await usersTable.insert({ data: user2 });\n await usersTable.insert({ data: agent1 });\n await loginTable.insert({ data: user1Login });\n // await loginTable.insert({ data: user2Login });\n await loginTable.insert({ data: agent1Login });\n await propertiesTable.insert({ data: property1 });\n await flagsTable.insert({ data: flag1 });\n } catch (err) {\n // debug(err);\n }\n }", "title": "" }, { "docid": "56887d4cfbc01bf9ae137bb216e36a07", "score": "0.49320897", "text": "function onInsert(helper, scriptErrors, row) {\n if (row.caseid === undefined) {\n row.caseid = snprcTriggerHelper.getNextCaseId();\n }\n}", "title": "" }, { "docid": "29c7a85331edaf3f3dcb8285d5201d84", "score": "0.49205548", "text": "async insertMeds(med, key) {\n try {\n await Medicamente.create({\n cod_comerc: med[0],\n denumire: med[1],\n den_intern: med[2],\n producator: med[3],\n prezentare: med[4],\n concentrat: med[5],\n codifatc: med[6],\n ut: med[7],\n prescri: med[8],\n forma: med[9],\n });\n\n if (key + 1 >= this.datLength) {\n console.log(chalk.green('All rows inserted'), key + 1);\n }\n\n } catch(err) {\n console.error(chalk.red('Error:'), err);\n }\n\n }", "title": "" }, { "docid": "2c8ef9c96cc913de8d49cb4db4dc0ba5", "score": "0.49191442", "text": "willInsertElement() {\n let scmUrl = this.get('scmUrl');\n\n if (validateScmInput(scmUrl)) {\n this.sendAction('updateData', scmUrl);\n }\n }", "title": "" }, { "docid": "d1de92049b6860e68447a48153e3ede3", "score": "0.4905609", "text": "function onSuccessfulInsert(data) {\n if (data.id)\n document.location = '/' + newContent.type + '?id=' + data.id;\n else\n console.error('There was a problem inserting the new item! Please try again!');\n}", "title": "" }, { "docid": "35a7b14c53ef82b8c76dee35cdd06713", "score": "0.48913357", "text": "async onInsert() {\n this.validate({\n nim: {required:true, numbers:true},\n nama: {required:true},\n jurusan: {required:true},\n });\n\n if(this.isFormValid()) {\n this.setState({isLoading:true});\n\n //memanggil api supabase\n let { data, error } = await supabase\n .from('anggota')\n .insert({\n nim: this.state.nim,\n nama: this.state.nama,\n jurusan: this.state.jurusan,\n });\n\n //menampilkan response\n let message = 'Data berhasil ditambah';\n if(error) {\n message = error.message;\n } \n\n Alert.alert(\n \"Pemberitahuan\",\n message,\n [\n { text: \"OK\", onPress: () => this.props.navigation.navigate('AnggotaListScreen') }\n ]\n );\n\n this.setState({isLoading:false});\n\n } else {\n alert(this.getErrorMessages());\n }\n }", "title": "" }, { "docid": "4a6af0499b557e706f9c59d62512eafb", "score": "0.48911813", "text": "function beforeInsert(row,errors) {\n //console.log(\"Inside beforeInsert\");\n var dCode = snprcTriggerHelper.getNextDietCode();\n\n if (row.DietCode === undefined || row.DietCode == 'undefined') {\n row.DietCode = dCode;\n // Refactored to generate FauxMed code if DietCode is generated srr 03.26.19\n // Used to generate a 7 character FauxMed code i.e. S-001234\n var fauxRight = \"00000\" + dCode;\n row.SnomedCode = \"S-\" + fauxRight.slice(fauxRight.length-5,fauxRight.length);\n }\n row.objectid = row.objectid || LABKEY.Utils.generateUUID().toUpperCase();\n\n}", "title": "" }, { "docid": "5d4d9054bf5fcb4efe343d1358926fe9", "score": "0.48868018", "text": "function insert() {\n\n // adjust repo path in global config\n // used within RDFStore.http\n Cfg.sparqlEndpointGet = localCfg.store + localCfg.repo;\n Cfg.sparqlEndpointPost = Cfg.sparqlEndpointGet + '/statements',\n\n // log\n log( 'Processing ontology : ' + localCfg.onto );\n log( 'Target repository ontology : ' + Cfg.sparqlEndpointGet );\n\n // process all queries (waterfall of ontology promises)\n return processOnto( localCfg.onto );\n\n}", "title": "" }, { "docid": "08479183ddfcaa57efc710cced124679", "score": "0.48791224", "text": "add(\n reference: Object,\n transactionUpdater: Function,\n onComplete?: Function,\n applyLocally?: boolean = false\n ) {\n const id = this._generateTransactionId();\n\n this.transactions[id] = {\n id,\n reference,\n transactionUpdater,\n onComplete,\n applyLocally,\n completed: false,\n started: true,\n };\n\n FirebaseDatabase.startTransaction(reference.path, id, applyLocally);\n }", "title": "" }, { "docid": "057185547665e60376352e0cc3ab8d58", "score": "0.4874641", "text": "onCellInserted(index, cell) {\n // This is a no-op.\n }", "title": "" }, { "docid": "268f6a1f5cab832beb07f7f816359675", "score": "0.48727396", "text": "onSync(matchID, syncInfo) {\r\n if (matchID == this.matchID) {\r\n const action = turnOrder.sync(syncInfo);\r\n this.store.dispatch(action);\r\n }\r\n }", "title": "" }, { "docid": "d973761e8f7b4d19b03c82335bf12693", "score": "0.48726863", "text": "blockAdded(){\n this.mempool.pool.shift()\n this.isAddingBlock = false\n\n }", "title": "" }, { "docid": "536ed690076719c4b62f5ca55d1080b5", "score": "0.4871932", "text": "doTransaction() {\n this.app.handleDescUpdate(this.id, this.desc);\n }", "title": "" }, { "docid": "e3ef2666d29d404ac6ee3ef7bdd68cdb", "score": "0.48687273", "text": "function dbInsertSingleRecord(editRecord) {\n\treturn function(tx) {\n\t\ttx.executeSql(\n\t\t\t\t\"insert into local_contents (userId,content,lastLocalTime,contentType\"\n\t\t\t\t\t\t+ \" ) values (?,?,?,'SchemaRecord')\", [\n\t\t\t\t\t\tmLocalParameters['userId'], editRecord.detail,\n\t\t\t\t\t\t(new Date()).valueOf() ],\n\t\t\t\tprocessRecordMetadata(editRecord));\n\t}\n}", "title": "" }, { "docid": "0e35a3cd2c2968cb695ad3b1640bfb1e", "score": "0.48588505", "text": "insert() {\n throw new TypeError('Must implement insert method');\n }", "title": "" }, { "docid": "f7093ef52a09af5783d804eebbf4fa47", "score": "0.48555154", "text": "onInsertColumnAfter() {\n\t\tthis.onInsertColumn( 1 );\n\t}", "title": "" }, { "docid": "b4ab414f9f401b77abdf18082cfc2f82", "score": "0.48509416", "text": "onAdded() {\n\t\tthis.log(`${this.getData().id} added: ${this.getName()}`);\n\t}", "title": "" }, { "docid": "241d17181c74d4e5b4d9821c4a1eecf3", "score": "0.48475397", "text": "_onMessage(dbname, heads) {\n // console.log(\".MESSAGE\", dbname, heads)\n const store = this.stores[dbname]\n store.sync(heads)\n }", "title": "" }, { "docid": "a663da92ea87e48448c8959e5e09aba0", "score": "0.48304018", "text": "insertEntity(newEntity) {\n let entities = this.data.entities\n this.data.setEntities(\n entities.concat([Object.assign(newEntity, { id: getUniqueId() })])\n )\n }", "title": "" }, { "docid": "e80086b98b3ef0cf45ccc0518013852a", "score": "0.48188317", "text": "function insertElement(table, uid, type, filename, fp, filetype, imagefile, action, close, form_table, form_field, form_uid) {\r\nvar performAction = true;\r\n// Call performing function and finish this action:\r\nif (performAction) {\r\naddElement(filename, table+\"_\"+uid, fp, close, table, uid, form_table, form_field, form_uid);\r\n}\r\n}", "title": "" }, { "docid": "02e1303fc9e18f230af18f3cea06c1b2", "score": "0.48112735", "text": "function insert() {\n db.collection(collectionName).insert(item, function(err, result) {\n assert.equal(null, err);\n console.log('Item inserted');\n });\n }", "title": "" }, { "docid": "f26c45904a805a8de5cadff53d6dbbf6", "score": "0.48112494", "text": "function OnBeforeStartInsertTM()\n{ \n console.log(\"before: \");\n $(\".demo-droppable\").show();\n $(\".output\").show();\n if( $(\"#editandoReg\").val() == \"\" )\n {\n $(\".output\").html(\"\");\n $(\"#mensajeCargarImagenes\").hide();\n }\n addReadonlyFieldGrid('tipoMueblesGrid_mt_nr_tipoMueblesGrid_mt_c2_input');\n return true; // Approve action\n}", "title": "" }, { "docid": "62f8c13661e57599c8b77b57d7addcae", "score": "0.48060343", "text": "function insert(targetId, message) {\n id(targetId).insertAdjacentHTML(\"afterbegin\", message);\n}", "title": "" }, { "docid": "62f8c13661e57599c8b77b57d7addcae", "score": "0.48060343", "text": "function insert(targetId, message) {\n id(targetId).insertAdjacentHTML(\"afterbegin\", message);\n}", "title": "" }, { "docid": "62f8c13661e57599c8b77b57d7addcae", "score": "0.48060343", "text": "function insert(targetId, message) {\n id(targetId).insertAdjacentHTML(\"afterbegin\", message);\n}", "title": "" }, { "docid": "62f8c13661e57599c8b77b57d7addcae", "score": "0.48060343", "text": "function insert(targetId, message) {\n id(targetId).insertAdjacentHTML(\"afterbegin\", message);\n}", "title": "" }, { "docid": "62f8c13661e57599c8b77b57d7addcae", "score": "0.48060343", "text": "function insert(targetId, message) {\n id(targetId).insertAdjacentHTML(\"afterbegin\", message);\n}", "title": "" }, { "docid": "62f8c13661e57599c8b77b57d7addcae", "score": "0.48060343", "text": "function insert(targetId, message) {\n id(targetId).insertAdjacentHTML(\"afterbegin\", message);\n}", "title": "" }, { "docid": "f5fe5a99f090875d6a813ad6c44d4eaa", "score": "0.47978738", "text": "function SBInsertRecord(name, title, selectedNode)\r\n{ \r\n // Use the init function for construction.\r\n this.initServerBehavior(name, title, selectedNode);\r\n}", "title": "" }, { "docid": "d6f4702a00dfd0511be769c202abc2d6", "score": "0.47940922", "text": "insert(tuple) {\n\t\t\t\tthis._tuples[this._tuples.length] = new GSQL.Tuple([this.path.table, this._tuples.length], this, this.columns, tuple, this.keys)\n\t\t\t\treturn\n\t\t\t}", "title": "" }, { "docid": "1987bebe5a0fe277165aacb8cb1f544d", "score": "0.47860554", "text": "insert(value) {\r\n // -------------------- Your Code Here --------------------\r\n this.data.push(value);\r\n \r\n\r\n \r\n // --------------------- End Code Area --------------------\r\n }", "title": "" }, { "docid": "2772357f706a26cd28c751c94cdfb0ab", "score": "0.47787023", "text": "insert(name, entity, next, err) {\n fields = [];\n values = [];\n parameters = [];\n\n for (let [key, value] of Object.entries(entity)) {\n if (key != this.idName) {\n fields.push(key)\n values.push('?');\n parameters.push(value)\n }\n }\n\n this.db.transaction(tx => {\n tx.executeSql(\n `insert into ${name} (${fields.join(',')}) values(${values.join(',')});`,\n parameters,\n (_,res) => {\n entity.Id = res.insertId; \n next(entity);\n }, \n (_, error) => {\n err(error);\n })\n }\n );\n }", "title": "" }, { "docid": "657f7840b1f35529f93d12d62ee01564", "score": "0.47635156", "text": "function successCB() {\n console.log(\"success! from inserting the values into Db\");\n }", "title": "" }, { "docid": "9f984a05b245b5ad91f66c5ac9b92273", "score": "0.47611135", "text": "insertMoney(insertedMoney) {\n this.money += insertedMoney;\n }", "title": "" }, { "docid": "9a254ff4ee41e20d09f8483040fe0d01", "score": "0.47599322", "text": "_onConsensusSyncing() {\n console.log('Consensus syncing');\n this.actions.setConsensus('syncing');\n }", "title": "" }, { "docid": "e8000349a7f56d2b90f927d88585cff4", "score": "0.47552374", "text": "function handleInsertBlockType(name) {\n return insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR);\n}", "title": "" }, { "docid": "c7097f72774fdf1bb74ced69ab12414b", "score": "0.47492632", "text": "enqueue() {\n // TODO: Implement enqueue method\n }", "title": "" }, { "docid": "c82ca4e4db94c89bed208cf69ea64bcd", "score": "0.4747129", "text": "onsync() {\n this.emit('sync')\n }", "title": "" }, { "docid": "bd498f3609ad2a60e80054a446be3e52", "score": "0.4742097", "text": "didInsertElement() {\n this._registerTableScroll();\n this._filteredDataDidChange();\n }", "title": "" }, { "docid": "abddb5d9e69a77582f0aeadad9aa0fd7", "score": "0.4739206", "text": "function canInsert() {\n\t\t// Cap nhat bien insertPosition la thuoc tinh trong lop\n\t\tinsertPosition = getInsertPosition();\n\t\treturn insertPosition != null;\n\t}", "title": "" }, { "docid": "c3136358f85dfd20ff8670c8029c01d6", "score": "0.47325078", "text": "function successfullyInsertedTag() {\n console.log('Successful tag insertion');\n}", "title": "" }, { "docid": "e98a7205fe56e3f432c2fa9b3e0ec325", "score": "0.47290125", "text": "function transaction(action, thisArg) {\n\t if (thisArg === void 0) { thisArg = undefined; }\n\t startBatch();\n\t try {\n\t return action.apply(thisArg);\n\t }\n\t finally {\n\t endBatch();\n\t }\n\t}", "title": "" }, { "docid": "e98a7205fe56e3f432c2fa9b3e0ec325", "score": "0.47290125", "text": "function transaction(action, thisArg) {\n\t if (thisArg === void 0) { thisArg = undefined; }\n\t startBatch();\n\t try {\n\t return action.apply(thisArg);\n\t }\n\t finally {\n\t endBatch();\n\t }\n\t}", "title": "" }, { "docid": "2979d5690470eb8ce6405cd86f21535b", "score": "0.47219613", "text": "insert() {\n const insertValues = this.single.insert || [];\n let { returning } = this.single;\n\n let sql = this.with() + `insert into ${this.tableName} `;\n if (Array.isArray(insertValues)) {\n if (insertValues.length === 0) {\n return ''\n }\n } else if (typeof insertValues === 'object' && isEmpty(insertValues)) {\n return sql + this._emptyInsertValue\n }\n\n const insertData = this._prepInsert(insertValues);\n if (typeof insertData === 'string') {\n sql += insertData;\n } else {\n if (insertData.columns.length) {\n sql += `(${this.formatter.columnize(insertData.columns)}`\n sql += ') values ('\n let i = -1\n while (++i < insertData.values.length) {\n if (i !== 0) sql += '), ('\n sql += this.formatter.parameterize(insertData.values[i], this.client.valueForUndefined)\n }\n sql += ')';\n } else if (insertValues.length === 1 && insertValues[0]) {\n sql += this._emptyInsertValue\n } else {\n sql = ''\n }\n }\n if (returning) {\n sql = {\n sql: sql,\n returning: '*',\n returningSQL: `select ${this.tableName.replace(/\"/g, '')}_ID_INCREMENTER.CURRVAL AS ID from DUMMY;`,\n returningHandler(response) {\n return response[0].ID\n }\n };\n }\n return sql;\n }", "title": "" } ]
d2873dc029e621bd103a7723912f6baf
Shows friend action buttons (add friend, delete friend, accept request, cancel request) depending on the friendship
[ { "docid": "2d0cd05dfccc35c238679902056c9e33", "score": "0.72791314", "text": "function showFriendActionButton() {\n getFriendship(function (error, response) {\n if (error) {\n console.log(error);\n } else {\n //console.log(response);\n if (response.length == 0) {\n $('.addfriendbutton').fadeOut(0, function () {\n $('#addfriendbuttontext').text($.i18n.prop('profile_addfriend', localStorage.getItem(\"lang\")));\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n } else if (response.length == 1) {\n if (response[0]['user_id'] == userId) {\n $('#addfriendbuttontext').text($.i18n.prop('profile_acceptrequest', localStorage.getItem(\"lang\")));\n $('.addfriendbutton').fadeOut(0, function () {\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n $('#deletefriendbuttontext').text($.i18n.prop('profile_rejectrequest', localStorage.getItem(\"lang\")));\n $('.deletefriendbutton').fadeOut(0, function () {\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n } else if (response[0]['friend_id'] == userId) {\n $('#deletefriendbuttontext').text($.i18n.prop('profile_cancelrequest', localStorage.getItem(\"lang\")));\n $('.deletefriendbutton').fadeOut(0, function () {\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n }\n } else if (response.length >= 2) {\n $('#deletefriendbuttontext').text($.i18n.prop('profile_deletefriend', localStorage.getItem(\"lang\")));\n $('.deletefriendbutton').fadeOut(0, function () {\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n }\n }\n });\n}", "title": "" } ]
[ { "docid": "6016e77206f13c70b8bac904e3018d44", "score": "0.6598488", "text": "function initFriendActionButton() {\n $('.addfriendbutton').css('display', 'none');\n $('.addfriendbutton').attr('data-id', userId);\n $('.deletefriendbutton').css('display', 'none');\n $('.deletefriendbutton').attr('data-id', userId);\n}", "title": "" }, { "docid": "1174fbb835de5fd1f9e60cb4128ca8ba", "score": "0.63040966", "text": "function addFriend() {\n setShowAddFriend(true)\n }", "title": "" }, { "docid": "668d03a289c8225a9c4448c0f2fef687", "score": "0.6213376", "text": "function showFriends(thisButton, parent) {\n\t\t\tvar uniqueClassId = $(thisButton).attr(\"class\").split(\" \")[0];\n\n\t\t\tvar buttonCourses = Parse.Object.extend(\"Courses\");\n\t\t\tvar buttonCourse_query = new Parse.Query(buttonCourses);\n\n\t\t\tbuttonCourse_query.include(\"user\");\n\t\t\tbuttonCourse_query.equalTo(\"linked_course\", {\n\t\t\t\t__type: \"Pointer\",\n\t\t\t\tclassName: \"Catalog\",\n\t\t\t\tobjectId: uniqueClassId\n\t\t\t});\n\n\t\t\tbuttonCourse_query.find({\n\t\t\t\tsuccess: function(results) {\n\n\t\t\t\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\t\t\t\tif (results[i].attributes.user.id !== Parse.User.current().id) {\n\t\t\t\t\t\t\tif ($(parent + \" > li > \" + thisButton).find(\"#\" + results[i].attributes.user.attributes.facebookId).length == 0) {\n\t\t\t\t\t\t\t\t$(parent + \" > li > \" + thisButton).next(\".views\").after(\"<div class='friendsInClass'><img id='\" + results[i].attributes.user.attributes.facebookId + \"' title='\" + results[i].attributes.user.attributes.name + \"' src='\" + results[i].attributes.user.attributes.picture + \"'/></div>\");\t\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\terror: function(error) {\n\t\t\t\t\tconsole.log(\"Error: \" + error.code + \" \" + error.message);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "664647734ce0e4eae54b2b7b92fbc9a6", "score": "0.6152058", "text": "function dispfriends() {\r\n if (document.getElementById(\"clickfriend\").display == \"true\") {\r\n document.getElementById(\"clickfriend\").style.display = \"block\";\r\n } else {\r\n getUserFriends();\r\n\r\n document.getElementById(\"clickfriend\").style.display = \"block\";\r\n document.getElementById(\"clickbox\").style.display = \"none\";\r\n document.getElementById(\"shareL\").style.display = \"none\";\r\n }\r\n}", "title": "" }, { "docid": "da2e6692ffbb7a3dc737335ad96642bb", "score": "0.6115505", "text": "render(){\n let button = !this.state.added ? (<button className=\"unadded-friend\" \n onClick={this.handleClick}>Add Friend</button>) :\n (<button className=\"added-friend\">Added</button>)\n return(\n <div className=\"suggested-friends\">\n <div className=\"suggested-details\">\n <div className=\"suggested-img\">\n <Link to={`/users/${this.props.user.id}`}>\n <img src={this.props.user.profileUrl} alt=\"\"/>\n </Link>\n </div>\n <div>\n <Link to={`/users/${this.props.user.id}`}>\n <li>{this.props.user.name}</li>\n </Link>\n <li className=\"mutual-friends\">Mutual Friends: {this.props.user.mutualFriends}</li>\n </div>\n {button}\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "51961a73296d42c945587332f363f719", "score": "0.59889793", "text": "function showFriends(friends) {\n $('#friends').empty();\n friends.forEach(addFriendElement);\n selectFriend(friends[0].id);\n}", "title": "" }, { "docid": "712e45f7f3d2af61f6e6439a11ac0fd9", "score": "0.5940906", "text": "function drawFriends(friends) {\n var html = '';\n\n for (var i = 0; i < friends.length; i++) { //display all friends\n var f = friends[i]; // current friend\n var online = f.online ? 'Online' : 'Offline'; // Is current friend online?\n \n\n html += \n '<li>'+ \n '<a>'\n +'<img src=\"'+f.photo_200_orig+'\"/>'\n +'<div>' \n +'<h4>' + f.first_name + ' ' + f.last_name + '</h4>' \n +'<p>'+ online +'</p>'\n +'<button data-id=\"'+f.id+'\"class=\"open-detail\">Open detail profile</button>'\n +'</div>' \n +'</a>'\n +'</li>';\n }\n\n$('ul').html(html); //Display \n\n}", "title": "" }, { "docid": "88bbd2f3e3b7bfaf603f3404064b9e9f", "score": "0.59235835", "text": "function beFriends(id) {\n\t$.ajax({\n\t\turl : 'add_to_friend.html',\n\t\tdata : {\n\t\t\tqueryId : id\n\t\t},\n\t\ttype : 'GET',\n\t\tsuccess : function(data) {\n\t\t\tdocument.getElementById(\"be_friends_button\").disabled = true;\n\t\t\t$(\"be_friends_button\").val(\"Request sent\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "897163d0b260b87a10f446a1e59129f1", "score": "0.5897727", "text": "function toggleFriendsButton() {\n if (checkedCount > 0) {\n $('#subViewAllFriendsDelete').attr({disabled: false});\n } else {\n $('#subViewAllFriendsDelete').attr({disabled: true});\n }\n }", "title": "" }, { "docid": "5f402af9aff88eaf29104e2b89e63da0", "score": "0.58956414", "text": "function addFriend() {\r\n // Get the profile we're visiting from the GET parameters\r\n let urlParams = new URLSearchParams(window.location.search);\r\n let visitingUserID = urlParams.get(\"userID\");\r\n\r\n // Make a new user object\r\n let currentUser = new User({userID : profileUserID});\r\n\r\n // Get the add friend button\r\n let btn = document.getElementById(\"addFriendButton\");\r\n\r\n // If the profile we're visiting isn't a friend then add them\r\n if(btn.value == \"Add Friend\") {\r\n currentUser.addFriend(requestToken, visitingUserID);\r\n\r\n // Update the text to \"Remove Friend\";\r\n btn.value = \"Remove Friend\";\r\n btn.innerHTML = \"Remove Friend\";\r\n\r\n // Update the friend list\r\n updateFriendList();\r\n } else {\r\n // If they're already friends then remove them as a friend\r\n currentUser.removeFriend(requestToken, visitingUserID);\r\n\r\n // Update the text to \"Add Friend\"\r\n btn.value = \"Add Friend\";\r\n btn.innerHTML = \"Add Friend\";\r\n\r\n // Update the friend list\r\n updateFriendList();\r\n }\r\n}", "title": "" }, { "docid": "65c5ef8d4a7112b4612093fdb7466c39", "score": "0.58537126", "text": "buttonAction(notif, action) {\n //respond to the request\n\n //decline either friend request or location request\n if (action == 'decline') {\n\n //remove row from list\n var index = globals.requests.indexOf(notif)\n globals.requests.splice(index, 1)\n this.setState({requests: globals.requests})\n\n if (globals.friend_requests.indexOf(notif) > -1) {\n\n var url = globals.base_url + 'api/declineFriend'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success declined friend: ' + notif)\n })\n }\n else {\n //this is decline location request\n var url = globals.base_url + 'api/declineLocation'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success location accept: ' + notif)\n })\n }\n }\n //accept either friend request or location request\n else { //action == 'accept'\n\n //remove row from notification list\n var index = globals.requests.indexOf(notif)\n globals.requests.splice(index, 1)\n this.setState({requests: globals.requests})\n\n\n if (globals.friend_requests.indexOf(notif) > -1) {\n var url = globals.base_url + 'api/acceptFriend'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success accepted friend: ' + notif)\n globals.friendslist.append(notif)\n })\n }\n else {\n //this is accept location request\n var url = globals.base_url + 'api/acceptLocation'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success declined location: ' + notif)\n })\n\n }\n }\n }", "title": "" }, { "docid": "2cc69b36a46c69163499c53c08eac091", "score": "0.5803485", "text": "function friendList_helper(key,receiver){ // 'key' is group id; 'receiver' is group name\n //1. add friend/group name button\n $('#clients').append(\n $('<button>',{id:key,class: 'chatbtn list-group-item bg-dark text-white text-left',text:receiver})\n );\n //2. add badge\n $('#'+key).append($('<span>',{id:'badge'+receiver,class:'badge badge-danger float-right',text:'New',style:'display:none'}));\n\n //3. add friend's name and id to group creation modal list\n if(!receiver.includes('_and_')){\n\n r.table('groups').get(key).run(conn,function(err,result) {\n if (err) throw err;\n console.log(result.groupmember);\n result.groupmember.forEach(function (i) {\n if (i !== userid){\n $('#modal_list').append(\n $('<button>',{id:'modal'+ i,class:\"create-group-list list-group-item list-group-item-action border\",text:receiver})\n )\n }\n });\n });\n }\n }", "title": "" }, { "docid": "285a36dbafc134e2187f02dfcf367982", "score": "0.5770894", "text": "function showFriends() {\n getMutualFriends(function (error, response) {\n if (error) {\n console.log(error);\n }\n showOtherUsers(response, 'showmutualfriendsdiv');\n });\n if (sessionId == userId) {\n getPendingFriends(function (error, response) {\n if (error) {\n console.log(error);\n }\n showOtherUsers(response, 'showpendingfriendsdiv');\n });\n getFriendRequests(function (error, response) {\n if (error) {\n console.log(error);\n }\n showOtherUsers(response, 'showfriendrequestsdiv');\n });\n }\n}", "title": "" }, { "docid": "ff8b10357b7f97dbf9f6d08f9d42c58c", "score": "0.56068486", "text": "function user_show_lists(id_user_friend)\n{\n\tvar param = 'action=user_show_lists&id_user_friend=' + id_user_friend;\n\tuser_request(id_user_friend, param);\n\t\n\treturn false;\n}", "title": "" }, { "docid": "05bdb279fe91c8ee914846efc3ca8410", "score": "0.5606834", "text": "function goToFriendPageAndStart() {\r\n // See if we are at the right page to start. We need to be at the /friends/*\r\n // location, to get access to the list of friends. Any other page won't do.\r\n if (document.location.pathname.match('^/friends/edit') && document.location.search == 0) {\r\n // Do nothing now, the worker tab will manage the state since everything \r\n // is asynchronous, we will let events handle the state.\r\n switchToWorkerTab();\r\n }\r\n else { \r\n $(document.body).append(createFacebookDialog({\r\n id: 'fb-exporter-redirect',\r\n title: 'Redirection needed',\r\n message: 'First, you need to go to your friends page, do you want us to redirect you to it?',\r\n yes_text: 'Redirect now',\r\n yes_callback: (function() {\r\n $('#fb-exporter-redirect').remove();\r\n switchToWorkerTab();\r\n window.location = 'http://www.facebook.com/friends/edit';\r\n }),\r\n cancel_callback: (function() {\r\n $('#fb-exporter-redirect').remove();\r\n })\r\n }));\r\n }\r\n}", "title": "" }, { "docid": "1ab42da40ce4e9c6cdbc78de1f7e475c", "score": "0.5580897", "text": "function createActionButtons(){\n var actionButtons = template(tActionButtons);\n $('#actionButtons').append(actionButtons);\n $('#addUser').on('click', function(){\n if(!addForm.form.find('button').length){\n createAddForm();\n }\n addForm.show(300);\n });\n $('#editUser').on('click', function(){\n if(!updateForm.form.find('button').length){\n createUpdateForm();\n }\n if(userId){\n updateForm.setValueForm(\n collectionOfUser.getElementById(userId)\n );\n updateForm.show(300);\n }\n else{\n if(!warningForm.form.find('button').length){\n createWarningForm();\n }\n warningForm.show(300);\n }\n });\n $('#delUser').on('click', function(){\n if(userId){\n updateForm.setValueForm(\n collectionOfUser.getElementById(userId)\n );\n if(!confirmForm.form.find('button').length){\n createConfirmForm();\n }\n confirmForm.show(300);\n }\n else{\n warningForm.show(300);\n }\n });\n \n }", "title": "" }, { "docid": "12ca5e3abbe08ff8ed2de592b012bea1", "score": "0.55735147", "text": "function updateFriendsList(list){\n $(\"#friends-list ul\").children().remove()\n $(\"#offline-friends ul\").children().remove()\n\n offlineFriends.forEach((friend) => {\n if(list[friend] ){\n $(\"#friends-list ul\").append(`\n <li class=\"friend-container\" id=\"${list[friend].user_id}\">\n ${list[friend].username}\n <button class=\"btn btn-secondary\" id=\"start-call\" style=\"height: auto;\"><i class=\"fas fa-video\"></i></button>\n <button class=\"btn btn-secondary\" id=\"start-chat\"><i class=\"far fa-comments\"></i></button>\n </li>\n `)\n }else{\n $('#offline-friends ul').append(`<li>${friend}</li>`)\n }\n })\n}", "title": "" }, { "docid": "abf344ab798e9eea38e4533149532374", "score": "0.5531471", "text": "function friendLookUp() {\n $(\"#friendInfo\").show();\n showFriendInfo();\n}", "title": "" }, { "docid": "8963292db47a47434957b61903ef4e22", "score": "0.55212975", "text": "function setup_invite_friends_prompt(dialog, reason) {\n dialog.user_data['invite_friends_reason'] = reason;\n\n dialog.widgets['title'].set_text_with_linebreaking_and_shrink_font_to_fit(dialog.data['widgets']['title']['ui_name'].replace('%game', gamedata['strings']['game_name']));\n\n /** @type {string} */\n var value_prop;\n // customize text per platform\n if('ui_name_'+spin_frame_platform in dialog.data['widgets']['value_prop']) {\n value_prop = dialog.data['widgets']['value_prop']['ui_name_'+spin_frame_platform];\n } else {\n value_prop = dialog.data['widgets']['value_prop']['ui_name'];\n }\n dialog.widgets['value_prop'].set_text_with_linebreaking(value_prop.replace('%game', gamedata['strings']['game_name']));\n\n var num_friends = 0;\n var friend_name = '';\n\n for(var i = 0; i < player.friends.length; i++) {\n var friend = player.friends[i];\n if(!friend.is_ai() && friend.is_real_friend) {\n num_friends += 1;\n if(!friend_name) {\n friend_name = friend.get_ui_name();\n }\n }\n }\n\n var proof = '';\n\n if(num_friends < 1) {\n proof = dialog.data['widgets']['social_proof']['ui_name_has_no_friends'];\n } else if(num_friends < 2) {\n proof = dialog.data['widgets']['social_proof']['ui_name_has_one_friend'];\n } else if(num_friends < 3) {\n proof = dialog.data['widgets']['social_proof']['ui_name_has_two_friends'];\n } else {\n proof = dialog.data['widgets']['social_proof']['ui_name_has_many_friends'];\n }\n\n dialog.widgets['social_proof'].set_text_with_linebreaking(proof.replace('%game', gamedata['strings']['game_name']).replace('%s', friend_name).replace('%d', pretty_print_number(num_friends-1)));\n\n // fill in friend widgets\n var row = 0;\n var n_widgets = 5;\n for(i = 0; i < player.friends.length && row < n_widgets; i++) {\n var friend = player.friends[i];\n if(friend.is_ai() || !friend.is_real_friend) { continue; }\n dialog.widgets['friend_icon'+row].set_user(friend.user_id);\n row++;\n }\n\n // \"direct_share\" means we'll skip friend selector / membership rewards\n // and just offer to share a \"join the game\" link.\n\n var direct_share = (spin_frame_platform === 'fb'); // as of April 2018, this is the only method that works on FB\n\n if(direct_share) {\n dialog.widgets['ok_button'].show = false;\n dialog.widgets['fb_share_button'].show =\n dialog.widgets['fb_share_icon'].show = true;\n dialog.default_button = dialog.widgets['fb_share_button'];\n dialog.widgets['fb_share_button'].onclick = function(w) {\n var reason = w.parent.user_data['invite_friends_reason'];\n close_parent_dialog(w); // regardless of success or failure, close the prompt. (don't be too pushy...)\n invoke_invite_friends_dialog_fb_alternative(reason);\n };\n } else {\n dialog.widgets['ok_button'].show = true;\n dialog.widgets['fb_share_button'].show =\n dialog.widgets['fb_share_icon'].show = false;\n dialog.default_button = dialog.widgets['ok_button'];\n if('ui_name_'+spin_frame_platform in dialog.widgets['ok_button'].data) {\n dialog.widgets['ok_button'].str = dialog.widgets['ok_button'].data['ui_name_'+spin_frame_platform];\n }\n\n dialog.widgets['ok_button'].onclick = function(w) {\n // note: there used to be a special case here for the rails tutorial,\n // but it's no longer relevant because the invite prompt was moved\n // into the new quest-based tutorial system.\n var reason = w.parent.user_data['invite_friends_reason'];\n change_selection(null);\n invoke_invite_friends_dialog(reason);\n };\n }\n}", "title": "" }, { "docid": "ec416b09a5b652b32443fcfcf383c67c", "score": "0.5421354", "text": "function createPendingFriendButton(targetID) {\n\n if (targetID == null) {\n console.log(\"Friend Forms must have a targetID\");\n return;\n }\n\n var tID = document.getElementById(targetID);\n $(tID).empty();\n\n var button = document.createElement(\"button\");\n $(button).addClass(\"expand disabled\").append(\"Friend Request Sent\");\n\n // Add button to target\n $(tID).append(button);\n}", "title": "" }, { "docid": "56bc093947fa5583f2ad462a1d949bc4", "score": "0.5420157", "text": "function makeFriendRequest(requester, friend){\n if(!existsUser(requester))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + requester);\n\n if(!existsUser(friend))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + friend);\n\n if(areFriends(requester, friend))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"The users are already friends\");\n\n Meteor.users.update({\n _id: requester\n },\n {\n $addToSet: {\n 'friends.unconfirmed': friend\n }\n });\n\n Meteor.users.update({\n _id: friend\n },\n {\n $addToSet: {\n 'friends.requests': requester\n }\n });\n }", "title": "" }, { "docid": "f613356dad651d72a3b13e864ae3198c", "score": "0.5401556", "text": "function initHandlers() {\n\n $(\".addfriendbutton\").click(function () {\n console.log(\"addfriendbutton clicked\");\n var str = \"addFriend&id=\";\n console.log(userId);\n $.ajax({\n url: '/rest/friends?id=' + $(this).attr('data-id'),\n type: \"POST\",\n dataType: \"json\",\n //data: JSON.stringify({\"friendid\": userId}),\n success: function (response) {\n console.log(response);\n showFriends();\n getUserInfo();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log(textStatus, errorThrown);\n }\n });\n });\n\n $(\".deletefriendbutton\").click(function () {\n console.log(\"deletefriendbutton clicked\");\n $.ajax({\n url: '/rest/friends?id=' + $(this).attr('data-id'),\n type: \"DELETE\",\n dataType: \"json\",\n //data: JSON.stringify({\"friendid\": userId}),\n success: function (response) {\n console.log(response);\n showFriends();\n getUserInfo();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log(textStatus, errorThrown);\n }\n });\n });\n}", "title": "" }, { "docid": "4f913f18c47d0a43cc414e7643202079", "score": "0.5395658", "text": "function show_friends(req, res, username) {\n\toracle.connect(connectData, function(err, connection) {\n if ( err ) {\n \tconsole.log(err);\n } else {\n \tconnection.execute(\"SELECT * FROM FRIENDS WHERE USERNAME1='\" + username + \"' AND STATUS='accepted'\",\n \t\t[],\n \t\tfunction(err, existing) {\n \t\tif ( err ) {\n \t\t\tconsole.log(err);\n \t\t} else {\n \t\t\tconsole.log(existing);\n if (existing.length == 0) {\n res.render('my_friends.jade',\n {title: 'My Friends',\n message: \"Currently, you don't have any friends. Search for a new one!\"});\n } else {\n // results = render_string(existing);\n res.render('my_friends.jade',\n {title: 'My Friends',\n message: 'Keep in touch with your friends:',\n showResults: true,\n results: existing});\n }\n \t\t}\n \t}); // end of connection.execute\n }\n}); // end of orocal.connect\n}", "title": "" }, { "docid": "9fd18eb7449adf06868dd1035064439f", "score": "0.53793555", "text": "function displayFriends(){\n\t// declare variables\n\tvar callback = function(json){\n\t\tvar friends = json.friends;\n\t\t// put all data in its proper place\n\t\t$('.baby-step').each(function(){\n\t\t\tvar id = $(this).attr('id');\n\t\t\tvar babyStep = id.split('-')[3];\n\t\t\tvar msg = buildMessage(friends, babyStep);\n\t\t\t$(\"#\"+id).find('.baby-step-friends').html(msg);\n\t\t});\n\t};\n\t// get friends list\n\tgetFriends(callback);\n}", "title": "" }, { "docid": "17d9f4f1dbbc09258ba98c6ae81df7cd", "score": "0.534321", "text": "friend() {\n //email is of the potential friend, id is of the signed in user\n let email = this.state.selectedUser.email;\n let id = this.props.id;\n\n if(email === this.props.email && this.state.selectedUser.name === this.props.name) {\n toastr.warning('Uh Oh!', `You can't friend yourself, please select a different user`);\n return null;\n }\n\n this.props.addFriend(id, email)\n //the toast for success or failure wil be determined in componentDidUpdate\n }", "title": "" }, { "docid": "a109eb82b600a749a6889a8663b2ce1e", "score": "0.534009", "text": "function getUserFriends() {\n var markup = '<div class=\"data-header\"></div><div style = \"width :70%; margin : 20px auto;\"><ul id=\"friends-list\">';\n \n for (var i=0; i < friendsInfo.length; i++) {\n markup = markup + '<li onclick=\"doComparison(\\'' + friendsInfo[i].name + '\\',\\'' + friendsInfo[i].id + '\\',\\'' + friendsInfo[i].picture + '\\')\" style = \"list-style-type: none; height = 20%;\"><img src=\"' + friendsInfo[i].picture + '\">' + '&nbsp;&nbsp;&nbsp;<b>' + friendsInfo[i].name + '</b></li><br />';\n }\n \n markup = markup + \"</ul></div>\"\n FB.$('friends').innerHTML = markup; \n\n}", "title": "" }, { "docid": "b1d075c7604649114d44ce78af0a1584", "score": "0.5334582", "text": "function updateButtons() {\n\t// It's mine button\n\tif(currentState == GameState.CAN_WIN) {\n\t\t$(\"div#mine\").css({\"display\":\"block\"});\n\t}else{\n\t\t$(\"div#mine\").css({\"display\":\"none\"});\n\t}\n\t// It's yours button\n\tif(currentState == GameState.CAN_PUT_OR_LOSE) {\n\t\t$(\"div#yours\").css({\"display\":\"block\"});\n\t}else{\n\t\t$(\"div#yours\").css({\"display\":\"none\"});\n\t}\n}", "title": "" }, { "docid": "fd3290e022fcb6fa09edb8c896d9fcfa", "score": "0.5327606", "text": "function addNAMWCProfileButton(Context, User) {\n Context.insertAdjacentHTML(\n \"beforeEnd\",\n \" <span class=\\\"NAMWCButton\\\">\" +\n \" <i class=\\\"fa fa-question-circle\\\" title=\\\"Check for not activated / multiple wins.\\\"></i>\" +\n \"</span>\"\n );\n setNAMWCPopup(Context, User);\n}", "title": "" }, { "docid": "a197905423c1b80ae9b62cb4d4614aa8", "score": "0.5314539", "text": "function EditGreeting() {\n\tif (wgCanonicalNamespace == 'Message_Wall' && wgAction != 'history') {\n\t\tif (wgTitle == wgUserName) {\n\t\t\t$('.WikiaMainContent').prepend('<div class=\"UserProfileActionButton\"><a accesskey=\"e\" href=\"/wiki/Message_Wall_Greeting:'+ wgUserName +'?action=edit\" class=\"wikia-button\" data-id=\"edit\" id=\"talkArchiveEditButton\" style=\"padding-left: 5px; padding-right: 8px;\"><img alt=\"\" class=\"sprite edit-pencil\" height=\"16\" src=\"data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D\" width=\"22\"> Edit greeting\t</a></div>');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1407ab7906fe59e321b4a3c6d0d6cc7d", "score": "0.5314124", "text": "function showControls() {\n var elm, inp, i, x, coll;\n\n // find and render controls\n elm = document.getElementById('actions');\n if(elm) {\n elm.innerHTML = '';\n coll = g.msg.getElementsByTagName(\"data\");\n\n for(i=0,x=coll.length;i<x;i++) {\n if(coll[i].getAttribute('name')===\"links\") {\n inp = document.createElement('input');\n inp.type = \"button\";\n inp.className = \"button\";\n inp.id = coll[i].getAttribute('id');\n \n inp.setAttribute('action',coll[i].getAttribute('action'));\n inp.setAttribute('href',coll[i].getAttribute('url'));\n inp.setAttribute('model',coll[i].getAttribute('model'));\n inp.value = coll[i].getAttribute('rel');\n inp.onclick = clickButton;\n \n elm.appendChild(inp);\n }\n }\n }\n }", "title": "" }, { "docid": "1d66d70618782659a63dec2324685d6d", "score": "0.53120154", "text": "function friendsTab() {\n // We get the friends list container and empty it.\n var friendslist = $(\"#list-view-items\");\n friendslist.empty();\n\n // We request a list of friends from the server.\n $.post(\"/User/GetFriends\", function (results) {\n // Results:\n // [usernames/images/userIds][indexer]\n for (var i = 0; i < results[0].length; i++) {\n friendslist.append(\n \"<li class='list-item'>\"\n + \"<img src='/Images/Users/\" + results[1][i] + \"'/>\"\n + \"<a onclick='friendMain(\\\"\" + results[2][i] + \"\\\"); return false;' class='list-name'>\" + results[0][i] + \"</a>\"\n + \"</li>\"\n );\n }\n })\n}", "title": "" }, { "docid": "210935008aa920be3f1961788962f680", "score": "0.5294679", "text": "function friend_recommend(record) {\n var field = make_friend_combo();\n var id = record.get(typeinfo[record.get('type')].qryindex);\n var url = ['recommend', record.get('type'), id].join('/');\n var button_t = new Ext.Template('<span><button>{0}</button></span>');\n var button = new Ext.Button({\n text: 'recommend',\n template: button_t\n });\n var cancel = new Ext.Button({\n text:'cancel',\n template: button_t\n });\n var entity = record.get(typeinfo[record.get('type')].lblindex);\n var win = new Ext.Panel({\n layout: 'fit',\n resizable: false,\n items: [field],\n buttons: [cancel, button],\n title: '<h1>Recommend to a friend</h1><h2>' + entity + '</h2>',\n\t\tbaseCls:'x-plain'\n });\n button.setHandler(\n function() {\n show_status_msg(\"Recommmending...\");\n Ext.Ajax.request({\n url: [url, field.getValue()].join('/'),\n success: function(options, response) {\n show_status_msg(\"Recommendation Sent\");\n }\n });\n hide_dialog();\n }\n );\n cancel.setHandler(function() { hide_dialog(); });\n show_dialog(win, true);\n}", "title": "" }, { "docid": "6a430446c661aa32a122b43048cabcb3", "score": "0.52889836", "text": "isFriendRequested() {\n return this.props.user.friendRequests.filter(user => user.spotifyId === this.props.auth.spotifyId).length > 0;\n }", "title": "" }, { "docid": "407b9c77fadc5fb32465dfeec82ca965", "score": "0.5272578", "text": "function displayFriend(mate) {\n\treturn mate.name + \" is \" + mate.age + \" like \" + hobby \n}", "title": "" }, { "docid": "e952c591a8c846c92e5a3ed02b39b00f", "score": "0.52617186", "text": "function sendFriendRequests() {\n\tvar sitemembers = new Array ();\n\tvar checked = false;\n\tvar total_contacts = $('total_contacts').value;\n\tfor (var i =1; i <= total_contacts; i++) \n\t{\n\t\tif ($('contact_' + i).checked) {\n\t\t\tchecked = true;\n\t\t\tsitemembers [i] = $('contact_' + i).value;\n\t\t}\n\t}\n\tif (checked) {\n\t\tSmoothbox.open(\"<div style='height:30px;'><center><b>\" + en4.core.language.translate('Sending Request') + \"</b><br /><img src='application/modules/Seaocore/externals/images/loadings.gif' alt='' /></center></div>\");\n\t\tvar postData = { \n\t\t 'format': 'json',\n\t\t\t'sitemembers' : sitemembers,\n\t\t\t'task' : 'friend_requests'\n\t\t};\n\t\t\n\t\ten4.core.request.send(new Request.JSON({\n\t\t\turl : en4.core.baseUrl + 'seaocore/usercontacts/addtofriend',\n\t\t\tmethod : 'post',\n\t\t\tdata : postData,\n\t\t\tonSuccess : function(responseJSON)\n\t\t\t{ \n\t\t\t\t\n if ($('id_success_frequ')) \n\t\t\t\t $('id_success_frequ').style.display = 'block';\n\t\t\t\t$('show_sitefriend').style.display = 'none';\n\t\t\t\t$('show_nonsitefriends').style.display = 'block';\n\t\t\t\tSmoothbox.close();\n\t\t\t}\n\t\t}));\n\t}\n\telse {\n\t\ten4.core.showError(\"Please select at least one friend to add\");\n\t}\n}", "title": "" }, { "docid": "97d3f2f08365bdd328f63de020ae39b0", "score": "0.5259829", "text": "function invoke_invite_friends_dialog_fb_alternative(reason) {\n invite_friends_dialog_shown_this_session = true; // stop the \"+Add\" button flashing\n metric_event('7103_invite_friends_fb_prompt', {'sum': player.get_denormalized_summary_props('brief'), 'method': 'share_invite'});\n FBShare.invoke({name: gamedata['virals']['invite_friends']['ui_post_message'],\n description: gamedata['virals']['ui_post_description'],\n link_qs: {'spin_campaign': 'share_invite'},\n ref: 'share_invite'});\n}", "title": "" }, { "docid": "249ea8a4179f035be3250f2e32346a28", "score": "0.5257951", "text": "function onSyncFriendAction( obj ) {\n let action = formatFriendAction( obj );\n IMBridge.onSyncFriendAction( action );\n}", "title": "" }, { "docid": "514bede814f3c0581f68647f567dc082", "score": "0.5195482", "text": "function publishStoryFriend() {\n randNum = Math.floor ( Math.random() * friendIDs.length ); \n\n var friendID = friendIDs[randNum];\n \n console.log('Opening a dialog for friendID: ', friendID);\n \n FB.ui({\n method: 'feed',\n to: friendID,\n name: 'I\\'m using the Hackbook web app',\n caption: 'Hackbook for Mobile Web.',\n description: 'Check out Hackbook for Mobile Web to learn how you can make your web apps social using Facebook Platform.',\n link: 'http://apps.facebook.com/mobile-start/',\n picture: 'http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png',\n actions: [{ name: 'Get Started', link: 'http://apps.facebook.com/mobile-start/' }],\n user_message_prompt: 'Tell your friends about building social web apps.'\n }, \n function(response) {\n console.log('publishStoryFriend UI response: ', response);\n });\n}", "title": "" }, { "docid": "514bede814f3c0581f68647f567dc082", "score": "0.5195482", "text": "function publishStoryFriend() {\n randNum = Math.floor ( Math.random() * friendIDs.length ); \n\n var friendID = friendIDs[randNum];\n \n console.log('Opening a dialog for friendID: ', friendID);\n \n FB.ui({\n method: 'feed',\n to: friendID,\n name: 'I\\'m using the Hackbook web app',\n caption: 'Hackbook for Mobile Web.',\n description: 'Check out Hackbook for Mobile Web to learn how you can make your web apps social using Facebook Platform.',\n link: 'http://apps.facebook.com/mobile-start/',\n picture: 'http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png',\n actions: [{ name: 'Get Started', link: 'http://apps.facebook.com/mobile-start/' }],\n user_message_prompt: 'Tell your friends about building social web apps.'\n }, \n function(response) {\n console.log('publishStoryFriend UI response: ', response);\n });\n}", "title": "" }, { "docid": "514bede814f3c0581f68647f567dc082", "score": "0.5195482", "text": "function publishStoryFriend() {\n randNum = Math.floor ( Math.random() * friendIDs.length ); \n\n var friendID = friendIDs[randNum];\n \n console.log('Opening a dialog for friendID: ', friendID);\n \n FB.ui({\n method: 'feed',\n to: friendID,\n name: 'I\\'m using the Hackbook web app',\n caption: 'Hackbook for Mobile Web.',\n description: 'Check out Hackbook for Mobile Web to learn how you can make your web apps social using Facebook Platform.',\n link: 'http://apps.facebook.com/mobile-start/',\n picture: 'http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png',\n actions: [{ name: 'Get Started', link: 'http://apps.facebook.com/mobile-start/' }],\n user_message_prompt: 'Tell your friends about building social web apps.'\n }, \n function(response) {\n console.log('publishStoryFriend UI response: ', response);\n });\n}", "title": "" }, { "docid": "b37f731a3b857bc60a578c1729b81e5b", "score": "0.51904887", "text": "function changeFollowButton(status) {\n\tif(status == 0) {\n\t\t//follow \n\t\tdocument.getElementById('follow-button').className = 'follow-button';\n\t\tdocument.getElementById('follow-icon').className = 'fa fa-plus-circle';\n\t\tdocument.getElementById('follow-text').innerHTML = 'follow';\n\t} else {\n\t\t//unfollow - following\n\t\tdocument.getElementById('follow-button').className = 'following-button';\n\t\tdocument.getElementById('follow-icon').className = 'fa fa-times-circle';\n\t\tdocument.getElementById('follow-text').innerHTML = 'following';\n\t}\n}", "title": "" }, { "docid": "60449e7b4c45797cdfef151c417ceae5", "score": "0.5174162", "text": "function renderJoinFanClub() {\n hideChat();\n $joinChatPH.html('');\n let btn = \"<button id='\" + chosenShowID + \"' class='button' onclick='JoinFanClub()'>Join \" + chosenShowName + \" Fan Club</button> \";\n $joinChatPH.append(btn);\n}", "title": "" }, { "docid": "5a7cf2a7f5c916389718eb73b1d12bb6", "score": "0.5173381", "text": "function onMateEvent(action, data) {\r\n const fid = data.myRequest.friend._id;\r\n\r\n if (users.has(fid))\r\n users.get(fid).socket.emit('mate:', action, data);\r\n }", "title": "" }, { "docid": "2b4fde8f3a5908c10dedd585ceaeb06e", "score": "0.5173015", "text": "function friends_activities() {\n\tvar status = dojo.byId('status_checkbox').checked;\n\tvar include_friends = dojo.byId('friends_checkbox').checked;\n\tif (status == true && include_friends == true) {\n\t\tdojo.xhrGet({\n\t\t\turl: '/widgets/load_profile_widget',\n\t\t timeout: 10000, // give up after 10 seconds\n\t\t content: { name:'activity_feed_profile', only_statuses:'true', include_friends:'true', user_id:user_id, authenticity_token:authenticity_token },\n\t\t\terror: function (data) {widget_load_error('activity_feed_profile', data);},\n\t\t\tload: function (data) {widget_loaded('activity_feed_profile', data);}\n\t\t});\t\n\t}\n\telse if (include_friends == true) {\n\t\tdojo.xhrGet({\n\t\t\turl: '/widgets/load_profile_widget',\n\t\t timeout: 10000, // give up after 10 seconds\n\t\t content: { name:'activity_feed_profile', include_friends:'true', user_id:user_id, authenticity_token:authenticity_token },\n\t\t\terror: function (data) {widget_load_error('activity_feed_profile', data);},\n\t\t\tload: function (data) {widget_loaded('activity_feed_profile', data);}\n\t\t});\t\n\t}\n\telse if (status == true) {\n\t\tdojo.xhrGet({\n\t\t\turl: '/widgets/load_profile_widget',\n\t\t timeout: 10000, // give up after 10 seconds\n\t\t content: { name:'activity_feed_profile', only_statuses:'true', user_id:user_id, authenticity_token:authenticity_token },\n\t\t\terror: function (data) {widget_load_error('activity_feed_profile', data);},\n\t\t\tload: function (data) {widget_loaded('activity_feed_profile', data);}\n\t\t});\t\n\t}\n\telse {\n\t\trefresh_profile_widget('activity_feed_profile')\n\t}\n}", "title": "" }, { "docid": "e46b5ffe009381223eaa704cb2d1987f", "score": "0.51666164", "text": "_getHeaderButtons () {\n let buttons = super._getHeaderButtons()\n const canConfigure = game.user.isGM || this.actor.owner\n if (this.options.editable && canConfigure) {\n buttons = [\n {\n label: 'Actor Mods',\n class: 'configure-actor',\n icon: 'fas fa-dice',\n onclick: (ev) => this._onConfigureActor(ev)\n }\n ].concat(buttons)\n }\n return buttons\n }", "title": "" }, { "docid": "0b142aae7135e9327dbcc6c95ab08271", "score": "0.51655185", "text": "function updateFriendsStatus(friends) {\n friends.forEach(function (friendId) {\n $('#' + friendId).find('div.media-body span').text('online')\n });\n}", "title": "" }, { "docid": "779345f70bcfcdf3407c982e188a275c", "score": "0.5150375", "text": "function friends(data){\n $scope.friends = data;\n $scope.friend = {};\n }", "title": "" }, { "docid": "3fee8e05cbc0af67e7697e93f5065677", "score": "0.5136054", "text": "function addButtons()\n {\n\n //Create the buttons\n createFavoritsButtons();\n \n \n }", "title": "" }, { "docid": "74b7c26b481f79c50876e3436e644e0e", "score": "0.51359874", "text": "function showConnections(evt) {\n /* render the layover and show the list of friends */\n var pids = evt.data.p == 1 ? participantIds : followerIds;\n var heading = evt.data.p == 1 ? 'Participants' : 'Followers';\n \n var code = '<ul>';\n var n = pids.length;\n for (var i = 0; i < pids.length; i++) {\n code += '<li id=\"' + pids[i] + '\"><a target=\"_blank\" href=\"home.php?fbid=' + \n pids[i] + '\"><img id=\"' + pids[i] + '\" src=\"https://graph.facebook.com/' + \n pids[i] + '/picture\"/></a></li>';\n }\n code += '</ul>';\n var id = '#overlay';\n renderOverlay(id, heading, code);\n}", "title": "" }, { "docid": "12bc1461c862d3ed8e72b8bbf5f5d2f8", "score": "0.5122518", "text": "function get_friend_list() {\n let friendlist = [];\n $.post(\n 'http://' + auth_server + ':8081/api/friend/list',\n {\n token: token\n },\n function (data) {\n if (!data.success) {\n console.log(data.msg);\n } else {\n\n $(\".user_box\").not(\"#add-friend-box\").each(function () {\n let found = false;\n for(let friend in data.friends) {\n if($(this).prop(\"id\") == friend.name) {\n found = true;\n break;\n }\n }\n if(!found)\n $(this).remove();\n });\n\n let hide = true;\n $(\".user_box\").each(function(){\n if($(this).is(\":hidden\")) {\n hide = true;\n }\n else {\n hide = false;\n }\n });\n\n data.friends.forEach(function (friend) {\n let s = $('#friends_list').find('#list_item_' + friend.name);\n if(s.length == 0) {\n let element = $(\"<li class=\\\"list-group-item user_box\\\" id='list_item_\" + friend.name + \"'></li>\");\n let input_group = $(\"<div class=\\\"input-group\\\" id=\\\"input-group-\" + friend.name + \"\\\"></div>\");\n let indicator = $(\"<div id=\\\"online-indicator\\\"></div>\");\n if (!friend.online) {\n indicator.css(\"background-color\", \"red\");\n }\n input_group.append(indicator);\n input_group.append(\"<div id='friend_id'>\" + friend.name + \" </div>\");\n\n let input_group_btn = $(\"<div class=\\\"input-group-btn\\\"></div>\");\n\n if (!friend.confirm) {\n let confirm_btn = $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-ok\\\" id='\" + friend.name + \"'></button>\")\n .click(function () {\n $.post(\n 'http://' + auth_server + ':8081/api/friend/accept',\n {\n token: token,\n requestname: event.target.id\n },\n function (data) {\n if (!data.success) {\n alert(data.msg);\n } else {\n get_friend_list();\n }\n },\n 'json'\n );\n });\n input_group_btn.append(confirm_btn);\n\n let refuse_btn = $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-remove warning\\\" id='\" + friend.name + \"'></button>\")\n .click(function () {\n $.post(\n 'http://' + auth_server + ':8081/api/friend/refuse',\n {\n token: token,\n requestname: event.target.id\n },\n function (data) {\n if (!data.success) {\n alert(data.msg);\n } else {\n get_friend_list();\n }\n },\n 'json'\n );\n });\n input_group_btn.append(refuse_btn);\n\n } else {\n if (friend.online) {\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon-comment\\\" id='\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .click(function () {\n $('#chat_window_1').show();\n let friend_id = $('#chat_window_1').find('.panel-title');\n friend_id.text(friend.name);\n $(\"#container-msg\").empty();\n console.log(\"friend.name: \" + friend.name);\n socket.emit('chat history', friend.name);\n });\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon-tower\\\" id='\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .click(function () {\n socket.emit('duel request', {pseudo: event.target.id});\n });\n }\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-remove\\\" id='\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .click(function () {\n $.post(\n 'http://' + auth_server + ':8081/api/friend/remove',\n {\n token: token,\n requestname: event.target.id\n },\n function (data) {\n if (!data.success) {\n alert(data.msg);\n } else {\n get_friend_list();\n }\n },\n 'json'\n );\n });\n\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-ok duel\\\" id='accept_duel_\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .hide();\n\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-remove duel\\\" id='refuse_duel_\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .hide();\n }\n\n input_group.append(input_group_btn);\n element.append(input_group);\n if (friend.online === 'true')\n element.css(\"background-color\", \"red\");\n if(hide) {\n element.hide();\n }\n $(\"#friends_list\").append(element);\n } else {\n if (!friend.online)\n $('#friends_list').find('#list_item_' + friend.name).find(\"#input-group-\" + friend.name).find(\"#online-indicator\").css(\"background-color\", \"red\");\n }\n }, this);\n }\n },\n 'json'\n );\n return friendlist;\n}", "title": "" }, { "docid": "911f00122e1971918c367810a5df354b", "score": "0.5118473", "text": "[commandEnum.CONTACTS]() {\n\t\tif (user.friendsList.length === 0) {\n\t\t\tconsole.log(\"You have no friends :cry:\")\n\t\t}\n\t\tuser.friendsList.forEach(f => { console.log(f.fullName) })\n\t}", "title": "" }, { "docid": "3de22e24073efda460a864d11fe7f662", "score": "0.5114309", "text": "function addFriendElement(friend) {\n var friendElement = createFriendElement(friend);\n $('#friends').append(friendElement);\n friends[friend.id] = 0;\n}", "title": "" }, { "docid": "4e6b03d4a4f3b2c7365b145a9e3b8c17", "score": "0.51105714", "text": "async function onFriendship (friendship) {\n log.info(\"onFriendShip event emit...\")\n\n try {\n const contact = friendship.contact() //获取联系人信息\n \n switch (friendship.type()) { \n \n // 1. receive new friendship request from new contact\n case Friendship.Type.Receive:\n // 获取验证信息\n log.info(`Request from ${contact.name()}:`, friendship.hello())\n\n // 校验验证信息\n if (!Validator.checkFriendConfirm(friendship.hello())) {\n log.info(`未通过好友(${contact.name()})请求!`)\n return\n }\n\n // 通过请求\n let result = await friendship.accept()\n log.info(result)\n\n //if (result) {\n //log.info(`Request from ${contact.name()} is accept succesfully!`)\n //} else {\n //log.error(`Request from ${contact.name()} failed to accept!`)\n //}\n\n break\n\n // 2. confirm friendship\n case Friendship.Type.Confirm: \n log.info(`new friendship confirmed with ${contact.name()}`)\n\n /**\n * reply image(qrcode image)\n */\n const fileBox1 = FileBox.fromFile('../web/static/images/reply.jpg')\n log.debug(fileBox1)\n await contact.say(fileBox1)\n\n //await contact.say(\"欢迎使用曼泽愿望机器人!\")\n //await contact.say(\"只要您把常购买的商品链接分享给我,我就会给您定制一份属于您的购买愿望列表!\")\n //await contact.say(\"您可以随时把链接分享给亲人、朋友或发放到朋友圈!\")\n\n break\n }\n\n } catch (e) {\n log.error(e)\n }\n }", "title": "" }, { "docid": "628c931aadeb37dbc4520579a68457a6", "score": "0.5101407", "text": "function NonFriend(props) {\n\n function remove(userId, friendId){\n props.addFriend(userId, friendId)\n }\n\n return (\n <div className='image-container'>\n <div>{this.props.friends.user_name}</div>\n <button onClick={remove}>add</button>\n </div>\n )\n }", "title": "" }, { "docid": "6d72f4232804010057157c2030e4a9dd", "score": "0.51012444", "text": "function sendContextFriendshipRequest(nickname){\n\tif (!nickname){return false;}\n\n\tvar data = initFriendsAJAXData(),\n\t\t$element = $('body .context-add-to-friends');\n\n\tdata.params.receiverNickname = nickname;\n\n\tif ($element.length){\n\t\t$element.addClass('processing');\n\t}\n\n\tvar callback = function(callbackData){\n\t\tdevInfo('context success callback');\n\t\t//show in context button\n\n\t\tshowMessageInContextMenu($element, callbackData.message, 'success');\n\t\t// update friends system\n\t\tfriendsFrameRenew();\n\t\tcleanupContextMenu();\n\t};\n\tvar errorCallback = function(callbackData){\n\t\tdevInfo('context error callback');\n\t\t//show error in context button\n\t\tshowMessageInContextMenu($element, callbackData.message, 'failure');\n\t\tcleanupContextMenu();\n\t};\n\n\t$.ajax({\n\t\turl: urlPrefix + \"/api/friendship/request-by-nick/\",\n\t\tdataType: 'jsonp',\n\t\tdata: data,\n\t\tsuccess: function (returnedData) {\n\t\t\tdevInfo('!!success!!', returnedData);\n\t\t\tcallback(returnedData);\n\t\t},\n\t\terror: function(xhr, status, error) {\n\t\t\tdevInfo('!!error!!', xhr, status, error);\n\t\t\tif (status){\n\t\t\t\tdevInfo('error status', status);\n\t\t\t}\n\t\t\tif (error){\n\t\t\t\tdevInfo('error data', error);\n\t\t\t}\n\t\t\tif (errorCallback){\n\t\t\t\t/*errorCallback(JSON.parse(error.responseText));*/\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "5176248b10bc5aaa6e24b801f64c717b", "score": "0.5100794", "text": "function doActivateButtonsDisplayEventPage(obj) {\r\n var obj = document.getElementById(\"MGEventDisplayForm\");\r\n var userTypeName = getUserTypeName();\r\n\r\n $(\"#MGEventDisplayBtnModify\").hide();\r\n $(\"#MGEventDisplayBtnJoin\").show();\r\n if (userTypeName == \"Manager\") {\r\n $(\"#MGEventDisplayBtnModify\").show();\r\n $(\"#MGEventDisplayBtnJoin\").show();\r\n }\r\n}", "title": "" }, { "docid": "c53284726178a0e46499eeabe8478b24", "score": "0.50919217", "text": "function friend_cancel(id)\n{\njQuery('#request_action').hide();\njQuery('#imgs_load').show();\n$.ajax({\n url: \"http://gautambook.isprasoft.com/userprofile/user_unfriend\",\n async: false,\n type: \"POST\",\n data: \"users_id=\"+id,\n dataType: \"html\",\n success: function(data) { \n jQuery('#request_sent').html(data);\n\t jQuery('#'+id).hide();\n\t\tjQuery('#imgs_load').hide();\n\t\t\n }\n });\n\t\n}", "title": "" }, { "docid": "1d9362cd759c9efe1c6d40e5c1e605f7", "score": "0.50839424", "text": "function askToBeFriend(usrId, pseudo) {\n if (confirm('Envoyer une demande d\\'ami à ' + pseudo + ' ?')) {\n $j.post(\n '/friends/sendInvite', {\n 'usrId': usrId\n }, function(data) {\n $j('.msgInfo').css({'opacity' : '1'});\n $j('.msgInfo').animate({opacity:0}, 4000);\n if (data != 'Nok') {\n $j('.msgInfo').html(data);\n $j('.msgInfo').removeClass('msgInfoNok');\n $j('.msgInfo').addClass('msgInfoOk');\n } else {\n $j('.msgInfo').html('Error : demande pas envoyé');\n $j('.msgInfo').removeClass('msgInfoOk');\n $j('.msgInfo').addClass('msgInfoNok');\n }\n })\n }\n}", "title": "" }, { "docid": "5fe6766f20634e80edccbf343d8d3331", "score": "0.5083386", "text": "function alertUserToSocialChanges() {\n\t\t//$('#social-scripts2').html('<span class=\"warning\">Do you want to save your changes</span>');\t\n\t\t$(\"#edit-social\").text('Save Changes');\n\t\t$(\"#edit-social\").removeClass('btn btn-success');\n\t\t$(\"#edit-social\").removeClass('btn btn-info');\n\t\t$(\"#edit-social\").addClass('btn btn-warning');\n\t\t$(\"#edit-social\").fadeIn();\n\t\t}", "title": "" }, { "docid": "6d66239d0fb3d2ed149d285fc123f531", "score": "0.50775695", "text": "function displayFriends(req, res) {\n\n var id = req.session.current_id;\n\n models.getFriendsFromDb(id, function(error, result) {\n if (error || result == null) {\n res.status(500).json({success: false, data: error});\n }\n else {\n res.status(200).json(result);\n }\n });\n}", "title": "" }, { "docid": "c6c0d1e0b747a5e5b7507810a2213bef", "score": "0.50709605", "text": "function MenuCommands (){\r\n GM_registerMenuCommand('FBOnline: Show/Hide PopUp Friends', function(){\r\n if ((GM_getValue('ShowPopUp', true)) && (confirm('Hide online friends in place of Facebook Chat?'))) {\r\n GM_setValue('ShowPopUp', false);\r\n }\r\n else if ((!GM_getValue('ShowPopUp', true)) && (confirm('Show online friends in place of Facebook Chat?'))) {\r\n GM_setValue('ShowPopUp', true);\r\n }\r\n });\r\n GM_registerMenuCommand('FBOnline: Show/Hide Time', function(){\r\n if ((GM_getValue('ShowTime', true)) && (confirm('Hide Time next to friend?'))) {\r\n GM_setValue('ShowTime', false);\r\n }\r\n else if ((!GM_getValue('ShowTime', true)) && (confirm('Show Time next to friend?'))) {\r\n GM_setValue('ShowTime', true);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "3e9a7aad9f808882553d48e290323417", "score": "0.5069453", "text": "function renderFriend(doc) {\n let li = document.createElement(\"li\");\n\n let image = document.createElement(\"i\");\n let first_name = document.createElement(\"span\");\n let last_name = document.createElement(\"span\");\n let relation_to_client = document.createElement(\"span\");\n // New=============\n // li.setAttribute(\"data-id\", doc.id); //doc.id is the friends document id\n li.setAttribute(\"title\", doc.id); //doc.id is the friends document id\n\n li.setAttribute(\"class\", \"mdl-list__item\");\n li.setAttribute(\"id\", \"contact_entry\");\n li.setAttribute(\"onclick\", \"getFriendId(this.title)\");\n\n let del = document.createElement(\"div\");\n\n image.setAttribute(\"class\", \"material-icons mdl-list__item-icon\");\n\n first_name.setAttribute(\"style\", \"font-weight: bold;\");\n last_name.setAttribute(\"style\", \"padding-left:4px;font-weight: bold;\");\n relation_to_client.setAttribute(\"style\", \"padding-left:4px;\");\n\n image.textContent = \"person\";\n first_name.textContent = doc.data().first_name;\n last_name.textContent = doc.data().last_name + \",\";\n relation_to_client.textContent = doc.data().relation_to_client;\n\n li.appendChild(image);\n li.appendChild(first_name);\n li.appendChild(last_name);\n li.appendChild(relation_to_client);\n\n li.appendChild(del);\n\n friendsList.appendChild(li);\n}", "title": "" }, { "docid": "542e4b07b42cb705ab9ef3971ce93bd8", "score": "0.50684947", "text": "function addMenuButton()\n {\n createDialog();\n\n\n /*$(\".messages-toolbar\").find(\"ul\").eq(0).append('<li class=\"nav-item\"><button id=\"changeFavorits\" class=\"btn large btn-link\"\"><span data-v-8b7c5970=\"\" aria-hidden=\"true\"><i data-v-8b7c5970=\"\" class=\"icon icon-Aula_settings\"></i>Tilpas favoritter</span></button></li>');\n */\n $(\"label.collapsible\").prepend('<button id=\"changeFavorits\" class=\"btn large btn-link\"\" title=\"Tilpas Favoritter\"><span data-v-8b7c5970=\"\" aria-hidden=\"true\"><i data-v-8b7c5970=\"\" class=\"icon icon-Aula_settings\"> </i></span></button>');\n\n $(\"#changeFavorits\").button().on( \"click\", function() {\n var farvorits = GM_getValue(\"aula_user_favorits\",\"fornavnA efternavnA, fornavnB efternavnB\");\n $(\"#favorits_dialog\").val(farvorits);\n dialog.dialog( \"open\" );\n });\n\n\n \n }", "title": "" }, { "docid": "eea647ecaf466fa06fc14f662eb08f98", "score": "0.5065405", "text": "function markExisting(deviceFriends) {\n updateButton.textContent = deviceFriends.length === 0 ? _('import') :\n _('update');\n\n deviceFriends.forEach(function(fbContact) {\n var uid = serviceConnector.getContactUid(fbContact);\n // We are updating those friends that are potentially selectable\n delete selectableFriends[uid];\n var ele = document.querySelector('[data-uuid=\"' + uid + '\"]');\n // This check is needed as there might be existing FB Contacts that\n // are no longer friends\n if (ele) {\n setChecked(ele.querySelector('input[type=\"checkbox\"]'), true);\n }\n if (existingContactsByUid[uid]) {\n existingContactsByUid[uid].push(fbContact);\n } else {\n existingContactsByUid[uid] = [fbContact];\n }\n });\n\n var newValue = myFriends.length -\n Object.keys(existingContactsByUid).length;\n friendsMsgElement.textContent = _('fbFriendsFound', {\n numFriends: newValue\n });\n\n checkDisabledButtons();\n }", "title": "" }, { "docid": "a961cd20942d35414e191f71183161f0", "score": "0.5059591", "text": "function getToolbarButton(aFriend, aText, aButtonInfo) {\n var liButton =\n Utils.createElement('li', { id: 'litb-' + aText + '-nick-' + aFriend.nick });\n var button = Utils.createElementAt(liButton, 'button',\n {\n id: 'button-' + aText + '-nick-' + aFriend.nick,\n 'class': 'tc-button small' + (aButtonInfo.negative ? ' negative' : '')\n }, aText);\n button.addEventListener('click', aButtonInfo.getHandler(aFriend));\n return button;\n }", "title": "" }, { "docid": "feda47b44cbd9cf6c51660e00b21d9d3", "score": "0.5058161", "text": "function addClickActionTab(){\n document.getElementById(\"myTaball\").addEventListener(\"click\", function() {\n let div = document.getElementById(\"allusers_id\")\n let newdiv = `<div id=\"allusers_id\"></div>`\n if(div != null){\n div.remove()\n $(\"#allusers\").append(newdiv)\n }\n createListAllUsers()\n visitUsers()\n })\n document.getElementById(\"myTabfollowers\").addEventListener(\"click\", function() {\n let div = document.getElementById(\"followers_id\")\n let newdiv = `<div id=\"followers_id\"></div>`\n if(div != null){\n div.remove()\n $(\"#followers\").append(newdiv)\n }\n createListFollowers()\n visitUsers()\n })\n document.getElementById(\"myTabfollowing\").addEventListener(\"click\", function() {\n let div = document.getElementById(\"following_id\")\n let newdiv = `<div id=\"following_id\"></div>`\n if(div != null){\n div.remove()\n $(\"#following\").append(newdiv)\n }\n createListFollowing()\n visitUsers()\n })\n\n}", "title": "" }, { "docid": "6099346abb9f6f32c902c79416fc51c3", "score": "0.50503296", "text": "friendRequestedYou() {\n return this.props.auth.friendRequests.filter(user => user.spotifyId === this.props.user.spotifyId).length > 0;\n }", "title": "" }, { "docid": "3ee592bb7d957f4c2e050f49b6985e1b", "score": "0.5048471", "text": "function confirmation (selected) {\n selectedChoice = selected\n confirmationContainer.style.display = 'block'\n if (selectedChoice === '0') {\n confirmationAction.innerHTML = 'not '\n } else {\n confirmationAction.innerHTML = ''\n }\n\n yesButton.onclick = function () {\n if (errorFound) { // If there was an error, instead of executing the action, reports that there was an error\n var allErrors = errorLogs.join('-')\n completeField('0|Did not receive all needed data-' + allErrors)\n } else {\n executeAction()\n }\n }\n\n noButton.onclick = function () {\n clearAnswer()\n confirmationContainer.style.display = 'none'\n }\n} // End confirmtation", "title": "" }, { "docid": "cabf0d1355467f2d6e836cd4c6ad05de", "score": "0.5021861", "text": "function backBtnLogic() {\n if(addFriendScreen) {\n $(\"#backBtn, #friendInfo\").hide();\n $(\"#listOfFriends, #addFriends, #addFriend\").show();\n $(\"#pageTitle\").text(\"Add Friends\");\n isEventPage = false;\n }\n if(searchFriendScreen) {\n $(\"#backBtn, #friendInfo, #listOfFriends\").hide();\n $(\"#searchFriends\").show();\n $(\"#pageTitle\").text(\"Search Friends\");\n isEventPage = false;\n }\n if(viewFriendScreen) {\n $(\"#backBtn, #friendInfo, #listOfFriends\").hide();\n $(\"#listOfFriends\").show();\n $(\"#pageTitle\").text(\"View Friends\");\n isEventPage = false;\n }\n if(isEventPage) {\n isEventPage = false;\n }\n}", "title": "" }, { "docid": "1513530dd5950796b432450b963da14d", "score": "0.50158954", "text": "function updateModificationButtons() {\n // If no node or edge is selected, hide the mod buttons\n if (selectedItem == null) {\n $('#mod-buttons').hide(); \n }\n // Otherwise, show them\n else {\n $('#mod-buttons').show();\n // Show appropriate value in rename box\n if (selectedItem instanceof Node) {\n $('#rename-item').val(selectedItem.getLabel());\n }\n else if (selectedItem instanceof Edge) {\n $('#rename-item').val(selectedItem.getWeight()); \n }\n }\n }", "title": "" }, { "docid": "091ff8652df25df625f28b0a5817d76d", "score": "0.50079924", "text": "async function onFriendship (friendship) {\n console.log(\"onFriendShip event emit...\")\n\n try {\n const contact = friendship.contact() //获取联系人信息\n \n switch (friendship.type()) { \n \n // 1. receive new friendship request from new contact\n case Friendship.Type.Receive:\n // 获取验证信息\n console.log(`Request from ${contact.name()}:`, friendship.hello())\n\n // 校验验证信息\n if (!Validator.checkFriendConfirm(friendship.hello())) return\n\n // 通过请求\n let result = await friendship.accept()\n console.log(result)\n\n if (result) {\n console.log(`Request from ${contact.name()} is accept succesfully!`)\n } else {\n console.log(`Request from ${contact.name()} failed to accept!`)\n }\n\n break\n\n // 2. confirm friendship\n case Friendship.Type.Confirm: \n console.log(`new friendship confirmed with ${contact.name()}`)\n\n /**\n * reply image(qrcode image)\n */\n const fileBox1 = FileBox.fromFile('../web/public/images/reply.jpg')\n await contact.say(fileBox1) \n\n //await contact.say(\"欢迎使用曼泽愿望机器人!\")\n //await contact.say(\"只要您把常购买的商品链接分享给我,我就会给您定制一份属于您的购买愿望列表!\")\n //await contact.say(\"您可以随时把链接分享给亲人、朋友或发放到朋友圈!\")\n\n break\n }\n\n } catch (e) {\n console.error(e)\n }\n }", "title": "" }, { "docid": "0bbd63479609259505181fd5f2c3e5de", "score": "0.50058764", "text": "addToFriends(friend) {\n //console.log(\"current user name: \", this.props.name);\n axios({\n url: \"/userinfo/addfriend\",\n method: \"POST\",\n data: { friend: friend },\n })\n .then((response) => {\n // console.log(\"friend added successfully\", response);\n // alert(`${friend.name} has been added successfully!`);\n this.props.reloadComponentAction();\n })\n .catch((err) => {\n console.log(\"error while saving friend: \", err);\n });\n }", "title": "" }, { "docid": "90ea7d992a45dea5b94b7838aea273f0", "score": "0.50000757", "text": "function Friends()\n{\n\tvar classMeta = classes[ instances[ this.ooID ].classID ]\n\n\t// prevent cheating since we rely on ooID\n\t//\n\tif( this !== classMeta.Static )\n\n\t\treturn\n\n\n\tclassMeta.friends = [].concat( Array.prototype.slice.call( arguments, 0, arguments.length ) )\n}", "title": "" }, { "docid": "23edd436fa9c0ae883a669e60f81233b", "score": "0.49980924", "text": "function sendRequestSingle() {\n randNum = Math.floor ( Math.random() * friendIDs.length ); \n\n var friendID = friendIDs[randNum];\n\n FB.ui({\n method: 'apprequests',\n //Use the first friend returned\n to: friendID,\n message: 'Learn how to make your mobile web app social',\n }, function(response) {\n console.log('sendRequestSingle UI response: ', response);\n });\n}", "title": "" }, { "docid": "23edd436fa9c0ae883a669e60f81233b", "score": "0.49980924", "text": "function sendRequestSingle() {\n randNum = Math.floor ( Math.random() * friendIDs.length ); \n\n var friendID = friendIDs[randNum];\n\n FB.ui({\n method: 'apprequests',\n //Use the first friend returned\n to: friendID,\n message: 'Learn how to make your mobile web app social',\n }, function(response) {\n console.log('sendRequestSingle UI response: ', response);\n });\n}", "title": "" }, { "docid": "b471ddc8daaf8fd3e72c6fe28dc1d4b0", "score": "0.4996607", "text": "function FriendList(props){\n if(props.friends.length<1){\n return(<h1>No Data! Go get some friends.</h1>)\n }\n \n\n \n return(\n \n <div>\n {props.friends.map(friend=>\n <Friend \n {...props}\n friend={friend} \n // deleteFriend={props.deleteFriend} \n handleButtonClick={props.handleButtonClick} \n key={friend.id}/>)}\n </div>\n );\n}", "title": "" }, { "docid": "c84ebc72f7737957e732c42db0e95541", "score": "0.49931276", "text": "function profileViewedList(uid, token, apiBaseUrl, baseUrl, page, rowsPerPage, type, username) {\n\n if ($.trim(token).length < 1) {\n var rowsPerPage = 8;\n }\n\n var i = '';\n var j = '';\n var friendButton;\n var encodedata = JSON.stringify({\n \"uid\": uid,\n \"token\": token,\n \"page\": page,\n \"rowsPerPage\": rowsPerPage,\n \"username\": username\n });\n var url;\n if (token)\n url = apiBaseUrl + 'api/profileViewedList';\n else\n url = apiBaseUrl + 'api/publicProfileViewedList';\n\n ajaxPost(url, encodedata, function (data) {\n\n if (parseInt(type) > 0) /* Small Friend List */\n DIV = $(\"#userProfileViewList\")\n else\n DIV = $(\"#viewsList\")\n\n if (data) {\n if (data.profileViewedList.length) {\n var Follow = \"Follow\";\n var Following = \"Following\";\n var You = 'You';\n if ($.labelData) {\n Follow = $.labelData.buttonFollow;\n Following = $.labelData.buttonFollowing;\n You = $.labelData.buttonYou;\n }\n\n if (data.profileViewedList.length >= 8)\n $(\"#profilesViewAll\").fadeIn(\"slow\");\n\n $.each(data.profileViewedList, function (i, data) {\n\n if (parseInt(type) > 0) /* Small Friend List */ {\n i = '<li><a href=\"' + baseUrl + data.username + '\"><img src=\"' + data.profile_pic + '\" alt=\"people\" class=\"sFace\"/></a></li>';\n } else {\n\n if (data.role == 'fri') {\n friendButton = '<a href=\"#\" class=\"wallbutton removeButton\" id=\"remove' + data.uid + '\">' + Following + '</a>' +\n '<a href=\"#\" class=\"wallbutton addButton displaynone\" id=\"add' + data.uid + '\" ><i class=\"fa fa-plus\"></i>' + Follow + '</a>';\n } else if (data.role == 'me') {\n friendButton = \"<div id='you'>\" + You + \"!</div>\";\n } else {\n friendButton = '<a href=\"#\" class=\"wallbutton addButton \" id=\"add' + data.uid + '\" p=\"1\"><i class=\"fa fa-plus\"></i>' + Follow + '</a>' +\n '<a href=\"#\" class=\"wallbutton removeButton displaynone\" id=\"remove' + data.uid + '\">' + Following + '</a>';\n\n }\n\n\n i = '<div class=\"friendBlock\" rel=\"' + page + '\">' +\n '<div class=\"panel panel-default user-box\">' +\n '<div class=\"panel-body\">' +\n '<div class=\"media\">' +\n '<img src=\"' + data.profile_pic + '\" alt=\"people\" class=\"media-object img-circle pull-left\" />' +\n '<div class=\"media-body\">' +\n '<a href=\"' + baseUrl + data.username + '\" class=\"username\">' + data.name + '</a>' +\n '</div></div></div>' +\n '<div class=\"panel-footer\">' +\n friendButton +\n '</div></div></div>';\n }\n\n\n if (parseInt(type) > 0)\n DIV.append(i);\n else\n DIV.gridalicious('append', loadGrid(i));\n\n });\n\n\n\n } else {\n if (parseInt(type) > 0) {\n $(\"#recentProfileBlock_child\").html(\"No Recent Views\");\n } else {\n\n DIV.removeClass(\"scrollMore\").attr(\"rel\", \"0\");\n\n\n var NoViews = \"No visitors\";\n var NoMoreViews = \"No more visitors\";\n if ($.labelData) {\n NoViews = $.labelData.msgNoViews;\n NoMoreViews = $.labelData.msgNoMoreViews;\n }\n\n\n if (parseInt(page) > 1)\n $(\"#noRecords\").html(\"<div class='noDataMessage'>\" + NoMoreViews + \"</div>\");\n else\n $(\"#noRecords\").html(\"<div class='noDataMessage'>\" + NoViews + \"</div>\");\n\n\n }\n\n }\n\n } else\n $(\"#networkError\").show().html($.networkError);\n });\n}", "title": "" }, { "docid": "3d358165d32dff5251ef5cd54d557910", "score": "0.49892345", "text": "function showFriendInfo() {\n loadFriendInfo();\n facebookLog = friendDeets.facebook;\n addressLog = friendDeets.address;\n phoneLog = friendDeets.phone;\n emailLog = friendDeets.email;\n instagramLog = friendDeets.instagram;\n nameLog = friendDeets.friendNameIs;\n birthdayLog = friendDeets.birthday;\n notesLog = friendDeets.notes;\n placeOfOriginLog = friendDeets.from;\n workNameLog = friendDeets.workName;\n historyLog = friendDeets.history;\n if (birthdayLog !== '') {\n $(\"#birthdayText\").text(birthdayLog);\n } else {\n birthdayLog = 'MM/DD/YYYY';\n $(\"#birthdayText\").text(birthdayLog);\n }\n if (facebookLog !== '') {\n $(\"#facebookInfo\").html(\"Facebook: <a alt='\" + friendName + \"on Facebook' href='https://facebook.com/\" + facebookLog + \"'>https://facebook.com/\" + facebookLog + \"</a>\");\n } else {\n facebookLog = \"{{userID}}\";\n $(\"#facebookInfo\").html(\"Facebook: <a alt='\" + friendName + \"on Facebook' href='https://facebook.com/\" + facebookLog + \"'>https://facebook.com/\" + facebookLog + \"</a>\");\n }\n if (instagramLog !== '') {\n $(\"#instagramText\").text(instagramLog);\n } else {\n instagramLog = \"{{userID}}\";\n $(\"#instagramText\").text(instagramLog);\n }\n if (addressLog !== '') {\n $(\"#addressText\").text(addressLog);\n } else {\n addressLog = \"Street, City, State, Zip\";\n $(\"#addressText\").text(addressLog);\n }\n if (phoneLog !== '') {\n $(\"#phoneText\").text(phoneLog);\n } else {\n phoneLog = \"XXX-XXX-XXXX\";\n $(\"#phoneText\").text(phoneLog);\n }\n if (emailLog !== '') {\n $(\"#emailText\").text(emailLog);\n } else {\n emailLog = \"[email protected]\";\n $(\"#emailText\").text(emailLog);\n }\n if (notesLog !== '') {\n $(\"#notesText\").text(notesLog);\n }\n if (workNameLog !== '') {\n $(\"#workNameText\").text(workNameLog);\n }\n if (placeOfOriginLog !== '') {\n $(\"#placeOfOriginText\").text(placeOfOriginLog);\n }\n if (emailLog == '' && phoneLog == '' && addressLog == '' && facebookLog == '' && instagramLog == '' && birthdayLog == '' && notesLog == '' && workNameLog == '' && placeOfOriginLog == '') {\n alert (\"is Empty!\");\n } \n $(\"#friendCardName\").text(nameLog);\n}", "title": "" }, { "docid": "7afcbaf06ff2e094f21cbbdd8fea9a50", "score": "0.49885118", "text": "function showOwnProfileFields() {\n $('#editprofilebutton').fadeOut(0, function () {\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n $('#editpicturebutton').fadeOut(0, function () {\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n $('#mycollectionbutton').fadeOut(0, function () {\n $(this).css('display', 'inline-block').fadeIn(500);\n });\n $('#friendrequeststab').css(\"display\", \"inline-block\");\n $('#pendingfriendstab').css(\"display\", \"inline-block\");\n}", "title": "" }, { "docid": "d7279eccc9e10e05e7fad26ba4d75ee7", "score": "0.4986559", "text": "function createFriend(event) {\n event.preventDefault();\n getSurvey();\n showMatch();\n}", "title": "" }, { "docid": "52d0d6a08969e032668b6d33f619b2a3", "score": "0.49847567", "text": "function beginWolfFriend() {\n if (nodeListOfDivs[walker.index].classList.contains('wolf-friend')) {\n nodeListOfDivs[walker.index].classList.remove('walker-right', 'walker-left', 'walker-down', 'walker-up')\n nodeListOfDivs[walker.index].classList.add('chemin')\n nodeListOfDivs[walker.index].classList.remove('wolf-friend')\n nodeListOfDivs[walker.index].classList.add('walker-right')\n score = score + 5;\n displayScore.innerHTML = score;\n }\n }", "title": "" }, { "docid": "ca24f96db22f14dfc031bf38aabff831", "score": "0.49783182", "text": "function print_room_user_info() {\n $('#Room_player_div').empty();\n $.getJSON('/getFactions', function(factions) {\n $('#Room_player_div').append('<span id=\"Room_player_name\">' + user_logged.user_username + '</span>');\n $('#Room_player_div').append('<select id=\"Room_faction_selector\"></select>');\n var i;\n for(i = 0; i < factions.length; i++) {\n $('#Room_faction_selector').append('<option value=\"' + factions[i].faction_name + '\">' + factions[i].faction_name + '</option>');\n }\n $('#Room_player_div').append('<input id=\"Room_invite_friend_button\" type=\"button\" value=\"INVITE FRIEND\" onclick=\"javascript:invite_friend_button_behaviour()\"/>');\n });\n}", "title": "" }, { "docid": "f67e72f97f76b2fec65f8c9f5a9ab3d6", "score": "0.49764267", "text": "function addReceivedFriend(newfriendname) {\n\t\n\t$.getJSON(\"/addfriend/\", {jid: newfriendname}, \n\t\tfunction(data) {\n\t\t\t\n\t\t\t\n\t\t\tvar newfriendname = data.jid;\n\n\t\t\t// send a subscribed message\n\t\t\tacceptRequest(connection, my_user_name, newfriendname);\n\t\t\t// send a subscribe message\n\t\t\tsendRequest(connection, my_user_name, newfriendname);\n\t\t\t\n\t\t\t// Remove from the pending dialog table\n\t\t\t$('#pending-table tr[pendingname= \"' + newfriendname + '\"]').remove();\n\t\t\t$('#search-table tr[friendname=\"' + newfriendname + '\"] td:eq(2)').replaceWith('<td>' + '<button disabled=\"disabled\" type=\"button\"> Friends </button>' + '</td>');\n\t\t\t$.getJSON(\"/requests/\",\n\t\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\trefresh_pending_requests(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\n\t\t\n\t\t} \n\t);\n\t\n\n}", "title": "" }, { "docid": "3fc6d3fe95c667b10e4c8065917b1e9a", "score": "0.49704126", "text": "function respond_request(req_id,response)\n{\n\tvar file = \"Friend_Request_Update.php\";\n\tvar data = {requestor_id: req_id,accept: response};\n\tvar jqxhr = $.post(file,data,function(datafromserver)\n\t{\n\t\t//here we tell the user if his action has bee fulfilled\n\t\t$('#notify_actions').html(datafromserver);\n\t});\n\trefresh_lists();\n}", "title": "" }, { "docid": "60db884981b99dc588d4688a88c65a0d", "score": "0.4969204", "text": "function handleCardHello(cmd){\n //TODO: indefinite waiting modal show until this point\n let friendsHere = Object.values(cmd.friendsHere);\n let friendListing = $('#user-icon-container');\n //Create a display icon for each connected user\n for(let i = 0; i < friendsHere.length; i++){\n let thisFriend = friendsHere[i];\n if(thisFriend === null){\n continue;\n }\n //Set this user data to the local connected client array\n users[thisFriend.id] = {\n uid : thisFriend.uid,\n username : thisFriend.username,\n initials : thisFriend.initials,\n color : thisFriend.color\n };\n //Create connected user icon\n let thisFriendIcon = getUserIcon(thisFriend);\n thisFriendIcon.appendTo(friendListing);\n }\n}", "title": "" }, { "docid": "5ef83b8845c98598f3aaf2f14075f7f8", "score": "0.49691755", "text": "function displayButtons() {\n if (yourActions.includes(\"check\")) {\n document.getElementById(\"check\").classList.remove('hidden');\n }\n else {\n document.getElementById(\"check\").classList.add('hidden');\n }\n\n if (yourActions.includes(\"call\")) {\n document.getElementById(\"call\").classList.remove('hidden');\n } \n else {\n document.getElementById(\"call\").classList.add('hidden');\n }\n\n if (yourActions.includes(\"fold\")) {\n document.getElementById(\"fold\").classList.remove('hidden');\n }\n else {\n document.getElementById(\"fold\").classList.add('hidden');\n }\n\n if (yourActions.includes(\"bet\")) {\n document.getElementById(\"bet\").classList.remove('hidden');\n }\n else {\n document.getElementById(\"bet\").classList.add('hidden');\n }\n\n if (yourActions.includes(\"raise\")) {\n document.getElementById(\"raise\").classList.remove('hidden');\n }\n else {\n document.getElementById(\"raise\").classList.add('hidden');\n }\n\n if (yourActions.includes(\"allIn\")) {\n document.getElementById(\"allIn\").classList.remove('hidden');\n }\n else {\n document.getElementById(\"allIn\").classList.add('hidden');\n }\n }", "title": "" }, { "docid": "88d2320c4429af8835050b7a7ac6fd3b", "score": "0.49662355", "text": "function handlePermission(permission) {\n\t\t // set the button to shown or hidden, depending on what the user answers\n\t\t if(Notification.permission === 'denied' || Notification.permission === 'default') {\n\t\t // notificationBtn.style.display = 'block';\n\t\t } else {\n\t\t // notificationBtn.style.display = 'none';\n\t\t }\n\t \t}", "title": "" }, { "docid": "31b9ca2e9ffc47737344e4786e36cdb1", "score": "0.49585414", "text": "addOrRemove(friend) {\n if (this.isAdded(friend)) {\n this.remove(friend);\n }\n else {\n this.add(friend);\n }\n }", "title": "" }, { "docid": "b326dafd5c6841ac8ad88a834a072b40", "score": "0.49564454", "text": "function renderFriendsEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"No Friends Resources to display.\");\n container.append(alertDiv);\n }", "title": "" }, { "docid": "fbe8a95e228eb47168d357f151fe3dc0", "score": "0.49451423", "text": "function toggleFormButtons() {\n\t\tjQuery('.user__info__edit--edit, .user__info__edit--save, .user__info__edit--cancel')\n\t\t\t.toggleClass('hidden');\n\t}", "title": "" }, { "docid": "38449a6bc2976dbe487290577c849c7f", "score": "0.49395025", "text": "function showhidebuttons(cur_id){\n\t\n\tvar full_ID = $('#verified_status_' + cur_id).val();\n\tif(full_ID == 1){\n\t\t//$('#add_button').show();\n\t\t$('#update_button').hide();\n\t}\n\telse {\n\t\t//$('#add_button').hide();\n\t\t$('#update_button').show();\n\t}\n\t\n}", "title": "" }, { "docid": "dafb253386ae9fcaf0da5d4ed5c44c19", "score": "0.49393764", "text": "showActionButtons() {\r\n this.hideDigScrapeButtons();\r\n this.hideStopButton();\r\n\r\n try {\r\n this.doc.getElementById(C.ELEMENT_ID.ACTION_HOLDER).style.display = C.CSS_V.DISPLAY.BLOCK;\r\n this.doc.getElementById(C.ELEMENT_ID.GET_ALL_JPG_OPTS).focus();\r\n }\r\n catch(error) {\r\n this.lm('Could not show action buttons. doc maybe is a Dead Object.');\r\n }\r\n }", "title": "" }, { "docid": "c23cf4db8a0a28e91221fef4f004538f", "score": "0.4933571", "text": "function doAction(type, profileid, button) {\r\n var correctMap = {\r\n 'Wink': 'winks',\r\n 'Email': 'messages',\r\n 'Gift': 'gift',\r\n 'Request-Photos': 'photorequest',\r\n 'Favourite': 'favourite',\r\n 'Block': 'block',\r\n 'Report': 'report'\r\n };\r\n if (correctMap[type]) type = correctMap[type];\r\n var url = '/action/' + type + '/' + profileid;\r\n if ($(button).attr('disabled') == 'disabled') return;\r\n $.getJSON(url, function (obj) {\r\n })\r\n .success(function (obj) {\r\n try {\r\n if (obj.alert) {\r\n showAlert(obj.alert);\r\n }\r\n else {\r\n showAlert(obj);\r\n\r\n //Check if button is Icon or Content-button\r\n $(button).attr('disabled', 'disabled');\r\n $(button).find('img').attr('disabled', 'disabled');\r\n\r\n //Icon:\r\n $(button).find('img').css('opacity', '0.3');\r\n }\r\n\r\n } catch (ex) {\r\n }\r\n });\r\n}", "title": "" }, { "docid": "d151692c6ab20db00e757a424277d457", "score": "0.49270248", "text": "function repopulate_pending_requests(data) {\n\t\n\t// Parse the JSON\n\t//data = jQuery.parseJSON(data);\n\t// clear pending table\n\t$('#pending-table tr').remove();\n\t$('#pending-table-rooms tr').remove();\n\t\n\tif ($(\"#subscribe_dialog\").length <= 0) {\n\t\tcreate_pending_requests_dialog();\n\t}\n\t\n\t\n\tif(data.friend_requests.length == 0 && data.room_invites.length == 0) {\n\t\t//change image to plain envelope\n\t\t$('#pending_requests_img_div').html('<a id=\"ttip3\" rel=\"tooltip\" title=\"Requests\"><img id=\"pending_requests_img\" class=\"friends_button\" src=\"/static/imgs/pending_envelope.png\" height=25px onclick=\"open_pending_requests()\" style=\"padding: 2px 5px 2px; position:relative; top:-3px; border: 1px solid #F2F2F2;\"></img></a>');\n\t\t\n\t\t$('#ttip3').tooltip({\n\t\t\t'placement':'top',\n\t\t\t'delay': { 'show': 700, 'hide': 100 }\n\t\t});\n\t\n\t}\n\telse {\n\t\t// change image to exclamation envelope\n\t\t\n\t\t$('#pending_requests_img_div').html('<a id=\"ttip3\" rel=\"tooltip\" title=\"Requests\"><img id=\"pending_requests_img\" class=\"friends_button\" src=\"/static/imgs/pending_envelope_exclamation.png\" height=25px onclick=\"open_pending_requests()\" style=\"padding: 2px 5px 2px; position:relative; top:-3px; border: 1px solid #F2F2F2;\"></img></a>');\n\t\n\t\t$('#ttip3').tooltip({\n\t\t\t'placement':'top',\n\t\t\t'delay': { 'show': 700, 'hide': 100 }\n\t\t});\n\t\n\t}\n\t\n\t\n\t$('.friends_button').hover(\n\t\tfunction() {\n\t\t\t$(this).addClass('btn');\n\t\t\t$(this).css({'border' : '1px solid #cccccc'});\n\t\t},\n\t\tfunction() {\n\t\t\t$(this).removeClass('btn');\n\t\t\t$(this).css({'border' : '1px solid #F2F2F2'});\n\t\t}\n\t);\n\t\n\t\n\t// For every request, create a row\n\tfor(var i = 0; i < data.friend_requests.length; i++) {\n\t\t\n\t\tvar sender_jid = data.friend_requests[i].creator;\n\t\t\n\t\t$.getJSON('/vcard/', {jid: sender_jid}, \n\t\t\tfunction(data) {\n\t\t\t\t\t\t\t\n\t\t\t\tFirstName = data.first_name;\n\t\t\t\tLastName = data.last_name; \n\t\t\t\tvar newrow = '<tr pendingname= \"' + sender_jid + '\">' +\n\t\t\t\t'<td>' + FirstName + ' ' + LastName + '</td>' +\n\t\t\t\t'<td>' + \"<input type='button' value='Accept' onclick='addReceivedFriend(\\\"\" + sender_jid + \"\\\")'/>\" + '</td>' +\n\t\t\t\t'<td>' + \"<input type='button' value='Reject' onclick='RejectFriend(\\\"\" + sender_jid + \"\\\")'/>\" + '</td>' +\n\t\t\t\t'</tr>';\n\t\t\t\t$(\"#pending-table\").append(newrow);\n\t\t\t\t\n\t\t\t}\n\t\t);\n\t\t\n\t\t\n\t\t\n\t}\n\t\n\tfor(var i = 0; i < data.room_invites.length; i++) {\n\t\tvar newrow = '<tr pendingname= \"' + data.room_invites[i].room_name + '\">' +\n\t\t'<td>' + data.room_invites[i].room_name + '</td>' +\n\t\t'<td>' + \"<input type='button' value='Accept' onclick='AcceptReceivedChatroomInvite(\\\"\" + data.room_invites[i].room_jid + \"\\\")'/>\" + '</td>' +\n\t\t'<td>' + \"<input type='button' value='Reject' onclick='RejectReceivedChatroomInvite(\\\"\" + data.room_invites[i].room_jid + \"\\\")'/>\" + '</td>' +\n\t\t'</tr>';\n\t\t$(\"#pending-table-rooms\").append(newrow);\n\t}\n\n\t//$('#subscribe_dialog').dialog('open');\t\n\n\t// Add room requests to the pending table\n\t//$.get('/room/requests/', function(data) {addPendingChatroomInvites(data) });\n}", "title": "" }, { "docid": "d0d889d9018443ae111d6abaf4a8a05d", "score": "0.49186116", "text": "function createConfirmForm(){\n confirmForm.appendForm(\n $('#wrraper'),\n [\n {\n id : 'yes',\n class : 'btn btn-primary',\n name : 'Yes',\n action : deleteUser\n },\n {\n id : 'no',\n class : 'btn btn-primary',\n name : 'No',\n action : function(e){\n e.preventDefault();\n confirmForm.hide();\n }\n }\n ],\n 'div'\n );\n }", "title": "" }, { "docid": "6cc7c0970526d6c31a6af5ad044f1c4c", "score": "0.49164528", "text": "function showFriendsInList() {\n if(getFriends.length == 0) { //if there are no objects in the arrray, show message\n $(\"#noFriendsList\").show();\n } else {\n $(\"#noFriendsList\").hide();\n // checkForBirthdays();\n for (var k = 0; k < getFriends.length; k++) { // otherwise show list of friends\n ref.child(userName + \"/friend/\" + getFriends[k]).update({\n friendNumber: friendCount\n });\n $(\"#friendsList\").append(\"<li class='list-group-item friendItem' data-friendnumber='\"+friendCount+\"' data-friendname='\" + getFriends[k] + \"'><a href='#' class='friendLink' id=''>\" + getFriends[k] + \"</a><button class='btn btn-danger btn-xs removeButton' id=''> Remove </button></li>\");\n\n // \n // Increase friend counter so we can give each friend a unique data-friendnumber\n friendCount++;\n }\n }\n}", "title": "" }, { "docid": "641c467755fea35cea48f9582f926ffa", "score": "0.4911814", "text": "function actionsHtml(data, type, full, meta) {\n var actions = \"<input class='pointer' type='checkbox' ng-click='vm.toggleMemberCheck(\" + data.memberid + \")'\";\n actions += (data.statusflg == 0) ? \"ng-checked=' vm.checkedMembers.indexOf(\" + data.memberid + \") != -1'\" : \"\";\n actions += (data.statusflg == 0) ? \">\" : \" disabled>\";\n actions += \"&nbsp;&nbsp;&nbsp;<i class='fa fa-pencil fa-lg pointer' ng-click='vm.updateMember(\" + data.memberid + \")'></i>\";\n\n //return checkbox for the specific row\n return actions;\n }", "title": "" }, { "docid": "eab0de558d57ab6a1af5b3f3a154ad6f", "score": "0.49116647", "text": "function loadFriendInfo() {\n if (typeof (sv[userName].friend) != \"undefined\") {\n getFriends = Object.keys(sv[userName].friend);\n // grab the name of the selected friend\n var this1 = $(\".friendItem.active a\").text();\n if (searchFriendScreen) {\n this1 = $(\"#searchFriendsText\").val();\n }\n friendDeets = sv[userName].friend[this1];\n }\n}", "title": "" }, { "docid": "9d8e17b0ed4186eae53ae284e9ae58b7", "score": "0.49109173", "text": "_getHeaderButtons() {\n let buttons = super._getHeaderButtons();\n // Token Configuration\n const canConfigure = game.user.isGM || this.actor.owner;\n if (this.options.editable && canConfigure) {\n buttons = [\n {\n label: game.i18n.localize('SWADE.Tweaks'),\n class: 'configure-actor',\n icon: 'fas fa-dice',\n onclick: (ev) => this._onConfigureEntity(ev),\n },\n ].concat(buttons);\n }\n return buttons;\n }", "title": "" }, { "docid": "cacc6d9a63a4d87df412a104fac403e1", "score": "0.49001873", "text": "function notifyFriend() {\n jsondata.username = localStorage.username;\n jsondata.friend = localStorage.friend;\n jsondata.status = \"pending friend\";\n jsondata.friendstatus = \"pending\";\n jsondata.groupstatus = \"disabled\";\n jsondata.group = \"Group_\" + localStorage.username;\n\n $.ajax({\n type: 'POST',\n data: JSON.stringify(jsondata),\n contentType: 'application/json',\n url: '/friends',\n success: function (response) {\n\n if (response == \"200\") {\n alert(\"You have invited:\" + jsondata.friend + \" for friendship\");\n citizenFriendReport(localStorage.username)\n window.location.href = \"/invitingfriendpage\";\n } else {\n alert(\"The invitation has not been done successfully try again:\" + response);\n }\n\n\n },\n error: function (error) {\n alert(\"Alert:\" + error);\n }\n });\n\n\n\n\n}", "title": "" } ]
601ba7169c1bb209c5c0233654c61b32
Show & Hide Modal
[ { "docid": "d94255b03f4d6291f25d92e6a0ea6289", "score": "0.0", "text": "function hideModal() {\n document.body.style.overflowY = 'auto';\n modal.hidden = true;\n}", "title": "" } ]
[ { "docid": "9de66b77db3ad962bfe4e93c20f926ae", "score": "0.78207153", "text": "function show() {\n $$invalidate('modalIsVisible', modalIsVisible = true);\n }", "title": "" }, { "docid": "cdd9248545bc7e502e10c99cd103fcdc", "score": "0.7753842", "text": "function attShowModal() {\n setShowModal(!showModal);\n }", "title": "" }, { "docid": "cb8ac07ce8e8ccac723109d02ec80288", "score": "0.7659536", "text": "function showModal()\n{\n\tdocument.getElementById('modal-backdrop').classList.toggle('hidden');\n\tif(document.getElementById('leave-comment-modal')) {\n\t\tdocument.getElementById('leave-comment-modal').classList.toggle('hidden');\n\t}\n\tif(document.getElementById('create-location-modal')) {\n\t\tdocument.getElementById('create-location-modal').classList.toggle('hidden');\n\t}\n}", "title": "" }, { "docid": "a9c83a9a537fb780b914ad7ba083d6ee", "score": "0.7490103", "text": "function show () {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "7ff51ed74b0834180e6e733e713a9df4", "score": "0.7454143", "text": "show(){\n\t\tthis.modalShadow.show();\n\t\tthis.modalBody.show();\n\t}", "title": "" }, { "docid": "b6793c4dd3231d049cd97684eb237bf3", "score": "0.7416397", "text": "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "title": "" }, { "docid": "d2538af4f2aff6a628d9a8f2c9465384", "score": "0.7348045", "text": "function showModal() {\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t \tshowContractEndDateSelect();\n\t\t \tshowHidePassword();\n\t\t \tshowHideConfirmPassword();\n\t\t }", "title": "" }, { "docid": "e202cb9f202d1d79a0b79c49056086a2", "score": "0.7313581", "text": "function __BRE__show_modal(modal_id){$('#'+modal_id).modal('show');}", "title": "" }, { "docid": "443e6a1be024af4fb966445950f55f3d", "score": "0.72997075", "text": "function hideModal() {\n vm.modalVisible = false;\n }", "title": "" }, { "docid": "443e6a1be024af4fb966445950f55f3d", "score": "0.72997075", "text": "function hideModal() {\n vm.modalVisible = false;\n }", "title": "" }, { "docid": "63b8ad7bb66a25b0f17bc59b6b7c8588", "score": "0.72708094", "text": "modalHide(myModal) {\n myModal.style.display = \"none\";\n player.choosePlayer();\n }", "title": "" }, { "docid": "a42ae580d3e76f699a7a2c6bc29a638a", "score": "0.7228196", "text": "function toggle() {\r\n setModal(!modal)\r\n }", "title": "" }, { "docid": "311cfdc7706717b12828c8432620ff59", "score": "0.71902865", "text": "function modalOpen() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "aaadea6ed67a27d5cb8205a4dd67e96e", "score": "0.71816534", "text": "function onShowBsModal() {\n isModalInTransitionToShow = true;\n isModalVisible = true;\n }", "title": "" }, { "docid": "a8af411d59a036a786f6e1de73327e52", "score": "0.71773946", "text": "function showModal({ isEditMode }) {\n seIsEditMode(isEditMode);\n setIsVisible(true);\n }", "title": "" }, { "docid": "fab15c4f812070802977458aac9a931e", "score": "0.7172872", "text": "toggleModal () {\n\t\tthis.model.toggleModalState();\n\t\tthis.view.toggleModal( this.model.isModalOpen )\n\t}", "title": "" }, { "docid": "5723ab0144b0268eade8c176c0cd5db2", "score": "0.7171715", "text": "function openModal() {\nelModal.style.display = 'block';\n}", "title": "" }, { "docid": "5d02c7e2c4289a8a9c313d05fdf6619e", "score": "0.7166311", "text": "function openModal() { \n modal.style.display = 'block';\n }", "title": "" }, { "docid": "9d1e551c7a1d2b78fa32709c9ce331a5", "score": "0.7159109", "text": "function show_modal() {\n \t$('#promoModal').modal();\n }", "title": "" }, { "docid": "e827ca3a2640f5764575c93029046598", "score": "0.71526426", "text": "function openModal() {\n modal.style.display = 'block';\n }", "title": "" }, { "docid": "e827ca3a2640f5764575c93029046598", "score": "0.71526426", "text": "function openModal() {\n modal.style.display = 'block';\n }", "title": "" }, { "docid": "3d2c5ee76e95e7616076fb8d0fada7aa", "score": "0.7139386", "text": "function openModal(){\r\n modal.style.display = 'block';\r\n }", "title": "" }, { "docid": "29be79b827f1439825c80110883f1504", "score": "0.7126328", "text": "function esconderModal() {\n\tmodal.style.display = 'none';\n}", "title": "" }, { "docid": "63ee94eab422a58c5c1b85be3d45a548", "score": "0.7104036", "text": "function show() {\n document.getElementById('myModal').style.display = \"block\";\n}", "title": "" }, { "docid": "15f095f4a71b6c419d81b74551379071", "score": "0.7097289", "text": "function showModal() {\n\tvar btnShowModal = $('.button-show-modal');\n\tif (btnShowModal.length > 0) {\n\t\tbtnShowModal.bind('click', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar modalTarget = $(this).data('target-modal');\n\t\t\tvar package = $(this).data('option');\n\n\t\t\tif (modalTarget.length > 0) {\n\t\t\t\t$(modalTarget).addClass('show');\n\n\t\t\t\tif ($(modalTarget).hasClass('show')) {\n\t\t\t\t\tchangeValueOptionInForm(package);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "5f728e07d616e365e659beb1d0a1c97f", "score": "0.7096224", "text": "function show() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "title": "" }, { "docid": "76991009f522235a8a00893e88d0654e", "score": "0.70918447", "text": "function openModal() {\r\n\t\t\tdocument.getElementById('myModal').style.display = \"block\";\r\n\t\t}", "title": "" }, { "docid": "0582b18e626d166fd9cef1890e189920", "score": "0.7061848", "text": "function openModal () {\n modal.style.display = 'block';\n }", "title": "" }, { "docid": "7054031d0106504498ab577c8b04f38b", "score": "0.70507056", "text": "function showModal() {\n debug('showModal');\n if (!modal.ready) {\n initModal();\n modal.anim = true;\n currentSettings.showBackground(modal, currentSettings, endBackground);\n } else {\n modal.anim = true;\n modal.transition = true;\n currentSettings.showTransition(modal, currentSettings, function(){endHideContent();modal.anim=false;showContentOrLoading();});\n }\n }", "title": "" }, { "docid": "e2eec8ed7883149f823cece0284b9152", "score": "0.70503646", "text": "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n }", "title": "" }, { "docid": "a6e19a57950dbe8a0216ab65008895b9", "score": "0.70414215", "text": "function openModal(){\n modal.style.display = 'block';\n }", "title": "" }, { "docid": "539977cd5d9f29954d41d302e47d7e23", "score": "0.7011816", "text": "setModalShowOrHide() {\r\n this.setState({\r\n showModal: !this.state.showModal\r\n })\r\n }", "title": "" }, { "docid": "e214dce572a7e0c8a727b13c6421d954", "score": "0.7009131", "text": "function openModal(myModal) {\n myModal.style.display = \"block\";\n }", "title": "" }, { "docid": "b8248f81271278d3edef55931f34d41f", "score": "0.70088565", "text": "function showModal(btnClass, modalWindow) {\n $(btnClass).on('click', function() {\n\n if ($(modalWindow).is(':hidden') == true) {\n $(modalWindow).fadeIn();\n } else if ($(modalWindow).is(':hidden') == false) {\n $(modalWindow).fadeOut();\n }\n\n });\n}", "title": "" }, { "docid": "82cb05576358ed35b8e966b259c5c74e", "score": "0.7005918", "text": "function showModal() {\n $('#modal-container').show(\"fold\", 1000);\n}", "title": "" }, { "docid": "e2aad6518bd1346645264f4190e94b7d", "score": "0.6997294", "text": "function openModal(){\r\n modal.style.display = 'block';\r\n}", "title": "" }, { "docid": "1c47644579631c02be59de4b39efe96e", "score": "0.6993886", "text": "function openModal3(){\n modal3.style.display = 'block';\n}", "title": "" }, { "docid": "61fd5dec328848e2556fe912b00813b5", "score": "0.6993095", "text": "function openModal() {\n modal3.style.display = 'block'; \n}", "title": "" }, { "docid": "61d551fa3daf80f77d73db634672f719", "score": "0.6991703", "text": "function openModal(e) {\n\tmodal.style.display = 'block'\n}", "title": "" }, { "docid": "4384cdaf2bb602b5fcfbb4a19d47ff4e", "score": "0.69913757", "text": "function openModal() {\n document.getElementById('myModal').style.display = \"block\";\n }", "title": "" }, { "docid": "abc9fe309fd340d6624661416588dfe7", "score": "0.6984455", "text": "function openModal() {\r\n modal.style.display = 'block';\r\n}", "title": "" }, { "docid": "67b928ba9845b804d835be17eec9413b", "score": "0.6977289", "text": "function openModal() {\r\n modal.style.display = \"block\";\r\n}", "title": "" }, { "docid": "a184611892b1569512ebbd132161db6a", "score": "0.6972417", "text": "function openModal(){\r\n modal.style.display = 'block';\r\n}", "title": "" }, { "docid": "eddf59411af69ea927455acf6fb63626", "score": "0.6962405", "text": "function show() {\n loadingModal.show();\n }", "title": "" }, { "docid": "7814c54ed90c69cf2a8ff77c585d11f8", "score": "0.69588506", "text": "function changeModal(id){\n\t\tif(!$(id).is(':visible')){\n\t\t\t$('[data-role=\"modal_page\"]').hide();\n\t\t\t$(id).fadeIn();\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "2a72f292fefd44c86119abf61d4e478d", "score": "0.6953467", "text": "function openModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "13c2a3f446a53545200d46204526a26e", "score": "0.6951832", "text": "function openModal () {\n //chnge the display value to block\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "f3d60d81de5817352aa98027f8143464", "score": "0.69471234", "text": "function toggleModal() {\n\n let form = document.getElementById('editModal');\n if (form.style.display === 'none') form.style.display = 'block';\n else form.style.display = 'none';\n}", "title": "" }, { "docid": "31a02ac45669ccc902be23dea703b682", "score": "0.6945401", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "31a02ac45669ccc902be23dea703b682", "score": "0.6945401", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "5f27a68cd97df34ea96deda6c561bd75", "score": "0.69445986", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "5f27a68cd97df34ea96deda6c561bd75", "score": "0.69445986", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "5f27a68cd97df34ea96deda6c561bd75", "score": "0.69445986", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "5f27a68cd97df34ea96deda6c561bd75", "score": "0.69445986", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "5f27a68cd97df34ea96deda6c561bd75", "score": "0.69445986", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "7eb39c74a82ead71457b5102d027eb3f", "score": "0.69427603", "text": "function openModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "870ca63f147ea91f12aec0a16e702454", "score": "0.69411355", "text": "function showModal() {\n $(\"#exampleModal\").modal();\n }", "title": "" }, { "docid": "51fc10121e9171fe2b4ebec36b2dcc81", "score": "0.6937854", "text": "function openModalEdit() {\n modalEdit.style.display = \"block\"\n }", "title": "" }, { "docid": "e14e7667538e053f3cbadd0c255ee754", "score": "0.69377446", "text": "function showModal() {\r\n\t\tdebug('showModal');\r\n\t\tif (!modal.ready) {\r\n\t\t\tinitModal();\r\n\t\t\tmodal.anim = true;\r\n\t\t\tcurrentSettings.showBackground(modal, currentSettings, endBackground);\r\n\t\t} else {\r\n\t\t\tmodal.anim = true;\r\n\t\t\tmodal.transition = true;\r\n\t\t\tcurrentSettings.showTransition(modal, currentSettings, function(){endHideContent();modal.anim=false;showContentOrLoading();});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "5cda22eb3876cc7cd7787daf48a277db", "score": "0.69364995", "text": "function openModal () {\n modal.style.display = 'block'\n}", "title": "" }, { "docid": "95f1a47f55e7037856a36cee301ff4c1", "score": "0.6932026", "text": "function showChangeNameModule() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "bc2bf12ee0692a67b87112485fd60d81", "score": "0.6925868", "text": "function showModal() {\n\t\ttimer.className = 'modalTimer' ;\n\t\tmodal.className = 'modal-visible' ;\n\t}", "title": "" }, { "docid": "d546d1900abaa16477b88c6fa5c33593", "score": "0.69231707", "text": "activateModal() {\n\t\tdocument.getElementById('logout').style.display = 'none';\n\t\tdocument.querySelector('#login-modal').style.display = 'block';\n\t}", "title": "" }, { "docid": "b9d4d2170a7cb771ba545cd31bce5c57", "score": "0.6920867", "text": "function showModal(modalId, display = 'block') {\n document.getElementById(modalId).style.display = display;\n}", "title": "" }, { "docid": "bd6f866103bb6adb7ff1e933d1e523df", "score": "0.69192487", "text": "function modalWindow() {\n $(\"#modal\").css('display', 'block');\n }", "title": "" }, { "docid": "2fe586d8b393fbe3d9d4963ac1228684", "score": "0.6917007", "text": "function showModal(id) {\n if (id in modals) {\n modals[id].show();\n }\n }", "title": "" }, { "docid": "6d74090f04a2cad18f892c0fcb2c50ac", "score": "0.69124573", "text": "function openModal(){\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "e52163817b98ad7f7a496980b41796b9", "score": "0.69106066", "text": "function openModal(){\n modal.style.display = 'block'; \n}", "title": "" }, { "docid": "0ade137aef9e58cfa4ef05252dbbf5ee", "score": "0.6904943", "text": "function openModal(){\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "e16df8775384ca3c484ae93690582f96", "score": "0.69047517", "text": "showModal() {\n $('.modal').modal('show');\n }", "title": "" }, { "docid": "878c28f9019db9f121b581e55ef217b2", "score": "0.6904291", "text": "function openChooseModal() {\n var chooseModal = document.getElementById(\"chooseModal\");\n\n chooseModal.style.display = \"block\";\n}", "title": "" }, { "docid": "42205ce307c0c903348f3a2cd75cb71a", "score": "0.6902578", "text": "handleShowModal() {\n this.showSpinner = true;\n this.template.querySelector(\"c-modal-component-template\").show();\n }", "title": "" }, { "docid": "ac8620f4673de6de10bfa3a659b4eb2a", "score": "0.6898056", "text": "function openModal() {\r\n\tmodal.style.display = 'block';\r\n}", "title": "" }, { "docid": "c99e04668927919df19825e4e001b571", "score": "0.68974626", "text": "function openModal3() {\n modal3.style.display = 'block';\n }", "title": "" }, { "docid": "c99e04668927919df19825e4e001b571", "score": "0.68974626", "text": "function openModal3() {\n modal3.style.display = 'block';\n }", "title": "" }, { "docid": "6ab015063ffd80cbe595145b8fc35546", "score": "0.6895765", "text": "function showModal() {\n if (this.getAttribute(\"id\") === \"settings-btn\") {\n document.getElementById('settings-modal').style.display = 'block';\n }\n if (this.getAttribute(\"id\") === \"how-btn\") {\n document.getElementById('how-modal').style.display = 'block';\n }\n}", "title": "" }, { "docid": "24cfcdd33d48085fcfa06598f6d3f0bd", "score": "0.6890049", "text": "function openModal4(){\n modal4.style.display = 'block';\n}", "title": "" }, { "docid": "cef64fd94e6f50bcc959b2325f558ccb", "score": "0.68880445", "text": "showModal() {\n this.isModalOpen = true;\n }", "title": "" }, { "docid": "74d2a65331ee412033836b1fa35681e7", "score": "0.6881496", "text": "function hideModal() {\n modal.style.display = \"none\";\n}", "title": "" }, { "docid": "c1757eb11e3ffbeea07f989c86bf7840", "score": "0.68717355", "text": "function btnOnclick(){\r\n\tmodal.style.display = \"block\";\r\n}", "title": "" }, { "docid": "28ae82b725a5eb815289c4e3aa6309d5", "score": "0.68638664", "text": "function openModal(){\n\t\n\tmodal.style.display = 'block';\n\t\n}", "title": "" }, { "docid": "752aa990a1933fbd8fe5b7aa9f95aae7", "score": "0.68637913", "text": "function showThanks() {\n\t\t\t$(\"#IP-head-reg\").modal('hide');\n\t\t\t$('#post-sub').modal('show');\n\t\t}", "title": "" }, { "docid": "42cb661843ddc7cc3b0f1b2cb692ee70", "score": "0.68634915", "text": "function setModal() {\n $('.overlay').fadeIn('slow');\n $('.modal').slideDown('slow');\n }", "title": "" }, { "docid": "9562a0e06f6759fe0751aac73fe709b0", "score": "0.686174", "text": "function show_modal() \n{\n $('#myModal').modal();\n}", "title": "" }, { "docid": "04e3009cb91f9f411a1d2db8551db451", "score": "0.686123", "text": "function showModal(){\r\n let modal=document.getElementsByClassName(\"modal\")[0];\r\n modal.style.display = \"block\";\r\n }", "title": "" }, { "docid": "392b6688e7a04f05cefef566a3e8a204", "score": "0.6856062", "text": "function hideModal() {\n instructions.style.display = 'none';\n showButton.style.display = 'inline';\n}", "title": "" }, { "docid": "f23ea31cc6fc61729abc313ce9425b54", "score": "0.6854022", "text": "modify () {\n\n // Hide modal\n this.modal.hide();\n }", "title": "" }, { "docid": "ccfded8d8f7700a3511f13adc4513e82", "score": "0.6850218", "text": "function toggleModal() {\n modal.classList.toggle(\"show-modal\");\n }", "title": "" }, { "docid": "d94aa49fd89e7e42137e9e46c877f49f", "score": "0.68384033", "text": "toggleModal({commit}, show) {\n commit(\"toggleModal\", show);\n }", "title": "" }, { "docid": "8d8749573e230d84d8b8a1144e15a80d", "score": "0.68332666", "text": "function affiche(name) {\n modal = document.getElementById(name);\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "8bbfab35c38a13b0fede08aef7955b24", "score": "0.6831776", "text": "function modalShown(o){\n\t\t/*\n\t\tif(o.template){\n\t\t\t//show spinner dialogue\n\t\t\t//render o.template into o.target here\n\t\t}\n\t\t*/\n\t\tsaveTabindex();\n\t\ttdc.Grd.Modal.isVisible=true;\n\t}", "title": "" }, { "docid": "06e9279d61b8661bf4e10f3996e4a9fb", "score": "0.6830791", "text": "function showModal() {\n document.getElementById('myModal2').style.display = \"block\";\n}", "title": "" }, { "docid": "5e5a2299e4f505e81c0349b0667d05e1", "score": "0.6829845", "text": "openAddModal(){\n document.getElementById(\"add_modal\").style.display = \"block\";\n }", "title": "" }, { "docid": "5311e86daf44554f0287a7521f2091df", "score": "0.68272775", "text": "function openModal() {\n document.getElementById('myModal').style.display = \"block\";\n}", "title": "" }, { "docid": "9a31021419f755de7174825bfdef8fa2", "score": "0.682701", "text": "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "title": "" }, { "docid": "9a31021419f755de7174825bfdef8fa2", "score": "0.682701", "text": "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "title": "" }, { "docid": "9a31021419f755de7174825bfdef8fa2", "score": "0.682701", "text": "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "title": "" }, { "docid": "c6bdc9b6e6da7d04d1f59424cc88ea04", "score": "0.68199426", "text": "function mostrarModal () {\n modalContacto.style.display = \"block\";\n }", "title": "" }, { "docid": "20da33f49852313c056ba9d82c4a7356", "score": "0.6818837", "text": "function showModalFun() {\n loginModal.style.display = \"block\";\n}", "title": "" }, { "docid": "9008cf6ebd72dfc94af58e45d3379568", "score": "0.68131924", "text": "function openModal() {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "title": "" }, { "docid": "a11f20e3043b832e38d96cd7e772137b", "score": "0.68016046", "text": "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "title": "" } ]
5daa48435255eefa94e42c866e4e1d71
===================================================== CHAMPION UPGRADES ===================================================== / All of this must be implemented in the champion object constructor, for easier future updates create a function that computes the cost of the lvl 18 upgrade (~ 100baseCost) championUpgrade object to be erased. champion upgrade constructor
[ { "docid": "de63a1436554920b842b418a6f223d14", "score": "0.7360277", "text": "function ChampionUpgrade (champion, name, cost) {\n\tthis.champion = champion;\n\tthis.name = name;\n\tthis.cost = cost;\n\tthis.owned = 0;\n}", "title": "" } ]
[ { "docid": "71abbbf43a6d990f75b7838c25ba5215", "score": "0.7061922", "text": "function levelUpChampion(champion) {\n\tif(gold>=champion.cost()) {\n\t\tgold = gold- champion.cost();\n\t\tchampion.level = champion.level + 1;\t\t\n\t\tcomputeGoldPerSecond();\n\t\tshowChampionsUpgrades ();\n showChampionSpellsBlocks();\n\t\tcheckAchievementsUnlocked();\n\t\tcomputeGlobalAD();\n\t\tcomputeGlobalAP();\n\t\tupdateInterface();\n\t\t\n\t}\n}", "title": "" }, { "docid": "3f1ab892c38999544a4cdf8d7eed8c38", "score": "0.6524314", "text": "function upgrade_cost_calc(x) {\n //x is the level being upgraded to, y is cost\n //function is (x-10)(7/10y) = -1 * 8^2\n //function is a rectangular hyperbola - has an asymtope at 10\n if (x > 10) {\n return 200;\n }else if (x == 10) {\n y = 100;\n } else {\n y = Math.round(-640 / (7 * (x - 10)));\n }\n\n return y;\n}", "title": "" }, { "docid": "85714af26914aad4df7a04bf38a7fe94", "score": "0.64446205", "text": "upgrade() {\n if (this.towerLevel < 3 && this.user.balance >= this.upgradeCost) {\n this.towerLevel++;\n this.user.decreaseBalance(this.upgradeCost);\n this.cost += this.upgradeCost;\n\n if (this.towerLevel == 2) {\n this.HP = Pistol.maxHP;\n this.fireRate = Pistol.fireRate;\n this.shootingRadius = Pistol.shootingRadius * this.scale; \n this.damage = Pistol.damage; \n this.upgradeCost = Pistol.cost3;\n\n this.frameHeight = 44;\n this.yOffset = this.frameHeight * this.scale - 5 * this.scale;\n } else {\n this.HP = Pistol.maxHP;\n this.fireRate = Pistol.fireRate;\n this.shootingRadius = Pistol.shootingRadius * this.scale; \n this.damage = Pistol.damage; \n\n this.frameHeight = 45;\n this.yOffset = this.frameHeight * this.scale - 5 * this.scale;\n }\n\n this.animations = [];\n var i;\n for (i = 0; i < 8; i++) {\n this.animations.push(\n new Animator(\n this.spritesheet[this.towerLevel - 1],\n this.frameWidth * i,\n 0,\n this.frameWidth,\n this.frameHeight,\n 1,\n 1,\n 0,\n false,\n true\n )\n );\n }\n }\n }", "title": "" }, { "docid": "012271285eab55c479a147c323469906", "score": "0.6334961", "text": "function updateChampStats(champLvl = 1) {\n if(champLoaded) {\n var shardOffense = document.getElementById(\"shardOffense\").value;\n var shardFlex = document.getElementById(\"shardFlex\").value;\n var shardDefense = document.getElementById(\"shardDefense\").value;\n\n var adaptiveForceRunes,attackSpeedRune, armorRunes, mrRunes, healthRunes, coolDownRune;\n\n adaptiveForceRunes = attackSpeedRune = armorRunes = mrRunes = healthRunes = coolDownRune = 0;\n\n\n if(shardOffense == 'af'){\n adaptiveForceRunes++;\n }\n else if(shardOffense == 'as'){\n attackSpeedRune++;\n\n }\n else{//cooldown chosen\n coolDownRune++\n }\n }\n\n if(shardFlex == 'af'){\n adaptiveForceRunes++;\n }\n else if(shardFlex == 'ar'){\n armorRunes++;\n\n }\n else{//mr chosen\n mrRunes++\n }\n\n if(shardDefense == 'ht'){\n healthRunes\n }\n else if(shardDefense == 'ar'){\n armorRunes++;\n\n }\n else{//cooldown chosen\n mrRunes++\n }\n\n\n //CALCULATE THE INCREASED STAT VALUES\n\n //add adaptive force\n if(isMage){\n document.getElementById(\"ap_lvl1Stats\").innerHTML = ((adaptiveForceValue*adaptiveForceRunes)).toFixed(2);\n document.getElementById(\"ap_specificLevelStat\").innerHTML = ((adaptiveForceValue*adaptiveForceRunes)+itemAp).toFixed(2);\n }\n else if(ad > ap){\n document.getElementById(\"ad_specificLevelStat\").innerHTML = ((ad+(adPerLevel*(champLvl-1))+itemAd) + ((adaptiveForceValue*adaptiveForceRunes)*adaptiveADScaler)).toFixed(2);\n }\n else{\n document.getElementById(\"ap_lvl1Stats\").innerHTML = ((adaptiveForceValue*adaptiveForceRunes)).toFixed(2);\n document.getElementById(\"ap_specificLevelStat\").innerHTML = (ap+(adaptiveForceValue*adaptiveADScaler)+itemAp).toFixed(2);\n }\n\n //add attack speed\n document.getElementById(\"as_specificLevelStat\").innerText = ((as * (attackSpeendRuneBonus*attackSpeedRune))+as).toFixed(2);\n\n //add cooldown\n cooldown = (shardCDStartValue+(shardCDScaler*champLvl))*coolDownRune;\n document.getElementById(\"cd_specificLevelStat\").innerText = cooldown;\n\n //add health\n health = (startingHealth + (healthPerLevel*(champLvl-1)) + (shardHealthStartValue)+(shardHealthScaler*champLvl));\n document.getElementById(\"hp_specificLevelStat\").innerHTML = health.toFixed(0);\n\n //armour and mr\n document.getElementById(\"ar_specificLevelStat\").innerHTML = ar+(arRuneValue*armorRunes);\n document.getElementById(\"mr_specificLevelStat\").innerHTML = mr+(mrRuneValue*mrRunes);\n\n}", "title": "" }, { "docid": "f54caac1e9945aac8a788feed496f170", "score": "0.6112682", "text": "function upgradeDamage()\r\n{\r\n var obj = canvas.getActiveObject();\r\n var index = towerObjs.indexOf(obj);\r\n\tvar tower = PLAYER.towerArray[index];\r\n if(tower.source.indexOf(\"offensive\") >= 0 && PLAYER.money >= parseInt(tower.cost*.25) && tower.upgrades < 3)\r\n {\r\n PLAYER.money -= parseInt(tower.cost*0.25);\r\n tower.cost += parseInt(tower.cost*0.25);\r\n //maybe increase energy consumption\r\n tower.damage += Math.ceil(tower.damage*0.15);\r\n tower.sell += parseInt(tower.sell*0.2);\r\n tower.efficiency += parseInt(tower.efficiency*.35);\r\n displayHUD();\r\n console.log(\"Tower Damage Upgraded: \"+ tower.damage);\r\n tower.upgrades++ ;\r\n updateStatsMenu(tower);\r\n }\r\n else if(tower.upgrades >= 3)\r\n alertUser(\"Maximum Upgrades Reached!\")\r\n else if(PLAYER.money < parseInt(tower.cost*.25))\r\n alertUser(\"Insufficient Funds!\");\r\n else\r\n alertUser(\"Invalid Upgrade!\");\r\n}", "title": "" }, { "docid": "61ac21024c59ed2372cf9fe172f4cc00", "score": "0.60179037", "text": "function upgrades(item) {\n\tif (item == 0 && money >= upgradeSelfCost[0]){\t\t\t\n\t\tplayerDam = playerDam * 5;\n\t\tmoney = money - upgradeSelfCost[0]; \n\t\tselfupgrades++;\n upgraded = true;\n\t}\n\tif (item == 1 && money >= upgradeHeroCost[0]){\n\t\theroDam[0] = heroDam[0] * 2;\n\t\tmoney = money - upgradeHeroCost[0];\n\t\theroupgrades++;\n upgraded = true;\n\t}\n\tif (item == 2 && money >= upgradeSelfCost[1]){\n\t\tplayerDam = playerDam * 5;\n\t\tmoney = money - upgradeSelfCost[1];\t\t\n\t\tselfupgrades++;\n upgraded = true;\n\t}\n\tif (item == 3 && money >= upgradeHeroCost[1]){\n\t\theroDam[1] = heroDam[1] * 2;\n\t\tmoney = money - upgradeHeroCost[1];\n\t\theroupgrades++;\n upgraded = true;\n\t}\n\tif (item == 4 && money >= upgradeSelfCost[2]){\n\t\tplayerDam = playerDam * 5;\n\t\tmoney = money - upgradeSelfCost[2];\t\n\t\tselfupgrades++;\n upgraded = true;\n\t}\n\tif (item == 5 && money >= upgradeHeroCost[2]){\n\t\theroDam[2] = heroDam[2] * 2;\n\t\tmoney = money - upgradeHeroCost[2];\n\t\theroupgrades++;\n upgraded = true;\n\t}\n\tif (item == 6 && money >= upgradeSelfCost[3]){\n\t\tplayerDam = playerDam * 5;\n\t\tmoney = money - upgradeSelfCost[3];\n\t\tselfupgrades++;\n upgraded = true;\n\t}\n\tif (item == 7 && money >= upgradeHeroCost[3]){\n\t\theroDam[3] = heroDam[3] * 2;\n\t\tmoney = money - upgradeHeroCost[3];\n\t\theroupgrades++;\n upgraded = true;\n\t}\n\tif (item == 8 && money >= upgradeSelfCost[4]){\n\t\tplayerDam = playerDam * 5;\n\t\tmoney = money - upgradeSelfCost[4];\n\t\tselfupgrades++;\n upgraded = true;\n\t}\n\tif (item == 9 && money >= upgradeHeroCost[4]){\n\t\theroDam[4] = heroDam[4] * 2;\n\t\tmoney = money - upgradeHeroCost[4];\n\t\theroupgrades++;\n upgraded = true;\n\t}\n\n // stuff for all upgrades\n if (upgraded == true) {\n displayUpgrades();\n displayHeroUpgrades()\n printall();\n newUpgrade = 5; // counter\n upgraded = false;\n }\t\n}", "title": "" }, { "docid": "38eecd4a4c59b32255628d19e72ac757", "score": "0.601073", "text": "upgrade(i) {\n if (this.level.xpPoint <= 0) return;\n let value = this.myUpgrade[i];\n if (value == \"ATTACK\") {\n this.attack += 0.15;\n } else if (value == \"SPEED\") {\n this.speed += 0.15;\n } else if (value == \"BULLETSIZE\") {\n this.bulletSize += 0.5;\n } else if (value == \"ATTACKSPEED\") {\n this.attackSpeed *= 0.95;\n } else if (value == \"BULLETSPEED\") {\n this.bulletSpeed += 0.25;\n } else if (value == \"HEALTH\") {\n this.healh += 2;\n this.maxHealth += 2;\n } else if (value == \"XP\") {\n this.level.changeMult(this.level.mult * 1.1);\n }\n this.size += 0.5;\n this.level.xpPoint--;\n }", "title": "" }, { "docid": "8c6753b28ab2d064c29077f13df2b3eb", "score": "0.59746784", "text": "base(){ \n if(player.X.points.gte(1)&&hasUpgrade('F',103)) return new Decimal(500).pow(new Decimal(1).div(player.F.FP.add(10).log(2).pow(0.15)))\n else if(player.X.points.gte(1)&&hasUpgrade('F',14))return new Decimal(500).pow(new Decimal(1).div(player.F.FP.add(10).log(10).pow(0.1)))\n else if(inChallenge('E',31))return new Decimal(\"eeeeeeeeee10\")\n else return 50}", "title": "" }, { "docid": "e951e3ade32af7986d0d92d604f49814", "score": "0.59482706", "text": "LevelUp() {\n\n var levelIndex = Game.Upgrades.Unlocked.indexOf(\"LevelUp\");\n\n // Make sure the level up is available for puchase\n if (levelIndex == -1) {\n console.log(\"Already purchased all available levels\");\n return;\n } else if (Game.Upgrades.PurchasedLevels[levelIndex] >= Game.Upgrades.AvailableLevels[levelIndex]) {\n console.log(\"Already purchased all available levels\");\n return;\n }\n\n // Assuming levelling up is allowed, get cost and pay for level up\n var levelUpCost = Math.ceil(GameDB.Stats.Level.baseXPCost * Math.pow(GameDB.Stats.Level.levelCostScaling, this.Level));\n if (Game.Resources.XP >= levelUpCost) {\n // Give level\n this.Level++;\n Game.Resources.XP -= levelUpCost;\n\n // Re-do stats\n this.recalcStats();\n } else {\n console.log(\"Unable to afford levelup\");\n }\n }", "title": "" }, { "docid": "16272df773685bb6df5556499cdc4d41", "score": "0.59359723", "text": "upgradetower()\n {\n if(this.stats.level<3){\n //Remove money\n game.currency=game.currency-upgradeprice;\n document.getElementById(\"currency\").innerHTML=\"$\"+game.currency+\",-\";\n\n this.stats.level++;\n this.stats.speed=this.stats.speed-2;\n this.stats.damage=this.stats.damage+0.5;\n\n this.updatecolor();\n $(\"#success\").fadeIn(300).delay(1000).fadeOut(300);\n }\n else{\n $(\"#errorhighlvl\").fadeIn(300).delay(1000).fadeOut(300);\n }\n upgradehide();\n scene.remove(indicator);\n }", "title": "" }, { "docid": "881b08b82135aadba413da1d807bcd4e", "score": "0.5876336", "text": "function Upgrade(name, id, textId, flavor, fps, fpsId, cost, costId, appears, owned, ownedId, image, built) {\n this.name = name; //name of the upgrade\n this.id = id; //id of the upgrade\n this.textId = textId; //id of the upgrade's textbox\n this.flavor = flavor; //flavor text of the upgrade\n this.fps = fps; //how much fps the upgrade gives\n this.fpsId = fpsId; //id of the upgrade's fps-text\n this.cost = cost; //cost of the upgrade\n this.costId = costId; //id of the upgrade's cost-text\n this.appears = appears; //when the upgrade becomes available\n this.owned = owned; //how many owned\n this.ownedId = ownedId; //id of the owned number\n this.image = image; //location of the upgrade's image\n this.built = built; //check if element has been built and drawn to the screen\n\n}", "title": "" }, { "docid": "8ea02269105128c867655010e5c2aa71", "score": "0.58504117", "text": "LevelUpStat(statName, numLevels){\n\n // Get cost required to level up desired stat\n var buyoutCost = Math.ceil(\n getTotalMultiCost(\n GameDB.Stats[statName].baseXPCost * Math.pow(GameDB.Stats[statName].tierUpCostScaling, this.StatLevels[statName].Tier) * Math.pow(GameDB.Stats[statName].levelCostScaling, this.StatLevels[statName].Level),\n numLevels,\n GameDB.Stats[statName].levelCostScaling,\n true\n )\n );\n\n // Check if we can afford it and level it up\n if (Game.Resources.XP >= buyoutCost) {\n this.StatLevels[statName].Level += numLevels;\n Game.Resources.XP -= buyoutCost;\n\n this.recalcStats();\n } else {\n console.log(\"Error, unable to afford upgrade\");\n }\n }", "title": "" }, { "docid": "6b9b6171f57421dbb2d9261a5357b3bd", "score": "0.58107835", "text": "TierUpStat(statName) {\n var tierIndex = Game.Upgrades.indexOf(statName);\n\n if (tierIndex == -1) {\n console.log(\"Already purchased all available tiers\");\n return;\n } else if (Game.Upgrades.PurchasedLevels[tierIndex] >= Game.Upgrades.AvailableLevels[tierIndex]) {\n console.log(\"Already purchased all available tiers\");\n return;\n }\n\n var levelUpCost = Math.ceil(GameDB.Stats[statName].baseXPCost * Math.pow(GameDB.Stats[statName].tierUpCostScaling, this.StatLevels[statName].Tier));\n if (Game.Resources.XP >= levelUpCost) {\n // Give level\n this.StatLevels[statName].Tier++;\n this.StatLevels[statName].Level = 1;\n Game.Resources.XP -= levelUpCost;\n\n this.recalcStats();\n } else {\n console.log(\"Unable to afford tier up of \" + statName);\n }\n }", "title": "" }, { "docid": "16863b3cdf6d9fbb89bdfc09a12b81a8", "score": "0.57728153", "text": "function levelUp(){\n if (legacyValue >= levelUpCost){\n userClickValue *= 2\n legacyValue -= levelUpCost\n levelUpCost *= 3\n // @ts-ignore\n document.getElementById(\"level-up-cost\").innerText = `Cost: ${levelUpCost}`\n}\n}", "title": "" }, { "docid": "0a4107cb91e13688d8f793c4967625b4", "score": "0.576816", "text": "function updateChampionInterface(champion) {\n\n // bread crumbling\n if((champion.minGoldToDiscover>1)&&(totalGoldGained >= champion.minGoldToDiscover)){\n document.getElementById(champion.name + \"UnknownBlock\").style.display = \"none\";\n document.getElementById(champion.name + \"ChampionBlock\").style.display = \"\";\n }\n \n \n\t// level\n\tif(champion.level !== 0){\n\tdocument.getElementById(champion.name + \"Level\").innerHTML = \"Level \" + champion.level;\n\t}\n\telse{\n\tdocument.getElementById(champion.name + \"Level\").innerHTML = \"Not owned\";\n\t}\n\t\n\t// cost\n\tdocument.getElementById(champion.name + \"Cost\").innerHTML = addCommas(prettyBigNumber(champion.cost()));\n\tif(champion.cost()<=roundGold){\n\tdocument.getElementById(champion.name + \"Cost\").style.color = \"green\";\n\t}\n\telse{\n\tdocument.getElementById(champion.name + \"Cost\").style.color = \"red\";\n\t}\n \n \t// buy 10 cost\n\tdocument.getElementById(champion.name + \"Buy10Cost\").innerHTML = addCommas(prettyBigNumber(champion.costBuyX(10)));\n\tif(champion.costBuyX(10)<=roundGold){\n\tdocument.getElementById(champion.name + \"Buy10Cost\").style.color = \"green\";\n\t}\n\telse{\n\tdocument.getElementById(champion.name + \"Buy10Cost\").style.color = \"red\";\n\t} \n \n\t\n\t// displayed GpS\n\tif(champion.owned()){\n\t\tdocument.getElementById(champion.name + \"DisplayedGpS\").innerHTML = addCommas(prettyBigNumber(champion.goldPerSecond()));\n\t}\n}", "title": "" }, { "docid": "afa44d5ab28fb52e746af14b7b2973f6", "score": "0.57426184", "text": "function levelUp(){\n//levels up the player characters stats, adding to their current totals\n//levelling up also heals the player fully\n//the luck stat handles level scaling, as your luck goes up, the more your other stats go up\n\tconsole.info(\"Player Character Stats Before Level Up: \");\n\tlistStatsInConsole();\n\tlevel = level + 1;\n\tsetMessage(\"Congratulations!\",\"You Levelled Up to level \" + level +\"!\");\n\tsetMessage(\" HP:\" + maxHP + \" MP:\" +maxMP + \" phyAtt:\" + phyAttack + \" magAtt:\" + magAttack , \" phyDef:\" + phyDefence + \" magDef:\" + magDefence +\" Luck:\" + luck);\n\teffectiveExpLevelUp = expLevelUp;\n\teffectiveCurrentExp = currentExp - expLevelUp;\n\tif (expLevelUp >= 50000){\n\t\texpLevelUp = expLevelUp + Math.floor(expLevelUp/7);\n\t}else{\t\n\t\tif(expLevelUp >= 40000){\n\t\t\texpLevelUp = expLevelUp + Math.floor(expLevelUp/6);\n\t\t}else{\n\t\t\tif(expLevelUp >= 30000){\n\t\t\t\texpLevelUp = expLevelUp + Math.floor(expLevelUp/5);\n\t\t\t}else{\n\t\t\t\tif (expLevelUp >= 20000){190733\n\t\t\t\t\texpLevelUp = expLevelUp + Math.floor(expLevelUp/4);\t\n\t\t\t\t}else{\n\t\t\t\t\tif (expLevelUp >= 10000){\n\t\t\t\t\t\texpLevelUp = expLevelUp + Math.floor(expLevelUp/3);\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(expLevelUp >= 5000){\n\t\t\t\t\t\t\texpLevelUp = expLevelUp + Math.floor(expLevelUp/2);\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\texpLevelUp = expLevelUp + expLevelUp;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\teffectiveExpLevelUp = expLevelUp - effectiveExpLevelUp; \n\tswitch(playerClass){\n\tcase \"warrior\": //growth focuses on physical stats\n\t\tmaxHP = maxHP + getRandomInt(4+Math.ceil(luck/2),7+Math.ceil(luck/2));\n\t\tcurrentHP = maxHP;\n\t\tmaxMP = maxMP + getRandomInt(3+Math.ceil(luck/2),7+Math.ceil(luck/2));\n\t\tcurrentMP = maxMP;\n\t\tphyAttack = phyAttack + getRandomInt(2+Math.ceil(luck/4),5+Math.ceil(luck/4));\n\t\tphyDefence = phyDefence + getRandomInt(2+Math.ceil(luck/4),4+Math.ceil(luck/4));\n\t\tmagAttack = magAttack + getRandomInt(2+Math.ceil(luck/4),3+Math.ceil(luck/4));\n\t\tmagDefence = magDefence + getRandomInt(1+Math.ceil(luck/4),2+Math.ceil(luck/4));\n\t\tluck = luck + getRandomInt(1,3);\n\t\tbreak;\n\tcase \"mage\": //growth focuses on magic based stats\n\t\tmaxHP = maxHP + getRandomInt(3+Math.ceil(luck/2),5+Math.ceil(luck/2));\n\t\tcurrentHP = maxHP;\n\t\tmaxMP = maxMP + getRandomInt(8+Math.ceil(luck/2),11+Math.ceil(luck/2));\n\t\tcurrentMP = maxMP;\n\t\tphyAttack = phyAttack + getRandomInt(1+Math.ceil(luck/4),2+Math.ceil(luck/4));\n\t\tphyDefence = phyDefence + getRandomInt(1+Math.ceil(luck/4),2+Math.ceil(luck/4));\n\t\tmagAttack = magAttack + getRandomInt(5+Math.ceil(luck/4),7+Math.ceil(luck/4));\n\t\tmagDefence = magDefence + getRandomInt(2+Math.ceil(luck/4),4+Math.ceil(luck/4));\n\t\tluck = luck + getRandomInt(1,3);\n\t\tbreak;\n\tcase \"rogue\"://growth focuses on luck and has balance magical and phyiscal stats\n\t\tmaxHP = maxHP + getRandomInt(4+Math.ceil(luck/2),6+Math.ceil(luck/2));\n\t\tcurrentHP = maxHP;\n\t\tmaxMP = maxMP + getRandomInt(4+Math.ceil(luck/2),8+Math.ceil(luck/2));\n\t\tcurrentMP = maxMP;\n\t\tphyAttack = phyAttack + getRandomInt(2+Math.ceil(luck/4),3+Math.ceil(luck/4));\n\t\tphyDefence = phyDefence + getRandomInt(2+Math.ceil(luck/4),3+Math.ceil(luck/4));\n\t\tmagAttack = magAttack + getRandomInt(2+Math.ceil(luck/4),3+Math.ceil(luck/4));\n\t\tmagDefence = magDefence + getRandomInt(2+Math.ceil(luck/4),3+Math.ceil(luck/4));\n\t\tluck = luck + getRandomInt(2,5);\n\t\tbreak;\t\t\t\t\n\t}\n\tsetMessage(\" HP:\" + maxHP + \" MP:\" +maxMP + \" phyAtt:\" + phyAttack + \" magAtt:\" + magAttack , \" phyDef:\" + phyDefence + \" magDef:\" + magDefence +\" Luck:\" + luck);\n\tif (level == 25){ //message for when the player reaches the max possible level\n\t\tsetMessage(\"Congratulations!\",\"You have reached the max level!\");\n\t\tsetMessage(\"You are as strong as you can be!\",\"Go forth and finish your quest!\");\n\t}\n\tswitch(playerClass){\n\t\tcase \"warrior\":\n\t\t\tif (level == 2){ //flame slash\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Burn foes with Flame Slash!\");\n\t\t\t\tsetMessage(\"Remember to cast a spell,\",\"you need enough MP to cast it!\");\n\t\t\t}\n\t\t\tif (level == 3){ //Sheer will\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Heal yourself with Sheer Will!\");\n\t\t\t}\n\t\t\tif (level == 5){ //tornado slash\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Tear foes to shreds with tornado slash!\");\n\t\t\t}\n\t\t\tif (level == 10){ //bulk up\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Bulk Up to boost your stats!\");\n\t\t\t}\n\t\t\tif (level == 15){ //nova slash\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Unleash your full power Nova Slash!\");\n\t\t\t\tsetMessage(\"Congratulations!\",\"You now have learnt every spell!\");\n\t\t\t\tsetMessage(\"Have fun using them\",\"to defeat your foes!\");\n\t\t\t}\n\t\t\tbreak;\n\t\t\n\t\tcase \"mage\":\n\t\t\tif (level == 2){ //fire\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Scorch your foes with Fire!\");\n\t\t\t\tsetMessage(\"Remember to cast a spell,\",\"you need enough MP to cast it!\");\n\t\t\t}\n\t\t\tif (level == 3){ //heal\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Heal yourself with Heal!\");\n\t\t\t}\n\t\t\tif (level == 5){ //thunder\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Zap your foes with Thunder!\");\n\t\t\t}\n\t\t\tif (level == 10){ //health drain\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Steal health with Health Drain!\");\n\t\t\t}\n\t\t\tif (level == 15){ //g nova\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Unleash your full power with Grand Nova!\");\n\t\t\t\tsetMessage(\"Congratulations!\",\"You now have learnt every spell!\");\n\t\t\t\tsetMessage(\"Have fun using them\",\"to defeat your foes!\");\n\t\t\t}\n\t\t\tbreak;\n\t\t\n\t\tcase \"rogue\":\n\t\t\tif (level == 2){ //Steal\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Plunder items with Steal!\");\n\t\t\t\tsetMessage(\"Remember to cast a spell,\",\"you need enough MP to cast it!\");\n\t\t\t}\n\t\t\tif (level == 3){//Life steal\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Life Steal from your foes!\");\n\t\t\t}\n\t\t\tif (level == 5){//Cash N Grab\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Cash N Grab enemy gold!\");\n\t\t\t}\n\t\t\tif (level == 10){ //Backstab\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Hit weak points with Backstab!\");\n\t\t\t}\n\t\t\tif (level == 15){ //Nova Blitz\n\t\t\t\tsetMessage(\"You learnt a new spell!\",\"Unleash your full power of Nova Blitz!\");\n\t\t\t\tsetMessage(\"Congratulations!\",\"You now have learnt every spell!\");\n\t\t\t\tsetMessage(\"Have fun using them\",\"to defeat your foes!\");\n\t\t\t}\n\t\t\tbreak;\t\t\t\t\t\t\n\t}\n}", "title": "" }, { "docid": "eafeae1e920328bc593e4fca01893f44", "score": "0.5689427", "text": "function nip_characterXpCalculators() {\r\n // Get the Melee xp, Ranged xp, Total xp, and Class Points\r\n var meleeXp = $(\".halfpane ul:nth-of-type(1) li:nth-of-type(3)\").text().match(/([0-9]*) xp/)[1];\r\n var rangedXp = $(\".halfpane ul:nth-of-type(1) li:nth-of-type(4)\").text().match(/([0-9]*) xp/)[1];\r\n var totalXp = $(\".halfpane ul:nth-of-type(1) li:nth-of-type(5)\").text().match(/([0-9]*) \\/ ([0-9]*) xp/);\r\n var classPts = $(\".halfpane ul:nth-of-type(2) li:nth-of-type(3)\").text().match(/[0-9]*$/);\r\n // Calculate the xp till next level\r\n var totalXpRequired = totalXp[2] - totalXp[1];\r\n // Insert the xp till next level\r\n if (totalXpRequired < 0) totalXpRequired = 0;\r\n $(\".halfpane > ul:nth-of-type(1)\").append(\"<li><span class=\\\"label\\\">XP to Level:</span>\" + totalXpRequired + \" xp</li>\");\r\n // Loop through each upgrade option\r\n $(\".progBxReqTbl\").each(function(){\r\n // Get the xp, class point, and gold requirements for each upgrade option\r\n var classPtRequirement = $(\"tr:nth-of-type(1) td:nth-of-type(2)\", this).text();\r\n var meleeXpRequirement = $(\"tr:nth-of-type(2) td:nth-of-type(2)\", this).text();\r\n var rangedXpRequirement = $(\"tr:nth-of-type(3) td:nth-of-type(2)\", this).text();\r\n var goldRequirement = $(\"tr:nth-of-type(4) td:nth-of-type(2)\", this).text();\r\n // Calculate the xp, class points, and gold remaining till next upgrade\r\n var classPtsRemaining = classPtRequirement - classPts;\r\n var meleeXpRemaining = meleeXpRequirement - meleeXp;\r\n var rangedXpRemaining = rangedXpRequirement - rangedXp;\r\n //var goldRemaining = gold - goldRequirement;\r\n // If the remaing is negative, override with zero\r\n if (classPtsRemaining < 0) classPtsRemaining = 0;\r\n if (meleeXpRemaining < 0) meleeXpRemaining = 0;\r\n if (rangedXpRemaining < 0) rangedXpRemaining = 0;\r\n // Widen the upgrade option tables\r\n $(this).parent().css(\"width\",\"220px\");\r\n // Insert the xp, class points, and gold remaining till next upgrade\r\n $(\"tr:nth-of-type(1) td:nth-of-type(2)\", this).text(classPtRequirement + \" (\" + classPtsRemaining + \")\");\r\n $(\"tr:nth-of-type(2) td:nth-of-type(2)\", this).text(meleeXpRequirement + \" (\" + meleeXpRemaining + \")\");\r\n $(\"tr:nth-of-type(3) td:nth-of-type(2)\", this).text(rangedXpRequirement + \" (\" + rangedXpRemaining + \")\");\r\n });\r\n}", "title": "" }, { "docid": "25f22129f33f1dde262690889a93c936", "score": "0.5669348", "text": "function UpdateGoal() {\n if (playerData.length != 0) {\n let playerSkills = getHighscore();\n let xpRemaining = 0;\n let actualPlayerXp = 0;\n let vTotal = 0;\n // Loop through each skill\n for (s = 1; s < 28; s++) {\n let tempRemValue = \"\";\n // Calculate the xp remaining until the new goal is reached\n if (s != 27) { // Regular Skills\n if (s == 25 || s == 19) { // Skills that go up to level 120\n tempRemValue = xpToGoal(playerSkills[s].xp, true, false)\n actualPlayerXp = actualPlayerXp + xpLessThanGoal(playerSkills[s].xp, true, false);\n } else { // Skills that cap at 99\n tempRemValue = xpToGoal(playerSkills[s].xp, false, false)\n actualPlayerXp = actualPlayerXp + xpLessThanGoal(playerSkills[s].xp, false, false);\n }\n // Add to the player's virtual level\n vTotal = vTotal + getLevel(playerSkills[s].xp);\n } else { // Elite Skills\n tempRemValue = xpToGoal(playerSkills[s].xp, true, true)\n actualPlayerXp = actualPlayerXp + xpLessThanGoal(playerSkills[s].xp, true, true);\n // Add to the player's virtual level\n vTotal = vTotal + getLevel(playerSkills[s].xp, true);\n }\n // If the player has passed the goal, set the remaining xp to 0\n if (tempRemValue < 0) {\n tempRemValue = 0;\n }\n // Calculate the percentage value\n let tempPercentageValue = Math.round(playerSkills[s].xp / (playerSkills[s].xp + tempRemValue) * 100);\n\n // Add the data to the page\n let currElement = document.getElementById(\"skill\" + s);\n let attrRem = document.createAttribute('data-rem');\n attrRem.value = tempRemValue;\n let attrPercent = document.createAttribute('data-percent');\n attrPercent.value = tempPercentageValue;\n currElement.parentElement.setAttributeNode(attrRem);\n currElement.parentElement.setAttributeNode(attrPercent);\n currElement.style = \"width:\" + tempPercentageValue + \"%\";\n currElement.childNodes[7].innerText = numberWithCommas(tempRemValue);\n currElement.childNodes[8].innerText = tempPercentageValue + \"%\";\n currElement.childNodes[8].setAttribute(\"style\", \"color: \" + getColor(tempPercentageValue) + \";\");\n xpRemaining = xpRemaining + tempRemValue;\n }\n // Update some of the data on the left\n document.getElementById(\"xpRem\").innerText = numberWithCommas(xpRemaining);\n document.getElementById(\"percentRem\").innerText = Math.round(actualPlayerXp / (actualPlayerXp + xpRemaining) * 100) + \"%\";\n document.getElementById(\"levelsToTrueMax\").innerText = numberWithCommas(3270 - vTotal);\n PageLoaded();\n } else { // If the data was receieved in the wrong order\n wrongTiming = true;\n }\n}", "title": "" }, { "docid": "ada75b7eb2972e786d361701d09c8e1f", "score": "0.5660794", "text": "function buyAlphaUpgrade(column, row) {\r\n\tvar cost;\r\n\tif (row == 1 || row == 2) cost = 1;\r\n\tif (row == 3 || row == 5 || row == 6) cost = 2;\r\n\tif (row == 4) cost = 3;\r\n\tif (row == 7) cost = 4;\r\n\tif (row == 8) cost = 5;\r\n\tif (verifyAlphaUpgrade(column, row)) {\r\n\t\tgame.alpha.upgrades.push(column + row);\r\n\t\tgame.alpha.alphonium = game.alpha.alphonium.minus(cost);\r\n\t}\r\n}", "title": "" }, { "docid": "e022e810e6baab807e74f2985c01b58f", "score": "0.559733", "text": "function increasePower() {\n\n if (player.dollars >= player.powerCost) {\n player.clickPower = player.clickPower + 1;\n player.dollars = player.dollars - player.powerCost;\n if (player.clickUpgrades > 0) {\n // If the player has the Karma upgrade that gives a % of moneyPerSec\n // per click, include that in the calculation (and displayed string)\n player.clickPowString = \" (\" + (player.clickPower * player.karmaMult).toString() + \" + \" + (player.clickUpgrades * 10).toString() + \"% of MPT)\";\n }\n $('#clickPower').text(player.clickPower * player.karmaMult + Math.floor((player.clickUpgrades * 0.1 * MPS).toFixed(0)) + player.clickPowString);\n $('#dollars').text(comma(player.dollars));\n updateMPS();\n }\n // Increases the cost of the upgrade.\n player.powerCost = Math.floor(30 * Math.pow(2, player.clickPower - 1));\n $('#powerCost').text(comma(player.powerCost));\n validateButtons();\n}", "title": "" }, { "docid": "675534e668e6a94db1d0d1e3080ffb00", "score": "0.5578074", "text": "function getUpgCost(type, heirloom) {\n\tlet rarity = heirloom.rarity\n\tlet value = getUpgValue(type, heirloom)\n\tif (value <= maxAmounts[type][rarity] || !isNumeric(value)) {\n\t\treturn basePrices[rarity];\n\t}\n\tlet amount = (value - maxAmounts[type][rarity]) / stepAmounts[type][rarity];\n\tif (type === \"critChance\") {\n\t\treturn (value >= hardCaps[type][rarity]) ? 1e10 : Math.floor(basePrices[rarity] * Math.pow(priceIncreases[rarity], amount));\n\t} else if (type === \"voidMaps\") {\n\t\treturn (value >= hardCaps[type][rarity]) ? 1e10 : Math.floor(basePrices[rarity] * Math.pow(priceIncreases[rarity], amount));\n\t} else if (type === \"plaguebringer\") {\n\t\treturn (value >= hardCaps[type][rarity]) ? 1e10 : Math.floor(basePrices[rarity] * Math.pow(priceIncreases[rarity], amount));\n\t}\n\treturn Math.floor(basePrices[rarity] * Math.pow(priceIncreases[rarity], amount));\n}", "title": "" }, { "docid": "60aa83ee002d3771f874036b5f441670", "score": "0.55687165", "text": "function buyUpgrade(btn){\r\n var upg = btn.id.substring(0, btn.id.length - 3);\r\n var ct = getUpgradeCost(upg, player.buyAmount);\r\n var cost = ct[0];\r\n var amt = ct[1];\r\n\r\n if (player.money < cost) return;\r\n\r\n player.money -= cost;\r\n player[upg] += amt;\r\n \r\n\r\n updateUpgradeLabels(upg);\r\n\r\n if (upg===\"tickSpeed\"){\r\n document.getElementById(\"tick\").innerHTML = formatValue(calcTickSpeed(),0,0);\r\n }else if(upg===\"xpGain\"){\r\n document.getElementById(\"xpRateSpan\").innerHTML = formatValue(calcBaseXP(false),2,0);\r\n } else { \r\n generatePayoutTable(false);\r\n }\r\n updateCash();\r\n previewUpgrade(btn);\r\n}", "title": "" }, { "docid": "0964e189caaa54e2bab06640298bfefc", "score": "0.5564032", "text": "function getUpgradeCost(upg, amt){\r\n var cost = 0;\r\n var num = 0;\r\n if (amt === -1){\r\n var temp = consts.baseCost[upg]*Math.pow(consts.costMulti[upg],player[upg]);\r\n while (cost + temp <= player.money){\r\n cost += temp;\r\n num++;\r\n temp = consts.baseCost[upg]*Math.pow(consts.costMulti[upg],player[upg]+num);\r\n }\r\n if (num === 0){\r\n num=1;\r\n cost = consts.baseCost[upg]*Math.pow(consts.costMulti[upg],player[upg]);\r\n }\r\n }else{\r\n for (var i = 0; i < amt; i++){\r\n cost += consts.baseCost[upg]*Math.pow(consts.costMulti[upg],player[upg]+i);\r\n }\r\n num=amt;\r\n }\r\n return [cost, num];\r\n}", "title": "" }, { "docid": "98d717d390efd7b7cf9790314271ad4c", "score": "0.5550522", "text": "function update_upgrade_list() {\n /* Loop through all remaining upgrades */\n Object.keys(remaining_upgrades).forEach(function (upg_name) {\n /* No upgrades visible in no upgrade challenge. */\n if (adventure_data[\"challenge\"] == CHALLENGES.NO_UPGRADE || adventure_data[\"challenge\"] == CHALLENGES.UDM) {\n $(\"#upgrade_\" + upg_name).addClass(\"hidden\");\n return;\n }\n if (remaining_upgrades[upg_name].unlock()) {\n /* Only autobuy non-repeating upgrades that don't cost time (as time is constantly the most limited resource) */\n let color = \"\"; /* Set color to lightgray or red depending on if they can afford it */\n $(\"#upgrade_\" + upg_name).removeClass(\"hidden\");\n Object.keys(remaining_upgrades[upg_name].cost).forEach(function (res) {\n if (resources[res].amount < remaining_upgrades[upg_name].cost[res]) {\n color = \"red\";\n }\n });\n if (adventure_data[\"auto_upgrade\"] && color == \"\" && !remaining_upgrades[upg_name].repeats && remaining_upgrades[upg_name].cost[\"time\"] == undefined) {\n try {\n purchase_upgrade(upg_name);\n return; /* Don't bother with the rest if we successfully buy it. */\n }\n catch (e) {\n /* Ah, well. Couldn't buy it. */\n }\n }\n $(\"#upgrade_\" + upg_name).css(\"color\", color);\n /* Refresh tooltip */\n let tooltip = remaining_upgrades[upg_name].tooltip;\n let reg_costs = [];\n let req_costs = [];\n Object.keys(remaining_upgrades[upg_name].cost).forEach(function (res) {\n if (resources[res].value) {\n let cost = \"\";\n if (resources[res].amount < remaining_upgrades[upg_name].cost[res]) {\n cost += \"<span style='color: red'>\";\n }\n else {\n cost += \"<span class='fgc'>\";\n }\n cost += format_num(remaining_upgrades[upg_name].cost[res], true) + \" \" + res.replace(\"_\", \" \") + \"</span>\";\n reg_costs.push(cost);\n }\n else {\n let cost = \"\";\n if (resources[res].amount < remaining_upgrades[upg_name].cost[res]) {\n cost += \"<span style='color: red'>\";\n }\n else {\n cost += \"<span class='fgc'>\";\n }\n cost += \"Requires \" + format_num(remaining_upgrades[upg_name].cost[res], true) + \" \" + res.replace(\"_\", \" \") + \"</span>\";\n req_costs.push(cost);\n }\n });\n if (reg_costs.length && upg_name != \"trade\") {\n tooltip += \"<br />Costs \" + reg_costs.join(\", \");\n }\n if (req_costs.length) {\n tooltip += \"<br />\" + req_costs.join(\"<br />\");\n }\n $(\"#upgrade_\" + upg_name + \" .tooltiptext\").html(tooltip);\n }\n else {\n $(\"#upgrade_\" + upg_name).addClass(\"hidden\");\n }\n });\n}", "title": "" }, { "docid": "33341764ca488af4f660fae3f4d6b99a", "score": "0.5511066", "text": "function genNewStats() {\n //Generate amount of experience points required to level\n let monsterModifier = Props.getPropList();\n monsterModifier = monsterModifier[1][1];\n maxEXP = BASE_EXP * level * monsterModifier + BASE_EXP * level * EXP_MULTIPLIER;\n\n //Max Level 10\n if (level >= 10) {\n maxEXP = 0;\n }\n currentEXP = maxEXP;\n\n //Generate max hp, restore health to full\n maxHP = BASE_HP * (HP_MULTIPLIER + HP_MULTIPLIER * level);\n currentHP = maxHP;\n\n //Generate base attack power\n currentAP = BASE_AP + level * AP_MULTIPLIER;\n totalAP = currentAP + weaponAP;\n\n //Generate offset attack power\n offsetAP = BASE_AP_OFFSET + level;\n }", "title": "" }, { "docid": "2f043820718593cc1837bbfee9dfd63a", "score": "0.5468633", "text": "function initializeGame(){\r\n\r\n var d = new Date();\r\n var time = d.getTime();\r\n\r\n player.stats.session= {\r\n startTime: 0,\r\n money: 0,\r\n xp: 0,\r\n pulls: 0,\r\n ballMatches: [0,0,0,0,0,0],\r\n matchCount: [[0,0,0,0,0],[0,0,0,0,0]],\r\n powerups: 0,\r\n ballsRemoved: 0,\r\n abilityMatches: [0,0,0,0,0,0]\r\n }\r\n \r\n player.stats.session.startTime=time;\r\n\r\n updateDropdowns();\r\n updateAbilityLabels();\r\n updateRemoveLabels();\r\n hideRemovedBall(-1);\r\n\r\n consts.cashObj = document.getElementById('cash');\r\n for (var i = 0; i < htmLabels.ballLabels.length; i++){\r\n consts.ballLabelObjs[i] = document.getElementById(htmLabels.ballLabels[i]);\r\n }\r\n updateCash();\r\n generatePayoutTable(false);\r\n\r\n updateAllPowerupTableLabels();\r\n\r\n updateUpgradeLabels(\"winMulti\");\r\n updateUpgradeLabels(\"winExpo\");\r\n updateUpgradeLabels(\"superMulti\");\r\n updateUpgradeLabels(\"tickSpeed\");\r\n updateUpgradeLabels(\"xpGain\");\r\n document.getElementById(\"tick\").innerHTML = formatValue(calcTickSpeed(),0,0);\r\n\r\n document.getElementById(\"powerupCostSpan\").innerHTML=formatValue(consts.powerupBaseCost*Math.pow(consts.powerupcostMulti,player.powerupCount),2,0);\r\n\r\n document.getElementById(\"xpRateSpan\").innerHTML = formatValue(calcBaseXP(false),2,0);\r\n document.getElementById(\"levelSpan\").innerHTML=formatValue(player.level,2,0);\r\n changeBuyAmount(1,document.getElementById(\"buyUpgradeOne\"));\r\n\r\n \r\n}", "title": "" }, { "docid": "4eb6bde02d2445ff2b066e3b0838cca4", "score": "0.5449884", "text": "calculateAbilityMods() {\n this.abilityScoreMods.strength = Math.floor((this.abilityScores.strength - 10)/2);\n this.abilityScoreMods.dexterity = Math.floor((this.abilityScores.dexterity - 10)/2);\n this.abilityScoreMods.constitution = Math.floor((this.abilityScores.constitution - 10)/2);\n this.abilityScoreMods.intelligence = Math.floor((this.abilityScores.intelligence - 10)/2);\n this.abilityScoreMods.wisdom = Math.floor((this.abilityScores.wisdom - 10)/2);\n this.abilityScoreMods.charisma = Math.floor((this.abilityScores.charisma - 10)/2);\n}", "title": "" }, { "docid": "140ae4cbc95fcfdeb98e9bfb079a7ded", "score": "0.5449798", "text": "function softResetValues() {\r\n\tplayer.time = new Decimal(1);\r\n\tplayer.totalProduction = new Decimal(0);\r\n\tplayer.upgradesAvailable = true;\r\n\t\r\n\tplayer.smallHole.production = new Decimal(0);\r\n\tplayer.smallHole.productionIncrement = 1;\r\n\tplayer.smallHole.productionPerHole = new Decimal(0);\r\n\tplayer.smallHole.amount = new Decimal(0);\r\n\tplayer.smallHole.cost = new Decimal(1);\r\n\tplayer.smallHole.costMultiplier = new Decimal(5);\r\n\tplayer.smallHole.upgradesBought = 0;\r\n\tplayer.smallHole.upgraded = false;\r\n\tplayer.smallHole.upgrades = {};\r\n\tplayer.smallHole.upgrades.production = {};\r\n\tplayer.smallHole.upgrades.production.accumulated = new Decimal(0);\r\n\tplayer.smallHole.upgrades.production.production = new Decimal(0);\r\n\tplayer.smallHole.upgrades.production.increment = 0.01;\r\n\tplayer.smallHole.upgrades.production.perUpgrade = new Decimal(0);\r\n\tplayer.smallHole.upgrades.production.cost = new Decimal(10000);\r\n\tplayer.smallHole.upgrades.production.multiplier = new Decimal(2500);\r\n\tplayer.smallHole.upgrades.production.amount = new Decimal(0);\r\n\t\r\n\tplayer.mediumHole.production = new Decimal(0);\r\n\tplayer.mediumHole.productionIncrement = 0.1;\r\n\tplayer.mediumHole.productionPerHole = new Decimal(0);\r\n\tplayer.mediumHole.amount = new Decimal(0);\r\n\tplayer.mediumHole.cost = new Decimal(1000);\r\n\tplayer.mediumHole.costMultiplier = new Decimal(10);\r\n\tplayer.mediumHole.upgradesBought = 0;\r\n\tplayer.mediumHole.upgraded = false;\r\n\tplayer.mediumHole.upgrades = {};\r\n\r\n\tplayer.largeHole.production = new Decimal(0);\r\n\tplayer.largeHole.productionIncrement = 0.01;\r\n\tplayer.largeHole.productionPerHole = new Decimal(0);\r\n\tplayer.largeHole.amount = new Decimal(0);\r\n\tplayer.largeHole.cost = new Decimal(1000);\r\n\tplayer.largeHole.costMultiplier = new Decimal(10);\r\n\tplayer.largeHole.upgradesBought = 0;\r\n\tplayer.largeHole.upgraded = false;\r\n\tplayer.largeHole.upgrades = {};\r\n\t\r\n\ttextBoxGeneral.insertAdjacentHTML('afterbegin', htmlTextbox);\r\n\ttextBoxLog.insertAdjacentHTML('afterbegin', htmlTextbox);\r\n\ttextBoxUpgrades.insertAdjacentHTML('afterbegin', htmlTextbox);\r\n\ttextBoxAchievements.insertAdjacentHTML('afterbegin', htmlTextbox);\r\n\t\r\n\ttextBoxGeneral.innerHTML = \"\";\r\n\ttextBoxLog.innerHTML = \"\";\r\n\ttextBoxUpgrades.innerHTML = \"\";\r\n\ttextBoxAchievements.innerHTML = \"\";\r\n}", "title": "" }, { "docid": "a18f9a8818bf59dd34a23716b44403ea", "score": "0.5440682", "text": "function dropletUpgrade(upgrade){\n if (upgrade == 'mucus' && replication.total >= 10 && trUpgrades.mucus == 0){\n listUpgrades.transmission.push(\" Mucus\");\n trUpgrades.mucus = 1;\n replication.total -= 10;\n trPath.increment += 12;\n if (symptoms.sneeze == 1){\n trPath.increment += 5;\n }\n visibility.mucus = 0;\n update();\n }\n if (upgrade == 'breath' && replication.total >= 10 && trUpgrades.breath == 0){\n listUpgrades.transmission.push(\" Breath\");\n trUpgrades.breath = 1;\n replication.total -= 10;\n trPath.increment += 9;\n if (symptoms.cough == 1){\n trPath.increment += 5;\n }\n visibility.breath = 0;\n update();\n }\n if (upgrade == 'saliva' && replication.total >= 25 && trUpgrades.saliva == 0){\n listUpgrades.transmission.push(\" Saliva\");\n trUpgrades.saliva = 1;\n replication.total -= 25;\n trPath.increment += 30;\n if (symptoms.vomit == 1){\n trPath.increment += 10;\n }\n visibility.saliva = 0;\n update();\n }\n}", "title": "" }, { "docid": "ce04d343d4caad1d214f372c0fcaccf2", "score": "0.54366547", "text": "_adjustBonus({ type, unit, addResults }) {\n // Only apply recalibration once even if there are multiple speakers\n if (this !== this.team.units.find(u => u.type === 'DragonspeakerMage'))\n return;\n\n if (unit.team !== this.team)\n return;\n if (!(unit.type === 'DragonTyrant' || unit instanceof Pyromancer))\n return;\n\n let dragons = this.team.units.filter(u =>\n u.type === 'DragonTyrant' && u.mHealth > -u.health\n );\n let speakers = this.team.units.filter(u =>\n u.type === 'DragonspeakerMage' && u.mHealth > -u.health\n );\n let mages = this.team.units.filter(u =>\n u instanceof Pyromancer && u.mHealth > -u.health\n );\n let counts = [dragons.length, speakers.length, mages.length];\n let next = calcPowerModifiers(...counts);\n\n let change = 0;\n if (type === 'addUnit')\n change = -1;\n else if (type === 'dropUnit')\n change = 1;\n\n if (unit.type === 'DragonTyrant')\n counts[0] += change;\n else if (unit.type === 'DragonspeakerMage') {\n counts[1] += change;\n counts[2] += change;\n }\n else if (unit.type === 'Pyromancer')\n counts[2] += change;\n\n let prev = calcPowerModifiers(...counts);\n let results = [];\n\n if (dragons.length)\n results = dragons.map(u => ({\n unit: u,\n changes: {\n mPower: u === unit\n ? next.dragonModifier\n : u.mPower - prev.dragonModifier + next.dragonModifier,\n },\n }));\n\n if (mages.length)\n results = results.concat(mages.map(u => ({\n unit: u,\n changes: {\n mPower: u === unit\n ? next.mageModifier\n : u.mPower - prev.mageModifier + next.mageModifier,\n }\n })));\n\n addResults(results.filter(r => r.unit.mPower !== r.changes.mPower));\n }", "title": "" }, { "docid": "e83f9153074e4fb99667316d54ce7a83", "score": "0.5392514", "text": "function Hero(x, y, energy, whiffles, binoculars, inventory={}) {\n //Data Members:\n this.x = parseInt(x);\n this.y = parseInt(y);\n this.energy = energy;\n this.whiffles = whiffles;\n this.inventory = inventory;\n this.binoculars = binoculars;\n\n\n //Member Functions:\n\n\n //These functions are called by the map class. They simply increment the\n // hero's location.\n this.move_north = function () {\n //The hero starts at 0,0 which is at the top left corner of the map.\n //When the hero moves North, the y value will be decreasing until it gets to 0.\n this.y += 1;\n };\n this.move_south = function () {\n //When the hero moves South, the y value will increase.\n this.y -= 1;\n };\n this.move_east = function () {\n //When the hero moves East, the x value will increase.\n this.x += 1;\n };\n this.move_west = function () {\n //When the hero moves West, the x value will decrease.\n this.x -= 1;\n };\n\n // add item to hero's inventory\n this.add_item = function(item){\n if(item in this.inventory)\n this.inventory[item] += 1;\n else\n this.inventory[item] = 1;\n }\n\n this.costs = {\n \"Rock\": 1,\n \"Shears\": 35,\n \"Axe\": 30,\n \"Hatchet\": 15,\n \"Chainsaw\": 60,\n \"Chisel\": 5,\n \"Sledge\": 25,\n \"Jackhammer\": 100,\n \"Machete\": 25,\n \"Binoculars\": 50\n };\n\n\n //update Hero Energy\n this.update_energy = function (energy_change) {\n this.energy += energy_change;\n }\n\n //update Hero Whiffles\n this.update_whiffles = function (whiffle_change) {\n this.whiffles += whiffle_change;\n }\n\n //check whiffle balance for hero purchases,\n // return true if hero has enough whiffles\n this.check_balance = function (whiffle_change){\n if (this.whiffles - whiffle_change < 0)\n return false;\n return true;\n }\n\n\n //These functions will return an HTML string representing the hero's current\n // statistics.\n this.display_location = function () {\n var to_return = \"(\";\n to_return += this.x;\n to_return += \", \";\n to_return += this.y;\n to_return += \")\";\n return to_return;\n }\n this.display_whiffles = function () {\n return this.whiffles;\n\n }\n this.display_energy = function () {\n return this.energy;\n }\n this.display_inventory = function() {\n let inventory_to_html = \"<h3>Inventory</h3>\";\n Object.keys(this.inventory).forEach( item => {\n // example of templated string appended to inventory_to_html:\n // <p>Axe x2 ---- Cost: $30 ea.</p>\n let cost = this.costs[item];\n let count = this.inventory[item];\n inventory_to_html += `<p>${item} x${count} ---- Cost: \\$${cost} ea.</p>`;\n });\n inventory_to_html += '<button type=\"button\" onclick=\"close_inventory()\">CLOSE</button>';\n document.getElementById(\"inventory\").innerHTML = inventory_to_html;\n }\n}", "title": "" }, { "docid": "8ae2a3d1de80014ceace4eed21bb4b9e", "score": "0.53520757", "text": "update_battery_level(){\n var over = this.total_consumption < this.pwr_production; // true for overprod\n if (this.blocked > 0 && over) {\n pwr_to_charge = (this.pwr_production - this.total_consumption); // not multiplied with any distr, ALL excess goes to battery\n this.battery_level = Math.min(this.battery_max, this.battery_level + pwr_to_charge);\n return pwr_to_charge;\n }\n if (over) {\n var pwr_to_charge = (this.pwr_production - this.total_consumption)*this.store_percentage; // how much of overprod to charge with\n if(pwr_to_charge+this.battery_level > this.battery_max) { // overcharge\n var temp = this.battery_max - this.battery_level;\n this.battery_level = this.battery_max;\n return temp;\n } else {\n this.battery_level += pwr_to_charge;\n return pwr_to_charge;\n }\n } else {\n var pwr_to_drain = (this.total_consumption - this.pwr_production)*this.drain_percentage; // how much of underprod to drain\n if(this.battery_level - pwr_to_drain < 0){ // undercharge\n var batlvl = this.battery_level;\n this.battery_level = 0;\n return -batlvl;\n } else {\n this.battery_level -= pwr_to_drain;\n return -pwr_to_drain;\n }\n }\n\n }", "title": "" }, { "docid": "41c84099517d106a7d4bfa4bf4021885", "score": "0.5295226", "text": "function scaleUp() {\n player.x /= scaleFactor;\n player.y /= scaleFactor;\n player.xOffset /= scaleFactor;\n player.yOffset /= scaleFactor;\n player.effectiveWidth /= scaleFactor;\n player.effectiveHeight /= scaleFactor;\n allEnemies.forEach(function(enemy) {\n enemy.x /= scaleFactor;\n enemy.y /= scaleFactor;\n enemy.dx /= scaleFactor;\n enemy.dy /= scaleFactor;\n enemy.xOffset /= scaleFactor;\n enemy.yOffset /= scaleFactor;\n enemy.effectiveWidth /= scaleFactor;\n enemy.effectiveHeight /= scaleFactor;\n });\n gem.x /= scaleFactor;\n gem.y /= scaleFactor;\n gem.xOffset /= scaleFactor;\n gem.yOffset /= scaleFactor;\n gem.effectiveWidth /= scaleFactor;\n gem.effectiveHeight /= scaleFactor;\n allRocks.forEach(function(rock) {\n rock.x /= scaleFactor;\n rock.y /= scaleFactor;\n rock.xOffset /= scaleFactor;\n rock.yOffset /= scaleFactor;\n rock.effectiveWidth /= scaleFactor;\n rock.effectiveHeight /= scaleFactor;\n });\n heart.x /= scaleFactor;\n heart.y /= scaleFactor;\n heart.xOffset /= scaleFactor;\n heart.yOffset /= scaleFactor;\n heart.effectiveWidth /= scaleFactor;\n heart.effectiveHeight /= scaleFactor;\n key.x /= scaleFactor;\n key.y /= scaleFactor;\n key.xOffset /= scaleFactor;\n key.yOffset /= scaleFactor;\n key.effectiveWidth /= scaleFactor;\n key.effectiveHeight /= scaleFactor;\n }", "title": "" }, { "docid": "7cbc3842f5c1f036885add5032a917df", "score": "0.5283486", "text": "function giveCult(player, cult, num) {\r\n if(num == 0) return;\r\n\r\n if(num > 0) {\r\n if(player.cult[cult] == 10) return; //the code below would bring it back to 9 due to key limit and Math.min\r\n\r\n var oldcult = player.cult[cult];\r\n var maxcult = (player.keys > 0 && getHighestOtherPlayerValueOnCult(player, cult) < 10) ? 10 : 9;\r\n var newcult = Math.min(maxcult, oldcult + num);\r\n if(newcult == 10 && oldcult < 10) player.keys--;\r\n\r\n player.cult[cult] = newcult;\r\n addPower(player, cultPower(oldcult, newcult));\r\n }\r\n else if(num < 0) {\r\n if(player.cult[cult] == 10) player.keys++; //get the town key back\r\n if(player.cult[cult] < num) player.cult[cult] = 0;\r\n else player.cult[cult] += num; //negative so subtracted\r\n }\r\n}", "title": "" }, { "docid": "9175bb6dcb54f7e3343f68ceccc29391", "score": "0.5282638", "text": "buildCharacter() {\n // Create the base character (no features, augmentations, or equipment)\n // This is what will be modified for tne new build.\n const build = this.getBaseCharacter()\n\n // Very common: list of proficiencies can be updated from multiple places\n function adjustProficiencies(proficiencyType, proficiencies) {\n proficiencies.forEach(p => {\n if (!build[proficiencyType].includes(p)) {\n build[proficiencyType].push(p);\n }\n })\n }\n\n // Set the character ability scores to the base level (determined in ability score step).\n // Also copy over the baseAbilities for future updates.\n if (this.character.baseAbilities) {\n build.baseAbilities = {}\n build.abilityScores = {}\n Object.entries(this.character.baseAbilities).forEach(([ability, score]) => {\n build.baseAbilities[ability] = score;\n build.abilityScores[ability] = score;\n });\n }\n\n // - Go through every feature on the character and adjust character values\n this.character.features.forEach(feature => {\n // Static features\n feature.types.forEach(type => {\n switch (type) {\n case \"age\":\n build.age_range = feature.age;\n break;\n case \"base_speed\":\n build.base_speed = feature.speed\n break\n case \"climb_speed\":\n build.climb_speed = feature.speed\n break\n case \"asi\":\n if (build.abilityScores) {\n console.log(build.abilityScores)\n feature.ability_score_increase.forEach(asi => {\n build.abilityScores[asi.ability] += asi.increase;\n })\n }\n break;\n case \"skill_proficiency\":\n adjustProficiencies('skill_proficiencies', feature.skill_proficiencies);\n break;\n case \"tool_proficiency\":\n adjustProficiencies('tool_proficiencies', feature.tool_proficiencies);\n break;\n case \"weapon_proficiency\":\n adjustProficiencies('weapon_proficiencies', feature.weapon_proficiencies);\n break;\n case \"armor_proficiency\":\n adjustProficiencies('armor_proficiencies', feature.armor_proficiencies);\n break;\n case \"language_proficiency\":\n adjustProficiencies('languages', feature.languages);\n break\n case \"darkvision\":\n const existingDarkvision = build.senses.filter(sense => sense.type === 'darkvision')\n if (existingDarkvision.length > 0)\n build.senses = build.senses.map(sense => {\n if (sense.type !== 'darkvision' || sense.range > feature.darkvision_range) {\n return sense;\n } else {\n return {type: 'darkvision', range: feature.darkvision_range}\n }\n })\n else {\n build.senses.push({'type': 'darkvision', 'range': feature.darkvision_range});\n }\n break;\n case \"weapon_override\":\n build.weapon_overrides[feature.weapon_type] = feature.weapon_override;\n break;\n case \"natural_armor\":\n build.natural_armor = feature.natural_base_ac;\n break;\n case \"damage_resistance\":\n adjustProficiencies('damage_resistances', feature.damage_types);\n break;\n case \"bonus_action\":\n build.bonus_actions.push({name: feature.name, description: feature.description});\n break;\n case \"influence\":\n Object.entries(feature.influence).forEach(([type,value]) => {\n build.baseInfluence[type] = Math.max(build.baseInfluence[type], value)\n });\n break;\n default:\n console.log('Missing static: ' + type)\n break;\n }\n })\n\n // Choices\n if (feature.hasOwnProperty('choices')) {\n feature.choices.forEach(choice => {\n switch(choice.type) {\n case \"asi\":\n if (this.build.abilityScores) {\n choice.selections.forEach(a => {\n this.build.abilityScores[a] += choice.increase;\n })\n }\n break;\n case \"skill_proficiency\":\n adjustProficiencies('skill_proficiencies', choice.selected.map(s => s.key));\n break;\n case \"tool_proficiency\":\n adjustProficiencies('tool_proficiencies', choice.selected.map(s => s.key));\n break;\n case \"weapon_proficiency\":\n adjustProficiencies('weapon_proficiencies', choice.selected.map(s => s.key));\n break;\n case \"armor_proficiency\":\n adjustProficiencies('armor_proficiencies', choice.selected.map(s => s.key));\n break;\n case \"language_proficiency\":\n adjustProficiencies('languages', choice.selected.map(s => s.key));\n break\n default:\n console.log('Missing choice: ' + choice.type)\n break;\n }\n })\n }\n })\n\n // - Calculate Ability Scores Mods\n if (!build.abilityScores) {\n // NOTE: Everything after this point requires ability modifiers. If that's not set, break here.\n this.character = build;\n return;\n } else {\n build.abilityMods = {}\n Object.entries(build.abilityScores).forEach(([ability,score]) => {\n build.abilityMods[ability] = Math.floor((score - 10) / 2)\n })\n }\n\n // - Calculate AC (based on armor & helmet)\n build.armor = this.character.armor\n build.helmet = this.character.helmet\n if (build.armor) {\n const armorStats = this.data.armor[build.armor]\n switch (armorStats.category) {\n case \"light\":\n build.ac = armorStats.base_ac + build.abilityMods.dexterity;\n break;\n case \"medium\":\n build.ac = armorStats.base_ac + Math.max(2, build.abilityMods.dexterity);\n break;\n case \"heavy\":\n build.ac = armorStats.base_ac\n break;\n default:\n build.ac = build.natural_armor + build.abilityMods.dexterity;\n break;\n }\n } else {\n build.ac = build.natural_armor + build.abilityMods.dexterity;\n }\n\n if (build.helmet) {\n const helmetStats = this.data.armor[build.helmet]\n build.ac += helmetStats.base_ac\n }\n\n // NOTE: Everything after this point requires character level (including proficiency bonus).\n // If that's not set, break here.\n build.level = this.character.level\n if (!build.level) {\n this.character = build;\n return;\n }\n const proficiency = [2,2,2,2,3,3,3,3,4,4][Math.max(build.level - 1, 0)]\n\n // - Calculate skill proficiencies (including half and expertise) (and add passive perception to senses)\n build.skillMods = {}\n Object.entries(this.data.skills).forEach(([skill,data]) => {\n const halfBonus = build.skill_half_proficiencies.includes(skill) ? Math.round(proficiency / 2) : 0;\n const profBonus = build.skill_proficiencies.includes(skill) ? proficiency : 0;\n const expertiseBonus = build.skill_expertise.includes(skill) ? (2 * proficiency) : 0;\n\n build.skillMods[skill] = Math.max(halfBonus, profBonus, expertiseBonus);\n });\n\n // - Create Attacks (based on weapons)\n build.weapons = this.character.weapons\n build.attacks = build.weapons.map(w => {\n const weapon = JSON.parse(JSON.stringify(this.data.weapons[w.type]))\n\n // Apply weapon override\n if (build.weapon_overrides[w.type]) {\n Object.entries(build.weapon_overrides[w.type]).forEach(([prop,override]) => {\n console.log(prop)\n console.log(override)\n weapon[prop] = override;\n console.log(weapon)\n })\n }\n\n var abilityMod = build.abilityMods.dexterity; // Most weapons are light guns in Carbon 2185, so we'll use DEX as a default\n if (['melee','unarmed','heavy_weapons'].includes(weapon.category)) {\n abilityMod = weapon.properties.includes('finesse') ? Math.max(build.abilityMods.strength, build.abilityMods.dexterity) : build.abilityMods.strength\n }\n\n const proficiencyMod = build.weapon_proficiencies.some(p => {\n return (p.category === weapon.category) || (p.type === w.type)\n }) ? proficiency : 0;\n\n // TODO: Add other bonuses, but we'll start with this basic one for now\n const attackBonus = abilityMod + proficiencyMod\n const damageRoll = weapon.damage_dice + '+' + abilityMod\n\n return {\n type: w.type,\n name: weapon.name,\n attackBonus: attackBonus,\n damageRoll: damageRoll,\n damageType: weapon.damage_type,\n range: weapon.range\n }\n })\n\n // TODO: Two-Weapon Fighting\n\n // - Calculate carrying capacity\n\n // - Calculate carried weight and encumbrance\n\n // Finished!\n this.character = build\n }", "title": "" }, { "docid": "39d5c6c71a9401b6c22ffdf17b981b6d", "score": "0.5263269", "text": "function Upgrade(name, price, icePrice, ironPrice, orePrice, uraniumPrice, next = null) {\n this.name = name;\n this.price = price;\n this.icePrice = icePrice;\n this.ironPrice = ironPrice;\n this.orePrice = orePrice;\n this.uraniumPrice = uraniumPrice;\n this.next = next;\n}", "title": "" }, { "docid": "a1226d901e760e81a4ba2316fc8669e9", "score": "0.525438", "text": "function attackFunction(){\n\tattackPower = attackPower + 8\n\t//UNFINISHED\n\t\t//need to track health scores,\n\t\t//subtract counter attacks\n\n\n}", "title": "" }, { "docid": "07e0de89704fab61a227d6c2092db3dc", "score": "0.52499783", "text": "updateOtherStuff() {\n for (const tile of this.game.tiles) {\n const gold = tile.gold * this.game.buryInterestRate;\n tile.gold = Math.min(gold, this.game.settings.maxTileGold);\n if (tile.unit && tile.unit.tile !== tile) {\n tile.unit = undefined; // it died\n }\n }\n this.game.currentPlayer.port.gold = this.game.shipCost;\n }", "title": "" }, { "docid": "692870f8b00965c4ce372a9f65e8400b", "score": "0.5246613", "text": "function costumechange(player)\n{\n\tif (teamOrFFA == 0) //Costume amounts change slightly if it is a FFA or Team game (0 is FFA)\n\t{ \n\t\tif (player == 1)//if already on the player 1\n\t\t{\n\t\t\tif (player1Costume == 5) //restart numbering\n\t\t\t{\n\t\t\t\tplayer1Costume = 0; //1=Normal, 2=Shadow, 3=Inverse, 4=Reverse, 5=Gold Mask (This will be adjusted for full game)\n\t\t\t}\n\t\t\t\tplayer1Costume++;\n\t\t\t\tprint(\"Player 1 Costume is \" + player1Costume); //change player costume every click\n\t\t}\n\t\n\t\telse if (player == 2)//if already on player 2\n\t\t{\n\t\t\tif (player2Costume == 5)\n\t\t\t{\n\t\t\t\tplayer2Costume = 0; //Same values as Player 1 Costumes\n\t\t\t}\n\t\t\t\tplayer2Costume++;\n\t\t\t\tprint (\"Player 2 Costume is \" + player2Costume); \n\t\t}\n\t\t\t\n\t\telse if (player == 3)//if already on player 3\n\t\t{\n\t\t\tif (player3Costume == 5)\n\t\t\t{\n\t\t\t\tplayer3Costume = 0; //Same values as Player 1 Costumes\n\t\t\t}\n\t\t\t\tplayer3Costume++;\n\t\t\t\tprint (\"Player 3 Costume is \" + player3Costume);\n\t\t}\n\t\t\n\t\telse if (player == 4)//if already on player 4\n\t\t{\n\t\t\tif (player4Costume == 5)\n\t\t\t{\n\t\t\t\tplayer4Costume = 0; //Same values as Player 1 Costumes\n\t\t\t}\n\t\t\t\tplayer4Costume++;\n\t\t\t\tprint (\"Player 4 Costume is \" + player4Costume);\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\n\t}\n\t\n\tif (teamOrFFA == 1) //If Team Match\n\t{\n\t\tif (player == 1)//if already on the player 1\n\t\t{\n\t\t\tif (player1Costume == 3) //restart numbering\n\t\t\t{\n\t\t\t\tplayer1Costume = 0; //1=Red, 2=Green, 3=Blue (This may be adjusted for full game)\n\t\t\t}\n\t\t\t\tplayer1Costume++;\n\t\t\t\tprint(\"Player 1 Team is \" + player1Costume); //change player costume every click\n\t\t}\n\t\n\t\telse if (player == 2)//if already on player 2\n\t\t{\n\t\t\tif (player2Costume == 3)\n\t\t\t{\n\t\t\t\tplayer2Costume = 0; //Same values as Player 1 Costumes\n\t\t\t}\n\t\t\t\tplayer2Costume++;\n\t\t\t\tprint (\"Player 2 Team is \" + player2Costume); \n\t\t}\n\t\t\t\n\t\telse if (player == 3)//if already on player 3\n\t\t{\n\t\t\tif (player3Costume == 3)\n\t\t\t{\n\t\t\t\tplayer3Costume = 0; //Same values as Player 1 Costumes\n\t\t\t}\n\t\t\t\tplayer3Costume++;\n\t\t\t\tprint (\"Player 3 Team is \" + player3Costume);\n\t\t}\n\t\t\n\t\telse if (player == 4)//if already on player 4\n\t\t{\n\t\t\tif (player4Costume == 3)\n\t\t\t{\n\t\t\t\tplayer4Costume = 0; //Same values as Player 1 Costumes\n\t\t\t}\n\t\t\t\tplayer4Costume++;\n\t\t\t\tprint (\"Player 4 Team is \" + player4Costume);\n\t\t}\n\t\t\t\t\n\t}\n\t\n\t//Training Mode Costumes\n\telse if (player == 5) //if already on training player\n\t\t{\n\t\t\tif (trainingPlayerCostume == 5)\n\t\t\t{\n\t\t\t\ttrainingPlayerCostume = 0; //Same as multiplayer values\n\t\t\t}\n\t\t\t\ttrainingPlayerCostume++;\n\t\t\t\tprint (\"Player Costume is \" + trainingPlayerCostume);\n\t\t}\n\t\t\n\telse if (player == 6) //if already on trainer\n\t\t{\n\t\t\tif (trainingComputerCostume == 5)\n\t\t\t{\n\t\t\t\ttrainingComputerCostume = 0; //Same as multiplayer values\n\t\t\t}\n\t\t\t\ttrainingComputerCostume++;\n\t\t\t\tprint (\"Player Costume is \" + trainingComputerCostume);\n\t\t}\n\n}", "title": "" }, { "docid": "b2deff0fb3f931c8af5b1a01801ec08e", "score": "0.5239695", "text": "function increaseAttackPower(){\n player.attackPower = (player.attackPower + 10);\n }", "title": "" }, { "docid": "6ff1db9910bf58f8ecd4e94fb085a538", "score": "0.52295214", "text": "function upgradePrint(upgradeAmount){\n\tvar printUpgradeCost = Math.floor(100 * Math.pow(1.1,printUpgradeAmount));\n\tif(money >= printUpgradeCost){\n\t\tprintUpgradeAmount = printUpgradeAmount + 1;\n\t\tmoney = money - printUpgradeCost;\n\t\tdocument.getElementById('printUpgradeAmount').innerHTML = printUpgradeAmount;\n\t\tdocument.getElementById('money').innerHTML = money;\n\t}\n\tvar nextPrintUpgradeCost = Math.floor(10 * Math.pow(1.1,printUpgradeAmount));\n\tdocument.getElementById('printUpgradeCost').innerHTML = nextPrintUpgradeCost;\n}", "title": "" }, { "docid": "754dedcccae2eac71375d8ff1a1469e8", "score": "0.5213777", "text": "function CacheUpgradeIncome() {\n CacheUpgrades = {};\n for (let i = 0; i < Game.UpgradesInStore.length; i++) {\n const upgradeName = Game.UpgradesInStore[i].name;\n const bonusIncome = BuyUpgradesBonusIncome(upgradeName);\n if (upgradeName === 'Elder Pledge') {\n CacheUpgrades[upgradeName] = {\n bonus: Game.cookiesPs - CacheAverageGainBank,\n };\n if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 1)\n CacheUpgrades[upgradeName].bonus -= CacheAverageGainWrink;\n else if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.CalcWrink === 2)\n CacheUpgrades[upgradeName].bonus -= CacheAverageGainWrinkFattest;\n if (!Number.isFinite(CacheUpgrades[upgradeName].bonus)) CacheUpgrades[upgradeName].bonus = 0;\n } else {\n CacheUpgrades[upgradeName] = {};\n if (bonusIncome[0]) CacheUpgrades[upgradeName].bonus = bonusIncome[0];\n if (bonusIncome[1]) CacheUpgrades[upgradeName].bonusMouse = bonusIncome[1];\n }\n }\n}", "title": "" }, { "docid": "f9dfc2ac2bc0efc0adaca2c4e7635735", "score": "0.5206185", "text": "function Sprite_AbilityCost() { this.initialize(...arguments); }", "title": "" }, { "docid": "e9220dbb92bc0051fc4ca44307a8cc71", "score": "0.5204298", "text": "function DeductPoints(WeaponDamage: int){\n\thealth = health - WeaponDamage;\n}", "title": "" }, { "docid": "98f6708a1c32c0983a47e0fd348a46ab", "score": "0.5200646", "text": "function coreLoop(){\r\n if (player.abilityCharges[2] > 0) populateBonusBalls();\r\n refreshPool();\r\n //buyTicket();\r\n runLottery();\r\n updateBallLabels();\r\n updateCash();\r\n generateXP();\r\n updateStats(true);\r\n\r\n if (!player.powerupsUnlocked && player.money > consts.powerupBaseCost) {\r\n document.getElementById(\"mainMenuPowerups\").onclick=Function(\"changeMainTab('Powerups')\");\r\n document.getElementById(\"mainMenuPowerups\").innerHTML=\"Powerups\";\r\n }\r\n\r\n // Use up ability charges\r\n for (var i=0; i<3; i++){\r\n if (player.abilityCharges[0][i] > 0) player.abilityCharges[0][i]--;\r\n }\r\n if (player.abilityCharges[1] > 0) player.abilityCharges[1]--;\r\n if (player.abilityCharges[2] > 0) player.abilityCharges[2]--;\r\n if (player.abilityCharges[5] > 0) player.abilityCharges[5]--;\r\n // Decay ability 5 bonuses\r\n if (player.ability5Bonus > 0){\r\n player.ability5Bonus *= 1-(player.abilityLevels[4] >= 5 ? consts.ability5DecayLvl5 : consts.ability5Decay);\r\n if (player.ability5Bonus < .01) player.ability5Bonus = 0;\r\n }\r\n\r\n // Turn on abilities\r\n if (player.matchArr[0] && player.abilityLevels[0] > 0){\r\n if (player.abilityLevels[0] >= 5){\r\n player.abilityCharges[0][2] = player.abilityCharges[0][1];\r\n player.abilityCharges[0][1] = player.abilityCharges[0][0];\r\n player.abilityCharges[0][0] = 3;\r\n } else {\r\n player.abilityCharges[0][0] = 2;\r\n }\r\n } \r\n if (player.matchArr[1] && player.abilityLevels[1] > 0) player.abilityCharges[1] = 2;\r\n if (player.matchArr[2] && player.abilityLevels[2] > 0) player.abilityCharges[2] = 1;\r\n if (player.matchArr[4] && player.abilityLevels[4] > 0) player.ability5Bonus += getAbilityStrength(4,false);\r\n if (player.matchArr[5] && player.abilityLevels[5] > 0) player.abilityCharges[5] = getAbilityStrength(5,false);\r\n\r\n // Update ability status labels\r\n if (player.abilityLevels[0] >= 5){\r\n document.getElementById(\"0abilityChargeSpan\").innerHTML = formatValue(player.abilityCharges[0][0],2,0)+\"-\"+formatValue(player.abilityCharges[0][1],2,0)+\"-\"+formatValue(player.abilityCharges[0][2],2,0);\r\n }else{\r\n document.getElementById(\"0abilityChargeSpan\").innerHTML = formatValue(player.abilityCharges[0][0],2,0);\r\n }\r\n document.getElementById(\"1abilityChargeSpan\").innerHTML = formatValue(player.abilityCharges[1],2,0);\r\n document.getElementById(\"2abilityChargeSpan\").innerHTML = formatValue(player.abilityCharges[2],2,0);\r\n document.getElementById(\"4abilityChargeSpan\").innerHTML = formatValue(player.ability5Bonus*100,2,2);\r\n document.getElementById(\"5abilityChargeSpan\").innerHTML = formatValue(player.abilityCharges[5],2,0);\r\n\r\n // Calculate the time until next draw and call it\r\n var ts = calcTickSpeed();\r\n\r\n // Speed it up for abilities 2 and PB\r\n if (player.abilityCharges[1] > 0){\r\n ts=ts/(1+getAbilityStrength(1,false));\r\n }\r\n if (player.abilityCharges[5] > 0){\r\n ts=ts/10;\r\n }\r\n player.timeBank-=ts;\r\n\r\n if (player.timeBank < 0) player.timeBank=0;\r\n window.setTimeout(function(){coreLoop();}, ts);\r\n \r\n document.getElementById(\"bonusTimeSpan\").innerHTML=Math.floor(player.timeBank/1000);\r\n}", "title": "" }, { "docid": "7afb18264e1951e439c14f61dba52464", "score": "0.51918244", "text": "function calculateChampionResourceChange(champion) {\n\t\t\tswitch(champion.resourceType) {\n\t\t\t\tcase 'mana':\n\t\t\t\tcase 'energy':\n\t\t\t}\n\t\t\treturn 0;\n\t\t}", "title": "" }, { "docid": "55489231d91a6c996f37252509a74472", "score": "0.5184776", "text": "function displayUpgrades(){\n // start with all upgrades hidden\n for (var i=0; i < numOfUpgrades; i++) {\n document.getElementById(\"up\" + i.toString()).style = \"display: none\";\n }\n // show the next upgrade to player damage\n\tswitch(selfupgrades){\n\t\tcase 0:\n\t\t\tdocument.getElementById(\"up0\").style = \"display: block\";\n document.getElementById(\"up0\").innerHTML = \"X5 Power to Manual Attack $\" + upgradeSelfCost[0];\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tdocument.getElementById(\"up2\").style = \"display: block\";\n document.getElementById(\"up2\").innerHTML = \"X5 Power to Manual Attack $\" + upgradeSelfCost[1];\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdocument.getElementById(\"up4\").style = \"display: block\";\n document.getElementById(\"up4\").innerHTML = \"X5 Power to Manual Attack $\" + upgradeSelfCost[2];\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdocument.getElementById(\"up6\").style = \"display: block\";\n document.getElementById(\"up6\").innerHTML = \"X5 Power to Manual Attack $\" + upgradeSelfCost[3];\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tdocument.getElementById(\"up8\").style = \"display: block\";\n document.getElementById(\"up8\").innerHTML = \"X5 Power to Manual Attack $\" + upgradeSelfCost[4];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//do nothing\t\n\t}\n // show the next upgrade to hero damage\n\tswitch(heroupgrades){\n\t\tcase 0:\n\t\t\tdocument.getElementById(\"up1\").style = \"display: block\";\n document.getElementById(\"up1\").innerHTML = \"X2 Power to Hero 1 $\" + upgradeHeroCost[0];\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tdocument.getElementById(\"up3\").style = \"display: block\";\n document.getElementById(\"up3\").innerHTML = \"X2 Power to Hero 2 $\" + upgradeHeroCost[1];\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdocument.getElementById(\"up5\").style = \"display: block\";\n document.getElementById(\"up5\").innerHTML = \"X2 Power to Hero 3 $\" + upgradeHeroCost[2];\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdocument.getElementById(\"up7\").style = \"display: block\";\n document.getElementById(\"up7\").innerHTML = \"X2 Power to Hero 4 $\" + upgradeHeroCost[3];\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tdocument.getElementById(\"up9\").style = \"display: block\";\n document.getElementById(\"up9\").innerHTML = \"X2 Power to Hero 5 $\" + upgradeHeroCost[4];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//do nothing\t\n\t}\n}", "title": "" }, { "docid": "83426c51d848ac868d2e94d48c05e877", "score": "0.5177813", "text": "function sixSkillGenerateForClubPortiere(startPlayer1){\r\n var player1={};\r\n player1[\"Pace\"]=0;\r\n player1[\"Passing\"]=0;\r\n player1[\"Defending\"]=startPlayer1[\"Reactions\"]*0.06+startPlayer1[\"GKDiving\"]*0.24+startPlayer1[\"GKHandling\"]*0.22,startPlayer1[\"GKKicking\"]*0.04,startPlayer1[\"GKPositioning\"]*0.22,startPlayer1[\"GKReflexes\"]*0.22;\r\n player1[\"Shooting\"]=0;\r\n player1[\"Dribbling\"]=0;\r\n player1[\"Physical\"]=0;\r\n return player1;\r\n}", "title": "" }, { "docid": "fc80e9f92da1813dfa5b0b0352b072c6", "score": "0.51722807", "text": "_prepareCharacterData(actorData) {\n const data = actorData.data;\n\n //Characteristic Bonuses\n var strBonus = Math.floor(data.characteristics.str.value / 10);\n var forBonus = Math.floor(data.characteristics.for.value / 10);\n var endBonus = Math.floor(data.characteristics.end.value / 10);\n var agiBonus = Math.floor(data.characteristics.agi.value / 10);\n var intBonus = Math.floor(data.characteristics.int.value / 10);\n var wpBonus = Math.floor(data.characteristics.wp.value / 10);\n var prcBonus = Math.floor(data.characteristics.prc.value / 10);\n var perBonus = Math.floor(data.characteristics.per.value / 10);\n var prsBonus = Math.floor(data.characteristics.prs.value / 10);\n var socBonus = Math.floor(data.characteristics.soc.value / 10);\n var lckBonus = Math.floor(data.characteristics.lck.value / 10);\n\n //Skill Bonus Calculation\n const legacyUntrained = game.settings.get(\"uesrpg-d100\", \"legacyUntrainedPenalty\");\n\n if (legacyUntrained) {\n for (var skill in data.skills) {\n if (data.skills[skill].rank == \"untrained\") {\n data.skills[skill].bonus = -20;\n } else if (data.skills[skill].rank == \"novice\") {\n data.skills[skill].bonus = 0;\n } else if (data.skills[skill].rank == \"apprentice\") {\n data.skills[skill].bonus = 10;\n } else if (data.skills[skill].rank == \"journeyman\") {\n data.skills[skill].bonus = 20;\n } else if (data.skills[skill].rank == \"adept\") {\n data.skills[skill].bonus = 30;\n } else if (data.skills[skill].rank == \"expert\") {\n data.skills[skill].bonus = 40;\n } else if (data.skills[skill].rank == \"master\") {\n data.skills[skill].bonus = 50;\n }\n }\n\n } else {\n for (var skill in data.skills) {\n if (data.skills[skill].rank == \"untrained\") {\n data.skills[skill].bonus = -10;\n } else if (data.skills[skill].rank == \"novice\") {\n data.skills[skill].bonus = 0;\n } else if (data.skills[skill].rank == \"apprentice\") {\n data.skills[skill].bonus = 10;\n } else if (data.skills[skill].rank == \"journeyman\") {\n data.skills[skill].bonus = 20;\n } else if (data.skills[skill].rank == \"adept\") {\n data.skills[skill].bonus = 30;\n } else if (data.skills[skill].rank == \"expert\") {\n data.skills[skill].bonus = 40;\n } else if (data.skills[skill].rank == \"master\") {\n data.skills[skill].bonus = 50;\n }\n }\n }\n\n //Magic Skill Bonus Calculation\n if (legacyUntrained) {\n for (var skill in data.magic_skills) {\n if (data.magic_skills[skill].rank == \"untrained\") {\n data.magic_skills[skill].bonus = -20;\n } else if (data.magic_skills[skill].rank == \"novice\") {\n data.magic_skills[skill].bonus = 0;\n } else if (data.magic_skills[skill].rank == \"apprentice\") {\n data.magic_skills[skill].bonus = 10;\n } else if (data.magic_skills[skill].rank == \"journeyman\") {\n data.magic_skills[skill].bonus = 20;\n } else if (data.magic_skills[skill].rank == \"adept\") {\n data.magic_skills[skill].bonus = 30;\n } else if (data.magic_skills[skill].rank == \"expert\") {\n data.magic_skills[skill].bonus = 40;\n } else if (data.magic_skills[skill].rank == \"master\") {\n data.magic_skills[skill].bonus = 50;\n }\n }\n } else {\n for (var skill in data.magic_skills) {\n if (data.magic_skills[skill].rank == \"untrained\") {\n data.magic_skills[skill].bonus = -10;\n } else if (data.magic_skills[skill].rank == \"novice\") {\n data.magic_skills[skill].bonus = 0;\n } else if (data.magic_skills[skill].rank == \"apprentice\") {\n data.magic_skills[skill].bonus = 10;\n } else if (data.magic_skills[skill].rank == \"journeyman\") {\n data.magic_skills[skill].bonus = 20;\n } else if (data.magic_skills[skill].rank == \"adept\") {\n data.magic_skills[skill].bonus = 30;\n } else if (data.magic_skills[skill].rank == \"expert\") {\n data.magic_skills[skill].bonus = 40;\n } else if (data.magic_skills[skill].rank == \"master\") {\n data.magic_skills[skill].bonus = 50;\n }\n }\n }\n\n //Combat Style Skill Bonus Calculation\n if (legacyUntrained) {\n for (var skill in data.combat_styles) {\n if (data.combat_styles[skill].rank == \"untrained\") {\n data.combat_styles[skill].bonus = -20 + this._untrainedException(actorData);\n } else if (data.combat_styles[skill].rank == \"novice\") {\n data.combat_styles[skill].bonus = 0;\n } else if (data.combat_styles[skill].rank == \"apprentice\") {\n data.combat_styles[skill].bonus = 10;\n } else if (data.combat_styles[skill].rank == \"journeyman\") {\n data.combat_styles[skill].bonus = 20;\n } else if (data.combat_styles[skill].rank == \"adept\") {\n data.combat_styles[skill].bonus = 30;\n } else if (data.combat_styles[skill].rank == \"expert\") {\n data.combat_styles[skill].bonus = 40;\n } else if (data.combat_styles[skill].rank == \"master\") {\n data.combat_styles[skill].bonus = 50;\n }\n }\n } else {\n for (var skill in data.combat_styles) {\n if (data.combat_styles[skill].rank == \"untrained\") {\n data.combat_styles[skill].bonus = -10 + this._untrainedException(actorData);\n } else if (data.combat_styles[skill].rank == \"novice\") {\n data.combat_styles[skill].bonus = 0;\n } else if (data.combat_styles[skill].rank == \"apprentice\") {\n data.combat_styles[skill].bonus = 10;\n } else if (data.combat_styles[skill].rank == \"journeyman\") {\n data.combat_styles[skill].bonus = 20;\n } else if (data.combat_styles[skill].rank == \"adept\") {\n data.combat_styles[skill].bonus = 30;\n } else if (data.combat_styles[skill].rank == \"expert\") {\n data.combat_styles[skill].bonus = 40;\n } else if (data.combat_styles[skill].rank == \"master\") {\n data.combat_styles[skill].bonus = 50;\n }\n }\n }\n\n // Skill TN Calculation\n for (var skill in data.skills) {\n if (data.skills[skill].characteristic == \"str\") {\n data.skills[skill].tn = data.characteristics.str.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"for\") {\n data.skills[skill].tn = data.characteristics.for.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"end\") {\n data.skills[skill].tn = data.characteristics.end.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"agi\") {\n data.skills[skill].tn = data.characteristics.agi.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"int\") {\n data.skills[skill].tn = data.characteristics.int.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"wp\") {\n data.skills[skill].tn = data.characteristics.wp.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"prc\") {\n data.skills[skill].tn = data.characteristics.prc.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"per\") {\n data.skills[skill].tn = data.characteristics.per.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"prs\") {\n data.skills[skill].tn = data.characteristics.prs.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"soc\") {\n data.skills[skill].tn = data.characteristics.soc.value + data.skills[skill].bonus;\n } else if (data.skills[skill].characteristic == \"lck\") {\n data.skills[skill].tn = data.characteristics.lck.value + data.skills[skill].bonus;\n }\n }\n\n //Magic Skill TN Calculation\n for (var skill in data.magic_skills) {\n if (data.magic_skills[skill].characteristic == \"str\") {\n data.magic_skills[skill].tn = data.characteristics.str.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"for\") {\n data.magic_skills[skill].tn = data.characteristics.for.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"end\") {\n data.magic_skills[skill].tn = data.characteristics.end.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"agi\") {\n data.magic_skills[skill].tn = data.characteristics.agi.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"int\") {\n data.magic_skills[skill].tn = data.characteristics.int.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"wp\") {\n data.magic_skills[skill].tn = data.characteristics.wp.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"prc\") {\n data.magic_skills[skill].tn = data.characteristics.prc.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"per\") {\n data.magic_skills[skill].tn = data.characteristics.per.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"prs\") {\n data.magic_skills[skill].tn = data.characteristics.prs.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"soc\") {\n data.magic_skills[skill].tn = data.characteristics.end.value + data.magic_skills[skill].bonus;\n } else if (data.magic_skills[skill].characteristic == \"lck\") {\n data.magic_skills[skill].tn = data.characteristics.lck.value + data.magic_skills[skill].bonus;\n }\n }\n\n // Combat Style Skill Calculation\n for (var skill in data.combat_styles) {\n if (data.combat_styles[skill].characteristic == \"str\") {\n data.combat_styles[skill].tn = data.characteristics.str.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"for\") {\n data.combat_styles[skill].tn = data.characteristics.for.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"end\") {\n data.combat_styles[skill].tn = data.characteristics.end.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"agi\") {\n data.combat_styles[skill].tn = data.characteristics.agi.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"int\") {\n data.combat_styles[skill].tn = data.characteristics.int.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"wp\") {\n data.combat_styles[skill].tn = data.characteristics.wp.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"prc\") {\n data.combat_styles[skill].tn = data.characteristics.prc.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"per\") {\n data.combat_styles[skill].tn = data.characteristics.per.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"prs\") {\n data.combat_styles[skill].tn = data.characteristics.prs.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"soc\") {\n data.combat_styles[skill].tn = data.characteristics.soc.value + data.combat_styles[skill].bonus;\n } else if (data.combat_styles[skill].characteristic == \"lck\") {\n data.combat_styles[skill].tn = data.characteristics.lck.value + data.combat_styles[skill].bonus;\n }\n }\n\n //Talent/Power/Trait Resource Bonuses\n data.hp.bonus = this._hpBonus(actorData);\n data.magicka.bonus = this._mpBonus(actorData);\n data.stamina.bonus = this._spBonus(actorData);\n data.luck_points.bonus = this._lpBonus(actorData);\n data.wound_threshold.bonus = this._wtBonus(actorData);\n data.speed.bonus = this._speedBonus(actorData);\n data.initiative.bonus = this._iniBonus(actorData);\n\n //Talent/Power/Trait Resistance Bonuses\n data.resistance.diseaseR = this._diseaseR(actorData);\n data.resistance.fireR = this._fireR(actorData);\n data.resistance.frostR = this._frostR(actorData);\n data.resistance.shockR = this._shockR(actorData);\n data.resistance.poisonR = this._poisonR(actorData);\n data.resistance.magicR = this._magicR(actorData);\n data.resistance.natToughness = this._natToughnessR(actorData);\n data.resistance.silverR = this._silverR(actorData);\n data.resistance.sunlightR = this._sunlightR(actorData);\n\n //Derived Calculations\n if (this._isMechanical(actorData) == true) {\n data.wound_threshold.base = strBonus + (endBonus * 2);\n } else {\n data.wound_threshold.base = strBonus + endBonus + wpBonus + (data.wound_threshold.bonus);\n }\n data.wound_threshold.value = data.wound_threshold.base;\n data.wound_threshold.value = this._woundThresholdCalc(actorData);\n \n data.speed.base = strBonus + (2 * agiBonus) + (data.speed.bonus);\n data.speed.value = this._speedCalc(actorData);\n data.speed.swimSpeed = parseFloat(this._swimCalc(actorData)) + parseFloat((data.speed.value/2).toFixed(0));\n data.speed.flySpeed = this._flyCalc(actorData);\n\n data.initiative.base = agiBonus + intBonus + prcBonus + (data.initiative.bonus);\n data.initiative.value = data.initiative.base;\n data.initiative.value = this._iniCalc(actorData);\n\n data.hp.base = Math.ceil(data.characteristics.end.value / 2);\n data.hp.max = data.hp.base + data.hp.bonus;\n\n data.magicka.max = data.characteristics.int.value + data.magicka.bonus + this._addIntToMP(actorData);\n\n data.stamina.max = endBonus + data.stamina.bonus;\n\n data.luck_points.max = lckBonus + data.luck_points.bonus;\n\n data.carry_rating.max = Math.floor((4 * strBonus) + (2 * endBonus)) + data.carry_rating.bonus;\n this._sortCarriedItems(actorData);\n data.current_enc = (this._calculateENC(actorData) - this._armorWeight(actorData) - this._excludeENC(actorData)).toFixed(1);\n\n //Form Shift Calcs\n if (this._wereWolfForm(actorData) === true) {\n actorData.data.resistance.silverR = actorData.data.resistance.silverR - 5;\n actorData.data.resistance.diseaseR = actorData.data.resistance.diseaseR + 200;\n actorData.data.hp.max = actorData.data.hp.max + 5;\n actorData.data.stamina.max = actorData.data.stamina.max + 1;\n actorData.data.speed.base = data.speed.base + 9;\n data.speed.value = this._speedCalc(actorData);\n data.speed.swimSpeed = (data.speed.value/2).toFixed(0);\n actorData.data.resistance.natToughness = 5;\n actorData.data.wound_threshold.base = actorData.data.wound_threshold.base + 5;\n actorData.data.action_points.max = actorData.data.action_points.max - 1;\n actorData.data.skills.survival.tn = actorData.data.skills.survival.tn + 30;\n actorData.data.skills.navigate.tn = actorData.data.skills.navigate.tn + 30;\n actorData.data.skills.observe.tn = actorData.data.skills.observe.tn + 30;\n } else if (this._wereBatForm(actorData) === true) {\n actorData.data.resistance.silverR = actorData.data.resistance.silverR - 5;\n actorData.data.resistance.diseaseR = actorData.data.resistance.diseaseR + 200;\n actorData.data.hp.max = actorData.data.hp.max + 5;\n actorData.data.stamina.max = actorData.data.stamina.max + 1;\n actorData.data.speed.value = (this._speedCalc(actorData)/2).toFixed(0);\n actorData.data.speed.flySpeed = actorData.data.speed.base + 9;\n data.speed.swimSpeed = (data.speed.value/2).toFixed(0);\n actorData.data.resistance.natToughness = 5;\n actorData.data.wound_threshold.base = actorData.data.wound_threshold.base + 3;\n actorData.data.action_points.max = actorData.data.action_points.max - 1;\n actorData.data.skills.survival.tn = actorData.data.skills.survival.tn + 30;\n actorData.data.skills.navigate.tn = actorData.data.skills.navigate.tn + 30;\n actorData.data.skills.observe.tn = actorData.data.skills.observe.tn + 30;\n } else if (this._wereBoarForm(actorData) === true) {\n actorData.data.resistance.silverR = actorData.data.resistance.silverR - 5;\n actorData.data.resistance.diseaseR = actorData.data.resistance.diseaseR + 200;\n actorData.data.hp.max = actorData.data.hp.max + 5;\n actorData.data.speed.base = data.speed.base + 9;\n data.speed.value = this._speedCalc(actorData);\n data.speed.swimSpeed = (data.speed.value/2).toFixed(0);\n actorData.data.resistance.natToughness = 7;\n actorData.data.wound_threshold.base = actorData.data.wound_threshold.base + 5;\n actorData.data.action_points.max = actorData.data.action_points.max - 1;\n actorData.data.skills.survival.tn = actorData.data.skills.survival.tn + 30;\n actorData.data.skills.navigate.tn = actorData.data.skills.navigate.tn + 30;\n actorData.data.skills.observe.tn = actorData.data.skills.observe.tn + 30;\n } else if (this._wereBearForm(actorData) === true) {\n actorData.data.resistance.silverR = actorData.data.resistance.silverR - 5;\n actorData.data.resistance.diseaseR = actorData.data.resistance.diseaseR + 200;\n actorData.data.hp.max = actorData.data.hp.max + 10;\n actorData.data.stamina.max = actorData.data.stamina.max + 1;\n actorData.data.speed.base = data.speed.base + 5;\n data.speed.value = this._speedCalc(actorData);\n data.speed.swimSpeed = (data.speed.value/2).toFixed(0);\n actorData.data.resistance.natToughness = 5;\n actorData.data.wound_threshold.base = actorData.data.wound_threshold.base + 5;\n actorData.data.action_points.max = actorData.data.action_points.max - 1;\n actorData.data.skills.survival.tn = actorData.data.skills.survival.tn + 30;\n actorData.data.skills.navigate.tn = actorData.data.skills.navigate.tn + 30;\n actorData.data.skills.observe.tn = actorData.data.skills.observe.tn + 30;\n } else if (this._wereCrocodileForm(actorData) === true) {\n actorData.data.resistance.silverR = actorData.data.resistance.silverR - 5;\n actorData.data.resistance.diseaseR = actorData.data.resistance.diseaseR + 200;\n actorData.data.hp.max = actorData.data.hp.max + 5;\n actorData.data.stamina.max = actorData.data.stamina.max + 1;\n actorData.data.speed.value = (this._addHalfSpeed(actorData)).toFixed(0);\n actorData.data.speed.swimSpeed = parseFloat(this._speedCalc(actorData)) + 9;\n actorData.data.resistance.natToughness = 5;\n actorData.data.wound_threshold.base = actorData.data.wound_threshold.base + 5;\n actorData.data.action_points.max = actorData.data.action_points.max - 1;\n actorData.data.skills.survival.tn = actorData.data.skills.survival.tn + 30;\n actorData.data.skills.navigate.tn = actorData.data.skills.navigate.tn + 30;\n actorData.data.skills.observe.tn = actorData.data.skills.observe.tn + 30;\n } else if (this._wereVultureForm(actorData) === true) {\n actorData.data.resistance.silverR = actorData.data.resistance.silverR - 5;\n actorData.data.resistance.diseaseR = actorData.data.resistance.diseaseR + 200;\n actorData.data.hp.max = actorData.data.hp.max + 5;\n actorData.data.stamina.max = actorData.data.stamina.max + 1;\n actorData.data.speed.value = (this._speedCalc(actorData)/2).toFixed(0);\n actorData.data.speed.flySpeed = actorData.data.speed.base + 9;\n data.speed.swimSpeed = (data.speed.value/2).toFixed(0);\n actorData.data.resistance.natToughness = 5;\n actorData.data.wound_threshold.base = actorData.data.wound_threshold.base + 3;\n actorData.data.action_points.max = actorData.data.action_points.max - 1;\n actorData.data.skills.survival.tn = actorData.data.skills.survival.tn + 30;\n actorData.data.skills.navigate.tn = actorData.data.skills.navigate.tn + 30;\n actorData.data.skills.observe.tn = actorData.data.skills.observe.tn + 30;\n } else if (this._vampireLordForm(actorData) === true) {\n actorData.data.resistance.fireR = actorData.data.resistance.fireR - 1;\n actorData.data.resistance.sunlightR = actorData.data.resistance.sunlightR - 1;\n actorData.data.speed.flySpeed = 5;\n actorData.data.hp.max = actorData.data.hp.max + 5;\n actorData.data.magicka.max = actorData.data.magicka.max + 25;\n actorData.data.resistance.natToughness = 3;\n }\n\n //Speed Recalculation\n actorData.data.speed.value = this._addHalfSpeed(actorData);\n\n //ENC Burden Calculations\n if (data.current_enc > data.carry_rating.max * 3) {\n data.speed.value = 0;\n data.stamina.max = data.stamina.max - 5;\n } else if (data.current_enc > data.carry_rating.max * 2) {\n data.speed.value = Math.floor(data.speed.base / 2);\n data.stamina.max = data.stamina.max - 3;\n } else if (data.current_enc > data.carry_rating.max) {\n data.speed.value = data.speed.value - 1;\n data.stamina.max = data.stamina.max - 1;\n }\n\n //Armor Weight Class Calculations\n if (data.armor_class == \"super_heavy\") {\n data.speed.value = data.speed.value - 3;\n data.speed.swimSpeed = data.speed.swimSpeed - 3;\n } else if (data.armor_class == \"heavy\") {\n data.speed.value = data.speed.value - 2;\n data.speed.swimSpeed = data.speed.swimSpeed - 2;\n } else if (data.armor_class == \"medium\") {\n data.speed.value = data.speed.value - 1;\n data.speed.swimSpeed = data.speed.swimSpeed - 1;\n } else {\n data.speed.value = data.speed.value;\n data.speed.swimSpeed = data.speed.swimSpeed;\n }\n\n //Les critiques\n\n //Wounded Penalties\n let woundPen = -20;\n data.woundPenalty = woundPen;\n\n if (this._painIntolerant(actorData) === true) {\n woundPen = -30;\n data.woundPenalty = woundPen;\n }\n\n let halfWound = woundPen / 2;\n let woundIni = -2;\n let halfWoundIni = woundIni / 2;\n\n if (data.wounded == true) {\n if (this._halfWoundPenalty(actorData) === true) {\n for (var skill in data.skills) {\n data.skills[skill].tn = data.skills[skill].tn + halfWound;\n }\n for (var skill in data.magic_skills) {\n data.magic_skills[skill].tn = data.magic_skills[skill].tn + halfWound;\n }\n for (var skill in data.combat_styles) {\n data.combat_styles[skill].tn = data.combat_styles[skill].tn + halfWound;\n }\n data.initiative.value = data.initiative.base + halfWoundIni;\n data.woundPenalty = halfWound;\n\n } else if (this._halfWoundPenalty(actorData) === false) {\n for (var skill in data.skills) {\n data.skills[skill].tn = data.skills[skill].tn + woundPen;\n }\n for (var skill in data.magic_skills) {\n data.magic_skills[skill].tn = data.magic_skills[skill].tn + woundPen;\n }\n for (var skill in data.combat_styles) {\n data.combat_styles[skill].tn = data.combat_styles[skill].tn + woundPen;\n }\n data.initiative.value = data.initiative.base + woundIni;\n data.woundPenalty = woundPen;\n }\n }\n\n //Fatigue Penalties\n if (data.stamina.value == -1) {\n for (var skill in data.skills) {\n data.fatigueLevel = -10;\n data.skills[skill].tn = data.skills[skill].tn + this._halfFatiguePenalty(actorData);\n }\n for (var skill in data.magic_skills) {\n data.fatigueLevel = -10;\n data.magic_skills[skill].tn = data.magic_skills[skill].tn + this._halfFatiguePenalty(actorData);\n }\n for (var skill in data.combat_styles) {\n data.fatigueLevel = -10;\n data.combat_styles[skill].tn = data.combat_styles[skill].tn + this._halfFatiguePenalty(actorData);\n }\n\n } else if (data.stamina.value == -2) {\n for (var skill in data.skills) {\n data.fatigueLevel = -20;\n data.skills[skill].tn = data.skills[skill].tn + this._halfFatiguePenalty(actorData);\n }\n for (var skill in data.magic_skills) {\n data.magic_skills[skill].tn = data.magic_skills[skill].tn -20 + this._halfFatiguePenalty(actorData);\n data.fatigueLevel = -20;\n }\n for (var skill in data.combat_styles) {\n data.fatigueLevel = -20;\n data.combat_styles[skill].tn = data.combat_styles[skill].tn + this._halfFatiguePenalty(actorData);\n }\n\n } else if (data.stamina.value == -3) {\n for (var skill in data.skills) {\n data.fatigueLevel = -30;\n data.skills[skill].tn = data.skills[skill].tn + this._halfFatiguePenalty(actorData);\n }\n for (var skill in data.magic_skills) {\n data.fatigueLevel = -30;\n data.magic_skills[skill].tn = data.magic_skills[skill].tn + this._halfFatiguePenalty(actorData);\n }\n for (var skill in data.combat_styles) {\n data.fatigueLevel = -30;\n data.combat_styles[skill].tn = data.combat_styles[skill].tn + this._halfFatiguePenalty(actorData);\n }\n\n } else if (data.stamina.value == -4) {\n for (var skill in data.skills) {\n data.skills[skill].tn = 0;\n }\n for (var skill in data.magic_skills) {\n data.magic_skills[skill].tn = 0;\n }\n for (var skill in data.combat_styles) {\n data.combat_styles[skill].tn = 0;\n }\n\n } else if (data.stamina.value <= -5) {\n for (var skill in data.skills) {\n data.skills[skill].tn = 0;\n }\n for (var skill in data.magic_skills) {\n data.magic_skills[skill].tn = 0;\n }\n for (var skill in data.combat_styles) {\n data.combat_styles[skill].tn = 0;\n }\n }\n\n\n //Worn Armor/Weapons to Actor Sheet\n data.armor.head.ar = this._helmetArmor(actorData);\n data.armor.head.magic_ar = this._helmetMagicArmor(actorData);\n\n data.armor.l_arm.ar = this._larmArmor(actorData);\n data.armor.l_arm.magic_ar = this._larmMagicArmor(actorData);\n\n data.armor.r_arm.ar = this._rarmArmor(actorData);\n data.armor.r_arm.magic_ar = this._rarmMagicArmor(actorData);\n\n data.armor.l_leg.ar = this._llegArmor(actorData);\n data.armor.l_leg.magic_ar = this._llegMagicArmor(actorData);\n\n data.armor.r_leg.ar = this._rlegArmor(actorData);\n data.armor.r_leg.magic_ar = this._rlegMagicArmor(actorData);\n\n data.armor.body.ar = this._bodyArmor(actorData);\n data.armor.body.magic_ar = this._bodyMagicArmor(actorData);\n\n data.shield.br = this._shieldBR(actorData);\n data.shield.magic_br = this._shieldMR(actorData);\n\n }", "title": "" }, { "docid": "7decb6857f3321a1bbf22c4f73e5c498", "score": "0.5172157", "text": "function resetUpgrades(){\n//Destroy the previous array if it has anything in it.\n\tvar index;\n\tfor (index = upgradeArray.length - 1; index >= 0; index--){\n\t\tupgradeArray[index].sprite.destroy(); //Remove the sprite\n\t\tupgradeArray.pop(); // And trash the rest.\n\t}\n\tupgradeX = 40; upgradeY = 150; //Reset these values. Important!\n//Rebuild the array of upgrade sprites\n\tif (cursorsBought >= 10 && !cursorUpgrade10Bought) { // 10 cursors, production x2, cost 50\n\t\tupgradeArray.push({spriteIndex: 0, func: cursorUpgrade10, sprite: 0});\n\t//\tupgradeText += \"<br><button onclick='cursorUpgrade10(50)'>Bronze Cursors - 50</button>\";\n //\tupgradeText += 'Increase Cursor output by 100%';\n\t}\n\tif (farms >= 10 && !farmUpgrade10Bought) { // 10 farms, production x2, cost 250\n\tupgradeArray.push({spriteIndex: 1, func: farmUpgrade10, sprite: 0});\n\t//\tupgradeText += \"<br><button onclick='farmUpgrade10(250)'>Bronze Tractors - 250</button>\";\n //\tupgradeText += 'Increase Farm output by 100%';\n\t}\n\t// 10 towns, production x2, cost 1500\n\tif (towns >= 10 && !townUpgrade10Bought) upgradeArray.push({spriteIndex: 2, func: townUpgrade10, sprite: 0});\n//Display on screen\n\tupgradeArray.forEach(displayUpgrade);\n\t\n}", "title": "" }, { "docid": "25ffb7f77564607e583b0b113bd8df17", "score": "0.5166436", "text": "function getPointGen() {\n\tif(!canGenPoints())\n\t\treturn new Decimal(0)\n\n let gain = new Decimal(1)\n if (hasUpgrade(\"m\",11)) gain = gain.times(layers.m.effect())\n if (hasUpgrade(\"h\", 12)) gain = gain.times(2)\n if (hasUpgrade(\"h\", 13)) gain = gain.times(2)\n if (hasUpgrade(\"h\", 14)) gain = gain.times(upgradeEffect(\"h\", 14))\n if (hasUpgrade(\"h\", 21)) gain = gain.times(4)\n if (hasUpgrade(\"h\", 22)) gain = gain.times(upgradeEffect(\"h\", 22))\n if (hasUpgrade(\"h\", 23)) gain = gain.times(upgradeEffect(\"h\", 22))\n // if (hasUpgrade(\"m\", 11)) player.m.points = player.m.points.add(1)\n\treturn gain\n}", "title": "" }, { "docid": "76e19df8c5b13d1576276e807040c699", "score": "0.51592183", "text": "function removeEnergy(){\n game.energy -= game.rubbishValue;\n game.energy = Math.max(0, game.energy);\n}", "title": "" }, { "docid": "6e3e70ffbe302b1d378a4a3db8b30bfe", "score": "0.5158114", "text": "function trainer(name, pokemon1, pokemon2, pokemon3) {\n this.name = name;\n this.pokemon1 = pokemon1;\n this.pokemon2 = pokemon2;\n this.pokemon3 = pokemon3;\n this.pkmnArray = [this.pokemon1, this.pokemon2, this.pokemon3]; // need this for swaps\n this.currentlyUseingPokemon = 1;//1, 2, or 3\n this.numberNotKOed = 3;\n this.potions = 1;\n\n this.koUpdate = function () {\n this.pkmnArray = [this.pokemon1, this.pokemon2, this.pokemon3];\n }\n\n this.usePotion = function (whichPKMN) {\n if (this[\"pokemon\" + whichPKMN].currentHealth == this[\"pokemon\" + whichPKMN].maxHealth) {\n return false; // dont let them heal if health is full\n }\n else if (this[\"pokemon\" + whichPKMN].currentHealth > this[\"pokemon\" + whichPKMN].maxHealth - 50) {\n this[\"pokemon\" + whichPKMN].currentHealth = this[\"pokemon\" + whichPKMN].maxHealth;\n this.potions = 0;\n return true;\n }\n else {\n this[\"pokemon\" + whichPKMN].currentHealth += 50;\n this.potions = 0;\n return true;\n }\n }\n\n this.getName = function () {\n return this.name;\n }\n this.setName = function (newName) {\n this.name = newName;\n }\n this.getCurrentlyUseingPokemon = function () {\n return \"pokemon\" + this.currentlyUseingPokemon;\n }\n this.getNumberOfPokemonLeft = function () {\n return this.numberNotKOed;\n }\n this.changePokemon = function (changeTo) {\n // need to reset pokemon array for alive checks\n this.pkmnArray = [this.pokemon1, this.pokemon2, this.pokemon3];\n if (this[\"pokemon\" + changeTo].getCurrentHealth() > 0) {\n this.currentlyUseingPokemon = changeTo;\n //console.log(this[\"pokemon\" + Number(this.currentlyUseingPokemon)]);\n } else {\n //console.log(\"BAD PKMN HP: \" + this[\"pokemon\" + Number(this.currentlyUseingPokemon)].getCurrentHealth());\n return -1;\n }\n }\n this.pokemonKOed = function () {\n this.numberNotKOed = this.numberNotKOed - 1;\n return this.numberNotKOed;\n }\n}", "title": "" }, { "docid": "264a5da0b358c1362f7a56958183d8ef", "score": "0.5154996", "text": "function newTurn() {\n // the frontline who fought last turn gets 1 more turn as frontline, if too many, then they are now fatigued\n // if was frontline, then cannot have refreshed\n if (turns > 1) {\n frontline.frontlineTurns++;\n frontline.refreshed = false;\n if (frontline.frontlineTurns >= 3 && frontline.acted === true) {\n frontline.tired = true;\n }\n }\n for (let i = 0; i < playersList.length; i++) {\n // reset stat changes\n playersList[i].offenseChange = 0;\n playersList[i].defenseChange = 0;\n // if a player character did not use any abilities last turn, it gains refreshed this turn\n if (playersList[i].acted === false) {\n // if not the first turn, give the characters refreshed buff\n if (turns > 1) {\n playersList[i].energyBoost = 3;\n playersList[i].offenseChange = 10;\n playersList[i].defenseChange = 10;\n playersList[i].refreshed = true;\n }\n } else if (playersList[i].acted === true) {\n playersList[i].energyBoost = 0;\n playersList[i].refreshed = false;\n }\n // if the frontline is tired, get debuffs\n if (frontline.tired === true) {\n frontline.offenseChange = -10;\n frontline.defenseChange = -10;\n }\n playersList[i].energy += playersList[i].energyTurn + playersList[i].energyBoost;\n playersList[i].energy = constrain(playersList[i].energy, 0, playersList[i].maxEnergy);\n playersList[i].acted = false;\n // all abilities are no used yet\n for (let i2 = 0; i2 < playersList[i].abilities[0].length; i2++) {\n playersList[i].abilities[0][i2].used = false;\n }\n }\n for (let i = 0; i < enemiesList.length; i++) {\n enemiesList[i].offenseChange = 0;\n enemiesList[i].defenseChange = 0;\n }\n}", "title": "" }, { "docid": "30b4eb3ae172a9d2d9a8eb6100a913c1", "score": "0.51494956", "text": "function saveChanges(Character) {\n /* Affordance in case they did not want a last name :D*/\n if(Character.FamilyName == \"\"){Character.FamilyName = \"Hero\"};\n if(Character.Name == \"\"){Character.Name = \"Brave\"};\n \n \n /* Add in BattleStats */\n PartyMember = Character;\n var AttackStrength = 0;\n var DefenseStrength = 0\n \n \n if (PartyMember.Equipment.Head.Stats == undefined){\n console.log(\"No Headwear On Character\");\n } else {\n DefenseStrength = DefenseStrength + PartyMember.Equipment.Head.Stats.Defense\n };\n \n if (PartyMember.Equipment.Torso.Stats == undefined){\n console.log(\"No Torso On Character\");\n } else {\n DefenseStrength = DefenseStrength + PartyMember.Equipment.Torso.Stats.Defense\n }\n \n if (PartyMember.Equipment.Belt.Stats == undefined){\n console.log(\"No Belt On Character\");\n } else {\n DefenseStrength = DefenseStrength + PartyMember.Equipment.Belt.Stats.Defense\n }\n \n \n if (PartyMember.Equipment.Legs.Stats == undefined){\n console.log(\"No Legs On Character\");\n } else {\n DefenseStrength = DefenseStrength + PartyMember.Equipment.Legs.Stats.Defense\n }\n \n if (PartyMember.Equipment.Ring1.Stats == undefined){\n console.log(\"No Ring1 On Character\");\n } else {\n DefenseStrength = DefenseStrength + PartyMember.Equipment.Ring1.Stats.Defense\n }\n \n \n if (PartyMember.Equipment.Ring2.Stats == undefined){\n console.log(\"No Ring2 On Character\");\n } else {\n DefenseStrength = DefenseStrength + PartyMember.Equipment.Ring2.Stats.Defense\n }\n \n \n \n \n\n if (PartyMember.Equipment.RightHand.Stats == undefined){\n console.log(\" No Item Equipped In Right Hand\")\n } else {\n if (PartyMember.Equipment.RightHand.Stats.Attack != undefined){\n console.log(\"No RightHand Defense For Character\");\n AttackStrength = AttackStrength + PartyMember.Equipment.RightHand.Stats.Attack \n } else if (PartyMember.Equipment.RightHand.Stats.Defense != undefined){\n console.log(\"No RightHand Attack For Character\");\n DefenseStrength = DefenseStrength + PartyMember.Equipment.RightHand.Stats.Defense \n }\n }\n \n if (PartyMember.Equipment.LeftHand.Stats == undefined){\n console.log(\" No Item Equipped In LeftHand \")\n } else {\n if (PartyMember.Equipment.LeftHand.Stats.Attack != undefined){\n console.log(\"No LeftHand Defense For Character\");\n AttackStrength = AttackStrength + PartyMember.Equipment.LeftHand.Stats.Attack \n } else if (PartyMember.Equipment.LeftHand.Stats.Defense != undefined){\n console.log(\"No LeftHand Attack For Character\");\n DefenseStrength = DefenseStrength + PartyMember.Equipment.LeftHand.Stats.Defense \n }\n \n }\n \n \n if (DefenseStrength == 0){\n DefenseStrength = 1;\n }\n \n if (AttackStrength == 0){\n AttackStrength = 1;\n }\n \n \n \n if (PartyMember.Stats[2].Value < 1){\n DefenseStrength = Math.round(( 1 ) * DefenseStrength); \n } else {\n DefenseStrength = Math.round(( PartyMember.Stats[2].Value + .45) * DefenseStrength);\n };\n \n \n if (PartyMember.Stats[1].Value < 1){\n AttackStrength = Math.round(( 1 ) * AttackStrength); \n } else {\n AttackStrength = Math.round(( PartyMember.Stats[1].Value + .25) * AttackStrength);\n };\n \n \n Character.BattleStats.AttackStrength = AttackStrength;\n Character.BattleStats.DefenseStrength= DefenseStrength;\n \n \n \n \n //////////////////////\n \n \n \n \n \n \n \n \n var FirstMove = { Name:\"Punch\",\n Damage:5,\n Cost: 0,\n Type:\"Physical\"};\n Character.Moves.push(FirstMove)\n console.log(Character)\n $(\"#Color\").css(\"background-color\", \"\" + Character.Color + \"\");\n var Party = [];\n Party.push(Character);\n localStorage.setItem('_character', JSON.stringify(Character));\n localStorage.setItem('_Party', JSON.stringify(Party));\n $(\"#App\").load(\"./temp/CutSceneIntro2.html\")\n}", "title": "" }, { "docid": "a9a85ef9d610ab66015b583f7dd2a8a3", "score": "0.5140957", "text": "function changeNumber(champObject) {\n baseHealth.value = champObject.stats.hp;\n baseHealthPlus.value = champObject.stats.hpperlevel;\n baseMana.value = champObject.stats.mp;\n baseManaPlus.value = champObject.stats.mpperlevel;\n hpRegen.value = champObject.stats.hpregen;\n hpRegenPlus.value = champObject.stats.hpregenperlevel;\n manaRegen.value = champObject.stats.mpregen;\n manaRegenPlus.value = champObject.stats.mpregenperlevel;\n damage.value = champObject.stats.attackdamage;\n damagePlus.value = champObject.stats.attackdamageperlevel;\n attackSpeed.value = champObject.stats.attackspeed;\n attackSpeedPlus.value = champObject.stats.attackspeedperlevel;\n armor.value = champObject.stats.armor;\n armorPlus.value = champObject.stats.armorperlevel;\n mr.value = champObject.stats.spellblock;\n mrPlus.value = champObject.stats.spellblockperlevel;\n}", "title": "" }, { "docid": "689e5d61b5924ab75c21f34f19bf7ab0", "score": "0.5134212", "text": "function chargeScoreGrille()\n{\n\tscoreGrille = new scoreGrilleCharge(); // v1.4\n}", "title": "" }, { "docid": "82dd3d175c30b14426c44dc8e17519c2", "score": "0.512352", "text": "function upgradeDamage(){\n\tif (cash >= shopPrice[i] && i<=damageLevelUpgrades.length){\n\t\tcash -=shopPrice[i]\n\t\ti++\n\t\tdocument.getElementById(\"divContainerUC\").innerHTML = (\"Current Price for next upgrade is \"+ shopPrice[i]+\"CM.\");\n\t\tdocument.getElementById(\"bank\").innerHTML =(\"Cash Monies value: \"+cash+\" CM\");\n\t\talert(\"Your power grows...and yet you crave MORE...\");\n\t}\n\telse if ( i === shopPrice.length){\n\t\talert(\"Your power level is already off the charts! WE CAN'T GO HIGHER!\");\n\t}\n\telse if (cash < shopPrice[i]){\n\t\talert(\"Maybe I need to increase the text size if you think you have enough CM\");\n\n\t}\n}", "title": "" }, { "docid": "65d5f4fa383601bc55ba388acc15fb34", "score": "0.51221836", "text": "function Player(){\r\n\tthis.name = \"Player\";\r\n\tthis.money = 0;\r\n\tthis.autoclickers = 0;\r\n\tthis.autoclickercost = 10;\r\n\tthis.activeavatar = 1;\r\n\tthis.activeTheme = 0;\r\n\tthis.gameStartedDate = new Date();\r\n\tthis.gameStarted = this.gameStartedDate.toLocaleDateString();\r\n\tthis.totalClicksEver = 0;\r\n\tthis.totalMoneyEver = 0;\r\n\tthis.totalMoneySpent = 0;\r\n\tthis.clickpower = 1;\r\n\tthis.clickpowercost = 100;\r\n\tthis.newavatarcost = 5000;\r\n\tthis.karugems = 0;\r\n\t//Karugems are obtained in several ways:\r\n\t//1.Every 10 minutes\r\n\t//2.For every achievement (7 in total)\r\n\t//3.Every 1000 clicks (up to 10000 clicks, 10 in total)\r\n\t//So 17 by playing and one every 10 minutes.\r\n\tthis.unlockedAvatar = [true, false, false, false, false];\r\n\tthis.unlockedAchievement = [false, false, false, false, false,\r\n\t\t\t\t\t\t\t\tfalse, false, false];\r\n\tthis.unlockedSkill = [false, false, false, false, false];\r\n\tthis.unlockedTheme = [true, false];\r\n\tthis.unlockedMusic = [true, false, true, true, false, false];\r\n\r\n\t//MUSIC\r\n\tthis.bgm1 = new Audio('assets/bgm/Karukami - Bleeps and Bloops.mp3');\r\n\tthis.bgm1.loop = true;\r\n\r\n\tthis.bgm2 = new Audio('assets/bgm/Karukami - Broken Repository.mp3');\r\n\tthis.bgm2.loop = true;\r\n\r\n\tthis.bgm3 = new Audio('assets/bgm/Satisfaction.wav');\r\n\tthis.bgm3.loop = true;\r\n\r\n\tthis.bgm4 = new Audio('assets/bgm/Rendezvous.wav');\r\n\tthis.bgm4.loop = true;\r\n\r\n\tthis.bgm5 = new Audio('assets/bgm/Searching for the answer.wav');\r\n\tthis.bgm5.loop =true;\r\n\r\n\tthis.bgm6 = new Audio('assets/bgm/No Risk, no gain!.wav');\r\n\tthis.bgm6.loop = true;\r\n\r\n\t/*--------------*/\r\n\t/* Select Theme */\r\n\t/*--------------*/\r\n\tthis.selectTheme = function(selection) {\r\n\t\tswitch (selection) {\r\n\t\t\tcase 0:\r\n\t\t\t\tthis.activeTheme = 0;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 1:\r\n\t\t\t\tthis.activeTheme = 1;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tthis.updateTheme();\r\n\t}\r\n\r\n\t/*--------------*/\r\n\t/* Update Theme */\r\n\t/*--------------*/\r\n\tthis.updateTheme = function() {\r\n\t\tswitch (this.activeTheme) {\r\n\t\t\tcase 0:\r\n\t\t\t\tdocument.getElementById(\"favicon\").setAttribute(\"href\",\r\n\t\t\t\t\t\"assets/favicon.png\");\r\n\t\t\t\tdocument.getElementById(\"body\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-image: url(\\\"assets/bg.png\\\"); background-repeat: no-repeat; background-size: 100%; background-position: 0px 90px; background-color: #000000; color: rgba(255,255,255,1); text-align: center;\");\r\n\t\t\t\tdocument.getElementById(\"header\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-image: linear-gradient(-60deg, white, rgba(180, 80, 170, 1)); padding: 0px;\");\r\n\t\t\t\tdocument.getElementById(\"headerfavicon\").setAttribute(\"src\",\r\n\t\t\t\t\t\"assets/favicon.png\");\r\n\t\t\t\tdocument.getElementById(\"navbar\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 35px; background-image: linear-gradient(#eeeeee, white, #cccccc);\");\r\n\t\t\t\tdocument.getElementById(\"clockcontainer\").setAttribute(\"style\",\r\n\t\t\t\t\t\"margin-top:4px; text-align: right; color: black;\");\r\n\t\t\t\tdocument.getElementById(\"maincol\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-color: rgba(255,255,255,0.7); border-radius: 5px; margin-top: 15px; padding-top: 15px; padding-bottom: 15px; text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"divbotones\").setAttribute(\"style\",\r\n\t\t\t\t\t\"margin-right: 15px; margin-left: 15px; padding: 20px 60px 20px 60px; background-color: rgba(0,0,0,0.1); border-radius: 15px;\");\r\n\t\t\t\tdocument.getElementById(\"namediv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-color: rgba(255,255,255,0.7); margin-top: 15px; margin-left: 5px; border-radius: 5px; text-align: center;\ttext-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"avatardiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 155px; background-color: rgba(255,255,255,0.7); border-radius: 5px; padding-top: 3px; margin-top: 15px; margin-left: 5px; margin-right: 0px; text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"avatar_selector_left\").setAttribute(\"src\", \"assets/avatar/select_arrow_left.png\");\r\n\t\t\t\tdocument.getElementById(\"avatar_selector_right\").setAttribute(\"src\", \"assets/avatar/select_arrow_right.png\");\r\n\t\t\t\tdocument.getElementById(\"currentavatar\").setAttribute(\"style\",\r\n\t\t\t\t\t\"box-shadow: -1px 0px 2px rgba(200, 100, 190, 1), 0px 1px 2px rgba(200, 100, 190, 1), 1px 0px 2px rgba(200, 100, 190, 1), 0px -1px 2px rgba(200, 100, 190, 1);\");\r\n\t\t\t\tdocument.getElementById(\"statsdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 308px;\tbackground-color: rgba(255,255,255,0.7); border-radius: 5px; margin-top: 15px; margin-left: 10px; margin-right: 5px; padding-top: 5px; text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"consolediv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 158px;\tpadding: 5px; margin-top: 10px;\tborder-radius: 5px;\toverflow: hidden; background-color: rgba(255,255,255,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"console\").setAttribute(\"style\",\r\n\t\t\t\t\t\"transform: translate(0px, -9px); resize: none;\");\r\n\t\t\t\tdocument.getElementById(\"shopdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 235px; padding: 5px; margin-top: 15px; margin-right: 10px; border-radius: 5px; background-color: rgba(255,255,255,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"themesdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 100px;\tpadding: 5px; margin-top: 15px;\tmargin-right: 10px;\tborder-radius: 5px;\tbackground-color: rgba(255,255,255,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"adsdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 152px;\tpadding: 5px; margin-top: 15px;\tmargin-right: 10px;\tborder-radius: 5px;\toverflow: hidden; background-color: rgba(255,255,255,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 1:\r\n\t\t\t\tdocument.getElementById(\"favicon\").setAttribute(\"href\",\r\n\t\t\t\t\t\"assets/favicon2.png\");\r\n\t\t\t\tdocument.getElementById(\"body\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-image: url(\\\"assets/bg2.png\\\"); background-repeat: no-repeat; background-size: 100%; background-position: 0px 90px; background-color: #000000; color: rgba(255,255,255,1); text-align: center;\");\r\n\t\t\t\tdocument.getElementById(\"header\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-image: linear-gradient(-60deg, #333333, rgba(0, 0, 0, 1)); padding: 0px;\");\r\n\t\t\t\tdocument.getElementById(\"headerfavicon\").setAttribute(\"src\",\r\n\t\t\t\t\t\"assets/favicon2.png\");\r\n\t\t\t\tdocument.getElementById(\"navbar\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 35px; background-image: linear-gradient(#333333, black, black, #222222);\");\r\n\t\t\t\tdocument.getElementById(\"clockcontainer\").setAttribute(\"style\",\r\n\t\t\t\t\t\"margin-top:4px; text-align: right; color: white;\");\r\n\t\t\t\tdocument.getElementById(\"maincol\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-color: rgba(0,0,0,0.7); border-radius: 5px; margin-top: 15px; padding-top: 15px; padding-bottom: 15px; text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"divbotones\").setAttribute(\"style\",\r\n\t\t\t\t\t\"margin-right: 15px; margin-left: 15px; padding: 20px 60px 20px 60px; background-color: rgba(0,0,0,0.7); border-radius: 15px;\");\r\n\t\t\t\tdocument.getElementById(\"namediv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"background-color: rgba(80,80,80,0.2); margin-top: 15px; margin-left: 5px; border-radius: 5px; text-align: center;\ttext-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"avatardiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 155px; background-color: rgba(0,0,0,0.7); border-radius: 5px; padding-top: 3px; margin-top: 15px; margin-left: 5px; margin-right: 0px; text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"avatar_selector_left\").setAttribute(\"src\", \"assets/avatar/select_arrow_left2.png\");\r\n\t\t\t\tdocument.getElementById(\"avatar_selector_right\").setAttribute(\"src\", \"assets/avatar/select_arrow_right2.png\");\r\n\t\t\t\tdocument.getElementById(\"currentavatar\").setAttribute(\"style\",\r\n\t\t\t\t\t\"box-shadow: -1px 0px 2px rgba(180, 100, 220, 1), 0px 1px 2px rgba(180, 100, 220, 1), 1px 0px 2px rgba(180, 100, 220, 1), 0px -1px 2px rgba(180, 100, 220, 1);\");\r\n\t\t\t\tdocument.getElementById(\"statsdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 308px;\tbackground-color: rgba(0,0,0,0.7); border-radius: 5px; margin-top: 15px; margin-left: 10px; margin-right: 5px; padding-top: 5px; text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"consolediv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 158px;\tpadding: 5px; margin-top: 10px;\tborder-radius: 5px;\toverflow: hidden; background-color: rgba(0,0,0,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"console\").setAttribute(\"style\",\r\n\t\t\t\t\t\"transform: translate(0px, -9px); resize: none; background-color: black; color: #00ff00\");\r\n\t\t\t\tdocument.getElementById(\"shopdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 235px; padding: 5px; margin-top: 15px; margin-right: 10px; border-radius: 5px; background-color: rgba(0,0,0,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"themesdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 100px;\tpadding: 5px; margin-top: 15px;\tmargin-right: 10px;\tborder-radius: 5px;\tbackground-color: rgba(0,0,0,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tdocument.getElementById(\"adsdiv\").setAttribute(\"style\",\r\n\t\t\t\t\t\"height: 152px;\tpadding: 5px; margin-top: 15px;\tmargin-right: 10px;\tborder-radius: 5px;\toverflow: hidden; background-color: rgba(0,0,0,0.7); text-shadow: -1px 0px 2px #222222, 0px 1px 2px #222222, 1px 0px 2px #222222, 0px -1px 2px #222222;\");\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/*----------*/\r\n\t/* Play BGM */\r\n\t/*----------*/\r\n\tthis.playBGM = function(song) {\r\n\t\tif (song == 0) {\r\n\t\t\tthis.bgm1.load();\r\n\t\t\tthis.bgm2.load();\r\n\t\t\tthis.bgm3.load();\r\n\t\t\tthis.bgm4.load();\r\n\t\t\tthis.bgm5.load();\r\n\t\t\tthis.bgm6.load();\r\n\t\t}\r\n\t\tif (song == 1) {\r\n\t\t\tthis.bgm1.load();\r\n\t\t\tthis.bgm2.load();\r\n\t\t\tthis.bgm3.load();\r\n\t\t\tthis.bgm4.load();\r\n\t\t\tthis.bgm5.load();\r\n\t\t\tthis.bgm6.load();\r\n\t\t\tthis.bgm1.play();\r\n\t\t}\r\n\t\tif (song == 2) {\r\n\t\t\tif (this.unlockedMusic[1] == true) {\r\n\t\t\t\tthis.bgm1.load();\r\n\t\t\t\tthis.bgm2.load();\r\n\t\t\t\tthis.bgm3.load();\r\n\t\t\t\tthis.bgm4.load();\r\n\t\t\t\tthis.bgm5.load();\r\n\t\t\t\tthis.bgm6.load();\r\n\t\t\t\tthis.bgm2.play();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>This song is locked!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>To unlock it, play through the game!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (song == 3) {\r\n\t\t\tif (this.unlockedMusic[2] == true) {\r\n\t\t\t\tthis.bgm1.load();\r\n\t\t\t\tthis.bgm2.load();\r\n\t\t\t\tthis.bgm3.load();\r\n\t\t\t\tthis.bgm4.load();\r\n\t\t\t\tthis.bgm5.load();\r\n\t\t\t\tthis.bgm6.load();\r\n\t\t\t\tthis.bgm3.play();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>This song is locked!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Coming soon!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (song == 4) {\r\n\t\t\tif (this.unlockedMusic[3] == true) {\r\n\t\t\t\tthis.bgm1.load();\r\n\t\t\t\tthis.bgm2.load();\r\n\t\t\t\tthis.bgm3.load();\r\n\t\t\t\tthis.bgm4.load();\r\n\t\t\t\tthis.bgm5.load();\r\n\t\t\t\tthis.bgm6.load();\r\n\t\t\t\tthis.bgm4.play();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>This song is locked!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Coming soon!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (song == 5) {\r\n\t\t\tif (this.unlockedMusic[4] == true) {\r\n\t\t\t\tthis.bgm1.load();\r\n\t\t\t\tthis.bgm2.load();\r\n\t\t\t\tthis.bgm3.load();\r\n\t\t\t\tthis.bgm4.load();\r\n\t\t\t\tthis.bgm5.load();\r\n\t\t\t\tthis.bgm6.load();\r\n\t\t\t\tthis.bgm5.play();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>This song is locked!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Coming soon!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (song == 6) {\r\n\t\t\tif (this.unlockedMusic[5] == true) {\r\n\t\t\t\tthis.bgm1.load();\r\n\t\t\t\tthis.bgm2.load();\r\n\t\t\t\tthis.bgm3.load();\r\n\t\t\t\tthis.bgm4.load();\r\n\t\t\t\tthis.bgm5.load();\r\n\t\t\t\tthis.bgm6.load();\r\n\t\t\t\tthis.bgm6.play();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>This song is locked!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Coming soon!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/*------------*/\r\n\t/* Make Money */\r\n\t/*------------*/\r\n\t//This function is called when clicking the Make Money Button.\r\n\t//It just adds +1 to the money counter and updates the html element.\r\n\tthis.MakeMoney = function() {\r\n\t\tthis.money += this.clickpower;\r\n\t\tthis.totalMoneyEver += this.clickpower;\r\n\t\tthis.totalClicksEver++;\r\n\t\tdocument.getElementById(\"moneycounter\").innerHTML = \"$\" + Math.round(this.money);\r\n\t\tthis.addKaruGemsByClicking();\r\n\t\tthis.updateStats();\r\n\t}\r\n\r\n\tthis.generateKaruGem = function() {\r\n\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\tthis.karugems++;\r\n\t\tthis.updateBoutique();\r\n\t}\r\n\r\n\t/*--------------------------*/\r\n\t/* Add KaruGems by Clicking */\r\n\t/*--------------------------*/\r\n\tthis.addKaruGemsByClicking = function() {\r\n\t\tif (this.totalClicksEver == 1000\r\n\t\t\t|| this.totalClicksEver == 2000\r\n\t\t\t|| this.totalClicksEver == 3000\r\n\t\t\t|| this.totalClicksEver == 4000\r\n\t\t\t|| this.totalClicksEver == 5000\r\n\t\t\t|| this.totalClicksEver == 6000\r\n\t\t\t|| this.totalClicksEver == 7000\r\n\t\t\t|| this.totalClicksEver == 8000\r\n\t\t\t|| this.totalClicksEver == 9000\r\n\t\t\t|| this.totalClicksEver == 10000) {\r\n\t\t\tthis.karugems++;\r\n\t\t\tthis.updateBoutique();\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\t}\r\n\r\n\t/*-----------------*/\r\n\t/* Add Autoclicker */\r\n\t/*-----------------*/\r\n\t//This function is called when clicking the Buy Autoclicker Button.\r\n\t//If the player has enough money, adds +1 to the autoclicker count, and you pay for it.\r\n\t//Else, nothing happens when you click the button.\r\n\tthis.AddAutoClicker = function() {\r\n\t\tif (this.money >= Math.round(this.autoclickercost)) {\r\n\t\t\tthis.money -= this.autoclickercost;\r\n\t\t\tthis.totalMoneySpent += this.autoclickercost;\r\n\t\t\tthis.autoclickers++;\r\n\t\t\tdocument.getElementById(\"autoclickerscounter\").innerHTML = \"Autoclickers: \" + this.autoclickers;\r\n\t\t\tthis.autoclickercost += Math.round(this.autoclickercost * 0.10);\r\n\t\t\tthis.updateShop();\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>\"+this.name+\" just bought an autoclicker!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.updateStats();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You don't have enough money!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\t}\r\n\r\n\t/*------------------------*/\r\n\t/* Autoclicker Make Money */\r\n\t/*------------------------*/\r\n\t//This function is constantly being called.\r\n\t//Adds an ammount to the money counter based on the number of autoclickers the player has.\r\n\t//Then it updates the html money counter, rounding the number so it doesn't appear float.\r\n\tthis.AutoClickerMakeMoney = function() {\r\n\t\tif (this.unlockedSkill[0] == false) {\r\n\t\t\tthis.money += this.autoclickers * 0.1;\r\n\t\t\tthis.totalMoneyEver += this.autoclickers * 0.1;\r\n\t\t\tdocument.getElementById(\"moneycounter\").innerHTML = \"$\" + Math.round(this.money);\r\n\t\t\tthis.updateStats();\r\n\t\t}\r\n\t\tif (this.unlockedSkill[0] == true) {\r\n\t\t\tthis.money += this.autoclickers * 0.2;\r\n\t\t\tthis.totalMoneyEver += this.autoclickers * 0.2;\r\n\t\t\tdocument.getElementById(\"moneycounter\").innerHTML = \"$\" + Math.round(this.money);\r\n\t\t\tthis.updateStats();\r\n\t\t}\t\t\r\n\t}\r\n\r\n\t/*-------------*/\r\n\t/* Next Avatar */\r\n\t/*-------------*/\r\n\tthis.NextAvatar = function() {\r\n\t\tswitch (this.activeavatar) {\r\n\t\t\tcase 1:\r\n\t\t\t\tif (this.unlockedAvatar[1] == true) {\r\n\t\t\t\t\tthis.activeavatar = 2;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.activeavatar = 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 2:\r\n\t\t\t\tif (this.unlockedAvatar[2] == true) {\r\n\t\t\t\t\tthis.activeavatar = 3;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.activeavatar = 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 3:\r\n\t\t\t\tif (this.unlockedAvatar[3] == true) {\r\n\t\t\t\t\tthis.activeavatar = 4;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.activeavatar = 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 4:\r\n\t\t\t\tif (this.unlockedAvatar[4] == true) {\r\n\t\t\t\t\tthis.activeavatar = 5;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.activeavatar = 1;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 5:\r\n\t\t\t\tthis.activeavatar = 1;\r\n\t\t}\r\n\t\tthis.UpdateAvatar();\r\n\t}\r\n\r\n\t/*-----------------*/\r\n\t/* Previous Avatar */\r\n\t/*-----------------*/\r\n\tthis.PreviousAvatar = function() {\r\n\t\tswitch (this.activeavatar) {\r\n\t\t\tcase 1:\r\n\t\t\t\tif (this.unlockedAvatar[4] == true) {\r\n\t\t\t\t\tthis.activeavatar = 5;\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.unlockedAvatar[3] == true) {\r\n\t\t\t\t\tthis.activeavatar = 4;\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.unlockedAvatar[2] == true) {\r\n\t\t\t\t\tthis.activeavatar = 3;\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.unlockedAvatar[1] == true) {\r\n\t\t\t\t\tthis.activeavatar = 2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 2:\r\n\t\t\t\tthis.activeavatar = 1;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 3:\r\n\t\t\t\tthis.activeavatar = 2;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 4:\r\n\t\t\t\tthis.activeavatar = 3;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 5:\r\n\t\t\t\tthis.activeavatar = 4;\r\n\t\t}\r\n\t\tthis.UpdateAvatar();\r\n\t}\r\n\r\n\t/*---------------*/\r\n\t/* Update Avatar */\r\n\t/*---------------*/\r\n\tthis.UpdateAvatar = function() {\r\n\t\tswitch(this.activeavatar) {\r\n\t\t\tcase 1:\r\n\t\t\t\tdocument.getElementById(\"currentavatar\").setAttribute(\"src\", \"assets/avatar/avatar0big.png\");\r\n\t\t\t\tdocument.getElementById(\"avatarname\").innerHTML = \". + Karu + .\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 2:\r\n\t\t\t\tdocument.getElementById(\"currentavatar\").setAttribute(\"src\", \"assets/avatar/avatar1big.png\");\r\n\t\t\t\tdocument.getElementById(\"avatarname\").innerHTML = \". + Kazzy + .\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 3:\r\n\t\t\t\tdocument.getElementById(\"currentavatar\").setAttribute(\"src\", \"assets/avatar/avatar2big.png\");\r\n\t\t\t\tdocument.getElementById(\"avatarname\").innerHTML = \". + Ricardo + .\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 4:\r\n\t\t\t\tdocument.getElementById(\"currentavatar\").setAttribute(\"src\", \"assets/avatar/avatar3big.png\");\r\n\t\t\t\tdocument.getElementById(\"avatarname\").innerHTML = \". + Spinal + .\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 5:\r\n\t\t\t\tdocument.getElementById(\"currentavatar\").setAttribute(\"src\", \"assets/avatar/avatar4big.png\");\r\n\t\t\t\tdocument.getElementById(\"avatarname\").innerHTML = \". + Robin + .\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/*-----------------*/\r\n\t/* Update Boutique */\r\n\t/*-----------------*/\r\n\tthis.updateBoutique = function() {\r\n\t\tif (this.unlockedAvatar[1]) {\r\n\t\t\tdocument.getElementById(\"boutique_unlocked_1\").setAttribute(\"src\", \"assets/avatar/avatar1.png\");\r\n\t\t\tdocument.getElementById(\"skill_description_1\").innerHTML = \"Kazzy's Hacker attack <br><small>&nbsp&nbspTotal Autoclickers x3</small>\";\r\n\t\t\tdocument.getElementById(\"Shop_btn_newavatar\").innerHTML = \"Get New Avatar ($\" + this.newavatarcost + \")\";\r\n\t\t}\r\n\t\tif (this.unlockedAvatar[2]) {\r\n\t\t\tdocument.getElementById(\"boutique_unlocked_2\").setAttribute(\"src\", \"assets/avatar/avatar2.png\");\r\n\t\t\tdocument.getElementById(\"skill_description_2\").innerHTML = \"Ricardo's Sexy Dance <br><small>&nbsp&nbspClick power x5</small>\";\r\n\t\t\tdocument.getElementById(\"Shop_btn_newavatar\").innerHTML = \"Get New Avatar ($\" + this.newavatarcost + \")\";\r\n\t\t}\r\n\t\tif (this.unlockedAvatar[3]) {\r\n\t\t\tdocument.getElementById(\"boutique_unlocked_3\").setAttribute(\"src\", \"assets/avatar/avatar3.png\");\r\n\t\t\tdocument.getElementById(\"skill_description_3\").innerHTML = \"Spinal's Ultra Combo <br><small>&nbsp&nbsp+15 Autoclickers, +15 Click power</small>\";\r\n\t\t\tdocument.getElementById(\"Shop_btn_newavatar\").innerHTML = \"Get New Avatar ($\" + this.newavatarcost + \")\";\r\n\t\t}\r\n\t\tif (this.unlockedAvatar[4]) {\r\n\t\t\tdocument.getElementById(\"boutique_unlocked_4\").setAttribute(\"src\", \"assets/avatar/avatar4.png\");\r\n\t\t\tdocument.getElementById(\"skill_description_4\").innerHTML = \"Robin's Ultimate Meow <br><small>&nbsp&nbspWalks on the keyboard</small>\";\r\n\t\t\tdocument.getElementById(\"Shop_btn_newavatar\").innerHTML = \"Got all avatars!\";\r\n\t\t\tdocument.getElementById(\"Shop_btn_newavatar\").disabled = true;\r\n\t\t}\r\n\r\n\t\t//These activate and deactivate skill purchase buttons\r\n\t\tif (this.karugems >= 1 && this.unlockedSkill[0] == false) {\r\n\t\t\tdocument.getElementById(\"btn_skill_0\").disabled = false;\r\n\t\t}\r\n\t\telse if (this.unlockedSkill[0] == true) {\r\n\t\t\tdocument.getElementById(\"btn_skill_0\").innerHTML = \"Activated!\";\r\n\t\t\tdocument.getElementById(\"btn_skill_0\").disabled = true;\r\n\t\t}\r\n\t\tif (this.karugems >= 3 && this.unlockedAvatar[1] == true && this.unlockedSkill[1] == false) {\r\n\t\t\tdocument.getElementById(\"btn_skill_1\").disabled = false;\r\n\t\t}\r\n\t\telse if (this.unlockedSkill[1] == true) {\r\n\t\t\tdocument.getElementById(\"btn_skill_1\").innerHTML = \"Activated!\";\r\n\t\t\tdocument.getElementById(\"btn_skill_1\").disabled = true;\r\n\t\t}\r\n\t\tif (this.karugems >= 5 && this.unlockedAvatar[2] == true && this.unlockedSkill[2] == false) {\r\n\t\t\tdocument.getElementById(\"btn_skill_2\").disabled = false;\r\n\t\t}\r\n\t\telse if (this.unlockedSkill[2] == true) {\r\n\t\t\tdocument.getElementById(\"btn_skill_2\").innerHTML = \"Activated!\";\r\n\t\t\tdocument.getElementById(\"btn_skill_2\").disabled = true;\r\n\t\t}\r\n\t\tif (this.karugems >= 7 && this.unlockedAvatar[3] == true && this.unlockedSkill[3] == false) {\r\n\t\t\tdocument.getElementById(\"btn_skill_3\").disabled = false;\r\n\t\t}\r\n\t\telse if (this.unlockedSkill[3] == true) {\r\n\t\t\tdocument.getElementById(\"btn_skill_3\").innerHTML = \"Activated!\";\r\n\t\t\tdocument.getElementById(\"btn_skill_3\").disabled = true;\r\n\t\t}\r\n\t\tif (this.karugems >= 10 && this.unlockedAvatar[4] == true && this.unlockedSkill[4] == false) {\r\n\t\t\tdocument.getElementById(\"btn_skill_4\").disabled = false;\r\n\t\t}\r\n\t\telse if (this.unlockedSkill[4] == true) {\r\n\t\t\tdocument.getElementById(\"btn_skill_4\").innerHTML = \"Activated!\";\r\n\t\t\tdocument.getElementById(\"btn_skill_4\").disabled = true;\r\n\t\t}\r\n\t}\r\n\r\n\t/*----------------*/\r\n\t/* Activate Skill */\r\n\t/*----------------*/\r\n\tthis.activateSkill = function(skillnumber) {\r\n\t\tif (skillnumber == 0) {\r\n\t\t\tif (this.karugems >= 1) {\r\n\t\t\t\tthis.karugems -= 1;\r\n\t\t\t\tthis.unlockedSkill[0] = true;\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>SKILL ACTIVATED: KARU'S SUGAR RUSH!!!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (skillnumber == 1) {\r\n\t\t\tif (this.karugems >= 3) {\r\n\t\t\t\tthis.karugems -= 3;\r\n\t\t\t\tthis.unlockedSkill[1] = true;\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tthis.autoclickers *= 3;\r\n\t\t\t\tthis.updateStats();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>SKILL ACTIVATED: KAZZY'S HACKER ATTACK!!!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (skillnumber == 2) {\r\n\t\t\tif (this.karugems >= 5) {\r\n\t\t\t\tthis.karugems -= 5;\r\n\t\t\t\tthis.unlockedSkill[2] = true;\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tthis.clickpower *= 5;\r\n\t\t\t\tthis.updateStats();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>SKILL ACTIVATED: RICARDO'S SEXY DANCE!!!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (skillnumber == 3) {\r\n\t\t\tif (this.karugems >= 7) {\r\n\t\t\t\tthis.karugems -= 7;\r\n\t\t\t\tthis.unlockedSkill[3] = true;\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tthis.autoclickers += 15;\r\n\t\t\t\tthis.clickpower += 15;\r\n\t\t\t\tdocument.getElementById(\"btn_makemoney\").innerHTML = \"Make Money! ($\" + this.clickpower + \")\";\r\n\t\t\t\tthis.updateStats();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>SKILL ACTIVATED: SPINAL'S ULTRA COMBO!!!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (skillnumber == 4) {\r\n\t\t\tif (this.karugems >= 10) {\r\n\t\t\t\tthis.karugems -= 10;\r\n\t\t\t\tthis.unlockedSkill[4] = true;\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tthis.autoclickers += 100;\r\n\t\t\t\tthis.clickpower += 100;\r\n\r\n\t\t\t\tdocument.getElementById(\"btn_music_1\").setAttribute(\"class\", \"btn btn-success btn-sm\");\r\n\t\t\t\tdocument.getElementById(\"btn_music_1\").innerHTML = \"Unlocked\";\r\n\t\t\t\tdocument.getElementById(\"btn_makemoney\").innerHTML = \"Make Money! ($\" + this.clickpower + \")\";\r\n\t\t\t\tthis.updateStats();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>SKILL ACTIVATED: ROBIN'S ULTIMATE MEOW!!!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (this.unlockedSkill[0] == true &&\r\n\t\t\tthis.unlockedSkill[1] == true &&\r\n\t\t\tthis.unlockedSkill[2] == true &&\r\n\t\t\tthis.unlockedSkill[3] == true &&\r\n\t\t\tthis.unlockedSkill[4] == true) {\r\n\t\t\tthis.unlockedMusic[1] = true;\r\n\t\t\tthis.updateMusicShop();\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Congratulations, \"+this.name+\", you have completed the game!!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You have unlocked a new song!!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.updateMusicShop = function() {\r\n\t\tif (this.unlockedMusic[1] == true) {\r\n\t\t\tdocument.getElementById(\"btn_music_1\").setAttribute(\"class\", \"btn btn-success btn-sm\");\r\n\t\t\tdocument.getElementById(\"btn_music_1\").innerHTML = \"Unlocked\";\t\r\n\t\t}\r\n\t}\r\n\r\n\t/*---------------------*/\r\n\t/* Update Shop Buttons */\r\n\t/*---------------------*/\r\n\tthis.updateShop = function() {\r\n\t\tdocument.getElementById(\"Shop_btn_autoclicker\").innerHTML = \"Buy Autoclicker ($\" + Math.round(this.autoclickercost) + \")\";\r\n\t\tdocument.getElementById(\"Shop_btn_clickpower\").innerHTML = \"Upgrade Click Power ($\" + this.clickpowercost + \")\";\r\n\t}\r\n\r\n\t/*-------------------*/\r\n\t/* Unlock New Avatar */\r\n\t/*-------------------*/\r\n\tthis.unlockNewAvatar = function() {\r\n\t\tif (this.money >= this.newavatarcost) {\r\n\t\t\tif (this.unlockedAvatar[1] == false) {\r\n\t\t\t\tthis.money -= this.newavatarcost;\r\n\t\t\t\tthis.totalMoneySpent += this.newavatarcost;\r\n\t\t\t\tthis.unlockedAvatar[1] = true;\r\n\t\t\t\tthis.newavatarcost += Math.round(this.newavatarcost*2);\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>\"+this.name+\" has unlocked a new avatar: Kazzy!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\t\t\telse if (this.unlockedAvatar[2] == false) {\r\n\t\t\t\tthis.money -= this.newavatarcost;\r\n\t\t\t\tthis.totalMoneySpent += this.newavatarcost;\r\n\t\t\t\tthis.unlockedAvatar[2] = true;\r\n\t\t\t\tthis.newavatarcost += Math.round(this.newavatarcost*2);\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>\"+this.name+\" has unlocked a new avatar: Ricardo!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\r\n\t\t\t}\r\n\t\t\telse if (this.unlockedAvatar[3] == false) {\r\n\t\t\t\tthis.money -= this.newavatarcost;\r\n\t\t\t\tthis.totalMoneySpent += this.newavatarcost;\r\n\t\t\t\tthis.unlockedAvatar[3] = true;\r\n\t\t\t\tthis.newavatarcost += Math.round(this.newavatarcost*2);\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>\"+this.name+\" has unlocked a new avatar: Spinal!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t}\r\n\r\n\t\t\telse if (this.unlockedAvatar[4] == false) {\r\n\t\t\t\tthis.money -= this.newavatarcost;\r\n\t\t\t\tthis.totalMoneySpent += this.newavatarcost;\r\n\t\t\t\tthis.unlockedAvatar[4] = true;\r\n\t\t\t\tthis.newavatarcost += Math.round(this.newavatarcost*2);\r\n\t\t\t\tthis.updateBoutique();\r\n\t\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>\"+this.name+\" has unlocked a new avatar: Robin!&#013;\");\r\n\t\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\t\tdocument.getElementById(\"Shop_btn_newavatar\").disabled = true;\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You don't have enough money!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\t}\r\n\r\n\t/*-------------------------*/\r\n\t/* Show Avatar Description */\r\n\t/*-------------------------*/\r\n\tthis.showAvatarDescription = function() {\r\n\t\tswitch (this.activeavatar) {\r\n\t\t\tcase 1:\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").innerHTML = \"<h6>Karu</h6><small>\\\"The developer, just a guy who likes spaghetti.\\\"</small>\";\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").setAttribute(\"style\", \"display: yes; background-color: rgba(255,255,255,0.9); border-radius: 5px; position: absolute; z-index: 2; padding: 5px; transform: translate(0px, -70px)\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 2:\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").innerHTML = \"<h6>Kazzy</h6><small>\\\"Loves cats and a good night of watching anime.\\\"</small>\";\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").setAttribute(\"style\", \"display: yes; background-color: rgba(255,255,255,0.9); border-radius: 5px; position: absolute; z-index: 2; padding: 5px; transform: translate(0px, -70px)\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 3:\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").innerHTML = \"<h6>Ricardo</h6><small>\\\"Internet celebrity, likes to dance and pose.\\\"</small>\";\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").setAttribute(\"style\", \"display: yes; background-color: rgba(255,255,255,0.9); border-radius: 5px; position: absolute; z-index: 2; padding: 5px; transform: translate(0px, -70px)\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 4:\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").innerHTML = \"<h6>Spinal</h6><small>\\\"Used to be a hollywood actor, now he just likes to hang around at Karu's and play Mario Party \\\"</small>\";\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").setAttribute(\"style\", \"display: yes; background-color: rgba(255,255,255,0.9); border-radius: 5px; position: absolute; z-index: 2; padding: 5px; transform: translate(0px, -70px)\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 5:\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").innerHTML = \"<h6>Robin</h6><small>\\\"Kazzy's fluffy cat, naps 24/7 and likes walking over the keyboard.\\\"</small>\";\r\n\t\t\t\tdocument.getElementById(\"avatarDescription\").setAttribute(\"style\", \"display: yes; background-color: rgba(255,255,255,0.9); border-radius: 5px; position: absolute; z-index: 2; padding: 5px; transform: translate(0px, -70px)\");\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/*-------------------------*/\r\n\t/* Hide Avatar Description */\r\n\t/*-------------------------*/\r\n\tthis.hideAvatarDescription = function() {\r\n\t\tdocument.getElementById(\"avatarDescription\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\t/*------------------------*/\r\n\t/* Open Name Change Modal */\r\n\t/*------------------------*/\r\n\tthis.openNameChangeModal = function() {\r\n\t\t$('#ChangeNameModal').modal('show');\r\n\t}\r\n\r\n\t/*---------------------*/\r\n\t/* Open Boutique Modal */\r\n\t/*---------------------*/\r\n\tthis.openBoutiqueModal = function() {\r\n\t\t$('#BoutiqueModal').modal('show');\r\n\t}\r\n\r\n\t/*--------------------------------*/\r\n\t/* Open Music & Themes Shop Modal */\r\n\t/*--------------------------------*/\r\n\tthis.openMusicThemeShopModal = function() {\r\n\t\t$('#MusicThemeModal').modal('show');\r\n\t}\r\n\r\n\t/*----------*/\r\n\t/* Set Name */\r\n\t/*----------*/\r\n\tthis.setName = function() {\r\n\t\tthis.name = document.getElementById(\"newnameinput\").value;\r\n\t\tdocument.getElementById(\"namediv\").innerHTML = \"Player: \" + this.name;\r\n\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Changed your name to: \"+this.name+\"&#013;\");\r\n\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t}\r\n\r\n\t/*--------------*/\r\n\t/* Update Stats */\r\n\t/*--------------*/\r\n\tthis.updateStats = function() {\r\n\t\tdocument.getElementById(\"statvalues\").innerHTML =\r\n\t\tthis.gameStarted + \"<br>\" + this.clickpower + \"<br>\" +this.totalClicksEver \r\n\t\t+ \"<br>\" + this.autoclickers + \"<br>\" + Math.round(this.totalMoneyEver) \r\n\t\t+ \"<br>\" + this.totalMoneySpent;\r\n\t\tdocument.getElementById(\"rubycounter\").innerHTML = \"Karu Gems: \" + this.karugems;\r\n\t}\r\n\r\n\t/*----------------------*/\r\n\t/* Increase Click Power */\r\n\t/*----------------------*/\r\n\tthis.increaseClickPower = function() {\r\n\t\tif (this.money >= Math.round(this.clickpowercost)) {\r\n\t\t\tthis.money -= this.clickpowercost;\r\n\t\t\tthis.totalMoneySpent += this.clickpowercost;\r\n\t\t\tthis.clickpower++;\r\n\t\t\tthis.clickpowercost += this.clickpowercost*3;\r\n\t\t\tdocument.getElementById(\"btn_makemoney\").innerHTML = \"Make Money! ($\" + this.clickpower + \")\";\r\n\t\t\tthis.updateShop();\r\n\t\t\tthis.updateStats();\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>\"+this.name+\" increased his/her click power!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You don't have enough money!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\t}\r\n\r\n\t/*--------------------------*/\r\n\t/* Achievement Descriptions */\r\n\t/*--------------------------*/\r\n\tthis.updateAchievements = function() {\r\n\t\t//Achievement 0: Click 100 times!\r\n\t\tif (this.totalClicksEver >= 100 && this.unlockedAchievement[0] == false) {\r\n\t\t\tthis.unlockedAchievement[0] = true;\r\n\t\t\tdocument.getElementById(\"achievement_0\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Click 100 Times!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//Achievement 1: Click 1000 times!\r\n\t\tif (this.totalClicksEver >= 1000 && this.unlockedAchievement[1] == false) {\r\n\t\t\tthis.unlockedAchievement[1] = true;\r\n\t\t\tdocument.getElementById(\"achievement_1\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Click 1000 Times!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//Achievement 2: Got 50 Autoclickers!\r\n\t\tif (this.autoclickers >= 50 && this.unlockedAchievement[2] == false) {\r\n\t\t\tthis.unlockedAchievement[2] = true;\r\n\t\t\tdocument.getElementById(\"achievement_2\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Got 50 Autoclickers!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//Achievement 3: Got 100 Autoclickers!\r\n\t\tif (this.autoclickers >= 100 && this.unlockedAchievement[3] == false) {\r\n\t\t\tthis.unlockedAchievement[3] = true;\r\n\t\t\tdocument.getElementById(\"achievement_3\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Got 100 Autoclickers!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//Achievement 4: Double Power!\r\n\t\tif (this.clickpower >= 2 && this.unlockedAchievement[4] == false) {\r\n\t\t\tthis.unlockedAchievement[4] = true;\r\n\t\t\tdocument.getElementById(\"achievement_4\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Double Power!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//Achievement 5: Giga Power!\r\n\t\tif (this.clickpower >= 5 && this.unlockedAchievement[5] == false) {\r\n\t\t\tthis.unlockedAchievement[5] = true;\r\n\t\t\tdocument.getElementById(\"achievement_5\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Giga Power!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//Achievement 6: Meow!\r\n\t\tif (this.unlockedAvatar[4] == true && this.unlockedAchievement[6] == false) {\r\n\t\t\tthis.unlockedAchievement[6] = true;\r\n\t\t\tdocument.getElementById(\"achievement_6\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Meow!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tthis.unlockedMusic[4] = true;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You have unlocked a new song!!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//Achievement 7: Click 5000 Times!\r\n\t\tif (this.totalClicksEver >= 5000 && this.unlockedAchievement[7] == false) {\r\n\t\t\tthis.unlockedAchievement[7] = true;\r\n\t\t\tdocument.getElementById(\"achievement_7\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>Achievement Unlocked: Click 5000 Times!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t\tthis.karugems++;\r\n\t\t\tthis.unlockedMusic[5] = true;\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You have unlocked a new song!!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").innerHTML = document.getElementById(\"console\").innerHTML.concat(\">>You generated a KaruGem!&#013;\");\r\n\t\t\tdocument.getElementById(\"console\").scrollTop = document.getElementById(\"console\").scrollHeight;\r\n\t\t}\r\n\r\n\t\t//For loading the game\r\n\t\tif (this.unlockedAchievement[0]) {\r\n\t\t\tdocument.getElementById(\"achievement_0\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedAchievement[1]) {\r\n\t\t\tdocument.getElementById(\"achievement_1\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedAchievement[2]) {\r\n\t\t\tdocument.getElementById(\"achievement_2\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedAchievement[3]) {\r\n\t\t\tdocument.getElementById(\"achievement_3\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedAchievement[4]) {\r\n\t\t\tdocument.getElementById(\"achievement_4\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedAchievement[5]) {\r\n\t\t\tdocument.getElementById(\"achievement_5\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedAchievement[6]) {\r\n\t\t\tdocument.getElementById(\"achievement_6\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedAchievement[7]) {\r\n\t\t\tdocument.getElementById(\"achievement_7\").setAttribute(\"style\", \"filter: none;\");\r\n\t\t}\r\n\t\t//Song icons\r\n\t\tif (this.unlockedMusic[0]) {\r\n\t\t\tdocument.getElementById(\"musicbutton1\").setAttribute(\"style\", \"cursor: pointer; filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedMusic[1]) {\r\n\t\t\tdocument.getElementById(\"musicbutton2\").setAttribute(\"style\", \"cursor: pointer; filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedMusic[2]) {\r\n\t\t\tdocument.getElementById(\"musicbutton3\").setAttribute(\"style\", \"cursor: pointer; filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedMusic[3]) {\r\n\t\t\tdocument.getElementById(\"musicbutton4\").setAttribute(\"style\", \"cursor: pointer; filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedMusic[4]) {\r\n\t\t\tdocument.getElementById(\"musicbutton5\").setAttribute(\"style\", \"cursor: pointer; filter: none;\");\r\n\t\t}\r\n\t\tif (this.unlockedMusic[5]) {\r\n\t\t\tdocument.getElementById(\"musicbutton6\").setAttribute(\"style\", \"cursor: pointer; filter: none;\");\r\n\t\t}\r\n\t}\r\n\r\n\tthis.showAchievement0 = function() {\r\n\t\tif (this.unlockedAchievement[0] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_0txt\").innerHTML = \"<h6>Clicked 100 times!</h6><small> \\\"You're doing some workout! <br> Keep burning those calories\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[0] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_0txt\").innerHTML = \"<h6>Clicked 100 times!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_0txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement0 = function() {\r\n\t\tdocument.getElementById(\"achievement_0txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\tthis.showAchievement1 = function() {\r\n\t\tif (this.unlockedAchievement[1] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_1txt\").innerHTML = \"<h6>Clicked 1000 times!</h6><small>\\\"Bro, look how much I can click!<br>Your clicks have come a long way...\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[1] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_1txt\").innerHTML = \"<h6>Clicked 1000 times!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_1txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement1 = function() {\r\n\t\tdocument.getElementById(\"achievement_1txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\tthis.showAchievement2 = function() {\r\n\t\tif (this.unlockedAchievement[2] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_2txt\").innerHTML = \"<h6>Got 50 Autoclickers!</h6><small>\\\"Automatization is the future!<br>click... click... click...\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[2] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_2txt\").innerHTML = \"<h6>Got 50 Autoclickers!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_2txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement2 = function() {\r\n\t\tdocument.getElementById(\"achievement_2txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\tthis.showAchievement3 = function() {\r\n\t\tif (this.unlockedAchievement[3] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_3txt\").innerHTML = \"<h6>Got 100 Autoclickers!</h6><small>\\\"Look at those numbers go up!<br>These guys sure are doing their job!\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[3] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_3txt\").innerHTML = \"<h6>Got 100 Autoclickers!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_3txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement3 = function() {\r\n\t\tdocument.getElementById(\"achievement_3txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\tthis.showAchievement4 = function() {\r\n\t\tif (this.unlockedAchievement[4] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_4txt\").innerHTML = \"<h6>Double Power!</h6><small>\\\"You've got double the power now,<br>be careful not to destroy the world!\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[4] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_4txt\").innerHTML = \"<h6>Double Power!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_4txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement4 = function() {\r\n\t\tdocument.getElementById(\"achievement_4txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\tthis.showAchievement5 = function() {\r\n\t\tif (this.unlockedAchievement[5] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_5txt\").innerHTML = \"<h6>Giga Power!</h6><small>\\\"With five times the power,<br>the universe is at risk!\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[5] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_5txt\").innerHTML = \"<h6>Giga Power!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_5txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement5 = function() {\r\n\t\tdocument.getElementById(\"achievement_5txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\tthis.showAchievement6 = function() {\r\n\t\tif (this.unlockedAchievement[6] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_6txt\").innerHTML = \"<h6>Meow!</h6><small>\\\"Bought the new avatar: Robin!<br>*Purr*\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[6] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_6txt\").innerHTML = \"<h6>Meow!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_6txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement6 = function() {\r\n\t\tdocument.getElementById(\"achievement_6txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n\tthis.showAchievement7 = function() {\r\n\t\tif (this.unlockedAchievement[7] == true) {\r\n\t\t\tdocument.getElementById(\"achievement_7txt\").innerHTML = \"<h6>Click 5000 Times!</h6><small>\\\"You've got to have fingers in your fingers\\\"</small>\";\r\n\t\t}\r\n\t\telse if (this.unlockedAchievement[7] == false) {\r\n\t\t\tdocument.getElementById(\"achievement_7txt\").innerHTML = \"<h6>Click 5000 Times!</h6><small>[Locked]</small>\";\t\r\n\t\t}\r\n\t\tdocument.getElementById(\"achievement_7txt\").setAttribute(\"style\", \"display:} yes; background-color: rgba(255,255,255,0.7); border-radius: 5px; position: absolute; z-index: 1; padding: 5px\");\r\n\t}\r\n\r\n\tthis.hideAchievement7 = function() {\r\n\t\tdocument.getElementById(\"achievement_7txt\").setAttribute(\"style\", \"display: none\");\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "4e23273c582faa025ef551a1fb5bc072", "score": "0.5110061", "text": "function harvest(){\n dustCount++\n checkUpgrades()\n drawCounters()\n}", "title": "" }, { "docid": "433e0ae1815681eb3939d6d419819a5c", "score": "0.5108778", "text": "function updateHealth() {\n // Reduce player health\n\n //added increased health decay during sprint, made the penalty threshhold to a minimum boosted speed of 2.8, so that theres atleast some kind of advantage to sprinting\n if (playerMaxSpeed > 2.8) {\n playerHealth = playerHealth - 0.9;\n }\n\n playerHealth = playerHealth - 0.5;\n // Constrain the result to a sensible range\n playerHealth = constrain(playerHealth, 0, playerMaxHealth);\n\n\n\n // Check if the player is dead (0 health)\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "title": "" }, { "docid": "2b02db4b454cc52e8cafcefb91b7b8a1", "score": "0.51077795", "text": "function CalculateTotalAchievements() {\n // go through each and total things up\n let newTotal = 0;\n\n // Gold\n for (var i = 0; i < Game.Achievements['Gold'].TierEarned; i++) {\n newTotal += GameDB.Events.Gold.Value[i];\n }\n\n Game.Achievements.TotalScore = newTotal;\n}", "title": "" }, { "docid": "bc96c45e056a899a18f88c9117a8dbfb", "score": "0.51033765", "text": "function fixOldSave(oldVersion){\n if (!player.g.automation) player.g.automation = {\n autoBuyerOn: false,\n autoMergeOn: false,\n autoUpgradeOn: false,\n autoGildOn: false,\n }\n for (var i in layers.t.startData().bonusLevels) {\n if (!(typeof player.t.bonusLevels[i] == \"object\")) {\n player.t.bonusLevels[i] = new Decimal(0)\n }\n }\n}", "title": "" }, { "docid": "a9e4392252c79325016c230d064f4583", "score": "0.50971115", "text": "scoreUp() {\n \n if (!this.gameoverBot && !this.gameoverTop) {\n \n // increment score\n this.score++;\n\n // update scoreBoard\n this.scoreBoard.setText(this.score);\n \n if ((this.score%this.diffCheck == 0) && (this.score > 0)) {\n \n if(this.itemDrop<this.itemMax)this.itemDrop += this.itemPlus;\n\n else if(this.scroll < this.speedCapInit){\n \n // make scrolling + spawning a little faster\n this.scroll += this.speedUp;\n this.platformTimer.timeScale = 1 + (0.3*this.scroll);\n\n //scale player jump and move to platform speed\n this.player.jumpHeight -= 15; // 90 is = to this.scroll*jumpheight //flag may need balancing\n this.player.speedCap += 50*this.speedUp//check\n \n //update speed of existing platforms and objects\n //code provided by Ben Rosien in the discord channel\n \n this.platforms.getChildren().forEach(function (platform) {\n platform.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.boxes.getChildren().forEach(function (box) {\n box.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.shelves.getChildren().forEach(function (shelf) {\n shelf.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.fullShelves.getChildren().forEach(function (fullShelf) {\n fullShelf.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.messes.getChildren().forEach(function (mess) {\n mess.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n /*this.customers.getChildren().forEach(function (customer) {\n customer.body.velocity.y = this.scroll*this.platMod;\n }, this);*/ //flag\n\n this.agCustomers.getChildren().forEach(function (agCustomer) {\n agCustomer.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n }\n\n else if (this.score >= this.bonusTime){\n // make scrolling + spawning a little faster\n this.scroll += this.speedUp/2;\n this.platformTimer.timeScale = 1 + (0.2*this.scroll);\n\n //scale player jump to platform speed\n this.player.jumpHeight -= 15; // 90 is = to this.scroll*jumpheight //flag may need balancing\n this.player.speedCap += 50*this.speedUp//check\n \n //update speed of existing platforms and objects\n //code provided by Ben Rosien in the discord channel\n \n this.platforms.getChildren().forEach(function (platform) {\n platform.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.boxes.getChildren().forEach(function (box) {\n box.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.shelves.getChildren().forEach(function (shelf) {\n shelf.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.fullShelves.getChildren().forEach(function (fullShelf) {\n fullShelf.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n this.messes.getChildren().forEach(function (mess) {\n mess.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n /*this.customers.getChildren().forEach(function (customer) {\n customer.body.velocity.y = this.scroll*this.platMod;\n }, this);*/ //flag\n\n this.agCustomers.getChildren().forEach(function (agCustomer) {\n agCustomer.body.velocity.y = this.scroll*this.platMod;\n }, this);\n\n } \n }\n }\n }", "title": "" }, { "docid": "a82c2fa2053a028318d86b20e7a3966b", "score": "0.50912833", "text": "function enemyAttacksBack(selectedEnemyHealthPoints, selectedCharacterAttackPower) {\n \tselectedEnemyHealthPoints = selectedEnemyHealthPoints - selectedCharacterAttackPower;\n \t$(\"#fight-section #selected-enemy .ui-widget-content .characterPower\").html(selectedEnemyHealthPoints);\n \tvar updatedCharacterAttackPower = selectedCharacterAttackPower + powerUp;\n \tconsole.log(\"Power surge is working: \" + updatedCharacterAttackPower);\n \t$(\"#selected-character #character-placeholder .ui-widget-content\").attr(\"data-attackPower\", updatedCharacterAttackPower);\n \tenemyDefeated = false;\n }", "title": "" }, { "docid": "90bac56181bf760b5d5537013d0db63a", "score": "0.5083842", "text": "enemyBust() {\n var dmg = (super.points() - 21);\n super.changeBust = true;\n super.changeHealth = (this.health - dmg); //lose health based on how much they were from 21\n document.getElementById(\"enemyHP\").innerHTML = this.health;\n document.getElementById(\"actionText\").innerHTML += '<br />' + this.name + \" took \" + dmg + \" damage.\";\n }", "title": "" }, { "docid": "17afa430001fae038707a5bb75af9447", "score": "0.50780964", "text": "function upgradeClick(upgradeAmount){\n\tvar clickUpgradeCost = Math.floor(10 * Math.pow(1.1,clickUpgradeAmount));\n\tif(money >= clickUpgradeCost){\n\t\tclickUpgradeAmount = clickUpgradeAmount + 1;\n\t\tmoney = money - clickUpgradeCost;\n\t\tdocument.getElementById('clickUpgradeAmount').innerHTML = clickUpgradeAmount;\n\t\tdocument.getElementById('money').innerHTML = money;\n\t}\n\tvar nextClickUpgradeCost = Math.floor(10 * Math.pow(1.1,clickUpgradeAmount));\n\tdocument.getElementById('clickUpgradeCost').innerHTML = nextClickUpgradeCost;\n}", "title": "" }, { "docid": "a82e3b67b70aa3e3fdc5a3f3bda56047", "score": "0.5069155", "text": "function Enemy1 (level) {\n this.power = 80;\n\n this.primaryAttack = function(target){\n target.power = target.power -30;\n };\n\n this.secondaryAttack = function(target){\n target.power = target.power -40;\n };\n\n this.specialAttack = function(target){\n target.power = target.power -40;\n this.power = this.power +40;\n };\n}", "title": "" }, { "docid": "f7767dee8596f761e208f18dd5026305", "score": "0.5050297", "text": "function collectAutoUpgrades() {\n for (let key in automaticUpgrades) {\n let autoUpgrade = automaticUpgrades[key]\n let upgrade = autoUpgrade.quantity * autoUpgrade.modifier\n\n honeyPot += upgrade\n }\n update()\n}", "title": "" }, { "docid": "7809172c5396ac7dcdbd090d285c65d2", "score": "0.50372165", "text": "function showChampionsUpgrades() {\n\tif(ryze.level>=18){\n\t\tdocument.getElementById(\"ryzeUpgrade18\").style.display = 'inline-block';\n\t}\n\telse{\n\t\tdocument.getElementById(\"ryzeUpgrade18\").style.display='none';\n\t}\n\t\n\tif(darius.level>=18){\n\t\tdocument.getElementById(\"dariusUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"dariusUpgrade18\").style.display='none';\n\t}\n\t\n\tif(rumble.level>=18){\n\t\tdocument.getElementById(\"rumbleUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"rumbleUpgrade18\").style.display='none';\n\t}\n\t\n\tif(riven.level>=18){\n\t\tdocument.getElementById(\"rivenUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"rivenUpgrade18\").style.display='none';\n\t}\n\t\n\tif(syndra.level>=18){\n\t\tdocument.getElementById(\"syndraUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"syndraUpgrade18\").style.display='none';\n\t}\n\t\n\tif(pantheon.level>=18){\n\t\tdocument.getElementById(\"pantheonUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"pantheonUpgrade18\").style.display='none';\n\t}\n\t\n\tif(mordekaiser.level>=18){\n\t\tdocument.getElementById(\"mordekaiserUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"mordekaiserUpgrade18\").style.display='none';\n\t}\n\t\n\tif(leeSin.level>=18){\n\t\tdocument.getElementById(\"leeSinUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"leeSinUpgrade18\").style.display='none';\n\t}\n\t\n\tif(kassadin.level>=18){\n\t\tdocument.getElementById(\"kassadinUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"kassadinUpgrade18\").style.display='none';\n\t}\n\t\n\tif(zed.level>=18){\n\t\tdocument.getElementById(\"zedUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"zedUpgrade18\").style.display='none';\n\t}\n\t\n\tif(heimerdinger.level>=18){\n\t\tdocument.getElementById(\"heimerdingerUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"heimerdingerUpgrade18\").style.display='none';\n\t}\n\t\n\tif(draven.level>=18){\n\t\tdocument.getElementById(\"dravenUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"dravenUpgrade18\").style.display='none';\n\t}\n\t\n\tif(akali.level>=18){\n\t\tdocument.getElementById(\"akaliUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"akaliUpgrade18\").style.display='none';\n\t}\n\t\n\tif(aurelionSol.level>=18){\n\t\tdocument.getElementById(\"aurelionSolUpgrade18\").style.display = 'inline-block';\n\t}\n\t\telse{\n\t\tdocument.getElementById(\"aurelionSolUpgrade18\").style.display='none';\n\t}\n\t\n}", "title": "" }, { "docid": "f8506eeb9dea58658e1b884e945b7802", "score": "0.50362533", "text": "updateEnergy(){\n\t\tthis.energy -= this.cell.cellPopPenalty;\n\t}", "title": "" }, { "docid": "c4dfe4f6e6456d999657bd2db5b65f2b", "score": "0.5031889", "text": "generateStatsObject(itemStats, champtionStats) {\n\t\t//this function will be a swtich statement\n\t\tlet newChamptionStats = {...champtionStats};\n\t\t_.forIn(itemStats.stats, function(value, key) {\n\t\t\tswitch (key) {\n\t\t\t \t/*****************all percentage case************/\n\t\t \tcase \"PercentAttackSpeedMod\": {\n\t\t \t//attack speed by percent 40%\n\t\t\t \tnewChamptionStats.attackspeed = applyPercentageItemEffect(champtionStats.attackspeed, value);\n\t\t\t \tif (newChamptionStats.attackspeed > 2.5) {\n\t\t\t \t\tnewChamptionStats.attackspeed = 2.5\n\t\t\t \t}\n\t\t\t \tbreak;\n\t\t \t}\n\t\t \t case \"PercentMovementSpeedMod\": {\n\t\t\t \t//movement speed by percent 7%\n\t\t\t newChamptionStats.movespeed = applyPercentageItemEffect(champtionStats.movespeed, value);\n\t\t\t }\n \t \t/*****************all flat case************/ \n\t\t case \"FlatCritChanceMod\": {\n\t \t \t//critChance 0.3 = 30% flat\n\t\t\t newChamptionStats.crit = applyFlatItemEffect(champtionStats.crit, value);\n\t\t\t if (newChamptionStats.crit > 100) {\n\t\t\t \tnewChamptionStats.crit = 100\n\t\t\t }\n\t\t\t break;\n\t\t }\n\t\t case \"FlatMagicDamageMod\": {\n\t\t \t//ablityPower ex: + 60\n\t\t \tnewChamptionStats.abilityPower = applyFlatItemEffect(champtionStats.abilityPower, value);\n\t\t \tbreak;\n\t\t }\n\t\t case \"FlatHPPoolMod\": {\n\t\t \t//flat health ex: + 400 health\n\t\t \tnewChamptionStats.hp = applyFlatItemEffect(champtionStats.hp, value);\n\t\t \tbreak;\n\t\t }\n\t\t case \"FlatPhysicalDamageMod\": {\n\t\t \t//flat damage ex: + 60 damage\n\t\t \tnewChamptionStats.attackdamage = applyFlatItemEffect(champtionStats.attackdamage, value);\n\t\t \tbreak;\n\t\t }\n\t\t case \"FlatArmorMod\": {\n\t\t \t//flat FlatArmorMod ex: + 100 armor\n\t\t \tnewChamptionStats.armor = applyFlatItemEffect(champtionStats.armor, value);\n\t\t \tbreak;\n\t\t }\n\t\t \tcase \"FlatSpellBlockMod\": {\n\t\t \t//flat magicResist ex: + 40 majic resist\n\t\t \t\tnewChamptionStats.magicResist = applyFlatItemEffect(champtionStats.magicResist, value);\n\t\t \t\tbreak;\n\t\t }\n\t\t //percent stats but treat as flat stats\n\t\t case \"PercentLifeStealMod\": {\n\t\t \t//lift steal like 10% but it's added as flat\n\t\t \t\tnewChamptionStats.lifeSteal = applyFlatItemEffect(champtionStats.lifeSteal, value);\n\t\t \t\tbreak;\n\t\t }\n\t\t\t}\n\t\t});\n\t this.props.dispatch(ItemAddedToCurrentChamption(itemStats.id, newChamptionStats));\n\t}", "title": "" }, { "docid": "53f4fc4fb5ac67aa13c4c63ceca7182f", "score": "0.50316364", "text": "function updateGame() {\n mana+=Math.log((slaingreatoaks+1000)/1000);\n growerincomepersec = 0;\n chopperincomepersec = 0;\n sellerincomepersec = 0;\n growerexpensepersec = 0;\n chopperexpensepersec = 0;\n sellerexpensepersec = 0;\n for (var i = 0; i < grower.length; i++) {\n growerincome = 0;\n sellerincome = 0;\n chopperincome = 0;\n growerexpense = 0;\n chopperexpense = 0;\n sellerexpense = 0;\n growerincome += grower[i].number * grower[i].income * treemodifier / 10;\n trees += growerincome;\n growerincomepersec += growerincome * 10;\n chopperincome += chopper[i].number * chopper[i].income * treemodifier / 10;\n chopperexpense += chopper[i].number * chopper[i].expense * treemodifier / 10;\n if (trees > chopperexpense) {\n trunks += chopperincome;\n trees -= chopperexpense;\n chopperincomepersec += chopperincome * 10;\n growerexpensepersec -= chopperexpense * 10;\n } else {\n if (trees !== 0 && chopperexpense !== 0) {\n var m = (trees - chopperexpense);\n\n if (!(isNaN(m) && isNaN(m / chopperexpense))) {\n chopperincome *= ((chopperexpense + m) / chopperexpense);\n trunks += chopperincome;\n chopperexpense += m;\n trees -= chopperexpense;\n chopperincomepersec += chopperincome * 10;\n growerexpensepersec -= chopperexpense * 10;\n }\n }\n }\n sellerincome += seller[i].number * seller[i].income * treemodifier / 10;\n sellerexpense += seller[i].number * seller[i].expense * treemodifier / 10;\n if (trunks > sellerexpense) {\n money += sellerincome;\n trunks -= sellerexpense;\n sellerincomepersec += sellerincome * 10;\n chopperexpensepersec -= sellerexpense * 10;\n } else {\n if (trunks !== 0 && sellerexpense !== 0) {\n var k = (trunks - sellerexpense);\n if (!(isNaN(k) && isNaN(k / sellerexpense))) {\n sellerincome *= ((sellerexpense + k) / sellerexpense);\n money += sellerincome;\n sellerexpense += k;\n trunks -= sellerexpense;\n sellerincomepersec += sellerincome * 10;\n chopperexpensepersec -= sellerexpense * 10;\n }\n }\n }\n }\n document.getElementById('trees').innerHTML = abreviation(trees) + \" trees Net:\" + abreviation((growerincomepersec + growerexpensepersec)) + \" <br>\" + abreviation(growerincomepersec) + \" trees/s \" + abreviation(growerexpensepersec) + \" trees felled/s\";\n document.getElementById('trunks').innerHTML = abreviation(trunks) + \" trunks Net:\" + abreviation((chopperincomepersec + chopperexpensepersec)) + \" <br>\" + abreviation(chopperincomepersec) + \" trunks/s \" + abreviation(chopperexpensepersec) + \" trunks sold/s\";\n document.getElementById('money').innerHTML = abreviation(money) + \" money Net:\" + abreviation((sellerincomepersec + sellerexpensepersec)) + \" <br>\" + abreviation(sellerincomepersec) + \" money/s \" + abreviation(sellerexpensepersec) + \" money spent/s\";\n\n document.getElementById(\"date\").innerHTML = \"Played for:\" + (new Date() - date) / 1000 + \" seconds\";\n document.getElementById(\"mana\").innerHTML = abreviation(mana)+\" mana\";\n}", "title": "" }, { "docid": "7741e6c5b8dc2c18eceb27e36a2a2cef", "score": "0.5020316", "text": "function Hacker(inputAlias, inputSkill, inputStoredCash) {\n this.alias = inputAlias,\n this.skill = inputSkill,\n this.pocketCash = \"doesn't go outside and therefore have no use for on-hand money.\",\n this.storedCash = inputStoredCash,\n //Adds person to players array to check their values later on\n this.addPlayerFunc = function () {\n players.push(this.alias + \" \" + this.pocketCash + \" His stored cash is $\" + this.storedCash + \".\");\n },\n //Property to steal money, but only from bank accounts\n this.hack = function(targetPerson) {\n var luck = Math.floor(10 * Math.random());\n var purse = ((luck + 1) * this.skill * 1000 * luck) + luck;\n //Skill is better than luck, make steal\n if (this.skill > luck) {\n //If the take is less than the chum has on hand\n if (purse <= (targetPerson.accountInfo.checking + targetPerson.accountInfo.savings)) {\n console.log(\"Good work. You stole $\" + purse + \".\");\n targetPerson.accountInfo.checking -= purse / 2;\n targetPerson.accountInfo.savings -= purse / 2;\n this.storedCash += purse;\n }\n //If the take is more than the chum has on hand, take it all\n else {\n purse = targetPerson.accountInfo.checking + targetPerson.accountInfo.savings;\n console.log(\"Good work. You stole $\" + purse + \". This was all of the unsecure funds.\");\n this.storedCash += purse;\n targetPerson.accountInfo.checking = 0;\n targetPerson.accountInfo.savings = 0;\n }\n }\n //skill is equal to luck, missed, but didn't get caught\n else if (this.skill === luck) {\n console.log(\"Better Luck Next Time!\");\n }\n //Skill is less than luck, got caught. Loose all cash.\n else {\n console.log(\"You were caught and taken to court and sued of all your cash.\");\n targetPerson.storedCash += this.storedCash;\n this.storedCash = 0;\n }\n targetPerson.accountInfo.recalculateAccount(targetPerson);\n }\n}", "title": "" }, { "docid": "c80f6eb8be9c6831559020c4e892210b", "score": "0.5020089", "text": "function CheckLevelUp(game) {\n let currentGame = game.getCurrentGame();\n const nextLevelExperience = GetExperienceForLevel(currentGame.level + 1);\n if (currentGame.experience >= nextLevelExperience) {\n // Level up\n currentGame.level += 1;\n // Determine random stat increase\n const STRENGTH_STAT = 1;\n const SPEED_STAT = 2;\n const HEALTH_STAT = 3;\n const GOLD_STAT = 4;\n const STAT_ARRAY = shuffleArray([STRENGTH_STAT, SPEED_STAT, HEALTH_STAT, GOLD_STAT]);\n let increaseStats = 0;\n let printMessage = \"Leveled up to level \" + currentGame.level + \"! \";\n let statMessage = \"You have leveled up to level \" + currentGame.level + \"!\\n\\n\";\n // Give one free stat increase per level\n increaseStats += 1;\n // Randomly choose to increase other stats\n const baseRandomness = 0.5;\n for (let index = 1; index < STAT_ARRAY.length; index++) {\n if (Math.random() >= baseRandomness) {\n increaseStats += 1;\n }\n }\n for (let index = 0; index < STAT_ARRAY.length && index < increaseStats; index++) {\n let stat = STAT_ARRAY[index];\n if (stat === STRENGTH_STAT) {\n let increaseAmount = Math.round(Math.random() * 2 + 1);\n currentGame.strength += increaseAmount;\n statMessage += \"Your strength has increased by \" + increaseAmount + \"!\\n\";\n printMessage += \"Strength has increased by \" + increaseAmount + \"! \";\n } else if (stat === SPEED_STAT) {\n let increaseAmount = Math.round(Math.random() * 2 + 1);\n currentGame.speed += increaseAmount;\n statMessage += \"Your speed has increased by \" + increaseAmount + \"!\\n\";\n printMessage += \"Speed has increased by \" + increaseAmount + \"! \";\n } else if (stat === HEALTH_STAT) {\n let healthIncrease = Math.floor(Math.random() * 5 + 5);\n currentGame.health += healthIncrease;\n currentGame.currentHealth += healthIncrease;\n statMessage += \"Your health has increased by \" + healthIncrease + \"!\\n\";\n printMessage += \"Health has increased by \" + healthIncrease + \"! \";\n } else if (stat === GOLD_STAT) {\n let goldBase = currentGame.level * 5;\n let foundGold = Math.floor(Math.random() * goldBase + goldBase);\n currentGame.gold += foundGold;\n statMessage += \"You found \" + foundGold + \" gold!\\n\";\n printMessage += \"Found \" + foundGold + \" gold! \";\n }\n }\n game.eventPopover.set(\"Level up!\",\n statMessage,\n \"Yay!\",\n () => {\n game.eventPopover.hide();\n CheckLevelUp(game);\n })\n game.eventPopover.show();\n game.print(printMessage);\n game.mainWindow.updateDisplay();\n }\n}", "title": "" }, { "docid": "95d9b180a8e4a470249aab1a86cfa6a7", "score": "0.50193256", "text": "function calculateStrength (playersArray){\r\n\tvar strength = 0;\r\n\treserves433 = new Array();\r\n\treserves442 = new Array();\r\n\treserves343 = new Array();\r\n\treserves451 = new Array();\r\n\treserves532lib = new Array();\r\n\treserves541 = new Array();\r\n\treserves352 = new Array();\r\n\treserves532vs = new Array();\r\n\tvar squad = new Array(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);\r\n\t// step 1: fill all positions with the best player and move other players of the same position to all reserves arrays\r\n\tfor (var i=0; i<playersArray.length; i++){\r\n\t\tswitch (playersArray[i][0]) {\r\n\t\t\tcase \"TW\":\r\n\t\t\t\tif (squad[TW]==0){\r\n\t\t\t\t\tsquad[TW] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[TW]){\r\n\t\t\t\t\tpushToReserves(squad[TW]/2);\r\n\t\t\t\t\tsquad[TW] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"LIB\":\r\n\t\t\t\tif (squad[LIB]==0){\r\n\t\t\t\t\tsquad[LIB] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[LIB]){\r\n\t\t\t\t\tpushToReserves(squad[LIB]/2);\r\n\t\t\t\t\tsquad[LIB] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"LV\":\r\n\t\t\t\tif (squad[LV]==0){\r\n\t\t\t\t\tsquad[LV] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[LV]){\r\n\t\t\t\t\tpushToReserves(squad[LV]/2);\r\n\t\t\t\t\tsquad[LV] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"LMD\":\r\n\t\t\t\tif (squad[LMD]==0){\r\n\t\t\t\t\tsquad[LMD] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[LMD]){\r\n\t\t\t\t\tpushToReserves(squad[LMD]/2);\r\n\t\t\t\t\tsquad[LMD] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"RMD\":\r\n\t\t\t\tif (squad[RMD]==0){\r\n\t\t\t\t\tsquad[RMD] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[RMD]){\r\n\t\t\t\t\tpushToReserves(squad[RMD]/2);\r\n\t\t\t\t\tsquad[RMD] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"RV\":\r\n\t\t\t\tif (squad[RV]==0){\r\n\t\t\t\t\tsquad[RV] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[RV]){\r\n\t\t\t\t\tpushToReserves(squad[RV]/2);\r\n\t\t\t\t\tsquad[RV] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"VS\":\r\n\t\t\t\tif (squad[VS]==0){\r\n\t\t\t\t\tsquad[VS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[VS]){\r\n\t\t\t\t\tpushToReserves(squad[VS]/2);\r\n\t\t\t\t\tsquad[VS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"LM\":\r\n\t\t\t\tif (squad[LM]==0){\r\n\t\t\t\t\tsquad[LM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[LM]){\r\n\t\t\t\t\tpushToReserves(squad[LM]/2);\r\n\t\t\t\t\tsquad[LM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"DM\":\r\n\t\t\t\tif (squad[DM]==0){\r\n\t\t\t\t\tsquad[DM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[DM]){\r\n\t\t\t\t\tpushToReserves(squad[DM]/2);\r\n\t\t\t\t\tsquad[DM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"ZM\":\r\n\t\t\t\tif (squad[ZM]==0){\r\n\t\t\t\t\tsquad[ZM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[ZM]){\r\n\t\t\t\t\tpushToReserves(squad[ZM]/2);\r\n\t\t\t\t\tsquad[ZM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"RM\":\r\n\t\t\t\tif (squad[RM]==0){\r\n\t\t\t\t\tsquad[RM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[RM]){\r\n\t\t\t\t\tpushToReserves(squad[RM]/2);\r\n\t\t\t\t\tsquad[RM] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"LS\":\r\n\t\t\t\tif (squad[LS]==0){\r\n\t\t\t\t\tsquad[LS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[LS]){\r\n\t\t\t\t\tpushToReserves(squad[LS]/2);\r\n\t\t\t\t\tsquad[LS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"MS\":\r\n\t\t\t\tif (squad[MS]==0){\r\n\t\t\t\t\tsquad[MS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[MS]){\r\n\t\t\t\t\tpushToReserves(squad[MS]/2);\r\n\t\t\t\t\tsquad[MS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"RS\":\r\n\t\t\t\tif (squad[RS]==0){\r\n\t\t\t\t\tsquad[RS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (parseFloat(playersArray[i][1]) > squad[RS]){\r\n\t\t\t\t\tpushToReserves(squad[RS]/2);\r\n\t\t\t\t\tsquad[RS] = parseFloat(playersArray[i][1]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tpushToReserves(parseFloat(playersArray[i][1])/2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\t\r\n\t\t\tdefault:\r\n\t\t\t\talert(\"bad position error\");\r\n\t\t}\r\n\t}\r\n\tsortReserves();\r\n\t//sort reserves so that the best is first\r\n\r\n\t// step 2: the following positions are always needed, so they can be filled if empty with the best reserves\r\n\tif(squad[TW]==0 && reserves433.length > 0){\r\n\t\tsquad[TW] = getBestReserve();\r\n\t}\r\n\tif(squad[LMD]==0 && reserves433.length > 0){\r\n\t\tsquad[LMD] = getBestReserve();\r\n\t}\r\n\tif(squad[RMD]==0 && reserves433.length > 0){\r\n\t\tsquad[RMD] = getBestReserve();\r\n\t}\r\n\tif(squad[LM]==0 && reserves433.length > 0){\r\n\t\tsquad[LM] = getBestReserve();\r\n\t}\r\n\tif(squad[ZM]==0 && reserves433.length > 0){\r\n\t\tsquad[ZM] = getBestReserve();\r\n\t}\r\n\tif(squad[RM]==0 && reserves433.length > 0){\r\n\t\tsquad[RM] = getBestReserve();\r\n\t}\r\n\t\r\n\t// now we start differentiating different formations...\r\n\tvar strength433 = 0;\r\n\tvar strength442 = 0;\r\n\tvar strength343 = 0;\r\n\tvar strength451 = 0;\r\n\tvar strength532lib = 0;\r\n\tvar strength541 = 0;\r\n\tvar strength352 = 0;\r\n\tvar strength532vs = 0;\r\n\tvar squad433 = new Array();\r\n\tvar squad442 = new Array();\r\n\tvar squad343 = new Array();\r\n\tvar squad451 = new Array();\r\n\tvar squad532lib = new Array();\r\n\tvar squad541 = new Array();\r\n\tvar squad352 = new Array();\r\n\tvar squad532vs = new Array();\r\n\t\r\n\t//step 3: if player of position X is present, but not needed in the formation, he can be moved to reserves of the other formations\r\n\tif(squad[LIB]!=0){\r\n\t\treserves433.push(squad[LIB]/2);\r\n\t\treserves442.push(squad[LIB]/2);\r\n\t\treserves451.push(squad[LIB]/2);\r\n\t\treserves532vs.push(squad[LIB]/2);\r\n\t}\r\n\tif(squad[LV]!=0){\r\n\t\treserves343.push(squad[LV]/2);\r\n\t\treserves352.push(squad[LV]/2);\r\n\t}\r\n\tif(squad[RV]!=0){\r\n\t\treserves343.push(squad[RV]/2);\r\n\t\treserves352.push(squad[RV]/2);\r\n\t}\r\n\tif(squad[VS]!=0){\r\n\t\treserves433.push(squad[VS]/2);\r\n\t\treserves442.push(squad[VS]/2);\r\n\t\treserves343.push(squad[VS]/2);\r\n\t\treserves532lib.push(squad[VS]/2);\r\n\t\treserves541.push(squad[VS]/2);\r\n\t}\r\n\tif(squad[DM]!=0){\r\n\t\treserves433.push(squad[DM]/2);\r\n\t\treserves532lib.push(squad[DM]/2);\r\n\t\treserves532vs.push(squad[DM]/2);\r\n\t}\r\n\tif(squad[LS]!=0){\r\n\t\treserves451.push(squad[LS]/2);\r\n\t\treserves541.push(squad[LS]/2);\r\n\t}\r\n\tif(squad[MS]!=0){\r\n\t\treserves442.push(squad[MS]/2);\r\n\t\treserves532lib.push(squad[MS]/2);\r\n\t\treserves352.push(squad[MS]/2);\r\n\t\treserves532vs.push(squad[MS]/2);\r\n\t}\r\n\tif(squad[RS]!=0){\r\n\t\treserves451.push(squad[RS]/2);\r\n\t\treserves541.push(squad[RS]/2);\r\n\t}\r\n\tsortReserves();\r\n\t//again sort the reserves to get the best in first position\r\n\t\r\n\t//step 4: fill the different formation squads with the players of the total squad array\r\n\t//the formation arrays contain the indices needed for that formation - see global variables above\r\n\tvar i;\r\n\tfor (i=0; i<11; i++){\r\n\t\tsquad433.push(squad[formation433[i]]);\r\n\t\tsquad442.push(squad[formation442[i]]);\r\n\t\tsquad343.push(squad[formation343[i]]);\r\n\t\tsquad451.push(squad[formation451[i]]);\r\n\t\tsquad532lib.push(squad[formation532lib[i]]);\r\n\t\tsquad541.push(squad[formation541[i]]);\r\n\t\tsquad352.push(squad[formation352[i]]);\r\n\t\tsquad532vs.push(squad[formation532vs[i]]);\r\n\t}\r\n\tsquad433.sort();\r\n\tsquad442.sort();\r\n\tsquad343.sort();\r\n\tsquad451.sort();\r\n\tsquad532lib.sort();\r\n\tsquad541.sort();\r\n\tsquad352.sort();\r\n\tsquad532vs.sort();\r\n\t//sort the formations so the weakest players are first\r\n\t\r\n\t//step 5: check all positions if there is a reserve available who is better and than switch the players\r\n\t// here the strength of each formation is also calculated\r\n\tvar sub;\r\n\tfor (i=0; i<11; i++){\r\n\t\tif (reserves433.length>0){\r\n\t\t\tsub = reserves433[0];\r\n\t\t\tif(squad433[i]==0){\r\n\t\t\t\tsquad433[i] = reserves433.shift();\r\n\t\t\t\tstrength433 = strength433 + squad433[i];\r\n\t\t\t}\r\n\t\t\telse if (squad433[i] < sub) {\r\n\t\t\t\treserves433.push(squad433[i]/2);\r\n\t\t\t\treserves433.sort().reverse();\r\n\t\t\t\tsquad433[i] = reserves433.shift();\r\n\t\t\t\tstrength433 = strength433 + squad433[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength433 = strength433 + squad433[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength433 = strength433 + squad433[i];\r\n\t\t}\r\n\t\tif (reserves442.length>0){\r\n\t\t\tsub = reserves442[0];\r\n\t\t\tif(squad442[i]==0){\r\n\t\t\t\tsquad442[i] = reserves442.shift();\r\n\t\t\t\tstrength442 = strength442 + squad442[i];\r\n\t\t\t}\r\n\t\t\telse if (squad442[i] < sub) {\r\n\t\t\t\treserves442.push(squad442[i]/2);\r\n\t\t\t\treserves442.sort().reverse();\r\n\t\t\t\tsquad442[i] = reserves442.shift();\r\n\t\t\t\tstrength442 = strength442 + squad442[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength442 = strength442 + squad442[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength442 = strength442 + squad442[i];\r\n\t\t}\r\n\t\tif (reserves343.length>0){\r\n\t\t\tsub = reserves343[0];\r\n\t\t\tif(squad343[i]==0){\r\n\t\t\t\tsquad343[i] = reserves343.shift();\r\n\t\t\t\tstrength343 = strength343 + squad343[i];\r\n\t\t\t}\r\n\t\t\telse if (squad343[i] < sub) {\r\n\t\t\t\treserves343.push(squad343[i]/2);\r\n\t\t\t\treserves343.sort().reverse();\r\n\t\t\t\tsquad343[i] = reserves343.shift();\r\n\t\t\t\tstrength343 = strength343 + squad343[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength343 = strength343 + squad343[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength343 = strength343 + squad343[i];\r\n\t\t}\r\n\t\tif (reserves451.length>0){\r\n\t\t\tsub = reserves451[0];\r\n\t\t\tif(squad451[i]==0){\r\n\t\t\t\tsquad451[i] = reserves451.shift();\r\n\t\t\t\tstrength451 = strength451 + squad451[i];\r\n\t\t\t}\r\n\t\t\telse if (squad451[i] < sub) {\r\n\t\t\t\treserves451.push(squad451[i]/2);\r\n\t\t\t\treserves451.sort().reverse();\r\n\t\t\t\tsquad451[i] = reserves451.shift();\r\n\t\t\t\tstrength451 = strength451 + squad451[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength451 = strength451 + squad451[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength451 = strength451 + squad451[i];\r\n\t\t}\r\n\t\tif (reserves532lib.length>0){\r\n\t\t\tsub = reserves532lib[0];\r\n\t\t\tif(squad532lib[i]==0){\r\n\t\t\t\tsquad532lib[i] = reserves532lib.shift();\r\n\t\t\t\tstrength532lib = strength532lib + squad532lib[i];\r\n\t\t\t}\r\n\t\t\telse if (squad532lib[i] < sub) {\r\n\t\t\t\treserves532lib.push(squad532lib[i]/2);\r\n\t\t\t\treserves532lib.sort().reverse();\r\n\t\t\t\tsquad532lib[i] = reserves532lib.shift();\r\n\t\t\t\tstrength532lib = strength532lib + squad532lib[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength532lib = strength532lib + squad532lib[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength532lib = strength532lib + squad532lib[i];\r\n\t\t}\r\n\t\tif (reserves541.length>0){\r\n\t\t\tsub = reserves541[0];\r\n\t\t\tif(squad541[i]==0){\r\n\t\t\t\tsquad541[i] = reserves541.shift();\r\n\t\t\t\tstrength541 = strength541 + squad541[i];\r\n\t\t\t}\r\n\t\t\telse if (squad541[i] < sub) {\r\n\t\t\t\treserves541.push(squad541[i]/2);\r\n\t\t\t\treserves541.sort().reverse();\r\n\t\t\t\tsquad541[i] = reserves541.shift();\r\n\t\t\t\tstrength541 = strength541 + squad541[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength541 = strength541 + squad541[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength541 = strength541 + squad541[i];\r\n\t\t}\r\n\t\tif (reserves352.length>0){\r\n\t\t\tsub = reserves352[0];\r\n\t\t\tif(squad352[i]==0){\r\n\t\t\t\tsquad352[i] = reserves352.shift();\r\n\t\t\t\tstrength352 = strength352 + squad352[i];\r\n\t\t\t}\r\n\t\t\telse if (squad352[i] < sub) {\r\n\t\t\t\treserves352.push(squad352[i]/2);\r\n\t\t\t\treserves352.sort().reverse();\r\n\t\t\t\tsquad352[i] = reserves352.shift();\r\n\t\t\t\tstrength352 = strength352 + squad352[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength352 = strength352 + squad352[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength352 = strength352 + squad352[i];\r\n\t\t}\r\n\t\tif (reserves532vs.length>0){\r\n\t\t\tsub = reserves532vs[0];\r\n\t\t\tif(squad532vs[i]==0){\r\n\t\t\t\tsquad532vs[i] = reserves532vs.shift();\r\n\t\t\t\tstrength532vs = strength532vs + squad532vs[i];\r\n\t\t\t}\r\n\t\t\telse if (squad532vs[i] < sub) {\r\n\t\t\t\treserves532vs.push(squad532vs[i]/2);\r\n\t\t\t\treserves532vs.sort().reverse();\r\n\t\t\t\tsquad532vs[i] = reserves532vs.shift();\r\n\t\t\t\tstrength532vs = strength532vs + squad532vs[i];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstrength532vs = strength532vs + squad532vs[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstrength532vs = strength532vs + squad532vs[i];\r\n\t\t}\r\n\t}\r\n\t//uncomment for debugging and get a popup with best strength for each formation\r\n\t//alert(\"433: \" + strength433 + \"\\n442: \" + strength442 + \"\\n343: \" + strength343 + \"\\n451: \" + strength451 + \"\\n532lib: \" + strength532lib + \"\\n541: \" + strength541 + \"\\n352: \" + strength352 + \"\\n532vs: \" + strength532vs);\r\n\t\r\n\t// step 6: return the maximum value of all formations\r\n\treturn Math.max(strength433, strength442, strength343, strength451, strength532lib, strength541, strength352, strength532vs);\r\n}", "title": "" }, { "docid": "a70b8cd99d3cddd0aa10b09011cb1276", "score": "0.5018324", "text": "function checkUpgrades(){\n drillsUpgrade()\n cartsUpgrade()\n}", "title": "" }, { "docid": "5671556b3ce15789283fbc12cb5ca53a", "score": "0.5013146", "text": "async function fixTooManyUnits(state, playerIndex) {\n const board = state.getIn(['players', playerIndex, 'board']);\n // Find cheapest unit\n const iter = board.keys();\n let temp = iter.next();\n let cheapestCost = 100;\n let cheapestCostIndex = List([]);\n while (!temp.done) {\n const unitPos = temp.value;\n const cost = (await pokemonJS.getStats(board.get(unitPos).get('name'))).get('cost');\n if (cost < cheapestCost) {\n cheapestCost = cost;\n cheapestCostIndex = List([unitPos]);\n } else if (cost === cheapestCost) {\n cheapestCostIndex = cheapestCostIndex.push(unitPos);\n }\n temp = iter.next();\n }\n let chosenUnit;\n if (cheapestCostIndex.size === 1) {\n chosenUnit = cheapestCostIndex.get(0);\n } else {\n // TODO Check the one that provides fewest combos\n // Temp: Random from cheapest\n const chosenIndex = Math.random() * cheapestCostIndex.size;\n chosenUnit = cheapestCostIndex.get(chosenIndex);\n }\n // Withdraw if possible unit, otherwise sell\n // console.log('@FixTooManyUnits Check keys', state.get('players'));\n let newState;\n // TODO: Inform Client about update\n if (state.getIn(['players', playerIndex, 'hand']).size < 8) {\n console.log('WITHDRAWING PIECE', board.get(chosenUnit).get('name'));\n newState = await withdrawPiece(state, playerIndex, chosenUnit);\n } else {\n console.log('SELLING PIECE', board.get(chosenUnit).get('name'));\n newState = await sellPiece(state, playerIndex, chosenUnit);\n }\n const newBoard = newState.getIn(['players', playerIndex, 'board']);\n const level = newState.getIn(['players', playerIndex, 'level']);\n if (newBoard.size > level) {\n return fixTooManyUnits(newState, playerIndex);\n }\n return newState.getIn(['players', playerIndex]);\n}", "title": "" }, { "docid": "edd7de088cf0914248d755643cf40c22", "score": "0.50084144", "text": "function cursorUpgrade10(){\n\tif (soulsCount >= 50){\n\t\tsoulsCount -= 50; //Pay the cost...\n\t\tcursorMulti *= 2; //Increase the multiplier...\n\t\tcursorUpgrade10Bought = true; //Disable the button.\n\t\tpurchasedUpgrades++; //And increment the upgrade counter.\n\t\tresetUpgrades();\n\t}\n}", "title": "" }, { "docid": "4baeb0bc50641c8871eb236731d5eee8", "score": "0.5003083", "text": "newGoalLogic(creep) {\n if (creep.memory.lab_goal && !this.isGoalValid(creep, creep.memory.lab_goal)) {\n creep.log('invalidGoal', JSON.stringify(creep.memory.lab_goal));\n delete creep.memory.lab_goal;\n }\n\n if (!creep.memory.lab_goal) {\n if (creep.memory.goalCheck && creep.memory.goalCheck > Game.time - 10) {\n return;\n }\n // export minerals go to terminal\n\n // labs with bad min\n // fill almost empty labs\n // unload almost full labs\n // fill lab energy\n let labs = creep.room.structures[STRUCTURE_LAB];\n let roomProduction = creep.room.memory.lab_production;\n // if (!roomProduction) {\n // return this.oldGoalLogic(creep);\n // }\n\n // creep.log('room labs', labs, labs.map((lab)=>this.expectedMineralType(lab)));\n let requireEmptying = (lab) => (lab.mineralType && (lab.mineralType !== lab.room.expectedMineralType(lab)\n || (lab.room.expectedMineralType(lab) === roomProduction && lab.mineralAmount > lab.mineralCapacity / 2)));\n let requireRefilling = (lab) => {\n let expected = lab.room.expectedMineralType(lab);\n return (!roomProduction || expected !== roomProduction) // production target, ignore\n && (!lab.mineralType || lab.mineralType === expected)\n && ((lab.mineralAmount || 0) < lab.mineralCapacity / 2); // ingredient, refill\n };\n let terminal = creep.room.terminal;\n let desiredLedger = creep.room.desiredLedger;\n let carryCapacity = creep.carryCapacity;\n let goalFinders = [\n // gather minerals from containers\n () => {\n let needEmptying = _.max(creep.room.structures[STRUCTURE_CONTAINER] || [], container => {\n let totalStore = _.sum(container.store) || 0;\n let energy = (container.store.energy || 0);\n return energy < totalStore // has minerals\n && totalStore > 0.5 * container.storeCapacity;\n });\n // creep.log('needEmptying labs', needEmptying, needEmptying.map((lab)=>creep.room.expectedMineralType(lab)));\n if (needEmptying && needEmptying !== -Infinity && _.sum(needEmptying.store) - needEmptying.store.energy) {\n creep.memory.lab_goal = {\n name: 'unloadContainer',\n action: this.ACTION_UNLOAD,\n loadTarget: needEmptying.id,\n mineralType: _.max(_.pull(_.keys(needEmptying.store), RESOURCE_ENERGY), r => needEmptying.store[r])\n };\n }\n },\n // empty wrong mineral labs\n (labs) => {\n if ((!creep.room.storage) || (creep.room.storage.storeCapacity - 10000 < _.sum(creep.room.storage.store))) return;\n let needEmptying = _.sortBy(labs.filter((lab) => requireEmptying(lab)), lab => -lab.mineralAmount);\n // creep.log('needEmptying labs', needEmptying, needEmptying.map((lab)=>creep.room.expectedMineralType(lab)));\n let goal = needEmptying.reduce((goal, lab) => {\n if (goal) {\n return goal;\n } else {\n let containerId = lab.room.find(FIND_STRUCTURES).filter(s => !s.runReaction && s.store && s.store[lab.mineralType]) // do not drop in other labs\n .map((c) => c.id).find((s) => s.id !== lab.id) || lab.room.storage.id;\n if (containerId) {\n // TODO\n return {\n name: 'unloadLab',\n action: this.ACTION_UNLOAD,\n unloadTarget: lab.room.storage.id,\n mineralType: lab.mineralType,\n loadTarget: lab.id,\n };\n } else {\n return undefined;\n }\n }\n\n }, undefined);\n // creep.log('not full labs goals ', JSON.stringify(goals));\n if (goal) {\n creep.memory.lab_goal = goal;\n }\n },\n // refill lab mineral\n (labs) => {\n let ledger = creep.room.currentLedger;\n let needRefilling = labs.filter((lab) => requireRefilling(lab) && (ledger[lab.room.expectedMineralType(lab)] || 0) > 0);\n // creep.log('needRefilling labs', needRefilling, needRefilling.map((lab)=>lab.room.expectedMineralType(lab)));\n if (needRefilling.length ===0) return;\n let lab = _.min(needRefilling, lab=>lab.mineralAmount);\n // creep.log('chosen', lab);\n if (lab) {\n let expectedMineralType = lab.room.expectedMineralType(lab);\n let source = lab.room.storage.store[expectedMineralType] ? lab.room.storage : lab.room.terminal;\n creep.memory.lab_goal = {\n name: 'fillLab',\n action: this.ACTION_FILL,\n loadTarget: source.id,\n unloadTarget: lab.id,\n mineralType: expectedMineralType,\n };\n }\n },\n // refill lab energy\n (labs) => {\n let missingEnergyLabs = labs.filter((lab) => lab.energy < lab.energyCapacity);\n // creep.log('missingEnergyLabs', missingEnergyLabs.length);\n let goal = _.sample(missingEnergyLabs.map((lab) => {\n let goal = {\n name: 'fillLab',\n action: this.ACTION_FILL,\n mineralType: RESOURCE_ENERGY,\n loadTarget: lab.room.storage.id,\n unloadTarget: lab.id\n };\n return goal;\n }));\n // creep.log('not full labs goals ', JSON.stringify(goals));\n if (goal && goal.container) {\n creep.memory.lab_goal = goal;\n }\n },\n // refill/unload terminal energy\n () => {\n let terminalEnergy = _.get(creep.room.terminal, ['store', RESOURCE_ENERGY], 0);\n let storageEnergy = _.get(creep.room.storage, ['store', RESOURCE_ENERGY], 0);\n if (terminal) {\n if (creep.room.export.length > 0 && storageEnergy > 10000 && terminalEnergy < this.terminalEnergyTarget(creep.room) - carryCapacity) {\n creep.memory.lab_goal = {\n name: 'fillTerminal',\n action: this.ACTION_FILL,\n // lab: terminal.id,\n mineralType: RESOURCE_ENERGY,\n unloadTarget: creep.room.terminal.id,\n loadTarget: creep.room.storage.id,\n };\n } else if (terminalEnergy > this.terminalEnergyTarget(creep.room)) {\n creep.memory.lab_goal = {\n name: 'fillStorage',\n action: this.ACTION_UNLOAD,\n // lab: terminal.id,\n mineralType: RESOURCE_ENERGY,\n loadTarget: creep.room.terminal.id,\n unloadTarget: creep.room.storage.id,\n };\n }\n }\n },\n // export mineral , fill terminal\n () => {\n let min;\n if (creep.room.export && _.get(creep.room.storage, ['store', RESOURCE_ENERGY], 0) > 10000 && terminal && terminal.storeCapacity > _.sum(terminal.store)) {\n // creep.log('seeking exports', JSON.stringify(creep.room.memory.exports), JSON.stringify(creep.room.storage.store));\n min = creep.room.export.find((min) => {\n // creep.log('testing', min, creep.room.storage.store[min], (!terminal.store || ! terminal.store[min] ||terminal.store[min]<10000));\n return RESOURCE_ENERGY !== min\n && (creep.room.storage.store[min] || 0) - carryCapacity > (desiredLedger[min] || 0)\n && (_.get(terminal, ['store', min], 0) < 10000);\n });\n // creep.log('testing sellOrders?', !min);\n }\n if (!min && creep.room.sellOrders) {\n min = _.keys(creep.room.sellOrders).find(m => creep.room.storage.store[m] && (terminal.store[m] || 0) < Math.min(creep.room.sellOrders[m], 5000));\n // creep.log('sellOrder min ', min);\n }\n if (!min) {\n let streamingOrder = (Memory.streamingOrders || []).find(\n o => o.from === creep.room.name && (o.amount > 100) && o.what !== RESOURCE_ENERGY\n && _.get(creep.room.storage, ['store', o.what], 0) > 0 && _.get(creep.room.terminal, ['store', o.what], 0) < 10000);\n if (streamingOrder) {\n min = streamingOrder.what;\n }\n }\n if (min) {\n creep.memory.lab_goal = {\n name: 'fillTerminal',\n unloadTarget: creep.room.terminal.id,\n loadTarget: creep.room.storage.id,\n action: this.ACTION_FILL,\n mineralType: min,\n };\n }\n },\n // import mineral , move to storage\n () => {\n if (creep.room.terminal && creep.room.terminal.store && creep.room.storage && creep.room.storage.storeCapacity - 10000 > _.sum(creep.room.storage.store)) {\n // creep.log('seeking exports', JSON.stringify(creep.room.memory.exports), JSON.stringify(creep.room.storage.store));\n let min = _.keys(creep.room.terminal.store).find((min) => {\n // creep.log('testing', min, creep.room.storage.store[min], (!terminal.store || ! terminal.store[min] ||terminal.store[min]<10000));\n let neededForTrade = _.sum(_.values(Game.market.orders).filter(o => o.type === 'sell' && o.roomName === creep.room.name && o.resourceType === min), o => o.remainingAmount);\n let wantedInTerminal = Math.max(neededForTrade, Math.min(10000, (creep.room.currentLedger[min] || 0) - (creep.room.desiredLedger[min] || 0)));\n return min !== RESOURCE_ENERGY && (creep.room.terminal.store[min] || 0) - carryCapacity > wantedInTerminal;\n });\n if (min) {\n creep.memory.lab_goal = {\n name: 'fillStorage',\n unloadTarget: creep.room.storage.id,\n loadTarget: creep.room.terminal.id,\n action: this.ACTION_FILL,\n mineralType: min,\n };\n }\n }\n },\n // fill nuker\n () => {\n let nuker = _.head(creep.room.structures[STRUCTURE_NUKER]);\n if (!nuker || (nuker.ghodium || 0) == nuker.ghodiumCapacity) {\n return;\n }\n let ghodiumProvider = [creep.room.storage, creep.room.terminal].find(s => s && _.get(s, ['store', RESOURCE_GHODIUM], 0));\n if (ghodiumProvider) {\n let goal = {\n name: 'fillNuker',\n action: this.ACTION_FILL,\n mineralType: RESOURCE_GHODIUM,\n container: ghodiumProvider.id,\n unloadTarget: nuker.id\n };\n creep.memory.lab_goal = goal;\n }\n\n },\n\n ];\n for (let i = 0, max = goalFinders.length; i < max && !creep.memory.lab_goal; i++) {\n // creep.log('finding goal', i);\n goalFinders[i](labs);\n }\n\n // creep.log('chosen goal', JSON.stringify(creep.memory.lab_goal));\n if (!creep.memory.lab_goal) {\n creep.memory.goalCheck = Game.time;\n }\n }\n\n\n }", "title": "" }, { "docid": "24251d8abc7e54b243a538053d322bf6", "score": "0.49930084", "text": "function evaluateEquipmentEfficiency(equipName) {\n var equip = equipmentList[equipName];\n var gameResource = equip.Equip ? game.equipment[equipName] : game.buildings[equipName];\n if (equipName == 'Shield') {\n if (gameResource.blockNow) {\n equip.Stat = 'block';\n } else {\n equip.Stat = 'health';\n }\n }\n var Effect = equipEffect(gameResource, equip);\n var Cost = equipCost(gameResource, equip);\n var Factor = Effect / Cost;\n var StatusBorder = 'white';\n var Wall = false;\n\n if (!game.upgrades[equip.Upgrade].locked) {\n //Evaluating upgrade!\n var CanAfford = canAffordTwoLevel(game.upgrades[equip.Upgrade]);\n if (equip.Equip) {\n var NextEffect = PrestigeValue(equip.Upgrade);\n //Scientist 3 and 4 challenge: set metalcost to Infinity so it can buy equipment levels without waiting for prestige. (fake the impossible science cost)\n //also Fake set the next cost to infinity so it doesn't wait for prestiges if you have both options disabled.\n if ((game.global.challengeActive == \"Scientist\" && getScientistLevel() > 2) || (!BuyWeaponUpgrades && !BuyArmorUpgrades))\n var NextCost = Infinity;\n else\n var NextCost = Math.ceil(getNextPrestigeCost(equip.Upgrade) * Math.pow(1 - game.portal.Artisanistry.modifier, game.portal.Artisanistry.level));\n Wall = (NextEffect / NextCost > Factor);\n if (buyWeaponsMode === 3) { //eventhough we allow prestiging of equipment, defer it until levels become expensive.\n if(Cost * 100 < game.resources.metal.owned)\n Wall = false;\n }\n else if (buyWeaponsMode == 2 || buyWeaponsMode == 4) Wall = false; //prestiging equipment isnt allowed, so allow buying levels\n\n var done = game.upgrades[equipmentList[equipName].Upgrade].done;\n var allowed = game.upgrades[equipmentList[equipName].Upgrade].allowed;\n if(getPageSetting('AutoStance')==1 && getPageSetting('DelayWeaponsForWind') && buyWeaponsMode === 1 && done === allowed - 1) //1: prestige till 1 before max prestige and level 2: prestige only 3: buy everything\n Wall = false;\n }\n\n //white - Upgrade is not available\n //yellow - Upgrade is not affordable\n //orange - Upgrade is affordable, but will lower stats\n //red - Yes, do it now!\n\n if (!CanAfford) {\n StatusBorder = 'yellow';\n } else {\n if (!equip.Equip) {\n StatusBorder = 'red';\n } else {\n var CurrEffect = gameResource.level * Effect;\n var NeedLevel = Math.ceil(CurrEffect / NextEffect);\n var Ratio = gameResource.cost[equip.Resource][1];\n var NeedResource = NextCost * (Math.pow(Ratio, NeedLevel) - 1) / (Ratio - 1);\n if (game.resources[equip.Resource].owned > NeedResource) {\n StatusBorder = 'red';\n } else {\n StatusBorder = 'orange';\n }\n }\n }\n }\n //what this means:\n //wall (don't buy any more equipment, buy prestige first)\n //Factor = 0 sets the efficiency to 0 so that it will be disregarded. if not, efficiency will still be somenumber that is cheaper,\n // and the algorithm will get stuck on whatever equipment we have capped, and not buy other equipment.\n if (game.jobs[mapresourcetojob[equip.Resource]].locked && (game.global.challengeActive != 'Metal')){\n //cap any equips that we haven't unlocked metal for (new/fresh game/level1/no helium code)\n Factor = 0;\n Wall = true;\n }\n //if (gameResource.level < 25 && equip.Stat != \"attack\") {\n // Factor = 999 - gameResource.prestige;\n //}\n //skip buying shields (w/ shieldblock) if we need gymystics\n if (equipName == 'Shield' && gameResource.blockNow &&\n game.upgrades['Gymystic'].allowed - game.upgrades['Gymystic'].done > 0)\n {\n Factor = 0;\n Wall = true;\n StatusBorder = 'orange';\n }\n return {\n Stat: equip.Stat,\n Factor: Factor,\n StatusBorder: StatusBorder,\n Wall: Wall,\n Cost: Cost\n };\n}", "title": "" }, { "docid": "5f9afc247028c45fdc6d9e21fc56030c", "score": "0.4986597", "text": "function prestige(){\r\n if(player.number > 1e+25) {\r\n let keepOnPrestige = {\r\n superNumber: player.superNumber,\r\n WorkerAutomatorBought: player.shop.WorkerAutomatorBought,\r\n bought22: player.shop.bought22,\r\n bought32: player.shop.bought32,\r\n bought111: player.shop.bought111,\r\n bought112: player.shop.bought112,\r\n }\r\n player.superNumber = keepOnPrestige.superNumber\r\n player.superNumber += superOnPrestige()\r\n keepOnPrestige.superNumber = player.superNumber\r\n player = defaultData()\r\n player.superNumber = keepOnPrestige.superNumber\r\n player.shop.WorkerAutomatorBought = keepOnPrestige.WorkerAutomatorBought\r\n player.shop.bought22 = keepOnPrestige.bought22\r\n player.shop.bought32 = keepOnPrestige.bought32\r\n player.shop.bought111 = keepOnPrestige.bought111\r\n player.shop.bought112 = keepOnPrestige.bought112\r\n player.prestigeUnlocked = true\r\n player.navUnlocked = true\r\n player.upgradeUnlocked = true\r\n player.prestiged = true\r\n update()\r\n }\r\n}", "title": "" }, { "docid": "81a7a7a52b8ccf97cbe1f7be1958b95c", "score": "0.4981936", "text": "function update_pow(new_pow) {} // NO FUNCTION", "title": "" }, { "docid": "10071d5cb003b81fccecba9575d0cc88", "score": "0.49818042", "text": "function updateCash(){\r\n consts.cashObj.innerHTML = formatValue(player.money,2,2);\r\n\r\n // This is a little arbitrary being in here, but we'll want to call it everytime we update cash anyways...\r\n updateUpgradeLabels(\"winMulti\");\r\n updateUpgradeLabels(\"winExpo\");\r\n updateUpgradeLabels(\"superMulti\");\r\n updateUpgradeLabels(\"tickSpeed\");\r\n updateUpgradeLabels(\"xpGain\");\r\n\r\n updateRemoveLabels();\r\n updateAbilityLabels();\r\n\r\n if (player.money < consts.powerupBaseCost*Math.pow(consts.powerupcostMulti,player.powerupCount)){\r\n for (var i = 0; i < 3; i++){\r\n document.getElementById(i+\"selectPowerupBtn\").style.color=\"gray\";\r\n }\r\n }else{\r\n for (var i = 0; i < 3; i++){\r\n document.getElementById(i+\"selectPowerupBtn\").style.color=\"black\";\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "334ef63dd4fa902deb36b42988a28c22", "score": "0.49778584", "text": "function goFight(fighter1, fighter2) {\n document.getElementById(\"formulaire\").style.display = 'none';\n document.getElementById(\"fight\").style.display = 'block';\n document.getElementById(\"fighter1\").innerHTML = name1;\n document.getElementById(\"fighter2\").innerHTML = name2;\n\n var insert = document.getElementById(\"fight-table\").getElementsByTagName('tbody')[0];\n // Ces variables servent juste à compter les critiques et les esquives\n var w = 0;\n var x = 0;\n var y = 0;\n var z = 0;\n\n var damagePlayer1;\n var damagePlayer2;\n // On fait une boucle pour simuler des rounds\n for (var i = 0; i < 100; i++) {\n\n // chance de CC aléatoire * 100\n chanceCC1 = Math.random();\n chanceCC2 = Math.random();\n\n chanceCC1 = chanceCC1 * 100;\n chanceCC2 = chanceCC2 * 100;\n\n // chance d'esquive esquive / 100\n esquiveP1 = Math.random();\n esquiveP2 = Math.random();\n\n esquiveP1 = esquiveP1 * 100;\n esquiveP2 = esquiveP2 * 100;\n\n if (esquiveP2 <= esquive2) {\n damagePlayer1 = 0;\n w++;\n }\n else {\n // si chance CC * 100 <= au nombre donné à la base --> Coup critique\n if (chanceCC1 <= criticalChance1) {\n health2 = (health2 - (strength1 * 1.5));\n damagePlayer1 = (strength1 * 1.5);\n y++;\n }\n else {\n health2 = (health2 - strength1);\n damagePlayer1 = (strength1);\n\n }\n }\n if (esquiveP1 <= esquive1) {\n damagePlayer2 = 0;\n z++;\n }\n else {\n // si chance CC * 100 <= au nombre donné à la base --> Coup critique\n if (chanceCC2 <= criticalChance2) {\n health1 = (health1 - (strength2 * 1.5));\n x++;\n damagePlayer2 = (strength2 * 1.5);\n }\n else {\n health1 = (health1 - strength2);\n\n damagePlayer2 = (strength2);\n\n }\n }\n\n // construction du tableau cellule par cellule (lance index.html dans ton navigateur tu verra le résultat ;)\n var row = insert.insertRow(i);\n\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n var cell4 = row.insertCell(3);\n var cell5 = row.insertCell(4);\n var cell6 = row.insertCell(5);\n var cell7 = row.insertCell(6);\n\n cell2.innerHTML = damagePlayer2;\n cell3.innerHTML = damagePlayer1;\n cell4.innerHTML = health1;\n cell5.innerHTML = damagePlayer1;\n cell6.innerHTML = damagePlayer2;\n cell7.innerHTML = health2;\n\n damagePlayer1 = 0;\n damagePlayer2 = 0;\n\n if (health1 <= 0) {\n console.log(\"STOOOOOOOP\");\n document.getElementById(\"winner\").innerHTML = \"WINNER : \" + name2 + \"<br>Il a esquivé \" + w + \" fois !\" + \"<br>Et il a fait \" + x + \" coups critiques !\";\n return false;\n }\n if (health2 <= 0) {\n console.log(\"STOOOOOOOP\");\n document.getElementById(\"winner\").innerHTML = \"WINNER : \" + name1 + \"<br>Il a esquivé \" + z + \" fois !\" + \"<br>Et il a fait \" + y + \" coups critiques !\" ;\n return false;\n }\n }\n }", "title": "" }, { "docid": "6b5d9586f1872881ed0409c071349ea0", "score": "0.4976591", "text": "function ChampionLevelAchievement(name, champion, levelReq, unlockingMessage) {\n\tthis.name = name;\n\tthis.champion = champion;\n\tthis.levelReq = levelReq;\n this.unlockingMessage = unlockingMessage;\n\t\n\tthis.unlocked = 0;\n}", "title": "" }, { "docid": "64a5aeabbb6e0c178cdb53d114d1d608", "score": "0.49732333", "text": "function gameDemonstration() {\n\n var heracles = new Champion({\n name: 'Heracles',\n attack: 10,\n hitpoints: 100\n });\n var boar = new Monster({\n name: 'Erymanthian Boar',\n attack: 10,\n hitpoints: 100\n });\n\n heracles.getTotalHitpoints();\n heracles.getHitpoints();\n heracles.getAttack();\n heracles.fight(boar);\n boar.fight(heracles);\n heracles.rest();\n heracles.setAttack(45);\n heracles.fight(boar);\n heracles.fight(boar);\n heracles.fight(boar);\n heracles.rest();\n boar.isAlive();\n boar.setHitpoints(100);\n boar.isAlive();\n boar.setAttack(35);\n boar.enrage();\n boar.fight(heracles);\n heracles.defence();\n boar.fight(heracles);\n heracles.rest();\n boar.fight(heracles);\n heracles.setTotalHitpoints(300);\n heracles.setHitpoints(350);\n heracles.isAlive();\n heracles.getKillerPoints();\n boar.getKillerPoints();\n}", "title": "" }, { "docid": "009e30cee2862a2e8463122cf64ca2c3", "score": "0.4971286", "text": "shrink(){\n if (difficulty === 1) {\n cieling += 3;\n this.height += 3;\n } else if (difficulty === 2) {\n cieling += 7;\n this.height += 7;\n } else if (difficulty === 3 || difficulty === 4) {\n cieling += 10;\n this.height += 10;\n }\n }", "title": "" }, { "docid": "5051a552e49839ab617b8db089b6f6e4", "score": "0.49693978", "text": "calculateEffectiveCharacterLevel() {\n this.effectiveClassLevel = 0;\n for (let i = 0; i < this.classes.length; i++) {\n this.effectiveClassLevel += parseInt(this.classes[i].level);\n }\n }", "title": "" }, { "docid": "6065a13f76a48f05f4ff484d15f5b329", "score": "0.49589658", "text": "function upgradeUser(user) {\n if (user.point > 10) {\n //long upgrade logic..\n } \n}", "title": "" }, { "docid": "243171f895637273854c3a55ec84f981", "score": "0.49564514", "text": "function resetGame() { // END SEASON\n var totalTeemosSlain = pastTeemosSlain + teemosSlain;\n var newNumberOfPoros = Math.round(Math.pow((totalTeemosSlain/1000000),1/4));\n var oldNumberOfPoros = Math.round(Math.pow((pastTeemosSlain/1000000),1/4));\n var porosDifferential = newNumberOfPoros - oldNumberOfPoros\n\tif(confirm(\"You will restart from scratch, but keeping the achievements you unlocked. You will recieve \" + porosDifferential + \" new poros (GpS bonus) fighting by your side.\")){\n\t\n\t\t//rewards\n\t\tvar temp = pastTeemosSlain + teemosSlain;\n\t\tvar displayUrfUnlocked = false; // display the message\n\t\t\n\t\tnumberOfPoros = Math.round(Math.pow((temp/1000000),1/4));\n\t\tdocument.getElementById(\"displayedNumberOfPoros\").innerHTML = numberOfPoros;\n\t\n\t\t//Clears champions and their upgrades\n\t\tryze.level = 0;\n\t\tryzeUpgrade18.owned = 0;\n\t\tryze.upgrade18Owned = 0;\n\t\t\n\t\tdarius.level = 0;\n\t\tdariusUpgrade18.owned = 0;\n\t\tdarius.upgrade18Owned = 0;\n\t\t\n\t\trumble.level = 0;\n\t\trumbleUpgrade18.owned = 0;\n\t\trumble.upgrade18Owned = 0;\n\t\t\n\t\triven.level = 0;\n\t\trivenUpgrade18.owned = 0;\n\t\triven.upgrade18Owned = 0;\n\t\t\n\t\tsyndra.level = 0;\n\t\tsyndraUpgrade18.owned = 0;\n\t\tsyndra.upgrade18Owned = 0;\n\t\t\n\t\tpantheon.level = 0;\n\t\tpantheonUpgrade18.owned = 0;\n\t\tpantheon.upgrade18Owned = 0;\n\t\t\n\t\tmordekaiser.level = 0;\n\t\tmordekaiserUpgrade18.owned = 0;\n\t\tmordekaiser.upgrade18Owned = 0;\n\t\t\n\t\tleeSin.level = 0;\n\t\tleeSinUpgrade18.owned = 0;\n\t\tleeSin.upgrade18Owned = 0;\n\t\t\n\t\tkassadin.level = 0;\n\t\tkassadinUpgrade18.owned = 0;\n\t\tkassadin.upgrade18Owned = 0;\n\t\t\n\t\tzed.level = 0;\n\t\tzedUpgrade18.owned = 0;\n\t\tzed.upgrade18Owned = 0;\n\t\t\n\t\theimerdinger.level = 0;\n\t\theimerdingerUpgrade18.owned = 0;\n\t\theimerdinger.upgrade18Owned = 0;\n\t\t\n\t\tdraven.level = 0;\n\t\tdravenUpgrade18.owned = 0;\n\t\tdraven.upgrade18Owned = 0;\n\t\t\n\t\takali.level = 0;\n\t\takaliUpgrade18.owned = 0;\n\t\takali.upgrade18Owned = 0;\n\t\t\n\t\taurelionSol.level = 0;\n\t\taurelionSolUpgrade18.owned = 0;\n\t\taurelionSol.upgrade18Owned = 0;\n\t\t\n\t\t//Clears inventory\n\t\tfor(i=0;i<=6;i++){\n\t\t\tsellItem(doransBlade);\n\t\t\tsellItem(doransRing);\n\t\t\tsellItem(brutalizer);\n\t\t\tsellItem(hauntingGuise);\n\t\t\tsellItem(lightbringer);\n\t\t\tsellItem(lastWhisper);\n\t\t\tsellItem(voidStaff);\n\t\t\tsellItem(bloodthirster);\n\t\t\tsellItem(rabadonsDeathcap);\n\t\t\tsellItem(phantomDancer);\n\t\t\tsellItem(nashorsTooth);\n\t\t\tsellItem(trinityForce);\n\t\t\tsellItem(ghostblade);\n\t\t\tsellItem(infinityEdge);\n\t\t\tsellItem(deathfireGrasp);\n\t\t}\n \n unequipChampionSpell(ryzeOverload);\n unequipChampionSpell(rivenBrokenWings);\n unequipChampionSpell(mordekaiserChildrenOfTheGrave);\n unequipChampionSpell(zedDeathMark);\n\t\t\n bonetoothNecklace.number = 0;\n\t\theartOfGold.number = 0;\n\t\tphilosophersStone.number = 0;\n\t\t\n\t\t//skins\n mainButtonTeemoPortrait = \"files/teemoPortraits/teemo_face.jpg\";\n updateMainButtonPortraitInterface();\n document.getElementById(\"unequipSkinsButton\").style.display = \"none\";\n \n classicTeemo.owned = 0;\n\t\treconTeemo.owned = 0;\n\t\tcottontailTeemo.owned = 0;\n\t\tastronautTeemo.owned = 0;\n\t\tsuperTeemo.owned = 0;\n\t\tbadgerTeemo.owned = 0;\n\t\tpandaTeemo.owned = 0;\n\t\tomegaSquadTeemo.owned = 0;\n\t\t\n\t\t\n\t\t//TeemosSlain\n\t\tif(pastTeemosSlain < urfTeemosSlainRequirement && pastTeemosSlain + teemosSlain >= urfTeemosSlainRequirement){\n\t\t\tdisplayUrfUnlocked = true;\n\t\t}\n\t\tpastTeemosSlain = pastTeemosSlain + teemosSlain;\n\t\ttotalGoldGained = 0;\n\t\tteemosSlain = 0;\n\t\t\n\t\t//basic\n\t\t\n\t\tgold = 0;\n//\t\tsetPassive(0);\n passiveChoice = 0;\n\t\tseasonCount++;\n\t\t\n\t\t//interface\n\t\tshowChampionsUpgrades();\n showChampionSpellsBlocks();\n\t\tcheckTeemoSkinsUnlocking();\n\t\tdocument.getElementById(\"chooseYourPassive\").style.display = 'block';\n\t\topenTab(0);\n\t\tupdateInterface();\n\t\t\n\t\t\n\t\tif(allTimeTeemosSlain>=urfTeemosSlainRequirement){\n\t\tdocument.getElementById(\"urfChoice\").style.display = \"block\";\n\t\t}\t\n\t\t\n\t\t//end of reset message\n\t\tif(displayUrfUnlocked){\n\t\talert(\"You have unlocked a new passive, and \" + numberOfPoros + \" Poros are fighting by your side!\");\n\t\t}\n\t\telse{\n\t\talert(numberOfPoros + \" Poros are fighting by your side!\");\n\t\t}\n \n\t\tsave();\n load();\n\t\t\n\t}\n\n}", "title": "" }, { "docid": "d3415e485d146e93f16cec2f21e35d60", "score": "0.49535817", "text": "scaleDifficulty(score){\n let newDifficulty = Math.floor(score / 10000);\n\n if( NEW_OBSTACLE_CHANCE > 3 && DIFFICULTY != newDifficulty && NEW_OBSTACLE_CHANCE - 1 >= 3 ){\n DIFFICULTY++;\n NEW_OBSTACLE_CHANCE--;\n }\n }", "title": "" }, { "docid": "f52d0ef0f9d9418ea1c74d90ccf09726", "score": "0.49487", "text": "function changeHealth() {\n\tvar hero = $('.your-char div').attr('id');\n\tif(hero == 'Peashooter') {\n\t\thero = Peashooter\n\t};\n\tif(hero == 'CherryBomb') {\n\t\thero = CherryBomb\n\t};\n\tif(hero == 'Chomper') {\n\t\thero = Chomper\n\t};\n\tif(hero == 'KernelPult') {\n\t\thero = KernelPult\n\t};\n\n\tvar villain = $('.defender div').attr('id');\n\tif(villain == 'Peashooter') {\n\t\tvillain = Peashooter\n\t};\n\tif(villain == 'CherryBomb') {\n\t\tvillain = CherryBomb\n\t};\n\tif(villain == 'Chomper') {\n\t\tvillain = Chomper\n\t};\n\tif(villain == 'KernelPult') {\n\t\tvillain = KernelPult\n\t};\n\n\t$('.defender .health').html(villain.health -= hero.attackPower);\n\t$('.your-char .health').html(hero.health -= villain.counterAttack);\n\t\n\t$('.attack-report').html(\"You attacked \" + villain.name + \" for \" + hero.attackPower + \" damage.\");\n\n\t$('.counter-report').html(villain.name + \" attacked you back for \" + villain.counterAttack + \" damage.\");\n\n\thero.attackPower += hero.attackPowerConstant;\n\n\t// status update of players depending on if you win or lose.\n\tif(hero.health <= 0 || villain.health <= 0) {\n\t\tif(hero.health <= 0) {\n\t\t\t$('.result').html(\"YOU LOSE.\");\n\t\t\t$('.btn-attack').remove();\n\t\t\t$('.fight-section').append('<button class=\"restart btn btn-danger\">Restart Game</button>');\n\t\t\t$('.restart').click(restart);\n\t\t} else {\n\t\t\t$('.attack-report').html(\"You defeated \" + villain.name + \"!\");\n\t\t\t$('.counter-report').html(\"Please choose your next opponent.\");\n\t\t\t$('.defender div').remove();\n\t\t\t$('.enemies').on('click', pickVillain);\n\t\t\t$('.enemies').click(function(){\n \t\t\t$('.enemies').unbind('click', pickVillain);\n \t\t});\n\t\t}\n\t\tif($('.enemies div').length == 0) {\n\t\t\t$('.result').html(\"YOU WIN!\");\n\t\t\t$('.btn-attack').remove();\n\t\t\t$('.fight-section').append('<button class=\"restart btn btn-danger\">Restart Game</button>');\n\t\t\t$('.restart').click(restart);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ac8ecb0539050580803142094aca072d", "score": "0.49481338", "text": "function surpriseAttack(attackAmount) {\n camperHealth -= attackAmount\n isCamperAlive()\n}", "title": "" }, { "docid": "770d0557058b753595410c54aed68a2b", "score": "0.49462417", "text": "async function checkPieceUpgrade(stateParam, playerIndex, piece, position) {\n let state = stateParam;\n const boardUnits = state.getIn(['players', playerIndex, 'board']);\n const name = piece.get('name');\n const stats = await pokemonJS.getStats(name);\n if (f.isUndefined(stats.get('evolves_to'))) return Map({ state, upgradeOccured: false });\n let pieceCounter = 0;\n let positions = List([]);\n const keysIter = boardUnits.keys();\n let tempUnit = keysIter.next();\n while (!tempUnit.done) {\n const unit = boardUnits.get(tempUnit.value);\n if (unit.get('name') === name) {\n pieceCounter += 1;\n positions = positions.push(unit.get('position'));\n // TODO: Check for bug buff here (baby pkmns)\n }\n tempUnit = keysIter.next();\n }\n let requiredAmount = 3;\n if (piece.get('reqEvolve')) {\n requiredAmount = piece.get('reqEvolve');\n console.log('LESS UNITS REQUIRED FOR UPGRADE', piece.get('name'), requiredAmount);\n }\n if (pieceCounter >= requiredAmount) { // Upgrade unit @ position\n // console.log('UPGRADING UNIT', name);\n let board = state.getIn(['players', playerIndex, 'board']);\n let discPieces = state.get('discardedPieces');\n for (let i = 0; i < positions.size; i++) {\n const unit = board.get(positions.get(i));\n discPieces = discPieces.push(unit.get('name'));\n board = board.delete(positions.get(i));\n }\n state = state.set('discardedPieces', discPieces);\n state = state.setIn(['players', playerIndex, 'board'], board);\n const evolvesUnit = stats.get('evolves_to');\n let evolvesTo = evolvesUnit;\n if (!f.isUndefined(evolvesTo.size)) { // List\n evolvesTo = evolvesUnit.get(f.getRandomInt(evolvesTo.size));\n }\n // Check if multiple evolutions exist, random between\n const newPiece = await getBoardUnit(evolvesTo, f.x(position), f.y(position));\n state = state.setIn(['players', playerIndex, 'board', position], newPiece);\n // TODO: List -> handle differently\n const evolutionDisplayName = (await pokemonJS.getStats(evolvesTo)).get('displayName');\n // console.log('evolutionDisplayName', evolutionDisplayName);\n const nextPieceUpgrade = await checkPieceUpgrade(state, playerIndex, newPiece, position);\n // Get both upgrades\n return nextPieceUpgrade.set('upgradeOccured', List([evolutionDisplayName]).concat(nextPieceUpgrade.get('upgradeOccured') || List([])));\n }\n return Map({ state, upgradeOccured: false });\n}", "title": "" }, { "docid": "7b08bca086eeecb9f17f118b7828387a", "score": "0.49420196", "text": "function purchaseUpgrade(input) {\n let upgradeChoice = mineMethod[input]\n let noBuyAlert = document.getElementById('shop-alert-space')\n if (upgradeChoice.upPrice <= currentCheese) {\n upgradeChoice.quantity += 1;\n currentCheese -= upgradeChoice.upPrice\n upgradeChoice.upPrice *= upgradeChoice.upIncrement;\n console.log(`purchased 1 ${input}/t- ${upgradeChoice.quantity}`)\n playMusic(mineMethod[input].sound)\n drawMiners(input)\n globalCheeseRefine += upgradeChoice.refineValue\n } else {\n noBuyAlert.innerHTML = `<div id='shop-alert' class=\"col-12 order-1 alert alert-danger alert-dismissable fade show\" role=\"alert\">\n Could not buy ${upgradeChoice.name}, need ${Math.ceil(upgradeChoice.upPrice - currentCheese)} <i class=\"fa fa-moon-o\"></i>\n </div>`\n function alertTimeout() {\n noBuyAlert.innerHTML = ''\n }\n setTimeout(alertTimeout, 4 * second)\n // window.alert(`Could not buy, need more cheese (${upgradeChoice.upPrice - currentCheese})`)\n }\n if (mineMethod[input].upgradePath !== 'none') {\n if (mineMethod[input].quantity >= 10) {\n mineMethod[mineMethod[input].upgradePath].unlocked = true;\n }\n }\n drawUpdate()\n}", "title": "" }, { "docid": "881252c5526a278fcd2237906f3c34f7", "score": "0.49307144", "text": "function verifyAlphaUpgrade(column, row) {\r\n\tvar cost;\r\n\tif (row == 1 || row == 2) cost = 1;\r\n\tif (row == 3 || row == 5 || row == 6) cost = 2;\r\n\tif (row == 4) cost = 3;\r\n\tif (row == 7) cost = 4;\r\n\tif (row == 8) cost = 5;\r\n\t\r\n\tif(!upgIncl(column + row)) {\r\n\tswitch(column) {\r\n\t\t\tcase \"A\":\r\n\t\t\tif (row > 6 || row < 4) return false;\r\n\t\t\tif (row == 4 && upgIncl(\"E4\") && upgIncl(\"B4\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row <= 6 && row >= 5 && game.alpha.upgrades.includes(\"A\" + row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"B\":\r\n\t\t\tif (row == 1 && !upgIncl(\"E1\") && !upgIncl(\"H1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"E1\") && upgIncl(\"E7\") && !upgIncl(\"H1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"H1\") && upgIncl(\"H7\") && !upgIncl(\"E1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"E1\") && upgIncl(\"E7\") && upgIncl(\"H1\") && upgIncl(\"H7\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row > 1 && upgIncl(\"B\"+row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"C\":\r\n\t\t\tif (row > 6 || row < 4) return false;\r\n\t\t\tif (row == 4 && upgIncl(\"H4\") && upgIncl(\"B4\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row <= 6 && row >= 5 && game.alpha.upgrades.includes(\"C\" + row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"D\":\r\n\t\t\tif (row > 6 || row < 4) return false;\r\n\t\t\tif (row == 4 && upgIncl(\"E4\") && upgIncl(\"B4\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row <= 6 && row >= 5 && game.alpha.upgrades.includes(\"D\" + row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"E\":\r\n\t\t\tif (row == 1 && !upgIncl(\"B1\") && !upgIncl(\"H1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"B1\") && upgIncl(\"B7\") && !upgIncl(\"H1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"H1\") && upgIncl(\"H7\") && !upgIncl(\"B1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"B1\") && upgIncl(\"B7\") && upgIncl(\"H1\") && upgIncl(\"H7\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row > 1 && upgIncl(\"E\"+row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"F\":\r\n\t\t\tif (row > 6 || row < 4) return false;\r\n\t\t\tif (row == 4 && upgIncl(\"H4\") && upgIncl(\"E4\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row <= 6 && row >= 5 && game.alpha.upgrades.includes(\"F\" + row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"G\":\r\n\t\t\tif (row > 6 || row < 4) return false;\r\n\t\t\tif (row == 4 && upgIncl(\"H4\") && upgIncl(\"B4\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row <= 6 && row >= 5 && game.alpha.upgrades.includes(\"G\" + row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"H\":\r\n\t\t\tif (row == 1 && !upgIncl(\"E1\") && !upgIncl(\"B1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"E1\") && upgIncl(\"E7\") && !upgIncl(\"B1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"B1\") && upgIncl(\"B7\") && !upgIncl(\"E1\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row == 1 && upgIncl(\"E1\") && upgIncl(\"E7\") && upgIncl(\"B1\") && upgIncl(\"B7\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row > 1 && upgIncl(\"H\"+row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t\tcase \"I\":\r\n\t\t\tif (row > 6 || row < 4) return false;\r\n\t\t\tif (row == 4 && upgIncl(\"H4\") && upgIncl(\"E4\") && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tif (row <= 6 && row >= 5 && game.alpha.upgrades.includes(\"I\" + row-1) && game.alpha.alphonium.gte(cost)) return true;\r\n\t\t\tbreak\r\n\t\t}\r\n\t\tif (game.alpha.alphonium.lt(cost)) return false;\r\n\t}\r\n\telse return false;\r\n}", "title": "" }, { "docid": "457c83c229c9486b67cab98b05f34f1d", "score": "0.49291855", "text": "function best_building(affordable)\n{\n\tvar affordable=affordable||0; //Feature requested by [REDACTED]\n\tvar lowest = Number.MAX_VALUE;\n\tvar name = \"\";\n\tvar add=0;\n\tif (Game.Has('Thousand fingers')) add+=\t\t0.1;\n\tif (Game.Has('Million fingers')) add+=\t\t0.5;\n\tif (Game.Has('Billion fingers')) add+=\t\t5;\n\tif (Game.Has('Trillion fingers')) add+=\t\t50;\n\tif (Game.Has('Quadrillion fingers')) add+=\t500;\n\tif (Game.Has('Quintillion fingers')) add+=\t5000;\n\tif (Game.Has('Sextillion fingers')) add+=\t50000;\n\tif (Game.Has('Septillion fingers')) add+=\t500000;\n\tif (Game.Has('Octillion fingers')) add+=\t5000000;\n\tvar num =0;\n\tfor (var i in Game.Objects) {if (Game.Objects[i].name!='Grandma') num+=Game.Objects[i].amount;}\n\n\n\tfor (var me in Game.Objects) //goes through the arbitrary list\n\t{\n\t\t//Step 1: Calculate how much long it would take until we have enough cookies to buy it (Thanks to the JGU Physics department)\n\t\tvar current= Math.max(get_time(-Game.cookies+Game.Objects[me].price),0);\n\n\t\t//Step 2: calculate the increase in CpS this building would bring\n\t\t//Step 2.1: Flat CpS this building would add\n\t\tcps = g_cps(me);\n\n\t\t//Step 2.2: Calculate the base multiplier for grandmas\n\t\tif (me.name == \"Grandma\" || me.name == \"Portal\") \n\t\t{\n\t\t\tvar mult=1;\n\t\t\tif (Game.Has('Farmer grandmas')) mult*=2;\n\t\t\tif (Game.Has('Worker grandmas')) mult*=2;\n\t\t\tif (Game.Has('Miner grandmas')) mult*=2;\n\t\t\tif (Game.Has('Cosmic grandmas')) mult*=2;\n\t\t\tif (Game.Has('Transmuted grandmas')) mult*=2;\n\t\t\tif (Game.Has('Altered grandmas')) mult*=2;\n\t\t\tif (Game.Has('Grandmas\\' grandmas')) mult*=2;\n\t\t\tif (Game.Has('Antigrandmas')) mult*=2;\n\t\t\tif (Game.Has('Rainbow grandmas')) mult*=2;\n\t\t\tif (Game.Has('Banker grandmas')) mult*=2;\n\t\t\tif (Game.Has('Priestess grandmas')) mult*=2;\n\t\t\tif (Game.Has('Witch grandmas')) mult*=2;\n\t\t\tif (Game.Has('Bingo center/Research facility')) mult*=4;\n\t\t\tif (Game.Has('Ritual rolling pins')) mult*=2;\n\t\t\tif (Game.Has('Naughty list')) mult*=2;\n\t\t\tmult*=Game.GetTieredCpsMult(Game.Objects['Grandma']);\n\t\t}\n\n\t\t//Step 2.3: Grandmas affect every building with the proper upgrades\n\t\tif (me.name == \"Grandma\")\n\t\t{\n\t\t\t//Step 2.3.1: add the Grandma synergy boosts to our CpS\n\t\t\tif(Game.Has(\"Farmer grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Farm\");\n\t\t\tif(Game.Has(\"Miner grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Mine\");\n\t\t\tif(Game.Has(\"Worker grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Factory\");\n\t\t\tif(Game.Has(\"Banker grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Bank\");\n\t\t\tif(Game.Has(\"Priestess grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Temple\");\n\t\t\tif(Game.Has(\"Witch grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Wizard tower\");\n\t\t\tif(Game.Has(\"Cosmic grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Shipment\");\n\t\t\tif(Game.Has(\"Transmuted grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Alchemy lab\");\n\t\t\tif(Game.Has(\"Altered grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Portal\");\n\t\t\tif(Game.Has(\"Grandmas\\' grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Time machine\");\n\t\t\tif(Game.Has(\"Antigrandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Antimatter condenser\");\n\t\t\tif(Game.Has(\"Rainbow grandmas\"))\n\t\t\t\tcps += one_grandma_synergy(\"Prism\");\n\n\t\t\t//Step 2.3.2: Grandmas affect each other, so add the boost the other grandmas would gain\n\t\t\t//+2 because of the boost the new grandma will give to the others and because of the bosst it will receive from the others\n\t\t\tif (Game.Has('One mind'))\n\t\t\t\tcps+=(Game.Objects['Grandma'].amount+2)*0.02*mult; \n\t\t\tif (Game.Has('Communal brainsweep')) \n\t\t\t\tcps+=(Game.Objects['Grandma'].amount+2)*0.02*mult;\n\t\t} \n\t\telse if (Game.hasAura('Elder Battalion')) \t\t//Alt Step 2.3: Elder Battalion Aura, \n\t\t{\n\t\t\tcps+=(Game.cookiesPsByType['Grandma']/(1+0.01*num))*0.01;\n\t\t}\n\n\n\t\t//Step 2.4: Add the boost to Grandmas a new Portal brings\n\t\tif (me.name == \"Portal\" && Game.Has('Elder Pact')) \n\t\t\tcps+=Game.Objects['Grandma'].amount*0.05*mult;\n\n\t\t//Step 2.5: With the right upgrades, Cursors gain a boost every for other building\n\t\tif (me.name != \"Cursor\")\n\t\t{\n\t\t\tcps += add*Game.Objects['Cursor'].amount;\n\t\t}\n\n\t\t//Step 2.6: Synergies, finding the correct formula to get the right increase was not easy\n\t\tfor (var i in me.synergies)\n\t\t{\n\t\t\tvar syn=me.synergies[i];\n\t\t\tif (Game.Has(syn.name))\n\t\t\t{\n\t\t\t\tif (syn.buildingTie2.name==me.name) \n\t\t\t\t\tcps+=(Game.cookiesPsByType[syn.buildingTie1.name]/(1+0.05*(syn.buildingTie2.amount)))*0.05;\n\t\t\t\telse if (syn.buildingTie1.name==me.name) \n\t\t\t\t\tcps+=(Game.cookiesPsByType[syn.buildingTie2.name]/(1+0.001*(syn.buildingTie1.amount)))*0.001;\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\t//Step 3: Add the time until the boost pays for the current object to the time until we can buy it\n\t\tcurrent += Game.Objects[me].price/cps;\n\t\t\n\t\t//Step 4: is the current building the most efficient in terms of time till 0 is reached\n\t\t//Extra Step: if you call the function with a true, you will buy the most efficient building you can afford to buy right now\n\t\tif( current < lowest && (!affordable || Game.cookies>Game.Objects[me].price))\n\t\t{\n\t\t\tlowest = current;\n\t\t\tname = me;\n\t\t}\n\t\t\n\t}\n\treturn name;\n}", "title": "" }, { "docid": "4d9b662af707bed1c07deedb3effe218", "score": "0.492543", "text": "happens() {\n // check if the ability did what it needs to give ult charge\n let hitTarget = false;\n let healed = false;\n // remove the energy this costs and set the player's acted to yes\n this.user.energy -= this.cost;\n this.user.acted = true;\n if (this.ultimate === true) {\n this.user.ultCharge -= 100;\n }\n // for each effect, apply\n for (let i = 0; i < this.effects.length; i++) {\n let theEffect = this.effects[i];\n switch (this.effects[i].type) {\n case \"damage\":\n for (let i2 = 0; i2 < theEffect.targets.length; i2++) {\n theEffect.targets[i].hp -= round(theEffect.amount * (1+this.user.offenseChange*0.01) * (1+theEffect.targets[i].defenseChange*0.01));\n theEffect.targets[i].hp = constrain(theEffect.targets[i].hp, 0, theEffect.targets[i].maxHp);\n }\n break;\n case \"heal\":\n for (let i2 = 0; i2 < theEffect.targets.length; i2++) {\n let targetOldHp = theEffect.targets[i2].hp;\n theEffect.targets[i2].hp += theEffect.amount;\n theEffect.targets[i2].hp = constrain(theEffect.targets[i2].hp, 0, theEffect.targets[i2].maxHp);\n // if the target's health went up after being healed, then give heal ult charge\n if (targetOldHp < theEffect.targets[i2].maxHp && theEffect.targets[i2].hp > targetOldHp) {\n healed = true;\n }\n }\n break;\n case \"offense_up\":\n for (let i2 = 0; i2 < theEffect.targets.length; i2++) {\n theEffect.targets[i2].offenseChange += theEffect.amount;\n console.log( theEffect.targets[i2]);\n }\n break;\n case \"offense_down\":\n for (let i2 = 0; i2 < theEffect.targets.length; i2++) {\n theEffect.targets[i].offenseChange -= theEffect.amount;\n }\n break;\n case \"defense_up\":\n for (let i2 = 0; i2 < theEffect.targets.length; i2++) {\n theEffect.targets[i].defenseChange += theEffect.amount;\n }\n break;\n case \"defense_down\":\n for (let i2 = 0; i2 < theEffect.targets.length; i2++) {\n theEffect.targets[i].defenseChange -= theEffect.amount;\n }\n break;\n case \"ramp\":\n for (let i2 = 0; i2 < theEffect.targets.length; i2++) {\n theEffect.targets[i2].energy += theEffect.amount;\n theEffect.targets[i2].energy = constrain(theEffect.targets[i2].energy, 0, theEffect.targets[i2].maxEnergy);\n }\n break;\n // combat only effects\n case \"bullet\":\n shootBullets(theEffect, this);\n break;\n // move the user towards the mouse angle direction\n case \"dash\":\n let dashCounter = 10;\n let currentUserAngle = this.user.angle;\n let dashInterval = setInterval(() => {\n this.user.vx = this.user.currentSpeed * theEffect.amount * cos(currentUserAngle);\n this.user.vy = this.user.currentSpeed * theEffect.amount * sin(currentUserAngle);\n this.user.x += this.user.vx;\n this.user.y += this.user.vy;\n dashCounter--;\n if (dashCounter <= 0) {\n clearInterval(dashInterval);\n }\n }, 10);\n break;\n default: console.log(\"error\");\n }\n for (let i4 = 0; i4 < this.chargeGive.length; i4++) {\n switch (this.chargeGive[i4][1]) {\n case \"use\":\n this.user.ultCharge += this.chargeGive[i4][0];\n this.user.ultCharge = constrain(this.user.ultCharge, 0, 100);\n break;\n case \"heal\":\n if (healed === true) {\n this.user.ultCharge += this.chargeGive[i4][0];\n this.user.ultCharge = constrain(this.user.ultCharge, 0, 100);\n }\n break;\n default:\n }\n }\n // this ability is now used this turn\n this.used = true;\n // if this is a combat ability with a cooldown, then after use, set the timer\n if (this.cooldown !== 0 && this.onCooldown === false) {\n this.onCooldown = true;\n this.cooldownLeft = this.cooldown;\n let cooldownTimer = setInterval(() => {\n this.cooldownLeft -= 1;\n if (this.cooldownLeft <= 0) {\n this.onCooldown = false;\n this.cooldownLeft = 0;\n clearInterval(cooldownTimer);\n }\n }, 1000);\n // intervalsList.push(this.cooldownTimer);\n }\n // remove all targets from the ability effect since ability effect is finished\n theEffect.targets = [];\n }\n }", "title": "" }, { "docid": "9b61fe26fb353b5dcafc3498ee213528", "score": "0.49231225", "text": "function mineRupees(){\n totalRupees++\n for(let key in clickUpgrades){\n let item = clickUpgrades[key]\n totalRupees += item.multiplier * item.quantity\n }\n updateRupees()\n}", "title": "" } ]
3a7c4c4504a15db7b467166d77c34789
Attach Gestures: hook document and check shouldHijack clicks
[ { "docid": "6fe8e0b3ac425bf015e6d97e684d65e9", "score": "0.6962256", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\t\n\t // Polyfill document.contains for IE11.\n\t // TODO: move to util\n\t document.contains || (document.contains = function (node) {\n\t return document.body.contains(node);\n\t });\n\t\n\t if (!isInitialized && $mdGesture.isHijackingClicks ) {\n\t /*\n\t * If hijack clicks is true, we preventDefault any click that wasn't\n\t * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n\t * click event will be sent ~400ms after a touchend event happens.\n\t * The only way to know if this click is real is to prevent any normal\n\t * click events, and add a flag to events sent by material so we know not to prevent those.\n\t *\n\t * Two exceptions to click events that should be prevented are:\n\t * - click events sent by the keyboard (eg form submit)\n\t * - events that originate from an Ionic app\n\t */\n\t document.addEventListener('click' , clickHijacker , true);\n\t document.addEventListener('mouseup' , mouseInputHijacker, true);\n\t document.addEventListener('mousedown', mouseInputHijacker, true);\n\t document.addEventListener('focus' , mouseInputHijacker, true);\n\t\n\t isInitialized = true;\n\t }\n\t\n\t function mouseInputHijacker(ev) {\n\t var isKeyClick = !ev.clientX && !ev.clientY;\n\t if (!isKeyClick && !ev.$material && !ev.isIonicTap\n\t && !isInputEventFromLabelClick(ev)) {\n\t ev.preventDefault();\n\t ev.stopPropagation();\n\t }\n\t }\n\t\n\t function clickHijacker(ev) {\n\t var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n\t if (!isKeyClick && !ev.$material && !ev.isIonicTap\n\t && !isInputEventFromLabelClick(ev)) {\n\t ev.preventDefault();\n\t ev.stopPropagation();\n\t lastLabelClickPos = null;\n\t } else {\n\t lastLabelClickPos = null;\n\t if (ev.target.tagName.toLowerCase() == 'label') {\n\t lastLabelClickPos = {x: ev.x, y: ev.y};\n\t }\n\t }\n\t }\n\t\n\t\n\t // Listen to all events to cover all platforms.\n\t var START_EVENTS = 'mousedown touchstart pointerdown';\n\t var MOVE_EVENTS = 'mousemove touchmove pointermove';\n\t var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\t\n\t angular.element(document)\n\t .on(START_EVENTS, gestureStart)\n\t .on(MOVE_EVENTS, gestureMove)\n\t .on(END_EVENTS, gestureEnd)\n\t // For testing\n\t .on('$$mdGestureReset', function gestureClearCache () {\n\t lastPointer = pointer = null;\n\t });\n\t\n\t /*\n\t * When a DOM event happens, run all registered gesture handlers' lifecycle\n\t * methods which match the DOM event.\n\t * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n\t * run `handler.cancel()` and `handler.start()` on all registered handlers.\n\t */\n\t function runHandlers(handlerEvent, event) {\n\t var handler;\n\t for (var name in HANDLERS) {\n\t handler = HANDLERS[name];\n\t if( handler instanceof $$MdGestureHandler ) {\n\t\n\t if (handlerEvent === 'start') {\n\t // Run cancel to reset any handlers' state\n\t handler.cancel();\n\t }\n\t handler[handlerEvent](event, pointer);\n\t\n\t }\n\t }\n\t }\n\t\n\t /*\n\t * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n\t * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n\t * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n\t * won't effect it.\n\t */\n\t function gestureStart(ev) {\n\t // If we're already touched down, abort\n\t if (pointer) return;\n\t\n\t var now = +Date.now();\n\t\n\t // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n\t // If <400ms have passed, don't allow an event of a different type than the previous event\n\t if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n\t return;\n\t }\n\t\n\t pointer = makeStartPointer(ev);\n\t\n\t runHandlers('start', ev);\n\t }\n\t /*\n\t * If a move event happens of the right type, update the pointer and run all the move handlers.\n\t * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n\t */\n\t function gestureMove(ev) {\n\t if (!pointer || !typesMatch(ev, pointer)) return;\n\t\n\t updatePointerState(ev, pointer);\n\t runHandlers('move', ev);\n\t }\n\t /*\n\t * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n\t */\n\t function gestureEnd(ev) {\n\t if (!pointer || !typesMatch(ev, pointer)) return;\n\t\n\t updatePointerState(ev, pointer);\n\t pointer.endTime = +Date.now();\n\t\n\t runHandlers('end', ev);\n\t\n\t lastPointer = pointer;\n\t pointer = null;\n\t }\n\t\n\t}", "title": "" } ]
[ { "docid": "0bd4080015a2b09f372fd564b075ee1b", "score": "0.708695", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) { // 2130\n // 2131\n // Polyfill document.contains for IE11. // 2132\n // TODO: move to util // 2133\n document.contains || (document.contains = function (node) { // 2134\n return document.body.contains(node); // 2135\n }); // 2136\n // 2137\n if (!isInitialized && $mdGesture.isHijackingClicks ) { // 2138\n /* // 2139\n * If hijack clicks is true, we preventDefault any click that wasn't // 2140\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost', // 2141\n * click event will be sent ~400ms after a touchend event happens. // 2142\n * The only way to know if this click is real is to prevent any normal // 2143\n * click events, and add a flag to events sent by material so we know not to prevent those. // 2144\n * // 2145\n * Two exceptions to click events that should be prevented are: // 2146\n * - click events sent by the keyboard (eg form submit) // 2147\n * - events that originate from an Ionic app // 2148\n */ // 2149\n document.addEventListener('click' , clickHijacker , true); // 2150\n document.addEventListener('mouseup' , mouseInputHijacker, true); // 2151\n document.addEventListener('mousedown', mouseInputHijacker, true); // 2152\n document.addEventListener('focus' , mouseInputHijacker, true); // 2153\n // 2154\n isInitialized = true; // 2155\n } // 2156\n // 2157\n function mouseInputHijacker(ev) { // 2158\n var isKeyClick = !ev.clientX && !ev.clientY; // 2159\n if (!isKeyClick && !ev.$material && !ev.isIonicTap // 2160\n && !isInputEventFromLabelClick(ev)) { // 2161\n ev.preventDefault(); // 2162\n ev.stopPropagation(); // 2163\n } // 2164\n } // 2165\n // 2166\n function clickHijacker(ev) { // 2167\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0; // 2168\n if (!isKeyClick && !ev.$material && !ev.isIonicTap // 2169\n && !isInputEventFromLabelClick(ev)) { // 2170\n ev.preventDefault(); // 2171\n ev.stopPropagation(); // 2172\n lastLabelClickPos = null; // 2173\n } else { // 2174\n lastLabelClickPos = null; // 2175\n if (ev.target.tagName.toLowerCase() == 'label') { // 2176\n lastLabelClickPos = {x: ev.x, y: ev.y}; // 2177\n } // 2178\n } // 2179\n } // 2180\n // 2181\n // 2182\n // Listen to all events to cover all platforms. // 2183\n var START_EVENTS = 'mousedown touchstart pointerdown'; // 2184\n var MOVE_EVENTS = 'mousemove touchmove pointermove'; // 2185\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel'; // 2186\n // 2187\n angular.element(document) // 2188\n .on(START_EVENTS, gestureStart) // 2189\n .on(MOVE_EVENTS, gestureMove) // 2190\n .on(END_EVENTS, gestureEnd) // 2191\n // For testing // 2192\n .on('$$mdGestureReset', function gestureClearCache () { // 2193\n lastPointer = pointer = null; // 2194\n }); // 2195\n // 2196\n /* // 2197\n * When a DOM event happens, run all registered gesture handlers' lifecycle // 2198\n * methods which match the DOM event. // 2199\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and // 2200\n * run `handler.cancel()` and `handler.start()` on all registered handlers. // 2201\n */ // 2202\n function runHandlers(handlerEvent, event) { // 2203\n var handler; // 2204\n for (var name in HANDLERS) { // 2205\n handler = HANDLERS[name]; // 2206\n if( handler instanceof $$MdGestureHandler ) { // 2207\n // 2208\n if (handlerEvent === 'start') { // 2209\n // Run cancel to reset any handlers' state // 2210\n handler.cancel(); // 2211\n } // 2212\n handler[handlerEvent](event, pointer); // 2213\n // 2214\n } // 2215\n } // 2216\n } // 2217\n // 2218\n /* // 2219\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android) // 2220\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type // 2221\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events // 2222\n * won't effect it. // 2223\n */ // 2224\n function gestureStart(ev) { // 2225\n // If we're already touched down, abort // 2226\n if (pointer) return; // 2227\n // 2228\n var now = +Date.now(); // 2229\n // 2230\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later. // 2231\n // If <400ms have passed, don't allow an event of a different type than the previous event // 2232\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) { // 2233\n return; // 2234\n } // 2235\n // 2236\n pointer = makeStartPointer(ev); // 2237\n // 2238\n runHandlers('start', ev); // 2239\n } // 2240\n /* // 2241\n * If a move event happens of the right type, update the pointer and run all the move handlers. // 2242\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing. // 2243\n */ // 2244\n function gestureMove(ev) { // 2245\n if (!pointer || !typesMatch(ev, pointer)) return; // 2246\n // 2247\n updatePointerState(ev, pointer); // 2248\n runHandlers('move', ev); // 2249\n } // 2250\n /* // 2251\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */ // 2253\n function gestureEnd(ev) { // 2254\n if (!pointer || !typesMatch(ev, pointer)) return; // 2255\n // 2256\n updatePointerState(ev, pointer); // 2257\n pointer.endTime = +Date.now(); // 2258\n // 2259\n runHandlers('end', ev); // 2260\n // 2261\n lastPointer = pointer; // 2262\n pointer = null; // 2263\n } // 2264\n // 2265\n} // 2266", "title": "" }, { "docid": "f98ee0f7f6973e3c71b78b6086c68c6b", "score": "0.6967725", "text": "function attachToDocument($mdGesture,$$MdGestureHandler){if(disableAllGestures){return;}// Polyfill document.contains for IE11.\n// TODO: move to util\ndocument.contains||(document.contains=function(node){return document.body.contains(node);});if(!isInitialized&&$mdGesture.isHijackingClicks){/*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by AngularJS Material. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n *\n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */document.addEventListener('click',clickHijacker,true);document.addEventListener('mouseup',mouseInputHijacker,true);document.addEventListener('mousedown',mouseInputHijacker,true);document.addEventListener('focus',mouseInputHijacker,true);isInitialized=true;}function mouseInputHijacker(ev){var isKeyClick=!ev.clientX&&!ev.clientY;if(!isKeyClick&&!ev.$material&&!ev.isIonicTap&&!isInputEventFromLabelClick(ev)&&(ev.type!=='mousedown'||!canFocus(ev.target)&&!canFocus(document.activeElement))){ev.preventDefault();ev.stopPropagation();}}function clickHijacker(ev){var isKeyClick=ev.clientX===0&&ev.clientY===0;var isSubmitEvent=ev.target&&ev.target.type==='submit';if(!isKeyClick&&!ev.$material&&!ev.isIonicTap&&!isInputEventFromLabelClick(ev)&&!isSubmitEvent){ev.preventDefault();ev.stopPropagation();lastLabelClickPos=null;}else{lastLabelClickPos=null;if(ev.target.tagName.toLowerCase()=='label'){lastLabelClickPos={x:ev.x,y:ev.y};}}}// Listen to all events to cover all platforms.\nvar START_EVENTS='mousedown touchstart pointerdown';var MOVE_EVENTS='mousemove touchmove pointermove';var END_EVENTS='mouseup mouseleave touchend touchcancel pointerup pointercancel';angular.element(document).on(START_EVENTS,gestureStart).on(MOVE_EVENTS,gestureMove).on(END_EVENTS,gestureEnd)// For testing\n.on('$$mdGestureReset',function gestureClearCache(){lastPointer=pointer=null;});/*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */function runHandlers(handlerEvent,event){var handler;for(var name in HANDLERS){handler=HANDLERS[name];if(handler instanceof $$MdGestureHandler){if(handlerEvent==='start'){// Run cancel to reset any handlers' state\nhandler.cancel();}handler[handlerEvent](event,pointer);}}}/*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */function gestureStart(ev){// If we're already touched down, abort\nif(pointer)return;var now=+Date.now();// iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n// If <400ms have passed, don't allow an event of a different type than the previous event\nif(lastPointer&&!typesMatch(ev,lastPointer)&&now-lastPointer.endTime<1500){return;}pointer=makeStartPointer(ev);runHandlers('start',ev);}/*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */function gestureMove(ev){if(!pointer||!typesMatch(ev,pointer))return;updatePointerState(ev,pointer);runHandlers('move',ev);}/*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */function gestureEnd(ev){if(!pointer||!typesMatch(ev,pointer))return;updatePointerState(ev,pointer);pointer.endTime=+Date.now();if(ev.type!=='pointercancel'){runHandlers('end',ev);}lastPointer=pointer;pointer=null;}}// ********************", "title": "" }, { "docid": "45753cd26ad4cef3e7d23656d5c9c4b7", "score": "0.6866524", "text": "function attachToDocument($mdGesture, $$MdGestureHandler) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by AngularJS Material. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n *\n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click', clickHijacker, true);\n document.addEventListener('mouseup', mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus', mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n\n if (!isKeyClick && !ev.$material && !ev.isIonicTap && !isInputEventFromLabelClick(ev) && (ev.type !== 'mousedown' || !canFocus(ev.target) && !canFocus(document.activeElement))) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n var isSubmitEvent = ev.target && ev.target.type === 'submit';\n if (!isKeyClick && !ev.$material && !ev.isIonicTap && !isInputEventFromLabelClick(ev) && !isSubmitEvent) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = { x: ev.x, y: ev.y };\n }\n }\n }\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document).on(START_EVENTS, gestureStart).on(MOVE_EVENTS, gestureMove).on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache() {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if (handler instanceof $$MdGestureHandler) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && now - lastPointer.endTime < 1500) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n if (ev.type !== 'pointercancel') {\n runHandlers('end', ev);\n }\n\n lastPointer = pointer;\n pointer = null;\n }\n }", "title": "" }, { "docid": "34b9da4b0af616a1064cdf01a1cbbff9", "score": "0.678979", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n * \n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "8cdb23fd9ae50c8cc1b75480dc99ba23", "score": "0.67629766", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n *\n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "8cdb23fd9ae50c8cc1b75480dc99ba23", "score": "0.67629766", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n *\n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "fc50b4084e2fe0c8199c10204ca9ba79", "score": "0.6755736", "text": "function attachToDocument($mdGesture, $$MdGestureHandler) {\n if (disableAllGestures) {\n return;\n }\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by AngularJS Material. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n *\n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n\n if (\n !isKeyClick &&\n !ev.$material &&\n !ev.isIonicTap &&\n !isInputEventFromLabelClick(ev) &&\n (ev.type !== 'mousedown' || (!canFocus(ev.target) && !canFocus(document.activeElement)))\n ) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n var isSubmitEvent = ev.target && ev.target.type === 'submit';\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)\n && !isSubmitEvent) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if (handler instanceof $$MdGestureHandler) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n if (ev.type !== 'pointercancel') {\n runHandlers('end', ev);\n }\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "a2c6d32bad1b15b14a34e34da398a910", "score": "0.67425126", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by AngularJS Material. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n *\n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n\n if (\n !isKeyClick &&\n !ev.$material &&\n !ev.isIonicTap &&\n !isInputEventFromLabelClick(ev) &&\n (ev.type !== 'mousedown' || (!canFocus(ev.target) && !canFocus(document.activeElement)))\n ) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n var isSubmitEvent = ev.target && ev.target.type === 'submit';\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)\n && !isSubmitEvent) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n if (ev.type !== 'pointercancel') {\n runHandlers('end', ev);\n }\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}", "title": "" }, { "docid": "e51349b40346c66f3bf5dba36acc4136", "score": "0.6739951", "text": "function bindEventListeners() {\n document.addEventListener('click', onDocumentClick, true);\n // Old browsers will use capture phase but the phase does not matter anyway\n document.addEventListener('touchstart', onDocumentTouch, { passive: true });\n window.addEventListener('blur', onWindowBlur);\n window.addEventListener('resize', onWindowResize);\n\n if (!supportsTouch && (navigator.maxTouchPoints || navigator.msMaxTouchPoints)) {\n document.addEventListener('pointerdown', onDocumentTouch);\n }\n}", "title": "" }, { "docid": "0f2b41ba50ef903b5593655502c621c0", "score": "0.6684497", "text": "_addEvents() {\n document.addEventListener('click', this.handleDocumentClick, true);\n }", "title": "" }, { "docid": "7da67ab5da946abbb23de17e74a69a14", "score": "0.6545292", "text": "function addClickListeners() {\n document.addEventListener(\"touchstart\", handleEvent);\n document.addEventListener(\"mousedown\", handleEvent);\n }", "title": "" }, { "docid": "c3b2a35b682281b072a391c2da896848", "score": "0.6468772", "text": "function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n * \n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click', function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }, true);\n \n isInitialized = true;\n }\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n }", "title": "" }, { "docid": "29512e8f34387db71b4d83f8def7f8de", "score": "0.6377352", "text": "attach() {\n document.addEventListener('mousedown', this[onMouseDown], true);\n }", "title": "" }, { "docid": "456d742f8cb4dbfa5fe779abca119912", "score": "0.6316654", "text": "_setupElementEvents() {\n const addListener = (event, callback) => {\n this.element.addEventListener(event, callback);\n this._elementEventListeners.push({ event, callback });\n };\n\n // Hide the sidebar in response to a document click or tap, so it doesn't obscure\n // the document content.\n const maybeHideSidebar = event => {\n if (!this.closeSidebarOnDocumentClick || this.isEventInAnnotator(event)) {\n // Don't hide the sidebar if event occurred inside Hypothesis UI, or\n // the user is making a selection, or the behavior was disabled because\n // the sidebar doesn't overlap the content.\n return;\n }\n this.crossframe?.call('hideSidebar');\n };\n\n addListener('click', event => {\n const annotations = annotationsAt(event.target);\n if (annotations.length && this.visibleHighlights) {\n const toggle = event.metaKey || event.ctrlKey;\n this.selectAnnotations(annotations, toggle);\n } else {\n maybeHideSidebar(event);\n }\n });\n\n // Allow taps on the document to hide the sidebar as well as clicks, because\n // on touch-input devices, not all elements will generate a \"click\" event.\n addListener('touchstart', event => {\n if (!annotationsAt(event.target).length) {\n maybeHideSidebar(event);\n }\n });\n\n addListener('mouseover', event => {\n const annotations = annotationsAt(event.target);\n if (annotations.length && this.visibleHighlights) {\n this.focusAnnotations(annotations);\n }\n });\n\n addListener('mouseout', () => {\n if (this.visibleHighlights) {\n this.focusAnnotations([]);\n }\n });\n }", "title": "" }, { "docid": "1cad6339c78415504741964147dc3e1a", "score": "0.63081956", "text": "function addEventListeners() {\n\n\t\teventsAreBound = true;\n\n\t\twindow.addEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.addEventListener( 'resize', onWindowResize, false );\n\n\t\tif( config.touch ) {\n\t\t\tdom.wrapper.addEventListener( 'touchstart', onTouchStart, false );\n\t\t\tdom.wrapper.addEventListener( 'touchmove', onTouchMove, false );\n\t\t\tdom.wrapper.addEventListener( 'touchend', onTouchEnd, false );\n\n\t\t\t// Support pointer-style touch interaction as well\n\t\t\tif( window.navigator.msPointerEnabled ) {\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\t\tdom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t\t}\n\t\t}\n\n\t\tif( config.keyboard ) {\n\t\t\tdocument.addEventListener( 'keydown', onDocumentKeyDown, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.addEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\tif ( config.controls && dom.controls ) {\n\t\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\t\tdom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\t\tdom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\t\tdom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\t\tdom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\t\tdom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\t\tdom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t\t} );\n\t\t}\n\n\t}", "title": "" }, { "docid": "0a7a7fafef47a081aa1123196a530b98", "score": "0.62890685", "text": "__addOpenListeners () {\n document.addEventListener('click', this.__onDocumentClick);\n document.addEventListener('scroll', this.__onDocumentScroll, { passive: true });\n window.addEventListener('resize', this.__onWindowResize, { passive: true });\n }", "title": "" }, { "docid": "2e79c157ba550fd72a140cc5022f4651", "score": "0.6261241", "text": "init(){\n\n document.addEventListener(\"touchstart\", this.onTouchStart.bind(this), {passive:false});\n document.addEventListener(\"touchend\", this.onTouchEnd.bind(this), {passive:false});\n document.addEventListener(\"touchmove\", this.onTouchMove.bind(this), {passive:false});\n }", "title": "" }, { "docid": "f468ee253a8cff11797db409cfefaefb", "score": "0.6248241", "text": "function attachDocumentEvent() {\n $document.on('click', hideSubtemplate);\n }", "title": "" }, { "docid": "a0fb1165bb06009130e7633c3d138042", "score": "0.62449396", "text": "addClickEventListener() {\n if (this.hasClickEventListener) {\n return;\n }\n const onClickHandler = (/** @type {MouseEvent} */event) => {\n this.hasClickEventListener = false;\n globalThis.document.body.removeEventListener(\"click\", onClickHandler);\n this.hideAllAutomations();\n };\n this.hasClickEventListener = true;\n globalThis.document.body.addEventListener(\"click\", onClickHandler);\n }", "title": "" }, { "docid": "28dffed0ea3e3dcaec5b42b86b85875e", "score": "0.62306523", "text": "_initiate() {\n\n // Prefer the pointer event specification. See https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events.\n if ( Display.canUsePointerEvents ) {\n\n // Add event listeners for both presses and releases via the pointer event specification, only if listeners\n // were provided.\n this._pressListener && this._targetNode.element.addEventListener( 'pointerdown', this._pressHandler );\n this._releaseListener && this._targetNode.element.addEventListener( 'pointerup', this._releaseHandler );\n }\n else if ( Display.canUseMSPointerEvents ) {\n\n // Add event listeners for both presses and releases via the MS pointer event specification, only if listeners\n // were provided.\n this._pressListener && this._targetNode.element.addEventListener( 'MSPointerDown', this._pressHandler );\n this._releaseListener && this._targetNode.element.addEventListener( 'MSPointerUp', this._releaseHandler );\n }\n else {\n\n // Otherwise, if pointer events are not supported, resort to the touchstart (mobile) and mousedown (mouse-click)\n // specification. Both listeners are added to support devices that are both touchscreen and on mouse and\n // keyboard.\n this._pressListener && this._targetNode.element.addEventListener( 'touchstart', this._pressHandler );\n this._pressListener && this._targetNode.element.addEventListener( 'mousedown', this._pressHandler );\n\n this._releaseListener && this._targetNode.element.addEventListener( 'touchend', this._releaseHandler );\n this._releaseListener && this._targetNode.element.addEventListener( 'mouseup', this._releaseHandler );\n }\n }", "title": "" }, { "docid": "090fc3d9cdfcbab42302f12fcc72d64c", "score": "0.61583406", "text": "function updateUserInteractionHandlers() {\r\n\t\t// first release any existing handlers\r\n\t\tdisarmUserInteractionHandlers();\r\n\r\n\t\t// we must determine which documents we need to arm\r\n\t\tvar documents = [];\r\n\r\n\t\t// are we disambiguating click <xyz> options?\r\n\t\tvar disambiguatingClickables = !!document.querySelector('.nuan_disambig_marker');\r\n\r\n\t\tif (disambiguatingClickables || isFocusRingActive()) {\r\n\t\t\t// add the main document\r\n\t\t\tdocuments.push(document);\r\n\t\t}\r\n\r\n\t\tif (editorElement) {\r\n\t\t\t// Add the document if it isn't already in the list.\r\n\t\t\tif (documents.length == 0) {\r\n\t\t\t\tdocuments.push(document);\r\n\t\t\t}\r\n\r\n\t\t\tif (editorElement.nodeName == \"IFRAME\" &&\r\n\t\t\t\teditorElement.contentDocument)\r\n\t\t\t{\r\n\t\t\t\t// editor is in an iframe, we need to know interactions\r\n\t\t\t\t// inside this iframe\r\n\t\t\t\tdocuments.push(editorElement.contentDocument);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// now arm the documents with event handlers:\r\n\t\tif (documents.length) {\r\n\t\t\tarmUserInteractionHandlers(documents);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a7ad35d5211c0d4af94baa8563cec8dc", "score": "0.6151031", "text": "startListening_() {\n this.element_.addEventListener(\n 'touchstart',\n this.onTouchstart_.bind(this),\n true\n );\n this.element_.addEventListener(\n 'touchend',\n this.onTouchend_.bind(this),\n true\n );\n this.element_.addEventListener(\n 'click',\n this.maybePerformNavigation_.bind(this),\n true\n );\n this.ampdoc_.onVisibilityChanged(() => {\n this.ampdoc_.isVisible() ? this.processTouchend_() : null;\n });\n }", "title": "" }, { "docid": "92eab84e093ecfb5fa3addaad7dccc3b", "score": "0.613069", "text": "function addDocumentClickListener() {\n document.addEventListener('click', onDocumentClick, true);\n }", "title": "" }, { "docid": "0f2181da9f42f904e8d24a70c3a5cc32", "score": "0.6115689", "text": "function addDocumentClickListener() {\n document.addEventListener('click', onDocumentClick, true);\n }", "title": "" }, { "docid": "d1a7b7db93fa576098b8e024108d14c6", "score": "0.609058", "text": "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouchStart, _extends({}, PASSIVE, {\n capture: true\n }));\n window.addEventListener('blur', onWindowBlur);\n }", "title": "" }, { "docid": "c375a7b45ed2a48fb3cebab332666597", "score": "0.60787874", "text": "on() {\n this.boundFns = {\n click: this.click.bind(this),\n mouseDown: this.mouseDown.bind(this),\n mouseMove: this.mouseMove.bind(this),\n mouseUp: this.mouseUp.bind(this),\n };\n\n this.DOM.context.addEventListener('click', this.boundFns.click);\n this.DOM.context.addEventListener('mousedown', this.boundFns.mouseDown);\n\n document.addEventListener('mousemove', this.boundFns.mouseMove);\n document.addEventListener('mouseup', this.boundFns.mouseUp);\n }", "title": "" }, { "docid": "263f99af666d68dd1b6dc281c6920648", "score": "0.60714966", "text": "UNSAFE_componentWillMount() {\n document.addEventListener(\"mousedown\", this.handleDocClick, false);\n }", "title": "" }, { "docid": "cb35ff846aa553e9767f57893e1e7de3", "score": "0.6067203", "text": "function setupEvents() {\n var element = canvas;\n\n // Needed this to override context menu behavior\n element.bind('contextmenu', function(evt) { evt.preventDefault(); });\n\n // Wheel should zoom across browsers\n element.bind('DOMMouseScroll mousewheel', function (evt) {\n var x = (-evt.originalEvent.wheelDeltaY || evt.originalEvent.detail);\n\n lastLocation = getRelativeLocation(canvas, evt);\n handleZoom((x > 0 ? wheelZoom : x < 0 ? -wheelZoom : 0));\n evt.preventDefault();\n\n // Redraw the image in the canvas\n redrawImage();\n });\n\n // Handle mobile\n attachTouchListener(element);\n element.bind('mouse', function(e){\n // action: mouseAction,\n // current_button: current_button,\n // charCode: '',\n // altKey: false,\n // ctrlKey: false,\n // shiftKey: false,\n // metaKey: false,\n // delegateTarget: target,\n // pageX: posX,\n // pageY: posY\n var action = e.action,\n altKey = e.altKey,\n shiftKey = e.shiftKey,\n ctrlKey = e.ctrlKey,\n x = e.pageX,\n y = e.pageY,\n current_button = e.current_button;\n\n if(action === 'down') {\n if (e.altKey) {\n current_button = 2;\n e.altKey = false;\n } else if (e.shiftKey) {\n current_button = 3;\n e.shiftKey = false;\n }\n // Detect interaction mode\n switch(current_button) {\n case 2: // middle mouse down = pan\n mouseMode = modePan;\n break;\n case 3: // right mouse down = zoom\n mouseMode = modeZoom;\n break;\n default:\n mouseMode = modeRotation;\n break;\n }\n\n // Store mouse location\n lastLocation = [x, y];\n\n e.preventDefault();\n } else if(action === 'up') {\n mouseMode = modeNone;\n e.preventDefault();\n } else if(action === 'move') {\n if(mouseMode != modeNone) {\n var loc = [x,y];\n\n // Can NOT use switch as (modeRotation == modePan) is\n // possible when Pan should take over rotation as\n // rotation is not possible\n if(mouseMode === modePan) {\n handlePan(loc);\n } else if (mouseMode === modeZoom) {\n var deltaY = loc[1] - lastLocation[1];\n handleZoom(deltaY * dzScale);\n\n // Update mouse location\n lastLocation = loc;\n } else {\n handleRotation(loc);\n }\n\n // Redraw the image in the canvas\n redrawImage();\n }\n }\n });\n\n // Zoom and pan events with mouse buttons and drag\n element.bind('mousedown', function(evt) {\n var current_button = evt.which;\n\n // alt+click simulates center button, shift+click simulates right\n if (evt.altKey) {\n current_button = 2;\n evt.altKey = false;\n } else if (evt.shiftKey) {\n current_button = 3;\n evt.shiftKey = false;\n }\n\n // Detect interaction mode\n switch(current_button) {\n case 2: // middle mouse down = pan\n mouseMode = modePan;\n break;\n case 3: // right mouse down = zoom\n mouseMode = modeZoom;\n break;\n default:\n mouseMode = modeRotation;\n break;\n }\n\n // Store mouse location\n lastLocation = getRelativeLocation(canvas, evt);\n\n evt.preventDefault();\n });\n\n // Send mouse movement event to the forwarding function\n element.bind('mousemove', function(e) {\n if(mouseMode != modeNone) {\n var loc = getRelativeLocation(canvas, e);\n\n // Can NOT use switch as (modeRotation == modePan) is\n // possible when Pan should take over rotation as\n // rotation is not possible\n if(mouseMode === modePan) {\n handlePan(loc);\n } else if (mouseMode === modeZoom) {\n var deltaY = loc[1] - lastLocation[1];\n handleZoom(deltaY * dzScale);\n\n // Update mouse location\n lastLocation = loc;\n } else {\n handleRotation(loc);\n }\n\n // Redraw the image in the canvas\n redrawImage();\n }\n });\n\n // Stop any zoom or pan events\n element.bind('mouseup', function(evt) {\n mouseMode = modeNone;\n evt.preventDefault();\n });\n\n // Update rotation handler if possible\n modeRotation = container.data('info').arguments.hasOwnProperty('phi') ? modeRotation : modePan;\n if(modeRotation != modePan) {\n thetaValues = container.data('info').arguments.theta.values;\n phiValues = container.data('info').arguments.phi.values;\n stepPhi = phiValues[1] - phiValues[0];\n stepTheta = thetaValues[1] - thetaValues[0];\n currentArgs = container.data('active-args');\n }\n }", "title": "" }, { "docid": "78d5c892a2ec83f956b862afcafd8042", "score": "0.6034039", "text": "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE);\n window.addEventListener('blur', onWindowBlur);\n }", "title": "" }, { "docid": "d5ec008b921360a4b093a01f2a715a63", "score": "0.6031808", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11) {\n on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) {\n return;\n }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) {\n return;\n }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n } else {\n on(d.scroller, \"dblclick\", function (e) {\n return signalDOMEvent(cm, e) || e_preventDefault(e);\n });\n }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) {\n on(d.scroller, \"contextmenu\", function (e) {\n return onContextMenu(cm, e);\n });\n }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished,\n prevTouch = { end: 0 };\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () {\n return d.activeTouch = null;\n }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date();\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) {\n return false;\n }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) {\n return true;\n }\n var dx = other.left - touch.left,\n dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date();\n d.activeTouch = { start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null };\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) {\n d.activeTouch.moved = true;\n }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null && !touch.moved && new Date() - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"),\n range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n {\n range = new Range(pos, pos);\n } else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n {\n range = cm.findWordAt(pos);\n } else // Triple tap\n {\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) {\n return onScrollWheel(cm, e);\n });\n on(d.scroller, \"DOMMouseScroll\", function (e) {\n return onScrollWheel(cm, e);\n });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () {\n return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0;\n });\n\n d.dragFunctions = {\n enter: function (e) {\n if (!signalDOMEvent(cm, e)) {\n e_stop(e);\n }\n },\n over: function (e) {\n if (!signalDOMEvent(cm, e)) {\n onDragOver(cm, e);e_stop(e);\n }\n },\n start: function (e) {\n return onDragStart(cm, e);\n },\n drop: operation(cm, onDrop),\n leave: function (e) {\n if (!signalDOMEvent(cm, e)) {\n clearDragCursor(cm);\n }\n }\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) {\n return onKeyUp.call(cm, e);\n });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) {\n return onFocus(cm, e);\n });\n on(inp, \"blur\", function (e) {\n return onBlur(cm, e);\n });\n }", "title": "" }, { "docid": "cd7a96cbb79d4e65521f4a83f9353f68", "score": "0.60310566", "text": "componentDidMount() {\n document.addEventListener('click', this.handleDocumentClick)\n }", "title": "" }, { "docid": "aa4dec5429e938b05f7f04e7f396e6d4", "score": "0.6025206", "text": "function bindEvents()\n {\n if (options.selection.mode != null)\n {\n overlay.observe('mousedown', mouseDownHandler);\n }\n overlay.observe('mousemove', mouseMoveHandler);\n overlay.observe('click', clickHandler);\n overlay.observe('mouseout', mouseOutHandler);\n\n }", "title": "" }, { "docid": "ef06b8bb958a62a1b5d80275acd2d0be", "score": "0.60227287", "text": "_enableHook() {\n !this._ready && this._mountContent()\n if (this._enabled) {\n !this._wrapper.parentNode &&\n this._viewer.container.appendChild(this._wrapper)\n this._bindEvent()\n } else {\n this._unbindEvent()\n this._wrapper.parentNode &&\n this._viewer.container.removeChild(this._wrapper)\n }\n }", "title": "" }, { "docid": "ce2d42703bceed7ed81dbc485daade0b", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "ce2d42703bceed7ed81dbc485daade0b", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "ce2d42703bceed7ed81dbc485daade0b", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "ce2d42703bceed7ed81dbc485daade0b", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "ce2d42703bceed7ed81dbc485daade0b", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "12ff9abe85d409c1cb3381c450ec164c", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "ce2d42703bceed7ed81dbc485daade0b", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "ce2d42703bceed7ed81dbc485daade0b", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "12ff9abe85d409c1cb3381c450ec164c", "score": "0.6022641", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n}", "title": "" }, { "docid": "660e8442ab0d94175a33cfeb670c8f8d", "score": "0.6021357", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "660e8442ab0d94175a33cfeb670c8f8d", "score": "0.6021357", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "660e8442ab0d94175a33cfeb670c8f8d", "score": "0.6021357", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "660e8442ab0d94175a33cfeb670c8f8d", "score": "0.6021357", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "660e8442ab0d94175a33cfeb670c8f8d", "score": "0.6021357", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "660e8442ab0d94175a33cfeb670c8f8d", "score": "0.6021357", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "660e8442ab0d94175a33cfeb670c8f8d", "score": "0.6021357", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "592cd71c32fb6e7e7e8db1052d5e0191", "score": "0.6018468", "text": "function bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE);\n window.addEventListener('blur', onWindowBlur);\n}", "title": "" }, { "docid": "037d6c9a40ecf80185b07b0bbc85d357", "score": "0.6013918", "text": "function registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}", "title": "" }, { "docid": "ff4f1e8ac75ed71e27a4652bfe6a12ab", "score": "0.6003415", "text": "function initTouch()\n{\n document.addEventListener(\"touchstart\", touchHandler, true);\n document.addEventListener(\"touchmove\", touchHandler, true);\n document.addEventListener(\"touchend\", touchHandler, true);\n document.addEventListener(\"touchcancel\", touchHandler, true); \n}", "title": "" }, { "docid": "97496ce67f8eced54fa357a0e822bf4e", "score": "0.5994301", "text": "function registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}", "title": "" }, { "docid": "6e3972e3039ca16d0ac33ef177484217", "score": "0.5994056", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop)\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "6e3972e3039ca16d0ac33ef177484217", "score": "0.5994056", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop)\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "d7310b8f53d688d60f928a6cb07cf23d", "score": "0.5994056", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function() {clearDragCursor(cm);}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "6e3972e3039ca16d0ac33ef177484217", "score": "0.5994056", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop)\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "6e3972e3039ca16d0ac33ef177484217", "score": "0.5994056", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop)\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "d7310b8f53d688d60f928a6cb07cf23d", "score": "0.5994056", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function() {clearDragCursor(cm);}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "6e3972e3039ca16d0ac33ef177484217", "score": "0.5994056", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop)\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "9d9af8036c0c00da5be8b1690090c1e7", "score": "0.5991858", "text": "function registerEventHandlers(cm){var d=cm.display;on(d.scroller,\"mousedown\",operation(cm,onMouseDown));// Older IE's will not fire a second mousedown for a double click\n\tif(ie&&ie_version<11){on(d.scroller,\"dblclick\",operation(cm,function(e){if(signalDOMEvent(cm,e)){return;}var pos=posFromMouse(cm,e);if(!pos||clickInGutter(cm,e)||eventInWidget(cm.display,e)){return;}e_preventDefault(e);var word=cm.findWordAt(pos);extendSelection(cm.doc,word.anchor,word.head);}));}else{on(d.scroller,\"dblclick\",function(e){return signalDOMEvent(cm,e)||e_preventDefault(e);});}// Some browsers fire contextmenu *after* opening the menu, at\n\t// which point we can't mess with it anymore. Context menu is\n\t// handled in onMouseDown for these browsers.\n\tif(!captureRightClick){on(d.scroller,\"contextmenu\",function(e){return onContextMenu(cm,e);});}// Used to suppress mouse event handling when a touch happens\n\tvar touchFinished,prevTouch={end:0};function finishTouch(){if(d.activeTouch){touchFinished=setTimeout(function(){return d.activeTouch=null;},1000);prevTouch=d.activeTouch;prevTouch.end=+new Date();}}function isMouseLikeTouchEvent(e){if(e.touches.length!=1){return false;}var touch=e.touches[0];return touch.radiusX<=1&&touch.radiusY<=1;}function farAway(touch,other){if(other.left==null){return true;}var dx=other.left-touch.left,dy=other.top-touch.top;return dx*dx+dy*dy>20*20;}on(d.scroller,\"touchstart\",function(e){if(!signalDOMEvent(cm,e)&&!isMouseLikeTouchEvent(e)){clearTimeout(touchFinished);var now=+new Date();d.activeTouch={start:now,moved:false,prev:now-prevTouch.end<=300?prevTouch:null};if(e.touches.length==1){d.activeTouch.left=e.touches[0].pageX;d.activeTouch.top=e.touches[0].pageY;}}});on(d.scroller,\"touchmove\",function(){if(d.activeTouch){d.activeTouch.moved=true;}});on(d.scroller,\"touchend\",function(e){var touch=d.activeTouch;if(touch&&!eventInWidget(d,e)&&touch.left!=null&&!touch.moved&&new Date()-touch.start<300){var pos=cm.coordsChar(d.activeTouch,\"page\"),range;if(!touch.prev||farAway(touch,touch.prev))// Single tap\n\t{range=new Range(pos,pos);}else if(!touch.prev.prev||farAway(touch,touch.prev.prev))// Double tap\n\t{range=cm.findWordAt(pos);}else// Triple tap\n\t{range=new Range(Pos(pos.line,0),_clipPos(cm.doc,Pos(pos.line+1,0)));}cm.setSelection(range.anchor,range.head);cm.focus();e_preventDefault(e);}finishTouch();});on(d.scroller,\"touchcancel\",finishTouch);// Sync scrolling between fake scrollbars and real scrollable\n\t// area, ensure viewport is updated when scrolling.\n\ton(d.scroller,\"scroll\",function(){if(d.scroller.clientHeight){setScrollTop(cm,d.scroller.scrollTop);setScrollLeft(cm,d.scroller.scrollLeft,true);signal(cm,\"scroll\",cm);}});// Listen to wheel events in order to try and update the viewport on time.\n\ton(d.scroller,\"mousewheel\",function(e){return onScrollWheel(cm,e);});on(d.scroller,\"DOMMouseScroll\",function(e){return onScrollWheel(cm,e);});// Prevent wrapper from ever scrolling\n\ton(d.wrapper,\"scroll\",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0;});d.dragFunctions={enter:function enter(e){if(!signalDOMEvent(cm,e)){e_stop(e);}},over:function over(e){if(!signalDOMEvent(cm,e)){onDragOver(cm,e);e_stop(e);}},start:function start(e){return onDragStart(cm,e);},drop:operation(cm,onDrop),leave:function leave(e){if(!signalDOMEvent(cm,e)){clearDragCursor(cm);}}};var inp=d.input.getField();on(inp,\"keyup\",function(e){return onKeyUp.call(cm,e);});on(inp,\"keydown\",operation(cm,onKeyDown));on(inp,\"keypress\",operation(cm,onKeyPress));on(inp,\"focus\",function(e){return onFocus(cm,e);});on(inp,\"blur\",function(e){return onBlur(cm,e);});}", "title": "" }, { "docid": "1fe05fd8a0019d0638b137401be8e823", "score": "0.59913075", "text": "function registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n })) }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0}\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null}\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n}", "title": "" }, { "docid": "7ba5e0276438687a3a3f4bed592d258f", "score": "0.59869134", "text": "function setupEvents() {\n var element = frontCanvas;\n\n // Needed this to override context menu behavior\n element.bind('contextmenu', function(evt) { evt.preventDefault(); });\n\n // Wheel should zoom across browsers\n element.bind('DOMMouseScroll mousewheel', function (evt) {\n var x = (-evt.originalEvent.wheelDeltaY || evt.originalEvent.detail);\n\n lastLocation = getRelativeLocation(frontCanvas, evt);\n handleZoom((x > 0 ? wheelZoom : x < 0 ? -wheelZoom : 0));\n evt.preventDefault();\n\n // Redraw the image in the canvas\n redrawImage();\n });\n\n // Handle mobile\n attachTouchListener(element);\n element.bind('mouse', function(e){\n // action: mouseAction,\n // current_button: current_button,\n // charCode: '',\n // altKey: false,\n // ctrlKey: false,\n // shiftKey: false,\n // metaKey: false,\n // delegateTarget: target,\n // pageX: posX,\n // pageY: posY\n var action = e.action,\n altKey = e.altKey,\n shiftKey = e.shiftKey,\n ctrlKey = e.ctrlKey,\n x = e.pageX,\n y = e.pageY,\n current_button = e.current_button;\n\n if(action === 'down') {\n if (e.altKey) {\n current_button = 2;\n e.altKey = false;\n } else if (e.shiftKey) {\n current_button = 3;\n e.shiftKey = false;\n }\n // Detect interaction mode\n switch(current_button) {\n case 2: // middle mouse down = pan\n mouseMode = modePan;\n break;\n case 3: // right mouse down = zoom\n mouseMode = modeZoom;\n break;\n default:\n mouseMode = modeRotation;\n break;\n }\n\n // Store mouse location\n lastLocation = [x, y];\n\n e.preventDefault();\n } else if(action === 'up') {\n mouseMode = modeNone;\n e.preventDefault();\n } else if(action === 'move') {\n if(mouseMode != modeNone) {\n var loc = [x,y];\n\n // Can NOT use switch as (modeRotation == modePan) is\n // possible when Pan should take over rotation as\n // rotation is not possible\n if(mouseMode === modePan) {\n handlePan(loc);\n } else if (mouseMode === modeZoom) {\n var deltaY = loc[1] - lastLocation[1];\n handleZoom(deltaY * dzScale);\n\n // Update mouse location\n lastLocation = loc;\n } else {\n handleRotation(loc);\n }\n\n // Redraw the image in the canvas\n redrawImage();\n }\n }\n });\n\n // Zoom and pan events with mouse buttons and drag\n element.bind('mousedown', function(evt) {\n var current_button = evt.which;\n\n // alt+click simulates center button, shift+click simulates right\n if (evt.altKey) {\n current_button = 2;\n evt.altKey = false;\n } else if (evt.shiftKey) {\n current_button = 3;\n evt.shiftKey = false;\n }\n\n // Detect interaction mode\n switch(current_button) {\n case 2: // middle mouse down = pan\n mouseMode = modePan;\n break;\n case 3: // right mouse down = zoom\n mouseMode = modeZoom;\n break;\n default:\n mouseMode = modeRotation;\n break;\n }\n\n // Store mouse location\n lastLocation = getRelativeLocation(frontCanvas, evt);\n\n evt.preventDefault();\n });\n\n // Send mouse movement event to the forwarding function\n element.bind('mousemove', function(e) {\n if(mouseMode != modeNone) {\n var loc = getRelativeLocation(frontCanvas, e);\n\n // Can NOT use switch as (modeRotation == modePan) is\n // possible when Pan should take over rotation as\n // rotation is not possible\n if(mouseMode === modePan) {\n handlePan(loc);\n } else if (mouseMode === modeZoom) {\n var deltaY = loc[1] - lastLocation[1];\n handleZoom(deltaY * dzScale);\n\n // Update mouse location\n lastLocation = loc;\n } else {\n handleRotation(loc);\n }\n\n // Redraw the image in the frontCanvas\n redrawImage();\n }\n });\n\n // Stop any zoom or pan events\n element.bind('mouseup', function(evt) {\n mouseMode = modeNone;\n evt.preventDefault();\n });\n }", "title": "" }, { "docid": "ebc7beda0ed7d8368536ef9a337132b3", "score": "0.5985147", "text": "initClick(target){\n\t\ttarget.addEventListener(\"click\", this.handleClick.bind(this));\n\t\ttarget.addEventListener(\"touchmove\", this.handleTouchMove.bind(this));\n\t}", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "bd7994c10723b63f24d8b98f0f602b80", "score": "0.59848505", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }", "title": "" }, { "docid": "eaf0f738ba1658ee8d64d410db9aa574", "score": "0.59840405", "text": "function enable() {\n\t\t\t\tdocument.addEventListener(\"touchstart\", anchorHighlight._touchstartHandler, false);\n\t\t\t\tdocument.addEventListener(\"touchend\", anchorHighlight._touchendHandler, false);\n\t\t\t\tdocument.addEventListener(\"touchmove\", anchorHighlight._touchmoveHandler, false);\n\t\t\t\t// for TAU in browser\n\t\t\t\tdocument.addEventListener(\"mousedown\", anchorHighlight._touchstartHandler, false);\n\t\t\t\tdocument.addEventListener(\"mouseup\", anchorHighlight._touchendHandler, false);\n\n\t\t\t\tdocument.addEventListener(\"visibilitychange\", anchorHighlight._checkPageVisibility, false);\n\t\t\t\tdocument.addEventListener(\"pagehide\", anchorHighlight._hideClear, false);\n\t\t\t\tdocument.addEventListener(\"popuphide\", anchorHighlight._hideClear, false);\n\t\t\t\tdocument.addEventListener(\"animationend\", anchorHighlight._clearBtnActiveClass, false);\n\t\t\t\tdocument.addEventListener(\"animationEnd\", anchorHighlight._clearBtnActiveClass, false);\n\t\t\t\tdocument.addEventListener(\"webkitAnimationEnd\", anchorHighlight._clearBtnActiveClass,\n\t\t\t\t\tfalse);\n\t\t\t}", "title": "" }, { "docid": "d2c0132783ec6254539544e233f3974f", "score": "0.59822685", "text": "function registerEventHandlers(cm) {\r\n var d = cm.display;\r\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\r\n // Older IE's will not fire a second mousedown for a double click\r\n if (ie && ie_version < 11)\r\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\r\n if (signalDOMEvent(cm, e)) { return }\r\n var pos = posFromMouse(cm, e);\r\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\r\n e_preventDefault(e);\r\n var word = cm.findWordAt(pos);\r\n extendSelection(cm.doc, word.anchor, word.head);\r\n })); }\r\n else\r\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\r\n // Some browsers fire contextmenu *after* opening the menu, at\r\n // which point we can't mess with it anymore. Context menu is\r\n // handled in onMouseDown for these browsers.\r\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }); }\r\n\r\n // Used to suppress mouse event handling when a touch happens\r\n var touchFinished, prevTouch = {end: 0};\r\n function finishTouch() {\r\n if (d.activeTouch) {\r\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\r\n prevTouch = d.activeTouch;\r\n prevTouch.end = +new Date;\r\n }\r\n }\r\n function isMouseLikeTouchEvent(e) {\r\n if (e.touches.length != 1) { return false }\r\n var touch = e.touches[0];\r\n return touch.radiusX <= 1 && touch.radiusY <= 1\r\n }\r\n function farAway(touch, other) {\r\n if (other.left == null) { return true }\r\n var dx = other.left - touch.left, dy = other.top - touch.top;\r\n return dx * dx + dy * dy > 20 * 20\r\n }\r\n on(d.scroller, \"touchstart\", function (e) {\r\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\r\n d.input.ensurePolled();\r\n clearTimeout(touchFinished);\r\n var now = +new Date;\r\n d.activeTouch = {start: now, moved: false,\r\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\r\n if (e.touches.length == 1) {\r\n d.activeTouch.left = e.touches[0].pageX;\r\n d.activeTouch.top = e.touches[0].pageY;\r\n }\r\n }\r\n });\r\n on(d.scroller, \"touchmove\", function () {\r\n if (d.activeTouch) { d.activeTouch.moved = true; }\r\n });\r\n on(d.scroller, \"touchend\", function (e) {\r\n var touch = d.activeTouch;\r\n if (touch && !eventInWidget(d, e) && touch.left != null &&\r\n !touch.moved && new Date - touch.start < 300) {\r\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\r\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\r\n { range = new Range(pos, pos); }\r\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\r\n { range = cm.findWordAt(pos); }\r\n else // Triple tap\r\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\r\n cm.setSelection(range.anchor, range.head);\r\n cm.focus();\r\n e_preventDefault(e);\r\n }\r\n finishTouch();\r\n });\r\n on(d.scroller, \"touchcancel\", finishTouch);\r\n\r\n // Sync scrolling between fake scrollbars and real scrollable\r\n // area, ensure viewport is updated when scrolling.\r\n on(d.scroller, \"scroll\", function () {\r\n if (d.scroller.clientHeight) {\r\n updateScrollTop(cm, d.scroller.scrollTop);\r\n setScrollLeft(cm, d.scroller.scrollLeft, true);\r\n signal(cm, \"scroll\", cm);\r\n }\r\n });\r\n\r\n // Listen to wheel events in order to try and update the viewport on time.\r\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\r\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\r\n\r\n // Prevent wrapper from ever scrolling\r\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\r\n\r\n d.dragFunctions = {\r\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\r\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\r\n start: function (e) { return onDragStart(cm, e); },\r\n drop: operation(cm, onDrop),\r\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\r\n };\r\n\r\n var inp = d.input.getField();\r\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\r\n on(inp, \"keydown\", operation(cm, onKeyDown));\r\n on(inp, \"keypress\", operation(cm, onKeyPress));\r\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\r\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\r\n}", "title": "" }, { "docid": "413081e7cd299137c76838d611467076", "score": "0.59643453", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "413081e7cd299137c76838d611467076", "score": "0.59643453", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "9c88a50e42828f73364aec0e33e8f34b", "score": "0.59643453", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function() {clearDragCursor(cm);}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "413081e7cd299137c76838d611467076", "score": "0.59643453", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "413081e7cd299137c76838d611467076", "score": "0.59643453", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n };\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) return false;\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1;\n }\n function farAway(touch, other) {\n if (other.left == null) return true;\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20;\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) d.activeTouch.moved = true;\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n range = new Range(pos, pos);\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n range = cm.findWordAt(pos);\n else // Triple tap\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},\n over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function(e){onDragStart(cm, e);},\n drop: operation(cm, onDrop),\n leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", bind(onFocus, cm));\n on(inp, \"blur\", bind(onBlur, cm));\n }", "title": "" }, { "docid": "6298b4b07ac6bf630667a5522136b619", "score": "0.59521395", "text": "function bindEvents() {\n\t\tcodeDiv.addEventListener('touchstart', onCodeDivTouchStart);\n\t\tcodeDiv.addEventListener('touchend', onCodeDivTouchEnd);\n\t\tdocument.addEventListener(\"rotarydetent\", rotaryDetentHandler);\n\t\tdocument.addEventListener('tizenhwkey', onBackButton);\n\t\tdocument.addEventListener(\"visibilitychange\", onVisibilityChange);\n\t}", "title": "" }, { "docid": "45ec57d56d555f3aa89e04b7be0a076b", "score": "0.5946074", "text": "function bind() {\n if (document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement) {\n // Lock event\n previewer.fixed = true;\n } else {\n // Unlock event\n previewer.fixed = false;\n }\n }", "title": "" }, { "docid": "44ac6f312345419206f8781b96d157d6", "score": "0.59367466", "text": "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n {\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) {\n return\n }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) {\n return\n }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n }\n else\n {\n on(d.scroller, \"dblclick\", function(e) {\n return signalDOMEvent(cm, e) || e_preventDefault(e);\n });\n }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) {\n on(d.scroller, \"contextmenu\", function(e) {\n return onContextMenu(cm, e);\n });\n }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished,\n prevTouch = {\n end: 0\n };\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function() {\n return d.activeTouch = null;\n }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) {\n return false\n }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) {\n return true\n }\n var dx = other.left - touch.left,\n dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function(e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {\n start: now,\n moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null\n };\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function() {\n if (d.activeTouch) {\n d.activeTouch.moved = true;\n }\n });\n on(d.scroller, \"touchend\", function(e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"),\n range;\n if (!touch.prev || farAway(touch, touch.prev))// Single tap\n {\n range = new Range(pos, pos);\n }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev))// Double tap\n {\n range = cm.findWordAt(pos);\n }\n else // Triple tap\n {\n range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));\n }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e) {\n return onScrollWheel(cm, e);\n });\n on(d.scroller, \"DOMMouseScroll\", function(e) {\n return onScrollWheel(cm, e);\n });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() {\n return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0;\n });\n\n d.dragFunctions = {\n enter: function(e) {\n if (!signalDOMEvent(cm, e)) {\n e_stop(e);\n }\n },\n over: function(e) {\n if (!signalDOMEvent(cm, e)) {\n onDragOver(cm, e);\n e_stop(e);\n }\n },\n start: function(e) {\n return onDragStart(cm, e);\n },\n drop: operation(cm, onDrop),\n leave: function(e) {\n if (!signalDOMEvent(cm, e)) {\n clearDragCursor(cm);\n }\n }\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function(e) {\n return onKeyUp.call(cm, e);\n });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function(e) {\n return onFocus(cm, e);\n });\n on(inp, \"blur\", function(e) {\n return onBlur(cm, e);\n });\n }", "title": "" }, { "docid": "c97eeee25601a78b8769897d0d58eeb2", "score": "0.59177893", "text": "function registerEventHandlers(cm) {\n var d = cm.display\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown))\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11) {\n on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e)\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e)\n var word = cm.findWordAt(pos)\n extendSelection(cm.doc, word.anchor, word.head)\n }))\n }\n else { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) { on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); }) }\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = { end: 0 }\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)\n prevTouch = d.activeTouch\n prevTouch.end = +new Date\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0]\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled()\n clearTimeout(touchFinished)\n var now = +new Date\n d.activeTouch = {\n start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null\n }\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX\n d.activeTouch.top = e.touches[0].pageY\n }\n }\n })\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true }\n })\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos) }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos) }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n cm.setSelection(range.anchor, range.head)\n cm.focus()\n e_preventDefault(e)\n }\n finishTouch()\n })\n on(d.scroller, \"touchcancel\", finishTouch)\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop)\n setScrollLeft(cm, d.scroller.scrollLeft, true)\n signal(cm, \"scroll\", cm)\n }\n })\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); })\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); })\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })\n\n d.dragFunctions = {\n enter: function (e) { if (!signalDOMEvent(cm, e)) { e_stop(e) } },\n over: function (e) { if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) } },\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) { if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) } }\n }\n\n var inp = d.input.getField()\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); })\n on(inp, \"keydown\", operation(cm, onKeyDown))\n on(inp, \"keypress\", operation(cm, onKeyPress))\n on(inp, \"focus\", function (e) { return onFocus(cm, e); })\n on(inp, \"blur\", function (e) { return onBlur(cm, e); })\n }", "title": "" }, { "docid": "eaabe4b982db3ace23e7d56cca68b554", "score": "0.5909893", "text": "function Nt(){document.addEventListener(\"click\",Mt,!0),document.addEventListener(\"touchstart\",jt,ji),window.addEventListener(\"blur\",It)}", "title": "" }, { "docid": "9c1b8ed314a66b697e5b39af8e58669d", "score": "0.58954406", "text": "function hapticSelectionChanged() {\n engine && engine.gestureSelectionChanged();\n}", "title": "" }, { "docid": "d50f7fb05a0369f8b5410d048678a351", "score": "0.5889693", "text": "onAddOutsideListener_() {\n // ensure any previous listeners are removed prior to adding\n this.onRemoveOutsideListener_();\n\n var doc = getDocument();\n listen(doc, GoogEventType.MOUSEDOWN, this.onClick_, true, this);\n listen(doc, GoogEventType.POINTERDOWN, this.onClick_, true, this);\n }", "title": "" }, { "docid": "1d629286f772c6b05be3b7e0ee9e9449", "score": "0.58894885", "text": "function initEvents() {\n var bind = _this.h.addEventListener;\n var eventTarget = params.eventTarget === 'wrapper' ? _this.wrapper : _this.container;\n //Touch Events\n if (! (_this.browser.ie10 || _this.browser.ie11)) {\n if (_this.support.touch) {\n bind(eventTarget, 'touchstart', onTouchStart);\n bind(eventTarget, 'touchmove', onTouchMove);\n bind(eventTarget, 'touchend', onTouchEnd);\n }\n if (params.simulateTouch) {\n bind(eventTarget, 'mousedown', onTouchStart);\n bind(document, 'mousemove', onTouchMove);\n bind(document, 'mouseup', onTouchEnd);\n }\n }\n else {\n bind(eventTarget, _this.touchEvents.touchStart, onTouchStart);\n bind(document, _this.touchEvents.touchMove, onTouchMove);\n bind(document, _this.touchEvents.touchEnd, onTouchEnd);\n }\n\n //Resize Event\n if (params.autoResize) {\n bind(window, 'resize', _this.resizeFix);\n }\n //Slide Events\n addSlideEvents();\n //Mousewheel\n _this._wheelEvent = false;\n if (params.mousewheelControl) {\n if (document.onmousewheel !== undefined) {\n _this._wheelEvent = 'mousewheel';\n }\n if (!_this._wheelEvent) {\n try {\n new WheelEvent('wheel');\n _this._wheelEvent = 'wheel';\n } catch (e) {}\n }\n if (!_this._wheelEvent) {\n _this._wheelEvent = 'DOMMouseScroll';\n }\n if (_this._wheelEvent) {\n bind(_this.container, _this._wheelEvent, handleMousewheel);\n }\n }\n\n //Keyboard\n function _loadImage(src) {\n var image = new Image();\n image.onload = function () {\n if (typeof _this === 'undefined' || _this === null) return;\n if (_this.imagesLoaded !== undefined) _this.imagesLoaded++;\n if (_this.imagesLoaded === _this.imagesToLoad.length) {\n _this.reInit();\n if (params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);\n }\n };\n image.src = src;\n }\n\n if (params.keyboardControl) {\n bind(document, 'keydown', handleKeyboardKeys);\n }\n if (params.updateOnImagesReady) {\n _this.imagesToLoad = $$('img', _this.container);\n\n for (var i = 0; i < _this.imagesToLoad.length; i++) {\n _loadImage(_this.imagesToLoad[i].getAttribute('src'));\n }\n }\n }", "title": "" }, { "docid": "3dcfdc8557ef192c045938069da2b319", "score": "0.58786994", "text": "addContainerEventListener() {\n let func_0 = this.onDocumentMouseClick.bind(this);\n this.container.addEventListener('click', func_0, false);\n this._containerEventListener['click'] = func_0;\n\n let func_1 = this.onDocumentMouseDBLClick.bind(this);\n this.container.addEventListener('dblclick', func_1, false);\n this._containerEventListener['dblclick'] = func_1;\n\n if (isOnMobile) {\n let func_2 = this.onDocumentMouseDBLClickMobile.bind(this);\n this.container.addEventListener('taphold', func_2);\n document.body.addEventListener('contextmenu', this.blockContextMenu);\n this._containerEventListener['taphold'] = func_2;\n }\n let func_4 = this.onDocumentMouseEnter.bind(this);\n this.container.addEventListener('mouseenter', func_4, false);\n this._containerEventListener['mouseenter'] = func_4;\n let func_5 = this.onDocumentMouseMove.bind(this);\n this.container.addEventListener('mousemove', func_5, false);\n this._containerEventListener['mousemove'] = func_5;\n let func_6 = this.onDocumentMouseLeave.bind(this);\n this.container.addEventListener('mouseleave', func_6, false);\n this._containerEventListener['mouseleave'] = func_6;\n let func_7 = this.onDocumentDrop.bind(this);\n this.container.addEventListener('drop', func_7, false); // drop file load swc\n this._containerEventListener['drop'] = func_7;\n let func_8 = this.blockDragEvents.bind(this);\n this.container.addEventListener('dragover', func_8, false); // drop file load swc\n this._containerEventListener['dragover'] = func_8;\n let func_9 = this.blockDragEvents.bind(this);\n this.container.addEventListener('dragenter', func_9, false); // drop file load swc\n this._containerEventListener['dragenter'] = func_9;\n let func_10 = this.onWindowResize.bind(this);\n this.container.addEventListener('resize', func_10, false);\n this._containerEventListener['resize'] = func_10;\n let func_11 = this.onDocumentMouseDown.bind(this);\n this.container.addEventListener('mousedown', func_11, false);\n this._containerEventListener['mousedown'] = func_11;\n let func_12 = this.onDocumentMouseUp.bind(this);\n this.container.addEventListener('mouseup', func_12, false);\n this._containerEventListener['mouseup'] = func_12;\n }", "title": "" }, { "docid": "45753f64bc0ff291ec3fed24d6628b82", "score": "0.5875669", "text": "addEventListeners_() {\n this.elem.on(\"click\", this.onInteraction);\n }", "title": "" }, { "docid": "3c373227de2704c912ddc2b3d452e211", "score": "0.5857074", "text": "componentDidMount(){\n window.addEventListener('touchstart', this.pageClick, false);\n window.addEventListener('mousedown', this.pageClick, false);\n }", "title": "" }, { "docid": "8ddbd8f02e14bedeef205161ed5687a3", "score": "0.5854227", "text": "inserted(el, binding) {\n const onClick = e => directive(e, el, binding); // iOS does not recognize click events on document\n // or body, this is the entire purpose of the v-app\n // component and [data-app], stop removing this\n\n\n const app = document.querySelector('[data-app]') || document.body; // This is only for unit tests\n\n app.addEventListener('click', onClick, true);\n el._clickOutside = onClick;\n }", "title": "" }, { "docid": "8ddbd8f02e14bedeef205161ed5687a3", "score": "0.5854227", "text": "inserted(el, binding) {\n const onClick = e => directive(e, el, binding); // iOS does not recognize click events on document\n // or body, this is the entire purpose of the v-app\n // component and [data-app], stop removing this\n\n\n const app = document.querySelector('[data-app]') || document.body; // This is only for unit tests\n\n app.addEventListener('click', onClick, true);\n el._clickOutside = onClick;\n }", "title": "" }, { "docid": "8ddbd8f02e14bedeef205161ed5687a3", "score": "0.5854227", "text": "inserted(el, binding) {\n const onClick = e => directive(e, el, binding); // iOS does not recognize click events on document\n // or body, this is the entire purpose of the v-app\n // component and [data-app], stop removing this\n\n\n const app = document.querySelector('[data-app]') || document.body; // This is only for unit tests\n\n app.addEventListener('click', onClick, true);\n el._clickOutside = onClick;\n }", "title": "" }, { "docid": "8ddbd8f02e14bedeef205161ed5687a3", "score": "0.5854227", "text": "inserted(el, binding) {\n const onClick = e => directive(e, el, binding); // iOS does not recognize click events on document\n // or body, this is the entire purpose of the v-app\n // component and [data-app], stop removing this\n\n\n const app = document.querySelector('[data-app]') || document.body; // This is only for unit tests\n\n app.addEventListener('click', onClick, true);\n el._clickOutside = onClick;\n }", "title": "" }, { "docid": "8ddbd8f02e14bedeef205161ed5687a3", "score": "0.5854227", "text": "inserted(el, binding) {\n const onClick = e => directive(e, el, binding); // iOS does not recognize click events on document\n // or body, this is the entire purpose of the v-app\n // component and [data-app], stop removing this\n\n\n const app = document.querySelector('[data-app]') || document.body; // This is only for unit tests\n\n app.addEventListener('click', onClick, true);\n el._clickOutside = onClick;\n }", "title": "" }, { "docid": "751e486c24edc984228f340ba9eb6e10", "score": "0.5849367", "text": "function initEvents() {\n var bind = _this.h.addEventListener;\n var eventTarget = params.eventTarget === 'wrapper' ? _this.wrapper : _this.container;\n //Touch Events\n if (! (_this.browser.ie10 || _this.browser.ie11)) {\n if (_this.support.touch) {\n bind(eventTarget, 'touchstart', onTouchStart);\n bind(eventTarget, 'touchmove', onTouchMove);\n bind(eventTarget, 'touchend', onTouchEnd);\n }\n if (params.simulateTouch) {\n bind(eventTarget, 'mousedown', onTouchStart);\n bind(document, 'mousemove', onTouchMove);\n bind(document, 'mouseup', onTouchEnd);\n }\n }\n else {\n bind(eventTarget, _this.touchEvents.touchStart, onTouchStart);\n bind(document, _this.touchEvents.touchMove, onTouchMove);\n bind(document, _this.touchEvents.touchEnd, onTouchEnd);\n }\n\n //Resize Event\n if (params.autoResize) {\n bind(window, 'resize', _this.resizeFix);\n }\n //Slide Events\n addSlideEvents();\n //Mousewheel\n _this._wheelEvent = false;\n if (params.mousewheelControl) {\n if (document.onmousewheel !== undefined) {\n _this._wheelEvent = 'mousewheel';\n }\n if (!_this._wheelEvent) {\n try {\n new WheelEvent('wheel');\n _this._wheelEvent = 'wheel';\n } catch (e) {}\n }\n if (!_this._wheelEvent) {\n _this._wheelEvent = 'DOMMouseScroll';\n }\n if (_this._wheelEvent) {\n bind(_this.container, _this._wheelEvent, handleMousewheel);\n }\n }\n\n //Keyboard\n function _loadImage(img) {\n var image, src;\n var onReady = function () {\n if (typeof _this === 'undefined' || _this === null) return;\n if (_this.imagesLoaded !== undefined) _this.imagesLoaded++;\n if (_this.imagesLoaded === _this.imagesToLoad.length) {\n _this.reInit();\n if (params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);\n }\n };\n\n if(!img.complete){\n src = (img.currentSrc || img.getAttribute('src'))\n if( src ){\n image = new Image();\n image.onload = onReady;\n image.onerror = onReady;\n image.src = src;\n } else {\n onReady();\n }\n\n } else {//image already loaded...\n onReady();\n }\n }\n\n if (params.keyboardControl) {\n bind(document, 'keydown', handleKeyboardKeys);\n }\n if (params.updateOnImagesReady) {\n _this.imagesToLoad = $$('img', _this.container);\n\n for (var i = 0; i < _this.imagesToLoad.length; i++) {\n _loadImage(_this.imagesToLoad[i]);\n }\n }\n }", "title": "" } ]
01caa544ab2e2fe8a3fd763471b7b9be
Get noUISlider Value and write on
[ { "docid": "b20d7bc93b6c1c511911c54118e8a02d", "score": "0.7605126", "text": "function getNoUISliderValue(slider, percentage) {\n slider.noUiSlider.on('update', function() {\n var val = slider.noUiSlider.get();\n if (percentage) {\n val = parseInt(val);\n val += '%';\n }\n $(slider).parent().find('span.js-nouislider-value').text(val);\n });\n}", "title": "" } ]
[ { "docid": "14581cd054a21f858c4e95148504c8c8", "score": "0.76374483", "text": "function getNoUISliderValue(slider, percentage) {\n slider.noUiSlider.on('update', function () {\n var val = slider.noUiSlider.get();\n if (percentage) {\n val = parseInt(val);\n val += '%';\n }\n $(slider).parent().find('span.js-nouislider-value').text(val);\n });\n }", "title": "" }, { "docid": "eacad23ba2b9d1a3a162ace54fd15ed9", "score": "0.7277211", "text": "function getNoUISliderValue(slider, percentage) {\n slider.noUiSlider.on('update', function () {\n var val = slider.noUiSlider.get();\n var arrayValue = val.toString().split(',');\n\n /*if (percentage) {\n val = parseInt(val);\n val += '%';\n }*/\n $(slider).parent().find('span.minimo').text(arrayValue[0] + \" €\");\n $(slider).parent().find('span.maximo').text(arrayValue[1] + \" €\");\n });\n}", "title": "" }, { "docid": "ee9059bc2f1962885057c9ee47cdc401", "score": "0.68091244", "text": "function set_slider_value(id, value) {\n const slider = document.getElementById(id);\n slider.noUiSlider.set(value);\n}", "title": "" }, { "docid": "725411b30cae167706ec07ae85ef88fa", "score": "0.67840356", "text": "function getSliderValue() {\n\t\tif (favorite[0].value === \"on\") {\n\t\t\tfavoriteValue = \"Yes\";\n\t\t} else {\n\t\t\tfavoriteValue = \"No\";\n\t\t}\n\t}", "title": "" }, { "docid": "683fc64fbb1032a1e75e4b77df4efe42", "score": "0.6662866", "text": "function setSliderHandle(i, value) {\n\t\t\tlet r = [null,null];\n\t\t\tr[i] = value;\n\t\t\t$range_price.noUiSlider.set(r);\n\t\t}", "title": "" }, { "docid": "3f29c00b0ec50206b08019a0b01ea1e9", "score": "0.66151655", "text": "function Slider(val) {\r\n document.getElementById('slider').value=val; \r\n }", "title": "" }, { "docid": "e167b555c2c420732fe9fb522ab198e3", "score": "0.66081536", "text": "function rollUnderValue(){\n return $('#roll-under').slider('option', 'value');\n}", "title": "" }, { "docid": "99dd9e8a680d69a3499950515bd68fd9", "score": "0.64662", "text": "function myRange() {\n if ($('#slider-range').length > 0) {\n var slider = document.getElementById('slider-range');\n var startPoint = $(\"#slider-range\").attr('data-from') - 0;\n var maxPoint = $(\"#slider-range\").attr('data-to') - 0;\n var sliderStart = $(\"#slider-range\").attr('data-start') - 0;\n var sliderEnd = $(\"#slider-range\").attr('data-end') - 0;\n\n noUiSlider.create(slider, {\n start: [sliderStart, sliderEnd],\n format: wNumb({\n decimals: 0\n }),\n connect: true,\n range: {\n 'min': startPoint,\n 'max': maxPoint\n },\n step: 1,\n });\n\n var snapValues = [\n document.getElementById('slider-from'),\n document.getElementById('slider-to')\n ];\n\n slider.noUiSlider.on('update', function (values, handle) {\n snapValues[handle].innerHTML = values[handle];\n });\n }\n}", "title": "" }, { "docid": "a7398c3a355cb9253698d96a7d3c8b9f", "score": "0.64346695", "text": "function valueGet ( ) {\n\n var i, retour = [];\n\n // Get the value from all handles.\n for ( i = 0; i < options.handles; i += 1 ){\n retour[i] = options.format.to( $Values[i] );\n }\n\n return inSliderOrder( retour );\n }", "title": "" }, { "docid": "b42cb7532ffdc80430276dd4a0272c07", "score": "0.64331126", "text": "function valueGet ( ) {\n\n\t\tvar i, retour = [];\n\n\t\t// Get the value from all handles.\n\t\tfor ( i = 0; i < options.handles; i += 1 ){\n\t\t\tretour[i] = options.format.to( $Values[i] );\n\t\t}\n\n\t\treturn inSliderOrder( retour );\n\t}", "title": "" }, { "docid": "87490bd104c004ac5ccb456dcf1f0fb0", "score": "0.64258873", "text": "function setValFromEvent(ev){\n var pos = this.html.track.getBoundingClientRect(),\n offset,\n fraction,\n percent\n ;\n\n // If slider is hidden ex: display:none, return\n if(pos.height <= 0 || pos.width <=0)\n return;\n\n offset = getOffset.call(this, ev, pos);\n fraction = offset / pos[(this.orientation==='h')?'width':'height'];\n this.pixelOffset = offset;\n this.percent = fraction * 100;\n this.value = fraction * this.max;\n }", "title": "" }, { "docid": "5dfaa574e0297010f6d2e0d2008188db", "score": "0.6404608", "text": "function setValue() {\n if (!lodash.isNil(ctrl.onChangeCallback)) {\n ctrl.onChangeCallback(ctrl.sliderConfig.value === ctrl.sliderConfig.options.ceil ? null : ctrl.sliderConfig.value * Math.pow(1024, ctrl.sliderConfig.pow), ctrl.updateSliderInput);\n }\n\n if (!lodash.isNil(ctrl.selectedData)) {\n ctrl.selectedData[ctrl.sliderConfig.options.id] = ctrl.sliderConfig.value === ctrl.sliderConfig.options.ceil ? 0 : ctrl.sliderConfig.value * Math.pow(1024, ctrl.sliderConfig.pow);\n }\n }", "title": "" }, { "docid": "2d96e7a49a476c96ed3c78606baa2628", "score": "0.6402957", "text": "function setSliderHandle(i, value, parent, varArgs, resetEnd, type, varVals=null, varLims=null) {\n\t//resetEnd : 0=don't reset; 1=reset if value > max; 2=reset always\n //console.log(i, value, parent, varArgs, resetEnd, type)\n\n\t//reset the slider limits\n\tvar min = parent.noUiSlider.options.range.min[0];\n\tvar max = parent.noUiSlider.options.range.max[0];\n\tif (typeof parseFloat(min) === \"number\" && typeof parseFloat(max) === \"number\" && !isNaN(min) && !isNaN(max)){\n\t\tvar minReset = min;\n\t\tvar maxReset = max;\n\t\tif ((i == 0 && type == \"double\") && resetEnd[0] == 2 || (resetEnd[0] == 1 && value < min)) minReset = parseFloat(value);\n\t\tif ((i == 1 || type == \"single\") && resetEnd[1] == 2 || (resetEnd[1] == 1 && value > max)) maxReset = parseFloat(value);\n\n\t\tmaxReset = Math.max(minReset + 0.0001*Math.abs(minReset), maxReset); //in case user makes a mistake\n\t\tparent.noUiSlider.updateOptions({\n\t\t\trange: {\n\t\t\t\t'min': [minReset],\n\t\t\t\t'max': [maxReset]\n\t\t\t}\n\t\t});\n\n\t\tif (varVals) varVals[i] = parseFloat(value);\t\n\t\tif (varLims) varLims[i] = parseFloat(value);\n\n\t\t//reset the slider value\n\t\tvar r = parent.noUiSlider.get()\n\t\tif (Array.isArray(r)) r[i] = value; else r = value; //this could also be type 'double' vs. 'single'\n\n\t\tunsafe_slider = !['plotNmaxSlider','PSlider','VelWidthSlider'].every(\n\t\t\tfunction(id){\n\t\t\t\treturn !parent.id.includes(id);});\n\t\t// don't automatically update the size, make people slide it so it's safer\n\t\tif (!GUIParams.safePSizeSliders || \n\t\t\tvalue < max || \n\t\t\t!unsafe_slider){\n\t\t\tparent.noUiSlider.set(r);\n\t\t\t//update the attached variables (already taken care of when we change the slider value)\n\t\t\tupdateUIValues(parseFloat(value), varArgs, i, type);\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "b87c1bcfa04b97eb69651cbecd72f1e7", "score": "0.63819206", "text": "get value() {\n return this.mode === 'determinate' ? this._value : 0;\n }", "title": "" }, { "docid": "b87c1bcfa04b97eb69651cbecd72f1e7", "score": "0.63819206", "text": "get value() {\n return this.mode === 'determinate' ? this._value : 0;\n }", "title": "" }, { "docid": "ea4094c2146862e965a1cf933817bb89", "score": "0.63601583", "text": "function setNewValue(num,value){\n\t//Si no es la cadena nula\n\tif(value!=\"\"){\n\t\t//Convierto a float\n\t\tvalue=parseFloat(value);\n\t\t//Si no es un numero....\n\t\tif(Number.isNaN(value))\n\t\t\tvalue=0;\n\t\tif(num==1){\n\t\t\tslider1.value=value;\n\t\t\tonSliderLuz(slider1);\n\t\t}\n\t\tif(num==2){\n\t\t\tslider2.value=value;\n\t\t\tonSliderZoomCamera(slider2);\n\t\t}\n\t\tif(num==3){\n\t\t\tslider3.value=value;\n\t\t\tonSliderUpDownCamera(slider3);\n\t\t}\n\t\tif(num==4){\n\t\t\tslider4.value=value;\n\t\t\tonSliderRotationCamera(slider4);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d8ebf6ef3e02381de7858d94ea7cd5e7", "score": "0.63395774", "text": "function setSliderValue (val) {\n $sliderEl.slider('setValue', val, false, true);\n return val;\n }", "title": "" }, { "docid": "a249d0a384c3fb03113d0df0758a04ec", "score": "0.63190013", "text": "function radioRangeGetValue() {\r\n document.getElementById(\"radioRangeValue\").innerHTML = document.getElementById(\"radioRangeSlider\").value;\r\n}", "title": "" }, { "docid": "8ef66eb6fd2e5daa5ac7cf75c074ca13", "score": "0.6309041", "text": "function checkSlider(){\n var slider = document.getElementById(\"myRange\");\n var output = document.getElementById(\"demo\");\n output.innerHTML = slider.value / 1000 + ' seconds';\n duration = slider.value; // Display the default slider value\n\n // Update the current slider value (each time you drag the slider handle)\n slider.oninput = function() {\n output.innerHTML = this.value / 1000 + ' seconds';\n duration = this.value;\n }\n }", "title": "" }, { "docid": "4840cb485e09864194cedf8b0d80c736", "score": "0.62917393", "text": "function setSliderValues(){\r\n prs_1_output.innerHTML = 'Not Selected';\r\n prs_2_output.innerHTML = 'Not Selected';\r\n prs_3_output.innerHTML = 'Not Selected';\r\n prs_4_output.innerHTML = 'Not Selected';\r\n prs_5_output.innerHTML = 'Not Selected';\r\n prs_6_output.innerHTML = 'Not Selected';\r\n prs_7_output.innerHTML = 'Not Selected';\r\n prs_8_output.innerHTML = 'Not Selected';\r\n prs_9_output.innerHTML = 'Not Selected';\r\n prs_10_output.innerHTML = 'Not Selected';\r\n\r\n //probe_1_output.innerHTML = 'Not Selected';\r\n //probe_2_output.innerHTML = 'Not Selected';\r\n\r\n age_output.innerHTML = 'Not Selected';\r\n}", "title": "" }, { "docid": "ffff37014e1c662acc26c7c806651df7", "score": "0.62796116", "text": "function nodesInNetworkGetValue() {\r\n document.getElementById(\"nodesInNetworkValue\").innerHTML = document.getElementById(\"nodesInNetworkSlider\").value;\r\n}", "title": "" }, { "docid": "020deffb8338b7da8b4684070d1286d2", "score": "0.6276884", "text": "function valueGet ( ) {\r\n\r\n\t\t\tvar i, retour = [];\r\n\r\n\t\t\t// Get the value from all handles.\r\n\t\t\tfor ( i = 0; i < options.handles; i += 1 ){\r\n\t\t\t\tretour[i] = options.format.to( scope_Values[i] );\r\n\t\t\t}\r\n\r\n\t\t\treturn inSliderOrder( retour );\r\n\t\t}", "title": "" }, { "docid": "273cc191761bef475a52b28c34bddabf", "score": "0.62685704", "text": "function getBreakSlider() {\n return $('#flat-slider').slider(\"value\");\n }", "title": "" }, { "docid": "f9392408ca89fcefa42f07310967a754", "score": "0.62353075", "text": "componentDidUpdate() {\n let range_slider = document.getElementById(\"range-slider\")\n if (range_slider !== null){\n range_slider.defaultValue = \"0\";\n }\n }", "title": "" }, { "docid": "6bd3ae2ac7616ea33d87478aaf3430b7", "score": "0.6225164", "text": "function setSliderHandle(i, value) {\n\t\t\t\tvar r = [null,null];\n\t\t\t\tr[i] = value;\n\t\t\t\tkeypressSlider.noUiSlider.set(r);\n\t\t\t}", "title": "" }, { "docid": "4c869d90437bb214a29298729e4b467e", "score": "0.621993", "text": "function initSlider(){\n $(\".slider #slide\").slider();\n $(\".slider #slide\").bind('slide click slideStart slideStop',function(){\n var current=$(this).data('slider').getValue();\n $(this).closest('.slider').find(\".slider-value\").html(current+'%');\n });\n}", "title": "" }, { "docid": "a6801f668ade91fcfca970d3023f1747", "score": "0.62142736", "text": "function reset_slider(){\r\n \tslider.value = 0;\r\n }", "title": "" }, { "docid": "13cab263bd0e4d59329ec9e3c765d1e0", "score": "0.6208773", "text": "function valueGet ( ) {\n\t\n\t\t\t\tvar i, retour = [];\n\t\n\t\t\t\t// Get the value from all handles.\n\t\t\t\tfor ( i = 0; i < options.handles; i += 1 ){\n\t\t\t\t\tretour[i] = options.format.to( scope_Values[i] );\n\t\t\t\t}\n\t\n\t\t\t\treturn inSliderOrder( retour );\n\t\t\t}", "title": "" }, { "docid": "8bf288f90c600588becd3c760058a31b", "score": "0.62035704", "text": "sliderOnChange() {\n updateShaderToyTime(this.sliderInput.value);\n }", "title": "" }, { "docid": "d614c16f18d79427141bd2e13969ca93", "score": "0.6192952", "text": "function showValue(evt, obj) {\n //Using showValue attribute to show hide pointer value\n if(showCB.checked) {\n cpuGauge.setChartAttribute('showValue', 1);\n posCheckBox.disabled = false;\n }\n else{\n cpuGauge.setChartAttribute('showValue', 0);\n posCheckBox.disabled = true;\n }\n }", "title": "" }, { "docid": "9ac6ad1503241bf5a3844ffc8dc8792e", "score": "0.61922663", "text": "function getSliderValue() {\r\n document.getElementById(\"rateSpan\").innerHTML = document.getElementById(\"rate\").value;\r\n}", "title": "" }, { "docid": "9b35b868e98f6b3ae3b5d0c940540cf0", "score": "0.6187928", "text": "function setSliderVal(el, val) {\n var magic_slider = document.getElementById(el + \"-slider\");\n val = parseInt(val);\n if ((val >= parseInt(magic_slider.min)) && (val <= parseInt(magic_slider.max))) {\n magic_slider.value = val;\n var magic_event = new Event('input');\n magic_slider.dispatchEvent(magic_event);\n }\n}", "title": "" }, { "docid": "8b0718fe62b4fe9e93d118b341db648c", "score": "0.61751586", "text": "function sensorFieldWidthGetValue() {\r\n document.getElementById(\"sensorFieldWidthValue\").innerHTML = document.getElementById(\"sensorFieldWidthSlider\").value;\r\n}", "title": "" }, { "docid": "9f094f7584fbacffde3c5d348c8095bd", "score": "0.6172645", "text": "function onAPSSlider(value){\r\n\taps = value;\r\n}", "title": "" }, { "docid": "f3d7c5304e8a0fa0d85efcc49e32f0d1", "score": "0.6166298", "text": "function valueGet ( ) {\n\n\t\tvar i, retour = [];\n\n\t\t// Get the value from all handles.\n\t\tfor ( i = 0; i < options.handles; i += 1 ){\n\t\t\tretour[i] = options.format.to( scope_Values[i] );\n\t\t}\n\n\t\treturn inSliderOrder( retour );\n\t}", "title": "" }, { "docid": "9ec14be76986b883276158bd0b5c267d", "score": "0.6123989", "text": "function updateSlider(val) {\n obj.option(\"value\",val);\n}", "title": "" }, { "docid": "e027f0e8c44ee1898ea9dad586677071", "score": "0.61239207", "text": "function sensorFieldLengthGetValue() {\r\n document.getElementById(\"sensorFieldLengthValue\").innerHTML = document.getElementById(\"sensorFieldLengthSlider\").value;\r\n}", "title": "" }, { "docid": "018886eef4e19b2dd98422f7dbebc131", "score": "0.61112696", "text": "function penWidthGetValue() {\r\n document.getElementById(\"penWidthValue\").innerHTML = document.getElementById(\"penWidthSlider\").value;\r\n}", "title": "" }, { "docid": "f41abeb62f9ac62d50d2cfd8625ecf12", "score": "0.6098967", "text": "function createDecimationSlider(){\n\n\tvar initialValue = parseFloat(GUIParams.decimate); //I don't *think* I need to update this in GUI; it's just the initial value that matters, right?\n\n\tvar sliderArgs = {\n\t\tstart: [initialValue], \n\t\tconnect: [true, false],\n\t\ttooltips: false,\n\t\tsteps: [0.1],\n\t\trange: { \n\t\t\t'min': [initialValue],\n\t\t\t'max': [20]\n\t\t},\n\t\tformat: wNumb({\n\t\t\tdecimals: 1\n\t\t})\n\t}\n\n\tvar slider = document.getElementById('DSlider');\n\tvar text = [document.getElementById('DMaxT')];\n\tvar varToSet = [initialValue, \"decimate\"]\n\tvar varArgs = {'f':'setViewerParamByKey','v':varToSet};\n\n\tcreateSlider(slider, text, sliderArgs, varArgs, [null, 1]);\n\n\t//reformat\n\tw = parseInt(d3.select(\"#DSlider\").style(\"width\").slice(0,-2));\n\td3.select(\"#DSlider\").select('.noUi-base').style('width',w-10+\"px\");\n\n\n\t//redefine the update function -- special case because it needs to talk to the Nslider as well\n\tslider.noUiSlider.on('update', function(values, handle) {\n\t\tvar decf = GUIParams.decimate/parseFloat(values[handle]);\n\t\t//if (decf != 1){ //is this if statement really necessary?\n\t\t\ttext.value = values[handle];\n\t\t\tvarToSet[0] = values[handle];\n\t\t\tsendToViewer([{'setViewerParamByKey':varToSet}])\n\t\t\tGUIParams.decimate = parseFloat(values[handle]);\n\t\t//}\n\n\t\tGUIParams.partsKeys.forEach(function(p){\n\t\t\tvar max = Math.round(GUIParams.plotNmax[p]);\n\t\t\tvar sliderInput = document.getElementById(p+'_NMaxT');\n\t\t\tif (sliderInput != null){\n\t\t\t\tvar val = parseFloat(sliderInput.parent.noUiSlider.get());\n\n\t\t\t\tsliderInput.parent.noUiSlider.updateOptions({\n\t\t\t\t\trange: {\n\t\t\t\t\t\t'min': [0],\n\t\t\t\t\t\t'max': [Math.round(max/parseFloat(values[handle]))]\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//Note: this is not perfect... if you increase decimation then decrease, it will not always place the N slider at the correct value\n\t\t\t\tsliderInput.parent.noUiSlider.set(Math.round(Math.min(max, val*decf)));\n\t\t\t}\n\n\t\t});\n\t});\n\n}", "title": "" }, { "docid": "5a1fa11a5192c8c2372e686ef2f0a1be", "score": "0.608185", "text": "function resetValue() {\n\t\t\tvar remainder = scrollPane.width() - scrollContent.width();\n\t\t\tvar leftVal = scrollContent.css( \"margin-left\" ) === \"auto\" ? 0 :\n\t\t\t\tparseInt( scrollContent.css( \"margin-left\" ) );\n\t\t\tvar percentage = Math.round( leftVal / remainder * 100 );\n\t\t\tscrollbar.slider( \"value\", percentage );\n\t\t}", "title": "" }, { "docid": "d257eeec72eb789eb7d07e0c021402e1", "score": "0.60807836", "text": "function GetSelectedTemperatureValue()\n{\n\treturn $(\"#id_tmp_slider\").is(\":checked\") ? 0.50 : 0.00;\n}", "title": "" }, { "docid": "13be6f3b60e34ab7062c25bb42176905", "score": "0.60800177", "text": "function sliderValueChanged(e) {\n\n var attribute = this.dataset.attribute;\n var device = this.dataset.device;\n var controlPanel = document.querySelector('.controlPanel');\n var inputField = controlPanel.querySelector('input[data-attribute=' + attribute + '][data-device=' + device + ']');\n var minMax = inputField.dataset.value;\n var min = minMax.split(',')[0];\n var max = minMax.split(',')[1];\n\n devicesData[device][attribute].min = min;\n devicesData[device][attribute].max = max;\n}", "title": "" }, { "docid": "485c137d0eb24596078deeaa4429e955", "score": "0.6075731", "text": "function resetValue() {\n var remainder = scrollPane.width() - scrollContent.width();\n\n var leftVal = scrollContent.css(\"left\") === \"auto\" ? 0 :\n parseInt(scrollContent.css(\"left\"));\n\n var percentage = Math.round(leftVal / remainder * 100);\n\n scrollBarElement.slider(\"value\", percentage);\n }", "title": "" }, { "docid": "ff15881a9e58c9fe9e36011141525e8f", "score": "0.60694927", "text": "function resetValue(){\n\t\tvar remainder = scrollPane.width() - scrollContent.width();\n\t\tvar leftVal = scrollContent.css('margin-left') === 'auto' ? 0 : parseInt(scrollContent.css('margin-left'));\n\t\tvar percentage = Math.round(leftVal / remainder * 100);\n\t\tscrollbar.slider('value', percentage);\n\t}", "title": "" }, { "docid": "cd12c4ad4fb9b233a8c1609665e995e0", "score": "0.6064375", "text": "function Slider(name){var _this=_super.call(this,name)||this;_this.name=name;_this._background=\"black\";_this._borderColor=\"white\";_this._thumbColor=\"\";_this._isThumbCircle=false;_this._displayValueBar=true;return _this;}", "title": "" }, { "docid": "0ee4fecbe802311650c2cd91d388755d", "score": "0.604979", "text": "getMaxSliderValue() {\n return this.dates.length - 1;\n }", "title": "" }, { "docid": "4a1a29b112f6dc86fa7e52c45fdf6777", "score": "0.6043392", "text": "function anchorsInNetworkGetValue() {\r\n document.getElementById(\"anchorsInNetworkValue\").innerHTML = document.getElementById(\"anchorsInNetworkSlider\").value;\r\n}", "title": "" }, { "docid": "9014fb11ee5609beac54994692e93142", "score": "0.60417837", "text": "function valueGet() {\n var i, retour = [];\n // Get the value from all handles.\n for (i = 0; i < options.handles; i += 1) {\n retour[i] = options.format.to(scope_Values[i]);\n }\n return inSliderOrder(retour);\n }", "title": "" }, { "docid": "27a45777e79c2287c7fef02cac3b5ced", "score": "0.60383576", "text": "_updateSlider() {\n assert( this._range.contains( this._numberProperty.value ), 'numberProperty outside of range of slider' );\n\n // Calculate the percentage that the thumb is across the slider track.\n const percentage = ( this._numberProperty.value - this._range.min ) / this._range.length;\n\n // Update the slider thumb center-x position based on the numberProperty's value.\n this._thumb.centerX = percentage * this._track.width + this._track.left;\n }", "title": "" }, { "docid": "e66904ef3a4c9d862c29d463c134469b", "score": "0.6027391", "text": "function checkValue()\n{\n if(!maxUnlimitedPort.get()) {\n v=Math.min(max.get(),v); \n }\n if(!minUnlimitedPort.get()) {\n v=Math.max(min.get(),v); \n }\n}", "title": "" }, { "docid": "8b84f7e14da5f7cc402b8cfc5d047a4c", "score": "0.6023608", "text": "function setup_uislider() {\n\t\tif ($('#uislider-demo').length) {\t\n\n\t\t\t$(\"#slider-range\").slider({\n\t\t\t range: true,\n\t\t\t min: 100,\n\t\t\t max: 500,\n\t\t\t values: [176, 329],\n\t\t\t slide: function(event, ui) {\n\t\t\t $(\"#amount\").val(\"$\" + ui.values[0] + \" - $\" + ui.values[1]);\n\t\t\t\n\t\t\t $('#slider-range .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[0] + '</div></div>');\n\t\t\t $('#slider-range .ui-slider-handle:last').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[1] + '</div></div>');\n\t\t\t }\n\t\t\t});\n\t\t\t$(\"#amount\").val(\"$\" + $(\"#slider-range\").slider(\"values\", 0) + \" - $\" + $(\"#slider-range\").slider(\"values\", 1));\n\n\t\t\t\t\n\t\t\t$( \"#slider-range-min\" ).slider({\n\t\t range: \"min\",\n\t\t value: 461,\n\t\t min: 100,\n\t\t max: 900,\n\t\t slide: function( event, ui ) {\n\t\t $( \"#amount2\" ).val( \"$\" + ui.value );\n\t\t $('#slider-range-min .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.value + '</div></div>');\n\t\t }\n\t\t });\n\t\t $(\"#amount2\").val( \"$\" + $( \"#slider-range-min\" ).slider(\"value\"));\n\t\t\t\n\t\t\t\n\t\t\t$( \"#slider-range-max\" ).slider({\n\t\t range: \"max\",\n\t\t min: 100,\n\t\t max: 999,\n\t\t value: 507,\n\t\t slide: function( event, ui ) {\n\t\t $( \"#amount3\" ).val( \"$\" + ui.value );\n\t\t $('#slider-range-max .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.value + '</div></div>');\n\t\t }\n\t\t });\n\t\t $(\"#amount3\" ).val( \"$\" + $( \"#slider-range-max\" ).slider( \"value\" ));\n\t\t \n\t\t\t$(\"#slider-range-step\").slider({\n\t\t\t range: true,\n\t\t\t min: 100,\n\t\t\t max: 999,\n\t\t\t step:100,\n\t\t\t values: [250, 850],\n\t\t\t slide: function(event, ui) {\n\t\t\t $(\"#amount4\").val(\"$\" + ui.values[0] + \" - $\" + ui.values[1]);\n\t\t\t\n\t\t\t $('#slider-range-step .ui-slider-handle:first').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[0] + '</div></div>');\n\t\t\t $('#slider-range-step .ui-slider-handle:last').html('<div class=\"tooltip top slider-tip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\">' + ui.values[1] + '</div></div>');\n\t\t\t }\n\t\t\t});\n\t\t\t$(\"#amount4\").val(\"$\" + $(\"#slider-range-step\").slider(\"values\", 0) + \" - $\" + $(\"#slider-range-step\").slider(\"values\", 1));\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "1541c662d51b5666d30eee7b4e77e14f", "score": "0.6006549", "text": "function valueF(nummer){\n var rangeslider = document.getElementById(slider[nummer]);\n var output = document.getElementById(\"sliderWert\");\n output.innerHTML = rangeslider.value; //liest Wert des aktuellen Sliders ein\n rangeslider.oninput = function() {\n checkFifty(); //Prüffunktionaufruf, da so immer geprüft wird, wenn ein Slider bewegt wird\n output.innerHTML = this.value; // und gibt diesen aus\n }\n}", "title": "" }, { "docid": "9fe819d62a6ebff20b9b0fcdfb6757c0", "score": "0.6004112", "text": "function WidgetSliderGUI() {\n this.addOutput(\"\", \"number\");\n this.properties = {\n value: 0.5,\n min: 0,\n max: 1,\n text: \"V\"\n };\n var that = this;\n this.size = [140, 40];\n this.slider = this.addWidget(\n \"slider\",\n \"V\",\n this.properties.value,\n function(v) {\n that.properties.value = v;\n },\n this.properties\n );\n this.widgets_up = true;\n }", "title": "" }, { "docid": "4aa951b0a7bf66239ab69255528ab9d3", "score": "0.6002414", "text": "function addSliderEvent(sliderId, valueId, ui) {\n document.getElementById(sliderId).oninput = () => {\n // get the input values from the sliders\n let red = document.getElementById(\"red_slider\").value/100;\n let green = document.getElementById(\"green_slider\").value/100;\n let blue = document.getElementById(\"blue_slider\").value/100;\n document.getElementById(valueId).innerHTML = document.getElementById(sliderId).value/100;\n // create a pseudolayer for this gui if one doesn't exist. we do it inside the event handler because we only want to generate the pseudolayer\n // if the gui value is actually changed. also helps for when we have inputs that are determined by the gui\n if (!(\"rgbaManipulationGui\" in ui.activeUiLayer._processingTracker)) {\n let pseudolayer = ui._constructor.rgbaManipulation({\n webgl: ui._webgl, \n rgbam_image: ui.activeUiLayer.pseudolayer,\n rgbam_multiplier: [red, green, blue, 1.0],\n });\n ui.activeUiLayer._processingTracker[\"rgbaManipulationGui\"] = pseudolayer;\n ui.updateUiLayer(ui.activeUiLayer, pseudolayer);\n // if the pseudolayer for the gui has been created (which it will have been every time except the first time this event fires)\n // we just update the pseudolayer, rather than creating a new one\n } else {\n // we update the pseudolayer value, using object mutation to our advantage\n let targetPseudolayer = ui.activeUiLayer._processingTracker.rgbaManipulationGui;\n targetPseudolayer.updateVariable(\"rgbam_multiplier\", [red, green, blue, 1.0]);\n // we're just updating the active ui layer, so we dont need to generate a new layer\n ui._renderActiveUiLayer();\n }\n }\n }", "title": "" }, { "docid": "3bfde108422cc818363f8b9227f801d2", "score": "0.60011345", "text": "function setValue(target, value){\n\t\tvar opts = $.data(target, 'slider').options;\n\t\tvar slider = $.data(target, 'slider').slider;\n\t\tvar oldValue = opts.value;\n\t\tif (value < opts.min) value = opts.min;\n\t\tif (value > opts.max) value = opts.max;\n\t\t\n\t\topts.value = value;\n\t\t$(target).val(value);\n\t\tslider.find('input.slider-value').val(value);\n\t\t\n\t\tvar pos = value2pos(target, value);\n\t\tvar tip = slider.find('.slider-tip');\n\t\tif (opts.showTip){\n\t\t\ttip.show();\n\t\t\ttip.html(opts.tipFormatter.call(target, opts.value));\n\t\t} else {\n\t\t\ttip.hide();\n\t\t}\n\t\t\n\t\tif (opts.mode == 'h'){\n\t\t\tvar style = 'left:'+pos+'px;';\n\t\t\tslider.find('.slider-handle').attr('style', style);\n\t\t\ttip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth()/2)) + 'px');\n\t\t} else {\n\t\t\tvar style = 'top:' + pos + 'px;';\n\t\t\tslider.find('.slider-handle').attr('style', style);\n\t\t\ttip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth())) + 'px');\n\t\t}\n\t\t\n\t\tif (oldValue != value){\n\t\t\topts.onChange.call(target, value, oldValue);\n\t\t}\n\t}", "title": "" }, { "docid": "48cecda62c48193955d0cded4b33bd74", "score": "0.59997845", "text": "function resetValue() {\n\t\tvar remainder = scrollPane.width() - scrollContent.width();\n\t\tvar leftVal = scrollContent.css( \"margin-left\" ) === \"auto\" ? 0 :\n\t\t\tparseInt( scrollContent.css( \"margin-left\" ) );\n\t\tvar percentage = Math.round( leftVal / remainder * 100 );\n\t\tscrollbar.slider( \"value\", percentage );\n\t}", "title": "" }, { "docid": "8907bd6bf99c0cdab3a0ddb583d3d692", "score": "0.5998975", "text": "function handleSlider(e) {\n e.target.id === \"size-range\"\n ? setArrLength(e.target.value)\n : setSpeed(e.target.value);\n }", "title": "" }, { "docid": "14773fe28cad982dda0789b0c57b2f6d", "score": "0.59985167", "text": "static removeSlider(analysisResult) {\n // if there's a slider, remove it\n if (analysisResult.get('slider').sliderElement.hasOwnProperty('noUiSlider')) {\n analysisResult.get('slider').sliderElement.noUiSlider.destroy();\n }\n $('#sliderValue').text(\"\");\n }", "title": "" }, { "docid": "3130f24a9d1a44e95c47681a68f56ec8", "score": "0.59880656", "text": "function setValue(val,num) {\n document.getElementById(\"slider\"+num).value = val;\n showValue(val,num);\n}", "title": "" }, { "docid": "2fc7c67989b5460cd3812776d9f5b60c", "score": "0.5973544", "text": "function updateSec() {\n mLectura.textContent = Number(mSlider.value);\n m = mSlider.value;\n}", "title": "" }, { "docid": "957a028d949b000018d781f77eb563c6", "score": "0.59668475", "text": "OnValueChanged(opt) {}", "title": "" }, { "docid": "098eb9bdf1e1b9037233547411f5ade1", "score": "0.5965248", "text": "function Slider() {\n var that;\n that = this;\n\n /** Slider.slider\n *\n * The HTML input slider Element\n */\n this.slider = null;\n\n /** Slider.slider\n *\n * The HTML div Element creating the slider background\n */\n this.rangeFill = null;\n\n /** Slider.scale\n *\n * Scaling factor for the slider (fixed to 1 for now)\n */\n this.scale = 1;\n\n /** Slider.currentValue\n *\n * The current value of the slider\n */\n this.currentValue = 50;\n\n /** Slider.initialValue\n *\n * The initial value of the slider\n */\n this.initialValue = 50;\n\n /**\n * ### Slider.mainText\n *\n * A text preceeding the slider\n */\n this.mainText = null;\n\n /**\n * ### Slider.required\n *\n * If TRUE, the user must move the slider\n */\n this.required = null;\n\n /**\n * ### Slider.requiredChoice\n *\n * Same as Slider.required (backward compatibility)\n */\n this.requiredChoice = null;\n\n /**\n * ### Slider.hint\n *\n * An additional informative text\n *\n * If not specified, it may be auto-filled, e.g. '*'.\n *\n * TODO: autoHint\n * @see Slider.texts.autoHint\n */\n this.hint = null;\n\n /** Slider.min\n *\n * The value of the slider at the leftmost position\n */\n this.min = 0;\n\n /** Slider.max\n *\n * The value of the slider at the rightmost position\n */\n this.max = 100;\n\n /** Slider.correctValue\n *\n * The correct value of the slider, if any\n */\n this.correctValue = null;\n\n /** Slider.displayValue\n *\n * If TRUE, the current value of the slider is displayed\n */\n this.displayValue = true;\n\n /** Slider.valueSpan\n *\n * The SPAN element containing the current value\n *\n * @see Slider.displayValue\n */\n this.valueSpan = null;\n\n /** Slider.displayNoChange\n *\n * If TRUE, a checkbox for marking a no-change is added\n */\n this.displayNoChange = true;\n\n /** Slider.noChangeSpan\n *\n * The checkbox form marking the no-change\n *\n * @see Slider.displayNoChange\n * @see Slider.noChangeCheckbox\n */\n this.noChangeSpan = null;\n\n /** Slider.totalMove\n *\n * The total movement of the slider\n */\n this.totalMove = 0;\n\n /** Slider.volumeSlider\n *\n * If TRUE, only the slider to the left of the pointer is colored\n *\n * Available types: 'volume', 'flat'.\n */\n this.type = 'volume';\n\n /** Slider.hoverColor\n *\n * The color of the slider on mouse over\n */\n this.hoverColor = '#2076ea';\n\n /** Slider.listener\n *\n * The main function listening for slider movement\n *\n * Calls user-defined listener oninput\n *\n * @param {boolean} noChange Optional. The function is invoked\n * by the no-change checkbox. Note: when the function is invoked\n * by the browser, noChange is the change event.\n *\n * @see Slider.onmove\n */\n var timeOut = null;\n this.listener = function(noChange) {\n if (!noChange && timeOut) return;\n\n if (that.isHighlighted()) that.unhighlight();\n\n timeOut = setTimeout(function() {\n var percent, diffPercent;\n\n percent = (that.slider.value - that.min) * that.scale;\n diffPercent = percent - that.currentValue;\n that.currentValue = percent;\n\n // console.log(diffPercent);\n // console.log(that.slider.value, percent);\n\n if (that.type === 'volume') {\n // Otherwise it goes a bit outside.\n if (percent > 99) percent = 99;\n that.rangeFill.style.width = percent + '%';\n }\n else {\n that.rangeFill.style.width = '99%';\n }\n\n if (that.displayValue) {\n that.valueSpan.innerHTML =\n that.getText('currentValue', that.slider.value);\n }\n\n if (that.displayNoChange && noChange !== true) {\n if (that.noChangeCheckbox.checked) {\n that.noChangeCheckbox.checked = false;\n J.removeClass(that.noChangeSpan, 'italic');\n }\n }\n\n that.totalMove += Math.abs(diffPercent);\n\n if (that.onmove) {\n that.onmove.call(that, that.slider.value, diffPercent);\n }\n\n timeOut = null;\n }, 0);\n }\n\n /** Slider.onmove\n *\n * User-defined listener function to slider movement\n *\n * @see Slider.listener\n */\n this.onmove = null;\n\n /**\n * ### Slider.timeFrom\n *\n * Time event from which measuring time\n *\n * Default: 'step'\n *\n * @see node.timer.getTimeSince\n */\n this.timeFrom = 'step';\n\n }", "title": "" }, { "docid": "c176a53725502584a2c79f2dbd61ce8a", "score": "0.59638023", "text": "function updateSliderVal(valOfSlider, nameOfExpense){\n $('input[type=\"range\"]').each(function(){\n // IF ITS THE SLIDER BEING CHANGED, UPDATE THE LABEL\n if($(this).closest('div').attr('id')==nameOfExpense){\n $(this).siblings('label').text(Math.floor($(this).val())+ '% of budget');\n $(this).closest('input').attr('value', Math.floor($(this).val()));\n }\n})\n}", "title": "" }, { "docid": "da6e78a1141b998c97570c3aad2b9081", "score": "0.59615237", "text": "function checkIfUnlimited() {\n ctrl.sliderConfig.valueLabel = ctrl.sliderConfig.value === ctrl.sliderConfig.options.ceil && !ctrl.allowFullRange ? 'U/L' : ctrl.sliderConfig.value;\n\n if (angular.isFunction(ctrl.onSliderChanging) && ctrl.sliderConfig.value !== ctrl.sliderConfig.options.ceil) {\n ctrl.onSliderChanging(ctrl.sliderConfig.value, ctrl.updateSliderInput);\n }\n\n $timeout(function () {\n $rootScope.$broadcast('rzSliderForceRender');\n });\n }", "title": "" }, { "docid": "332e0ad59447bb51d1b2a427690854ed", "score": "0.59597045", "text": "_initSliderRound() {\n if (document.getElementById('sliderRound')) {\n noUiSlider.create(document.getElementById('sliderRound'), {\n start: [4000],\n step: 1000,\n tooltips: true,\n connect: [true, false],\n range: {\n min: [1000],\n max: [10000],\n },\n format: {\n // 'to' the formatted value. Receives a number.\n to: function (value) {\n return Math.round(value);\n },\n // 'from' the formatted value.\n // Receives a string, should return a number.\n from: function (value) {\n return Number(value);\n },\n },\n });\n }\n }", "title": "" }, { "docid": "b5b47556f0bffce62dc43fedfe2896bb", "score": "0.59538037", "text": "addSlider(div, indicator) {\n let data = this.plotData.map(d => d[indicator]);\n\n if (indicator === 'time') {\n data = data.map(d => new Date(d).getTime());//Date.parse(d.toString()));\n }\n\n let min = d3.min(data);\n let max = d3.max(data);\n\n noUiSlider.create(div,\n {\n start: [min, max],\n connect: true,\n behaviour: 'drag',\n //tooltips: [true, true],\n range: {\n 'min': min,\n 'max': max\n },\n step: 0.01,\n margin: 0.1\n });\n\n if (indicator === 'time') {\n div.noUiSlider.updateOptions({\n step: 1000 * 60,\n margin: 1000 * 60 * 60 * 24\n });\n }\n\n let that = this;\n\n div.noUiSlider.on('start', function (values, handle) {\n if (indicator === 'time') {\n div.noUiSlider.updateOptions({\n tooltips: [that.dateSliderFormatter, that.dateSliderFormatter]\n });\n } else {\n div.noUiSlider.updateOptions({\n tooltips: true\n });\n }\n });\n\n div.noUiSlider.on('set', function (values, handle) {\n let sliders = d3.select(that.panel).selectAll('div.sliderDiv');\n\n let ranges = [];\n\n for (let node of sliders.nodes()) {\n ranges.push(node.noUiSlider.get());\n }\n\n for (let i = ranges.length; i < 4; i++) {\n ranges.push(null);\n }\n\n that.drawPlot(that.xIndicator, that.yIndicator, that.cIndicator, ranges);\n });\n\n div.noUiSlider.on('end', function (values, handle) {\n div.noUiSlider.updateOptions({\n tooltips: false\n });\n });\n }", "title": "" }, { "docid": "76a2c6235aba0e5d93a3f2ae16cd2902", "score": "0.5904282", "text": "function resetSlider() {\n var $slider = $(\"#slider-range\");\n var $sliderDuration = $(\"#slider-range-duration\");\n $slider.slider(\"values\", 0, min_round);\n $slider.slider(\"values\", 1, max_round);\n $sliderDuration.slider(\"values\", 0, min_duration);\n $sliderDuration.slider(\"values\", 1, max_duration);\n }", "title": "" }, { "docid": "f925cf98a9a09fc417a20c648ccac3e9", "score": "0.59026384", "text": "function setSlider(fld,val,enable) {\r\n $(\"#slider-\"+fld).slider(\"option\", \"value\", val);\r\n $(\"#slider-\"+fld).slider(\"enable\");\r\n $(\"#sldrmsg-\"+fld).css('visibility','hidden');\r\n}", "title": "" }, { "docid": "55aa943f01bc134c04208091f474d1a2", "score": "0.5896187", "text": "function update(slider,val) {\n //changed. Now, directly take value from ui.value. if not set (initial, will use current value.)\n var $vocal = slider == 1?val:$(\"#vocal\").val();\n var $repertoire = slider == 2?val:$(\"#repertoire\").val();\n\t\tvar $artistic = slider == 3?val:$(\"#artistic\").val();\n\t\tvar $individualy = slider == 4?val:$(\"#individualy\").val();\n\n /* commented\n $amount = $( \"#slider\" ).slider( \"value\" );\n $duration = $( \"#slider2\" ).slider( \"value\" );\n */\n\n $total = Number($vocal) + Number($repertoire)+Number($artistic)+Number($individualy);\n $( \"#vocal\" ).val($vocal);\n $( \"#vocal-label\" ).text($vocal);\n $( \"#repertoire\" ).val($repertoire);\n\t\t $( \"#repertoire-label\" ).text($repertoire);\n $( \"#artistic\" ).val($artistic);\n $( \"#artistic-label\" ).text($artistic);\n\t\t $( \"#individualy\" ).val($individualy);\n $( \"#individualy-label\" ).text($individualy);\n\t\t \n\t\t $( \"#total\" ).val($total);\n $( \"#total-label\" ).text($total);\n\n $('#slider a').html('<label><span class=\"glyphicon glyphicon-chevron-left\"></span> '+$vocal+' <span class=\"glyphicon glyphicon-chevron-right\"></span></label>');\n $('#slider2 a').html('<label><span class=\"glyphicon glyphicon-chevron-left\"></span> '+$repertoire+' <span class=\"glyphicon glyphicon-chevron-right\"></span></label>');\n $('#slider3 a').html('<label><span class=\"glyphicon glyphicon-chevron-left\"></span> '+$artistic+' <span class=\"glyphicon glyphicon-chevron-right\"></span></label>');\n $('#slider4 a').html('<label><span class=\"glyphicon glyphicon-chevron-left\"></span> '+$individualy+' <span class=\"glyphicon glyphicon-chevron-right\"></span></label>');\n\t }", "title": "" }, { "docid": "0f452641edfe95f28e37007fa6f742cb", "score": "0.58908856", "text": "function updateSlider()\r\n{\r\n\t// It works, but there should be a better way to implement this\r\n\tdocument.getElementById(\"completionSlider\").value = percent_complete;\r\n}", "title": "" }, { "docid": "b1bd6528613fb67ae06993f672ae19ec", "score": "0.58828765", "text": "function updateSlider() {\r\n \r\n }", "title": "" }, { "docid": "edabded2395fa6314502342b50887fac", "score": "0.58639526", "text": "function updateHandleText (slider, value, suffix = '') {\n var children;\n children = slider.getElementsByClassName('noUi-handle');\n children[0].dataset.value = value + suffix;\n return value;\n }", "title": "" }, { "docid": "8e2f8b836b03a717c41f82f52cbf30d6", "score": "0.5852924", "text": "function DiminuerBarreViesEnnemi () {\n\trestantEnnemi--;\n\tEnnemiSlider.value = restantEnnemi;\n}", "title": "" }, { "docid": "9f96921950688e52f4b0aadcda370ed7", "score": "0.5852024", "text": "function buildSlider_(params) {\n\t\tmin = 0.0;\n\t\tmax = 1;\n\t\tvalue = 1;\n\t\t\n\t\tonchangeEvent = throttle(\n\t\t\tfunction(newVal){\n\t\t\t\tvar selItem = selectionBox_.get(\"item\") || selectionBox_.store.query({name: selectionBox_.get(\"value\")})[0];\n\t\t\t\tDojoArray.forEach(checkBoxPanes_[selItem.id].getChildren(),function(btn){\n\t\t\t\t\tif(btn.controlType === OPACITY_BTN) {\n\t\t\t\t\t\tbtn.set(\"disabled\",((newVal <= 0.5) || !btn.checkControl.checked));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif(selItem && selItem.opaque) {\n\t\t\t\t\tDojoArray.forEach(opacityButtons_,function(btn){\n\t\t\t\t\t\tbtn.set(\"disabled\",(newVal <= 0.5));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\trequire([\"controllers/ActionCollection\"],function(ActionCollection){\n\t\t\t\t\tActionCollection[OVERLAY_ACTION](buildOverlayObject_());\n\t\t\t\t});\n\t\t\t},20);\n\t\t\n\t\tvar region = (params && params.region) ? params.region : DEFAULT_REGION;\t\t\t\n\t\t\n\t\tif(!sliderPane_) {\n\t\t\tsliderPane_ = new ContentPane({\n\t\t\t\tid: \"intensity_slider_pane\",\n\t\t\t\tregion: region\n\t\t\t});\n\t\t}\n\t\t\n\t\tsliderNodeId = \"slider_\" + utils.makeId();\n\t\t\t\t\t\n\t\tvar sliderNode = domConstruct.create(\"div\",{id: sliderNodeId},sliderPane_.domNode,\"first\");\n\t\t\t\t\t\n\t\tvar rulerNode = domConstruct.create(\"div\",{},sliderNode,\"first\");\n\t\tsliderRuler = new HRuler({\n\t \tcontainer: \"bottomDecoration\",\n\t \tcount: 2,\n\t \truleStyle: \"height: 5px;\"\n\t\t},rulerNode);\n\t\t\n\t var rulerValuesNode = domConstruct.create(\"div\",{},sliderNode,\"last\");\n\t sliderValues = new HRulerLabels({\n\t \tcontainer: \"bottomDecoration\",\n\t \tlabels: [\"min\",\"max\"],\n\t \tstyle: \"height: 10px; font-size: 0.6em;\"\n\t },rulerValuesNode);\n\t \t \n\t mainPane_.addChild(sliderPane_);\n\t \n\t domConstruct.create(\"span\",{id: \"intensity_slider_label\",innerHTML: \"Intensity\"},sliderPane_.domNode,\"first\");\n\t}", "title": "" }, { "docid": "990e1e19ea7f93647c7bcbce377ca078", "score": "0.5841232", "text": "function setSlider() {\n $( \"#slider\" ).slider({\n range: \"min\",\n value: time,\n min: today.time,\n max: today.time + 86400,\n slide: function( event, ui ) {\n $( \"#amount\" ).val( ui.value );\n time = $( \"#slider\" ).slider( \"value\" );\n setDaylight();\n returnWeatherFor();\n }\n });\n //change time value displayed\n $( \"#amount\" ).val( $( \"#slider\" ).slider( \"value\" ) );\n}", "title": "" }, { "docid": "cfe237fe969bece3a323ef9c47e7ba6e", "score": "0.5837271", "text": "function Slider (args) {\n\n var args = args || {};\n this.id = args.id || 'slider-' + Math.random().toString().substring(2);\n this.width = args.width || 400;\n this.callback = args.callback || false;\n this.label = args.label || false;\n this.min = args.min || 0;\n this.max = args.max || 100;\n this.val = args.value || 0;\n this.step = args.step || 0.1;\n this.css = args.css || '';\n this.labelCSS = args.labelCSS || '';\n this.autoAdd = (typeof args.autoAdd === 'undefined') ? true : args.autoAdd;\n this.slider = false;\n this.showValue = args.showValue || false;\n this.valueUnits = args.valueUnits || '';\n this.roundDisplayValue = args.roundDisplayValue || false;\n\n\n this.add = function () {\n\n document.write(this.html());\n this.slider = document.getElementById(this.id);\n\n if ($('#Slider-style').length == 0) {\n var html = '<style id=\"Slider-style\">';\n html += '.widget-slider { -webkit-appearance: none; margin: 0px; width: 100%; }';\n html += '.widget-slider:focus { outline: none; }';\n html += '.widget-slider::-webkit-slider-thumb { -webkit-appearance:none;width:18px;height:18px;background:#666666;border:none;cursor:pointer; }';\n html += '.widget-slider::-webkit-slider-runnable-track { width: 100%; height: 18px; cursor: pointer; background: #e2e2e2; }';\n html += '.widget-slider::-ms-track { width: 100%; cursor: pointer; background: transparent; border: none; border-color: transparent; color: transparent; }';\n html += '.widget-slider::-ms-thumb { height: 18px; width: 18px; background: #3e4899; border: none; cursor: pointer; }';\n html += '.widget-slider::-ms-track { width: 100%; height: 18px; cursor: pointer; background: #e2e2e2; }';\n html += '.widget-slider::-ms-fill-lower { background: transparent; }';\n html += '.widget-slider::-moz-range-thumb { height: 18px; width: 18px; background: #3e4899; cursor: pointer; border-radius: 0px; border: none; }';\n html += '.widget-slider::-moz-range-track { width: 100%; height: 18px; cursor: pointer; background: #e2e2e2; }';\n html += '</style>';\n document.write(html);\n }\n\n //add events\n var myThis = this;\n this.slider.addEventListener('input', function () { myThis.update(this.value); });\n this.slider.addEventListener('change', function () { myThis.update(this.value); });\n\n }\n\n\n this.update = function (v) {\n if (this.callback) { eval(this.callback + '(' + v + ')'); }\n if (this.showValue) { this.displayValue(v); }\n }\n\n\n this.displayValue = function (v) {\n if (this.roundDisplayValue) { v = this.round(v, this.roundDisplayValue); }\n var h = v;\n if (this.valueUnits) { h += this.valueUnits; }\n $('#' + this.id + '-value').html(h);\n }\n\n\n this.html = function () {\n\n var h = '';\n\n h += '<div style=\"margin: 4px auto; width:' + this.width + 'px; ';\n if (this.label || this.showValue) { h += 'background: #fcfcfc; border: 1px solid #e2e2e2;'; }\n h += this.css + '\">';\n\n h += '<input type=\"range\" id=\"' + this.id + '\" class=\"widget-slider\" ';\n h += 'style=\"width:' + this.width + 'px;\" ';\n h += 'min=\"' + this.min + '\" ';\n h += 'max=\"' + this.max + '\" ';\n h += 'value=\"' + this.val + '\" ';\n h += 'step=\"' + this.step + '\" ';\n h += ' />';\n\n if (this.label || this.showValue) {\n h += '<div style=\"font-family:\\'Arial\\';font-size:12px; font-weight:bold; text-align:left; color:#999999; padding-left:4px;' + this.labelCSS + '\">';\n if (this.label) { h += this.label; }\n if (this.label && this.showValue) { h += ' : '; }\n if (this.showValue) { h += '<span id=\"' + this.id + '-value\">' + this.val + this.valueUnits + '</span>'; }\n h += '</div>';\n }\n\n h += '</div>';\n\n return h;\n\n }\n\n\n this.round = function (num, nearest) {\n \tvar factor = 1 / nearest;\n \tvar result = Math.round(num * factor) / factor;\n \treturn result;\n }\n\n\n this.set = function (v) {\n $('#' + this.id).val(v);\n if (this.showValue) { this.displayValue(v); }\n eval(this.callback + '(' + v + ');');\n }\n\n\n if (this.autoAdd) { this.add(); }\n\n\n}", "title": "" }, { "docid": "ed6cadb8d541ac8c5728d111eb6b8c8c", "score": "0.58286124", "text": "function updateNum() {\n nLectura.textContent = Number(nSlider.value);\n n = nSlider.value;\n}", "title": "" }, { "docid": "78dcf1fde0b20f0faa174e438b1390d6", "score": "0.58255976", "text": "function sliderChange(val) {\n document.getElementById('output').innerHTML = val;\n}", "title": "" }, { "docid": "cce978bc296f5e2c6a608312f94a9614", "score": "0.5811958", "text": "function slider(as) {\n var width = as.width || 200;\n var height = as.height || 4;\n var radius = 8;\n var maxLineWidth = width - 2 * radius;\n\n function calcLeftWidth(v) {\n var w = (width * v / 100) - radius;\n return (w >= 0 ? (w >= maxLineWidth ? maxLineWidth : w) : 0) + 'px'; \n }\n\n function calcRightWidth(v) {\n var w = (width * (100 - v) / 100) - radius;\n return (w >= 0 ? (w >= maxLineWidth ? maxLineWidth : w) : 0) + 'px'; \n }\n\n var val = as.value;\n var mouseDown = false;\n\n function onMouseDown(evt) {\n mouseDown = true;\n onMouseMove(evt);\n }\n\n function onMouseMove(evt) {\n if (mouseDown) {\n // First, track down the element that we attached the event handler to\n var e = evt.target;\n while (e && !e.dataset.slider) {\n e = e.parentNode;\n }\n\n if (e) {\n var divOffset = evt.pageX - getPageX(e);\n\n if (divOffset > 0 && divOffset < width) {\n var v = divOffset / width * 100;\n as.onChange({target: {value: v}});\n //val.set(divOffset / width * 100);\n } else {\n console.error('onMouseDown: event out of bounds: ', divOffset, width);\n }\n } else {\n console.error('onMouseDown: expected parent node to be a DIV element', evt.target);\n }\n }\n }\n\n function onMouseUp(evt) {\n if (evt.target.dataset.slider) {\n mouseDown = false;\n }\n }\n\n // Create an observable 'leftWidth' that holds the value returned by calcLeftWidth any time 'val' changes.\n var leftWidth = Observable.thunk([val], calcLeftWidth);\n var rightWidth = Observable.thunk([val], calcRightWidth);\n\n var lineMarginTop = as.marginTop + radius - height / 2;\n\n var lines = Layout.hug([\n Layout.pillow(radius, 1),\n line({width: leftWidth, height: height, marginTop: lineMarginTop, marginBottom: lineMarginTop, color: as.color}),\n line({width: rightWidth, height: height, marginTop: lineMarginTop, marginBottom: lineMarginTop, color: Colors.gray}),\n Layout.pillow(radius, 1)\n ]);\n\n var circle = Shapes.circle({left: leftWidth, radius: radius, color: as.color, 'top': as.marginTop + 'px'});\n\n var handlers = {mousedown: onMouseDown, mousemove: onMouseMove, mouseup: onMouseUp, mouseout: onMouseUp};\n return Tag.tag({\n name: 'div',\n attributes: {'data-slider': true},\n style: {width: width + 'px'},\n contents: [lines, circle],\n handlers: handlers\n });\n }", "title": "" }, { "docid": "c433d6537e77f127b5039aaecf4806a1", "score": "0.5805169", "text": "function setSliderValue(newValue) {\n\t\t\t\tcurSlider.val(newValue).slider('refresh');\n\t\t\t}", "title": "" }, { "docid": "2165f2d85368f759187268e38ea13ea2", "score": "0.57948405", "text": "function updateValues() {\n document.querySelector('#two').value = document.getElementById(\"ab-max-pris\").value\n document.querySelector('#one').value=document.getElementById('ab-min-pris').value\n} // Fiks slider for firefox ! ! ", "title": "" }, { "docid": "fbb6631452e05493575c9801fa61b78b", "score": "0.57895064", "text": "get range()\n {\n return this._elSize - this._sliderSize;\n }", "title": "" }, { "docid": "ee19af203a389562f18d648ac2a2af4f", "score": "0.5789428", "text": "prevSlide() {\n if (this.value > 0) {\n this.setValue(this.value - 1);\n } else if (this.value == 0) {\n this.setValue(9);\n } else {\n console.log(\"err: out of range\");\n }\n }", "title": "" }, { "docid": "c3f3e42d114f6f8edf7a7723a8bd55d4", "score": "0.57871413", "text": "function createSlider() {\n noUiSlider.create(slider, {\n start\t\t\t\t: options.start,\n connect\t\t\t : options.connect,\n orientation\t\t: options.orientation,\n step\t\t\t : options.step,\n direction\t\t : options.direction,\n tooltips\t\t : options.tooltips,\n animate\t\t\t : options.animate,\n animationDuration\t: options.animationDuration,\n range\t\t\t : {\n 'min' \t: options.min,\n 'max' : options.max\n },\n format\t: wNumb({\n decimals\t \t : options.decimals,\n separator \t : options.separator,\n thousand\t : options.thousand,\n prefix\t\t \t: options.prefix,\n suffix\t\t \t: options.suffix,\n negative\t : options.negative,\n }),\n pips\t: {\n mode\t: 'range', //range, steps\n density\t: options.pipsDensity,\n format\t: wNumb({\n decimals\t \t : options.decimals,\n separator \t : options.separator,\n thousand\t : options.thousand,\n prefix\t\t \t: options.prefix,\n suffix\t\t \t: options.suffix,\n negative\t : options.negative,\n })\n }\n });\n}", "title": "" }, { "docid": "d940a5d4d247cbda58343d547d0aafbf", "score": "0.57834524", "text": "onSliderChange(e) {\n var slider = e.target,\n axis = slider.getAttribute('data-axis'),\n vPart = slider.getAttribute('data-vPart'),\n value = slider.value;\n\n slider.nextSibling.textContent = vPart + ': ' + value;\n gShaderToy['mMouse' + axis] = value;\n gShaderToy.mForceFrame = true;\n setTimeout(this.onSliderBlur, 20);\n }", "title": "" }, { "docid": "5cdf4656155d7b6f14fffd3ccbf9a352", "score": "0.5779383", "text": "function updateRangeFromUI () {\n var uirangeL = parseFloat(slider.style(\"left\"));\n var uirangeW = parseFloat(slider.style(\"width\"));\n var conW = sliderBox.node().clientWidth; //parseFloat(container.style(\"width\"));\n var slope = (conW - minWidth) / (rangeMax - rangeMin);\n var rangeW = (uirangeW - minWidth) / slope;\n if (conW == uirangeW) {\n var uislope = 0;\n } else {\n var uislope = (rangeMax - rangeMin - rangeW) / (conW - uirangeW);\n }\n var rangeL = rangeMin + uislope * uirangeL;\n sliderRange.begin = Math.round(rangeL);\n sliderRange.end = Math.round(rangeL + rangeW);\n\n //Fire change listeners\n changeListeners.forEach(function (callback) {\n callback({begin: sliderRange.begin, end: sliderRange.end});\n });\n }", "title": "" }, { "docid": "cfef9341b60d6961731889a72ca4c9e3", "score": "0.5752758", "text": "function speedVal() {\n const speedCount = document.querySelector('#slider').value;\n const speedDest = document.querySelector('#speed');\n speedDest.innerHTML = speedCount;\n }", "title": "" }, { "docid": "99e8345977ee5bf420fc71423440dfb3", "score": "0.57422394", "text": "function showValue(changedValue, rangeLabel, citizen, sliderID)\r\n{\r\n var values = [document.getElementById(\"newspeak\"), document.getElementById(\"fear\"), \r\n document.getElementById(\"unity\"), document.getElementById(\"education\"), \r\n document.getElementById(\"needs\"), document.getElementById(\"past\"), document.getElementById(\"monitor\")];\r\n\r\n var numberValues = [];\r\n for(x = 0; x < values.length; x++) {\r\n numberValues.push(values[x].innerHTML);\r\n }\r\n\r\n for(x = 0; x < numberValues.length; x++) {\r\n if(numberValues[x] == \"very low\") {\r\n numberValues[x] = 1;\r\n } else if(numberValues[x] == \"low\") {\r\n numberValues[x] = 2;\r\n } else if(numberValues[x] == \"medium\") {\r\n numberValues[x] = 3;\r\n } else if(numberValues[x] == \"high\") {\r\n numberValues[x] = 4;\r\n } else if(numberValues[x] == \"very high\") {\r\n numberValues[x] = 5;\r\n }\r\n }\r\n\r\n //Calculate total values of all sliders(counts changedValue)\r\n totalValue = 0;\r\n for (i = 0; i < values.length; i++) { \r\n totalValue += parseInt(values[i].innerHTML);\r\n }\r\n\r\n if(totalValue > resources) {\r\n maxValue = totalValue-resources;\r\n //Change value of slider based on the fact that\r\n //changedValue should be decreased by how much larger totalValue is in comparrison to resources\r\n changedValue -= maxValue;\r\n\r\n document.getElementById(rangeLabel).innerHTML= changedValue;\r\n document.getElementById(citizen).setAttribute(\"value\", changedValue);\r\n\r\n document.getElementById(citizen).stepDown(maxValue);\r\n totalValue -= maxValue;\r\n }\r\n \r\n //Change value of slider\r\n if(changedValue == 1) {\r\n document.getElementById(rangeLabel).innerHTML= \"very low\";\r\n } else if(changedValue == 2) {\r\n document.getElementById(rangeLabel).innerHTML= \"low\";\r\n } else if(changedValue == 3) {\r\n document.getElementById(rangeLabel).innerHTML= \"medium\";\r\n } else if(changedValue == 4) {\r\n document.getElementById(rangeLabel).innerHTML= \"high\";\r\n } else if(changedValue == 5) {\r\n document.getElementById(rangeLabel).innerHTML= \"very high\";\r\n }\r\n \r\n calculateControl(ranges[sliderID], changedValue, numberValues[sliderID]);\r\n\r\n if(isAllInRange(ranges, values)) { //possible Values, value of each slider\r\n setNextEvent();\r\n\t myTimer();\r\n\r\n placeholder +=1; // Close enough\r\n controlDecayPercent = (100 * Math.exp(-placeholder / 10)) / 50;\r\n if(control <= 7) {\r\n } else {\r\n // population -= population/control*1.1; \r\n }\r\n } else {\r\n \r\n } \r\n document.getElementById(\"control\").innerHTML = control + \"%\";\r\n document.getElementById(\"pop\").innerHTML = population;\r\n}", "title": "" }, { "docid": "7312a60b20bc229761578798d16b257c", "score": "0.57420796", "text": "function resetSlider(slider, text, value) {\n slider.val(value);\n text.html(value);\n }", "title": "" }, { "docid": "2977e29cf27db3436b239769075c360c", "score": "0.57341206", "text": "function getVals() {\n // Get slider values\n let parent = this.parentNode;\n let slides = parent.getElementsByTagName(\"input\");\n let slide1 = parseFloat(slides[0].value);\n let slide2 = parseFloat(slides[1].value);\n\n if (slide1 > slide2) {\n let tmp = slide2;\n slide2 = slide1;\n slide1 = tmp;\n }\n let minValue = document.querySelector(\".min\");\n let maxValue = document.querySelector(\".max\");\n minValue.innerText = `$${slide1}`;\n maxValue.innerText = `$${slide2}`;\n\n maxMinPrice.from = slide1;\n maxMinPrice.to = slide2;\n}", "title": "" }, { "docid": "e1c5ae7a6fcde33e3b7176c71b0bf024", "score": "0.57255054", "text": "function sliderInit(){\n\n const valueMin = document.getElementById(\"ab-min-value\")\n const valueMax = document.getElementById(\"ab-max-value\")\n\n const sliderMin = document.getElementById(\"ab-min-pris\")\n const sliderMax = document.getElementById(\"ab-max-pris\")\n\n sliderMax.oninput = function () {\n let lowerVal = parseInt(sliderMin.value);\n let upperVal = parseInt(sliderMax.value);\n \n if (upperVal < lowerVal + 75) {\n sliderMin.value = upperVal - 75;\n if (lowerVal == sliderMin.min) {\n sliderMax.value = 75;\n }\n }\n updateValues()\n \n };\n \n sliderMin.oninput = function () {\n let lowerVal = parseInt(sliderMin.value);\n let upperVal = parseInt(sliderMax.value);\n if (lowerVal > upperVal - 75) {\n sliderMax.value = lowerVal + 75;\n if (upperVal == sliderMax.max) {\n sliderMin.value = parseInt(sliderMax.max) - 75;\n }\n }\n updateValues()\n }; \n}", "title": "" }, { "docid": "1c42502fcf2f3c846ece2247ece245c3", "score": "0.57248074", "text": "function getLengthfromSlider() {\n var length = slider.value;\n console.log(\"slider value = \" + length);\n\n return length;\n}", "title": "" }, { "docid": "42a04fb808a69a07115fe654d2c0625d", "score": "0.57214516", "text": "function getVals(){\n // Get slider values\n var parent = this.parentNode;\n var slides = parent.getElementsByTagName(\"input\");\n var slide1 = parseFloat( slides[0].value );\n var slide2 = parseFloat( slides[1].value );\n // Neither slider will clip the other, so make sure we determine which is larger\n if( slide1 > slide2 ){ var tmp = slide2; slide2 = slide1; slide1 = tmp; }\n \n var displayElement = parent.getElementsByClassName(\"rangeValues\")[0];\n displayElement.innerHTML = slide1 + \" - \" + slide2\n svg.selectAll(\"*\").remove()\n svg.selectAll(\"*\").transition().duration(3000)\n draw(slide1,slide2,ratings);\n // filtering\n // data = data.filter(function(d){return d.price > slide1;})\n // data = data.filter(function(d){return d.price < slide2;})\n max_price = slide2\n min_price = slide1\n\n \n}", "title": "" }, { "docid": "8d9fa64986476c63ba9265acd7028623", "score": "0.57202435", "text": "function setDefaultSliderVals(sliderMax,sliderVal,animSlVal,speedSlVal){\n slider.max = sliderMax;\n slider.value = sliderVal;\n ouputSlVal.innerHTML = sliderVal;\n animSlider.value = animSlVal;\n outputAnimVal.innerHTML = animSlVal;\n speedSlider.value = speedSlVal;\n outputSpeedVal.innerHTML = speedSlVal;\n}", "title": "" }, { "docid": "b40ebbe0233bf9481320bff87d1d7f42", "score": "0.57187545", "text": "function detailEnsureValue() {\n\tif(!detailMouseDown) {\n\t\tdocument.getElementById('zoom-slider').value = detailCurValue * 100;\n\t}\n\telse {\n\t\t// Since IE treats onchange like oninput\n\t\tdetailPreview();\n\t}\n}", "title": "" }, { "docid": "21101e7629482d8c5715de1bc35061c0", "score": "0.5716234", "text": "function updateRate()\n{\n var rateval = document.getElementById('rate').value;\n //Console log to debug slider.\n console.log(rateval);\n document.getElementById(\"rate_val\").innerText=rateval;\n}", "title": "" }, { "docid": "cc97734861627398fb976cb1d0a47b50", "score": "0.5706241", "text": "function setValue(input, value) {\n input.value = value;\n\n // Check whether it is variable-axes input\n if (input.classList.contains(\"var\")) {\n vibrate(3);\n let axes = input.getAttribute(\"data-axes\");\n let max = input.getAttribute(\"max\");\n $(\".val\", input.closest(\".var-axes-set\")).innerHTML =\n max > 1 ? parseInt(value) : parseFloat(value).toFixed(2);\n testArea.style.setProperty(`--${axes}`, value);\n syncRangeInput(input);\n\n // Reset the named-variant value\n if ($(\".named-variation select\") && arguments.length < 3)\n $(\".named-variation select\").value = \"\";\n\n return;\n }\n\n let type = input.getAttribute(\"type\");\n let prop = input.getAttribute(\"data-id\");\n\n if (type === \"range\") {\n vibrate(3);\n $(`input[type=\"number\"][data-id=\"${prop}\"]`).value = value;\n syncRangeInput(input);\n }\n if (type === \"number\") {\n let rangeInput = $(`input[type=\"range\"][data-id=\"${prop}\"]`);\n rangeInput.value = value;\n syncRangeInput(rangeInput);\n }\n\n prop == \"lineHeight\"\n ? (testArea.style[prop] = value)\n : (testArea.style[prop] = `${value}px`);\n\n // Handles the custom range input functionality\n // ie. sets the progress width equal to range value\n function syncRangeInput(input) {\n let slider = input.closest(\".slider\");\n let progress = $(\".progress\", slider);\n let min = +input.getAttribute(\"min\");\n let max = +input.getAttribute(\"max\");\n let value = +input.value - min;\n let percent = (value * 100) / (max - min);\n progress.style.width = `${percent}%`;\n }\n }", "title": "" }, { "docid": "ba9efa0cc9172ebb93630ac692fe27a7", "score": "0.5703561", "text": "function update(slider, val) {\n //changed. Now, directly take value from ui.value. if not set (initial, will use current value.)\n var $amount = slider == 1 ? val : $(\"#amount\").val();\n var $duration = slider == 2 ? val : $(\"#duration\").val();\n $(\"#amount\").val($amount);\n $(\"#amount-label\").text($amount);\n formData['estimated_amount'] = $amount;\n $('#slider a').html('<label><span class=\"glyphicon glyphicon-chevron-left\"></span> ' + $amount + ' <span class=\"glyphicon glyphicon-chevron-right\"></span></label>');\n }", "title": "" }, { "docid": "026569c407b836cb28fabef21dda8671", "score": "0.57033163", "text": "function getInstallmentsValue() \n {\n return (parseInt(sliderAmount.noUiSlider.get()) / parseInt(sliderMonths.noUiSlider.get()) ).toFixed(0);\n }", "title": "" } ]
9bd0e31ee1ec05f224aa698a88531726
Must force callback to be called on nextTick, so that we don't emit 'drain' before the write() consumer gets the 'false' return value, and has a chance to attach a 'drain' listener.
[ { "docid": "f2b2188d89bf563db1738c7ea23ec3ea", "score": "0.0", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}", "title": "" } ]
[ { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "97108fee10d3698f58fc9e1d41fb0712", "score": "0.68402886", "text": "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "d0cc638fc49d2afef7b9523d0f221938", "score": "0.68144083", "text": "onDrain() {}", "title": "" }, { "docid": "669a0c0fe7cdd0d4945f5a6bebfd1aea", "score": "0.68063843", "text": "function onwriteDrain(stream,state){if(state.length === 0 && state.needDrain){state.needDrain = false;stream.emit('drain');}} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "560c692167c0a67284c8234a1de915d8", "score": "0.6796396", "text": "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, this.writeBuffer.length === 0 ? this.emitReserved(\"drain\") : this.flush();\n }", "title": "" }, { "docid": "b28cd51e64c0049b8e18555d16f16b33", "score": "0.6765108", "text": "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "title": "" }, { "docid": "b28cd51e64c0049b8e18555d16f16b33", "score": "0.6765108", "text": "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "title": "" }, { "docid": "b28cd51e64c0049b8e18555d16f16b33", "score": "0.6765108", "text": "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "title": "" }, { "docid": "b28cd51e64c0049b8e18555d16f16b33", "score": "0.6765108", "text": "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "title": "" }, { "docid": "9059b2d85f9d19996966fa2645c73fd4", "score": "0.6741953", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit(\"drain\");\n }\n } // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "e5376e1c4c031ba5d6ca0d5e5dd29944", "score": "0.67279136", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n } // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "0660589de9014b20b4e14ce556b4f261", "score": "0.6720488", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "42852f7e45623996283fe9c14c5b272d", "score": "0.66544706", "text": "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }", "title": "" }, { "docid": "575f4def0c4f810b8e284e9c52c56579", "score": "0.66477203", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "575f4def0c4f810b8e284e9c52c56579", "score": "0.66477203", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "2a5455c216e9125e527b0ec9c299d1ea", "score": "0.66352326", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n } // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "2a5455c216e9125e527b0ec9c299d1ea", "score": "0.66352326", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n } // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "5610e8b79fa8411f30cb55960753b6d8", "score": "0.6619509", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "1078c6bc80c3498aa1f9161a6e12a191", "score": "0.66070485", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "f015276f6fdf94bc339d14828af3cec1", "score": "0.6562401", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "144fb0e73716265de80e6a094b5f1e13", "score": "0.6558284", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit(\"drain\");\n }\n }", "title": "" }, { "docid": "144fb0e73716265de80e6a094b5f1e13", "score": "0.6558284", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit(\"drain\");\n }\n }", "title": "" }, { "docid": "a7a43f69c10398d8b83737d35686c843", "score": "0.65554756", "text": "function onwriteDrain(stream, state) {\r\n\t\t\t\tif (state.length === 0 && state.needDrain) {\r\n\t\t\t\t\tstate.needDrain = false;\r\n\t\t\t\t\tstream.emit(\"drain\");\r\n\t\t\t\t}\r\n\t\t\t} // if there's something in the buffer waiting, then process it", "title": "" }, { "docid": "ee223d6d02598d71242e684b6e0dd908", "score": "0.65494347", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "ee223d6d02598d71242e684b6e0dd908", "score": "0.65494347", "text": "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.65392685", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.65392685", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.65392685", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" }, { "docid": "295f96f4b9094c263949bcf7ec8d243c", "score": "0.65392685", "text": "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "title": "" } ]
994b1ae1b3938a854f0d1c7594d28875
Handle the keyword player controls for the player
[ { "docid": "7be2cd5e18fcfd4c2f610763bd7d5237", "score": "0.5812031", "text": "playerControls(button) {\n\t\tswitch (button) {\n\t\t\tcase \"beginning\":\n\t\t\t\tthis.player().currentTime(0);\n\t\t\t\tbreak;\n\n\t\t\tcase \"backward\":\n\t\t\t\tthis.player().currentTime(this.player().currentTime() - 15);\n\t\t\t\tbreak;\n\n\t\t\tcase \"play\":\n\t\t\t\tthis.player().play();\n\t\t\t\tbreak;\n\n\t\t\tcase \"stop\":\n\t\t\t\tthis.player().pause();\n\t\t\t\tbreak;\n\n\t\t\tcase \"forward\":\n\t\t\t\tthis.player().currentTime(this.player().currentTime() + 15);\n\t\t\t\tbreak;\n\n\t\t\tcase \"update\":\n\t\t\t\tthis.updateTimestamp();\n\t\t\t\tbreak;\n\n\t\t\tcase \"seek\":\n\t\t\t\tthis.seekMinute(parseInt($(\"#sync-minute\")[0].innerHTML));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "b400bfa389ffee3ff08f4b33be5b0ab6", "score": "0.67258704", "text": "setControls() {\n window.addEventListener(\"keydown\", e => {\n if (this.play === true) {\n this.setPlayControlsDown(e.keyCode);\n }\n else {\n this.setMenuControlsDown(e.keyCode);\n }\n });\n window.addEventListener(\"keyup\", e => {\n if (this.play === true) {\n this.setPlayControlsUp(e.keyCode);\n }\n else {\n this.setMenuControlsUp(e.keyCode);\n }\n });\n }", "title": "" }, { "docid": "b0f9df1b44e5afc6887f3bfce0fbf1f6", "score": "0.65075487", "text": "static handlePlayButton() {\r\n\t\t\r\n\t}", "title": "" }, { "docid": "63ba26700ff14831ce7fd2660f8a4109", "score": "0.6319873", "text": "function controlsEventHandler (e) {\n\te.stopPropagation();\t// Stop propagation up to the <body> event handler, which will close Casey's mouth.\n\n\t// If we're not already in the process of pausing (waiting for the head to bobble back to the center)\n\tif (player.state !== player.STATES.PAUSING) {\n\n\t\t// If we're on mobile and his mouth isn't already open, just open his mouth.\n\t\tif (audioLocked && (getCasey() === \"closed\")) {\n\t\t\tsetCasey(\"open\");\n\n\t\t// If we're not on mobile...\n\t\t} else {\n\n\t\t\t// If we're already playing, then pause the player.\n\t\t\tif (player.state === player.STATES.PLAYING) {\n\t\t\t\tplayer.state = player.STATES.PAUSING;\n\t\t\t\tsetControls(player.state);\n\n\t\t\t\tplayer.handle.pause();\n\t\t\t\tconsole.info(\"%cStopped playing track.\", \"color: indianred\");\n\n\t\t\t// Otherwise, start playing.\n\t\t\t} else {\n\t\t\t\tplayer.state = player.STATES.PLAYING;\n\t\t\t\tsetControls(player.state);\n\n\t\t\t\trandomTrack();\n\n\t\t\t\t// Automatically close Casey's mouth if we're working with a touchscreen.\n\t\t\t\tif (audioLocked) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tsetCasey(\"closed\");\n\t\t\t\t\t}, 2000);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6adfafec778bd03f0e09e7b731b56ae9", "score": "0.6260238", "text": "function manageKeyboardEvents() {\n // This listens for key presses and sends the keys to your\n // Player.handleInput() method. You don't need to modify this.\n document.addEventListener('keyup', function(e) {\n var allowedKeys = {\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down'\n };\n if (player != null)\n player.handleInput(allowedKeys[e.keyCode]);\n });\n}", "title": "" }, { "docid": "3169294a7da937ebf21bf990126168d9", "score": "0.61597663", "text": "onKeyPressed(event) {\n if (event.keyCode == 81) {\n this.toggleQPlay();\n }\n\n if (event.keyCode == 87) {\n this.toggleWPlay();\n }\n\n if (event.keyCode == 69) {\n this.toggleEPlay();\n }\n\n if (event.keyCode == 65) {\n this.toggleAPlay();\n }\n\n if (event.keyCode == 83) {\n this.toggleSPlay();\n }\n\n if (event.keyCode == 68) {\n this.toggleDPlay();\n }\n\n if (event.keyCode == 90) {\n this.toggleZPlay();\n }\n\n if (event.keyCode == 88) {\n this.toggleXPlay();\n }\n\n if (event.keyCode == 67) {\n this.toggleCPlay();\n }\n }", "title": "" }, { "docid": "a6f36a5346c69b1beebf312c7a7bb275", "score": "0.6151185", "text": "controls() {\n // Keyboard\n $(document).on('keydown', _.throttle((e) => {\n let keycode = e.keyCode\n console.log(keycode)\n\n if (!this.states.isPlayed) {\n // Start\n if (keycode == config.controls.start) {\n this.statePlayed()\n }\n }\n\n if (this.states.isPlayed && !this.states.isOvered) {\n // Pause\n if (keycode == config.controls.pause || keycode == 80) {\n this.statePause()\n }\n\n if (!this.states.isPaused) {\n // Move\n switch(keycode) {\n case config.controls.moveLeft:\n this.actionMove('left')\n break\n case config.controls.moveRight:\n this.actionMove('right')\n break\n case config.controls.bomb:\n this.actionBomb()\n }\n }\n }\n }, config.timeCtrl, {trailing: false}))\n .on('mouseover', '.action-handler', _.throttle((e) => {\n audio.effects.play('hover')\n }, config.timeBase/2, {trailing: false}))\n .on('mousedown', '.action-handler', (e) => {\n audio.effects.play('click')\n })\n .on('click', '.action-handler', (e) => {\n let $target = $(e.currentTarget)\n let action = $target.data('action')\n switch (action) {\n case 'welcome':\n this.stateWelcome()\n break\n case 'start':\n this.statePlayed()\n break\n case 'pause':\n this.statePause()\n break\n case 'fullscreen':\n if (screenfull.enabled) {\n screenfull.toggle()\n }\n break\n }\n }).on(screenfull.raw.fullscreenchange, () => {\n $('.fullscreen-toggle').toggleClass('is-fullscreen')\n })\n\n // // Dev hack\n // triggerKeyboard(config.controls.start)\n\n // Gamepad\n let gp = new GamepadMicro()\n\n gp.onUpdate(_.throttle((gamepads) => {\n if (gp.gamepadConnected) {\n for(let i = 0; i < gamepads.length; i++) {\n // Buttons & dPad\n let buttons = gamepads[i].buttons\n for (let button in buttons) {\n DEBUG && console.log(button)\n switch (button) {\n case 'leftBumper':\n changeBombNumber('down')\n break\n case 'rightBumper':\n changeBombNumber('up')\n break\n case 'dPadUp':\n focusItem('up')\n break\n case 'dPadDown':\n focusItem('down')\n break\n case 'rightStick':\n case 'select':\n rightStickClick()\n break\n case 'dPadLeft':\n triggerKeyboard(config.controls.moveLeft)\n break\n case 'dPadRight':\n triggerKeyboard(config.controls.moveRight)\n break\n case 'actionSouth':\n case 'actionEast':\n case 'actionWest':\n case 'actionNorth':\n if(!this.states.isPlayed || this.states.isPaused || this.states.isOvered) {\n rightStickClick()\n } else {\n triggerKeyboard(config.controls.bomb)\n }\n break\n case 'start':\n if(!this.states.isPlayed) {\n $(document).click()\n triggerKeyboard(config.controls.start)\n } else {\n if(buttons.start.released == true) {\n triggerKeyboard(80)\n }\n }\n break\n }\n }\n\n // LeftStick\n let leftStick = gamepads[i].leftStick\n if(leftStick.x < -0.4) {\n triggerKeyboard(config.controls.moveLeft)\n } else if (leftStick.x > 0.4) {\n triggerKeyboard(config.controls.moveRight)\n }\n if(leftStick.y < -0.7) {\n focusItem('up')\n } else if (leftStick.y > 0.7) {\n focusItem('down')\n }\n }\n }\n }, config.timeCtrl * 7, {trailing: false}))\n\n // Page visibility\n visibility.change((e, state) => {\n if (this.states && this.states.isPlayed && !this.states.isOvered) {\n console.log(e, state)\n if (state == 'hidden') {\n this.loopSwitcher(false)\n } else {\n if (!this.states.isPaused) {\n this.loopSwitcher(true)\n }\n }\n } else {\n DEBUG && console.log('d[-_-]b')\n }\n })\n\n // Util\n let triggerKeyboard = function(keycode) {\n let event = $.Event('keydown')\n event.keyCode = keycode\n $(document).trigger(event)\n }\n\n let changeBombNumber = function(action) {\n let $bombInput = $('#bomb-input')\n let $activeWelcome = $('.panel-welcome.is-active')\n if ($activeWelcome.length) {\n $bombInput.focus()\n if ($bombInput.val() == '') {\n $bombInput.val(0)\n }\n if (action == 'up') {\n $bombInput.val(parseInt($bombInput.val()) + 1)\n } else {\n let value = $bombInput.val() - 1\n value = Math.max(value, 0)\n $bombInput.val(value)\n }\n }\n }\n\n let rightStickClick = function() {\n let $focusedItem = $('.is-active .is-focused')\n if ($focusedItem.length) {\n $focusedItem.trigger('click')\n }\n }\n\n let focusItem = function(direction) {\n let $activePanel, $current, firstItem, lastItem, nextItem, prevItem\n $activePanel = $('.game-panels .is-active')\n if ($activePanel.length) {\n audio.effects.play('hover')\n $current = $activePanel.find('.is-focused')\n if (direction === 'up') {\n prevItem = $current.removeClass('is-focused').prevAll('.focused-obj:eq(0)')\n lastItem = $activePanel.find('.focused-obj:last')\n if (prevItem.length > 0) {\n prevItem.addClass('is-focused').focus()\n } else {\n lastItem.addClass('is-focused').focus()\n }\n } else if (direction === 'down') {\n nextItem = $current.removeClass('is-focused').nextAll('.focused-obj:eq(0)')\n firstItem = $activePanel.find('.focused-obj:first')\n if (nextItem.length > 0) {\n nextItem.addClass('is-focused').focus()\n } else {\n firstItem.addClass('is-focused').focus()\n }\n }\n }\n }\n return this\n }", "title": "" }, { "docid": "cfb6a360372e2d5ebc1f79b988f1107e", "score": "0.6016241", "text": "handleInteraction(key) {\r\n if(game.activePhrase.checkLetter(key.textContent) === false || !game.activePhrase.phrase.includes(key.textContent)){\r\n key.classList.add('lose');\r\n game.removeLife();\r\n } if( game.activePhrase.showMatchedLetter(key.textContent) || game.activePhrase.checkLetter(key.textContent) === true || game.activePhrase.phrase.includes(key.textContent)){\r\n\r\n key.classList.add('chosen');\r\n\r\n }\r\n\r\n key.disabled = true;\r\n\r\n if(game.checkForWin()){\r\n game.gameOver(true);\r\n }\r\n }", "title": "" }, { "docid": "6e041dce8d3fce980cbb63f4e112ce46", "score": "0.60113496", "text": "movePlayerHandler() {\r\n if (this.cursorKeys.left.isDown && this.cursorKeys.right.isDown) {\r\n this.player.stop();\r\n } else if (this.cursorKeys.left.isDown) {\r\n this.player.moveLeft();\r\n } else if (this.cursorKeys.right.isDown) {\r\n this.player.moveRight();\r\n } else {\r\n this.player.stop();\r\n }\r\n\r\n }", "title": "" }, { "docid": "0f1ae5fad94ab878256fc546c4700839", "score": "0.5997225", "text": "handleKeyboardInteraction(keyPressed) {\r\n const key = keyPressed;\r\n const onscreenKeys = document.getElementsByClassName('key');\r\n let btn;\r\n for(let k of onscreenKeys) {\r\n if (k.textContent == key) {\r\n btn = k;\r\n } \r\n };\r\n if (this.activePhrase.checkLetter(key)) {\r\n btn.classList.add('chosen');\r\n this.activePhrase.showMatchedLetter(key);\r\n this.checkForWin();\r\n if (this.checkForWin()) {\r\n this.gameOver();\r\n }\r\n } else {\r\n btn.classList.add('wrong');\r\n if(btn.disabled == false) {\r\n this.removeLife();\r\n } \r\n }\r\n btn.disabled = true;\r\n }", "title": "" }, { "docid": "d2dd908b804b06b7e55c9fcc70840a06", "score": "0.59947115", "text": "handleInteraction(letter){ \n if(this.activePhrase.checkLetter(letter)){\n this.activePhrase.showMatchedLetter(letter);\n guessHit.play(); // sound effect for good guess\n for(let i = 0 ; i < qwertyKeys.length ; i++){\n if (letter == qwertyKeys[i].textContent){\n qwertyKeys[i].classList.add('chosen');\n qwertyKeys[i].disabled = 'true';\n }}\n if(this.checkForWin()){\n this.gameOver(\"win\")\n }\n }else{\n guessMiss.play() // sound effect for whiffing on your guess\n for(let i = 0 ; i < qwertyKeys.length ; i++){\n if (letter == qwertyKeys[i].textContent){\n qwertyKeys[i].classList.add('wrong');\n qwertyKeys[i].disabled = 'true';\n }}\n this.removeLife();\n }\n }", "title": "" }, { "docid": "685f89d9452d8465e6f55dfc515834bb", "score": "0.59773195", "text": "handleInteraction(keyButton) {\r\n //Disable the pressed key button\r\n keyButton.disabled = true;\r\n\r\n // check if the letter selected is in the phrase\r\n if (this.activePhrase.checkLetter(keyButton.textContent)) {\r\n keyButton.classList.add('chosen');\r\n this.activePhrase.showMatchedLetter(keyButton.textContent);\r\n\r\n // Check if checkForWin is true\r\n if (this.checkForWin()) {\r\n this.gameOver(true);\r\n }\r\n } else {\r\n keyButton.classList.add('wrong');\r\n this.removeLife();\r\n }\r\n }", "title": "" }, { "docid": "f1e9f439a78f523867c5ee05b749252a", "score": "0.5950307", "text": "function handleKeys() {\r\n \r\n if (currentlyPressedKeys[37] || currentlyPressedKeys[65]) { //make camera roll to left\r\n \tspawn_spheres = 1;\r\n }\r\n\telse if(currentlyPressedKeys[39])\r\n\t{\r\n\t\treset_spheres = 1;\r\n\t}\r\n\telse \r\n\t{\r\n\t\treset_spheres = 0;\r\n\t\tspawn_spheres = 0;\r\n\t}\r\n\t \r\n\t\r\n}", "title": "" }, { "docid": "d28a99f984b73c1640a6fa3e155e501d", "score": "0.59392756", "text": "function inactivatePlayerControls() {\n //console.log(\"Inactivating player controls.\");\n var ctrldiv = dojo.byId(config.IDs.player.ctrl_div);\n dojo.addClass(ctrldiv, config.classes.inactive);\n setMovieTitleAndDescr(\"\", \"\");\n var pauseButton = dojo.byId(config.IDs.controls.pause);\n pauseButton.innerHTML = \"Pause\";\n}", "title": "" }, { "docid": "c7852474201b6bee4c5123e7321ced3a", "score": "0.5923921", "text": "function handleKeys() {\n if (camera!=2){\n //translation handling\n if (currentlyPressedKeys[37]) {\n // Left cursor key\n xTrans -= 0.1;\n }\n if (currentlyPressedKeys[39]) {\n // Right cursor key\n xTrans += 0.1;\n }\n if (currentlyPressedKeys[38]) {\n // Up cursor key\n yTrans += 0.1;\n }\n if (currentlyPressedKeys[40]) {\n // Down cursor key\n yTrans -= 0.1;\n }\n }else{\n\n //yaw handling\n if (currentlyPressedKeys[37]) {\n // Left cursor key\n yawRate -= 0.1;\n } else if (currentlyPressedKeys[39]) {\n // Right cursor key \n yawRate += 0.1;\n } else {\n yawRate = 0;\n }\n\n //speed handling\n\n if (currentlyPressedKeys[38]) {\n // Up cursor key\n speed = 0.01;\n }else if (currentlyPressedKeys[40]) {\n // Down cursor key\n speed = -0.01;\n } else {\n speed = 0;\n }\n }\n }", "title": "" }, { "docid": "2457039b7dc0e603c051d420f9a588bb", "score": "0.5871122", "text": "function keyTyped() {\n if (key === 'a') {\n skipSong.play();\n print(\"skipSong started\");\n } else if (key === 'b') {\n skipSong.stop();\n print(\"skipSong stopped\");\n }\n}", "title": "" }, { "docid": "efb95a1036824f128298c81c1347635b", "score": "0.58691305", "text": "handleInteraction(letter){\r\n\r\n //Check if letter already pressed\r\n let keySelected;\r\n const keys = document.querySelectorAll('.key');\r\n for (let i = 0 ; i < keys.length ; i++) {\r\n if (keys[i].textContent === letter && keys[i].className.length > 3){\r\n keySelected = true;\r\n } \r\n }\r\n\r\n //Ignore key press if the letter has already been pressed\r\n if ( !keySelected ) {\r\n //Check if letter guessed by user was in the phrase\r\n const result = this.phrases[this.activePhrase].checkLetter(letter);\r\n if ( result ) {\r\n this.phrases[this.activePhrase].showMatchedLetter(letter);\r\n this.checkForWin();\r\n } else {\r\n this.removeLife();\r\n }\r\n\r\n //Find key pressed among the button keys and allocate\r\n //either the chosen or wrong class\r\n const keys = document.querySelectorAll('.key');\r\n keys.forEach(key => {\r\n if ( key.textContent === letter ) {\r\n key.className = result ? \"key chosen\" : \"key wrong\";\r\n }\r\n });\r\n\r\n \r\n if ( this.checkForWin() ) this.gameOver();\r\n\r\n }\r\n }", "title": "" }, { "docid": "895d2770b416768124418122106f7204", "score": "0.5863079", "text": "function handleEditModeControls()\n{\n if (keyhandler.isPressed(\"Escape\"))\n {\n if (mouseselectedentity != null)\n {\n game_unselectObject();\n }\n }\n\n if (keyhandler.isDown(\"Up\" )) { playercamera.moveUp (); }\n if (keyhandler.isDown(\"Down\" )) { playercamera.moveDown (); }\n if (keyhandler.isDown(\"Left\" )) { playercamera.moveLeft (); }\n if (keyhandler.isDown(\"Right\" )) { playercamera.moveRight(); }\n if (keyhandler.isDown(\"Delete\")) \n {\n if (mouseselectedentity != null)\n {\n game_deleteSelectedObject();\n }\n }\n}", "title": "" }, { "docid": "96662a6a5c933991aacb42beca2ef4f2", "score": "0.585766", "text": "function keydownEventHandler(e) {\n // key movement for player up, down, left, right\n if (e.keyCode == 87) { // W key\n playerUp = true;\n }\n if (e.keyCode == 83) { // S key\n playerDown = true;\n }\n if (e.keyCode == 65) { // A key\n playerLeft = true;\n }\n if (e.keyCode == 68) { // D key\n playerRight = true;\n }\n}", "title": "" }, { "docid": "dff81375007d788b048b382ddee0304e", "score": "0.5850844", "text": "handleInteraction(keyValue, target = null) {\n if (!this.activePhrase.checkLetter(keyValue)) {\n if (target !== null && !target.classList.contains(\"wrong\")) {\n target.classList.add(\"wrong\");\n this.removeLife();\n } else if (!document.querySelector(`.${keyValue.toUpperCase()}Key`).classList.contains(\"wrong\")) {\n document.querySelector(`.${keyValue.toUpperCase()}Key`).classList.add(\"wrong\");\n this.removeLife();\n }\n } else {\n this.activePhrase.showMatchedLetter(keyValue, target);\n this.checkForWin();\n };\n return;\n }", "title": "" }, { "docid": "9ea29b9da79d5a0563196dd957e3f23f", "score": "0.5845654", "text": "handleInput(key) {\n\t\tswitch (key) {\n\t\t\tcase \"up\":\n\t\t\t\t/*Recall that the player cannot move off screen*/\n\t\t\t\tthis.y >= 42 ? this.y = this.y - 84 : \" \";\n\t\t\t\toGame.moviments++;\n\t\t\t\tthis.update();\n\n\t\t\t\tif (audioB.paused) {\n\t\t\t\t\taudioB.play();\n\t\t\t\t}\n\t\t\t\tif (audioWalk.paused) {\n\t\t\t\t\taudioWalk.play();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"down\":\n\t\t\t\tthis.y <= 950 ? this.y = this.y + 84 : \"\";\n\t\t\t\toGame.moviments++;\n\t\t\t\tthis.update();\n\t\t\t\tif (audioWalk.paused) {\n\t\t\t\t\taudioWalk.play();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"left\":\n\t\t\t\tthis.x >= 50 ? this.x = this.x - 101 : \"\";\n\t\t\t\toGame.moviments++;\n\t\t\t\tthis.update();\n\t\t\t\tif (audioWalk.paused) {\n\t\t\t\t\taudioWalk.play();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"right\":\n\t\t\t\tthis.x <= 505 ? this.x = this.x + 101 : \"\";\n\t\t\t\toGame.moviments++;\n\t\t\t\tthis.update();\n\t\t\t\tif (audioWalk.paused) {\n\t\t\t\t\taudioWalk.play();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "32c3ad38d9f4a074b75618d7cf2a542b", "score": "0.58430403", "text": "function handleControls() {\n\n //listening to arrow keys\n document.addEventListener(\"keydown\",detectDirection);\n \n function detectDirection(event) {\n \n if(event.keyCode === 37 && direction !==\"RIGHT\" ) {\n direction = \"LEFT\";\n }else if(event.keyCode === 38 && direction !==\"DOWN\") {\n direction = \"UP\";\n }else if(event.keyCode === 39 && direction !==\"LEFT\") {\n direction = \"RIGHT\";\n }else if(event.keyCode === 40 && direction !==\"UP\") {\n direction = \"DOWN\";\n }\n }\n \n //triggered when on screen control buttons are pressed\n left.onclick = function() {\n detectDirection({keyCode:37})\n }\n top.onclick = function() {\n detectDirection({keyCode:38})\n }\n right.onclick = function() {\n detectDirection({keyCode:39})\n }\n bottom.onclick = function() {\n detectDirection({keyCode:40})\n }\n\n }", "title": "" }, { "docid": "bfb696c7f0971cfbd9fed52465993cf6", "score": "0.5838557", "text": "disablePlayingAndControl() {\n this.$player.addClass('vac-disable-play');\n // TODO - catch spacebar being hit\n // TODO - prevent scrubbing and timeline click to seek\n }", "title": "" }, { "docid": "6a613263e65487bd055ae389d3f951ea", "score": "0.582039", "text": "function keywordsEventHandler(event) {\n if($scope.timerCheckQuerySolvableByView) {\n clearInterval($scope.timerCheckQuerySolvableByView);\n }\n\n $scope.setTimerToCheckQuery();\n disableHashtagButton();\n if (config.enableLiveTweet) {\n $scope.openRightMenu();\n }\n }", "title": "" }, { "docid": "ec11e4442278b1727daddf719a53c97a", "score": "0.5818662", "text": "function keydown(evt) {\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\n\n switch (keyCode) {\n case \"A\".charCodeAt(0):\n player.motion = motionType.LEFT;\n PLAYER_DIRECTION = \"left\";\n break;\n\n case \"D\".charCodeAt(0):\n player.motion = motionType.RIGHT;\n PLAYER_DIRECTION = \"right\";\n break;\n\t\t\t\n\n // Add your code here\n case \"C\".charCodeAt(0):\n cheat_mode = true;\n document.getElementById(\"shuriken\").style.setProperty(\"visibility\", \"hidden\", null);\n document.getElementById(\"cheat\").style.setProperty(\"visibility\", \"visible\", null);\n document.getElementById(\"player\").setAttribute(\"opacity\", \"0.5\");\n\n break;\n case \"V\".charCodeAt(0):\n cheat_mode = false;\n document.getElementById(\"cheat\").style.setProperty(\"visibility\", \"hidden\", null);\n document.getElementById(\"shuriken\").style.setProperty(\"visibility\", \"visible\", null);\n document.getElementById(\"player\").setAttribute(\"opacity\", \"1\");\n break;\n \n case \"L\".charCodeAt(0):\n clearHighScoreTable();\n break;\n\t\t\t\n case \"W\".charCodeAt(0):\n if (player.isOnPlatform() || player.isOnVerticalPlatform()) {\n console.log(\"jump key\");\n player.verticalSpeed = JUMP_SPEED+4;\n }\n break;\n\t\t\n case \"H\".charCodeAt(0): // spacebar = shoot\n if(canShoot && cheat_mode == true){\n console.log(\"cheat shoot\");\n shoot_sound.play();\n shootBullet(PLAYER_DIRECTION);\n }\n\t\t\telse if (canShoot && current_bullet_amount >= 1) {\n console.log(\"normal shoot\");\n shoot_sound.play();\n shootBullet(PLAYER_DIRECTION);\n if(cheat_mode == false ){\n current_bullet_amount--;\n document.getElementById(\"shuriken\").firstChild.data = current_bullet_amount;\n }\n }\n\t\t\tbreak;\n }\n}", "title": "" }, { "docid": "21168aebdfbcd65d7fd1173a527a0c91", "score": "0.5816973", "text": "function cuesControls() {\n\n cuesTrack = trackCaption.activeCues;\n\n if (cuesTrack) {\n if (cuesTrack.length > 0) {\n if (cuesText !== cuesTrack[0].getCueAsHTML().textContent)\n cuesText = cuesTrack[0].getCueAsHTML().textContent;\n goplayLegends.innerHTML = '<span>' + cuesText + '</span>';\n } else {\n if (cuesText !== '') {\n cuesText = '';\n goplayLegends.innerHTML = '<span></span>';\n }\n }\n }\n }", "title": "" }, { "docid": "a711100a54db1f27d58853ae59dc7142", "score": "0.58140624", "text": "function runStopKeyDownEvent(){/*\n Syncs all of the play pause elements to pause.\n */_playPauseElements2.default.syncToPause();/*\n Stops the active song.\n */_core2.default.stop()}", "title": "" }, { "docid": "4a6ae56f098137319f35ddfda663c7d1", "score": "0.58107007", "text": "function keyDownHandler(e) {\n if(e.key == \" \") {\n spacePressed = true;\n car.bonusControls1(spacePressed);\n }\n else if(e.key == \"Shift\") {\n shiftPressed = true;\n car.bonusControls2(shiftPressed);\n }\n}", "title": "" }, { "docid": "a2e183b655fff634319cf3e7ff7916d8", "score": "0.5809836", "text": "keyPressed() {\n for (let i = 0; i < this.tracks.length; i++) {\n this.tracks[i].keyPressed();\n }\n }", "title": "" }, { "docid": "e5d69d418099c73c93fa09960ed67d0c", "score": "0.57899", "text": "function ATACH_KEYBOARD(){\r\n\r\nwindow.addEventListener(\"keydown\", playerControlerKeyDown , false);\r\nwindow.addEventListener(\"keyup\", playerControlerKeyUp , false);\r\n \r\nfunction playerControlerKeyDown(e) {\r\n switch(e.keyCode) {\r\n case 37:\r\n // left key pressed\r\n\t\t\t//console.log(\"CONTROL LEFT\");\r\n\t \r\n\t\t\tPLAYER.CONTROL.left = true;\r\n\t\t\tconsole.log(\"TEST2\");\r\n\r\n break;\r\n case 38:\r\n // up key pressed\r\n\t\t\t//console.log(\"CONTROL UP\");\r\n\t\t \r\n\t\t\tPLAYER.CONTROL.top = true;\r\n break;\r\n case 39:\r\n // right key pressed\r\n\t\t\t//console.log(\"CONTROL RIGHT\");\r\n\t \r\n\t\t\tPLAYER.CONTROL.right = true;\r\n break;\r\n case 40:\r\n // down key pressed\r\n\t\t\t//console.log(\"CONTROL DOWN\");\r\n\t \r\n\t\t\tPLAYER.CONTROL.down = true;\r\n break; \r\n\t\t\t\r\n } \r\n}\r\n\r\nfunction playerControlerKeyUp(e) {\r\n switch(e.keyCode) {\r\n case 37:\r\n // left key pressed\r\n\t\t\t//PLAYER.CONTROLER.MOVE_LEFT = false;\r\n\t\t\tPLAYER.CONTROL.left = false;\r\n break;\r\n case 38:\r\n // up key pressed\r\n\t\t\t//PLAYER.CONTROLER.MOVE_UP = false;\r\n\t\t\tPLAYER.CONTROL.top = false;\r\n break;\r\n case 39:\r\n // right key pressed\r\n\t\t\t//PLAYER.CONTROLER.MOVE_RIGHT = false;\r\n\t\t\tPLAYER.CONTROL.right = false;\r\n break;\r\n case 40:\r\n // down key pressed\r\n\t\t\t//PLAYER.CONTROLER.MOVE_DOWN = false;\r\n\t\t\tPLAYER.CONTROL.down = false;\r\n break; \r\n\t\t\t\r\n } \r\n}\r\n\r\n\r\n}", "title": "" }, { "docid": "d6fcf17790cb0982d7c922fdb26b4f59", "score": "0.57862145", "text": "handleInput(keyCode) {\n switch(keyCode) {\n\n // toggle through the various player sprites\n case 'home': {\n sfxPop.playIfNotMuted();\n this.spriteIndex++;\n if (this.spriteIndex >= this.spriteArray.length) {\n this.spriteIndex = 0;\n }\n this.sprite = this.spriteArray[this.spriteIndex];\n player.render();\n scoreboard.render();\n break;\n }\n\n // move player one square left\n case 'left': {\n this.col--;\n if (this.col < 0) {\n this.col = 0;\n } else {\n sfxTick.playIfNotMuted();\n }\n break;\n }\n // move player one square right\n case 'right': {\n this.col++;\n if (this.col > constants.COLS - 1) {\n this.col = constants.COLS - 1;\n } else {\n sfxTick.playIfNotMuted();\n }\n break;\n }\n // move player one square up\n case 'up': {\n this.row--;\n if (this.row <= 0) {\n this.row = 0;\n } else {\n sfxTick.playIfNotMuted();\n }\n break;\n }\n // move player one square down\n case 'down': {\n this.row++;\n if (this.row > constants.ROWS - 1) {\n this.row = constants.ROWS - 1;\n } else {\n sfxTick.playIfNotMuted();\n }\n break;\n }\n }\n }", "title": "" }, { "docid": "5f5c55ea9074e9e5d9f77ebec41fb122", "score": "0.57847095", "text": "controls() {\n document.addEventListener('keydown', event => {\n event.preventDefault();\n switch (event.keyCode) {\n case 37:\n case 65:\n if (this.x > 0) this.x -= this.width;\n break;\n case 39:\n case 68:\n if (this.x < this.width) this.x += this.width;\n break;\n\n case 38:\n case 87:\n if (this.y > this.height * 2) this.y -= this.height;\n break;\n\n case 40:\n case 83:\n if (this.y < 500 - this.height) this.y += this.height;\n break;\n case 32:\n if (this.game.playerBullets.length < 2) {\n this.shoot();\n } else console.log(`reloading!`)\n break;\n }\n });\n }", "title": "" }, { "docid": "02fc07405757bc732799fbd62fcb9a27", "score": "0.5779156", "text": "keyboardControl(){\r\n this.control = function(e){\r\n // Player can control aim and shoot only if he is active\r\n // player in current turn.\r\n if(gamemanager.thisPlayer != gamemanager.whoseTurn){\r\n return false;\r\n }\r\n\r\n let angle;\r\n switch (e.keyCode) {\r\n case 32:\r\n // Player can shoot if he there was no shots in \r\n // current turn.\r\n if(!gamemanager.isShotMade){\r\n // Player can hold shoot button to increase \r\n // shoot strength.\r\n gamemanager.shootButtonPressed = true; \r\n }\r\n break;\r\n case 38: \r\n // If current angle greater max value than set \r\n // angle to max value.\r\n if(!players[gamemanager.thisPlayer].angle.upperBound(\r\n players[gamemanager.thisPlayer].getAngle()\r\n )\r\n ){\r\n angle = players[gamemanager.thisPlayer].angle.max;\r\n } else {\r\n angle = players[gamemanager.thisPlayer].getAngle()\r\n - players[gamemanager.thisPlayer].angle.increment_sign\r\n * 0.02;\r\n }\r\n \r\n // To change this player's aim on opponent screen\r\n // we send appropriate signal.\r\n gamemanager.messageHandler.sendMessage(\r\n \"gamemsg\", \"aimchange\", {\"angle\":angle}\r\n );\r\n gamemanager.setAimPointer(gamemanager.thisPlayer, angle);\r\n break;\r\n case 40:\r\n if(gamemanager.thisPlayer != gamemanager.whoseTurn)\r\n break;\r\n // If current angle less min value than\r\n // set angle to min value.\r\n if(!players[gamemanager.thisPlayer].angle.lowerBound(\r\n players[gamemanager.thisPlayer].getAngle()\r\n )\r\n ){\r\n angle = players[gamemanager.thisPlayer].angle.min;\r\n } else\r\n angle = players[gamemanager.thisPlayer].getAngle()\r\n + players[gamemanager.thisPlayer].angle.increment_sign\r\n * 0.02;\r\n \r\n gamemanager.messageHandler.sendMessage(\r\n \"gamemsg\", \"aimchange\", {\"angle\": + angle}\r\n );\r\n gamemanager.setAimPointer(gamemanager.thisPlayer, angle);\r\n break;\r\n }\r\n };\r\n\r\n\r\n /** \r\n * When player release fire button sends signal to server.\r\n * If shootButtonPressed == false than player already have\r\n * shooted in this turn or he is not active player now.\r\n * */\r\n this.shootControl = function(e){\r\n if(e.keyCode == 32 && gamemanager.shootButtonPressed){\r\n gamemanager.shootButtonPressed = false;\r\n gamemanager.messageHandler.sendMessage(\r\n \"gamemsg\",\r\n \"shot\",\r\n {\r\n \"strength\":parseFloat(\r\n gamemanager.strength.toFixed(3)\r\n ), \r\n \"angle\":parseFloat(\r\n players[gamemanager.thisPlayer].getAngle().toFixed(3)\r\n )\r\n }\r\n );\r\n gamemanager.strength = 0;\r\n }\r\n };\r\n\r\n window.addEventListener(\"keydown\", this.control);\r\n window.addEventListener(\"keyup\", this.shootControl);\r\n }", "title": "" }, { "docid": "31ae7bb253ca20359c083e5a159563c8", "score": "0.5773363", "text": "function handleKeys() {\n if (currentlyPressedKeys[74]) {\n // Page Up\n pitchRate = 0.1;\n } else if (currentlyPressedKeys[75]) {\n // Page Down\n pitchRate = -0.1;\n } else {\n pitchRate = 0;\n }\n\n if (currentlyPressedKeys[37] || currentlyPressedKeys[65]) {\n // Left cursor key or A\n pyramids[0].move(-1, 0);\n } else if (currentlyPressedKeys[39] || currentlyPressedKeys[68]) {\n // Right cursor key or D\n pyramids[0].move(1, 0);\n } \n\n if (currentlyPressedKeys[38] || currentlyPressedKeys[87]) {\n // Up cursor key or W\n pyramids[0].move(0, -1);\n } else if (currentlyPressedKeys[40] || currentlyPressedKeys[83]) {\n // Down cursor key\n pyramids[0].move(0, 1);\n } \n}", "title": "" }, { "docid": "e26eefdffecb8711fda9b496ac6ead53", "score": "0.5773101", "text": "keyPressed() {\n this.player.keyPressed();\n }", "title": "" }, { "docid": "754e9e0dc47e41d42a7994f03303043c", "score": "0.57597566", "text": "function preControls() {\n console.log(videoPrecontrol);\n console.log(audioPrecontrol);\n if (videoPrecontrol == 'false') {\n playPause();\n }\n if (audioPrecontrol == 'false') {\n muteUnmute();\n }\n}", "title": "" }, { "docid": "baf6d5c8feee9ce5d0c48eaa93c36aea", "score": "0.57564956", "text": "function keyup(evt) {\r\n // Get the key code\r\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\r\n\r\n switch (keyCode) {\r\n case \"A\".charCodeAt(0):\r\n if (player.motion == motionType.LEFT) player.motion = motionType.NONE;\r\n break;\r\n\r\n case \"D\".charCodeAt(0):\r\n if (player.motion == motionType.RIGHT) player.motion = motionType.NONE;\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "1d6661ee09727f4873f55b3018479f0a", "score": "0.5752404", "text": "function initWaveformControls(player) {\n $(\"#backward\").click(function() {\n player.skipBackward();\n });\n $(\"#togglePlay\").click(function() {\n player.playPause();\n });\n $(\"#forward\").click(function() {\n player.skipForward();\n });\n $(\"#toggleMute\").click(function() {\n player.toggleMute();\n });\n}", "title": "" }, { "docid": "b8f2ef8c8fc5862e3b028e34db965061", "score": "0.5743834", "text": "showControlsBriefly(player) {\n if (player.isVideo) {\n player.showControls();\n player.startControlsTimer();\n }\n }", "title": "" }, { "docid": "2217a0d76aa486b8fa6c9a1da56d2a7c", "score": "0.573421", "text": "function _controlListeners() {\n // IE doesn't support input event, so we fallback to change\n var inputEvent = (plyr.browser.isIE ? 'change' : 'input');\n\n // Click play/pause helper\n function togglePlay() {\n var play = _togglePlay();\n\n // Determine which buttons\n var trigger = plyr.buttons[play ? 'play' : 'pause'],\n target = plyr.buttons[play ? 'pause' : 'play'];\n\n // Get the last play button to account for the large play button\n if (target && target.length > 1) {\n target = target[target.length - 1];\n } else {\n target = target[0];\n }\n\n // Setup focus and tab focus\n if (target) {\n var hadTabFocus = _hasClass(trigger, config.classes.tabFocus);\n\n setTimeout(function() {\n target.focus();\n\n if (hadTabFocus) {\n _toggleClass(trigger, config.classes.tabFocus, false);\n _toggleClass(target, config.classes.tabFocus, true);\n }\n }, 100);\n }\n }\n\n // Get the focused element\n function getFocusElement() {\n var focused = document.activeElement;\n\n if (!focused || focused === document.body) {\n focused = null;\n } else {\n focused = document.querySelector(':focus');\n }\n\n return focused;\n }\n\n // Get the key code for an event\n function getKeyCode(event) {\n return event.keyCode ? event.keyCode : event.which;\n }\n\n // Detect tab focus\n function checkTabFocus(focused) {\n for (var button in plyr.buttons) {\n var element = plyr.buttons[button];\n\n if (_is.nodeList(element)) {\n for (var i = 0; i < element.length; i++) {\n _toggleClass(element[i], config.classes.tabFocus, (element[i] === focused));\n }\n } else {\n _toggleClass(element, config.classes.tabFocus, (element === focused));\n }\n }\n }\n\n // Keyboard shortcuts\n if (config.keyboardShorcuts.focused) {\n var last = null;\n\n // Handle global presses\n if (config.keyboardShorcuts.global) {\n _on(window, 'keydown keyup', function(event) {\n var code = getKeyCode(event),\n focused = getFocusElement(),\n allowed = [48,49,50,51,52,53,54,56,57,75,77,70,67],\n count = get().length;\n\n // Only handle global key press if there's only one player\n // and the key is in the allowed keys\n // and if the focused element is not editable (e.g. text input)\n // and any that accept key input http://webaim.org/techniques/keyboard/\n if (count === 1 && _inArray(allowed, code) && (!_is.htmlElement(focused) || !_matches(focused, config.selectors.editable))) {\n handleKey(event);\n }\n });\n }\n\n // Handle presses on focused\n _on(plyr.container, 'keydown keyup', handleKey);\n }\n\n function handleKey(event) {\n var code = getKeyCode(event),\n pressed = event.type === 'keydown',\n held = pressed && code === last;\n\n // If the event is bubbled from the media element\n // Firefox doesn't get the keycode for whatever reason\n if (!_is.number(code)) {\n return;\n }\n\n // Seek by the number keys\n function seekByKey() {\n // Get current duration\n var duration = plyr.media.duration;\n\n // Bail if we have no duration set\n if (!_is.number(duration)) {\n return;\n }\n\n // Divide the max duration into 10th's and times by the number value\n _seek((duration / 10) * (code - 48));\n }\n\n // Handle the key on keydown\n // Reset on keyup\n if (pressed) {\n // Which keycodes should we prevent default\n var preventDefault = [48,49,50,51,52,53,54,56,57,32,75,38,40,77,39,37,70,67];\n\n // If the code is found prevent default (e.g. prevent scrolling for arrows)\n if (_inArray(preventDefault, code)) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n switch(code) {\n // 0-9\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57: if (!held) { seekByKey(); } break;\n // Space and K key\n case 32:\n case 75: if (!held) { _togglePlay(); } break;\n // Arrow up\n case 38: _increaseVolume(); break;\n // Arrow down\n case 40: _decreaseVolume(); break;\n // M key\n case 77: if (!held) { _toggleMute() } break;\n // Arrow forward\n case 39: _forward(); break;\n // Arrow back\n case 37: _rewind(); break;\n // F key\n case 70: _toggleFullscreen(); break;\n // C key\n case 67: if (!held) { _toggleCaptions(); } break;\n }\n\n // Escape is handle natively when in full screen\n // So we only need to worry about non native\n if (!fullscreen.supportsFullScreen && plyr.isFullscreen && code === 27) {\n _toggleFullscreen();\n }\n\n // Store last code for next cycle\n last = code;\n } else {\n last = null;\n }\n }\n\n // Focus/tab management\n _on(window, 'keyup', function(event) {\n var code = getKeyCode(event),\n focused = getFocusElement();\n\n if (code === 9) {\n checkTabFocus(focused);\n }\n });\n _on(document.body, 'click', function() {\n _toggleClass(_getElement('.' + config.classes.tabFocus), config.classes.tabFocus, false);\n });\n for (var button in plyr.buttons) {\n var element = plyr.buttons[button];\n\n _on(element, 'blur', function() {\n _toggleClass(element, 'tab-focus', false);\n });\n }\n\n // Play\n _proxyListener(plyr.buttons.play, 'click', config.listeners.play, togglePlay);\n\n // Pause\n _proxyListener(plyr.buttons.pause, 'click', config.listeners.pause, togglePlay);\n\n // Restart\n _proxyListener(plyr.buttons.restart, 'click', config.listeners.restart, _seek);\n\n // Rewind\n _proxyListener(plyr.buttons.rewind, 'click', config.listeners.rewind, _rewind);\n\n // Fast forward\n _proxyListener(plyr.buttons.forward, 'click', config.listeners.forward, _forward);\n\n // Seek\n _proxyListener(plyr.buttons.seek, inputEvent, config.listeners.seek, _seek);\n\n // Set volume\n _proxyListener(plyr.volume.input, inputEvent, config.listeners.volume, function() {\n _setVolume(plyr.volume.input.value);\n });\n\n // Mute\n _proxyListener(plyr.buttons.mute, 'click', config.listeners.mute, _toggleMute);\n\n // Fullscreen\n _proxyListener(plyr.buttons.fullscreen, 'click', config.listeners.fullscreen, _toggleFullscreen);\n\n // Handle user exiting fullscreen by escaping etc\n if (fullscreen.supportsFullScreen) {\n _on(document, fullscreen.fullScreenEventName, _toggleFullscreen);\n }\n\n // Captions\n _proxyListener(plyr.buttons.captions, 'click', config.listeners.captions, _toggleCaptions);\n\n // Seek tooltip\n _on(plyr.progress.container, 'mouseenter mouseleave mousemove', _updateSeekTooltip);\n\n // Toggle controls visibility based on mouse movement\n if (config.hideControls) {\n // Toggle controls on mouse events and entering fullscreen\n _on(plyr.container, 'mouseenter mouseleave mousemove touchstart touchend touchcancel touchmove enterfullscreen', _toggleControls);\n\n // Watch for cursor over controls so they don't hide when trying to interact\n _on(plyr.controls, 'mouseenter mouseleave', function(event) {\n plyr.controls.hover = event.type === 'mouseenter';\n });\n\n // Watch for cursor over controls so they don't hide when trying to interact\n _on(plyr.controls, 'mousedown mouseup touchstart touchend touchcancel', function(event) {\n plyr.controls.pressed = _inArray(['mousedown', 'touchstart'], event.type);\n });\n\n // Focus in/out on controls\n _on(plyr.controls, 'focus blur', _toggleControls, true);\n }\n\n // Adjust volume on scroll\n _on(plyr.volume.input, 'wheel', function(event) {\n event.preventDefault();\n\n // Detect \"natural\" scroll - suppored on OS X Safari only\n // Other browsers on OS X will be inverted until support improves\n var inverted = event.webkitDirectionInvertedFromDevice,\n step = (config.volumeStep / 5);\n\n // Scroll down (or up on natural) to decrease\n if (event.deltaY < 0 || event.deltaX > 0) {\n if (inverted) {\n _decreaseVolume(step);\n } else {\n _increaseVolume(step);\n }\n }\n\n // Scroll up (or down on natural) to increase\n if (event.deltaY > 0 || event.deltaX < 0) {\n if (inverted) {\n _increaseVolume(step);\n } else {\n _decreaseVolume(step);\n }\n }\n });\n }", "title": "" }, { "docid": "2bc7ad21ff89f769b55474398db24712", "score": "0.5731729", "text": "function inputHandler(k){let x=Number(player[0].X);let y=Number(player[0].Y);if(k){let e;switch(k){case 87:case 38:e=[x,y-1];break;case 83:case 40:e=[x,y+1];break;case 65:case 37:e=[x-1,y];break;case 68:case 39:e=[x+1,y];break}e=regSearch(e[0],e[1]);if(typeof e!==\"undefined\"){eventHandler(e.e)}}}", "title": "" }, { "docid": "d56fd8ae96503639b90b64415cb7bbd7", "score": "0.5731461", "text": "function keyup(evt) {\n // Get the key code\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\n\n switch (keyCode) {\n case \"A\".charCodeAt(0):\n if (player.motion == motionType.LEFT) player.motion = motionType.NONE;\n break;\n\n case \"D\".charCodeAt(0):\n if (player.motion == motionType.RIGHT) player.motion = motionType.NONE;\n break;\n }\n}", "title": "" }, { "docid": "7185ef86d6e499c8392c0ea5d6bdb94e", "score": "0.5719018", "text": "function playingFieldClickHandler(e)\n{\n\n}", "title": "" }, { "docid": "076ee4a270dac32ee4647466fdd8b139", "score": "0.5709183", "text": "handleInteraction(event) {\r\n const btn = event.target;\r\n const key = event.target.textContent;\r\n btn.setAttribute('disabled', true);\r\n if (this.activePhrase.checkLetter(key)) {\r\n btn.classList.add('chosen');\r\n this.activePhrase.showMatchedLetter(key);\r\n this.checkForWin();\r\n if (this.checkForWin()) {\r\n this.gameOver();\r\n }\r\n } else {\r\n btn.classList.add('wrong');\r\n this.removeLife();\r\n }\r\n }", "title": "" }, { "docid": "11d512b5c90f83049ffc467ae0e27c96", "score": "0.570771", "text": "function handleKeyDown(event){\n //starts game when the space bar is pressed to ensure both players are ready\n if (event.which === KEY.SPACE){\n randomStart(); \n $(\"#alert\").remove();\n }\n\n //handles key-down events for left player, allows left paddle to move\n if (event.which === KEY[\"S-DOWN\"]){\n leftPaddle.speedY = 5;\n } else if (event.which === KEY[\"W-UP\"]){\n leftPaddle.speedY = -5;\n }\n\n //handles key-down events for right player, allows right paddle to move\n if (event.which === KEY.DOWN){\n rightPaddle.speedY = 5;\n } else if (event.which === KEY.UP){\n rightPaddle.speedY = -5;\n }\n }", "title": "" }, { "docid": "51a0de7de87022627b821eedc5875796", "score": "0.57046723", "text": "function playerClickHandler(){\n\n /**\n */\n var buttons=document.querySelectorAll(\".game button.keypad\");\n for(var i=0;i<buttons.length;i++){\n buttons[i].onclick=gameView.gamePadClickHandler;\n }\n\n var toggles=document.querySelectorAll(\".strict .toggle span\");\n toggles[0].onclick=gameView.toggleStrictMode;\n toggles[1].onclick=gameView.toggleStrictMode;\n}", "title": "" }, { "docid": "f4316c44052034929c5c6508211c5f4a", "score": "0.57030517", "text": "function handleKeyPress(event)\n{\n\tvar ch = getChar(event);\n cameraControl(camera, ch);\n\tswitch(ch) {\n \n case ' ':\n paused = !paused;\n break;\n \n case 'n': \n inAndOutCamera = !inAndOutCamera;\n break;\n \n case 'h':\n help = !help;\n if (help){\n document.getElementById(\"info\").innerHTML = \"<b>(Press h to hide)</b><br>DRAG TO SPIN <br><br><b>Keyboard controls</b>:<br><b>w, a, s, d</b> - move forward, left, back, right <br> <b>r, f</b> - move up, down <br> <b> I, J, K, L</b> - orbit down, right, up, left <br> <b>W</b> - decrease fov <br> <b>S</b> - increase fov <br> <b>Space</b> - pause animation <br> <b>n</b> - camera will rotate around the tree/camera will rotate<br> around the tree while moving closer/farther away.\";\n }\n else document.getElementById(\"info\").innerHTML = \"DRAG TO SPIN<br> Have your volume ON for the full experience <br> Press <b>h</b> for more information. <br><br>If the animation starts to lag, try reducing your browser window size.\";\n break;\n\tdefault:\n return;\n \n\t}\n}", "title": "" }, { "docid": "ec77efe1947b9e073fc6eff36339eb2f", "score": "0.56999576", "text": "function onkeyup(e, key, pressed) {\n switch(key) {\n case KEY.A:\n playerState.input.strafeLeft = pressed;\n e.preventDefault();\n break;\n case KEY.W:\n playerState.input.forward = pressed;\n e.preventDefault();\n break;\n case KEY.S:\n playerState.input.backward = pressed;\n e.preventDefault();\n break;\n case KEY.D:\n playerState.input.strafeRight = pressed;\n e.preventDefault();\n break;\n\n case KEY.SPACE:\n playerState.input.jump = pressed;\n e.preventDefault();\n break;\n case KEY.C:\n playerState.input.crouch = pressed;\n e.preventDefault();\n break;\n case KEY.LEFT:\n playerState.input.turnLeft = pressed;\n e.preventDefault();\n break;\n case KEY.RIGHT:\n playerState.input.turnRight = pressed;\n e.preventDefault();\n break;\n case KEY.UP:\n playerState.input.tiltForward = pressed;\n e.preventDefault();\n break;\n case KEY.DOWN:\n playerState.input.tiltBack = pressed;\n e.preventDefault();\n break;\n\n case KEY.Q:\n globalState.prevPixelShader = !globalState.prevPixelShader;\n e.preventDefault();\n break;\n case KEY.E:\n globalState.nextPixelShader = !globalState.nextPixelShader;\n e.preventDefault();\n break;\n\n case KEY.I:\n playerState.input.i = pressed;\n e.preventDefault();\n break;\n case KEY.K:\n playerState.input.k = pressed;\n e.preventDefault();\n break;\n case KEY.J:\n playerState.input.j = pressed;\n e.preventDefault();\n break;\n case KEY.L:\n playerState.input.l = pressed;\n e.preventDefault();\n break;\n case KEY.U:\n playerState.input.u = pressed;\n e.preventDefault();\n break;\n case KEY.O:\n playerState.input.o = pressed;\n e.preventDefault();\n break;\n\n }\n\n}", "title": "" }, { "docid": "c6bd68e0008cba2ce877c05b868570f9", "score": "0.569064", "text": "function setupKeyHandlers(){\n document.onkeypress=function(event){\n var c=event.key.toLowerCase();\n switch(c){\n case 'a':\n case 'b':\n case 'c':\n case 'd':\n var block=document.querySelector(\"#\" +c);\n if(!gameView.isPlayback)\n gameView._activateBlock(c);\n window.setTimeout(gameView._deactivateBlock,600,c);\n block.click();\n break;\n case ' ':\n var startButton=document.querySelector(\"#start\");\n startButton.click();\n break;\n case '?':\n case '/':\n var help=document.querySelector(\".dashboard .help\");\n help.click();\n break;\n case 'x':\n var closeButton=document.querySelector(\".info_panel .close\");\n closeButton.click();\n break;\n case 's':\n gameView.toggleStrictMode();\n break;\n }\n };\n}", "title": "" }, { "docid": "d3d55c236258d70aa2cfdaac558ac52e", "score": "0.5687423", "text": "_handleControlFromPlayer(type){\n // console.log(\"control btn clicked from playcontroller \", type)\n this.props.controlPlayFromIcon(type)\n }", "title": "" }, { "docid": "88b6373daac40780fadca577e9a70ca0", "score": "0.56861734", "text": "function keyupEventHandler(e) {\n if (e.keyCode == 87) { // W key\n playerUp = false;\n }\n if (e.keyCode == 83) { // S key\n playerDown = false;\n }\n if (e.keyCode == 65) { // A key\n playerLeft = false;\n }\n if (e.keyCode == 68) { // D key\n playerRight = false;\n }\n}", "title": "" }, { "docid": "5c4abd5d2c1d1eef2afa36cd2bc6eb80", "score": "0.56761426", "text": "handlePlayerInputs (buttonCode, value) {\n switch (buttonCode) {\n\n // Start the game !\n case Phaser.Input.Gamepad.Configs.XBOX_360.START:\n this.scene.unload();\n this.scene.scene.start('PrepareBattleScene');\n break;\n\n // Do nothing for other key\n default:\n break;\n }\n }", "title": "" }, { "docid": "d22fa7aef28e818becba971a2ac69165", "score": "0.5675883", "text": "function keydownEventHandler(e) {\n // key movement for player up, down, left, right\n if (e.keyCode == 87) { // W key\n keyUp = true;\n }\n if (e.keyCode == 83) { // S key\n keyDown = true;\n }\n if (e.keyCode == 65) { // A key\n keyLeft = true;\n }\n if (e.keyCode == 68) { // D key\n keyRight = true;\n }\n}", "title": "" }, { "docid": "201b707eeea1d882315fbf6d088dc74f", "score": "0.56737584", "text": "function control(e){ // function so that only the spacebar can make the bird jump\n if (e.keyCode === 32)\n flapSound.play();\n bird.flap()\n }", "title": "" }, { "docid": "e0ff7003d22c4960c53fbdda927c8ecd", "score": "0.5673247", "text": "function controls() \n\t{\n\t\tif(dead) { return; }\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {\n\t\t\tplayer.img.angle-= 3;\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {\n\t\t\tplayer.img.angle+= 3;\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) {\n\t\t\tif( player.speed > -5 - (speedLevel )) {\n\t\t\t\tplayer.speed -= 1;\n\t\t\t}\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.UP)) {\n\t\t\tif(player.speed < 10 + (speedLevel * 2)) {\n\t\t\tplayer.speed += 1;\n\t\t\t}\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.E)) { \n\t\t\tplayer.fire();\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.ONE)) { \n\t\t\tselectWeapon(SHOTGUN);\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.TWO)) { \n\t\t\tselectWeapon(MACHINE_GUN);\n\t\t}\n\t\t\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.THREE)) { \n\t\t\tselectWeapon(MISSILE);\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.SPACEBAR)) {\n\t\t\tplayer.speed = 0;\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.Q)) {\n\t\t\tif(!menuOpen) {\n\t\t\t\tcreateMenu();\n\t\t\t\tmenuOpen = true;\n\t\t\t}\n\t\t}\n\n\t\tif(game.input.keyboard.isDown(Phaser.Keyboard.A)) {\n\t\t\tif(menuOpen) {\n\t\t\t\tdestroyMenu();\n\t\t\t\tmenuOpen = false;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "8a20976c37a79ab97f7736e00bcf9cbf", "score": "0.56712717", "text": "setPlayControlsUp(key) {\n switch (key) {\n case Keys.Space:\n this.launchFire(Which[Which.Player]);\n break;\n case Keys.Left:\n this.clearActiveKey(key);\n break;\n case Keys.Right:\n this.clearActiveKey(key);\n break;\n }\n }", "title": "" }, { "docid": "4c67b8d661c341d703252d3d5ffb74ec", "score": "0.5671119", "text": "function keyPressed()\n{\n if (keyIsDown(LEFT_ARROW) || keyIsDown(65))\n offX += .01;\n\n if (keyIsDown(RIGHT_ARROW) || keyIsDown(68))\n offX -= .01;\n\n if (keyIsDown(UP_ARROW) || keyIsDown(87))\n offY += .01;\n\n if (keyIsDown(DOWN_ARROW) || keyIsDown(83))\n offY -= .01;\n\n if (keyCode === 49) {\n cs.setControlChannel(\"voice1change\", random(100));\n } else if (keyCode === 50) {\n cs.setControlChannel(\"voice2change\", random(100));\n } else if (keyCode === 51) {\n cs.setControlChannel(\"voice3change\", random(100));\n } else if (keyCode === 52) {\n cs.setControlChannel(\"voice4change\", random(100));\n } else if (keyCode === 53) {\n cs.setControlChannel(\"voice5change\", random(100));\n } else if (keyCode === 54) {\n cs.setControlChannel(\"voice1vol\", .2);\n } else if (keyCode === 55) {\n cs.setControlChannel(\"voice2vol\", .2);\n } else if (keyCode === 56) {\n cs.setControlChannel(\"voice3vol\", .2);\n } else if (keyCode === 57) {\n cs.setControlChannel(\"voice4vol\", .2);\n } else if (keyCode === 48) {\n cs.setControlChannel(\"voice5vol\", .2);\n }\n\n if(keyCode == 32)\n mousePressAndSpacebar();\n}", "title": "" }, { "docid": "a425abeb97294ea936bc0d395cc64c9e", "score": "0.56700706", "text": "function controls(e) {\n if(count === 0){\n if(e.keyCode === 37){\n moveLeft();\n }else if(e.keyCode === 39){\n moveRight();\n }else if(e.keyCode === 40){\n moveDown();\n }else if(e.keyCode === 38){\n rotateTetromino();\n }\n }else{\n return;\n }\n \n }", "title": "" }, { "docid": "7b27908d3f3ec6e5eef7cf4f03df9349", "score": "0.5666267", "text": "function handlePlay(){\n // console.log('play button has been clicked');\n if (myTamagotchi.happiness === 0){\n return;\n }\n if(myTamagotchi.hunger===10||myTamagotchi.happiness===10||myTamagotchi.sleepyness===10){\n return;\n }\n if(myTamagotchi.age === finalAge){\n return;\n }\n myTamagotchi.happiness--;\n updateMetric();\n bounceTime();\n}", "title": "" }, { "docid": "fe25d4f1a2132a2e0619f681e49509f8", "score": "0.56650645", "text": "function control(e) {\n // todo: remove snake class from all tiles, implement function for keyCodes\n \n }", "title": "" }, { "docid": "db88b6b426c14aa85a87667b79b0ea90", "score": "0.5661299", "text": "function handleAudioProcess(){\r\n if(document.getElementById('enregistrement').style.display == \"none\"){\r\n player.pause();\r\n }\r\n currentTime = player.currentTime;\r\n highlightCurrentText(currentTime);\r\n }", "title": "" }, { "docid": "553ba2a878b2d685d536055539ae8ebc", "score": "0.5660668", "text": "function keypressMaster(e) {\n keyHilight(e);\n letterWatch(e);\n}", "title": "" }, { "docid": "864876c3f5d6d92a2c272b7d76a83ff9", "score": "0.56583434", "text": "function handlePlayWithBuddyButton() {\n title.style.transform = \"translateY(0%)\";\n playWithBuddyButton.classList.add(\"hidden\");\n playerBoxWrapper.classList.add(\"visible\");\n startButton.classList.add(\"visible\");\n }", "title": "" }, { "docid": "132dc78a3b083949b305e28648f72e13", "score": "0.56561893", "text": "function detectKeypress(e) {\n\tif(e.keyCode == 32) { //space\n\t togglePlay();\n\t}\n else if(e.keyCode == 37) { //left\n video.currentTime += parseFloat(leftKeySkip);\n }\n else if(e.keyCode == 38) { //up\n var vol = video.volume + volumeUp;\n if(vol > 1) \n vol = 1;\n video.volume = vol;\n volumeRng.value = video.volume;\n }\n else if(e.keyCode == 39) { //right\n video.currentTime += parseFloat(rightKeySkip);\n }\n else if(e.keyCode == 40) { //down\n var vol = video.volume + volumeDown;\n if(vol < 0) \n vol = 0;\n video.volume = vol;\n volumeRng.value = video.volume;\n }\n else {\n return;\n }\n}", "title": "" }, { "docid": "5d8b8f4d9f4e97ac28a7143108dcc3a7", "score": "0.5633257", "text": "mouseActionUp(key) {\n if (this.play === true) {\n this.setPlayControlsUp(key);\n }\n else {\n this.setMenuControlsUp(key);\n }\n }", "title": "" }, { "docid": "b781b7b4508c4f279e4f5a0116776056", "score": "0.56295604", "text": "function KeyboardHandler(e)\n{\n\tif(e.which == 32) //space\n\t\tTogglePlay();\n}", "title": "" }, { "docid": "f9059359017f88dd0697db63e204d708", "score": "0.5624281", "text": "function handleKeyUp(event){\n //handes keyup events for left player, stops paddle movement when keys are not pressed\n if (event.which === KEY[\"S-DOWN\"]){\n leftPaddle.speedY = 0;\n } else if (event.which === KEY[\"W-UP\"]){\n leftPaddle.speedY = 0;\n }\n //handles keyup events for right player, stops paddle movement when keys are not pressed\n if (event.which === KEY.DOWN){\n rightPaddle.speedY = 0;\n } else if (event.which === KEY.UP){\n rightPaddle.speedY = 0;\n }\n }", "title": "" }, { "docid": "6c70bc63a91b696ed2008751adc69eb9", "score": "0.5611591", "text": "make_control_panel() {\n this.key_triggered_button(\"Pause Time\", [\"n\"], () => {\n this.paused = !this.paused;\n });\n\n this.key_triggered_button(\"Follow Fish\", [\"q\"], () => {\n if (!camera_once && tracking) {\n camera_once = true;\n }\n tracking = !tracking;\n });\n\n this.key_triggered_button(\"Treat Mode\", [\"t\"], () => {\n TREAT_MODE = !TREAT_MODE;\n });\n }", "title": "" }, { "docid": "14116d433676717d52d0cf0d91464160", "score": "0.5610082", "text": "function collectKey(player, key) {\n key.disableBody(true, true);\n\n hasKey = true;\n //keyText.setText('Key: true');\n}", "title": "" }, { "docid": "73bc8551d5babd38d4e6bc343b9541cc", "score": "0.5606678", "text": "musicControlsEnableControls() {\n\t\t// MusicControl.enableControl('skipBackward', true, { interval: 30 });\n\t\t// MusicControl.enableControl('skipForward', true, { interval: 30 });\n\t\t// MusicControl.enableControl('play', true);\n\t\t// MusicControl.enableControl('pause', true);\n\t}", "title": "" }, { "docid": "b07e34df71750745383dbadc3c13ae0a", "score": "0.5602685", "text": "function KeyDownHandler(event)\n {\n switch(event.keyCode)\n {\n case 37:\n player.Attack(true);\n break;\n case 39:\n player.Attack(false);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "f356460518e4cd13d8dac673e66b8083", "score": "0.55946267", "text": "function playGame() {\n handleKey();\n paddle.display();\n brickDisplay();\n ballControl();\n counter();\n}", "title": "" }, { "docid": "e34627929716f5bc0c00437328b997be", "score": "0.55932885", "text": "function updateControls() {\n\t\tvar disabled = (keywordsAdded.length === 0 && keywordsRemoved.length === 0);\n\t\tapplyCtrl.button(\"option\", \"disabled\", disabled);\n\t\tdiscardCtrl.button(\"option\", \"disabled\", disabled);\n\t}", "title": "" }, { "docid": "4a545fb03a8c747ae06c82cda2ece0b2", "score": "0.55925614", "text": "function processTxtCommands() {\n var playerAction = \"txtCommand \\\"\" + txtCommand.value + \"\\\"\";\n // Convert string to lower case for analysis\n var txtCommandLowcase = txtCommand.value.toLowerCase();\n switch(txtCommandLowcase) {\n case \"w\": attemptGoWest(playerAction); break;\n case \"n\": attemptGoNorth(playerAction); break;\n case \"s\": attemptGoSouth(playerAction); break;\n case \"e\": attemptGoEast(playerAction); break;\n default: parsedTxtCommands();\n }\n }", "title": "" }, { "docid": "1357cadce72fdc4ca879310d892744da", "score": "0.5591115", "text": "function mycb(event) {\n\n\tevent.preventDefault(); \n switch (event.keyCode)\n\t\t{\n\t\t\t\n case 87:\n\t\t\t{\n\t\t\tcontrols.reset();\n\t\t\tcamera.position.set(0,30,20);\n\t\t\t}\n \n }\n \n}", "title": "" }, { "docid": "1410e5a7f8b6f9998d08213e265035d6", "score": "0.5589642", "text": "function onkey(event) {\n\tevent.preventDefault();\n\tif (event.keyCode == 80) { // p (pause)\n\t\t// Toggle camera look speed on/off\n\t\t(scene.camControls.lookSpeed > 0.0) ? scene.camControls.lookSpeed = 0.0 : scene.camControls.lookSpeed = 0.2;\t\n\t}\n}", "title": "" }, { "docid": "10c8e8f42e4737331cbd8b75a1074291", "score": "0.5588379", "text": "function handleKeyDown(e)\r\n {\r\n var dXY = 10;\r\n /* Player 1 Controlls */\r\n if (e.which == W_KEY)\r\n {\r\n socket.emit('W');\r\n }\r\n if (e.which == D_KEY)\r\n {\r\n socket.emit('D');\r\n }\r\n if (e.which == A_KEY)\r\n {\r\n socket.emit('A');\r\n }\r\n if(e.which == S_KEY)\r\n {\r\n socket.emit('S');\r\n }\r\n drawCanvas();\r\n }", "title": "" }, { "docid": "51f19ae7ee451c9e01f6467cd25fbb72", "score": "0.5587799", "text": "function html5Controls() {\n var html5Selected = document.querySelector(\".player-choice--defaultHTML5\");\n var videoControls = document.querySelector(\".player__controls\");\n\n html5Selected.addEventListener(\"click\", function () {\n var video = document.querySelector(\".player\");\n\n // Hide custom controls\n videoControls.style.display = \"none\";\n document.querySelector(\".fa-cog\").style.display = \"block\";\n\n // Enable html5 defaul controls\n video.controls = true;\n video.style.borderRadius = \"0\";\n\n captionHighlight();\n var closedCaptionText = document.querySelector(\".player__closed-caption\");\n closedCaptionText.style.display = \"block\";\n\n // Reset Controls\n controlReset();\n });\n}", "title": "" }, { "docid": "13d449798a7f8c199dbeee62fe210381", "score": "0.55857784", "text": "function onKeyUp(evt) {\n if (evt.keyCode == 39) rightDown = false;\n else if (evt.keyCode == 37) leftDown = false;\n \n else if (evt.keyCode == 83) player2RightDown = false;\n else if (evt.keyCode == 65) player2LeftDown = false;\n \n if (multiPlayer)\n socket.emit('key_up', {'playerId': playerId, 'keyCode': evt.keyCode }); \n }", "title": "" }, { "docid": "be0ea75166c826d65b6186deba06cfc9", "score": "0.55836195", "text": "function winnerFunction() {\n switch (wordChoice) {\n case \"BULBASAUR\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"bulbasaur\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Bulbasaur!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"IVYSAUR\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"ivysaur\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Ivysaur!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"VENUSAUR\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"venusaur\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Vennusaur!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"CHARMANDER\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"charmander\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Charmander!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"CHARMELEON\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"charmeleon\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Charmeleon!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"CHARIZARD\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"charizard\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Charizard!\";\n audio1.volume = 0.05;\n audio1.play();\n break;\n case \"SQUIRTLE\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"squirtle\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Squirtle!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"WARTORTLE\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"wartortle\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Wartortle!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"BLASTOISE\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"blastoise\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Blastoise!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"ARTICUNO\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"articuno\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Articuno!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"ZAPDOS\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"zapdos\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Zapdos!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"MOLTRES\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"moltres\").style.visibility = \"visible\"\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught a Moltres!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"MEWTWO\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"mewtwo\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"MewTwo has caught you......\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n case \"MEW\":\n document.getElementById(\"pokemon\").style.visibility = \"hidden\";\n document.getElementById(\"mew\").style.visibility = \"visible\";\n document.getElementById(\"resultTextChange\").innerHTML = \"You caught Mew!\";\n audio1.play();\n audio1.volume = 0.05;\n break;\n }\n wins++;\n winsFunction();\n}", "title": "" }, { "docid": "2c5b18ff4bead2c3c296e14d1f305411", "score": "0.5583476", "text": "onPlay() {\n const $scope = _scope.get(this);\n const $timeout = _timeout.get(this);\n\n $timeout(() => {\n $scope.playControlClass = 'pause';\n });\n }", "title": "" }, { "docid": "df067f0148e6a98befc0478f8655775a", "score": "0.5580631", "text": "playlistKeyCodes() {\r\n function removeTransition(e) {\r\n if (e.propertyName !== 'transform') return;\r\n e.target.classList.remove('playing');\r\n }\r\n\r\n function playSound(e) {\r\n const audio = document.querySelector(`audio[data-key=\"${e.keyCode}\"]`);\r\n const key = document.querySelector(`div[data-key=\"${e.keyCode}\"]`);\r\n if (!audio) return;\r\n\r\n key.classList.add('playing');\r\n audio.currentTime = 0;\r\n audio.play();\r\n }\r\n\r\n const keys = Array.from(document.querySelectorAll('.key'));\r\n keys.forEach(key => key.addEventListener('transitionend', removeTransition));\r\n window.addEventListener('keydown', playSound);\r\n }", "title": "" }, { "docid": "3ca9bff21ab74e9c4835992f55fd1e82", "score": "0.5573829", "text": "function handleKeyDown(evt) {\n console.log(\"old left position: \", evt.currentTarget.style.left);\n console.log(\"key: \", evt.key);\n console.log(\"code: \", evt.code);\n textInputWrapper.style.transition = \"all 0.1s\";\n switch (evt.code) {\n case \"Enter\":\n console.log(\"Enter pressed: \", true);\n evt.currentTarget.style.left = \"500px\";\n audioEnter.currentTime = 0;\n audioEnter.play();\n console.log(\"new left position: \", evt.currentTarget.style.left);\n if (evt.target.getAttribute(\"id\") == `${elmId}-title`) {\n textInput.focus();\n // textInput.setSelectionRange(0, 1);\n }\n // evt.currentTarget.style.left = \"500px\";\n // } else {\n // evt.urrentTarget.style.left = \"500px\";\n // }\n break;\n case \"Backspace\":\n // if (parseFloat(evt.currentTarget.style.left.slice(0,-2)) >= 500) {\n // evt.currentTarget.style.left = \"-500px\";\n // }\n audioBackspace.currentTime = 0;\n audioBackspace.play();\n let charWidth = getCharWidth(\"a\", \"48px PT Mono\");\n evt.currentTarget.style.left = `${parseFloat(evt.currentTarget.style.left.slice(0, -2)) + charWidth}` + \"px\";\n console.log(\"new left position: \", evt.currentTarget.style.left);\n break;\n case \"Space\":\n audioSpacebar.currentTime = 0;\n audioSpacebar.play();\n break;\n default:\n if (evt.key !== \"Meta\") {\n audioChar.currentTime = 0;\n audioChar.play();\n }\n break;\n }\n }", "title": "" }, { "docid": "7031a41edffecef581ef7ec3d6c92aaf", "score": "0.5569828", "text": "function handleKeyDown(e) {\n //cross browser issues exist\n if (!e) {\n var e = window.event;\n }\n switch (e.keyCode) {\n case KEYCODE_SPACE:\n player.jumpHeld = true;\n return false;\n case KEYCODE_A:\n case KEYCODE_LEFT:\n player.leftHeld = true;\n return false;\n case KEYCODE_D:\n case KEYCODE_RIGHT:\n player.rightHeld = true;\n return false;\n case KEYCODE_W:\n case KEYCODE_UP:\n player.upHeld = true;\n return false;\n case KEYCODE_S:\n case KEYCODE_DOWN:\n player.downHeld = true;\n return false;\n //case KEYCODE_ENTER: if(canvas.onclick == handleClick){ handleClick(); }return false;\n }\n}", "title": "" }, { "docid": "3450d27ee6bcd352bb55ddb8f4d89994", "score": "0.5569432", "text": "function GRT_key(event) {\n element = event.target;\n elementName = element.nodeName.toLowerCase();\n if (elementName == \"input\") {\n typing = (element.type == \"text\" || element.type == \"password\");\n } else {\n typing = (elementName == \"textarea\");\n }\n if (typing) return true;\n if (String.fromCharCode(event.which)==\"Z\" && !event.ctrlKey && !event.altKey && !event.metaKey) {\n if (GM_config.get(\"reverser\")) { $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-right\",\"0px\" ); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-left\",\"0px\" ); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"width\",\"100%\" ); $(\"#lightsOut, #watch7-main-container, #yt-masthead-container, .watch7-playlist-bar-right, #watch7-playlist-tray-container, #watch7-playlist-tray, .watch7-playlist-bar-left, #watch7-playlist-tray-container\").css( \"display\",\"none\" ); }else{ \n $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-left\",\"0px\" ); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-right\",\"0px\" ); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"width\",\"100%\" ); $(\"#lightsOut, #watch7-main-container, #yt-masthead-container, .watch7-playlist-bar-right, #watch7-playlist-tray-container, #watch7-playlist-tray, .watch7-playlist-bar-left, #watch7-playlist-tray-container\").css( \"display\",\"none\" );\n }\n try {\n event.preventDefault();\n } catch (e) {\n }\n return false;\n }\n if (String.fromCharCode(event.which)==\"X\" && !event.ctrlKey && !event.altKey && !event.metaKey) {\n if (GM_config.get(\"reverser\")) { $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"-moz-calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"-webkit-calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"-o-calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-right\",\"311px\" ); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-left\",\"1px\" ); $(\"#watch7-main-container, #yt-masthead-container, .watch7-playlist-bar-right, #watch7-playlist-tray-container, #watch7-playlist-tray, .watch7-playlist-bar-left, #watch7-playlist-tray-container\").css( \"display\",\"block\" ); }else{ \n $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"-moz-calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"-webkit-calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"-o-calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css(\"width\",\"calc(100% - 312px)\"); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-left\",\"311px\" ); $(\"#player, #player-legacy, .site-left-aligned.guide-enabled #player-legacy\").css( \"padding-right\",\"1px\" ); $(\".watch7-playlist-bar-right, #watch7-playlist-tray-container, #watch7-playlist-tray, .watch7-playlist-bar-left, #watch7-playlist-tray-container, #watch7-main-container, #yt-masthead-container\").css( \"display\",\"block\" );\n }\n try {\n event.preventDefault();\n } catch (e) {\n }\n return false;\n }\n if (String.fromCharCode(event.which)==\"C\" && !event.ctrlKey && !event.altKey && !event.metaKey) {\n \n GM_config.open();\n try {\n event.preventDefault();\n } catch (e) {\n }\n return false;\n } \n }", "title": "" }, { "docid": "7d7e585651062a15b5d535b3677550d0", "score": "0.55670726", "text": "function keydown(evt) {\r\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\r\n\r\n switch (keyCode) {\r\n case \"A\".charCodeAt(0):\r\n player.motion = motionType.LEFT;\r\n player.face_direction = \"LEFT\";\r\n break;\r\n\r\n case \"D\".charCodeAt(0):\r\n player.motion = motionType.RIGHT;\r\n player.face_direction = \"RIGHT\";\r\n break;\r\n\r\n case \"W\".charCodeAt(0):\r\n if (player.isOnPlatform() || player.isOnMovingPlatform()) {\r\n player.verticalSpeed = JUMP_SPEED;\r\n }\r\n break;\r\n case \"C\".charCodeAt(0):\r\n cheat_mode = true;\r\n svgdoc.getElementById(\"bullets_left\").firstChild.data = \"Cheat mode\";\r\n break;\r\n case \"V\".charCodeAt(0):\r\n cheat_mode = false;\r\n if(bullets_left >= 0){\r\n svgdoc.getElementById(\"bullets_left\").firstChild.data = bullets_left;\r\n } else {\r\n svgdoc.getElementById(\"bullets_left\").firstChild.data = 0; \r\n\r\n }\r\n break;\r\n\r\n case 32:\r\n if (canShoot) shootBullet();\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "3d0990270e481a2d5ef620f995bc7e55", "score": "0.5566514", "text": "function clickKeys(evt) {\n\tlet allowedClicks = {\n\t\t\"arrow_back\": 'left',\n\t\t\"arrow_upward\": 'up',\n\t\t\"arrow_forward\": 'right',\n\t\t\"arrow_downward\": 'down'\n\t};\n\tplayer.handleInput(allowedClicks[evt.target.textContent]);\n}", "title": "" }, { "docid": "4f72187a5cfe247321578137cc6acc34", "score": "0.5566186", "text": "pauseHandler () {\n if (this._escapeDown && !this._lose && !this._won) {\n this._isPause = !this._isPause;\n this._escapeDown = false;\n\n if (this._isPause === true) {\n this.showPauseWindow();\n }\n else {\n this.showPauseWindow(false);\n }\n }\n }", "title": "" }, { "docid": "888c84167371e44ee7c5cb9d5b5dcf47", "score": "0.5554192", "text": "function control() {\n\t\t/* Move paddle to left */\n\t\tif ( key_press_list[37] ) {\t\n\t\t\tif (paddle.x - paddle.v <= 0 ) {\n\t\t\t\tvar delta = 0 - paddle.x;\n\t\t\t\tpaddle.x += delta;\n\t\t\t} else {\n\t\t\t\tpaddle.x -= paddle.v;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Move paddle to right */\n\t\t\n\t\tif ( key_press_list[39] ) {\n\t\t\tif (paddle.x + paddle.v >= WIDTH - PADDLE_WIDTH ) {\n\t\t\t\tvar delta = WIDTH - PADDLE_WIDTH - paddle.x;\n\t\t\t\tpaddle.x += delta;\n\t\t\t} else {\n\t\t\t\tpaddle.x += paddle.v;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7a74ab5de5e6a6abee7ab6f56204e503", "score": "0.5553283", "text": "function setupKeyHandlers(){\n /**\n * detect which text box is being changed\n * get the handle for corresponding slider\n * update slider value with text box value\n */\n var keyHandler=function(event){\n var slideClass=(this.className.includes(\"pomodori\"))?\".pomodori_slide\":\".break_slide\";\n var slide=document.querySelector(slideClass);\n slide.value=this.value;\n }\n //assign keyhandler to both the text boxes\n var session_text=document.querySelector('.pomodori_text');\n var break_text=document.querySelector('.break_text');\n session_text.onkeyup=keyHandler;\n break_text.onkeyup=keyHandler;\n //document level key handler\n //look out for space bar and simulate onoff click (start/stop)\n document.onkeypress=function(event){\n if(event.key==' ')\n document.querySelector('.onoff').click();\n };\n}", "title": "" }, { "docid": "75783605b894484634cb426038f9ee74", "score": "0.55487627", "text": "function controls(e) {\n e.preventDefault()\n if(e.keyCode === 37) {\n goLeft()\n } else if (e.keyCode === 38) {\n rotateTet()\n } else if (e.keyCode === 39) {\n goRight()\n } else if (e.keyCode ===40) {\n goDown()\n }\n }", "title": "" }, { "docid": "6111698f4839428d63d2514658d5eda6", "score": "0.55438846", "text": "'init_keys' (controls) // init_keys(): Define any extra keyboard shortcuts here\n {\n controls.add(\"Space\", this, function() { this.thrust[1] = -1; });\n controls.add(\"Space\", this, function() { this.thrust[1] = 0; }, { 'type': 'keyup' });\n controls.add(\"z\", this, function() { this.thrust[1] = 1; });\n controls.add(\"z\", this, function() { this.thrust[1] = 0; }, { 'type': 'keyup' });\n controls.add(\"w\", this, function() { this.thrust[2] = 1; });\n controls.add(\"w\", this, function() { this.thrust[2] = 0; }, { 'type': 'keyup' });\n controls.add(\"a\", this, function() { this.thrust[0] = 1; });\n controls.add(\"a\", this, function() { this.thrust[0] = 0; }, { 'type': 'keyup' });\n controls.add(\"s\", this, function() { this.thrust[2] = -1; });\n controls.add(\"s\", this, function() { this.thrust[2] = 0; }, { 'type': 'keyup' });\n controls.add(\"d\", this, function() { this.thrust[0] = -1; });\n controls.add(\"d\", this, function() { this.thrust[0] = 0; }, { 'type': 'keyup' });\n controls.add(\",\", this, function() { this.graphics_state.camera_transform = mult(rotation(6, 0, 0, 1), this.graphics_state.camera_transform); });\n controls.add(\".\", this, function() { this.graphics_state.camera_transform = mult(rotation(6, 0, 0, -1), this.graphics_state.camera_transform); });\n controls.add(\"o\", this, function() { this.origin = mult_vec(inverse(this.graphics_state.camera_transform), vec4(0, 0, 0, 1)).slice(0, 3); });\n controls.add(\"r\", this, function() { this.graphics_state.camera_transform = identity(); });\n controls.add(\"f\", this, function() { this.looking ^= 1; });\n }", "title": "" }, { "docid": "fbabcb12142a749df63332b093a0be49", "score": "0.5540522", "text": "function keyDown(einEvent) {\n\n //KeyCodes\n //left = 37\n //up = 38\n //right = 39\n //down = 40\n\n\n switch (einEvent.keyCode) {\n\n ////cursor up\n //case 38:\n // paddlePlayer1.moveAlong(0,paddlePlayer1.velocityY,0);\n // break;\n //\n ////cursor down\n //case 40:\n // paddlePlayer1.moveAlong(0,-paddlePlayer1.velocityY,0);\n // break;\n\n //cursor left\n case 37:\n if ((paddlePlayer1.position[0]-paddlePlayer1.dimension[0])*paddlePlayer1.dimension[0] >= -playField.dimension[0]/2) {\n paddlePlayer1.moveAlong(-paddlePlayer1.velocityX, 0, 0);\n }\n break;\n\n //cursor right\n case 39:\n if ((paddlePlayer1.position[0]+paddlePlayer1.dimension[0])*paddlePlayer1.dimension[0] <= playField.dimension[0]/2) {\n paddlePlayer1.moveAlong(paddlePlayer1.velocityX, 0, 0);\n }\n break;\n\n default:\n break;\n }\n}", "title": "" }, { "docid": "adc1e82b8b1edac625e99c011e8b1e46", "score": "0.5535256", "text": "mouseActionDown(key) {\n if (this.play === true) {\n this.setPlayControlsDown(key);\n }\n else {\n this.setMenuControlsDown(key);\n }\n }", "title": "" }, { "docid": "0d0588e95b84696ca4eb2dccd033b7fa", "score": "0.5527077", "text": "handleInteraction(button) {\r\n // disable the key button \r\n button.disabled = true;\r\n const key = button.textContent;\r\n // If the key letter picked is in the phrase\r\n if (this.activePhrase.checkLetter(key)) {\r\n // Add the chosen class to the button element\r\n button.classList.add('chosen');\r\n // Display the matched letter\r\n this.activePhrase.showMatchedLetter(key);\r\n // Check to see if the user won the game\r\n const winner = this.checkForWin();\r\n if (winner) {\r\n this.gameOver('win');\r\n }\r\n } else {\r\n // Remove wrong class from the button element and remove life\r\n button.classList.add('wrong');\r\n this.removeLife();\r\n }\r\n }", "title": "" }, { "docid": "2e3b1cdc6d768cd0757469235aa61c98", "score": "0.5517433", "text": "function listenControls(e, spaceship) {\r\n e = e || window.event;\r\n // console.log(e.keyCode);\r\n if (e.keyCode == '38' || e.keyCode == '87') {\r\n // up arrow\r\n steer[0] = true;\r\n spaceship.engine = true;\r\n }\r\n else if (e.keyCode == '40' || e.keyCode == '83' || e.keyCode == '32') {\r\n // down arrow\r\n steer[1] = true;\r\n spaceship.laserGun = true;\r\n }\r\n else if (e.keyCode == '37' || e.keyCode == '65') {\r\n // left arrow\r\n steer[2] = true;\r\n }\r\n else if (e.keyCode == '39' || e.keyCode == '68') {\r\n // right arrow\r\n steer[3] = true;\r\n }\r\n }", "title": "" }, { "docid": "a7cfc9509f4570c1325b83346ae06235", "score": "0.5516715", "text": "function gKeys(evt) {\n\tvar allowedKeys = {\n\t\t37: 'left',\n\t\t38: 'up',\n\t\t39: 'right',\n\t\t40: 'down'\n\t};\n\tplayer.handleInput(allowedKeys[evt.keyCode]);\n}", "title": "" }, { "docid": "62a69e9ec0018004ea7a50a4bc96c4b3", "score": "0.5515446", "text": "handleKeyDown(e) {\r\n if (e.keyCode === this.props.info.code) {\r\n this.playSound();\r\n this.setState({\r\n buttonStyle: \"drum-pad btn btn-warning\"\r\n });\r\n }\r\n }", "title": "" }, { "docid": "65a7a1d77c9219ae85ef6fd85bc5a0e7", "score": "0.55149406", "text": "keyDownHandler(e) {\n // Player hotkeys\n if (e.shiftKey) {\n if (e.keyCode === 37) { // Left\n this.moveFrameRelative(-10, this.state.video, true);\n e.preventDefault();\n } else if (e.keyCode === 39) { // right\n this.moveFrameRelative(10, this.state.video, true);\n e.preventDefault();\n }\n } else if (e.ctrlKey || e.metaKey) {\n if (e.keyCode === 37) { // Left\n this.moveFrameAbsolute(0, this.state.video, true);\n e.preventDefault();\n } else if (e.keyCode === 39) { // right\n this.moveFrameAbsolute(this.props.numFrames - 1, this.state.video, true);\n e.preventDefault();\n }\n } else {\n if (e.keyCode === 37) { // Left\n this.moveFrameRelative(-1, this.state.video, true);\n e.preventDefault();\n } else if (e.keyCode === 39) { // right\n this.moveFrameRelative(1, this.state.video, true);\n e.preventDefault();\n }\n }\n\n if (e.keyCode === 32) { // return / enter\n this.playPauseHandler();\n e.preventDefault();\n }\n }", "title": "" }, { "docid": "3befee74d0be3c15042e6025a3d05139", "score": "0.5514014", "text": "map_controls() {\n game.controls.map(this.playfield.pi, {\n up : this.up,\n down : this.down,\n left : this.left,\n right: this.right,\n a : this.swap,\n b : this.mode === \"vs\" ? this.swap : this.undo_swap,\n l : this.push,\n r : this.push,\n start: this.pause\n });\n }", "title": "" }, { "docid": "30b5c3bd9b00ae2162f79480501df02c", "score": "0.55040455", "text": "function updateControls() {\n // Don't show these controls for\n if (currentItem == 'fancy') {\n updateOverlayControls();\n } else {\n updateFaceTrackingOverlayControls();\n }\n}", "title": "" } ]
da85160ddff9785485b124ccf9ae773f
Perform Login via API
[ { "docid": "b76f2b8ac1e5b1b024f14ad3aab1a407", "score": "0.0", "text": "async handleSubmit(e) {\n e.preventDefault();\n const data = this.state;\n let responseData = null;\n \n // Call login function\n await axios.post('/api/login', data).then(response => { \n responseData = response.data;\n\n }).catch(error => {\n responseData = error.response.data;\n });\n \n //Proceed if there are no errors returned in the API\n if (!('errorResult' in responseData || 'errors' in responseData)) {\n localStorage.setItem(\"token\", responseData.token);\n return this.props.history.push(\"/\")\n } \n const errorMessage = (this.state.email === '' || this.state.password === '') ? 'Fill up necessary requirements' : 'Email or Password does not match';\n alert(errorMessage);\n }", "title": "" } ]
[ { "docid": "1ae1d7d960ef842e6119ac7306d97222", "score": "0.75734144", "text": "function login() {\n var loginOptions = {\n host: 'rollbase.com',\n port: 443,\n // Note this is password not Password like in documentation\n path: '/rest/api/login?&output=json&password=' + password + '&loginName=' + username\n };\n // do the request\n var loginGet = https.request(loginOptions, function(res) {\n var data = '';\n res.on('data', function(d) {\n data += d;\n });\n res.on('end', function() {\n var obj = JSON.parse(data);\n if (obj.status == 'ok') {\n sessionId = obj.sessionId;\n } else {\n console.log(obj.message);\n }\n })\n });\n loginGet.end();\n loginGet.on('error', function(e) {\n console.error(e);\n });\n}", "title": "" }, { "docid": "3a0843cbde5f18b141afe0ec83ff817a", "score": "0.7565956", "text": "function doLogin() \n{\n\tlet username = $('#textusername').val();\n\tlet password = $('#textpassword').val();\n\t\n\tlet jsondata = {\n\t\t \"serviceName\": \"generateToken\",\n\t\t \"param\": {\n\t\t \"email\": username,\n\t\t \"password\": password\n\t\t }\t\n\t};\n\tpostToApi(jsondata);\n} //end doLogin", "title": "" }, { "docid": "f919c4bd14bbd6ac320f2546de5a114f", "score": "0.7528465", "text": "login (data) {\n return this.apiCall('post', '/login', data)\n }", "title": "" }, { "docid": "d18c7d2d46135be4aa9dc900fb150b30", "score": "0.75031304", "text": "loginAPI() {\n\t\tthis.auth0Sales.authorize();\n\t}", "title": "" }, { "docid": "03c1354095edf7fa7d80384a8ccdcc32", "score": "0.73679316", "text": "function login() {\n if (__DEVONLY__) $log.debug('EntryController login');\n \n // build the authorization string for the request, then construct the apiRequest arguments\n let basicAuthString = $window.btoa(`${vm.login.username}:${vm.login.password}`);\n let requestOptions = {\n headers: { \n authorization: `Basic ${basicAuthString}` \n }\n };\n vm.login.password = null;\n \n // make the request\n // TODO: move this logic to userManager service\n apiRequest('get', 'login', requestOptions)\n .then((user) => {\n userManager.handleLogin(user);\n })\n .catch((err) => {\n if (__DEVONLY__) $log.error('login: ', err);\n vm.error = err;\n });\n }", "title": "" }, { "docid": "a394e264dd58f2d62cfe174fa742fd29", "score": "0.7264945", "text": "function login() {\n let formData = {\n username: USERNAME,\n password: PASSWORD,\n ['login-form-type']: 'pwd'\n };\n return nest.postAsync({uri:LOGIN_URL, form:formData})\n}", "title": "" }, { "docid": "e10e071e91c40b16ff7c0ac49d3832a1", "score": "0.72129625", "text": "login(credentials) {\n // use Axios post method\n return Api().post('login', credentials)\n }", "title": "" }, { "docid": "a977c9152d7207a9ed960b1c9e667615", "score": "0.71452576", "text": "function login() {\n\t// e.preventDefault();\n\n\t// Values extracted from login form\n\t username = $('#username').val();\n\tvar apiKey = $('#api_key').val();\n\tvar password = $('#password').val();\n\t\n\n\t/**\n\t * login(domainApiId, userName, password) logs in user to Kandy Platform\n\t * \n\t * @params <string> domainApiId, <string> userName, <string> password\n\t */\n\tKandyAPI.Phone.login(apiKey, username, password);\n}", "title": "" }, { "docid": "47bbb96615d959b0d9106b8ad6bd0819", "score": "0.7137793", "text": "login(email, password){\n return this.makeRequest('auth/rpc', 'Login', {\n data: {\n email: email,\n password: password\n }\n });\n }", "title": "" }, { "docid": "381292fe948445b606f946b6166d7294", "score": "0.70733815", "text": "function login(){\n data = getLoginData();\n $.ajax({\n url: getConfigValues('server_url') + getConfigValues('login_endpoint'),\n type: 'POST',\n data: data,\n success: loginCallBack,\n dataType: 'json'\n });\n}", "title": "" }, { "docid": "07212982510f590cb0f52945eb59c482", "score": "0.7050294", "text": "login(username, password) {\n return this._rb.next((value, rb) => {\n rb.operation = 'LOGIN';\n return rb.client.login(username, password);\n });\n }", "title": "" }, { "docid": "55ae4778110400d36c7852cbfda36101", "score": "0.70130676", "text": "function auth() {\n var emailError = document.getElementById('emailError');\n emailError.style.display = \"none\";\n var passwordError = document.getElementById('passwordError');\n passwordError.style.display = \"none\";\n var hashedPassword = sha256(document.getElementById('password').value);\n var url = 'http://158.38.101.146:8080/loginToken?email=' + document.getElementById('email').value + \"&password=\" + hashedPassword;\n var client = new HttpClient();\n client.get(url, function (response) {\n //console.log(response);\n if(response != null){\n loginRussesamfunnet(response);\n }\n });\n}", "title": "" }, { "docid": "c054055eab9db7bac0871a5897e0ca37", "score": "0.69582087", "text": "_authenticate(callback, params) {\n console.log('[web] (login) authenticating');\n\n this.request.post({\n url: '/launcher/1/authenticate',\n headers: makeHeaders({\n 'Referer': 'https://account.enmasse.com/',\n }),\n form: params,\n }, (err, res, body) => {\n if (err) {\n console.error(err);\n return;\n }\n\n if (res.statusCode !== 302) {\n console.error('failed to auth');\n return;\n }\n\n this.ready = 1;\n callback();\n });\n }", "title": "" }, { "docid": "0da41814bd69177b95f5c46dbd2a99eb", "score": "0.69364536", "text": "function check_Login(e) {\n Ti.API.info(\"inside check_Login\");\n // ############# function call of HTTP post req for API #################\n // require('loader').loading($.indexwin);\n require('loder').addloder($.indexwin);\n GoToLoginAPI();\n}", "title": "" }, { "docid": "9285b3db3391756f6e66cf43509913eb", "score": "0.69304216", "text": "handleLogin() {\n\t\tvar loginRequest = this.getLoginRequest();\n\t\tthis.client.sendRequest(Const.EzyCommand.LOGIN, loginRequest);\n }", "title": "" }, { "docid": "ad4caac431211de675afffc372a5f4cf", "score": "0.69025534", "text": "async login(login, password){\n return (await this.__call('Login', {\n \"jsonrpc\" : \"2.0\",\n \"method\" : \"UserAPI.Login\",\n \"id\" : this.__next_id(),\n \"params\" : [login, password]\n }));\n }", "title": "" }, { "docid": "fc1c999a95fe2f37e4c945cc55cfa5f4", "score": "0.6892214", "text": "function login() {\r\n console.log(user);\r\n\r\n var options = {\r\n followAllRedirects: true,\r\n form: {\r\n timezoneOffset: timezoneOffset,\r\n userid: user,\r\n pwd: pass\r\n },\r\n jar: true, // Save cookies for logout.\r\n headers: {\r\n 'User-Agent': USER_AGENT,\r\n 'host': 'nyc0fscqarwb03.na.corp.jwt.com:16102',\r\n 'Referer': 'http://nyc0fscqarwb03.na.corp.jwt.com:16102/psc/fsdev/EMPLOYEE/PSFT_EP/c/XX_AP_CUSTOM_MENU.XX_CONTAINER.?Page=XX_CONTAINER2'\r\n }\r\n };\r\n\r\n request.post(RICOCHET_SERVER + RICOCHET_LOGIN, options,\r\n function(error, response, body) {\r\n if (error) {\r\n console.log('Failed Ricochet Login:', error);\r\n process.exit();\r\n }\r\n })\r\n\r\n }", "title": "" }, { "docid": "5a01380eca3c1b7878fd9cb6b5b52cf9", "score": "0.68869317", "text": "function login() {\r\n console.log('Login');\r\n\r\n // Definisco l'URL della richiesta.\r\n var reqUrl = PATH + '/api/user/login';\r\n\r\n // Definisco i parametri della richiesta.\r\n var email = EMAIL;\r\n var password = PASSWORD;\r\n var body = {\r\n email: email,\r\n password: password\r\n };\r\n var options = {\r\n method: 'POST',\r\n contentType: 'application/json',\r\n payload: JSON.stringify(body)\r\n };\r\n\r\n // Invio la richiesta.\r\n var response = JSON.parse(UrlFetchApp.fetch(reqUrl, options));\r\n console.log('Token: ' + response.token);\r\n\r\n // Salvo il token di autorizzazione.\r\n PropertiesService.getDocumentProperties().setProperty('TOKEN', response.token);\r\n}", "title": "" }, { "docid": "1b50059a4790dea3dd5a88005ed19868", "score": "0.6844393", "text": "async login() {\n await this.client.login(this.token);\n }", "title": "" }, { "docid": "9e262ce36fbf24fb4b377e1c40bce0b3", "score": "0.682537", "text": "@action login() {\n this.inProgress = true;\n this.errors = undefined;\n\n return agent.Auth.login(this.values.username, this.values.password)\n .then((user) => commonStore.setToken(user.accessToken))\n .then(() => userStore.pullUser())\n .catch(action((err) => {\n this.errors = err.response && err.response.body && err.response.body.message;\n throw err;\n }))\n .finally(action(() => {\n this.inProgress = false;\n //TODO: need to reset() ?? --> leak password\n this.reset();\n }));\n }", "title": "" }, { "docid": "bf41375f64cd4a57a0dc6d69527e25c2", "score": "0.68231094", "text": "function login() {\n\n\tuser = $(\"input#username\").val();\n\tpassword = $(\"input#password\").val();\n\n\tparams = \"function=login&user=\" + user + \"&password=\" + password;\n\t$.ajax({type: \"POST\", url: api_path, data: params, success: function(data) {\n\t\tif (data==1) {\n\t\t\tgetURL();\n\t\t\tcloseModal();\n\t\t} else {\n\t\t\t$(\"#password\").val(\"\").addClass(\"error\");\n\t\t\t$(\".message .button.active\").removeClass(\"pressed\");\n\t\t}\n\t}});\n\n}", "title": "" }, { "docid": "249e8eb2f057c0474d88b72862dc4275", "score": "0.68045706", "text": "function step1(){\r\n wpApiCall('post',{\r\n action: 'login',\r\n lgusername: username,\r\n format: 'json'\r\n },function(res){\r\n if(res.login.result != 'NeedToken'){\r\n console.error('Initial response was not NeedToken but '+\r\n res.login.result);\r\n } else {\r\n wpApiCall('post',{\r\n action: 'login',\r\n lgusername: username,\r\n lgpassword: password,\r\n lgtoken: res.body.login.token,\r\n },function(res){\r\n if (res.login.result != 'Success'){\r\n console.error('Login was not Success but '+res.login.result);\r\n } else {\r\n getEditToken();\r\n }\r\n });\r\n }\r\n });\r\n}", "title": "" }, { "docid": "ba575ec8b3955dbb37f36667ba0615db", "score": "0.67887163", "text": "function requestLogin() {\n ngio.requestLogin(onLoggedIn, onLoginFailed, onLoginCancelled);\n /* you should also draw a 'cancel login' buton here */\n }", "title": "" }, { "docid": "34ec9b84400e03377a6923c3efef292d", "score": "0.67885363", "text": "static loginUser(apiURL, $callbackMethodName){\n\n var u = $(\"#username\").val();\n var p = $(\"#password\").val();\n // CloudServiceResponseHandler will be called using data returned\n // when called from the LOGIN wrapper :\n // update the page URL on success or update textbox failure message\n CloudService.LOGIN('loginStatusMessage',\n `${apiURL}`,\n [u,p],\n `${$callbackMethodName}`,\n );\n }", "title": "" }, { "docid": "ca864ec4925524c77927e752c5899dfa", "score": "0.67493397", "text": "async login() {\n logger.info('Attempting to log in');\n const ec = new ecc.ec(this.curve);\n const key = ec.keyFromPrivate(this.privateKey, 'hex');\n const signature = key.sign(this.uuid);\n\n const response = await this.app.authenticate({\n strategy: 'local',\n uuid: this.uuid,\n signature: signature\n });\n\n logger.info('Logged in and received JWT:', response.accessToken);\n }", "title": "" }, { "docid": "35cfc2d031ae93575c1a1318429e1168", "score": "0.67394376", "text": "function calaApiApi_login(userData, success, error){\n var req = {\n w: \"users\",\n r: \"users_log_me_in\",\n userName: userData.userName,\n pwd: userData.pwd\n };\n \n calaApi_postRequest(req, \n function(data){\n if(data.resp != ERROR_USER_WRONG_LOGIN_INFO){\n calaApi_setLocalStorage('userName', data.resp.userName); \n calaApi_setLocalStorage('sessionKey', data.resp.sessionKey); \n if(success != null){\n success(data);\n }\n }else{\n if(error != null){\n error(data);\n }\n }\n },\n function(data){\n if(error != null){\n error(data);\n }\n });\n}", "title": "" }, { "docid": "5e70b5596e2b8a868906834e8bd6ff7e", "score": "0.6732961", "text": "function login() {\n auth.signin({\n connection: 'Username-Password-Authentication',\n username: vm.username,\n password: vm.password,\n authParams: {\n scope: 'openid name email' //Details: https://auth0.com/docs/scopes\n }\n }, onLoginSuccess, onLoginFailed);\n }", "title": "" }, { "docid": "c9853512cf0e09595904e7f24537798f", "score": "0.672712", "text": "login() {\n\n this.newLoginWindow();\n this.loginWindow.loadURL(\"https://oauth2.sky.blackbaud.com/authorization?client_id=\" + id + \"&response_type=token&redirect_uri=\" + url);\n this.loginWindow.show();\n }", "title": "" }, { "docid": "69df34cc623cfe3241ce6b9fec3a8386", "score": "0.67231995", "text": "function onClickLogin(e) {\n e.preventDefault();\n var username = edtHostName.value;\n var password = edtHostPassword.value;\n\n if(username == null || username == \"\") {\n alert(\"Error: Need a name!\");\n } else {\n var request = new XMLHttpRequest();\n request.open(\"GET\", `${urlHostAPI}?cmd=login&name=${username}&password=${password}`, true);\n request.timeout = 2000;\n request.onload = onLoginResponse;\n request.send();\n }\n}", "title": "" }, { "docid": "e16f21fac36987dd3b05ed50d9ff6062", "score": "0.67218727", "text": "function request() {\n\n authenticate();\n }", "title": "" }, { "docid": "ceb3ab833992b058a2f88ebdadf74710", "score": "0.67119527", "text": "function oauthLogin() {\n jso.getToken();\n}", "title": "" }, { "docid": "b24ee9fcafee54e4c63b4f8f7ba77bb1", "score": "0.6701999", "text": "function Login() {\r var username = \"[email protected]\" // You can change username based on your configuration\r var password = \"admin\" // You can change password based on your configuration\r var token // This variable is empty now. But after your login, a new token will be assigned. This token will be used for other functions.\r var data = {\r \"request\": {\r \"interface\": \"AuthInterface\",\r \"method\": \"login\",\r \"parameters\": {\r \"username\": username,\r \"password\": password\r }\r }\r }\r\r var successCallbackLogin = function(data) {\r console.log(\"success\");\r window.test = data;\r token = JSON.stringify(data.response.result) // Do you remember the token variable above ??\r $(\"#token\").text(token);\r }\r\r $.ajax({\r url: \"http://localhost:8082/json\",\r method: \"POST\",\r data: JSON.stringify(data),\r success: successCallbackLogin\r });\r}", "title": "" }, { "docid": "583ee668bf6c278aa09cf9cc4fcf3f6f", "score": "0.66981244", "text": "onClickLogin() {\n const email = this.emailEl.value;\n const password = this.passwordEl.value;\n return this.client\n .login(email, password)\n .then(() => {\n this.statusEl.innerText = 'status: logged in';\n })\n .catch((err) => alert(err.message));\n }", "title": "" }, { "docid": "4822635280fbd57adc1782b64691b9d6", "score": "0.6692105", "text": "function login() {\n //om.login is an openMinds_connect.js function\n console.log(\"in login\");\n om.logIn({\n\tappId: APP_ID,\n\tredirectUri: REDIRECT_URI,\n\tcallback: function(accessToken) {\n\t if (accessToken) {\n\t\tconsole.log(\"calling postLogIn\");\n\t\tpostLogIn();\n\t }\n\t}\n });\n\n}", "title": "" }, { "docid": "3256b38916abb506b0d1d8c38a37c090", "score": "0.66916573", "text": "function login() {\n getElementById(\"login_message\").innerHTML = \"Logging in...\";\n $.ajax({\n type: \"POST\",\n contentType: \"application/json\",\n url: baseUrl + \"/fabric/security/token\",\n dataType: \"json\",\n data: '{\"username\":\"' + getElementByIdValue(\"username\") + '\", \"password\":\"' + getElementByIdValue(\"password\") + '\"}',\n success: function () {\n authenticated = true;\n $('#login').hide(\"slow\");\n $(\"#tabs\").show();\n updateTable();\n }\n });\n }", "title": "" }, { "docid": "607deeae79610c41eced5255cb4abde5", "score": "0.66719574", "text": "login (loginData) {\n // store.commit('RESET_ACL');\n return API({\n url:'login',\n method:'POST',\n data:loginData\n });\n\n }", "title": "" }, { "docid": "ccdb1bec012401f456c796459ae81287", "score": "0.666371", "text": "login (data) {\n console.log(\"Attempting logon.\");\n return client.post(\"/user/login\", data)\n .then(response => response.data);\n }", "title": "" }, { "docid": "70938211f1eef630fd0ee3b46d077f7d", "score": "0.6661738", "text": "login() {\n Resource.get(this).resource('Auth:login', {email: this.email, password: this.password})\n .then(res => {\n this.handleLoginResponse(res);\n })\n .catch(() => {\n this.unauthorized = true;\n });\n }", "title": "" }, { "docid": "a5ac1928c59ce594c4b10e8e11eaf629", "score": "0.6656704", "text": "function login() {\r\n let paramsString = serialize(params);\r\n return request({\r\n uri: 'https://rfs.skymanager.com/Home/LogIn',\r\n method: 'POST',\r\n headers: {\r\n \"Content-Type\" : \"application/x-www-form-urlencoded\",\r\n 'Content-Length' : paramsString.length\r\n },\r\n body: paramsString,\r\n resolveWithFullResponse: true,\r\n simple: false\r\n }).then((response) => {\r\n if (response.statusCode != 302 && response.statusCode != 200) {\r\n throw response;\r\n }\r\n // Save out cookies\r\n var sessionCookie = response.headers['set-cookie'].map((cookie) => cookie.split(';')[0]).join(\"; \");\r\n fs.writeFile('sessionCookie.txt', sessionCookie, function (err)\r\n {\r\n if(err)\r\n {\r\n throw err;\r\n }\r\n });\r\n }).catch((error) => {\r\n throw error;\r\n });\r\n}", "title": "" }, { "docid": "254e4bef1c3174303cc66ab901445fad", "score": "0.6655349", "text": "function login() {\n let token = auth.release;\n if (botName) {\n token = auth[botName];\n if (!token) {\n common.error('Failed to find auth entry for ' + botName);\n process.exit(1);\n }\n } else if (isDev) {\n token = auth.dev;\n }\n client.login(token).catch((err) => {\n console.error(err);\n process.exit(1);\n });\n }", "title": "" }, { "docid": "879302158266e37d3df5ef9226de5e6c", "score": "0.66450846", "text": "function doLogin(){\n var base = makeHttpRequest(args.address,{});\n\n if( base.getAllHeaders()['Set-Cookie'] == undefined || base.getAllHeaders()['Set-Cookie'].split(\"=\")[0] != \"ASP.NET_SessionId\")\n throw error(10004, \"Impossible to fetch the ASP id, check the ADDRESS\");\n\n var base_cookie = base.getAllHeaders()['Set-Cookie'].split(';')[0];\n\n log( 2, base_cookie, \"Base Cookie\");\n\n var url = args.address+'/Users/Account/DoLogin';\n var payload = {\n 'username' : args.username,\n 'password' : args.password\n };\n\n var headers = {\n 'accept' : '*/*',\n 'Connection' :\t'keep-alive',\n 'Referer' : args.address,\n 'User-Agent' :\t'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0',\n 'Cookie' : base_cookie,\n };\n\n var options = {\n 'method': 'POST',\n 'headers': headers,\n 'payload' : payload,\n 'followRedirects' : false\n };\n\n var response = makeHttpRequest(url, options);\n\n if( response.getAllHeaders()['Set-Cookie'] == undefined || response.getAllHeaders()['Set-Cookie'].split(\"=\")[0] != \"extranet_db\")\n throw error(10005, \"Login error, please check your credentials\");\n\n var returnValue = [ base_cookie, response.getAllHeaders()['Set-Cookie'].split(';')[0]];\n\n log( 2, returnValue[1], \"Response Code\");\n\n return returnValue;\n}", "title": "" }, { "docid": "0afa53a56f9dc3b943ccc2abb411bcec", "score": "0.6633145", "text": "function login(username, password, done){\n post(\n '/login', \n { \n username: username, \n password: password \n }, \n done\n );\n}", "title": "" }, { "docid": "acf61ebec50c87bbe54cf6a89d9e6bb5", "score": "0.66190785", "text": "function initLogin(){\n// Get Values\nvar userName = document.querySelector(\"input[name='username']\");\nvar userPass = document.querySelector(\"input[name='password']\");\n\nconsole.log(userName.value, userPass.value);\n// Send to the server\n$.ajax({\n\turl: \"/api/admin/login\",\n\ttype: \"POST\",\n\tdata: {\n\t\temail: userName.value,\n\t\tpassword: userPass.value\n\t},\n\tsuccess: function(result){\n\t\tif(result.success){\n\t\t\t$('body').pgNotification({message: result.message}).show();\n\t\t\tsetUserAuth(result.userid, result.token_api, result.username);\n\t\t\tsetTimeout(function(){\n\t\t\t\twindow.location.href = \"/admin/dashboard.php\";\n\t\t\t},1000);\n\t\t}else{\n\t\t\t$('body').pgNotification({message: result.message}).show();\n\t\t}\n\t},\n\terror: function(xhr,status,error){\n\t\tconsole.log(xhr, status, error);\n\t}\n});\n\n\n// Act according to response\n}", "title": "" }, { "docid": "3ee9fb05eab81b214fce946749558204", "score": "0.66066796", "text": "function login() {\n\treturn new Promise(function(resolve, reject) {\n\t\tReq.post({\n\t\t \"headers\": { \"content-type\": \"application/json\" },\n\t\t \"url\": \"https://anypoint.mulesoft.com/accounts/login\",\n\t\t \"body\": JSON.stringify({\n\t\t \"username\": process.env.ANYPOINT_USER,\n\t\t \"password\": process.env.ANYPOINT_PASSWORD\n\t\t })\n\t\t}, (error, response, body) => {\n\t\t\tif(error) {\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tjsonBody = JSON.parse(body);\n\n\t\t\t var token = jsonBody.token_type + \" \" + jsonBody.access_token;\n\t\t\t console.log('Token has been retrieved: ' + token);\n\t\t\t resolve(token);\n\t\t\t}\n\n\t\t});\n\t});\n}", "title": "" }, { "docid": "97f2e50a081184644b407b2931ae0737", "score": "0.6593635", "text": "function login() {\r\n\r\n $.ajax({\r\n url: '/bfoms-javaee/rest/users/' + username,\r\n /* url: '/archfirst/login.php?user_name='+username+'&?password='+password,*/\r\n beforeSend: setPasswordHeader,\r\n success: function (data, textStatus, jqXHR) {\r\n user = data;\r\n clearStatusMessage();\r\n $('#l_password')[0].value = ''; // erase password from form\r\n window.location.hash = 'accounts';\r\n getBrokerageAccounts();\r\n },\r\n error: function (jqXHR, textStatus, errorThrown) {\r\n showStatusMessage('error', errorThrown);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "ed5ba962038e3e7636e4b637a084f08c", "score": "0.6591263", "text": "function login() {\n return oauthClient().then(function (client) {\n return client.authorize($window);\n }).then(function (code) {\n // Save the auth code. It will be exchanged for an access token when the\n // next API request is made.\n authCode = code;\n tokenInfoPromise = null;\n });\n }", "title": "" }, { "docid": "c1271b359730d181ece9590c54d181ae", "score": "0.65891457", "text": "async function login() {\n try {\n return API.login(cod_bot_activision_email, cod_bot_activision_password);\n } catch (Error) {\n console.log('Error: ' + Error);\n }\n}", "title": "" }, { "docid": "1b6cbf5d5e1c5b26e963fd94c80d566d", "score": "0.65852183", "text": "function GoToLoginAPI() {\n\n var data = {\n // email: $.email_id.value,\n // password: $.password.value,\n // email: \"[email protected]\",\n // password: \"rahuls123\",\n email: \"[email protected]\",\n password: \"rahuls123\",\n\n }\n Ti.API.info(data);\n var client = Ti.Network.createHTTPClient();\n client.onload = function(e) {\n require('loder').removeloder();\n var response = JSON.parse(client.getResponseText());\n Ti.API.info(\"json stringfy load\" + JSON.stringify(e));\n Ti.API.info(\"client.responseText onload\" + client.getResponseText());\n Alloy.Globals.Mpassword = data.password;\n // alert(response.message);\n GoToHomescreen(client.getResponseText());\n\n\n };\n client.onerror = function(e) {\n require('loder').removeloder();\n var response = JSON.parse(client.getResponseText());\n Ti.API.info(\" onerror\" + JSON.stringify(e));\n Ti.API.info(\"client.responseText onerror\" + client.getResponseText());\n Ti.API.info(response.message);\n alert(response.message);\n response=null;\n };\n\n client.open('POST', 'http://staging.php-dev.in:8844/trainingapp/api/users/login');\n client.send(data);\n\n}", "title": "" }, { "docid": "d1106712d7cc1273b607cdaf9c767606", "score": "0.6585013", "text": "function login() {\n logger.log('Login POST !');\n $http\n .post('/api/login', JSON.stringify({'username': $scope.username, 'password': User.generateHash($scope.password)}))\n .then(\n function successCallback(response) {\n logger.log('Login response : ' + response.status);\n styleLoginAlert(true);\n $location.path('/survey');\n },\n function errorCallback(response) {\n logger.log('Error: response with status ' + response.status);\n styleLoginAlert(false);\n });\n }", "title": "" }, { "docid": "fcf55e8d14d936287c78323d6a62c770", "score": "0.6584245", "text": "function authenticate() {\n return requester.post('user', 'login', 'basic', AUTH_DATA);\n}", "title": "" }, { "docid": "50f633887c2923f829a88a557546678f", "score": "0.65766937", "text": "function login() {\n User.login(self.user, handleLogin);\n }", "title": "" }, { "docid": "a83b05ce27a9bcf7177509f758358430", "score": "0.65682083", "text": "submit() {\n\t\tvar postData = \"grant_type=password&username=\" + this.username + \"&password=\" + this.password;\n\t\tdebugger;\n\t\t// this.authService\n\t\t// \t.login(postData, { mode: 'cors' })\n\t\t// \t.then(response => {\n\t\t// \t\tdebugger;\n\t\t// \t\tconsole.log(response);\n\t\t// \t})\n\t\t// \t.catch(err => {\n\t\t// \t\tdebugger;\n\t\t// \t\tconsole.log(err);\n\t\t// \t});\n\n\t\tthis.authService.login({\n\t\t\tusername: this.username,\n\t\t\tpassword: this.password,\n\t\t\tgrant_type: \"password\"\n\t\t}, { mode: 'cors', headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })\n\t\t\t.then(response => {\n\t\t\t\tdebugger;\n\t\t\t\talert('Login successful');\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tdebugger;\n\t\t\t\talert(\"Invalid email or password.\");\n\t\t\t});\n\t}", "title": "" }, { "docid": "3f98c270ba45a1608089d3b29217f6c0", "score": "0.65586215", "text": "login() {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }", "title": "" }, { "docid": "ddb133320448bfdfc698bec54dd7f9d3", "score": "0.6554834", "text": "function login() {\n // check for validity\n if(!View.login.validateForm()) {\n return; // if the input is not valid we return the method, and HTML5 will handle the error message\n }\n let pin = View.login.getValues().pin;\n // find in accounts for account.pin == pin\n let validAccount = accounts.find(account => account.getPin() == pin); // pin is private in account, we use a getter\n if(validAccount) { // if found\n openAccountSession(validAccount);\n } else { // if not validAccount is undefined therefore falsy\n Alert.error(ERROR.ACCOUNT_NOT_FOUND);\n }\n }", "title": "" }, { "docid": "637eaeca4f51ecc944aaa5e1771437e8", "score": "0.655207", "text": "function login(){\n fetch(apiURL + \"login\")\n .then(function(response) {/*console.log(response)*/}); // You can print the response for testing purposes\n}", "title": "" }, { "docid": "247e48cc6056cf342ce6d9088309ae89", "score": "0.6540897", "text": "static async login(email, password) {\n const params = { email: email, password: password };\n const endpoint = APIRoutes.veteransSignInPath();\n try {\n let { json, headers } = await BaseRequester.post(endpoint, params);\n await SessionManager.storeUserSession(json.data, headers);\n return json;\n } catch (error) {\n // Erase user session on login failure in case stale session is there\n await SessionManager.removeUserSession();\n console.error(error);\n throw error;\n }\n }", "title": "" }, { "docid": "96103bcaf6422deea7842f9704d2f1a8", "score": "0.6537924", "text": "async function login({server, apiVersion, siteContentUrl, username, password}) {\n let response = await doRequest({\n method: 'POST',\n url: `${server}/api/${apiVersion}/auth/signin`,\n headers: {\n 'Accept': 'application/json',\n },\n data: {\n credentials: {\n name: username,\n password,\n site: {\n contentUrl: siteContentUrl,\n },\n },\n },\n }).catch(err => {\n console.error(err)\n });\n\n return {\n server,\n apiVersion,\n site: response.data.credentials.site,\n siteId: response.data.credentials.site.id,\n token: response.data.credentials.token,\n };\n\n}", "title": "" }, { "docid": "c685b768359bceda001335a7bbac24b5", "score": "0.65309334", "text": "async function onLogin(username, password){\n let imei = await IMEI.getImei();\n if(username && password && imei[0] !== undefined && imei[0] !== null && imei[0] !== \"\"){\n let header = null;\n let request = {\n \"username\": username,\n \"password\": password,\n \"imei\": imei\n };\n\n return await post(\"AUTH-LOGIN\",request, header)\n .then((response)=>{\n if(response.status){\n return response.data;\n }\n return null\n })\n }\n}", "title": "" }, { "docid": "26449bf7c3978a3587e471021eade94b", "score": "0.6508786", "text": "static async login(username, password) {\n let res = await this.request(`auth/token`, { username, password }, \"post\");\n return res.token;\n }", "title": "" }, { "docid": "e32cf933f5f8da38492a6e5579c7b3c4", "score": "0.65025604", "text": "function login(username, password) {\n return fetch('/we_talk/login', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n username,\n password\n })\n }).then(res => res.json())\n }", "title": "" }, { "docid": "98bf3c56cedca3973ebc4984cd243881", "score": "0.64894915", "text": "function login(datuak) {\n\n\n\t//alert( maquina + '/api/login');\n\t//alert(datuak);\n $.mobile.loading( \"show\");\n $.ajax({\n type: 'POST',\n url: maquina + '/api/login',\n data: datuak\n })\n .done(function (responseText) {\n // Triggered if response status code is 200 (OK)\n //alert(responseText.data.api_token);\n $.mobile.loading( \"hide\");\n if (responseText.data) {\n $('#token').val(responseText.data.api_token);\n $.mobile.changePage(\"#eraikinOrria\");\n } else {\n $.mobile.changePage(\"#pageError\");\n }\n })\n .fail(function (jqXHR, status, error) {\n // Triggered if response status code is NOT 200 (OK)\n \talert(jqXHR.responseText);\n $.mobile.changePage(\"#pageError\");\n });\n}", "title": "" }, { "docid": "a015f96439720a824bdb4e35c5572e7c", "score": "0.6484643", "text": "function create_login(token, name, email, username, password){\n var b_token = 'Bearer '+token;\n var body = \"connection=Username-Password-Authentication&email=\"+email+\"&username=\"+username+\"&password=\"+password+\"&name=\"+name;\n return fetch(\"https://withington24.us.auth0.com/api/v2/users\",{\n method:\"POST\",\n mode:\"cors\",\n headers:{\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Authorization\": b_token,\n },\n body: body,\n })\n .then(response=>response.json());\n}", "title": "" }, { "docid": "0458ba44e64fb1ff8ec01b690b3eee59", "score": "0.64832646", "text": "login() {\n AudioCodesUA.ac_log('AC: login()');\n this.jssipUA.register();\n }", "title": "" }, { "docid": "8409fb9cc2c440b8f639d7f805af8371", "score": "0.64704794", "text": "function taleoLogin() {\n //Build API call\n var loginURL = 'https://ch.tbe.taleo.net/CH06/ats/api/v1/login?orgCode=[INSERT_COMPANY_CODE]&userName=[INSERT_TALEO_USERNAME]&password=[INSERT_TALEO_PASSWORD]';\n var loginOptions = {\n 'method' : 'post',\n 'contentType' : 'application/json'\n };\n \n //Make API call\n try {\n var loginResponse = UrlFetchApp.fetch(loginURL, loginOptions);\n if (loginResponse.getResponseCode() == 200) {\n Logger.log('Logged in!');\n }\n else {\n Logger.log('Error logging in: ' + loginResponse.getContentText());\n }\n }\n catch (e) {\n Logger.log('Could not log in: ' + e);\n }\n \n //Return full authToken key\n return authToken = 'authToken=' + JSON.parse(loginResponse).response.authToken;\n}", "title": "" }, { "docid": "fd3f300f7f4dafbbb56d49da894d1eb9", "score": "0.6467902", "text": "login() {\n\t\tthis.auth0.authorize();\n\t}", "title": "" }, { "docid": "9a9086c1692247fd9a0675ad66c8d760", "score": "0.6464532", "text": "function getAuthTv() {\n return axios.post(`${url}/login`, {\"username\": \"teste\",\"password\": \"teste\"});\n }", "title": "" }, { "docid": "dc9b946c197e848d70c461069592908e", "score": "0.64561", "text": "signInExistingUsertoAPI() { }", "title": "" }, { "docid": "a90a007c1715e693e21ce2624835f2dc", "score": "0.6450302", "text": "function login(iden String){\n \n }", "title": "" }, { "docid": "64db801d079f281f075c6efbb9f07ed9", "score": "0.6444269", "text": "function login (email, password) {\n return Request.login(email, password)\n}", "title": "" }, { "docid": "e280d80d9ea41302d788c3a6db2b20d5", "score": "0.64399064", "text": "login() {\n wx.login({\n success: res => {\n var req = new request();\n //console.log(res);\n // 发送 res.code 到后台换取 openId, sessionKey, unionId\n var postData = {\n \"token\": res.code\n }\n req.postRequest(this.globalData.host + login, JSON.stringify(postData)).then(res => {\n if (res.statusCode === 400) {\n this.globalData.is_registered = false;\n }\n else if (res.statusCode === 200) {\n this.globalData.is_registered = true;\n this.globalData.access_token = res.data.data.access_token;\n this.globalData.expires_in = res.data.data.expires_in;\n this.globalData.refresh_token = res.data.data.refresh_token;\n }\n else {\n this.globalData.is_registered = false;\n }\n }).catch(err => {\n //console.log(err)\n this.globalData.is_registered = false;\n })\n\n // 显示欢迎页面2秒后跳转到\"我\"页面\n setTimeout(function () {\n wx.reLaunch({\n url: \"/pages/user/user\",\n })\n }, 5000)\n }\n });\n }", "title": "" }, { "docid": "a549181a4f8c1e696846e15cad2cd40d", "score": "0.6437122", "text": "async function apiLogin(usr, pass) {\n const tok= await apiTokenConseguir(usr,pass);\n tokenGuardar(tok, usr);\n return tok;\n}", "title": "" }, { "docid": "fd43fcca1e5ddd51d1b35ac3f9153f0c", "score": "0.643378", "text": "function spotifyLogin(app){\n\n app.ask(app.buildRichResponse()\n // Create a basic card and add it to the rich response\n .addSimpleResponse('Spotify Login')\n .addBasicCard(app.buildBasicCard('Log into Spotify to get concerts specific to you!')\n .setTitle('Log into Spotify')\n .addButton('Log In', 'https://eventagent-401c3.firebaseapp.com')\n .setImage('//logo.clearbit.com/spotify.com', 'Image alternate text')\n .setImageDisplay('CROPPED')\n )\n );\n\n }", "title": "" }, { "docid": "371e80a61f31fa455da1a6901cb59c6c", "score": "0.6415195", "text": "function check_login_user() {\n\n /* get data from login form */\n var username=document.getElementById('login_username').value;\n var password=btoa(document.getElementById('login_password').value);\n\n var url = \"http://148.72.206.6:8081/login/validate\";\n var requestType = 'POST';\n var elementStatus = \"login_loading\";\n requestJSON = new LoginRequestBody(username,password);\n body = JSON.stringify(requestJSON);\n\n //Passing responseFromLoginCheck as Callback function so as per the response this will get called and will take further action required\n SendHttpRequestAndReturnResponse(url, requestType, false, body, elementStatus, \"Kuch Bhi nhi, abhi Generic h\", false, null, responseFromLoginCheck);\n\n}", "title": "" }, { "docid": "3933e0f39031bf804afba94b1e6d0ffa", "score": "0.6414283", "text": "function login() {\r\n var username = $(\"#usernameFld\").val();\r\n var pass = $(\"#passwordFld\").val();\r\n if (username.length > 0) {\r\n console.log(\"accessing as \" + username + \":\" + pass);\r\n userService.logon(username, pass).then(goToProfile,\r\n function (loss) {\r\n console.log(\"Is this loss?\")\r\n });\r\n } else {\r\n console.log(\"Error, something missing\");\r\n }\r\n }", "title": "" }, { "docid": "5d3584ceb62bd5adf2e924afcf01f80b", "score": "0.64120644", "text": "function doLogin() {\n const UNAME = byId('uname').value;\n const PSW = byId('psw').value;\n\n if ((byId('uname').value != '') & (byId('psw').value != '')) {\n xhr.addEventListener('readystatechange', processLogin, false);\n xhr.open('GET', `login.php?name=${UNAME}&password=${PSW}`, true);\n xhr.send(null);\n }\n}", "title": "" }, { "docid": "7786bc5abada3b7b5f98015bfa20aee6", "score": "0.6406426", "text": "function doLogin() {\r\n Auth.authenticate( vm.oLoginData ).then( function () {\r\n $state.go( 'messageList' );\r\n }, function ( err ) {\r\n //PubSub.publish( 'notifications', {\r\n // msg: err.errorDescription || 'An error occurred, please try again',\r\n // type: 'danger',\r\n // detail: null,\r\n // err: err\r\n //});\r\n $state.go( 'login' );\r\n });\r\n }", "title": "" }, { "docid": "e6506be94928da1f221d1cb2120d706d", "score": "0.63999486", "text": "static logInAJAX(login, password) {\n let documentURI = new URL(document.documentURI);\n let url = new URL(\"/account/auth\", documentURI.origin);\n\n url.searchParams.set(\"login\", login);\n url.searchParams.set(\"password\", password);\n\n return httpRequest({\n url: '/account/auth',\n method: 'POST',\n responseType: 'json',\n data: JSON.stringify({\n login: login,\n password: password\n })\n }).then(account => {\n let user;\n if (!account) {\n console.log(\"HttpResponse define null or undefined.\");\n } else if (!account.status) {\n throw new Error(\"Status define null or undefined.\");\n } else if (account.status === \"client\") {\n user = new Client(account);\n } else if (account.status === \"admin\") {\n user = new Administrator(account);\n }\n userStatus = user.status;\n return user;\n }).catch(reject => {\n console.log(reject);\n return null;\n });\n }", "title": "" }, { "docid": "dccff4f239b69bc3926353bc078be3fd", "score": "0.6393976", "text": "login() {\n this.#reset();\n const host = window.location.hostname;\n const path = window.location.pathname.substr(1);\n window.location.replace(\n `${this.authurl}login?continue=${host}&resource=${path}`\n );\n }", "title": "" }, { "docid": "73cfc95641184b299b55609bab8427df", "score": "0.6387212", "text": "function ipythonLogin(token) {\n window.kb = new window.KBCacheClient(token); // just as bad as global, but passes linting\n $.ajax({\n url: JupyterUtils.url_join_encode(baseUrl, 'login'),\n })\n .then(() => {\n // console.log(ret);\n })\n .fail(() => {\n // console.err(err);\n });\n }", "title": "" }, { "docid": "b8f426149daab89c37c53c5aaab1d702", "score": "0.6379024", "text": "function submitLogin() {\n const params = new FormData(document.getElementById(\"login-form\"));\n fetch(\"/login\", {method: \"POST\", body: params})\n .then(statusCheck)\n .then(resp => resp.json())\n .then(json => {\n /*\n * this is a pattern that appears a lot and might not be necessary, because the http code\n * should already indicate whether or not an error has ocurred. I haven't implemented\n * the response returning with http error codes yet though, so this will be a way to double\n * check\n */\n if (json[\"result\"] === \"ok\") {\n // redirect user back to main page\n window.location.href = \"index.html\";\n } else {\n handleLoginError();\n }\n })\n .catch(handleLoginError); // we throw away the error text, just tell the user that it failed\n }", "title": "" }, { "docid": "244e2ebbc79d083db94550bc8f298d90", "score": "0.63738567", "text": "registerAndLogin(){\n this.add(\"registerAndLogin\", async function(api){\n await api.post(\"/v1/auth/register\", {\n \"emailAddress\": \"[email protected]\",\n \"password\": \"ThisIs1CleverTestPassword!\",\n });\n // api object automatically extracts session ID\n await api.post(\"/v1/auth/login\", {\n \"emailAddress\": \"[email protected]\",\n \"password\": \"ThisIs1CleverTestPassword!\",\n });\n });\n }", "title": "" }, { "docid": "2053ca9890c3847ec8348a23394cac7f", "score": "0.63715357", "text": "function loginRequest(email, password) {\n\n}", "title": "" }, { "docid": "0cafaee60af330e0ac7d8bccd12df727", "score": "0.6364453", "text": "function doLogin() {\n\n\t$(\"#message\").html(\"Aguarde...\");\n\n\tvar pars = $(\"#form_data\").serializeObject();\t\n\t\tpars.email = pars.username;\n\t\t\n\t\tdelete pars.username;\n\n\t$.ajax({\n\t\ttype : \"POST\",\n\t\turl : url + '/api/session',\n\t\tdata:pars,\n\t\tcache: false,\t\t\n\t\terror: function (response) {\t\t\n\t\t\tswitch(response.status) {\t\t\t\n\t\t\t\tcase 401:\n\t\t\t\t\t$(\"#message\").html(\"usuario não autorizado\");\n\t\t\t\t\tbreak;\t\n\t\t\t \tdefault:\n\t\t\t\t\t$(\"#message\").html(\"Erro no login\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\tsuccess: function (response, status, jXHR) {\n\t\t\t\n\t\t\tif (!response.disabled) {\n\t\t\t\n\t\t\t\t$(location).attr('href', url+'?token='+response.token);\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t} else {\n\t\t\t\t$(\"#message\").html(\"Erro no login\");\n\t\t\t}\t\t \t\t\t\n\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "a9a89c7f599867e7c7c10f3010ff77e7", "score": "0.63601375", "text": "function requestLogin() {\n return {\n type: REQUEST_LOGIN\n };\n}", "title": "" }, { "docid": "f5d81485c9c5f3f4b66eeb1e2794e80a", "score": "0.6358931", "text": "function login(un, pw, cfg, cb) {\n api.create({\n apiUrl: cfg.API_URL,\n uploadUrl: cfg.UPLOAD_URL,\n dataUrl: cfg.DATA_URL,\n version: 'uploader node CLI tool - Medtronic 600-series',\n });\n api.init(() => {\n api.user.login({\n username: un,\n password: pw,\n }, cb);\n });\n}", "title": "" }, { "docid": "e6662a848f81c67b2166519f5d98b87e", "score": "0.6358182", "text": "login(username, password) {\n\t\treturn fetch(\n\t\t\t'https://api.liberator.me/users/login/', \n\t\t\t{\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t},\n\t\t\t\tbody: 'username=' + encodeURI(username) + '&password=' + encodeURI(password),\n\t\t\t}\n\t\t).then( resp => {\n\n\t\t\tif( resp.status==200 ) {\n\t\t\t\treturn resp.json();\n\t\t\t} else if (resp.status==401) {\n\t\t\t\tthrow('User/pass combination does not match.');\n\t\t\t} else {\n\t\t\t\tthrow('User could not be logged in, try again later.');\n\t\t\t}\n\n\t\t\t\n\t\t}).then( json => { \n\t\t\t//assume that we'll always get a user back\n\t\t\treturn json.user;\n\t\t});\n\t}", "title": "" }, { "docid": "b3bd11e74336e9a4e8683fd1bf978296", "score": "0.6347547", "text": "async function login() {\n if (!session.info.isLoggedIn) {\n await session.login({\n oidcIssuer: SOLID_IDENTITY_PROVIDER,\n clientName: \"Inrupt tutorial client app\",\n redirectUrl: window.location.href\n });\n }\n}", "title": "" }, { "docid": "f492cf965ee0e30841ac19417a226c6b", "score": "0.63449097", "text": "function login (email, password) {\n const options = { \n call : 'login',\n method: 'post',\n body: {\n 'email': email,\n 'password': password\n }\n };\n return makeRequest(options);\n}", "title": "" }, { "docid": "44d65cb1237584ee9686135af26a2387", "score": "0.6339984", "text": "tryLogin() {\n Backend.login(null,null, function(err) {\n if (!err) {\n NavigationService.navigate('incomes');\n } else {\n NavigationService.navigate('Login');\n }\n });\n }", "title": "" }, { "docid": "c00f30348f876a646f9ab60879cc19fb", "score": "0.6319403", "text": "login() {\n // login to server to get cookie\n return new Promise( (resolve, reject) => {\n request({\n url: this.baseUrl + '/system/http/login',\n method: 'post',\n form: {\n u: this.username,\n p: this.password,\n referer: '/bcgui/index.html'\n },\n jar: true\n },\n (error, response = {}, body) => {\n if(response.statusCode === 403) {\n return reject(new Error('Wrong username or password'));\n }\n if(error || response.statusCode !== 200) {\n const err = error ? error : new Error('Login failed');\n return reject(err);\n }\n\n // Save cookie if login is successful\n this.sessionId = response.headers['set-cookie'][0].split(';')[0].split('=')[1];\n\n resolve();\n });\n });\n }", "title": "" }, { "docid": "28a7e3add47ecc8f63ecdd9be54ce174", "score": "0.6315597", "text": "login(callback) {\n const headers = {\n 'Content-Type': 'application/json; charset=UTF-8',\n 'Accept': 'application/json; charset=UTF-8',\n 'Version': 1,\n 'X-IG-API-KEY': this.key\n };\n\n const credentials = {\n 'identifier': this.identifier,\n 'password': this.password\n };\n\n rest.postJson(this.ighost + 'session', credentials, {headers: headers}).on('complete', (data, res) => {\n console.log(data);\n console.log(res.statusCode);\n this.cst = res.headers['cst'];\n this.token = res.headers['x-security-token'];\n callback(null,data);\n });\n\n }", "title": "" }, { "docid": "0ceab259c45aee7cf36c2b72cd597002", "score": "0.6315315", "text": "async function handleLogin() {\n try {\n const userData = await API.graphql(graphqlOperation(getUser, { id: login }))\n //console.log('userData', userData)\n if (userData.data.getUser.password === password)\n setToken({\n id: userData.data.getUser.id,\n department: userData.data.getUser.department,\n profile: userData.data.getUser.profile,\n })\n else setStatus('error')\n } catch (err) {\n console.log('error fetching User', err)\n }\n }", "title": "" }, { "docid": "efbf355c68966ded14c29d6c11e07a38", "score": "0.6312363", "text": "login(name = null, password = null) {\n return new Promise((resolve, reject) => {\n ApiService.post(\"/auth/login\", {\n name: name,\n password: password\n })\n .then(response => {\n this.setUserToken(response.data.token);\n return resolve(response.data);\n })\n .catch(err => {\n return reject(\"Username/password incorrect\", err);\n });\n });\n }", "title": "" }, { "docid": "7cbc2e1c8c2099443b915769746479b2", "score": "0.6309854", "text": "function login(call , callback){\n var request = call.request;\n console.log('request:', request);\n var response = 'fb339152-d2e8-11e9-bb65-2a2ae2dbcce4';\t\n callback(null, response);\n}", "title": "" }, { "docid": "09c9ba03a58a2d01c51ec1cae348343f", "score": "0.629481", "text": "doLogIn() {\n const userStr = document.getElementById('username').value;\n const pwStr = document.getElementById('password').value;\n\n // debugging\n console.log('Login Initiated.');\n console.log(`Username: ${userStr}, Password: ${pwStr}`);\n\n // get rid of whitespaces from login\n userStr.replace(/\\s+$/, '');\n\n const sendObj = { username: userStr, password: pwStr };\n const requestBody = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n\n body: JSON.stringify(sendObj),\n };\n\n // ping the backend with the\n fetch('/login', requestBody)\n .then((response) => response.json())\n .then((data) => {\n // based on returned login state, change the ribbon\\\n console.log('loginFail state: ', data.loginFail);\n this.setState({ loginFail: data.loginFail });\n })\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "4eacff3d660fa8f1be034a49acd77758", "score": "0.6292482", "text": "function doLogin()\n{\n\tuserId = 0;\n\n\tvar login = document.getElementById(\"loginName\").value;\n\tvar password = document.getElementById(\"loginPassword\").value;\n\tvar hash = md5( password );\n\n\tuser = login;\n\n\tdocument.getElementById(\"loginResult\").innerHTML = \"\";\n\n\tvar jsonPayload = '{\"login\" : \"' + login + '\", \"password\" : \"' + hash + '\"}';\n\tvar url = urlBase + '/api/user/login.' + extension;\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", url, false);\n\txhr.setRequestHeader(\"Content-type\", \"application/json; charset=UTF-8\");\n\n\ttry\n\t{\n\t\txhr.send(jsonPayload);\n\t\tvar jsonObject = JSON.parse( xhr.responseText );\n\t\tuserId = jsonObject.id;\n\n\t\tif( userId < 1 )\n\t\t{\n\t\t\tdocument.getElementById(\"loginResult\").innerHTML = \"User/Password combination incorrect\";\n\t\t\treturn;\n\t\t}\n\n\t\tsaveCookie();\n\t\twindow.location.href = \"contactPage.html\";\n\t\tgetAllContacts();\n\t}\n\tcatch(err)\n\t{\n\t\tdocument.getElementById(\"loginResult\").innerHTML = err.message;\n\t}\n\n}", "title": "" }, { "docid": "c70562b6f1e4ca4d4ea14daeb7a6103d", "score": "0.6286108", "text": "function doLogin()\n{\n\tuserId = 0;\n\n\tvar login = document.getElementById(\"loginName\").value;\n\tvar password = document.getElementById(\"loginPassword\").value;\n\t// var hash = md5( password );\n\n\tuser = login;\n\n\tdocument.getElementById(\"loginResult\").innerHTML = \"\";\n\n\tvar jsonPayload = '{\"username\" : \"' + login + '\", \"password\" : \"' + password + '\"}';\n\tvar url = 'http://vh1/api/user/login.' + extension; //needs to be modified \n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", url, false);\n\txhr.setRequestHeader(\"Content-type\", \"application/json; charset=UTF-8\");\n\txhr.withCredentials = false;\n\t// console.log(jsonPayload);\n\ttry\n\t{\n\t\txhr.send(jsonPayload);\n\t\tvar jsonObject = JSON.parse( xhr.responseText );\n\t\tuserId = jsonObject.id;\n\n\t\t// console.log(jsonObject['status']);\n\n\t\tif( jsonObject['status'] != true )\n\t\t{\n\t\t\tdocument.getElementById(\"loginResult\").innerHTML = \"User/Password combination incorrect\";\n\t\t\treturn;\n\t\t}\n\n\t\tsessionStorage.setItem('userId', login);\n\n\t\tsaveCookie();\n\t\tvar usertype = \"\";\n\t\tusertype = getRole();\n\t\tconsole.log(usertype);\n\n\t\tif(usertype == \"admin\"){\n\t\t\tconsole.log(\"user is admin\");\n\t\t\twindow.location.href = \"dashboard.html\";\n\t\t}\n\n\t\telse if (usertype == \"superadmin\")\n\t\t\twindow.location.href = \"superadmin.html\";\n\n\t}\n\tcatch(err)\n\t{\n\t\tdocument.getElementById(\"loginResult\").innerHTML = err.message;\n\t}\n}", "title": "" }, { "docid": "0dcd55732ebcfdff4db7e3ea3010fa55", "score": "0.62807226", "text": "signIn() {\n let username = this.state.username;\n let password = this.state.password;\n let credentials = new URLSearchParams();\n credentials.append(\"username\", username);\n credentials.append(\"password\", password);\n fetch(\"/CalculatorAPI/StartSession\", {\n method: \"POST\",\n body: credentials\n }).then((response) => response.json())\n .then(result => {\n if (!result.error) {\n if (result.hasSession) {\n this.props.signIn();\n } else {\n this.invalidCredentials();\n }\n } else {\n this.errorMessage();\n }\n }).catch((reason) => {\n this.errorMessage();\n });\n }", "title": "" }, { "docid": "822a26ae3140f457d7f5ef6cdc1fb26d", "score": "0.6280583", "text": "function getLoginToken() {\n var params_0 = {\n action: \"query\",\n meta: \"tokens\",\n type: \"login\",\n format: \"json\"\n };\n\n request.get({ url: url, qs: params_0 }, function (error, res, body) {\n if (error) {\n return;\n }\n var data = JSON.parse(body);\n loginRequest(data.query.tokens.logintoken);\n });\n}", "title": "" }, { "docid": "21a50331bc5ed4907d549c8886594ec1", "score": "0.62767816", "text": "handleLogin(data) {\n new CallAPI().loginUser(data, (err) => {\n if(err) {\n alert(\"Error loggin in. Please try again.\");\n return;\n }\n this.showHome();\n });\n }", "title": "" }, { "docid": "dd2db9c3524ec551f0de08f003721be6", "score": "0.6276642", "text": "async login() {\n\n const { authConfig } = this.config;\n\n const authUrl = `${authConfig.url_prefix}${authConfig.auth_url}`;\n const loginData = this.getLoginData();\n const urlEncodedData = querystring.stringify(loginData);\n const headers = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n\n let response = await aInstance({\n \"method\": 'post',\n \"url\": authUrl,\n \"data\": urlEncodedData,\n \"headers\": headers\n })\n\n .then((response) => {\n\n const { access_token, expires_in } = response.data;\n\n this.setToken(access_token);\n this.setExpiry(expires_in);\n\n return this;\n\n })\n .catch( (response) => {\n //handle error\n console.error(response);\n });\n\n\n return await response;\n\n }", "title": "" } ]
8ea0e552796bb85ec3c241401f241f2b
Get source language. Unsupported in xmb/xtb. Try to guess it from master filename if any..
[ { "docid": "a5eff53bafe31377cd6b47a1087281f4", "score": "0.7998553", "text": "sourceLanguage() {\r\n if (this._masterFile) {\r\n return this._masterFile.sourceLanguage();\r\n }\r\n else {\r\n return null;\r\n }\r\n }", "title": "" } ]
[ { "docid": "1f00f3c7239bfdac582d031b985a0544", "score": "0.71987164", "text": "function determineSelectedLanguageCode() {\n var selectedLanguageCode,\n path = window.location.pathname;\n if (window.location.origin.indexOf(\"readthedocs\") > -1) {\n // path is like /en/<branch>/<lang>/build/ -> extract 'lang'\n // split[0] is an '' because the path starts with the separator\n selectedLanguageCode = path.split(\"/\")[3];\n } else if (!window.location.href.startsWith(\"file://\")) {\n // path is like /<lang>/build/ -> extract 'lang'\n selectedLanguageCode = path.substr(1, 2);\n }\n if (!selectedLanguageCode || selectedLanguageCode.length > 2) {\n selectedLanguageCode = defaultLanguageCode;\n }\n return selectedLanguageCode;\n }", "title": "" }, { "docid": "cf1dee87b0f3f8921b55225f972a483c", "score": "0.70717376", "text": "function fgpGetLang() {\n\tvar docurl = document.URL;\n\tif ((docurl.indexOf('/en/') !== -1) || (docurl.indexOf('/eng') !== -1)) {\n\t\treturn \"eng\";\n\t} else {\n\t\treturn \"fre\";\n\t}\n}", "title": "" }, { "docid": "02ff826292dbd56860b6b64eea4af8f5", "score": "0.70015556", "text": "function getLanguage(file) {\n if (!file.includes(`.`)) {\n return `none`\n }\n\n const extension = file.split(`.`).pop()\n return FILE_EXTENSION_TO_LANGUAGE_MAP.hasOwnProperty(extension) ? FILE_EXTENSION_TO_LANGUAGE_MAP[extension] : extension.toLowerCase()\n}", "title": "" }, { "docid": "fd4bbb642140258b2390338cf8ab6453", "score": "0.68902296", "text": "adaptedLanguage (lang) {\n let language = lang || 'Other'\n\n switch (language) {\n case 'Shell': return 'Bash'\n case 'C#': return 'cs'\n case 'Objective-C': return 'objectivec'\n case 'Objective-C++': return 'objectivec'\n case 'Visual Basic': return 'vbscript'\n default:\n }\n return language\n }", "title": "" }, { "docid": "d41f03939e6bcd2ef39a5e3c1637bee2", "score": "0.68162817", "text": "getLanguage ()\n\t{\n\t\treturn studio.settings.loadValue('workspace','language',getLanguage ());\n\t}", "title": "" }, { "docid": "9d185acce6ffbbedec871422977e36da", "score": "0.6564439", "text": "function getLanguage() {\r\n\t\t// first try to find the youtube language for best blending\r\n\t\tvar language=unsafeWindow.ytLocale;\r\n\t\tif(isDefined(language)) {\r\n\t\t\tlanguage = language.substr(0,2);\r\n\t\t\tif(isDefined(translation[language])) {\r\n\t\t\t\treturn language;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// next try the browser default language\r\n\t\tlanguage=String.substr(window.navigator.language,0,2);\r\n\t\tif(isDefined(language) && isDefined(translation[language])) {\r\n\t\t\treturn language;\r\n\t\t}\r\n\t\t\r\n\t\tif(isDefined(translation[defaultLanguage])) {\r\n\t\t\treturn defaultLanguage;\r\n\t\t}\r\n\t\t\r\n\t\t// punt! return the first language defined\r\n\t\tfor (var key in translation) {\r\n\t\t\treturn key;\r\n\t\t}\r\n\t\t\r\n\t}", "title": "" }, { "docid": "98c3befe9c18f6f4890c78605f4d610a", "score": "0.6419", "text": "function getCurrentLang() {\r\n return getSetting(\"lang\", _a[worldLetters] && worldLetters || \"en\");\r\n /*Return the \"lang\" setting, or else if there's a translation for the current world's code, return that, or else \"en\".*/\r\n}", "title": "" }, { "docid": "05187265b0d77bc830fbeb960f4b8fc1", "score": "0.63423365", "text": "function getLangString(curTransLang,curElement,curClass,curTransChunk,transChunksLen,j,curClassNum) {\r\n\t\r\n\tvar detectedLang = \"\";\r\n\r\n\t// if the current element does not need a language string appended, end function\r\n\tif(curClass[2] != true) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// if source language for current element has already been manually specified, set this as detected language\r\n\tif(curClass[1] != \"\") {\r\n\t\tdetectedLang = curClass[1];\r\n\t}\r\n\t// otherwise find out language based on the detected source languages for translated chunks in current element \r\n\telse {\r\n\t\tdetectedLang = findDetectedLang(curTransLang,curTransChunk,transChunksLen);\r\n\t}\r\n\r\n\t// if detected language is same as site language, there is no need to display language string, so end function\r\n\tif(detectedLang == GL_curLang){\r\n\t\t\treturn;\r\n\t}\r\n\r\n\tvar srcLangString = getFmtLangStr(detectedLang); // retrieve name of detected language as a formatted string \r\n\r\n\t// append language string to current element...\r\n\tcurElement.innerHTML += '<div style=\"color: green;\" id=\"mlt_srctxt' + j + '\">[<span class=\"mlt_langstring\" ' +\r\n\t'style=\"font-family: arial, sans-serif; font-size: 11px;\"><em>Automatic translation from ' + srcLangString + \r\n\t': ' + google.language.getBranding().innerHTML + '</em> - <a id=\"mlt_srctxtlnk' + j + '\" href=\"javascript:showSrcTxt(' + \r\n\tj + ',' + curClassNum + ',0)\">View Source Text [+]</a></span><span id=\"mlt_srctxtbracket' + j + '\">]</span></div>';\r\n}", "title": "" }, { "docid": "2d8cbc755dd8139f8dffafa770e5f312", "score": "0.6332029", "text": "function getLanguage() {\n return 'en-us';\n}", "title": "" }, { "docid": "2d8cbc755dd8139f8dffafa770e5f312", "score": "0.6332029", "text": "function getLanguage() {\n return 'en-us';\n}", "title": "" }, { "docid": "1957010ff8a67c59ee14e2c04afdbc1a", "score": "0.63272536", "text": "function getCurrentLanguage(){ return languageFlag; }", "title": "" }, { "docid": "538d554f49566ccba5785d2e6c35ece2", "score": "0.6318463", "text": "function getLanguage()\r\n{\r\n var locale = \"\";\r\n if (navigator.languages != undefined) {\r\n locale = navigator.languages[0];\r\n } else {\r\n locale = navigator.language;\r\n }\r\n\r\n return locale.replace(\"-\", \"\").replace(\"_\", \"\").toLowerCase();\r\n}", "title": "" }, { "docid": "88187090723574f6f4067e84563b8c61", "score": "0.6315404", "text": "function lang() {\n\treturn document.documentElement.lang\n}", "title": "" }, { "docid": "c592432ab0b739a57b402a66ab38d6c2", "score": "0.6309189", "text": "function langConvert(src) {\n\tvar convert = src;\n\tif (hpvars.lang == 'tc') {\n\t\tswitch (src.trim().toLowerCase()) {\n\t\t\tcase 'cantonese':\n\t\t\tcase 'zh_au':\n\t\t\t\tconvert = '粵語';\n\t\t\t\tbreak;\n\t\t\tcase 'mandarin':\n\t\t\tcase 'qph_au':\n\t\t\t\tconvert = '國語';\n\t\t\t\tbreak;\n\t\t\tcase 'english':\n\t\t\tcase 'eng_au':\n\t\t\t\tconvert = '英語';\n\t\t\t\tbreak;\n\t\t\tcase 'french':\n\t\t\t\tconvert = '法語';\n\t\t\t\tbreak;\n\t\t\tcase 'japanese':\n\t\t\t\tconvert = '日語';\n\t\t\t\tbreak;\n\t\t\tcase 'korean':\n\t\t\t\tconvert = '韓語';\n\t\t\t\tbreak;\n\t\t\tcase 'others':\n\t\t\t\tconvert = '其他';\n\t\t\t\tbreak;\n\t\t\tcase 'polish':\n\t\t\t\tconvert = '波蘭語';\n\t\t\t\tbreak;\n\t\t\tcase 'portuguese':\n\t\t\t\tconvert = '葡萄牙語';\n\t\t\t\tbreak;\n\t\t\tcase 'thai':\n\t\t\t\tconvert = '泰語';\n\t\t\t\tbreak;\n\t\t\tcase 'vietnamese':\n\t\t\t\tconvert = '越南語';\n\t\t\t\tbreak;\n\t\t\tcase 'channel':\n\t\t\t\tconvert = '聲道';\n\t\t\t\tbreak;\n\t\t\tcase 'caption':\n\t\t\t\tconvert = '字幕';\n\t\t\t\tbreak;\n\t\t\tcase 'quality':\n\t\t\t\tconvert = '影片質素';\n\t\t\t\tbreak;\n\t\t\tcase 'auto':\n\t\t\t\tconvert = '自動';\n\t\t\t\tbreak;\n\t\t\tcase 'low':\n\t\t\t\tconvert = '低';\n\t\t\t\tbreak;\n\t\t\tcase 'high':\n\t\t\t\tconvert = '中';\n\t\t\t\tbreak;\n\t\t\tcase 'hd':\n\t\t\t\tconvert = '高';\n\t\t\t\tbreak;\n\t\t\tcase 'chi':\n\t\t\tcase 'tc':\n\t\t\tcase 'zh':\n\t\t\t\tconvert = '繁中';\n\t\t\t\tbreak;\n\t\t\tcase 'chs':\n\t\t\tcase 'sc':\n\t\t\t\tconvert = '简中';\n\t\t\t\tbreak;\n\t\t\tcase 'eng':\n\t\t\tcase 'en':\n\t\t\t\tconvert = 'English';\n\t\t\t\tbreak;\n\t\t\tcase 'au1':\n\t\t\tcase 'au1_au':\n\t\t\t\tconvert = '聲道1';\n\t\t\t\tbreak;\n\t\t\tcase 'au2':\n\t\t\tcase 'au2_au':\n\t\t\t\tconvert = '聲道2';\n\t\t\t\tbreak;\n\t\t\tcase 'au3':\n\t\t\tcase 'au3_au':\n\t\t\t\tconvert = '聲道3';\n\t\t\t\tbreak;\n\t\t\tcase 'ads':\n\t\t\t\tconvert = '廣告';\n\t\t\t\tbreak;\n case 'upnext':\n convert = '即將播放';\n break;\n\t\t\tdefault:\n\t\t\t\tconvert = '自動';\n\t\t}\n\t} else if (hpvars.lang == 'en') {\n\t\tswitch (src.trim().toLowerCase()) {\n\t\t\tcase 'cantonese':\n\t\t\tcase 'zh_au':\n\t\t\t\tconvert = 'Cantonese';\n\t\t\t\tbreak;\n\t\t\tcase 'mandarin':\n\t\t\tcase 'qph_au':\n\t\t\t\tconvert = 'Mandarin';\n\t\t\t\tbreak;\n\t\t\tcase 'english':\n\t\t\tcase 'eng_au':\n\t\t\t\tconvert = 'English';\n\t\t\t\tbreak;\n\t\t\tcase 'french':\n\t\t\t\tconvert = 'French';\n\t\t\t\tbreak;\n\t\t\tcase 'japanese':\n\t\t\t\tconvert = 'Japanese';\n\t\t\t\tbreak;\n\t\t\tcase 'korean':\n\t\t\t\tconvert = 'Korean';\n\t\t\t\tbreak;\n\t\t\tcase 'others':\n\t\t\t\tconvert = 'Others';\n\t\t\t\tbreak;\n\t\t\tcase 'polish':\n\t\t\t\tconvert = 'Polish';\n\t\t\t\tbreak;\n\t\t\tcase 'portuguese':\n\t\t\t\tconvert = 'Portuguese';\n\t\t\t\tbreak;\n\t\t\tcase 'thai':\n\t\t\t\tconvert = 'Thai';\n\t\t\t\tbreak;\n\t\t\tcase 'vietnamese':\n\t\t\t\tconvert = 'Vietnamese';\n\t\t\t\tbreak;\n\t\t\tcase 'channel':\n\t\t\t\tconvert = 'Channel';\n\t\t\t\tbreak;\n\t\t\tcase 'caption':\n\t\t\t\tconvert = 'Subtitle';\n\t\t\t\tbreak;\n\t\t\tcase 'quality':\n\t\t\t\tconvert = 'Quality';\n\t\t\t\tbreak;\n\t\t\tcase 'auto':\n\t\t\t\tconvert = 'Auto';\n\t\t\t\tbreak;\n\t\t\tcase 'low':\n\t\t\t\tconvert = 'Low';\n\t\t\t\tbreak;\n\t\t\tcase 'high':\n\t\t\t\tconvert = 'Middle';\n\t\t\t\tbreak;\n\t\t\tcase 'hd':\n\t\t\t\tconvert = 'High';\n\t\t\t\tbreak;\n\t\t\tcase 'chi':\n\t\t\tcase 'tc':\n\t\t\tcase 'zh':\n\t\t\t\tconvert = '繁中';\n\t\t\t\tbreak;\n\t\t\tcase 'chs':\n\t\t\tcase 'sc':\n\t\t\t\tconvert = '简中';\n\t\t\t\tbreak;\n\t\t\tcase 'eng':\n\t\t\tcase 'en':\n\t\t\t\tconvert = 'English';\n\t\t\t\tbreak;\n\t\t\tcase 'au1':\n\t\t\tcase 'au1_au':\n\t\t\t\tconvert = 'audio 1';\n\t\t\t\tbreak;\n\t\t\tcase 'au2':\n\t\t\tcase 'au2_au':\n\t\t\t\tconvert = 'audio 2';\n\t\t\t\tbreak;\n\t\t\tcase 'au3':\n\t\t\tcase 'au3_au':\n\t\t\t\tconvert = 'audio 3';\n\t\t\t\tbreak;\n\t\t\tcase 'ads':\n\t\t\t\tconvert = 'Ads';\n\t\t\t\tbreak;\n case 'upnext':\n convert = 'Up Next';\n break;\n\t\t\tdefault:\n\t\t\t\tconvert = 'auto';\n\t\t}\n\t}\n\treturn convert;\n}", "title": "" }, { "docid": "ef055877c59980d2a6a3f39f36c1ac9e", "score": "0.62138736", "text": "function getApplicationLanguageString()\n{\n\tvar languageString;\n\tswitch (applicationLanguage)\n\t{\n\t\tcase Languages.RO:\n\t\t\tlanguageString = \"RO\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlanguageString = \"EN\";\n\t}\n\treturn languageString;\n}", "title": "" }, { "docid": "c37d1564e635955615dc5e71d306a7ed", "score": "0.6200637", "text": "getCurrentLanguage_() {\n const LANGUAGE_LIST_ID = 'languageList';\n if (loadTimeData.valueExists(LANGUAGE_LIST_ID)) {\n var languageList = /** @type {!Array<OobeTypes.LanguageDsc>} */ (\n loadTimeData.getValue(LANGUAGE_LIST_ID));\n if (languageList) {\n var language = getSelectedValue(languageList);\n if (language) {\n return language;\n }\n }\n }\n return navigator.language;\n }", "title": "" }, { "docid": "48d46075e859d16077cf7aaee002059e", "score": "0.61885434", "text": "function getLanguage() {\n if (_language === undefined) {\n var doc = dom_1.getDocument();\n var savedLanguage = localStorage_1.getItem('language');\n if (savedLanguage !== null) {\n _language = savedLanguage;\n }\n if (_language === undefined && doc) {\n _language = doc.documentElement.getAttribute('lang');\n }\n if (_language === undefined) {\n _language = 'en';\n }\n }\n return _language;\n}", "title": "" }, { "docid": "48d46075e859d16077cf7aaee002059e", "score": "0.61885434", "text": "function getLanguage() {\n if (_language === undefined) {\n var doc = dom_1.getDocument();\n var savedLanguage = localStorage_1.getItem('language');\n if (savedLanguage !== null) {\n _language = savedLanguage;\n }\n if (_language === undefined && doc) {\n _language = doc.documentElement.getAttribute('lang');\n }\n if (_language === undefined) {\n _language = 'en';\n }\n }\n return _language;\n}", "title": "" }, { "docid": "049a5a1a01053d9a43283c89c5e48608", "score": "0.617617", "text": "function getLanguage() {\n try {\n var getLang = localStorage.getItem(\"yi-lang\");\n if ((getLang == \"\") || (getLang == null)) {\n getLang = \"en\";\n }\n lang = getLang;\n } catch (e) {\n lang = \"en\";\n }\n}", "title": "" }, { "docid": "f9b693735969d12309f8a48c7449d767", "score": "0.61665547", "text": "function getLangFromNavigator() {\r\n\t\tvar ln = String(navigator.language).split('-')[0],\r\n\t\t\tavailable = ['en', 'cs', 'sk', 'de', 'tr', 'pl', 'ru', 'hu', 'nl', 'fr', 'pt', 'hr'],\r\n\t\t\tindex = available.indexOf(ln);\r\n\t\treturn index >= 0 ? available[index] : 'en';\r\n\t}", "title": "" }, { "docid": "2c7363b5f5bb50e6bcbe789961f1ef00", "score": "0.6157367", "text": "function getLocalLanguage() {\n if( localStorage.getItem('lang') != null )\n defaultlang = localStorage.getItem('lang');\n}", "title": "" }, { "docid": "74acf7eb709f4bac11fa81b3a24eb115", "score": "0.61561567", "text": "function getLanguageCode(platformID, languageID, ltag) {\n\t switch (platformID) {\n\t case 0: // Unicode\n\t if (languageID === 0xFFFF) {\n\t return 'und';\n\t } else if (ltag) {\n\t return ltag[languageID];\n\t }\n\n\t break;\n\n\t case 1: // Macintosh\n\t return macLanguages[languageID];\n\n\t case 3: // Windows\n\t return windowsLanguages[languageID];\n\t }\n\n\t return undefined;\n\t}", "title": "" }, { "docid": "5b6e30af1b5de356d721f9013bb29954", "score": "0.6153539", "text": "function returnLanguage() {\n var lang = document.location.href.split('/')[3];\n var uaText = {\n open: 'Читати далі',\n close: 'Згорнути'\n };\n var ruText = {\n open: 'Читать далее',\n close: 'Свернуть'\n };\n var enText = {\n open: 'Read more',\n close: 'Close'\n };\n if(lang=='ru') {\n return ruText;\n } else if(lang=='en') {\n return enText;\n } else {\n return uaText;\n }\n }", "title": "" }, { "docid": "cec33a616056dc7a01454be6bff55b53", "score": "0.61512923", "text": "async function getTargetLang(msg) {\n var substring = msg.slice(0);\n var targetLanguage = null;\n while (substring.length > 0) {\n var openBrac = substring.indexOf('(');\n if (openBrac === -1) {\n break;\n }\n var closeBrac = substring.indexOf(')', openBrac);\n if (closeBrac === -1) {\n break;\n }\n var content = substring.slice(openBrac+1, closeBrac);\n console.log(content);\n if (content in supportedLang){\n targetLanguage = content;\n break;\n } else {\n substring = substring.slice(openBrac+1);\n }\n }\n if (targetLanguage == null) {\n try {\n let response = await translate.detect(msg);\n if (response[0].language === 'en') {\n return 'French';\n } else {\n return 'English';\n }\n } catch (error) {\n console.log('Error at detectLanguage --> ${error}');\n return 'English';\n }\n } else {\n return targetLanguage\n }\n}", "title": "" }, { "docid": "5e6154f5d37945a08fee243c673d06d9", "score": "0.61260134", "text": "function getLanguage() {\n\t if (_language === undefined) {\n\t var doc = dom_1.getDocument();\n\t var savedLanguage = localStorage_1.getItem('language');\n\t if (savedLanguage !== null) {\n\t _language = savedLanguage;\n\t }\n\t if (_language === undefined && doc) {\n\t _language = doc.documentElement.getAttribute('lang');\n\t }\n\t if (_language === undefined) {\n\t _language = 'en';\n\t }\n\t }\n\t return _language;\n\t}", "title": "" }, { "docid": "e5d42d8dd3f7ae66acb67dfca7adeb88", "score": "0.6116952", "text": "function getCodeLS() {\r\n return localStorage.getItem('source');\r\n }", "title": "" }, { "docid": "bd35f423c1c186e5de1a23067701d991", "score": "0.61167693", "text": "getUserLang() {\n const lang = window.navigator.language || window.navigator.userLanguage || Trans.defaultLanguage;\n return {\n lang: lang,\n langNoISO: lang.split('-')[0]\n };\n }", "title": "" }, { "docid": "8909bc00c70489af734561a72299fee8", "score": "0.6109843", "text": "getCurrentCulture() {\r\n let urlParam = this.getUrlParam(\"language\");\r\n if (urlParam) {\r\n return urlParam;\r\n }\r\n if (powerbi && powerbi.common && powerbi.common.cultureInfo) {\r\n // Get cultureInfo set in powerbi\r\n return powerbi.common.cultureInfo;\r\n }\r\n return window.navigator.userLanguage || window.navigator[\"language\"] || \"en-US\";\r\n }", "title": "" }, { "docid": "d042548b5e248eab27c25c5a348907a7", "score": "0.61082476", "text": "function get_language() {\n\tif (localStorage.language)\n\t{\n\t\treturn localStorage.language;\n\t}\n\telse\n\t{\n\t\treturn \"en\";\n\t}\n}", "title": "" }, { "docid": "dde42438f8957fd7582b463d51200aea", "score": "0.61038095", "text": "function getLanguage() {\n\t\tvar language = $.cordys.getURLParameter(window.location, \"language\");\n\t\treturn language ? language : (window.navigator.language || window.navigator.userLanguage);\t//userLanguage is specific to IE\n\t}", "title": "" }, { "docid": "d90161acbb5b6b7977c458f47d722386", "score": "0.6091398", "text": "function OpensourceLanguageName(nameObj) {\n var LanguageName;\n LanguageName = nameObj.langName + \" is the main language.\";\n return LanguageName;\n }", "title": "" }, { "docid": "660a8fa447d0c922415a9a25734e4f56", "score": "0.60911876", "text": "function getLanguageCode(platformID, languageID, ltag) {\n switch (platformID) {\n case 0: // Unicode\n if (languageID === 0xFFFF) {\n return 'und';\n } else if (ltag) {\n return ltag[languageID];\n }\n\n break;\n\n case 1: // Macintosh\n return macLanguages[languageID];\n\n case 3: // Windows\n return windowsLanguages[languageID];\n }\n\n return undefined;\n}", "title": "" }, { "docid": "660a8fa447d0c922415a9a25734e4f56", "score": "0.60911876", "text": "function getLanguageCode(platformID, languageID, ltag) {\n switch (platformID) {\n case 0: // Unicode\n if (languageID === 0xFFFF) {\n return 'und';\n } else if (ltag) {\n return ltag[languageID];\n }\n\n break;\n\n case 1: // Macintosh\n return macLanguages[languageID];\n\n case 3: // Windows\n return windowsLanguages[languageID];\n }\n\n return undefined;\n}", "title": "" }, { "docid": "747757ed2bc78021c63b2c7ffeda2395", "score": "0.60893667", "text": "function getOsLang() {\n return navigator.language.substring(0, 2).toUpperCase();\n }", "title": "" }, { "docid": "61ac77456b17c543998403ff0ee2f258", "score": "0.6082113", "text": "getLocale () {\n var locale = atom.config.get('spell-check-case.locale')\n if (locale === undefined || locale === \"\") {\n return navigator.language\n } else {\n return locale\n }\n }", "title": "" }, { "docid": "da749bc3a44c6c5a687c29231d7998fd", "score": "0.6071524", "text": "function returnLangCode(language)\n{\n var langCode;\n \n switch(language)\n {\n \n case \"English\":\n langCode = 'en';\n break; \n \n case \"English US\":\n langCode = 'en-us';\n break; \n \n case \"English UK\":\n langCode = 'en-uk';\n break; \n \n case \"German\":\n langCode = 'de';\n break; \n \n case \"Spanish\":\n langCode = 'es';\n break; \n \n case \"Hindi\":\n langCode = 'hi';\n break; \n \n case \"Mandarin\":\n langCode = 'zh';\n break; \n \n case \"Malay\":\n langCode = 'ms';\n break; \n \n case \"Italian\":\n langCode = 'it';\n break; \n \n case \"French\":\n langCode = 'fr';\n break; \n \n case \"Tamil\":\n langCode = 'ta';\n break;\n \n default:\n console.log(\"Language not supported\");\n langCode = \"\";\n break; \n }\n \n return(langCode);\n}", "title": "" }, { "docid": "3d6605a9bda7622c1271025bbf1c248d", "score": "0.6059734", "text": "function currentLanguage() {\n if (!i18next.language) {\n loadLanguage();\n }\n return i18next.language;\n}", "title": "" }, { "docid": "fa82bce48da074c1953d908e7620b849", "score": "0.6016429", "text": "function get_lang()\n{\t\n var name = \"language=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(\";\");\n for (var i = 0; i < ca.length; i++) \n\t{\n var c = ca[i];\n while (c.charAt(0) == \" \") \n\t\t{\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) \n\t\t{\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n}", "title": "" }, { "docid": "342b32e184f2819af4fcc094e88a98d5", "score": "0.6015581", "text": "function getLocale(lang) {\n\t//var lang = req.headers[\"accept-language\"];\n\tif (!lang) {\n\t\treturn;\n\t}\n\tlet arr;\n\tif (lang.indexOf(\";\") >= 0) {\n\t\tarr = lang.substring(0, lang.indexOf(\";\")).split(\",\");\n\t} else {\n\t\tarr = [lang];\n\t}\n\t//var arr = langparser.parse(lang);\n\t//if (!arr || arr.length < 1) {\n\t//\treturn;\n\t//}\n\t//var locale = arr[0].code;\n\n\tvar locale = arr[0].substring(0, arr[0].indexOf(\"-\"));\n\n\t//if (arr[0].region) {\n\t//\tlocale += \"_\" + arr[0].region;\n\t//}\n\n\tlocale += \"_\" + arr[0].substring(arr[0].indexOf(\"-\") + 1);\n\treturn locale;\n}", "title": "" }, { "docid": "37627516b6803d8b1edd5b8431d61c3d", "score": "0.60080874", "text": "function getFullLanguage(spec) {\n\t return spec.full;\n\t}", "title": "" }, { "docid": "ffa712d2d6f5cb3ceec43d19f627f70b", "score": "0.6006685", "text": "function getLanguage() {\n var n = navigator,\n l = n.language || n.systemLanguage || n.browserLanguage || n.userLanguage || \"\";\n return l.substring(0,2);\n }", "title": "" }, { "docid": "4b5b1efcf46bd8bdbe2cc14be1e54b75", "score": "0.60006535", "text": "findLanguage(resource) {\n const ext = paths_1.Paths.extname(resource.path) || resource.path;\n const language = language_1.LANGUAGES.find(item => item.extension === ext);\n return !!language ? language.id : '';\n }", "title": "" }, { "docid": "c1f40dff13f4149e5d92bbabe546af73", "score": "0.5987159", "text": "function getLanguage() {\n if (_language === undefined) {\n var doc = Object(_dom_getDocument__WEBPACK_IMPORTED_MODULE_0__[\"getDocument\"])();\n var savedLanguage = Object(_localStorage__WEBPACK_IMPORTED_MODULE_1__[\"getItem\"])('language');\n if (savedLanguage !== null) {\n _language = savedLanguage;\n }\n if (_language === undefined && doc) {\n _language = doc.documentElement.getAttribute('lang');\n }\n if (_language === undefined) {\n _language = 'en';\n }\n }\n return _language;\n}", "title": "" }, { "docid": "15eb3e819e1bc9e64fc61d565c74c824", "score": "0.59790677", "text": "function getLanguage() {\n if (_language === undefined) {\n var doc = Object(_dom__WEBPACK_IMPORTED_MODULE_0__[\"getDocument\"])();\n var savedLanguage = Object(_localStorage__WEBPACK_IMPORTED_MODULE_1__[\"getItem\"])('language');\n if (savedLanguage !== null) {\n _language = savedLanguage;\n }\n if (_language === undefined && doc) {\n _language = doc.documentElement.getAttribute('lang');\n }\n if (_language === undefined) {\n _language = 'en';\n }\n }\n return _language;\n}", "title": "" }, { "docid": "0ff6ed27b834a80ae96a197f91d9965e", "score": "0.59678465", "text": "getDefaultLanguage() {\n const fallbackLanguage = this._acceptedLanguages[0] ?? null\n\n return this._defaultLanguage ? this._defaultLanguage : fallbackLanguage\n }", "title": "" }, { "docid": "8d9526d781056534fdd6d257d9f278ba", "score": "0.5930224", "text": "function msg(name) {\n if ( config.userLang && wgUserLanguage in config && name in config[wgUserLanguage] )\n return config[wgUserLanguage][name];\n if ( wgContentLanguage in config && name in config[wgContentLanguage] )\n return config[wgContentLanguage][name];\n return config.en[name];\n }", "title": "" }, { "docid": "8d9526d781056534fdd6d257d9f278ba", "score": "0.5930224", "text": "function msg(name) {\n if ( config.userLang && wgUserLanguage in config && name in config[wgUserLanguage] )\n return config[wgUserLanguage][name];\n if ( wgContentLanguage in config && name in config[wgContentLanguage] )\n return config[wgContentLanguage][name];\n return config.en[name];\n }", "title": "" }, { "docid": "408d1d7b8d47b5f1fd7dcd6902f32e0d", "score": "0.5924917", "text": "function getFmtLangStr(lang) {\r\n\t// loop through list of supported languages and retrieve names\r\n\tfor(var l in google.language.Languages) {\r\n\t\tif(google.language.Languages[l] == lang) {\r\n\t\t\t// convert language string into title case\r\n\t\t\tvar lang = l.substr(0,1) + l.substr(1).toLowerCase();\r\n\t\t\t// improve formatting of 'chinese_simplified' and 'chinese_traditional' language strings\r\n\t\t\tlang = lang.split(\"_\").join(\" - \");\r\n\t\t\tbreak; // stop loop (don't need to continue searching for languages)\r\n\t\t}\r\n\t}\r\n\t// if language cannot be found in list of supported languages, set language to 'unknown'\r\n\tif(typeof lang == \"undefined\") {\r\n\t\tlang = \"An Unknown Language\";\r\n\t}\r\n\treturn lang; // return formatted language string\r\n}", "title": "" }, { "docid": "111798ea4e2f1d6d4103b51232f21bbb", "score": "0.59243906", "text": "function getLanguageString(lang) {\n try {\n languageService.getLanguageString({\n \"page\": $rootScope.selectedCountryShortName + \"_\" + lang + '_agents_reports.json'\n }).then(function (res) {\n $scope.dashboardLangTranslation = res;\n }, function (err) {\n commonService.logException({\n \"methodName\": \"getLanguageString\",\n \"ExceptionDetails\": err\n });\n });\n } catch (ex) {\n commonService.logException({\n \"methodName\": \"getLanguageString\",\n \"ExceptionDetails\": ex\n });\n }\n }", "title": "" }, { "docid": "0468b23bf5bedd6dc3957751736e1103", "score": "0.59213936", "text": "function check_current_site_language_from_path() {\n // Try to find language in hash.\n current_site_language = 'default';\n location_pathname = window.location.pathname;\n pathname_array = location_pathname.split('/').clean('');\n if (pathname_array.length > 0) {\n if ($.inArray(pathname_array[0], $.site_languages) > -1) {\n current_site_language = pathname_array[0];\n }\n }\n return current_site_language;\n}", "title": "" }, { "docid": "729f2cef39076b2c652b1da49ab450d2", "score": "0.59130543", "text": "function find_language() {\n let tag = [... document.getElementsByClassName(\"ant-select-selection-selected-value\")];\n if(tag && tag.length > 0)\n {\n for (let i = 0; i < tag.length; i++) {\n const elem = tag[i].textContent;\n if(elem != undefined && languages[elem] != undefined)\n {\n return languages[elem]; //should generate respective file extension\n }\n }\n return null;\n }\n}", "title": "" }, { "docid": "697d1b5c6a4eed89964f0a41097e4557", "score": "0.58955175", "text": "function determineLanguage() {\n var newL;\n if ((newL = Cookie.getCookie(\"lang\" + window.location.search)) != null) { // some already set language\n lang = newL;\n prepareData();\n return;\n } \n\n // fallback if no language specified in older json versions\n if (json_obj.languages == null) {\n lang = \"cs\"; // change to en eventually - when migrated\n return;\n }\n\n // else see if some enabled language is preferred on the system\n var preferredLanguage = window.navigator.userLanguage || window.navigator.language;\n preferredLanguage = preferredLanguage.split(\"-\")[0]; // to get rid of en-AU en-US etc\n if (json_obj.languages[preferredLanguage] != \"\" && json_obj.languages[preferredLanguage] != null) { // TODO -- not sure about the null checks\n lang = preferredLanguage;\n prepareData();\n return;\n }\n // if not, just pick first enabled language\n for (l of supportedLanguages) {\n if (json_obj.languages[l] != null && json_obj.languages[l] != \"\") { // TODO\n lang = l;\n prepareData();\n return;\n }\n }\n }", "title": "" }, { "docid": "f9a59d613b6737b959a1a80ec7cf1d65", "score": "0.5891717", "text": "function getBrowserLanguage() {\r\n //Lectura del idioma del navegador desde window\r\n return (window.navigator.language || window.navigator.userLanguage).substring(0, 2);\r\n }", "title": "" }, { "docid": "10ecc362c2747284a40e66850ac5d473", "score": "0.5889308", "text": "function getCurrentLanguage() {\n // Get current page URL\n var currentURL = window.location.href;\n\n /* TODO : Explode the currentURL to use the correct language from the URL. */\n currentLanguage = 'fr';\n\n return currentLanguage;\n}", "title": "" }, { "docid": "1ba4a17b2ffe45a3ab8d15ba7974a60f", "score": "0.5884404", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split, get = function(k) {\n if (!languages[k] && hasModule) {\n try {\n require(\"./lang/\" + k);\n } catch (e) {}\n }\n return languages[k];\n };\n if (!key) {\n return moment.fn._lang;\n }\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [ key ];\n }\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split(\"-\");\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split(\"-\") : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join(\"-\"));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "550d3ec3742e06be5e0fbb1b18e2cde2", "score": "0.5871474", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "2761a81d8de42128d8d3a6fecec81c5a", "score": "0.58492655", "text": "function checkLang()\r\n{\r\n var host = window.location.hostname;\r\n hosts = host.split(\".\");\r\n mlang = hosts[hosts.length-1];\r\n}", "title": "" }, { "docid": "865032d3930a6e4d9636f00abe646339", "score": "0.5844782", "text": "function i$Lang(lg) {\n var lang = '';\n var html = document.getElementsByTagName(\"html\");\n var meta = document.getElementsByTagName('script');\n\n if(html[0].getAttribute(\"lang\")) {\n\n lang = html[0].getAttribute(\"lang\");\n\n } else if(html[0].getAttribute(\"locale\")) {\n\n lang = html[0].getAttribute(\"locale\");\n\n } else {\n\n for (var i = 0; i < meta.length; i++) {\n if ((meta[i].getAttribute(\"http-equiv\") && meta[i].getAttribute(\"content\")\n && meta[i].getAttribute(\"http-equiv\").indexOf(\"Language\") > -1)\n ||(meta[i].getAttribute(\"property\") && meta[i].getAttribute(\"content\")\n && meta[i].getAttribute(\"property\").indexOf(\"locale\") > -1)) {\n\n lang = meta[i].getAttribute(\"content\");\n\n }\n }\n }\n return (lang.substr(0,2).toLowerCase() == lg)\n}", "title": "" }, { "docid": "917099b035c509acfb52bb91acd08702", "score": "0.5840837", "text": "function findPreferedLanguage() {\n var candidates = ['de','en'];\n var langHash = findHashParameter('lang');\n if(langHash && candidates.includes(langHash)) {\n return langHash;\n }\n var langGet = findGetParameter('lang');\n if(langGet && candidates.includes(langGet)) {\n return langGet;\n }\n var langNavi = navigator.language || navigator.userLanguage;\n if(langNavi && candidates.includes(langNavi.substr(0,2))) {\n return langNavi.substr(0,2);\n }\n if(navigator.languages) {\n for(var j=0; j<navigator.languages.length; j++) {\n var langList = navigator.languages[j].substr(0,2);\n if(langList && candidates.includes(langList)) {\n return langList;\n }\n }\n } \n return candidates[0];\n}", "title": "" }, { "docid": "2e9313fc006953d1f9ced030871efde6", "score": "0.583726", "text": "function getSystemLanguage()\n{\n\tvar lang = window.navigator.userLanguage || window.navigator.language;\n\treturn lang.toLowerCase();\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "d9b905efb4c7b99795d0152ff017d823", "score": "0.5825563", "text": "function getFullLanguage(spec) {\n return spec.full;\n}", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "71a1476c5b274fd9d4928a434a2f0c94", "score": "0.5801394", "text": "function getLangDefinition(key) {\n var i = 0, j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) { }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "8bcc8033b9d2eef21ace7a5ac56c5e1b", "score": "0.57970405", "text": "get language() {\n return (captions.getCurrentTrack.call(this) || {}).language;\n }", "title": "" }, { "docid": "16039524785e7066a52cdda45d3c2d9c", "score": "0.57956934", "text": "function GetCurrentLanguage() {\n\n return window.localStorage.getItem(\"locale\") || navigator.language;\n }", "title": "" }, { "docid": "b0b0ae08540934e3374392406a19b25e", "score": "0.5794402", "text": "function msg(name) {\n if (config.userLang && wgUserLanguage in config && name in config[wgUserLanguage]) {\n return config[wgUserLanguage][name];\n }\n if (wgContentLanguage in config && name in config[wgContentLanguage]) {\n return config[wgContentLanguage][name];\n }\n return config.en[name];\n }", "title": "" }, { "docid": "8dcf32f5133031f51f6332328c7f9aa0", "score": "0.5793395", "text": "function getLangDefinition(key) {\n var i = 0,\n j, lang, next, split,\n get = function (k) {\n if (!languages[k] && hasModule) {\n try {\n require('./lang/' + k);\n } catch (e) {\n }\n }\n return languages[k];\n };\n\n if (!key) {\n return moment.fn._lang;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n lang = get(key);\n if (lang) {\n return lang;\n }\n key = [key];\n }\n\n //pick the language from the array\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n while (i < key.length) {\n split = normalizeLanguage(key[i]).split('-');\n j = split.length;\n next = normalizeLanguage(key[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n lang = get(split.slice(0, j).join('-'));\n if (lang) {\n return lang;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return moment.fn._lang;\n }", "title": "" }, { "docid": "9cacd4df4064857221d65e2a78c7dce1", "score": "0.5786979", "text": "function getLangDefinition(key) {\r\n var i = 0, j, lang, next, split,\r\n get = function (k) {\r\n if (!languages[k] && hasModule) {\r\n try {\r\n require('./lang/' + k);\r\n } catch (e) { }\r\n }\r\n return languages[k];\r\n };\r\n\r\n if (!key) {\r\n return moment.fn._lang;\r\n }\r\n\r\n if (!isArray(key)) {\r\n //short-circuit everything else\r\n lang = get(key);\r\n if (lang) {\r\n return lang;\r\n }\r\n key = [key];\r\n }\r\n\r\n //pick the language from the array\r\n //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\r\n //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\r\n while (i < key.length) {\r\n split = normalizeLanguage(key[i]).split('-');\r\n j = split.length;\r\n next = normalizeLanguage(key[i + 1]);\r\n next = next ? next.split('-') : null;\r\n while (j > 0) {\r\n lang = get(split.slice(0, j).join('-'));\r\n if (lang) {\r\n return lang;\r\n }\r\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\r\n //the next array item is better than a shallower substring of this one\r\n break;\r\n }\r\n j--;\r\n }\r\n i++;\r\n }\r\n return moment.fn._lang;\r\n }", "title": "" }, { "docid": "be0dc7e93065958c2dc3703d381c4865", "score": "0.57836425", "text": "lang(lang) {\n if (lang) {\n this._lang = lang;\n }\n return this._lang || \"EN\";\n }", "title": "" }, { "docid": "5ca516eb5a2815e844425b0a863d4fc8", "score": "0.57780755", "text": "getUserLanguage( general=true ){\r\n\t\tvar urlParams = new URLSearchParams(window.location.search)\r\n\t\tvar lang = urlParams.get('lang')\r\n\t\tif( lang === undefined || lang === null ) lang = window.navigator.language\r\n\t\tif( general ) lang = lang.split('-')[0]\r\n\t\treturn lang\r\n\t}", "title": "" }, { "docid": "8febe20f2b03d8e88cbb784ceab54fad", "score": "0.57727295", "text": "function getLanguage(code) {\n\tvar langs = {\n\t\t\"abk\":\"Abkhaz\",\"ace\":\"Achinese\",\"ach\":\"Acoli\",\"ada\":\"Adangme\",\"ady\":\"Adygei\",\"aar\":\"Afar\",\"afh\":\"Afrihili (Artificial language)\",\"afr\":\"Afrikaans\",\"afa\":\"Afroasiatic (Other)\",\"ain\":\"Ainu\",\"aka\":\"Akan\",\"akk\":\"Akkadian\",\"alb\":\"Albanian\",\"ale\":\"Aleut\",\"alg\":\"Algonquian (Other)\",\"alt\":\"Altai\",\"tut\":\"Altaic (Other)\",\"amh\":\"Amharic\",\"anp\":\"Angika\",\"apa\":\"Apache languages\",\"ara\":\"Arabic\",\"arg\":\"Aragonese\",\"arc\":\"Aramaic\",\"arp\":\"Arapaho\",\"arw\":\"Arawak\",\"arm\":\"Armenian\",\"rup\":\"Aromanian\",\"art\":\"Artificial (Other)\",\"asm\":\"Assamese\",\"ath\":\"Athapascan (Other)\",\"aus\":\"Australian languages\",\"map\":\"Austronesian (Other)\",\"ava\":\"Avaric\",\"ave\":\"Avestan\",\"awa\":\"Awadhi\",\"aym\":\"Aymara\",\"aze\":\"Azerbaijani\",\"ast\":\"Bable\",\"ban\":\"Balinese\",\"bat\":\"Baltic (Other)\",\"bal\":\"Baluchi\",\"bam\":\"Bambara\",\"bai\":\"Bamileke languages\",\"bad\":\"Banda languages\",\"bnt\":\"Bantu (Other)\",\"bas\":\"Basa\",\"bak\":\"Bashkir\",\"baq\":\"Basque\",\"btk\":\"Batak\",\"bej\":\"Beja\",\"bel\":\"Belarusian\",\"bem\":\"Bemba\",\"ben\":\"Bengali\",\"ber\":\"Berber (Other)\",\"bho\":\"Bhojpuri\",\"bih\":\"Bihari (Other)\",\"bik\":\"Bikol\",\"byn\":\"Bilin\",\"bis\":\"Bislama\",\"zbl\":\"Blissymbolics\",\"bos\":\"Bosnian\",\"bra\":\"Braj\",\"bre\":\"Breton\",\"bug\":\"Bugis\",\"bul\":\"Bulgarian\",\"bua\":\"Buriat\",\"bur\":\"Burmese\",\"cad\":\"Caddo\",\"car\":\"Carib\",\"cat\":\"Catalan\",\"cau\":\"Caucasian (Other)\",\"ceb\":\"Cebuano\",\"cel\":\"Celtic (Other)\",\"cai\":\"Central American Indian (Other)\",\"chg\":\"Chagatai\",\"cmc\":\"Chamic languages\",\"cha\":\"Chamorro\",\"che\":\"Chechen\",\"chr\":\"Cherokee\",\"chy\":\"Cheyenne\",\"chb\":\"Chibcha\",\"chi\":\"Chinese\",\"chn\":\"Chinook jargon\",\"chp\":\"Chipewyan\",\"cho\":\"Choctaw\",\"chu\":\"Church Slavic\",\"chk\":\"Chuukese\",\"chv\":\"Chuvash\",\"cop\":\"Coptic\",\"cor\":\"Cornish\",\"cos\":\"Corsican\",\"cre\":\"Cree\",\"mus\":\"Creek\",\"crp\":\"Creoles and Pidgins (Other)\",\"cpe\":\"Creoles and Pidgins, English-based (Other)\",\"cpf\":\"Creoles and Pidgins, French-based (Other)\",\"cpp\":\"Creoles and Pidgins, Portuguese-based (Other)\",\"crh\":\"Crimean Tatar\",\"hrv\":\"Croatian\",\"cus\":\"Cushitic (Other)\",\"cze\":\"Czech\",\"dak\":\"Dakota\",\"dan\":\"Danish\",\"dar\":\"Dargwa\",\"day\":\"Dayak\",\"del\":\"Delaware\",\"din\":\"Dinka\",\"div\":\"Divehi\",\"doi\":\"Dogri\",\"dgr\":\"Dogrib\",\"dra\":\"Dravidian (Other)\",\"dua\":\"Duala\",\"dut\":\"Dutch\",\"dum\":\"Dutch, Middle (ca. 1050-1350)\",\"dyu\":\"Dyula\",\"dzo\":\"Dzongkha\",\"frs\":\"East Frisian\",\"bin\":\"Edo\",\"efi\":\"Efik\",\"egy\":\"Egyptian\",\"eka\":\"Ekajuk\",\"elx\":\"Elamite\",\"eng\":\"English\",\"enm\":\"English, Middle (1100-1500)\",\"ang\":\"English, Old (ca. 450-1100)\",\"myv\":\"Erzya\",\"epo\":\"Esperanto\",\"est\":\"Estonian\",\"gez\":\"Ethiopic\",\"ewe\":\"Ewe\",\"ewo\":\"Ewondo\",\"fan\":\"Fang\",\"fat\":\"Fanti\",\"fao\":\"Faroese\",\"fij\":\"Fijian\",\"fil\":\"Filipino\",\"fin\":\"Finnish\",\"fiu\":\"Finno-Ugrian (Other)\",\"fon\":\"Fon\",\"fre\":\"French\",\"frm\":\"French, Middle (ca. 1300-1600)\",\"fro\":\"French, Old (ca. 842-1300)\",\"fry\":\"Frisian\",\"fur\":\"Friulian\",\"ful\":\"Fula\",\"gaa\":\"Gã\",\"glg\":\"Galician\",\"lug\":\"Ganda\",\"gay\":\"Gayo\",\"gba\":\"Gbaya\",\"geo\":\"Georgian\",\"ger\":\"German\",\"gmh\":\"German, Middle High (ca. 1050-1500)\",\"goh\":\"German, Old High (ca. 750-1050)\",\"gem\":\"Germanic (Other)\",\"gil\":\"Gilbertese\",\"gon\":\"Gondi\",\"gor\":\"Gorontalo\",\"got\":\"Gothic\",\"grb\":\"Grebo\",\"grc\":\"Greek, Ancient (to 1453)\",\"gre\":\"Greek, Modern (1453-)\",\"grn\":\"Guarani\",\"guj\":\"Gujarati\",\"gwi\":\"Gwich'in\",\"hai\":\"Haida\",\"hat\":\"Haitian French Creole\",\"hau\":\"Hausa\",\"haw\":\"Hawaiian\",\"heb\":\"Hebrew\",\"her\":\"Herero\",\"hil\":\"Hiligaynon\",\"hin\":\"Hindi\",\"hmo\":\"Hiri Motu\",\"hit\":\"Hittite\",\"hmn\":\"Hmong\",\"hun\":\"Hungarian\",\"hup\":\"Hupa\",\"iba\":\"Iban\",\"ice\":\"Icelandic\",\"ido\":\"Ido\",\"ibo\":\"Igbo\",\"ijo\":\"Ijo\",\"ilo\":\"Iloko\",\"smn\":\"Inari Sami\",\"inc\":\"Indic (Other)\",\"ine\":\"Indo-European (Other)\",\"ind\":\"Indonesian\",\"inh\":\"Ingush\",\"ina\":\"Interlingua (International Auxiliary Language Association)\",\"ile\":\"Interlingue\",\"iku\":\"Inuktitut\",\"ipk\":\"Inupiaq\",\"ira\":\"Iranian (Other)\",\"gle\":\"Irish\",\"mga\":\"Irish, Middle (ca. 1100-1550)\",\"sga\":\"Irish, Old (to 1100)\",\"iro\":\"Iroquoian (Other)\",\"ita\":\"Italian\",\"jpn\":\"Japanese\",\"jav\":\"Javanese\",\"jrb\":\"Judeo-Arabic\",\"jpr\":\"Judeo-Persian\",\"kbd\":\"Kabardian\",\"kab\":\"Kabyle\",\"kac\":\"Kachin\",\"kal\":\"Kalâtdlisut\",\"kam\":\"Kamba\",\"kan\":\"Kannada\",\"kau\":\"Kanuri\",\"kaa\":\"Kara-Kalpak\",\"krc\":\"Karachay-Balkar\",\"krl\":\"Karelian\",\"kar\":\"Karen languages\",\"kas\":\"Kashmiri\",\"csb\":\"Kashubian\",\"kaw\":\"Kawi\",\"kaz\":\"Kazakh\",\"kha\":\"Khasi\",\"khm\":\"Khmer\",\"khi\":\"Khoisan (Other)\",\"kho\":\"Khotanese\",\"kik\":\"Kikuyu\",\"kmb\":\"Kimbundu\",\"kin\":\"Kinyarwanda\",\"tlh\":\"Klingon (Artificial language)\",\"kom\":\"Komi\",\"kon\":\"Kongo\",\"kok\":\"Konkani\",\"kut\":\"Kootenai\",\"kor\":\"Korean\",\"kos\":\"Kosraean\",\"kpe\":\"Kpelle\",\"kro\":\"Kru (Other)\",\"kua\":\"Kuanyama\",\"kum\":\"Kumyk\",\"kur\":\"Kurdish\",\"kru\":\"Kurukh\",\"kir\":\"Kyrgyz\",\"lad\":\"Ladino\",\"lah\":\"Lahndā\",\"lam\":\"Lamba (Zambia and Congo)\",\"lao\":\"Lao\",\"lat\":\"Latin\",\"lav\":\"Latvian\",\"lez\":\"Lezgian\",\"lim\":\"Limburgish\",\"lin\":\"Lingala\",\"lit\":\"Lithuanian\",\"jbo\":\"Lojban (Artificial language)\",\"nds\":\"Low German\",\"dsb\":\"Lower Sorbian\",\"loz\":\"Lozi\",\"lub\":\"Luba-Katanga\",\"lua\":\"Luba-Lulua\",\"lui\":\"Luiseño\",\"smj\":\"Lule Sami\",\"lun\":\"Lunda\",\"luo\":\"Luo (Kenya and Tanzania)\",\"lus\":\"Lushai\",\"ltz\":\"Luxembourgish\",\"mas\":\"Maasai\",\"mac\":\"Macedonian\",\"mad\":\"Madurese\",\"mag\":\"Magahi\",\"mai\":\"Maithili\",\"mak\":\"Makasar\",\"mlg\":\"Malagasy\",\"may\":\"Malay\",\"mal\":\"Malayalam\",\"mlt\":\"Maltese\",\"mnc\":\"Manchu\",\"mdr\":\"Mandar\",\"man\":\"Mandingo\",\"mni\":\"Manipuri\",\"mno\":\"Manobo languages\",\"glv\":\"Manx\",\"mao\":\"Maori\",\"arn\":\"Mapuche\",\"mar\":\"Marathi\",\"chm\":\"Mari\",\"mah\":\"Marshallese\",\"mwr\":\"Marwari\",\"myn\":\"Mayan languages\",\"men\":\"Mende\",\"mic\":\"Micmac\",\"min\":\"Minangkabau\",\"mwl\":\"Mirandese\",\"mis\":\"Miscellaneous languages\",\"moh\":\"Mohawk\",\"mdf\":\"Moksha\",\"mkh\":\"Mon-Khmer (Other)\",\"lol\":\"Mongo-Nkundu\",\"mon\":\"Mongolian\",\"mos\":\"Mooré\",\"mul\":\"Multiple languages\",\"mun\":\"Munda (Other)\",\"nqo\":\"N'Ko\",\"nah\":\"Nahuatl\",\"nau\":\"Nauru\",\"nav\":\"Navajo\",\"nbl\":\"Ndebele (South Africa)\",\"nde\":\"Ndebele (Zimbabwe)\",\"ndo\":\"Ndonga\",\"nap\":\"Neapolitan Italian\",\"nep\":\"Nepali\",\"new\":\"Newari\",\"nwc\":\"Newari, Old\",\"nia\":\"Nias\",\"nic\":\"Niger-Kordofanian (Other)\",\"ssa\":\"Nilo-Saharan (Other)\",\"niu\":\"Niuean\",\"zxx\":\"No linguistic content\",\"nog\":\"Nogai\",\"nai\":\"North American Indian (Other)\",\"frr\":\"North Frisian\",\"sme\":\"Northern Sami\",\"nso\":\"Northern Sotho\",\"nor\":\"Norwegian\",\"nob\":\"Norwegian (Bokmål)\",\"nno\":\"Norwegian (Nynorsk)\",\"nub\":\"Nubian languages\",\"nym\":\"Nyamwezi\",\"nya\":\"Nyanja\",\"nyn\":\"Nyankole\",\"nyo\":\"Nyoro\",\"nzi\":\"Nzima\",\"oci\":\"Occitan (post-1500)\",\"xal\":\"Oirat\",\"oji\":\"Ojibwa\",\"non\":\"Old Norse\",\"peo\":\"Old Persian (ca. 600-400 B.C.)\",\"ori\":\"Oriya\",\"orm\":\"Oromo\",\"osa\":\"Osage\",\"oss\":\"Ossetic\",\"oto\":\"Otomian languages\",\"pal\":\"Pahlavi\",\"pau\":\"Palauan\",\"pli\":\"Pali\",\"pam\":\"Pampanga\",\"pag\":\"Pangasinan\",\"pan\":\"Panjabi\",\"pap\":\"Papiamento\",\"paa\":\"Papuan (Other)\",\"per\":\"Persian\",\"phi\":\"Philippine (Other)\",\"phn\":\"Phoenician\",\"pon\":\"Pohnpeian\",\"pol\":\"Polish\",\"por\":\"Portuguese\",\"pra\":\"Prakrit languages\",\"pro\":\"Provençal (to 1500)\",\"pus\":\"Pushto\",\"que\":\"Quechua\",\"roh\":\"Raeto-Romance\",\"raj\":\"Rajasthani\",\"rap\":\"Rapanui\",\"rar\":\"Rarotongan\",\"roa\":\"Romance (Other)\",\"rom\":\"Romani\",\"rum\":\"Romanian\",\"run\":\"Rundi\",\"rus\":\"Russian\",\"sal\":\"Salishan languages\",\"sam\":\"Samaritan Aramaic\",\"smi\":\"Sami\",\"smo\":\"Samoan\",\"sad\":\"Sandawe\",\"sag\":\"Sango (Ubangi Creole)\",\"san\":\"Sanskrit\",\"sat\":\"Santali\",\"srd\":\"Sardinian\",\"sas\":\"Sasak\",\"sco\":\"Scots\",\"gla\":\"Scottish Gaelic\",\"sel\":\"Selkup\",\"sem\":\"Semitic (Other)\",\"srp\":\"Serbian\",\"srr\":\"Serer\",\"shn\":\"Shan\",\"sna\":\"Shona\",\"iii\":\"Sichuan Yi\",\"scn\":\"Sicilian Italian\",\"sid\":\"Sidamo\",\"sgn\":\"Sign languages\",\"bla\":\"Siksika\",\"snd\":\"Sindhi\",\"sin\":\"Sinhalese\",\"sit\":\"Sino-Tibetan (Other)\",\"sio\":\"Siouan (Other)\",\"sms\":\"Skolt Sami\",\"den\":\"Slavey\",\"sla\":\"Slavic (Other)\",\"slo\":\"Slovak\",\"slv\":\"Slovenian\",\"sog\":\"Sogdian\",\"som\":\"Somali\",\"son\":\"Songhai\",\"snk\":\"Soninke\",\"wen\":\"Sorbian (Other)\",\"sot\":\"Sotho\",\"sai\":\"South American Indian (Other)\",\"sma\":\"Southern Sami\",\"spa\":\"Spanish\",\"srn\":\"Sranan\",\"suk\":\"Sukuma\",\"sux\":\"Sumerian\",\"sun\":\"Sundanese\",\"sus\":\"Susu\",\"swa\":\"Swahili\",\"ssw\":\"Swazi\",\"swe\":\"Swedish\",\"gsw\":\"Swiss German\",\"syc\":\"Syriac\",\"syr\":\"Syriac, Modern\",\"tgl\":\"Tagalog\",\"tah\":\"Tahitian\",\"tai\":\"Tai (Other)\",\"tgk\":\"Tajik\",\"tmh\":\"Tamashek\",\"tam\":\"Tamil\",\"tat\":\"Tatar\",\"tel\":\"Telugu\",\"tem\":\"Temne\",\"ter\":\"Terena\",\"tet\":\"Tetum\",\"tha\":\"Thai\",\"tib\":\"Tibetan\",\"tig\":\"Tigré\",\"tir\":\"Tigrinya\",\"tiv\":\"Tiv\",\"tli\":\"Tlingit\",\"tpi\":\"Tok Pisin\",\"tkl\":\"Tokelauan\",\"tog\":\"Tonga (Nyasa)\",\"ton\":\"Tongan\",\"tsi\":\"Tsimshian\",\"tso\":\"Tsonga\",\"tsn\":\"Tswana\",\"tum\":\"Tumbuka\",\"tup\":\"Tupi languages\",\"tur\":\"Turkish\",\"ota\":\"Turkish, Ottoman\",\"tuk\":\"Turkmen\",\"tvl\":\"Tuvaluan\",\"tyv\":\"Tuvinian\",\"twi\":\"Twi\",\"udm\":\"Udmurt\",\"uga\":\"Ugaritic\",\"uig\":\"Uighur\",\"ukr\":\"Ukrainian\",\"umb\":\"Umbundu\",\"und\":\"Undetermined\",\"hsb\":\"Upper Sorbian\",\"urd\":\"Urdu\",\"uzb\":\"Uzbek\",\"vai\":\"Vai\",\"ven\":\"Venda\",\"vie\":\"Vietnamese\",\"vol\":\"Volapük\",\"vot\":\"Votic\",\"wak\":\"Wakashan languages\",\"wln\":\"Walloon\",\"war\":\"Waray\",\"was\":\"Washoe\",\"wel\":\"Welsh\",\"him\":\"Western Pahari languages\",\"wal\":\"Wolayta\",\"wol\":\"Wolof\",\"xho\":\"Xhosa\",\"sah\":\"Yakut\",\"yao\":\"Yao (Africa)\",\"yap\":\"Yapese\",\"yid\":\"Yiddish\",\"yor\":\"Yoruba\",\"ypk\":\"Yupik languages\",\"znd\":\"Zande languages\",\"zap\":\"Zapotec\",\"zza\":\"Zaza\",\"zen\":\"Zenaga\",\"zha\":\"Zhuang\",\"zul\":\"Zulu\",\"zun\":\"Zuni\"\n\t}\n\treturn langs[code];\n}", "title": "" }, { "docid": "c7108d7611bc710ba7ae8914c11bfce1", "score": "0.5768396", "text": "function getLanguage(originalLanguage) {\r\n var flags = ['en', 'it'];\r\n if (flags.includes(originalLanguage)) {\r\n return '<img src=\"img/' + originalLanguage + '.svg\">'\r\n } else {\r\n return originalLanguage;\r\n }\r\n }", "title": "" }, { "docid": "1a2231cc58a3318b764cbd5acc5ef437", "score": "0.57671154", "text": "static parseLGFileName(lgFileName) {\n if (lgFileName === undefined || !lgFileName.endsWith('.' + this.lgSuffix)) {\n return { prefix: lgFileName, language: '' };\n }\n const fileName = lgFileName.substring(0, lgFileName.length - this.lgSuffix.length - 1);\n const lastDot = fileName.lastIndexOf('.');\n if (lastDot > 0) {\n return { prefix: fileName.substring(0, lastDot), language: fileName.substring(lastDot + 1) };\n }\n else {\n return { prefix: fileName, language: '' };\n }\n }", "title": "" }, { "docid": "1f484612292280f91742bcde28551aaf", "score": "0.57547706", "text": "function getLangDefinition(key) {\n if (!key) {\n return moment.fn._lang;\n }\n if (!languages[key] && hasModule) {\n try {\n require('./lang/' + key);\n } catch (e) {\n // call with no params to set to default\n return moment.fn._lang;\n }\n }\n return languages[key] || moment.fn._lang;\n }", "title": "" }, { "docid": "1f484612292280f91742bcde28551aaf", "score": "0.57547706", "text": "function getLangDefinition(key) {\n if (!key) {\n return moment.fn._lang;\n }\n if (!languages[key] && hasModule) {\n try {\n require('./lang/' + key);\n } catch (e) {\n // call with no params to set to default\n return moment.fn._lang;\n }\n }\n return languages[key] || moment.fn._lang;\n }", "title": "" }, { "docid": "e30a6df3ba5503fa18d1c2a0273853fb", "score": "0.5751432", "text": "function getServerLanguage(lang) {\n var i, language = lang || defaultLanguage, processedLanguage = '';\n\n // Ensure the language culture string is all \n // lowercase and uppercase where appropriate.\n for (i = 0; i < language.length; i++) {\n if (i === 2) {\n processedLanguage += '-';\n } else if (i < 2) {\n processedLanguage += language.charAt(i).toLowerCase();\n } else {\n processedLanguage += language.charAt(i).toUpperCase();\n }\n }\n\n return (languages[processedLanguage] && languages[processedLanguage]['server']) ? \n languages[processedLanguage]['server'] : \n languages[defaultLanguage]['server'];\n}", "title": "" }, { "docid": "ff865a788f044ef16962162e9136955b", "score": "0.5742879", "text": "function GetLanguage() {\n var result = syncRequest({cmd : 'Language'});\n return (result && result.Language) ? result.Language : null;\n}", "title": "" }, { "docid": "52014d2cf6aaa80a8e34a5603cc65304", "score": "0.57206595", "text": "function langCode(nam) {\n return nam!=='auto' && !iso6391.validate(nam)? iso6391.getCode(nam):nam;\n}", "title": "" }, { "docid": "d26b2d4ced88411d5c5a8e26e863266e", "score": "0.5708138", "text": "requireParent() {\n if (this.properties.source || this.properties.compileFrom) {\n return \"SCLang\";\n }\n }", "title": "" }, { "docid": "e2a6970c0aede965d80ec59916615868", "score": "0.570544", "text": "getLanguage() {\n return this.languages.getLanguage();\n }", "title": "" }, { "docid": "c88efcb8707389ab2b3cfcc5cd969298", "score": "0.57031065", "text": "programmingLanguage() {\n return _.sample(DEVELOPMENT.PROGRAMMING_LANGS);\n }", "title": "" }, { "docid": "e9e3f8dd0fef08fae53738387c1f175a", "score": "0.5700191", "text": "function getPreferredLanguage() {\n return (\n vscode.workspace\n .getConfiguration(\"vscodeGoogleTranslate\")\n .get(\"preferredLanguage\") || setPreferredLanguage()\n );\n}", "title": "" } ]
19a5d8c303ad82002e967cf32a6d22cb
Creates and returns a new ValidationMessage instance in the SDK and on the server. The new ValidationMessage will be automatically stored in the 'widget' property of the parent MasterDetailRegion element passed as argument. Warning! Can only be used on models with the following Mendix meta model versions: 7.1.0 to 7.14.0
[ { "docid": "7317a30e4c8da05714226c287bbf0cf6", "score": "0.60491425", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" } ]
[ { "docid": "fc362bd9d67f8673acd052b925751b72", "score": "0.5621685", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, ValidationMessage);\n }", "title": "" }, { "docid": "5d3cd05f094107dd86a22382e3d1b283", "score": "0.5585917", "text": "newMessage(value) {\n if (this.parent && this.parent.hasInnerField) {\n this.parent.newMessage = value;\n }\n }", "title": "" }, { "docid": "51366c0a1ffa53d1a98c8bee9477dae2", "score": "0.51766545", "text": "function ValidationError(message) {\r\n this.message = message;\r\n}", "title": "" }, { "docid": "e5650c4d9e553d09a115e1f22c7018a6", "score": "0.5120328", "text": "function ValidationError(message) {\n this.message = message;\n}", "title": "" }, { "docid": "5cfcf64b96b6fa101bf9b4642d70e711", "score": "0.50761014", "text": "function ValidationError(message) {\n this.name = 'ValidationError'\n this.message = message;\n}", "title": "" }, { "docid": "9c9b1648eb4c1d09099c731341a69b5d", "score": "0.50334746", "text": "function ValidationError(message){\n this.message = message;\n}", "title": "" }, { "docid": "a96c8ed0b476ec5f7a71c58e84c85c20", "score": "0.49392325", "text": "function addValidationMessage(message, parentDiv) {\n // Add validation message\n const warningMessage = document.createElement('p');\n warningMessage.innerHTML = message;\n warningMessage.className = 'text-danger';\n \n // add validation message to DOM\n document.getElementById(parentDiv).append(warningMessage);\n}", "title": "" }, { "docid": "324d82737e4acb95a089f29427df837e", "score": "0.4921955", "text": "async function createMessage(request, response, next) {\n const validation = validate(request.body, messageNewSchema);\n if (!validation.valid) {\n return next(\n new APIError(\n 400,\n \"Bad Request\",\n validation.errors.map(e => e.stack).join(\". \")\n )\n );\n }\n\n try {\n const newMessage = await Message.createMessage(new Message(request.body));\n return response.status(201).json(newMessage);\n } catch (err) {\n return next(err);\n }\n}", "title": "" }, { "docid": "c9da5b93c9591eb5985d954385df1802", "score": "0.49075466", "text": "get validationMessage() {\n return supportsElementInternals\n ? this.elementInternals.validationMessage\n : this.proxy.validationMessage;\n }", "title": "" }, { "docid": "156e368554a44e6d3c0a3d8334d2ba0e", "score": "0.48538068", "text": "function insertNewMsg() {\n formValidation.setRules(descriptionMsg.value, \"descriptionMsg\");\n formValidation.setRules(detailsMsg.value, \"detailsMsg\");\n\n if (formValidation.run()) {\n let messages = [];\n\n if(localStorage.messages) {\n messages = JSON.parse(localStorage.messages);\n }\n\n let newMessage = {\n id: generateUniqueId(messages),\n description: descriptionMsg.value,\n details: detailsMsg.value\n } \n\n messages.push(newMessage);\n\n localStorage.setItem(\"messages\", JSON.stringify(messages));\n\n swal.fire(\"Sucesso!\", \"Dados salvos com sucesso.\", \"success\")\n\n clearAll();\n\n } else {\n let errorDescription = formValidation.errorMessages.descriptionMsg;\n let errorDetails = formValidation.errorMessages.detailsMsg;\n\n if (errorDescription) {\n descriptionMsg.style.border = \"1px solid #ff0000\";\n } else {\n descriptionMsg.style.border = \"1px solid #ced4da\";\n }\n\n if (errorDetails) {\n detailsMsg.style.border = \"1px solid #ff0000\";\n } else {\n detailsMsg.style.border = \"1px solid #ced4da\";\n }\n\n swal.fire(\"Atenção!\", \"Preencha os campos obrigatórios\", \"warning\");\n }\n}", "title": "" }, { "docid": "df4f7e5c9e55f352ad15ca9edf0ee66f", "score": "0.48353052", "text": "function onNewMessage(data) {\n // validate msg with data.sign\n var validationStatus = cryptoApi.validateMessage(data.sign);\n chatUi.displayMessage(data.msg,false,validationStatus);\n}", "title": "" }, { "docid": "a40ff26a669a8c35dd4e0ac9488f55b5", "score": "0.48250732", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MasterDetailDetailRegion);\n }", "title": "" }, { "docid": "6d06a4f0aa7dadb7358eb02733c9e7b2", "score": "0.48249042", "text": "function setValidationMessage(msg){\r\n\t\t \r\n\t\t $(emplopyeeMonthlyReprtMsg_id).text(msg);\r\n\t\t \r\n\t }", "title": "" }, { "docid": "181608da7c2db88732bbd06b53ae3b72", "score": "0.48174214", "text": "withMessage(message) {\r\n this.rule.messageKey = 'custom';\r\n this.rule.message = this.parsers.message.parse(message);\r\n return this;\r\n }", "title": "" }, { "docid": "36301b86ec2f9e495bf833dd544c5a78", "score": "0.48132128", "text": "getDynamicMessage(f, rule){\n let message = i18n.getLocaleMessage(i18n.locale).validate_messages[rule]\n if(f.label != undefined && f.label != null && f.label != '' ) f.label = i18n.t(f.label)\n else f.label = f.name.replace(/_/g, ' ')\n \n if(typeof f.options == 'object'){\n if(f.options.message) message = i18n.t(f.options.message)\n if(f.options.min_value || f.options.min_value === 0) message = message.replace(/{min_value}/g, f.options.min_value)\n if(f.options.max_value) message = message.replace(/{max_value}/g, f.options.max_value)\n if(f.options.decimal_value) message = message.replace(/{decimal_value}/g, f.options.decimal_value)\n }\n\n if(this.errors[f.name] == undefined)\n return this.errors[f.name] = message.replace(/{field}/g, '<span>' + f.label + '</span>')\n else\n return this.errors[f.name] += message.replace(/{field}/g, '<br><span>' + f.label + '</span>')\n }", "title": "" }, { "docid": "b1a068d7944db00b041ec82c886bdd60", "score": "0.481009", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MasterDetailMasterRegion);\n }", "title": "" }, { "docid": "6951ad9815c3fffda0ac3a5159222939", "score": "0.48060632", "text": "toError() {\n return new ValidationException_1.ValidationException(true, this.toJSON());\n }", "title": "" }, { "docid": "d58ed880b7e5194e389520946f427d9a", "score": "0.47919032", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, WidgetValidation);\n }", "title": "" }, { "docid": "3ee37bf8b3bdd52092b822f472f1860f", "score": "0.478378", "text": "getMessage(key) {\r\n let message;\r\n if (key in validationMessages) {\r\n message = validationMessages[key];\r\n }\r\n else {\r\n message = validationMessages['default'];\r\n }\r\n return this.parser.parse(message);\r\n }", "title": "" }, { "docid": "06d2daf0a2eb9229ca52f69d27d4e294", "score": "0.47782782", "text": "validate(customValidator) {\n return this.addValidator({\n message: (_, label, error) => typeof error === 'string' ?\n `(${label}) ${error}` :\n error(label),\n validator: value => {\n const { message, validator } = customValidator(value);\n if (validator) {\n return true;\n }\n return message;\n }\n });\n }", "title": "" }, { "docid": "f6b23a2a56d47abdfef9eff0987730dc", "score": "0.47689882", "text": "function updateValidationMessage(element) {\n // Make sure the element is a form field and not a button for example\n // Only form elements should have names. \n if (!(element.name in scopeForm)) {\n return;\n }\n\n var scopeElementModel = scopeForm[element.name];\n\n // Remove all validation messages \n var validationMessageElement = isValidationMessagePresent(element);\n if (validationMessageElement) {\n validationMessageElement.remove();\n }\n\n //SW: re-write all code until end of the function.\n var msgText = \"\";\n var isCustom = false;\n\n //Add and activate validation messages if the form field is $visited, $dirty, or the form has been submitted.\n if (scopeElementModel.$visited || scopeElementModel.$dirty || (scope[element.form.name] && scope[element.form.name].submitted)) {\n if (scopeElementModel.$error.required &&\n (scopeElementModel.$viewValue == \"\" || scopeElementModel.$viewValue == undefined)) {\n if (\"required-message\" in element.attributes)\n msgText = element.attributes['required-message'].value;\n else\n msgText = \"'Field is required'\";\n }\n else if (scopeElementModel.$error.maxlength) {\n if (\"max-length-message\" in element.attributes)\n msgText = element.attributes['max-length-message'].value;\n else\n msgText = \"'Field is too long'\";\n }\n else if (\"number\" in element.attributes) {\n //Numeric field custom validation.\n if (!isFinite(scopeElementModel.$viewValue)) {\n //Set validity token.\n scopeElementModel.$setValidity(\"number\", false);\n\n if (element.attributes['invalid-number-message'].value)\n msgText = element.attributes['invalid-number-message'].value;\n else\n msgText = \"Invalid number'\";\n }\n else {\n //Reset validity token.\n if (scopeElementModel.$error.number)\n scopeElementModel.$setValidity(\"number\", true);\n }\n if (\"max-number\" in element.attributes &&\n Number(scopeElementModel.$viewValue) > Number(element.attributes[\"max-number\"].value)) {\n scopeElementModel.$setValidity(\"max\", false);\n\n if (\"max-number-message\" in element.attributes)\n msgText = element.attributes[\"max-number-message\"].value;\n else\n msgText = \"'Too large number'\";\n }\n else {\n if (scopeElementModel.$error.max)\n scopeElementModel.$setValidity(\"max\", true);\n }\n if (\"min-number\" in element.attributes &&\n Number(scopeElementModel.$viewValue) < Number(element.attributes[\"min-number\"].value)) {\n scopeElementModel.$setValidity(\"min\", false);\n\n if (\"min-number-message\" in element.attributes)\n msgText = element.attributes[\"min-number-message\"].value;\n else\n msgText = \"'Too small number'\";\n }\n else {\n if (scopeElementModel.$error.min)\n scopeElementModel.$setValidity(\"min\", true);\n }\n }\n else if (\"date\" in element.attributes &&\n (scopeElementModel.$viewValue != \"\" && scopeElementModel.$viewValue != undefined)) {\n //Date field custom validation.\n //Test:\n //var te = Date.parse(scopeElementModel.$viewValue);\n //var tn = isValidDate(scopeElementModel.$viewValue);\n if (isNaN(Date.parse(scopeElementModel.$viewValue)) || !isValidDate(scopeElementModel.$viewValue)) {\n //Set validity token.\n scopeElementModel.$setValidity(\"date\", false);\n\n if (element.attributes['invalid-date-message'].value)\n msgText = element.attributes['invalid-date-message'].value;\n else\n msgText = \"'Invalid date'\";\n }\n else {\n //Reset validity token.\n if (scopeElementModel.$error.date)\n scopeElementModel.$setValidity(\"date\", true);\n }\n if (\"max-date\" in element.attributes &&\n Date.parse(scopeElementModel.$viewValue) > Date.parse(element.attributes[\"max-date\"].value.replace(/'/g, \"\"))) {\n scopeElementModel.$setValidity(\"maxDate\", false);\n\n if (\"max-date-message\" in element.attributes)\n msgText = element.attributes[\"max-date-message\"].value;\n else\n msgText = \"'Date exceeds maximum value'\";\n }\n else {\n if (scopeElementModel.$error.maxDate)\n scopeElementModel.$setValidity(\"maxDate\", true);\n }\n if (\"min-date\" in element.attributes &&\n Date.parse(scopeElementModel.$viewValue) < Date.parse(element.attributes[\"min-date\"].value.replace(/'/g, \"\"))) {\n scopeElementModel.$setValidity(\"minDate\", false);\n\n if (\"min-date-message\" in element.attributes)\n msgText = element.attributes[\"min-date-message\"].value;\n else\n msgText = \"'Date below minimum value'\";\n }\n else {\n if (scopeElementModel.$error.minDate)\n scopeElementModel.$setValidity(\"minDate\", true);\n }\n }\n\n else if (!scopeElementModel.$valid) {\n if (\"invalid-message\" in element.attributes)\n msgText = element.attributes['invalid-message'].value;\n else\n msgTextg = \"'Field is invalild'\";\n }\n\n if (msgText != \"\") {\n var msgAfterElem;\n if (\"message-after\" in element.attributes)\n msgAfterElem = document.getElementById(element.attributes[\"message-after\"].value);\n else msgAfterElem = element;\n\n angular.element(msgAfterElem).after(generateErrorMessage(msgText, element));\n }\n else {\n //Do something when having passed validation.\n\n //Reset $visited flag to false.\n scopeElementModel.$visited = false;\n }\n }\n }", "title": "" }, { "docid": "3dc6673bb13012a9e8dcfde68600ae95", "score": "0.47613168", "text": "get messages () {\n return Object.assign(super.messages, {\n 'room_id.required': 'Você deve informar a sala de reunião',\n 'schedule_start.required': 'Você deve informar a data e hora de início da reunião',\n 'schedule_end.required': 'Você deve informar a data e hora de fim da reunião',\n 'accountable.required': 'Você deve informar o responsável pela reunião',\n 'is_coffee.required': 'Você deve informar se vai ter cafézinho na reunião',\n })\n }", "title": "" }, { "docid": "71e73861f6d2ccc9606b65a36348823d", "score": "0.47348356", "text": "function addToValidationSummary(self, message) {\n // get the element name, whichever we find it\n var elmName = (!!self.validatorAttrs && !!self.validatorAttrs.name)\n ? self.validatorAttrs.name\n : (!!self.attrs && !!self.attrs.name)\n ? self.attrs.name\n : self.elm.attr('name');\n\n var form = getElementParentForm(elmName, self); // find the parent form (only found if it has a name)\n var index = arrayFindObjectIndex(validationSummary, 'field', elmName); // find index of object in our array\n\n // if message is empty, remove it from the validation summary\n if(index >= 0 && message === '') {\n validationSummary.splice(index, 1);\n }else if(message !== '') {\n var friendlyName = (!!self.attrs && !!self.friendlyName) ? $translate.instant(self.friendlyName) : '';\n var errorObj = { field: elmName, friendlyName: friendlyName, message: message, formName: (!!form) ? form.$name : null };\n\n // if error already exist then refresh the error object inside the array, else push it to the array\n if(index >= 0) {\n validationSummary[index] = errorObj;\n }else {\n validationSummary.push(errorObj);\n }\n }\n\n // save validation summary scope root\n self.scope.$validationSummary = validationSummary;\n\n // and also save it inside the current scope form (if found)\n if (!!form) {\n // since validationSummary contain errors of all forms\n // we need to find only the errors of current form and them into the current scope form object\n form.$validationSummary = arrayFindObjects(validationSummary, 'formName', form.$name);\n }\n return validationSummary;\n }", "title": "" }, { "docid": "cc7b0e147175073c063f0bdd73342866", "score": "0.4719008", "text": "static createInBuildingBlockUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "4ce8eaf340e4e02249e8ef944fe918df", "score": "0.47149187", "text": "withMessage(message) {\n this.rule.messageKey = 'custom';\n this.rule.message = this.parser.parseMessage(message);\n return this;\n }", "title": "" }, { "docid": "9961726e2c8d997a7c9fc9d768ba715d", "score": "0.47118407", "text": "function BaseMessage() {\r\n this.m_parameters = [];\r\n this.m_smfHeader = null;\r\n }", "title": "" }, { "docid": "37c797d84afa7f4fe4c30cab7d72a17c", "score": "0.47000745", "text": "function Message() {\n var _this = _super.call(this) || this;\n _this.header = new MessageHeader(_this);\n return _this;\n }", "title": "" }, { "docid": "b0bbca86303ba783d3d9964cb37a6a5c", "score": "0.46787938", "text": "_addMessage(ast, msgMeta) {\n if (ast.length == 0 ||\n ast.length == 1 && ast[0] instanceof Attribute && !ast[0].value) {\n // Do not create empty messages\n return null;\n }\n const { meaning, description, id } = _parseMessageMeta(msgMeta);\n const message = this._createI18nMessage(ast, meaning, description, id);\n this._messages.push(message);\n return message;\n }", "title": "" }, { "docid": "19f36bedf79d11b6f7450b5d4ef31861", "score": "0.46677268", "text": "validationMessage (rule, validationContext, vm) {\n const generators = this.options.locales[this.getLocale(vm)]\n if (generators.hasOwnProperty(rule)) {\n return generators[rule](validationContext)\n }\n if (generators.hasOwnProperty('default')) {\n return generators.default(validationContext)\n }\n return 'Invalid field value'\n }", "title": "" }, { "docid": "39ea922c4769690d0bf7ab7597b431b0", "score": "0.46420082", "text": "function createErrorMessage(message) {\n const errorBody = document.querySelector(\".error\");\n const errorElement = document.createElement(\"div\");\n errorElement.innerHTML = `<strong>* ${message}</strong>`;\n errorElement.classList.add(\"error-message\");\n errorBody.appendChild(errorElement);\n}", "title": "" }, { "docid": "9895ea8e12946455998618ef44cc26e5", "score": "0.46232745", "text": "static createInLayoutUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "73b4218c8535989eaeca1f9bd4a27fa1", "score": "0.45898414", "text": "function init_valiform_messages(){\n\t\n\tgeneric_error = \"Field not valid\";\n\tfield_required = \"This field is required\";\n\tmin_length = \"The field does not meet the minimum required length of {optional_value}\";\n\tmax_length = \"The field exceedes the maxium allowed length of {optional_value}\";\n\temail_not_valid = \"Email is not valid\";\n\tnumber_not_valid = \"The value is not a valid number\";\n\tinteger_not_valid = \"The value is not a valid integer\";\n\t\n\tlog_valiform(\"Messages initialized\");\n}", "title": "" }, { "docid": "dcdeed195184860839653731d3bd2532", "score": "0.45373034", "text": "static createInTableCellUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "94a26493044f013aa11d0526916289f7", "score": "0.4513274", "text": "function validationMessage(element) {\n const msg = __WEBPACK_IMPORTED_MODULE_0__components_message_store__[\"a\" /* message_store */].get(element);\n if (! msg) {\n return '';\n }\n\n /* make it a primitive again, since message_store returns String(). */\n return msg.toString();\n}", "title": "" }, { "docid": "23eaedecb0b5bad8bde379f275dd6948", "score": "0.45074627", "text": "static createInGroupBoxUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "e7ac0b902ae7d2b4ce299dd94cf7c97c", "score": "0.45041668", "text": "function validateDetail(detail) {\n\tlet message = \"\";\n\t\n\t// no restrictions on data\n\t\n\treturn message;\n}", "title": "" }, { "docid": "f7998f8bc7aa9bdfd31fbd56d7d221f8", "score": "0.4493918", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, MasterDetail.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, MasterDetail, \"widget\", false);\n }", "title": "" }, { "docid": "5e0e4b2992856fbec0e7b16a965ce205", "score": "0.44790977", "text": "static createInAttributeWidgetUnderValidation(container) {\n internal.createInVersionCheck(container.model, WidgetValidation.structureTypeName, { start: \"7.6.0\" });\n return internal.instancehelpers.createElement(container, WidgetValidation, \"validation\", false);\n }", "title": "" }, { "docid": "da4ba7ff9340508a119d4d2ec029520a", "score": "0.44763425", "text": "static create(msgtype, metadata, content = {}) {\n const header = Message.create_header(msgtype);\n return new Message(header, metadata, content);\n }", "title": "" }, { "docid": "749d38b97d10b24b174e09feeab828a4", "score": "0.44740918", "text": "function validate(newValue) {\n target.hasError(newValue ? false : true);\n target.validationMessage(newValue ? \"\" : overrideMessage || \"This field is required\");\n }", "title": "" }, { "docid": "25f5ced0e3a612647b919abcb492e128", "score": "0.4465128", "text": "statusMessage() {\n if (!this.parentField) return;\n return this.parentField.newMessage || this.parentField.hasMessageSlot;\n }", "title": "" }, { "docid": "7d56ac5c20e8b48af6d44b6e43ff98db", "score": "0.4448828", "text": "handleValidationEvent(e) {\n // To show error message by taking care of alignment\n this.flag = e.detail.flag;\n if (this.flag) {\n const parent = this.element.querySelector('.error-messsage-parent');\n const p = document.createElement('p');\n p.className = 'dxp-error error-message sc-dxp-checkbox-group';\n const txtNode = document.createTextNode(e.detail.message);\n p.appendChild(txtNode);\n parent.appendChild(p);\n }\n else {\n const errorMessage = this.element.querySelector('.dxp-error');\n if (errorMessage) {\n errorMessage.remove();\n }\n }\n }", "title": "" }, { "docid": "168cc0210735032a65c0f417e6af9a98", "score": "0.44479772", "text": "function ClientCtrlMessage(){\r\n this.m_smfHeader = new solace.smf.SMFHeader(); //override prototype's\r\n this.m_smfHeader.m_smf_protocol = 0x0c;\r\n this.m_smfHeader.m_smf_ttl = 1;\r\n\r\n this.m_parameters = []; // override parent\r\n\r\n // Field: msgtype\r\n this.MsgType = 0;\r\n\r\n // Field: version\r\n this.Version = 1;\r\n }", "title": "" }, { "docid": "fd9be3a296c8d1139268a8cfa3449359", "score": "0.4444753", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, Label.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, Label, \"widget\", false);\n }", "title": "" }, { "docid": "d95ea411dd28f8d0ad02f292feec3d83", "score": "0.44399232", "text": "function createMessage(message, vm, parent) {\n // if (Vuetify.config.silent) return\n\n if (parent) {\n vm = {\n __isVue: true,\n $parent: parent,\n $options: vm\n };\n }\n if (vm) {\n // Only show each message once per instance\n vm.$_alreadyWarned = vm.$_alreadyWarned || [];\n if (vm.$_alreadyWarned.includes(message)) return;\n vm.$_alreadyWarned.push(message);\n }\n return `[Vuetify] ${message}` + (vm ? generateComponentTrace(vm) : '');\n }", "title": "" }, { "docid": "f558e51a69aee13c3e484136c01c52ab", "score": "0.443938", "text": "function createMessage(){\n message = new createjs.DOMElement(messagediv);\n message.alpha = 0;\n message.regX = 200;\n message.x = stage.canvas.width / 2;\n message.y = 0;\n stage.addChild(message);\n message.visible=false;\n }", "title": "" }, { "docid": "9fb6b98e7e0a4b8cbfae067158df5d7a", "score": "0.44346386", "text": "_createValidator() {\n return new _validatable.Validator((0, _assign2.default)({}, this.$schema.validatorOptions, { context: this }));\n }", "title": "" }, { "docid": "e1519836024252ae057fc0ac82b78d7a", "score": "0.44331768", "text": "function updateErrorMsg(message, attrs) {\n var self = this;\n // attrs.obj if set, should be a commonObj, and can be self.\n // In addition we need to set validatorAttrs, as they are defined as attrs on obj.\n if (!!attrs && attrs.obj) {\n self = attrs.obj;\n self.validatorAttrs = attrs.obj.attrs;\n }\n\n // element name could be defined in the `attrs` or in the self object\n var elm = (!!attrs && attrs.elm) ? attrs.elm : self.elm;\n var elmName = (!!elm && elm.attr('name')) ? elm.attr('name') : null;\n\n // Make sure that element has a name=\"\" attribute else it will not work\n if(typeof elmName === \"undefined\" || elmName === null) {\n throw 'Angular-Validation Service requires you to have a (name=\"\") attribute on the element to validate... Your element is: ng-model=\"' + elm.attr('ng-model') + '\"';\n }\n\n // user might have passed a message to be translated\n var errorMsg = (!!attrs && !!attrs.translate) ? $translate.instant(message) : message;\n\n // get the name attribute of current element, make sure to strip dirty characters, for example remove a <input name=\"options[]\"/>, we need to strip the \"[]\"\n var elmInputName = elmName.replace(/[|&;$%@\"<>()+,\\[\\]\\{\\}]/g, '');\n var errorElm = null;\n\n // find the element which we'll display the error message, this element might be defined by the user with 'validationErrorTo'\n if(!!self.validatorAttrs && self.validatorAttrs.hasOwnProperty('validationErrorTo')) {\n // validationErrorTo can be used in 3 different ways: with '.' (element error className) or with/without '#' (element error id)\n var firstChar = self.validatorAttrs.validationErrorTo.charAt(0);\n var selector = (firstChar === '.' || firstChar === '#') ? self.validatorAttrs.validationErrorTo : '#'+self.validatorAttrs.validationErrorTo;\n errorElm = angular.element(document.querySelector(selector));\n }\n // errorElm can be empty due to:\n // 1. validationErrorTo has not been set\n // 2. validationErrorTo has been mistyped, and if mistyped, use regular functionality\n if(!errorElm || errorElm.length === 0) {\n // most common way, let's try to find our <span class=\"validation-inputName\">\n errorElm = angular.element(document.querySelector('.validation-'+elmInputName));\n }\n\n // form might have already been submitted\n var isSubmitted = (!!attrs && attrs.isSubmitted) ? attrs.isSubmitted : false;\n\n // invalid & isDirty, display the error message... if <span> not exist then create it, else udpate the <span> text\n if(!!attrs && !attrs.isValid && (isSubmitted || self.ctrl.$dirty || self.ctrl.$touched)) {\n (errorElm.length > 0) ? errorElm.text(errorMsg) : elm.after('<span class=\"validation validation-'+elmInputName+' text-danger\">'+errorMsg+'</span>');\n }else {\n errorElm.text(''); // element is pristine or no validation applied, error message has to be blank\n }\n }", "title": "" }, { "docid": "6759fc397f2eff5b678659e4ac176d5a", "score": "0.4432955", "text": "get requiredMessage() {\n return this.__requiredMessage.get();\n }", "title": "" }, { "docid": "6759fc397f2eff5b678659e4ac176d5a", "score": "0.4432114", "text": "get requiredMessage() {\n return this.__requiredMessage.get();\n }", "title": "" }, { "docid": "5ddafeb89f02a9ed38fe3103c6690d20", "score": "0.4431524", "text": "function validate(newValue) {\n target.hasError(newValue ? false : true);\n target.validationMessage(newValue ? \"\" : overrideMessage || \"Oops you've missed something\");\n }", "title": "" }, { "docid": "f11dc94467aba2806c5b81dda49dd2b8", "score": "0.44259518", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, GroupBox.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, GroupBox, \"widget\", false);\n }", "title": "" }, { "docid": "b1d7e0b98ed701c1e57cceee70c9880f", "score": "0.44248006", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, TextBox.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, TextBox, \"widget\", false);\n }", "title": "" }, { "docid": "8d46f86e0803ddf0d4fa4f6a333317cb", "score": "0.442464", "text": "function validateMessage() {\n this.app_invalid = document.querySelectorAll('small[data-invalid]');\n this.length = this.app_invalid.length;\n this.setMessage = function (name, message) {\n for (var i = 0; i < this.length; i++) {\n var tag = this.app_invalid[i];\n if (name == tag.getAttribute('data-invalid')) { /* firstname*/\n tag.innerHTML = message;\n tag.removeAttribute('hidden');\n }\n }\n }\n this.getMessage = function () {\n return this;\n }\n this.resetMessage = function () {\n for (var i = 0; i < this.length; i++) {\n var tag = this.app_invalid[i];\n tag.setAttribute('hidden', 'true');\n tag.innerHTML = '';\n }\n }\n}", "title": "" }, { "docid": "f662ead6cb142fb421c77e632cd20363", "score": "0.44241267", "text": "function buildMessage(messageContent) {\n return {\n\t\tcontentType: 'PlainText',\n\t\tcontent: messageContent,\n };\n}", "title": "" }, { "docid": "f930536cdb1aa775a290bbabd5f976f7", "score": "0.44205937", "text": "constructMessage(){\n // messageVariable can be adjusted to contain any number of variable inputs\n const messageVariables = {\n \"salutation\": this.salutation(),\n \"firstName\": this._guestInfo.firstName,\n \"lastName\": this._guestInfo.lastName,\n \"roomNumber\": this._guestInfo.reservation.roomNumber,\n \"company\": this._companyInfo.company,\n \"city\": this._companyInfo.city,\n }\n // define the initial message template\n let message = this._templateInfo.message\n // loop through messageVariables, if the variable key is found in 'message', replace it with the variable value\n for (const key in messageVariables){\n message = message.replace(`{${key}}`, `${messageVariables[key]}`)\n }\n return message\n }", "title": "" }, { "docid": "2f3405fb47d02b1ea305d50b066a9afa", "score": "0.44119367", "text": "message(value) {\n this.newMessage = value;\n }", "title": "" }, { "docid": "68ee0a8e98b524a5d19c7e21e462f1f3", "score": "0.4401403", "text": "parseNativeSubMessage(message) {\r\n return this._parser.createNormalizedMessageFromXMLString(message, null);\r\n }", "title": "" }, { "docid": "47e216e46bc32d24633d772d00ef453d", "score": "0.4396591", "text": "static createInTemplateGridContentsUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "29882d39708622385c2b1d52c56a4f3c", "score": "0.43930933", "text": "message(message) {\n this.__data['message'] = message;\n\n return this;\n }", "title": "" }, { "docid": "e4536cc19f3eb1e04721b294dd167a1f", "score": "0.43837667", "text": "static createInHeaderUnderLeftWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"leftWidget\", false);\n }", "title": "" }, { "docid": "682ce5bb429cbf63045f1a4077258cb3", "score": "0.4380861", "text": "function buildErrorMessage(msg) {\r\n var errorMsg = $('<p/>', {\r\n class: \"error-msg\"\r\n });\r\n\r\n errorMsg.text(msg);\r\n return errorMsg;\r\n }", "title": "" }, { "docid": "f98affb2466570226378911da9e5bba8", "score": "0.4377039", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, TextArea.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, TextArea, \"widget\", false);\n }", "title": "" }, { "docid": "77572c5c574bf49ab9089e2e2fa4d9ac", "score": "0.43746325", "text": "function validate(newValue) {\n target.hasError(newValue ? false : true);\n target.validationMessage(newValue ? \"\" : overrideMessage || \"*\");\n }", "title": "" }, { "docid": "e4ca0754b9f98e568362809c4344c6de", "score": "0.43706116", "text": "function populateValidationMessage() {\n\n var valid = \"\"\n\n //Concatenate each error message to an auxiliary variable\n if ($(\"#name\").valid() === false) {\n valid = valid.concat(\"Name: only alphabet characters are allowed,\")\n }\n if ($(\"#address\").valid() === false) {\n valid = valid.concat(\"Address: only alphanumeric characters are allowed,\")\n }\n if ($(\"#email\").valid() === false) {\n valid = valid.concat(\"Email: the format is not valid,\")\n }\n if (!$(\"input[name='interested']\").is(':checked')) {\n valid = valid.concat(\"GMU Interest: at least one must be selected,\")\n }\n if ($(\"input[name='preferences']:checked\").length < 2) {\n valid = valid.concat(\"Campus Preferences: at least two must be selected,\")\n }\n\n //Split the message by commas\n customItems = valid.split(\",\");\n\n //Remove empty values\n customItems = customItems.filter(function(el) {\n return el !== \"\"\n })\n\n //Format the validation message to display to the user\n for (let i = 0; i < customItems.length; i++) {\n customItems[i] = \"- \" + customItems[i] + \"<br>\";\n }\n\n //Join the custom message again\n customItems = customItems.join(\"\");\n\n //Set the message that is going to be displayed in the JQuery dialog modal\n document.getElementById(\"validationModal\").innerHTML = customItems;\n\n return valid\n}", "title": "" }, { "docid": "afa5b205e69e1e13dc51f9dea91414c6", "score": "0.43669343", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, DynamicText.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, DynamicText, \"widget\", false);\n }", "title": "" }, { "docid": "0588bca9462e44a3b521a8e0271e8a39", "score": "0.43643826", "text": "function createMessageError(error) {\n errorMessage.message = \"Could not create message. Please try again later.\";\n res.status(500).json(errorMessage);\n }", "title": "" }, { "docid": "010a5e00edd688bb3aa5797d5ed7790b", "score": "0.43613058", "text": "generateMessage (callback) {\n\t\t// the message we expect to receive is the registered user, with isRegistered flag set\n\t\tlet user = new User(this.registeringUser);\n\t\tlet userObject = user.getSanitizedObject();\n\t\tObject.assign(userObject, {\n\t\t\tisRegistered: true,\n\t\t\tjoinMethod: 'Added to Team',\n\t\t\tprimaryReferral: 'internal',\n\t\t\toriginTeamId: this.team.id,\n\t\t\tversion: 3\n\t\t});\n\t\tdelete userObject.inviteCode;\n\t\tthis.message = {\n\t\t\tusers: [userObject]\n\t\t};\n\t\tthis.beforeConfirmTime = Date.now();\n\n\t\t// confirming the user should trigger the message\n\t\tthis.userFactory.confirmUser(this.registeringUser, callback, { headers: { 'x-cs-plugin-ide': this.expectedOrigin }});\n\t}", "title": "" }, { "docid": "d48619834279401c6646e7376961e960", "score": "0.43612984", "text": "decodeMessage(data) {\n return __classPrivateFieldGet(this, _decodeMessage).call(this, 'message', this.messages, data);\n }", "title": "" }, { "docid": "afb80db8ed241319d86d98fa0f21f072", "score": "0.4356423", "text": "function $msg(attrs) { return new Strophe.Builder(\"message\", attrs); }", "title": "" }, { "docid": "4fd4bb66dfa66215278e0a511fc3c431", "score": "0.4355797", "text": "static createIn(container) {\n internal.createInVersionCheck(container.model, MasterDetailDetailRegion.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, MasterDetailDetailRegion, \"detail\", false);\n }", "title": "" }, { "docid": "7595b474130704a8660a2874b70af704", "score": "0.43557116", "text": "message() {\n this.matchWord(Tag.ID, 'message');\n var messageName = this.look;\n this.match(Tag.ID);\n this.match('{');\n var body = this.messageBody();\n this.match('}');\n return new Message(messageName, body);\n }", "title": "" }, { "docid": "5da2f4ea299660c13ce434fc954ea390", "score": "0.43519923", "text": "create(data) {\n const href = `${_environments_environment__WEBPACK_IMPORTED_MODULE_3__[\"environment\"].api.workMessages}`;\n return this.http.post(href, data);\n }", "title": "" }, { "docid": "6ccb208b422222ee1dd69e2eda036fa8", "score": "0.43515155", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, ShowMessageAction);\n }", "title": "" }, { "docid": "e85c874888f43114e0139e0f1d536dd7", "score": "0.43508783", "text": "constructor() { \n \n MessageMetadata.initialize(this);\n }", "title": "" }, { "docid": "59594a318fef999806c80a34b4a8e8e9", "score": "0.43370834", "text": "get messages() {\n return {\n required: \"{{field}} is required.\",\n required_when: \"{{field}} is required.\",\n regex: \"Invalid {{field}} format.\"\n };\n }", "title": "" }, { "docid": "0613951d903aae21873b69d57c2af81b", "score": "0.433482", "text": "static createInSnippetUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "a27d623f95807c1064e29ed6bba6481c", "score": "0.43347967", "text": "validateMessage (message) {\n\t\t// we can't predict these in advance, just check that they were updated\n\t\t// and then add them to our comparison message for validation\n\t\tconst user = message.message.users[0];\n\t\tAssert(typeof user.modifiedAt === 'number' && user.modifiedAt >= this.beforeConfirmTime, 'modifiedAt not updated properly');\n\t\tAssert(typeof user.registeredAt === 'number' && user.registeredAt >= this.beforeConfirmTime, 'registeredAt not updated properly');\n\t\tAssert(typeof user.lastLogin === 'number' && user.lastLogin > this.beforeConfirmTime, 'lastLogin not updated properly');\n\t\tAssert.equal(user.lastOrigin, this.expectedOrigin, 'lastOrigin not set to plugin IDE');\n\t\tthis.message.users[0].modifiedAt = user.modifiedAt;\n\t\tthis.message.users[0].registeredAt = user.registeredAt;\n\t\tthis.message.users[0].lastLogin = user.lastLogin;\n\t\tthis.message.users[0].lastOrigin = this.expectedOrigin;\n\t\treturn super.validateMessage(message);\n\t}", "title": "" }, { "docid": "e5f08891c3dde6c83689a074e7a57e42", "score": "0.4333978", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, Placeholder.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, Placeholder, \"widget\", false);\n }", "title": "" }, { "docid": "0c35299e46346c388054bdb22de64035", "score": "0.43196878", "text": "static create(message) {\n return new PlainMessage(message);\n }", "title": "" }, { "docid": "50f609bc11ae4458e45c9f847ebbb468", "score": "0.43179896", "text": "_createMessageElement(message, role) {\n const messageElement = this._document.createElement('div');\n setMessageId(messageElement);\n messageElement.textContent = message;\n if (role) {\n messageElement.setAttribute('role', role);\n }\n this._createMessagesContainer();\n messagesContainer.appendChild(messageElement);\n messageRegistry.set(getKey(message, role), { messageElement, referenceCount: 0 });\n }", "title": "" }, { "docid": "50f609bc11ae4458e45c9f847ebbb468", "score": "0.43179896", "text": "_createMessageElement(message, role) {\n const messageElement = this._document.createElement('div');\n setMessageId(messageElement);\n messageElement.textContent = message;\n if (role) {\n messageElement.setAttribute('role', role);\n }\n this._createMessagesContainer();\n messagesContainer.appendChild(messageElement);\n messageRegistry.set(getKey(message, role), { messageElement, referenceCount: 0 });\n }", "title": "" }, { "docid": "3da376c58067244e2fb712aee5079b9f", "score": "0.43175104", "text": "function Message () {\n\n if (!(this instanceof Message)) {\n if (typeof arguments[0] === 'object' && arguments[0] instanceof Message) {\n debug('message is a message so return it');\n return arguments[0];\n }\n else {\n debug('creating new message and initializing with arguments');\n var m = new Message();\n Message.prototype.initialize.apply(m, slice.call(arguments));\n return m;\n }\n }\n else {\n this.isMessage = true;\n if (arguments.length) {\n debug('initializing with arguments');\n Message.prototype.initialize.apply(this, slice.call(arguments));\n }\n }\n\n}", "title": "" }, { "docid": "7ac609e26bb677d82e1431b040cb8a7b", "score": "0.43105814", "text": "static createInLayoutCallArgumentUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "74192a44fe9f3ce01ae316fbc837f471", "score": "0.43073666", "text": "function _validateMessage(messageObject) {\n let valid = true;\n let contact = messageObject;\n let errors = {};\n if (isEmpty(contact.name)) {\n errors.name = \"Please provide your name\";\n valid = false;\n } else if (contact.name.length < 3) {\n errors.name = \"Name must be at least 3 characters long\";\n valid = false;\n }\n\n if (isEmpty(contact.contactNumber)) {\n errors.contactNumber = \"Please provide your contact number so that seller can contact you\";\n valid = false;\n } else if (!isNumeric(contact.contactNumber)) {\n errors.contactNumber = \"Only digits are allowed in contact number\";\n valid = false;\n } else if (contact.contactNumber.length < 10 || contact.contactNumber.length > 15) {\n errors.contactNumber = \"Please provide a valid phone number\";\n valid = false;\n }\n\n if (isEmpty(contact.message)) {\n errors.message = \"Please Enter your message\";\n valid = false;\n } else if (contact.message.length < 25) {\n errors.message = \"Message is too short, please describe your message breifly.\";\n valid = false;\n }\n\n let response;\n if (!valid) {\n response = {\n status: 'error',\n errors: errors\n }\n return response;\n } else {\n response = {\n status: 'ok',\n errors: null\n }\n return response;\n }\n}", "title": "" }, { "docid": "3492b12b1fd181a8e99745400f25b498", "score": "0.43069562", "text": "static createInLayoutGridColumnUnderWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widget\", false);\n }", "title": "" }, { "docid": "471e30f5d532577a7fde31441a1e5e99", "score": "0.43018824", "text": "static createInBuildingBlockUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"widgets\", true);\n }", "title": "" }, { "docid": "597daabf7c1a68ce9bb9f7466eb39e3d", "score": "0.42941743", "text": "function createBadRequest(message, res) {\n\n var responseError = {};\n responseError.statusCode = 400;\n responseError.validationErrors = [{\n keyword: \"ValidationError\",\n message: message\n }];\n\n return res.status(400).json(responseError);\n\n}", "title": "" }, { "docid": "9308b157c61946b8d2bff8e50fac3398", "score": "0.42922613", "text": "function Message () {\r\n var fnShellCallBackFunction;\r\n\r\n /**\r\n * Initialisation:\r\n * This method is to be invoked by the Shell to register the message callback function.\r\n * The signature of the callback is defined via the show function.\r\n *\r\n * @param {function} fnShellCallback\r\n * callback for the shell to execute showing the message\r\n *\r\n * @methodOf sap.ushell.services.Message#\r\n * @name init\r\n *\r\n * @returns {object} this\r\n * The MessageService\r\n *\r\n * @private\r\n */\r\n this.init = function (fnShellCallback) {\r\n fnShellCallBackFunction = fnShellCallback;\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Shows a message on the screen.\r\n *\r\n * @param {sap.ushell.services.Message.Type} iType\r\n * message type\r\n * @param {string} sMessage\r\n * the localized message as plain text\r\n * @param {object} oParameters\r\n * Some parameters\r\n *\r\n * @methodOf sap.ushell.services.Message#\r\n * @name show\r\n * @private\r\n */\r\n this.show = function (iType, sMessage, oParameters) {\r\n if (!sMessage) {\r\n jQuery.sap.log.error(\"Message must not be empty.\");\r\n return;\r\n }\r\n\r\n if (fnShellCallBackFunction && typeof fnShellCallBackFunction === \"function\") {\r\n fnShellCallBackFunction(iType, sMessage, oParameters || {});\r\n } else {\r\n this.buildMessage(iType, sMessage, oParameters || {});\r\n }\r\n };\r\n\r\n /**\r\n * Decides wether a MessageBox or a SupportMessage needs to be send and accordingly builds a configuration for it.\r\n * @param {number} iType message type\r\n * @param {string} sMessage message text\r\n * @param {object} oParameters message parameters\r\n * @private\r\n */\r\n this.buildMessage = function (iType, sMessage, oParameters) {\r\n var oMessageBoxConfig = {\r\n title: oParameters.title,\r\n actions: oParameters.actions,\r\n details: oParameters.details,\r\n onClose: oParameters.callback\r\n },\r\n sMessageBoxType;\r\n\r\n switch (iType) {\r\n case Message.Type.ERROR:\r\n var oDialog = this.createErrorDialog(sMessage, oMessageBoxConfig);\r\n oDialog.open();\r\n return;\r\n case Message.Type.CONFIRM:\r\n if (!oParameters.actions) {\r\n sMessageBoxType = \"confirm\";\r\n } else {\r\n oMessageBoxConfig.icon = MessageBox.Icon.QUESTION;\r\n sMessageBoxType = \"show\";\r\n }\r\n break;\r\n case Message.Type.INFO:\r\n sMessageBoxType = \"info\";\r\n this.buildAndSendMessageToast(sMessage, oParameters.duration || 3000);\r\n //Show only Toast. Don't need to show the MessageBox.\r\n return;\r\n default:\r\n oMessageBoxConfig = { duration: oParameters.duration || 3000 };\r\n sMessageBoxType = \"show\";\r\n break;\r\n }\r\n\r\n this.sendMessageBox(sMessage, sMessageBoxType, oMessageBoxConfig); // Give me some parameters please!\r\n };\r\n\r\n /**\r\n * Creates a Dialog from a given error message.\r\n * @param {string} sMessage message text\r\n * @param {object} oConfig message configuration (title and details)\r\n * @returns {object} oDialog enriched dialog\r\n * @private\r\n */\r\n this.createErrorDialog = function (sMessage, oConfig) {\r\n\r\n function copyToClipboard (sToClipboard) {\r\n var oTemporaryDomElement = document.createElement(\"textarea\");\r\n try {\r\n oTemporaryDomElement.contentEditable = true;\r\n oTemporaryDomElement.readonly = false;\r\n oTemporaryDomElement.innerText = sToClipboard;\r\n document.documentElement.appendChild(oTemporaryDomElement);\r\n\r\n if (navigator.userAgent.match(/ipad|iphone/i)) {\r\n var oRange = document.createRange();\r\n oRange.selectNodeContents(oTemporaryDomElement);\r\n window.getSelection().removeAllRanges();\r\n window.getSelection().addRange(oRange);\r\n oTemporaryDomElement.setSelectionRange(0, 999999);\r\n } else {\r\n jQuery(oTemporaryDomElement).select();\r\n }\r\n\r\n document.execCommand(\"copy\");\r\n sap.m.MessageToast.show(resources.i18n.getText(\"CopyWasSuccessful\"));\r\n } catch (oException) {\r\n sap.m.MessageToast.show(resources.i18n.getText(\"CopyWasNotSuccessful\"));\r\n } finally {\r\n jQuery(oTemporaryDomElement).remove();\r\n }\r\n }\r\n\r\n function generateCopyButton(sButtonName) {\r\n var oButton = new Button({\r\n text: resources.i18n.getText(sButtonName),\r\n press: function () {\r\n var sFormattedDetails = oConfig.details;\r\n\r\n if (typeof oConfig.details === \"object\") {\r\n // Using stringify() with \"tab\" as space argument and escaping the JSON to prevent binding\r\n sFormattedDetails = JSON.stringify(oConfig.details, null, '\\t');\r\n }\r\n\r\n var aCopiedText = [];\r\n aCopiedText.push(\"Title: \" + (sDialogTitle || \"-\"));\r\n aCopiedText.push(\"Message: \" + (sMessage || \"-\"));\r\n aCopiedText.push(\"Details: \" + (sFormattedDetails || \"-\"));\r\n copyToClipboard(aCopiedText.join(\"\\n\"));\r\n }\r\n });\r\n\r\n oButton.setTooltip(resources.i18n.getText(\"CopyToClipboardBtn_tooltip\"));\r\n return oButton;\r\n }\r\n\r\n function generateContactSupportButton(sButtonName) {\r\n var oButton = new Button({\r\n text: resources.i18n.getText(sButtonName),\r\n press: function () {\r\n sap.ui.require(['sap/ushell/ui/footerbar/ContactSupportButton'],\r\n function (ContactSupportButton) {\r\n var oContactSupport = new ContactSupportButton();\r\n if (oContactSupport) {\r\n oContactSupport.showContactSupportDialog();\r\n // oContactSupport is redundant after creation of the Contact Support Dialog.\r\n oContactSupport.destroy();\r\n }\r\n });\r\n\r\n oDialog.destroy();\r\n }\r\n });\r\n\r\n oButton.setTooltip(resources.i18n.getText(\"contactSupportBtn_tooltip\"));\r\n return oButton;\r\n }\r\n\r\n function generateButton (sButtonName) {\r\n switch (sButtonName) {\r\n case \"contactSupportBtn\":\r\n return generateContactSupportButton(sButtonName);\r\n case \"CopyToClipboardBtn\":\r\n return generateCopyButton(sButtonName);\r\n default:\r\n return new Button({\r\n text: resources.i18n.getText(sButtonName),\r\n press: function () {\r\n oDialog.destroy();\r\n }\r\n });\r\n }\r\n }\r\n\r\n function defineButtons (bHasSupportButton) {\r\n var aButtonNames = [],\r\n aButtons = [];\r\n\r\n if (bHasSupportButton) {\r\n aButtonNames.push(\"contactSupportBtn\");\r\n } else {\r\n aButtonNames.push(\"okDialogBtn\");\r\n }\r\n\r\n aButtonNames.push(\"CopyToClipboardBtn\");\r\n aButtonNames.push(\"cancelDialogBtn\");\r\n\r\n aButtonNames.forEach(function (sButtonName) {\r\n aButtons.push(generateButton(sButtonName));\r\n });\r\n\r\n return aButtons;\r\n }\r\n\r\n function addButtonsToDialog (oDialog, aButtons) {\r\n aButtons.forEach(function (oButton) {\r\n oDialog.addButton(oButton);\r\n });\r\n }\r\n\r\n function addMessageToVBox (oVBox) {\r\n var oText = new Text({\r\n text: sMessage\r\n });\r\n\r\n if (oConfig.details) {\r\n oText.addStyleClass(\"sapUiSmallMarginBottom\");\r\n }\r\n\r\n oVBox.addItem(oText);\r\n }\r\n\r\n function addDetailsToVBox (oVBox) {\r\n var sDetails = oConfig.details;\r\n\r\n if (typeof oConfig.details === \"object\") {\r\n sDetails = oConfig.details.info;\r\n }\r\n\r\n var oLink = new Link({\r\n text: resources.i18n.getText(\"ViewDetails\"),\r\n press: function () {\r\n var iLinkContentIndex = oVBox.indexOfItem(oLink);\r\n oVBox.removeItem(iLinkContentIndex);\r\n oVBox.insertItem(\r\n new FormattedText({\r\n htmlText: sDetails\r\n }), iLinkContentIndex);\r\n }\r\n });\r\n\r\n oVBox.addItem(oLink);\r\n }\r\n\r\n function defineContent () {\r\n var oVBox = new VBox({\r\n renderType: sap.m.FlexRendertype.Bare\r\n });\r\n\r\n addMessageToVBox(oVBox);\r\n\r\n if (oConfig.details) {\r\n addDetailsToVBox(oVBox);\r\n }\r\n\r\n return oVBox;\r\n }\r\n\r\n var sDialogTitle = oConfig.title || resources.i18n.getText(\"error\");\r\n\r\n var oDialog = new Dialog({\r\n state: sap.ui.core.ValueState.Error,\r\n title: sDialogTitle,\r\n type: sap.m.DialogType.Message,\r\n contentWidth: \"30rem\"\r\n });\r\n\r\n var bContactSupportEnabled = Config.last(\"/core/extension/SupportTicket\"),\r\n // check that SupportTicket is enabled and verify that we are not in a flow in which Support ticket creation is failing,\r\n // if this is the case we don't want to show the user the contact support button again\r\n // Note: Renderer.qunit.js deletes sap.ushell.container before this code is called.\r\n // check if container is available\r\n bHasSupportButton = sap.ushell.Container\r\n && bContactSupportEnabled\r\n && sMessage !== resources.i18n.getText(\"supportTicketCreationFailed\");\r\n\r\n var aButtons = defineButtons(bHasSupportButton);\r\n addButtonsToDialog(oDialog, aButtons);\r\n\r\n var oVBox = defineContent();\r\n oDialog.addContent(oVBox);\r\n\r\n return oDialog;\r\n };\r\n\r\n /**\r\n * Sends a MessageToast with provided Message and Duration\r\n * @param {string} sMessage The message\r\n * @param {number} iDuration The duration of the MessageToast in ms\r\n */\r\n this.buildAndSendMessageToast = function (sMessage, iDuration) {\r\n sap.ui.require([\"sap/m/MessageToast\"], function (MessageToast) {\r\n MessageToast.show(sMessage, { duration: iDuration });\r\n });\r\n };\r\n\r\n /**\r\n * Sends a MessageBox based on the provided configuration\r\n * @param {string} sMessage The actual error message\r\n * @param {string} sType The type of the MessageBox. e.g.: show, confirm\r\n * @param {object} oConfig The configuration of the MessageBox\r\n */\r\n this.sendMessageBox = function (sMessage, sType, oConfig) {\r\n if (MessageBox.hasOwnProperty(sType) && typeof MessageBox[sType] === \"function\") {\r\n MessageBox[sType](sMessage, oConfig);\r\n } else {\r\n jQuery.sap.log.error(\"Unknown Message type: \" + sType);\r\n }\r\n };\r\n\r\n /**\r\n * Shows an info message on the screen.\r\n *\r\n * @param {string} sMessage\r\n * the localized message as plain text\r\n * @param {int} [iDuration=3000]\r\n * display duration in ms (optional)\r\n *\r\n * @methodOf sap.ushell.services.Message#\r\n * @name info\r\n * @public\r\n * @alias sap.ushell.services.Message#info\r\n */\r\n this.info = function (sMessage, iDuration) {\r\n this.show(Message.Type.INFO, sMessage, { duration : iDuration || 3000 });\r\n };\r\n\r\n /**\r\n * Shows an error message on the screen.\r\n *\r\n * @param {string} sMessage\r\n * the localized message as plain text\r\n * @param {string} [sTitle]\r\n * the localized title as plain text (optional)\r\n *\r\n * @methodOf sap.ushell.services.Message#\r\n * @name error\r\n * @public\r\n * @alias sap.ushell.services.Message#error\r\n */\r\n this.error = function (sMessage, sTitle) {\r\n sMessage = (sTitle !== undefined) ? sTitle + \" , \" + sMessage : sMessage;\r\n jQuery.sap.log.error(sMessage);\r\n\r\n this.show(Message.Type.ERROR, sMessage, { title : sTitle });\r\n };\r\n\r\n /**\r\n * Shows an confirmation dialog on the screen.\r\n *\r\n * The callback is called with the following signature: <code>function(oAction)</code>\r\n * where oAction is the button that the user has tapped. For example, when the user has pressed the close button, a sap.m.MessageBox.Action.Close is returned.\r\n *\r\n * If no actions are provided, OK and Cancel will be shown. In this case oAction is set by one of the following three values:\r\n * 1. sap.m.MessageBox.Action.OK: OK (confirmed) button is tapped.\r\n * 2. sap.m.MessageBox.Action.Cancel: Cancel (unconfirmed) button is tapped.\r\n * 3. null: Confirm dialog is closed by Calling sap.m.InstanceManager.closeAllDialogs()\r\n *\r\n * @param {string} sMessage\r\n * the localized message as plain text\r\n * @param {function} fnCallback\r\n * callback function\r\n * @param {string} [sTitle]\r\n * the localized title as plain text (optional)\r\n * @param {sap.m.MessageBox.Action|sap.m.MessageBox.Action[]|string|string[]} [vActions]\r\n * Either a single action, or an array of two actions. If no action(s) are given, the single action MessageBox.Action.OK is taken as a default for the parameter. If more than two actions are given, only the first two actions are taken. Custom action string(s) can be provided, and then the translation of custom action string(s) needs to be done by the application.\r\n *\r\n * @methodOf sap.ushell.services.Message#\r\n * @name confirm\r\n * @public\r\n * @alias sap.ushell.services.Message#confirm\r\n */\r\n this.confirm = function (sMessage, fnCallback, sTitle, vActions) {\r\n this.show(Message.Type.CONFIRM, sMessage, { title : sTitle, callback : fnCallback, actions : vActions });\r\n };\r\n }", "title": "" }, { "docid": "224107d804c3ab1eeb03e14a99a17f7f", "score": "0.42902526", "text": "getNewMessage() {\n return {\n journey: this.journey,\n content: \"\",\n user: {\n id: this.userId,\n first_name: this.firstName,\n last_name: this.lastName\n },\n created: moment().toISOString()\n };\n }", "title": "" }, { "docid": "87a26c27ce581ac588708ebaef08ffe6", "score": "0.42835677", "text": "function validateMessage(event) {\n\n // Get the input field element and check if its a valid e-mail entry.\n let $message = $(this);\n let valid = ($.trim($message.val())) ? true : false;\n\n // Set validity state of this input control on its closest ancestor.\n let $input = $message.closest(selectors.input);\n $input.attr(attributes.valid, valid);\n\n if (bDebug) { console.log(\"[%s] validateMessage(): [%s] -> %s\", sModule, event.target.value, valid); }\n }", "title": "" }, { "docid": "0ec3c2006610974b5b8b3c62043d156c", "score": "0.42819393", "text": "function UIFieldMsg(sFieldID, bShow, oRef, sLocation, sMsgType, sMsgText) {\n \n this.FieldID = sFieldID;\n this.Show = bShow;\n this.Ref = oRef;\n this.Location = sLocation;\n this.MsgType = sMsgType;\n this.MsgText = sMsgText;\n\n}", "title": "" }, { "docid": "c02329cabd5d249b2f5406002650c90e", "score": "0.4275952", "text": "validationSuccessChanged(newValue){if(newValue!=null && newValue!=undefined && this._responsivesplitter!==null){ this._responsivesplitter.attachValidationSuccess(newValue);}}", "title": "" }, { "docid": "c005a4eafc1f7416f6037c994ba13c54", "score": "0.42738256", "text": "validate() {\n // Get generic API validation errors\n this._super();\n const intl = get(this, 'intl');\n var errors = get(this, 'errors')||[];\n if ( !get(this, 'cluster.name') ) {\n errors.push(intl.t('clusterNew.tencenttke.cluster.name.required'));\n }\n\n // Add more specific errors\n\n // Set the array of errors for display,\n // and return true if saving should continue.\n if ( get(errors, 'length') ) {\n set(this, 'errors', errors);\n return false;\n } else {\n set(this, 'errors', null);\n return true;\n }\n }", "title": "" }, { "docid": "6dea10c09202028899fe6293a90d39b8", "score": "0.4272908", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, MasterDetail);\n }", "title": "" }, { "docid": "092420dbb3804fe49b23e7410a797ac8", "score": "0.42669338", "text": "function createErrorMessage(msg) {\n return $('<p>').addClass('error-msg').text(msg);\n}", "title": "" }, { "docid": "92426d8a051da4f5339c3ed904b47130", "score": "0.42667267", "text": "static createInSplitPaneUnderFirstWidget(container) {\n internal.createInVersionCheck(container.model, ValidationMessage.structureTypeName, { start: \"7.0.2\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, ValidationMessage, \"firstWidget\", false);\n }", "title": "" }, { "docid": "bd6e92a9f80bffd935982c37f4ae7616", "score": "0.4266181", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, DataGrid.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, DataGrid, \"widget\", false);\n }", "title": "" }, { "docid": "d8eb3c39254620c72f9ce565fdd815bb", "score": "0.4264943", "text": "static createInMasterDetailRegionUnderWidget(container) {\n internal.createInVersionCheck(container.model, LoginIdTextBox.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, LoginIdTextBox, \"widget\", false);\n }", "title": "" }, { "docid": "202611d761368bb0d428be069a46ea9f", "score": "0.42592525", "text": "function ClearValidationMessage() {\n firstName.setCustomValidity(\"\");\n lastName.setCustomValidity(\"\");\n contactNumber.setCustomValidity(\"\");\n email.setCustomValidity(\"\");\n yourMessage.setCustomValidity(\"\");\n }", "title": "" } ]
6f17033fcfbf683614f31dbb7740c38f
=========================================================================== Reverse the first len bits of a code, using straightforward code (a faster method would use a table) IN assertion: 1 <= len <= 15
[ { "docid": "6c01e704eb6da3ed5deeae62be823831", "score": "0.78896075", "text": "function bi_reverse(code, len) {\n var res = 0;\n\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n\n return res >>> 1;\n }", "title": "" } ]
[ { "docid": "5b75f38e678d1b945a8ac120001a8dfa", "score": "0.7962264", "text": "function bi_reverse$1(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "ef0e21bafaaa82601effd728b9c1d692", "score": "0.79475", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "801aa28ad80663ef0faa517dea3ebaac", "score": "0.79386634", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "3ebc4fc5fd601b19478420e843691b90", "score": "0.793677", "text": "function bi_reverse(code, len) {\n var res = 0;\n\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n\n return res >>> 1;\n }", "title": "" }, { "docid": "3ebc4fc5fd601b19478420e843691b90", "score": "0.793677", "text": "function bi_reverse(code, len) {\n var res = 0;\n\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n\n return res >>> 1;\n }", "title": "" }, { "docid": "629f169935aa7485076686d9d0f7955d", "score": "0.7907587", "text": "function bi_reverse$1(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "1c7df0efba2a94a9dbd59412cb263f59", "score": "0.7902312", "text": "function bi_reverse$2(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "dad2e9ca00fb0d811b68176a3abf4896", "score": "0.7897974", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "dad2e9ca00fb0d811b68176a3abf4896", "score": "0.7897974", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "title": "" }, { "docid": "76569cc7680d55500e6e9d4440b946a3", "score": "0.788392", "text": "function bi_reverse(code,len){var res=0;do {res|=code&1;code>>>=1;res<<=1;}while(--len>0);return res>>>1;}", "title": "" }, { "docid": "89edb1d5a4820919f41d645fbcfbb7cd", "score": "0.78739095", "text": "function bi_reverse(code,len){var res=0;do{res|=code&1;code>>>=1;res<<=1;}while(--len>0);return res>>>1;}", "title": "" }, { "docid": "89edb1d5a4820919f41d645fbcfbb7cd", "score": "0.78739095", "text": "function bi_reverse(code,len){var res=0;do{res|=code&1;code>>>=1;res<<=1;}while(--len>0);return res>>>1;}", "title": "" }, { "docid": "89edb1d5a4820919f41d645fbcfbb7cd", "score": "0.78739095", "text": "function bi_reverse(code,len){var res=0;do{res|=code&1;code>>>=1;res<<=1;}while(--len>0);return res>>>1;}", "title": "" }, { "docid": "89edb1d5a4820919f41d645fbcfbb7cd", "score": "0.78739095", "text": "function bi_reverse(code,len){var res=0;do{res|=code&1;code>>>=1;res<<=1;}while(--len>0);return res>>>1;}", "title": "" }, { "docid": "89edb1d5a4820919f41d645fbcfbb7cd", "score": "0.78739095", "text": "function bi_reverse(code,len){var res=0;do{res|=code&1;code>>>=1;res<<=1;}while(--len>0);return res>>>1;}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "94910e1687e45127ad76320b89189ea9", "score": "0.78357726", "text": "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2e61cfd0cb503495e93bff777b4b2fe4", "score": "0.7822699", "text": "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "title": "" }, { "docid": "2f031768cd3ad098cbd20bc0efa75062", "score": "0.7804089", "text": "function bi_reverse(code, len) {\n var res = 0;\n\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n\n return res >>> 1;\n}", "title": "" } ]
a5094f6536fbc9fdfedd31ac99eb00f4
Handler for temporary usage for once implementation
[ { "docid": "955ada6f289388e87cbee05fb9809562", "score": "0.0", "text": "function onceHandler() {\n fn.apply(context || obj, arguments);\n self._off(obj, types, onceHandler, context);\n }", "title": "" } ]
[ { "docid": "acffe366305a123ddf65c9f97713c0bb", "score": "0.685861", "text": "function ___PRIVATE___(){}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.6752528", "text": "function Handler() {}", "title": "" }, { "docid": "5815673b311a51d19d78c2e6968ae677", "score": "0.6525233", "text": "handle() {}", "title": "" }, { "docid": "5815673b311a51d19d78c2e6968ae677", "score": "0.6525233", "text": "handle() {}", "title": "" }, { "docid": "48131704c239df8408ff9dd2ba8b5401", "score": "0.6359048", "text": "function NoopHandler() {}", "title": "" }, { "docid": "9b4306da1a1e9c3d0f940fc60bd4b3f0", "score": "0.62468046", "text": "function NoopHandler() { }", "title": "" }, { "docid": "170945dac3d5cf7b843e57c13c982ced", "score": "0.6102991", "text": "function helper () {}", "title": "" }, { "docid": "8464c3542f7a8f7163b7df6534c4669b", "score": "0.594728", "text": "adoptedCallback() {\n\t\t}", "title": "" }, { "docid": "8db0a0cb27dbd6a9d4d44f68abe61b0d", "score": "0.5765181", "text": "_addedHook() {}", "title": "" }, { "docid": "1ec628c522b9634177bdec5234d81613", "score": "0.573577", "text": "static use(handler) {\n handler.call(null, superagent);\n }", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.5709339", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "660072062919563329433351593cbe9b", "score": "0.5674118", "text": "usable(context,on=null) {return({OK:false, msg:'Cannot use.'});}", "title": "" }, { "docid": "bfd3ac15570112d3b8e479acffd1aa8d", "score": "0.56561387", "text": "function SimpleCallbackHandler() {}", "title": "" }, { "docid": "ff37da4f2db15b306db4b2f6308a4a0c", "score": "0.5637251", "text": "function Handler() {\n\t\t\tthis.state = 0;\n\t\t}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.56032234", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.56032234", "text": "handleEvent() {}", "title": "" }, { "docid": "5659c2a34401853a3ae36987b6a21e8b", "score": "0.5590841", "text": "function _noop(){}", "title": "" }, { "docid": "60715e008dff71440a3a06e9de51061a", "score": "0.5587956", "text": "proceed() {}", "title": "" }, { "docid": "a54af68cfbc3b90096060e973a5f0268", "score": "0.5584063", "text": "function nullHandlerFunction() {}", "title": "" }, { "docid": "06cd519996cf81e3f2e8fd72d64a754f", "score": "0.5511934", "text": "function com_zimbra_zss_HandlerObject() {\n\t\n}", "title": "" }, { "docid": "33739d1871f3ec5ed0504697c35b5111", "score": "0.5475323", "text": "function On(){}", "title": "" }, { "docid": "414d474a88840667f7d5444c32f6cf37", "score": "0.5471208", "text": "onReady() {/* For override */}", "title": "" }, { "docid": "3084a8963d590b1c953f84e339ae3b06", "score": "0.54445124", "text": "function business(){}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.54308337", "text": "function _noop() {}", "title": "" }, { "docid": "0b81eddc31bfb67af5847816e1604e69", "score": "0.5418985", "text": "function _(){}// Initial state", "title": "" }, { "docid": "7abbf65056c968517fd00449c667ba0e", "score": "0.5409477", "text": "function handleResponse(resp) {\n}", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.539214", "text": "_onRender() {}", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.539214", "text": "_onRender() {}", "title": "" }, { "docid": "29dd0266666e519ba83e050bdc7d186b", "score": "0.5388421", "text": "eavesdrop(handler) {\n if (handler === null) {\n\n }\n assert(_.isFunction(handler), \"handler must be a function\");\n }", "title": "" }, { "docid": "00384aef7750a0072e9f145a0bcdcb35", "score": "0.53323305", "text": "function _7jo0mRmmKDKvJeSkk629VQ(){}", "title": "" }, { "docid": "259ac736729c5b99ae04526dd590fff7", "score": "0.5332169", "text": "function blankhandler(req, res, next){\r\n next();\r\n}", "title": "" }, { "docid": "082ce1c2842da05639923e5c9adb0aad", "score": "0.53119427", "text": "function _(){}// Implementing the control as a state machine helps us correctly handle:", "title": "" }, { "docid": "082ce1c2842da05639923e5c9adb0aad", "score": "0.53119427", "text": "function _(){}// Implementing the control as a state machine helps us correctly handle:", "title": "" }, { "docid": "4d88bfd4e4204d85c6bac585a86a8813", "score": "0.53061527", "text": "function loadedHandler() {\n console.log('loadedHandler======>')\n}", "title": "" }, { "docid": "69baf5fe07e8904f293590dde39964db", "score": "0.5303857", "text": "static processResource(){\n\t\treturn null;\n\t}", "title": "" }, { "docid": "6adde2ac566a2132e9b883dd0b34c1a9", "score": "0.5300649", "text": "function handleRequest(request, request){\n\n \n}", "title": "" }, { "docid": "f2e86ff50af2920f7e7b82c5be96c009", "score": "0.53002596", "text": "_handlePlayerHit(hitData) {\n this.log.error('Game: Implement me: '+this._handlePlayerHit.name);\n }", "title": "" }, { "docid": "7814748436519b5444d35af3eff9bb35", "score": "0.52962524", "text": "function dummy() {\n return;\n }", "title": "" }, { "docid": "30b6c3486f0643d1a32bcac38836b101", "score": "0.52897453", "text": "function Helpers(){}", "title": "" }, { "docid": "b742181b53334a0244342b773022c911", "score": "0.5278987", "text": "function se(){}", "title": "" }, { "docid": "ae08ca0ff414661cfbdfb7c6ab5c6b0e", "score": "0.527772", "text": "handleDoneLoading() { }", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.5277639", "text": "function __func(){}", "title": "" }, { "docid": "84180f24752f24a176b48145e0aa99cf", "score": "0.52742016", "text": "function stub() {\n\t\treturn false;\n\t}", "title": "" }, { "docid": "53c3defd6e34b27cd30da525a63f667e", "score": "0.527319", "text": "function __avguVaGrgDi0RzjV63Di8A(){}", "title": "" }, { "docid": "3a86600a05a4f1ea424144198f51923a", "score": "0.52655697", "text": "constructor() {\n super();\n this.handlers = {};\n }", "title": "" }, { "docid": "8dc9979ebdbb2d6007cc18a2a4f57b65", "score": "0.52442116", "text": "extract() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "e7010ac9b0b53a0afc3c939e0a199b5c", "score": "0.52415127", "text": "function Dispatch(){}", "title": "" }, { "docid": "045758db38b24487786a1c51a3990d77", "score": "0.5239781", "text": "_removedHook() {}", "title": "" }, { "docid": "8dec7bf22faa74b37f559858cfe4f733", "score": "0.52385426", "text": "function noop(){} // No operation performed.", "title": "" }, { "docid": "8dec7bf22faa74b37f559858cfe4f733", "score": "0.52385426", "text": "function noop(){} // No operation performed.", "title": "" }, { "docid": "b696c45d18c7faedd90a2b1714eb008c", "score": "0.5229182", "text": "function ErrorHandler() {}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5207748", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5207748", "text": "function miFuncion(){}", "title": "" }, { "docid": "c1531424e6fbf92d2ea01dbe1dbcc486", "score": "0.5207282", "text": "function wrappedHandler() {\n // remove ourself, and then call the real handler with the args\n // passed to this wrapper\n handler.apply(obj.off(eventName, wrappedHandler), arguments);\n }", "title": "" }, { "docid": "25473cf823dea80d36b0e4f9deb564a4", "score": "0.5201068", "text": "handleEvent(e) {\r\n let fn = this.handlers[e.type];\r\n if (fn !== undefined) {\r\n // If we call the function like \"fn()\" then \"this\" won't be set inside the\r\n // function call, so we need to call it like this instead.\r\n fn.call(this, e);\r\n }\r\n }", "title": "" }, { "docid": "87ff5c8e2a64fc3b548c768d35686def", "score": "0.5187278", "text": "onNearbyReplace() {}", "title": "" }, { "docid": "24abede10f6c61a57056331a665b996c", "score": "0.51848596", "text": "function changed() {\r\n if (!aboutToCallHandler) {\r\n aboutToCallHandler = true;\r\n setTimeout(callHandler, 1);\r\n }\r\n }", "title": "" }, { "docid": "0c2a809eb320124f1fdeb0c21237c23f", "score": "0.518053", "text": "doSomething() {\n \n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.517996", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.517996", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.517996", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.517996", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "b7040b95eb5df7028ca30d0ed325fd4b", "score": "0.517706", "text": "_onEvent(msg) {\n let _this = this;\n\n let event = {\n from: msg.from,\n value: msg.body.value,\n identity: msg.body.identity,\n };\n\n if (_this._onEventHandler) _this._onEventHandler(event); \n\n}", "title": "" }, { "docid": "3d44805cd13fa864725b8f3f519c30f1", "score": "0.5171742", "text": "_setupHandler() {\n this._state = STATES.HANDLER;\n // cleanup extension of generator lock loop\n this._clearGeneratorExtending();\n\n this._handleMessages();\n }", "title": "" }, { "docid": "49d3fc481fc41554ad0fc84eece31a2b", "score": "0.5148917", "text": "function _noop() {\n}", "title": "" }, { "docid": "a2a8da8ff2576e5d1b7f26a6cccc5573", "score": "0.51475984", "text": "static IMPLEMENTATION_AUTO_DETECTION_HANDLER() {\n return false;\n }", "title": "" }, { "docid": "a5e8b8399284c1622bc3f94749233aae", "score": "0.5145808", "text": "initialize_on_error_event() {}", "title": "" }, { "docid": "a89c0c0d2640a6d4dc7d8497f6a28bca", "score": "0.5143779", "text": "function noop() {\n // No operation performed.\n }", "title": "" } ]
c9d8869ee3aad1867ff4f0f7b29b122c
Initialization after the window loads. Attaches event listeners to all the interactive elements
[ { "docid": "58de1e930167eef88dd2e9fc88f062f4", "score": "0.0", "text": "function init() {\n id(\"start\").addEventListener(\"click\", startGame);\n id(\"start-over\").addEventListener(\"click\", backToMenu);\n qs(\"button.player1\").addEventListener(\"click\", submit);\n qs(\"button.player2\").addEventListener(\"click\", challenge);\n\n // Enables submission with enter key stroke\n qs(\"input.player1\").addEventListener(\"keyup\", function(event) {\n const keyName = event.key;\n if (keyName === \"Enter\") {\n submit();\n }\n });\n qs(\"input.player2\").addEventListener(\"keyup\", function(event) {\n const keyName = event.key;\n if (keyName === \"Enter\") {\n submit();\n }\n });\n }", "title": "" } ]
[ { "docid": "4071f55840601956c5faa349c889adfe", "score": "0.72304463", "text": "function init() {\r\n contextListener();\r\n clickListener();\r\n keyupListener();\r\n }", "title": "" }, { "docid": "aeda2d004b2d4a8a82356f04e53f51fa", "score": "0.718244", "text": "init() {\n this.initDOMListeners()\n }", "title": "" }, { "docid": "fd995946fc0b3618c292d3467910dd42", "score": "0.7182158", "text": "function init() {\n contextListener();\n clickListener();\n keyupListener();\n resizeListener();\n }", "title": "" }, { "docid": "62c22f50cc66bfb75a57da38a78bc6a2", "score": "0.7119163", "text": "init() {\n\t\tthis.initDOMListeners()\n\t}", "title": "" }, { "docid": "455e0aa1384a3b743252e287f28d0acb", "score": "0.7078818", "text": "function initialize() {\n $(\"generate\").addEventListener(\"click\", learnMore);\n $(\"exploreColors\").addEventListener(\"click\", findColor);\n }", "title": "" }, { "docid": "50adaead38ddabc10365b94d9afed2be", "score": "0.7039176", "text": "initialize () {\n this._bindEvents()\n }", "title": "" }, { "docid": "50adaead38ddabc10365b94d9afed2be", "score": "0.7039176", "text": "initialize () {\n this._bindEvents()\n }", "title": "" }, { "docid": "503b4f7889a87242ae57425645991158", "score": "0.7000441", "text": "function init() {\n\n // Add event listeners for top bar items\n var navigationItems = document.getElementsByClassName('titleListItem');\n for (var index = 0; index < navigationItems.length; ++index) {\n var navigationItem = navigationItems[index];\n if (navigationItem) {\n navigationItem.addEventListener('click', handleTitleListItemClick);\n }\n }\n\n // Add event listeners for challenge Navigation Items\n var navigationItems = document.getElementsByClassName('navigationItem');\n for (var index = 0; index < navigationItems.length; ++index) {\n var navigationItem = navigationItems[index];\n if (navigationItem) {\n navigationItem.addEventListener('click', handleNavigationItemClick);\n }\n }\n\n //TODO : get the challenge list details\n\n updateOpenCLList();\n updateOldCLList();\n updateMyCLList();\n\n showOpenChallengeWrapper();\n}", "title": "" }, { "docid": "6b8bc94e7eb2bdc07c33dcfbadc5fe8f", "score": "0.69707197", "text": "init() {\n this.initDOMListeners()\n }", "title": "" }, { "docid": "6b8bc94e7eb2bdc07c33dcfbadc5fe8f", "score": "0.69707197", "text": "init() {\n this.initDOMListeners()\n }", "title": "" }, { "docid": "21c19fe9c2317854329ebca6179ce308", "score": "0.6924999", "text": "function qodeOnWindowLoad() {\n qodeInitElementorCarousel();\n }", "title": "" }, { "docid": "67f0dbf0e7b985eea54eb9cbe7c0ae39", "score": "0.6910418", "text": "init() {\n this.initDomListeners();\n }", "title": "" }, { "docid": "d38a35cc5164a80c2e256a76db97a576", "score": "0.68415296", "text": "init() {\n this.addEventListeners();\n }", "title": "" }, { "docid": "865587361c59f5d5e6a52bffaaba308e", "score": "0.6819216", "text": "init() {\n this.initDOMListener();\n }", "title": "" }, { "docid": "2029f4c3696bf34cd0176a860eee96a7", "score": "0.68124145", "text": "function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}", "title": "" }, { "docid": "2029f4c3696bf34cd0176a860eee96a7", "score": "0.68124145", "text": "function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}", "title": "" }, { "docid": "2029f4c3696bf34cd0176a860eee96a7", "score": "0.68124145", "text": "function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}", "title": "" }, { "docid": "c3a0666d2d036c089bbaea92dc448c1b", "score": "0.67778414", "text": "function _init() {\n\t\twindow.addEventListener('mousedown',\t_mouseInput);\n\t\twindow.addEventListener('mouseup',\t\t_mouseInput);\n\t\twindow.addEventListener('mousewheel',\t_mouseInput);\n\t\twindow.addEventListener('mousemove',\t_mouseMove);\n\t\twindow.addEventListener('keydown',\t\t_keyboardInput);\n\t\twindow.addEventListener('keyup',\t\t_keyboardInput);\n\t}", "title": "" }, { "docid": "ceb49f1be5b01514b9a2cebb69142a78", "score": "0.67653316", "text": "function init() {\n cacheDom();\n bindEvents();\n }", "title": "" }, { "docid": "ceb49f1be5b01514b9a2cebb69142a78", "score": "0.67653316", "text": "function init() {\n cacheDom();\n bindEvents();\n }", "title": "" }, { "docid": "3aed9752b3e651e3bc787c670299a295", "score": "0.67627674", "text": "function initDOM() {\n clearMenuItems();\n loadMenuItems();\n addListeners();\n}", "title": "" }, { "docid": "cd4ec9efc2353f7209543273f4bd8204", "score": "0.67553073", "text": "function init() {\n cacheDom();\n bindEvents();\n render();\n }", "title": "" }, { "docid": "09b99226ab5346267f776db9d36532ec", "score": "0.6746985", "text": "init() {\n // bind events\n this.bindEvents();\n }", "title": "" }, { "docid": "749ab50de0339f242b71b614b0819373", "score": "0.67440426", "text": "initialize() {\n\t\tthis._displayCalcEl.style.userSelect = 'none'\n\t\tthis._dateEl.style.userSelect = 'none'\n\t\tthis._timeEl.style.userSelect = 'none'\n\n\t\tthis.setDisplayDateTime()\n\t\tsetInterval(() => this.setDisplayDateTime(), 1000)\n\n\t\tthis.setLastNumberToDisplay()\n\t\tthis.pasteFromClipboard()\n\n\t\tdocument.querySelectorAll('.btn-ac').forEach(btn => {\n\t\t\tbtn.addEventListener('dblclick', e => {\n\t\t\t\tthis.toggleAudio()\n\t\t\t})\n\t\t})\n\t}", "title": "" }, { "docid": "21a5b3a87bf3471eb00447ca9a8c04b3", "score": "0.67330134", "text": "init() {\n this.addListenerKeyboard();\n this.dropdown();\n this.addListenerMouse();\n }", "title": "" }, { "docid": "1dbc02f1e8f49667e230dc0f7ca6ff76", "score": "0.6730673", "text": "function initialize(){\n refreshButtons();\n bindEvents();\n }", "title": "" }, { "docid": "1dbc02f1e8f49667e230dc0f7ca6ff76", "score": "0.6730673", "text": "function initialize(){\n refreshButtons();\n bindEvents();\n }", "title": "" }, { "docid": "dc86dcf6faa1c0b5cc9674b5b45c402f", "score": "0.67280054", "text": "function init() {\n //initial run-through\n collectInputs();\n\n document.querySelector(\"select\").addEventListener(\"change\", collectInputs);\n document.querySelector(\"#input\").addEventListener(\"input\", collectInputs);\n}", "title": "" }, { "docid": "02108ef92bd49463f96242729a42b352", "score": "0.6708858", "text": "function initialize() {\n setupUIElements();\n setupConnection();\n}", "title": "" }, { "docid": "258f1a0e078f949c0c8df9c727576ddb", "score": "0.66972476", "text": "function _initDOM() {\n _initLayout();\n \n onSchemaLoaded(\"all\", _addResourceToMenu, []);\n }", "title": "" }, { "docid": "5d65acfbef998cbb7ded0aa19c469d83", "score": "0.6691304", "text": "function init() {\n\n // setup canvas\n canvas = document.getElementById(canvas_id);\n context = canvas.getContext('2d');\n\n // render user controls\n if (controlsRendered === false) {\n self.renderControls();\n controlsRendered = true;\n }\n\n // add page controls\n window.addEventListener('keydown', self.navigation, false);\n window.addEventListener('hashchange', checkHash, false);\n }", "title": "" }, { "docid": "545d1d9cfa465bca4544cd93066947ca", "score": "0.6676382", "text": "function init() {\n\t\t// 绑定事件\n\t\tbindEvent();\n\t}", "title": "" }, { "docid": "7de60c40a8ce397f16189681e8d57d91", "score": "0.66724694", "text": "function domInit() {\n document.querySelector('.burger').addEventListener('click', toggleMenu, false);\n \n for (let el of document.querySelectorAll('.menu-items a')) {\n el.addEventListener('click', toggleMenu, false);\n }\n \n document.querySelector('#btn-text-update').addEventListener('click', function(e) {\n e.preventDefault();\n addCustomText(TEXT_OBJ_NAME);\n }, false);\n \n document.querySelector('#btn-text-cancel').addEventListener('click', function(e) {\n e.preventDefault();\n revertBoxText();\n });\n \n document.querySelector('.menu-items-customtext').addEventListener('click', toggleOverlay, false);\n document.querySelector('.menu-items-bg').addEventListener('click', toggleBg, false);\n document.querySelector('.menu-items-about').addEventListener('click', toggleOverlay, false);\n \n for (let el of document.querySelectorAll('.button-close')) {\n el.addEventListener('click', toggleOverlay, false);\n }\n}", "title": "" }, { "docid": "0d5de6d5daafd28a86310310f0f14042", "score": "0.6660331", "text": "init() {\n // Gather list of Jumbotrons to scroll to\n this.jumboList = document.querySelectorAll('.jumbotron');\n\n // Gather list of choice elements\n this.choiceList = document.querySelectorAll('.quiz-choice');\n\n // Get form element\n //this.form = document.querySelector('#consultationForm');\n\n // Set event handlers\n this.bindEvents();\n }", "title": "" }, { "docid": "12d2ddb810c555865b6fc78f0065a976", "score": "0.66496396", "text": "function init(){\n cacheDom();\n bindEvents();\n }", "title": "" }, { "docid": "cf22a4ebdb7c6d53078fec497206dd6b", "score": "0.66306335", "text": "function init() {\n\tprev=undefined;\n\tdocument.addEventListener('mouseover', function( event) { //lambda event handler function\n\t\tif ( event.target.classList.contains('colorbox')) {\n\t\t\thandleBox(event.target);\n\t\t}\n\t},false);\n\n\tcreateElements();\n}", "title": "" }, { "docid": "81d7f7d2f9bd4a3e69440e0d40fe8ab4", "score": "0.6624236", "text": "function init() {\n window.addEventListener('scroll', resizeHeader);\n window.addEventListener('scroll', hideHeader);\n window.addEventListener('scroll', showHeaderOnUpscroll);\n window.addEventListener('scroll', removeSearchResults);\n id('search').addEventListener('input', showSearchResults);\n }", "title": "" }, { "docid": "9a813e223514cf4be11bad906eecd246", "score": "0.66217077", "text": "function init () {\n $header = document.querySelector(\"[rel=js-header]\");\n $header.addEventListener(\"click\", handleHeaderClick);\n\n render();\n }", "title": "" }, { "docid": "aa8878f7fbb9783f6914baa59f2184db", "score": "0.6615071", "text": "function qodeOnWindowLoad() {\n qodeInitElementorComparisonSlider();\n }", "title": "" }, { "docid": "3f4270772670c8e9e20e0e70ba402b14", "score": "0.6609313", "text": "function init() {\r\n pickQuestion();\r\n createEventListeners();\r\n}", "title": "" }, { "docid": "7c0b94e40ecfa666b4b2ea864266a87e", "score": "0.65779126", "text": "function initialize () {\n _$findBtn.on( 'click', clickHandler );\n _$findInput.on( 'keydown', clickHandler );\n _$resultArea.on( 'click', 'a.result', selectedResultHandler );\n\t\t\t_$resultArea.on( 'click', 'input.selRadio', selectedRadioHandler );\n }", "title": "" }, { "docid": "8dc64cffff588675b95583e7781c3bc0", "score": "0.65737015", "text": "function init() {\n placeClothes(applicationData.clothes);\n\n var navItems = document.querySelectorAll(\".navItem\");\n navItems.forEach((nItem) => {\n nItem.addEventListener(\"click\", onNavClicked);\n })\n}", "title": "" }, { "docid": "7585a92d7ee743feefd767ec187eb4e9", "score": "0.6566623", "text": "init() {\n\t\tthis.domDetails = document.getElementById( 'details' );\n\n\t\tthis.callbackExport = this.startExport.bind( this.domDetails.querySelector( '.details-export' ) );\n\t\tthis.callbackFillHole = WebHF.SceneManager.fillHole.bind( WebHF.SceneManager );\n\n\t\tthis.fillButton = document.querySelector( '.fillholeStart' );\n\n\t\tthis.syncInterfaceWithConfig();\n\t\tthis.REGISTER.registerEvents();\n\t}", "title": "" }, { "docid": "c540f1a1667b0225b9413ad1f0494f0f", "score": "0.6561332", "text": "function initElements() {\n scrollVerticalEl = document.documentElement;\n scrollVerticalElAlt = document.body;\n scrollHorizontalEl = document.querySelector('.Wrapper');\n wrapperEl = document.querySelector('.Wrapper');\n canvasEl = document.querySelector('.Wrapper-inner');\n }", "title": "" }, { "docid": "fded6abc8544ca28c73d53d2879f4d21", "score": "0.65607214", "text": "function init() {\n addListeners();\n // Polite loading\n if (Enabler.isVisible()) {\n show();\n }\n else {\n Enabler.addEventListener(studio.events.StudioEvent.VISIBLE, show);\n }\n}", "title": "" }, { "docid": "7e9b3a294251f1037314bf7a85fad071", "score": "0.6556841", "text": "function init() {\n this._wm_tracker = Shell.WindowTracker.get_default();\n\n this._overviewHidingSig = Main.overview.connect('hiding', Util.strip_args(Intellifade.syncCheck).bind(this));\n\n if (Settings.transition_with_overview()) {\n this._overviewShownSig = Main.overview.connect('showing', _overviewShown.bind(this));\n } else {\n this._overviewShownSig = Main.overview.connect('shown', _overviewShown.bind(this));\n }\n\n let windows = global.get_window_actors();\n\n for (let window_actor of windows) {\n /* Simulate window creation event, null container because _windowActorAdded doesn't utilize containers */\n _windowActorAdded(null, window_actor, false);\n }\n\n this._workspaceSwitchSig = global.window_manager.connect_after('switch-workspace', _workspaceSwitched.bind(this));\n\n const screen = global.screen || global.display;\n\n if (screen) {\n this._windowRestackedSig = screen.connect_after('restacked', _windowRestacked.bind(this));\n } else {\n log('[Dynamic Panel Transparency] Error could not register \\'restacked\\' event.');\n }\n\n this._windowActorAddedSig = global.window_group.connect('actor-added', _windowActorAdded.bind(this));\n this._windowActorRemovedSig = global.window_group.connect('actor-removed', _windowActorRemoved.bind(this));\n\n this._appFocusedSig = this._wm_tracker.connect_after('notify::focus-app', _windowRestacked.bind(this));\n}", "title": "" }, { "docid": "acb2b67a6ed0bb58b4639f7c027e3ecc", "score": "0.6555578", "text": "function init() {\n coinListener();\n subListener();\n heartClickEvent();\n}", "title": "" }, { "docid": "3e7b79c640bf1ba7748cb49632791a5a", "score": "0.65537053", "text": "function initializeEvents() {\n\n\t\t\t// open buttons\n\t\t\tfor (var i=0; i<this.openButtons.length; i++) {\n\t\t\t\tvar openButton = this.openButtons[i];\n\t\t\t\tvar _ = this;\n\t\t\t\topenButton.addEventListener('click', function(event) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (!_.isOpen) {\n\t\t\t\t\t\t_.open();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// close with close buttons\n\t\t\tfor (var i=0; i<this.closeButtons.length; i++) {\n\t\t\t\tvar _ = this;\n\t\t\t\tvar closeButton = _.closeButtons[i];\n\t\t\t\tcloseButton.addEventListener('click', function(event) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (_.isOpen) {\n\t\t\t\t\t\t_.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// close with esc key\n\t\t\tif (this.options.closeWithEsc) {\n\t\t\t\tvar _ = this;\n\t\t\t\tdocument.addEventListener('keyup', function(e) {\n\t\t\t\t\tif (e.keyCode == 27 && !_.modal.classList.contains(_.options.hiddenClass)) {\n\t\t\t\t\t\t_.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8583343861ce4a632a924f3217234939", "score": "0.6546908", "text": "init() {\n this.releases.forEach((elem) =>\n elem.addEventListener(\"click\", (event) =>\n this.showCodeSnippetToCopy(event)\n )\n );\n this.snippetTextField.addEventListener(\"focus\", (event) =>\n event.target.select()\n );\n this.clipboardButton.addEventListener(\"click\", () =>\n this.copyCodeSnippetToClipboard()\n );\n this.tooltip.addEventListener(\"transitionend\", (event) =>\n this.tooltipFadeout(event)\n );\n }", "title": "" }, { "docid": "c0657ca096a28b77a58048134768a57d", "score": "0.65383875", "text": "function qodeOnWindowLoad() {\r\n qodeInitelementorListingSlider();\r\n }", "title": "" }, { "docid": "8a53e21d6b351a49ecd97d91a5b8ed51", "score": "0.6528562", "text": "function init(){\r\n pickQuestion();\r\n createEventListeners();\r\n}", "title": "" }, { "docid": "12243d2fcef0ec54e40b6e9a0f4c076b", "score": "0.6520054", "text": "function init() {\n setPageSize();\n makeScrollBar();\n document.addEventListener(\"resize\", setPageSize);\n document.addEventListener(\"wheel\", handleScroll);\n document.addEventListener(\"touchstart\", handleTouch);\n document.addEventListener(\"keydown\", handleKey);\n}", "title": "" }, { "docid": "171706d355f71c2c1a884a259e4ca794", "score": "0.6502446", "text": "function initialize() {\n buildStartingPage();\n document.getElementById('display-button').addEventListener('click', onDisplayButtonPress);\n}", "title": "" }, { "docid": "7c4b11923854706a71886c03d4c1c92b", "score": "0.64991415", "text": "_initEvents() {\n window.addEventListener(\"submit\", event => this._processInput(event.detail));\n window.addEventListener(\"historyup\", () => this._browseHistory(true));\n window.addEventListener(\"historydown\", () => this._browseHistory(false));\n window.addEventListener(\"autocomplete\", event => this._autocomplete(event.detail[0], event.detail[1], event.detail[2]));\n window.addEventListener(\"hideEditor\", () => this._hideEditor());\n }", "title": "" }, { "docid": "e2a29829010b1aa6df4ab57588dee042", "score": "0.6498871", "text": "onLoad(){\n this.initEventHandlers();\n this.initView();\n }", "title": "" }, { "docid": "a9a23bc708d3ab103913b6804b5618f3", "score": "0.64977044", "text": "function eltdOnWindowLoad() {\n eltdPortfolioSingleMasonryImages().init();\n eltdPortfolioSingleFollow().init();\n eltdSetInfoSliderHeight();\n eltd.modules.common.eltdInitParallax();\n }", "title": "" }, { "docid": "f8f29752ba31dec5621a8361a63f6eaf", "score": "0.649585", "text": "function init() {\r\n\t\t\r\n\t\tvar bodyPanels = document.getElementsByClassName('panel_body');\r\n\t\tvar panels = document.getElementsByClassName('panel');\r\n\t\tvar noPanels = panels.length;\r\n\t\tvar percentageWidth = 100 / noPanels;\r\n\t\tvar position = 0;\r\n\t\t\r\n\t\t// Loop through body panels and panels applying required styles and adding event listeners\r\n for (i = 0; i < bodyPanels.length; i++) {\r\n\t\t\tbodyPanels[i].hide();\r\n\t\t\tpanels[i].style.width = percentageWidth + '%';\r\n\t\t\tpanels[i].style.position = 'absolute';\r\n\t\t\tpanels[i].style.left = position + '%';\r\n\t\t\t\r\n\t\t\tEvent.observe(panels[i].getElementsByTagName('h3')[0], 'mouseover', accordion, false);\r\n\t\t\tEvent.observe(panels[i].getElementsByTagName('h3')[0], 'mousemove', accordion, false);\r\n\t\t\t\r\n\t\t\tposition += percentageWidth;\r\n }\r\n\t\t\r\n\t\t// Set panel with id of visible to be initial displayed\r\n var vis = $('visible').parentNode.id+'-body';\r\n $(vis).show();\r\n}", "title": "" }, { "docid": "bff53a073e8a6bc9847cb5d053541ccb", "score": "0.64958054", "text": "addEventListeners() {\n $('body').on('click','[data-tutorial-next]',this.next.bind(this));\n $('body').on('click','[data-tutorial-back]',this.back.bind(this));\n $('body').on('click','[data-tutorial-done]',this.done.bind(this));\n $('body').on('change activate','[data-tutorial-image]',this.swapImage.bind(this));\n $('body').on('change','.tutorial [name=\"startInPanelZoom\"]',this.setBeginnerMode.bind(this));\n\n this.settings.on('change:showTutorial',this.toggle.bind(this));\n\n this.interactable.on('swipeleft',this.next.bind(this));\n this.interactable.on('swiperight',this.back.bind(this));\n }", "title": "" }, { "docid": "29dc4d7459ae5be96afd33a028b262ef", "score": "0.64875096", "text": "function init() {\n qs(\"button\").addEventListener(\"click\", transitionPages);\n }", "title": "" }, { "docid": "4cb78008716e8d22b5fcda238c9d6873", "score": "0.64745826", "text": "function init() {\n\t\t//attach event listener\n\t\tdocument.onkeyup = onUserInput;\n\n\t\t//reset model\n\t\tresetModel();\n\n\t\trender();\n\n\t}", "title": "" }, { "docid": "07808f5c5a49455d0bc13d4fac7d8b5c", "score": "0.64734906", "text": "function qodeOnWindowLoad() {\n qodeInitElementorHorizontalMarquee();\n }", "title": "" }, { "docid": "e9d26f8474aefb8f587cd7d45d4b142b", "score": "0.6468423", "text": "function qodefOnWindowLoad() {\n qodefInitPortfolioMasonry();\n qodefInitPortfolioFilter();\n qodefInitPortfolioListAnimation();\n\t qodefInitPortfolioPagination().init();\n }", "title": "" }, { "docid": "9d8bfb2a6906c9c2f0bd2bb96e6b7acc", "score": "0.646371", "text": "function init() {\n createPalette();\n createActive();\n createCanvas();\n addEventHandlers();\n}", "title": "" }, { "docid": "b2a388d9a94a7aabfe9ef9dd303d91f3", "score": "0.64537716", "text": "_initEvents() {\r\n\t\t\tthis.$appEl.addEventListener('pickCategory', this._onItemAdd.bind(this));\r\n\t\t\tthis.$appEl.addEventListener('menuChange', (e) => {\r\n\t\t\t\tthis.counter.computeAmount(this.menuIn.getRepData(), this.menuOut.getRepData())});\r\n\t\t\t\r\n\t\t\tthis.$arrowEl.addEventListener('click', this._changeCategoryPos.bind(this));\r\n\t\t\tthis.$showRepEl.addEventListener('click', this._showRep.bind(this));\r\n\t\t}", "title": "" }, { "docid": "45a2df92290a9622faeb0b2546d97549", "score": "0.6453178", "text": "function _initEvents() {\n _expandable.addEventListener( 'click', toggleStoredState );\n }", "title": "" }, { "docid": "fea891db44b381ed1a563a1e99796a4a", "score": "0.6443053", "text": "function init() {\n cacheDom();\n bindEvents();\n getToys();\n }", "title": "" }, { "docid": "8ca5c5b8699a9a82371489279f7043b5", "score": "0.6442015", "text": "function init() {\n pointbreak.addChangeListener(setExpandControls);\n /** LIM 195 START**/\n if (window.favoritesActive) {\n /*LIM 3199*/\n if (!window.lfrActive) {\n updateFavoritesView();\n }\n }\n /** LIM 195 END**/\n // Initialize all open/close package states\n expandedState();\n autoExpandDeepLinkedItem();\n initAnalytics();\n }", "title": "" }, { "docid": "0b625d531a1890db2767625f00406e5f", "score": "0.64408875", "text": "function qodeOnWindowLoad() {\n qodeInitElementorBlogCarouselTitled();\n }", "title": "" }, { "docid": "5c49b1218cbe0b17dcd25d83db886cf9", "score": "0.64324373", "text": "initialize() {\n this.listenTo(this.owner, {\n [events_1.RendererEvent.BEGIN]: this.onBeginRenderer,\n [events_1.PageEvent.BEGIN]: this.onBeginPage,\n });\n }", "title": "" }, { "docid": "5c49b1218cbe0b17dcd25d83db886cf9", "score": "0.64324373", "text": "initialize() {\n this.listenTo(this.owner, {\n [events_1.RendererEvent.BEGIN]: this.onBeginRenderer,\n [events_1.PageEvent.BEGIN]: this.onBeginPage,\n });\n }", "title": "" }, { "docid": "6116d1ab91aac12ebae3fa364a48af54", "score": "0.64244294", "text": "init() {\n // make fade-in content invisible\n this.fadeInSections.forEach( section => section.style.opacity = 0 );\n\n // bind relevant events\n this.bindEvents();\n }", "title": "" }, { "docid": "214c7b91ad1561de50d64e7682ecba63", "score": "0.64244276", "text": "function qodeOnWindowLoad() {\r\n qodeInitElementorQodeNewsSlider1();\r\n }", "title": "" }, { "docid": "43cd28027752befcbeab2ea64134629d", "score": "0.642253", "text": "initialize() {\n\t\tthis.preRender();\n\t\tthis.bindEvents();\n\t}", "title": "" }, { "docid": "ec11b27de011436fa7d96752294d575a", "score": "0.64173204", "text": "function initUIElements() {\n initMenu();\n initButtons();\n initLayoutButtons();\n initDialogs();\n initAccordion();\n $('#toolbar').show();\n}", "title": "" }, { "docid": "2e8c0b473e3ade124ec57cd19c14543b", "score": "0.6417133", "text": "function applicationLoaded() {\n observeEvents();\n }", "title": "" }, { "docid": "f343ae60abcbc465e5b7deeea74e8a56", "score": "0.64155555", "text": "function initialize() {\n getFavoriteMovies();\n searchInputEl.focus();\n }", "title": "" }, { "docid": "2b95f9e88fca40587197cf0265768707", "score": "0.6414214", "text": "function init() {\n\t\t_levels = levelAtlas();\n\t\tgenerateLevelSelectHtml();\n\n\t\tdocument.getElementById('level-select-open-button').onclick = function () {\n\t\t\tenterLevelSelect();\n\t\t};\n\t\tdocument.getElementById('level-info-open-button').onclick = function () {\n\t\t\tenterLevelInfo();\n\t\t};\n\t\tdocument.getElementById('level-info-return-button').onclick = function () {\n\t\t\texitLevelInfo();\n\t\t};\n\n\t\tenterLevelSelect();\n\t\t_levelSelectContainer.classList.remove('level-select-open-animation');\n\t}", "title": "" }, { "docid": "2f06837e96794ca2e764abfd2f5dd5bf", "score": "0.641116", "text": "function init() {\n\n // Initialize DOM elements\n _$window = $(window);\n _$document = $(document);\n _$app = $(_SEL_APP);\n _$tags = $(_SEL_SEARCH_TAGS);\n _$search = $(_SEL_SEARCH);\n _$input = $(_SEL_SEARCH_INPUT);\n _$article = $(_SEL_ARTICLE);\n _$result = $(_SEL_RESULT);\n _$count = $(_SEL_RESULT_COUNT);\n\n // Focus input\n _$input.focus();\n\n // Initialize templates\n _tmplTags = $(_TMPL_TAGS).html();\n _tmplResult = $(_TMPL_RESULT).html();\n\n // Execute functions\n _bind();\n _load();\n }", "title": "" }, { "docid": "7c24ed7c7a0a805043891f995e82376e", "score": "0.640051", "text": "init() {\n this.previewUl = this.el.querySelector('.preview__ul');\n this.itemUl = this.el.querySelector('.new-bikes__ul');\n\n this.left = this.el.querySelector('.new-bikes__arrows--previous');\n this.right = this.el.querySelector('.new-bikes__arrows--next');\n\n this.listen();\n }", "title": "" }, { "docid": "b715f4e849a802ba1ae8f5d78be84637", "score": "0.6396246", "text": "function ready() {\n\t\tsetupAnimationView();\n\t\tbindTwitterToggle();\n\t}", "title": "" }, { "docid": "af2ceea706c10bb62f58078216bdb559", "score": "0.6392974", "text": "function qodeOnWindowLoad() {\n qodeInitElementorImageGallery();\n }", "title": "" }, { "docid": "ec6c5f1518949701e01e3db1696a4c6a", "score": "0.63892883", "text": "function init(){\n musique.addEventListener('volumechange', updateVolumeDisplay, false);\n musique.addEventListener('durationchange', updateDurationDisplay, false);\n musique.addEventListener('timeupdate', updateCurrentTimeDisplay, false);\n musique.addEventListener('ratechange', updatePlaybackRateDisplay, false);\n musique.addEventListener('progress', updatePercentLoadedDisplay, false);\n }", "title": "" }, { "docid": "30e51fdadcebe01751777f7bf5535c49", "score": "0.63837355", "text": "function initialize() {\n $('body').append('<div class=\"sf-all sf-ui\" id=\"sf-highlight\"></div>')\n $('body').append('<div class=\"sf-all sf-ui\" id=\"sf-selector\"></div>')\n $('body').addClass('sf-cursor')\n\n $(document).one(\"mousemove.sf\", identify)\n $(document).bind(\"mouseover.sf\", identify)\n\n $(document).bind(\"click.sf\", preventListeners)\n $(document).bind(\"mouseup.sf\", preventListeners)\n $(document).bind(\"mousedown.sf\", copySelector)\n}", "title": "" }, { "docid": "2898e1937757735ce9fc8ac465111cef", "score": "0.63769776", "text": "function init() {\n id(\"new-game\").addEventListener(\"click\", newGame);\n id(\"throw-btn\").addEventListener(\"click\", changeImg);\n id(\"stop-btn\").addEventListener(\"click\", startGame);\n id(\"submit\").addEventListener(\"click\", checkGuess);\n }", "title": "" }, { "docid": "676ef7f8a597b487aefa172c858e65bb", "score": "0.6375014", "text": "init() {\n // Assign the `click` event listener to each of the buttons\n for (let button of this._buttons) {\n button.addEventListener('click', this.handleLoad);\n }\n this._reinitBttn.addEventListener('click', () => { this.initModules(); });\n }", "title": "" }, { "docid": "5433e08041b525edb8b8a1c6ec569632", "score": "0.6374317", "text": "function init() {\n createScene();\n createModel();\n render();\n // createOrbit();\n loop();\n window.addEventListener('mousemove', mousePosData, false);\n window.addEventListener('touchmove', touchPosData, false);\n window.addEventListener('deviceorientation', sendCameraData);\n}", "title": "" }, { "docid": "83f00c1e185c982bc88e6bb91e99aaad", "score": "0.63680565", "text": "init () {\r\n /**\r\n * This function will be called during the loading of Scenes.\r\n * You can implement this method to act on this event.\r\n */\r\n }", "title": "" }, { "docid": "8381ac6e48e823e12b49de376eed297f", "score": "0.6367631", "text": "_init() {\n this.$inputs = this.$element.find('input, textarea, select').not('[data-abide-ignore]');\n\n this._events();\n }", "title": "" }, { "docid": "4f69c295565081b9d1bf44ec3c175691", "score": "0.6359438", "text": "init() {\n const targets = this.owner.el.querySelectorAll('[data-tooltip]');\n targets.forEach(target => {\n this.owner.dom.addElementEventListeners(this, target, this.targetEvents);\n });\n }", "title": "" }, { "docid": "6d624d3773ddbf23971734a3d47c23bc", "score": "0.6343539", "text": "hook() {\n\t\t\tthis.elements = {};\n\n\t\t\t// Computed Styles\n\t\t\tthis.elements.computedStyles = this.shadowRoot.querySelector('style');\n\t\t\tthis.depends(this.updateComputedStyles.bind(this), ['computedStyles']);\n\t\t\tthis.updateComputedStyles();\n\n\t\t\t// Weekday Names\n\t\t\tthis.elements.weekdayNames = this.shadowRoot.querySelectorAll('.day-name');\n\t\t\tthis.depends(this.updateWeekdayNames.bind(this), ['weekdayNames']);\n\t\t\tthis.updateWeekdayNames();\n\n\t\t\t// Cell Classes and Dates\n\t\t\tthis.elements.cells = this.shadowRoot.querySelectorAll('.cell');\n\t\t\tthis.depends(this.updateCells.bind(this), ['visibleEnd', 'dateExtractor', 'todayMax']);\n\t\t\tthis.updateCells();\n\n\t\t\t// Month title in the header\n\t\t\tthis.elements.basisTitle = this.shadowRoot.querySelector('header h1');\n\t\t\tthis.depends(this.updateBasisTitle.bind(this), ['visibleEnd', 'monthExtractor']);\n\t\t\tthis.updateBasisTitle();\n\n\t\t\t// Make sure that the basis is focused as long as any element is focused\n\t\t\tthis.depends(this.updateBasisCell.bind(this), ['basis']);\n\t\t\tthis.updateBasisCell();\n\n\t\t\t// Place the slots and notify the elements that their slots are available\n\t\t\tthis.elements.slotContainer = this.shadowRoot.querySelector('.slots');\n\t\t\tthis.depends(this.placeSlots.bind(this), ['visibleEventsMeta', 'visibleStart', 'eventsPerCell']);\n\t\t\tthis.placeSlots();\n\n\n\t\t\t// Start listening to the events we need\n\t\t\tthis.shadowRoot.querySelector('.cells').addEventListener('keydown', this.handleArrowNavigation.bind(this));\n\t\t\tthis.shadowRoot.querySelector('.cells').addEventListener('focusin', this.handleFocusChange.bind(this));\n\t\t}", "title": "" }, { "docid": "9eee5e707891ae9ee6fc53f4d38f96c6", "score": "0.63434136", "text": "function _addEventListeners() {\n\t\tdom.$body.on( 'click', _onBodyClicked );\n\t}", "title": "" }, { "docid": "5ce6a577cbeeaafc43cd4975391fb5aa", "score": "0.63420576", "text": "initializeEventListeners() {\n const that = this;\n document.addEventListener('click', e => that.handleClick(e));\n document.addEventListener('mousemove', e => that.handleMouseMove(e));\n }", "title": "" }, { "docid": "ab4a5036ca4a6561033aba2b2c80e947", "score": "0.63368547", "text": "function init() {\n // Make sure we're dealing with a clean slate.\n reset();\n\n // Set event handlers.\n document.querySelector('#user-input1')\n .addEventListener('keyup', handleUserInput1);\n \n document.querySelector('#user-input2')\n .addEventListener('keyup', handleUserInput2);\n\n document.querySelector('#user-input3')\n .addEventListener('keyup', handleUserInput3);\n\n document.querySelector('#user-input4')\n .addEventListener('keyup', handleUserInput4);\n\n document.querySelector('#user-input5')\n .addEventListener('keyup', handleUserInput5);\n\n document.querySelector('#reset')\n .addEventListener('click', reset)\n\n document.querySelector('#switch')\n .addEventListener('click', switchGears)\n}", "title": "" }, { "docid": "2c1fa35897d75f26c5e311018a0d7119", "score": "0.63355136", "text": "ready() {\n super.ready();\n var buttons = this.querySelectorAll('[role=\"button\"][data-button]');\n for (var i = 0; i < buttons.length; i++) {\n this._addListenerAddState(this, buttons[i], \"mouseover\", \"hover\");\n this._addListenerAddState(this, buttons[i], \"focus\", \"focus\");\n this._addListenerRemoveState(this, buttons[i], \"mouseout\", \"hover\");\n this._addListenerRemoveState(this, buttons[i], \"blur\", \"focus\");\n }\n }", "title": "" }, { "docid": "2542bc83ff4df3a0b85ea524bdb875e5", "score": "0.63321304", "text": "function init() {\n\n var scrollBarWidth = utils.getScrollBarWidth();\n\n document.body.addEventListener('drawer-open', function() {\n document.body.classList.add('overflow-hidden');\n DOM.mainContent.style.paddingRight = scrollBarWidth + 'px';\n DOM.header.style.paddingRight = scrollBarWidth + 'px';\n DOM.header.style.marginRight = '-' + scrollBarWidth + 'px';\n });\n\n document.body.addEventListener('drawer-closed', function() {\n document.body.classList.remove('overflow-hidden');\n DOM.mainContent.style.paddingRight = '';\n DOM.header.style.paddingRight = '';\n DOM.header.style.marginRight = '';\n });\n\n // Closing dropdowns and search container by clicking on other elements\n $('body').mousedown(function(e) {\n $target = $(e.target);\n\n $parentTargetDropdown = $target.closest('.dropdown');\n $openDropdown = $('.dropdown.open');\n\n $parentTargetSearch = $target.closest('.search-container');\n $openSearch = $('.search-container.open');\n\n if ($parentTargetDropdown.length === 0 && $openDropdown.length > 0) {\n $openDropdown.removeClass('open');\n } else if ($parentTargetSearch.length === 0 && $openSearch.length > 0) {\n $openSearch.removeClass('open');\n $openSearch.children().removeClass('popup-active');\n }\n });\n }", "title": "" }, { "docid": "05bf5d46b453546f7c97766dfc038125", "score": "0.632797", "text": "function init() {\n cacheDom();\n doEvent();\n }", "title": "" }, { "docid": "1bc0496d3a4c8595858fbc7f30c54d68", "score": "0.6327821", "text": "function _init(){\r\n\t\tfor (let i in plugins) {\r\n\t\t\tlet plugin = t[i]||plugins[i]; \r\n\t\t\tif (plugin&&plugin!==true) t[i] = new plugin(t);\r\n\t\t}\r\n\t\tdocument.addEventListener(\"visibilitychange\", _handle_visibility_change);\r\n\t}", "title": "" }, { "docid": "3784a798f7d3cab82ea32889ad3514bf", "score": "0.63272375", "text": "function _addEventListeners() {\n dom.$body.addEventListener( 'click', _onBodyClicked );\n }", "title": "" }, { "docid": "c91945e8d446913c475427e13f3c20d3", "score": "0.6323764", "text": "init() {\n this.setupControls()\n this.appendControls()\n }", "title": "" }, { "docid": "a6c0e66a9ebfa18f09e055b547568367", "score": "0.63226634", "text": "function init() {\n Css.apply();\n initializeScrollIntoViewIfNeeded();\n Hotkeys.bindAll();\n}", "title": "" }, { "docid": "c2989932743da2e43a78ea1b4b545ae1", "score": "0.6322202", "text": "function initializeEvents() {\n 'use strict'\n\n var thumbnails = getThumbnailsArray();\n thumbnails.forEach(addThumbClickHandler);\n\n // Add keypress handler tied to ESC to hide details when ESC is pressed\n addKeyPressHandler();\n}", "title": "" } ]
99eb522bcb0ca1cf3209d92fb10606e9
strip them. Otherwise, turn 'em into H2s.
[ { "docid": "2fa48f7163e125748070b2e76d64f440", "score": "0.0", "text": "function cleanHOnes$$1(article, $) {\n var $hOnes = $('h1', article);\n\n if ($hOnes.length < 3) {\n $hOnes.each(function (index, node) {\n return $(node).remove();\n });\n } else {\n $hOnes.each(function (index, node) {\n convertNodeTo$$1($(node), $, 'h2');\n });\n }\n\n return $;\n}", "title": "" } ]
[ { "docid": "44078f92bd45e31890028c23fdec95ae", "score": "0.64941454", "text": "function baynote_removeHtml(raw) {\n\tif (!raw) return;\n\traw = raw.replace(/\\<[^>]*\\>/g, \"\");\n\traw = raw.replace(/\\<.*/, \"\");\n\traw = raw.replace(/\\&nbsp;/g, \" \");\n\traw = raw.replace(/^\\s+/, \"\");\n\traw = raw.replace(/\\s+$/, \"\");\n\traw = raw.replace(/\\n/g, \" \");\n\treturn raw;\n}", "title": "" }, { "docid": "bb80ab1c98025f5035114308894d0261", "score": "0.6459438", "text": "static stripTags (text) {\n if (typeof text === \"string\") {\n return HsData.normalizeCardText(text).replace(\"<b>\", \"\").replace(\"</b>\", \"\").replace(/<[^>]*>/, \"\");\n }\n else {\n return text;\n }\n }", "title": "" }, { "docid": "3f4e92497cee500b0a6c32eb71ee1027", "score": "0.6199821", "text": "function stripHTML(text)\t{\n\tvar r = text.replace(/<\\/?[a-z][a-z0-9]*[^<>]*>/ig, \"\");\n\treturn r;\n\t}", "title": "" }, { "docid": "74deb72ce95bfaabdccece59ba17060d", "score": "0.61386496", "text": "function stripHTML(text){\n\tvar strippedText = text.replace(/<br>/ig, '\\n');\n\tstrippedText = strippedText.replace(/<br\\/>/ig, '\\n');\n\tstrippedText = strippedText.replace(/&lt\\;/ig, '<');\n\tstrippedText = strippedText.replace(/&gt\\;/ig, '>');\n\tstrippedText = strippedText.replace(/&amp\\;/ig, '&');\n\tstrippedText = strippedText.replace(/&nbsp\\;/ig, ' ');\n\treturn strippedText.replace(/<\\/?[^>]+(>|$)/g, \"\");\t\n}", "title": "" }, { "docid": "6ebe160811778fb1826b32ff7c5a088e", "score": "0.61356634", "text": "function stripText(text) {\n return text.replace(/<[^>]+>|[!.?,;:'\"-]/g, ' ').replace(/\\r?\\n|\\r|\\s+|\\t/g, ' ').trim()\n }", "title": "" }, { "docid": "9d4a6710b8271e84d232bee0f3d6393a", "score": "0.6108666", "text": "function ibf_stripTags(text){\n\t//text = text.replace(\"\\n\",\"\").replace(\"\\r\",\"\"); // remove all \\r or \\n\n\t//text = text.replace(/<(p|br)\\s*\\/?>/g,\"\\n\"); // convert html linebreaks to \\n\n\ttext = text.replace(/<\\/?[^>]+(>|$)/g, \"\"); // strip all tags\n\treturn ibf_unescape(text.replace(/^\\s+|\\s+$/g, \"\")); // trim and unescape\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.6023075", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.6023075", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.6023075", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.6023075", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.6023075", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "19a5c68831d2e2ec9aec7eaed4c24334", "score": "0.60121155", "text": "function strip(html)\r\n {\r\n var tmp = document.createElement(\"DIV\");\r\n tmp.innerHTML = html;\r\n return tmp.textContent || tmp.innerText;\r\n }", "title": "" }, { "docid": "5fcda463a45cc805f006f679bcd165bf", "score": "0.59995246", "text": "static stripHTML(text) {\n let regex = /(<([^>]+)>)/ig;\n return text.replace(regex, '');\n }", "title": "" }, { "docid": "576fc0b261724e5a4a1da03a985b40c0", "score": "0.5978751", "text": "function strip(html){\r\n\t\t\t var StrippedString = html.replace(/(<([^>]+)>)/ig,\"\");\r\n\t\t\t return StrippedString;\r\n\t\t\t}", "title": "" }, { "docid": "e8be93977155f6406e3333aef9df65d4", "score": "0.59580415", "text": "function setUpBetterPunctuation() {\n var els = document.querySelectorAll('h1, h2, h3, div')\n\n els.forEach(function(el) {\n var html = el.innerHTML\n\n if ((!el.querySelectorAll('*:not(br)').length) && \n (!el.classList.contains('no-smart-typography'))) {\n var html = el.innerHTML\n\n html = html.replace(/,/g, '<span class=\"comma\">\\'</span>')\n html = html.replace(/\\./g, '<span class=\"full-stop\">.</span>')\n html = html.replace(/…/g, '<span class=\"ellipsis\">...</span>')\n html = html.replace(/’/g, '\\'')\n\n el.innerHTML = html\n }\n })\n}", "title": "" }, { "docid": "fd4b74ec76d2068798034f81ea49a0ec", "score": "0.5955715", "text": "function cleanHTML(html)\n{\n\thtml = html.replace(/<o:p>\\s*<\\/o:p>/g, '') ;\n\thtml = html.replace(/<o:p>(.*?)<\\/o:p>/g, \"<p>$1</p>\") ;\n\n\t// Remove mso-xxx styles.\n\thtml = html.replace( /\\s*mso-[^:]+:[^;\"'}]+;?/gi, '' ) ;\n\n\thtml = html.replace( /\\s*TEXT-INDENT: 0cm\\s*;/gi, '' ) ;\n\thtml = html.replace( /\\s*TEXT-INDENT: 0cm\\s*\"/gi, \"\\\"\" ) ;\n\n\thtml = html.replace( /\\s*PAGE-BREAK-BEFORE: [^\\s;]+;?\"/gi, \"\\\"\" ) ;\n\n\thtml = html.replace( /\\s*FONT-VARIANT: [^\\s;]+;?\"/gi, \"\\\"\" ) ;\n\n\thtml = html.replace( /\\s*tab-stops:[^;\"]*;?/gi, '' ) ;\n\thtml = html.replace( /\\s*tab-stops:[^\"]*/gi, '' ) ;\n\n\t// Remove Class attributes\n\thtml = html.replace(/<(\\w[^>]*) class=([^ |>]*)([^>]*)/gi, \"<$1$3\") ;\n\n\t// Remove empty styles.\n\thtml = html.replace( /\\s*style=\"\\s*\"/gi, '' ) ;\n\n\thtml = html.replace( /<SPAN\\s*[^>]*>\\s*&nbsp;\\s*<\\/SPAN>/gi, '&nbsp;' ) ;\n\n\thtml = html.replace( /<SPAN\\s*[^>]*><\\/SPAN>/gi, '' ) ;\n\n\t// Remove Lang attributes\n\thtml = html.replace(/<(\\w[^>]*) lang=([^ |>]*)([^>]*)/gi, \"<$1$3\") ;\n\n\thtml = html.replace( /<SPAN\\s*>(.*?)<\\/SPAN>/gi, '$1' ) ;\n\n\thtml = html.replace( /<FONT\\s*>(.*?)<\\/FONT>/gi, '$1' ) ;\n\n\t// Remove XML elements and declarations\n\thtml = html.replace(/<\\\\?\\?xml[^>]*>/gi, '' ) ;\n\n\t// Remove Tags with XML namespace declarations: <o:p><\\/o:p>\n\thtml = html.replace(/<\\/?\\w+:[^>]*>/gi, '' ) ;\n\n\t// Remove comments [SF BUG-1481861].\n\thtml = html.replace(/<\\!--.*?-->/g, '' ) ;\n\n\thtml = html.replace( /<(U|I|STRIKE)>&nbsp;<\\/\\1>/g, '&nbsp;' ) ;\n\n\thtml = html.replace( /<H\\d>\\s*<\\/H\\d>/gi, '' ) ;\n\n\t// Remove \"display:none\" tags.\n\thtml = html.replace( /<(\\w+)[^>]*\\sstyle=\"[^\"]*DISPLAY\\s?:\\s?none(.*?)<\\/\\1>/ig, '' ) ;\n\n\t// Remove language tags\n\thtml = html.replace( /<(\\w[^>]*) language=([^ |>]*)([^>]*)/gi, \"<$1$3\") ;\n\n\t// Remove onmouseover and onmouseout events (from MS Word comments effect)\n\thtml = html.replace( /<(\\w[^>]*) onmouseover=\"([^\\\"]*)\"([^>]*)/gi, \"<$1$3\") ;\n\thtml = html.replace( /<(\\w[^>]*) onmouseout=\"([^\\\"]*)\"([^>]*)/gi, \"<$1$3\") ;\n\thtml = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size=\"6\">' ) ;\n\t\t\n\thtml = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size=\"5\">' ) ;\n\thtml = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size=\"4\">' ) ;\n\thtml = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size=\"3\">' ) ;\n\thtml = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size=\"2\">' ) ;\n\thtml = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size=\"1\">' ) ;\n\n\thtml = html.replace( /<\\/H\\d>/gi, '<\\/font><\\/b><\\/div>' ) ;\n\n\t// Remove empty tags (three times, just to be sure).\n\t// This also removes any empty anchor\n\thtml = html.replace( /<([^\\s>]+)(\\s[^>]*)?>\\s*<\\/\\1>/g, '' ) ;\n\thtml = html.replace( /<([^\\s>]+)(\\s[^>]*)?>\\s*<\\/\\1>/g, '' ) ;\n\thtml = html.replace( /<([^\\s>]+)(\\s[^>]*)?>\\s*<\\/\\1>/g, '' ) ;\n\t\n\treturn html ;\n}", "title": "" }, { "docid": "1cf817ee9acc1906c482cf20bfee152a", "score": "0.5918586", "text": "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n }", "title": "" }, { "docid": "9f6c5cd7e87637e523f7175393b6d43d", "score": "0.59128827", "text": "function stripHTML(html){\n\t\t\t\treturn $(\"<b>\"+html+\"</b>\").text();\n\t\t\t}", "title": "" }, { "docid": "fec5920b91d908f5a685aa5cd15ea6cd", "score": "0.5906848", "text": "function stripHTMLTagHelper(html) {\n var tmp = document.createElement(\"div\");\n tmp.innerHTML = html;\n //textContext returns all possible whitespaces\n return tmp.textContent||tmp.innerText; \n }", "title": "" }, { "docid": "16fcf371e78050eab7424ea33853778d", "score": "0.5897911", "text": "function remove_tags(text){\n\treturn text.replace(/<br\\s*\\/?>/ig, \"\\n\").replace(/<.*?>/g, \"\");//removing tags.\n}", "title": "" }, { "docid": "22051bfeca3b59167ce07b7be2668d67", "score": "0.5893924", "text": "function removeHtmlFormatting(str) {\n str = str.replace(/<br>/gi, \"\\n\");\n str = str.replace(/<[^p](?:.|\\s)*?>/g, \"\");\n return str;\n }", "title": "" }, { "docid": "ef354460e06d47995dad80472becc777", "score": "0.58564687", "text": "function fix_text(text) {\n\t//convert <,> and & to the corresponding entities\n\n\t//change &lt; and &gt; or the next string convert their & chars\n\tvar temp_text = String(text).replace(/\\&lt;/g, \"#h2x_lt\").replace(/\\&gt;/g, \"#h2x_gt\");\n\ttemp_text = temp_text.replace(/\\n{2,}/g, \"\\n\").replace(/\\&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\u00A0/g, \"&nbsp;\");\n\treturn temp_text.replace(/#h2x_lt/g, \"&lt;\").replace(/#h2x_gt/g, \"&gt;\");\n}", "title": "" }, { "docid": "102d1a00994071ac3d3ae0da44e0b753", "score": "0.58518076", "text": "function normalize(html) {\n return html.replace(/\\s*/g,'');\n}", "title": "" }, { "docid": "6118346553f34c21b55a219f3b1f71ea", "score": "0.57639104", "text": "function normaliseContentEditableHTML(html) {\n html = html.replace(openBreaks, '')\n .replace(breaks, '\\n')\n .replace(allTags, '')\n .replace(newlines, '<br>')\n .replace(trimWhitespace, '')\n\n return html\n}", "title": "" }, { "docid": "346b21316e9530e57a5f485229d5f2d7", "score": "0.57572573", "text": "function clean(text) { return (''+text).replace( /[<>]/g, '' ) }", "title": "" }, { "docid": "7d4699c6a230d7b069c4adb5042a8c7a", "score": "0.57486284", "text": "function strip(html) {\n var tmp = document.createElement(\"DIV\");\n tmp.innerHTML = html;\n return tmp.textContent||tmp.innerText;\n}", "title": "" }, { "docid": "12271cff2c57a64a4e462b2b6b529af7", "score": "0.57097554", "text": "function clean(s) {\n return expandHTMLEntities(s).replace(/[;,.: \\/]+$/g, \"\").trim();\n }", "title": "" }, { "docid": "83c80a7c971c356327673330da25f36a", "score": "0.5697643", "text": "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n}", "title": "" }, { "docid": "83c80a7c971c356327673330da25f36a", "score": "0.5697643", "text": "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n}", "title": "" }, { "docid": "83c80a7c971c356327673330da25f36a", "score": "0.5697643", "text": "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n}", "title": "" }, { "docid": "83c80a7c971c356327673330da25f36a", "score": "0.5697643", "text": "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n}", "title": "" }, { "docid": "8c45f0d4f2f8aad69dd8c7a13018ba4b", "score": "0.5697573", "text": "function strip(html) {\n\tvar doc = new DOMParser().parseFromString(html, 'text/html')\n\treturn doc.body.textContent || ''\n}", "title": "" }, { "docid": "5100ad10fd418ff7d6883773511b65ca", "score": "0.5681169", "text": "function htmlStrip(string) {\n\n var output = string.replace(/<(.*?)>/g,''); \n return output;\n \n}", "title": "" }, { "docid": "734c56c4189168bbb9367e0e917585aa", "score": "0.5678237", "text": "function stripOutNewLinesAndSpacesFromInnerHTML(innerHTML) {\n /* This is a regex to remove new lines and spaces between HTML Tags. */\n return innerHTML.replace(/>\\s+</g, '><');\n}", "title": "" }, { "docid": "ef54eaf552f38b26e06bef3cb510f0fb", "score": "0.5657194", "text": "stripNormalizedFormatting(text) { //Remove normalized formatting\n return text.replace(/__(.*?)__/g, \"$1\").replace(/\\*\\*(.*?)\\*\\*/g, \"$1\").replace(/\\*(.*?)\\*/g, \"$1\");\n }", "title": "" }, { "docid": "799dc86ad4e4828743a4ae2cfd96b6d6", "score": "0.5643893", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \")}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.56351626", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "94f8a198391102dc78d6fece18fc6289", "score": "0.56111526", "text": "function striptags(html) {\n return String(html).replace(/<\\/?([^>]+)>/g, '');\n}", "title": "" }, { "docid": "d3fdd262df8e3d422e2ec3ada12798f3", "score": "0.56095517", "text": "function cleanHTML(s) {\n // make node names lower-case and add quotes to attributes\n s = cleanNodesAndAttributes(s);\n // Midas adds colors to <br> tags! TODO: take newline conversion elsewhere\n if (Detect.MOZILLA()) s = s.replace(/<br [^>]+>/gi, '\\n'); \n // make single nodes XHTML compatible\n s = s.replace(/<(hr|br)>/gi, '<$1 \\/>');\n // make img nodes XHTML compatible\n s = s.replace(/<(img [^>]+)>/gi, '<$1 \\/>');\n return s; \n}", "title": "" }, { "docid": "e50da2b3cbed1559a83922ff874d0aa8", "score": "0.5608276", "text": "function h(text) { return text.replace(/&/g, '&amp;').replace(/</g, '&lt;'); }", "title": "" }, { "docid": "a573246061118ac66196fcb73a2e12c8", "score": "0.55787796", "text": "function cleanHtml(val) {\n return sanitizeHtml(val, {\n allowedTags: ['h3', 'h4', 'h5', 'h6', 'p', 'a', 'b',\n 'i', 'strong', 'em', 'br'\n ]\n });\n}", "title": "" }, { "docid": "4dc81dfc04af25ceaf50878205236d86", "score": "0.55675393", "text": "function cleanParagraphText(text) {\n var cleanTxt = text.replace(/(\\* \\(\\*([^\\)]+)\\))/gi, '<em>$2</em>');\n return cleanTxt;\n}", "title": "" }, { "docid": "5eecae30be20289d8e0b5c0fa6fbe6a1", "score": "0.556429", "text": "function stripHtml(s) {\r\n s = s.replace(/(<([^>]*)>)/ig, '');\r\n\r\n return s;\r\n}", "title": "" }, { "docid": "009e0b9563291741d609bf8a391252bc", "score": "0.5554702", "text": "function normalizeMetaTags($) {\n $ = convertMetaProp($, 'content', 'value');\n $ = convertMetaProp($, 'property', 'name');\n return $;\n} // Spacer images to be removed", "title": "" }, { "docid": "93794d43ff1da506318fa38646cc0410", "score": "0.55503994", "text": "function cleanHTMLTags(html) {\n if (html != null && html.length > 1) {\n let text = html.replace(/<(?:.|\\n)*?>/gm, '');\n let inx1 = 0;\n let foundDataField = text.indexOf(\"data-\");\n while (inx1 < text.length && foundDataField > 0) {\n let inx2 = text.indexOf(\">\", inx1) + 1;\n if (inx2 < inx1) {\n inx2 = text.indexOf(\"\\\"\", inx1) + 1;\n inx2 = text.indexOf(\"\\\"\", inx2) + 2;\n }\n text = text.substring(0,inx1) + text.substring(inx2, text.length);\n inx1 = inx2 + 1;\n foundDataField = text.indexOf(\"data-\", inx1);\n } \n return text; \n }\n //\n return html;\n }", "title": "" }, { "docid": "b53c6b085b9453c78710877bd040228d", "score": "0.5538041", "text": "function cleanHtml(str)\n\t{\n\t\tvar regex, replace;\n\n\t\t// This removes all empty class declarations from span tags\n\t\tregex = /(<span[^>]*?)\\s*class=(?:''|\"\")([^>]*>)/g;\n\t\treplace = '$1$2';\n\t\tstr = str.replace(regex, replace);\n\n\t\t// Convert all single quotes in tags to double quotes\n\t\tregex = /<[^>]*>/g;\n\t\tstr = str.replace(regex, function(full) {\n\t\t\treturn full.replace(/'/g, '\"');\n\t\t});\n\n\t\t// Perform character translation\n\t\t// Note that we can only replace < > characters that aren't part of tags!\n\t\t// Note that we can't replace & characters if they're part of web-safe tags (e.g. &gt; can't be changed)\n\t\tvar findReplace = [\n//\t\t\t[/&/g, \"&amp;\"],\n//\t\t\t[/</g, \"&lt;\"],\n//\t\t\t[/>/g, \"&gt;\"],\n\t\t\t[/&#8722;/g, \"\\u2212\"],\t// Negatives: convert &#8722 to the unicode character\n\t\t\t[/<mo>\\s*<\\/mo>/g, \"\"]\t// Remove the \"angry box\" -- empty <mo> blocks (we might also need to check for <mo> blocks containing zero width spaces\n\t\t];\n\n\t\t$.each(findReplace, function(idx, val) {\n\t\t\tstr = str.replace(val[0], val[1]);\n\t\t});\n\n\t\t// Clean up variable definitions. This should only occur on freshly imported data coming in from Word.\n\t\tstr = app.cleanBrackets(str);\n\n\t\treturn $.trim(str);\n\t}", "title": "" }, { "docid": "4e08c0decf8d122f51826d194268556a", "score": "0.5533759", "text": "function stripMarkup(text) {\n\treturn text.replace(/<[^>]*>/g, '');\n}", "title": "" }, { "docid": "2a6001ee11883890e1ef5ba76ae90da4", "score": "0.55268514", "text": "function strip(str) {\n\treturn str.replace(/\\&nbsp;/g, \"\").replace(/[\\s\\n]+/g, \"\")\n}", "title": "" }, { "docid": "58cd11ed0cf4c4322c93089ee7ee0e48", "score": "0.5508954", "text": "sanitizeHtml(html) {\n let opts = { allowedTags: [], allowedAttributes: [] },\n sliceLen\n\n if (html && html.length) {\n sliceLen = (html.length > 499) ? 500 : html.length\n } else {\n // handle if there isnt even a description\n html = 'No description provided.'\n sliceLen = (html.length > 499) ? 500 : html.length\n }\n // remove all \\n and \\r and only allow the first 501 chars\n let clean = sanitizer(html, opts)\n .replace(/[\\r\\n]+/g, '')\n .slice(0, sliceLen)\n // returns so it isnt ending in middle of sentence, goes towards the front of string\n return clean.slice(0, clean.lastIndexOf('.') + 1)\n }", "title": "" }, { "docid": "3d9ae92c8ad02ba7307f813ba5b700bc", "score": "0.54996324", "text": "wpml( txt, inline ) {\n if (!txt) { return ''; }\n inline = (inline && !inline.hash) || false;\n txt = XML(txt.trim());\n txt = inline ? MD(txt).replace(/^\\s*<p>|<\\/p>\\s*$/gi, '') : MD(txt);\n txt = H2W( txt );\n return txt;\n }", "title": "" }, { "docid": "d7290a0598ebe255447cd40622b317c6", "score": "0.54945326", "text": "function strip(html) {\n if (html && document) {\n var tmp = document.createElement(\"DIV\");\n tmp.innerHTML = html;\n return tmp.textContent || tmp.innerText;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "95c9bc7e294f5a73c124dc182737dce2", "score": "0.5484517", "text": "function removeH1(file) {\n return file.replace(/^#[^\\n]+\\n/, '');\n}", "title": "" }, { "docid": "976857e1f4479116edc881a0d1edd7ff", "score": "0.54270357", "text": "function stripOuterHTML(str) {\n\t\t\treturn str.replace(/^<[^>]+>|<\\/[^>]+><[^\\/][^>]*>|<\\/[^>]+>$/g, '')\n\t}", "title": "" }, { "docid": "e00ac1e4b806f344c95212e69579c0a4", "score": "0.5426394", "text": "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "title": "" }, { "docid": "b204b44ff6cd864992dbafbe56dfffa1", "score": "0.54223937", "text": "function crudeHtmlCheck ( input ) {\n\t\treturn input.trim().indexOf( \"&lt;\" ) === 0 ? \"html\" : \"\";\n\t}", "title": "" }, { "docid": "417e0911c73acc0cb7e27ad817117bcd", "score": "0.5417693", "text": "function hp_strip (tdText) {\n var childNodes = $('<div>').html(tdText)[0].childNodes;\n var date = Array.prototype.map.call(childNodes, function(item){\n if (item.nodeType === 3) return item.textContent;\n }).join('');\n return date;\n }", "title": "" }, { "docid": "1f7b20ea190fbebb04d8807e3d9225a0", "score": "0.5411224", "text": "function strip_tags(element){\n\n\treturn element.html().replace(/<\\/div>|<\\/tr>|<p>|<\\/p>|<\\/li>|<\\/form>|<\\/div>|<\\b>|<br>/gi,'\\n').replace(/<\\/?[^>]+>/gi, '');\n\n}", "title": "" }, { "docid": "cf2cb626441e075b6f6126c4a778dd59", "score": "0.54101884", "text": "function cleanHtml(list){\r\n var html = list.html();\r\n \r\n html = html.replace(/<\\/?strong>/gi, '');\r\n \r\n list.html(html);\r\n return list;\r\n }", "title": "" }, { "docid": "a7f4020bc2a51f90411e1db273e6b3b4", "score": "0.54031616", "text": "removeSpecialChar(data) {\n data.replace(/(<([^>]+)>)/gi, \"\");\n }", "title": "" }, { "docid": "d25cf996fcf55c691bcd54d07e450cc4", "score": "0.54029435", "text": "function strip_tags(htmlText) {\n var div = document.createElement(\"div\");\n div.innerHTML = htmlText;\n return div.innerText.replace(\"\\n\", \"\");\n}", "title": "" }, { "docid": "e04a81f10a652c7cdb3acabcc7ee0184", "score": "0.5383463", "text": "function unprocess( tagContent ) {\n\t\treturn tagContent.replace( /<bbcl=[0-9]+ \\/\\*>/gi, '').replace( /<bbcl=[0-9]+ /gi, '&#91;').replace( />/gi, '&#93;' );\n\t}", "title": "" }, { "docid": "f57be4bc04831d286a02644aee66a6c5", "score": "0.5381715", "text": "function stripTags (str) {\n str = str.replace(/&/g, '&amp;');\n str = str.replace(/</g, '&lt;');\n str = str.replace(/>/g, '&gt;');\n var container = document.createElement('div');\n container.innerHTML = str;\n return trim(container.textContent || container.innerHTML);\n }", "title": "" }, { "docid": "6c4a530609720a88683db4218fea4da3", "score": "0.5378762", "text": "function stripAndCollapse( value ) {\r\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\r\n\t\treturn tokens.join( \" \" );\r\n\t}", "title": "" }, { "docid": "6c4a530609720a88683db4218fea4da3", "score": "0.5378762", "text": "function stripAndCollapse( value ) {\r\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\r\n\t\treturn tokens.join( \" \" );\r\n\t}", "title": "" }, { "docid": "6c4a530609720a88683db4218fea4da3", "score": "0.5378762", "text": "function stripAndCollapse( value ) {\r\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\r\n\t\treturn tokens.join( \" \" );\r\n\t}", "title": "" }, { "docid": "6c4a530609720a88683db4218fea4da3", "score": "0.5378762", "text": "function stripAndCollapse( value ) {\r\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\r\n\t\treturn tokens.join( \" \" );\r\n\t}", "title": "" }, { "docid": "9fbd00a01ac37711b89cff3795a5a8ce", "score": "0.53775287", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "4043425597fb7313de94b29bb6056be7", "score": "0.53710836", "text": "function fix_attribute(text) {\n\t//convert <,>, & and \" to the corresponding entities\n\n\t//change &lt; and &gt; or the next string convert their & chars\n\tvar temp_text = String(text).replace(/\\&lt;/g, \"#h2x_lt\").replace(/\\&gt;/g, \"#h2x_gt\");\n\ttemp_text = temp_text.replace(/\\&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\\"/g, \"&quot;\");\n\treturn temp_text.replace(/#h2x_lt/g, \"&lt;\").replace(/#h2x_gt/g, \"&gt;\");\n}", "title": "" }, { "docid": "bec062abbc168dbdaa8345aa9c44bac8", "score": "0.5370924", "text": "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "title": "" }, { "docid": "bec062abbc168dbdaa8345aa9c44bac8", "score": "0.5370924", "text": "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "title": "" }, { "docid": "61494fb44c3660b3d7bc59739547ccf3", "score": "0.5368936", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || []\n return tokens.join(' ')\n }", "title": "" }, { "docid": "be329e6dee256951bce2ef1e23af784c", "score": "0.53593624", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "be329e6dee256951bce2ef1e23af784c", "score": "0.53593624", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "be329e6dee256951bce2ef1e23af784c", "score": "0.53593624", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "a4a761596018d6ad1f3e7b417224cbc8", "score": "0.53469205", "text": "function stripTags(text, safeTags) {\n safeTags = safeTags || [];\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/img;\n var comments = /<!--.*?-->/img;\n return text.replace(comments, '').replace(tags, function (a, b) {\n return safeTags.indexOf(b.toLowerCase()) !== -1 ? a : '';\n });\n }", "title": "" }, { "docid": "a35bd7d5d5e16b6ee7eaa7f85c43a7d5", "score": "0.53460515", "text": "strip() {\n this.list.forEach(p => {\n let terms = p.terms()\n terms.forEach(t => {\n let str = t.text.replace(/'s$/, '')\n t.set(str || t.text)\n })\n })\n return this\n }", "title": "" }, { "docid": "c80304cb6ba82de3dab5abba3f68072f", "score": "0.53455734", "text": "function removeWhitespace(el) { // made it a function just to see if i could\n\n $.each(el,function() { // loops each el\n var word = $(this).text(); // $this gets the text of the current el\n var trimmed = $.trim(word); // trims it\n $(this).text(trimmed); // the text of the current el is replaced with trimmed one\n });\n\n }", "title": "" }, { "docid": "e3bc5e275f0d66821c9f88443a0f4f20", "score": "0.5342079", "text": "function sanitizeTitle(titleText) {\n return sanitizeHtml(titleText, {\n allowedTags: ['i', 'em', 'sub', 'sup']\n }).replace(/\\0x20+/, ' ').trim();\n}", "title": "" }, { "docid": "c443e5773be12fe2b98cfbd016177680", "score": "0.5340342", "text": "function disableHtmlInText(text) {\n // U+2329 and U+232A are misc technical punctuation symbols\n return text && text.replace(/</gm, '\\u2329').replace(/>/gm, '\\u232a');\n }", "title": "" }, { "docid": "83af00d6b5f6c96dd4b0adbc2e6116ce", "score": "0.5331192", "text": "function strip_html(s) {\n var div = document.createElement(\"div\");\n div.innerHTML = s;\n var text = div.textContent || div.innerText || \"\";\n return text;\n}", "title": "" }, { "docid": "ac24f7e38d1545767671bc56af6435e3", "score": "0.53287935", "text": "function stripAndCollapse(value) {\r\n var tokens = value.match(rnothtmlwhite) || [];\r\n return tokens.join(\" \");\r\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.53256065", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.53256065", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.53256065", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.53256065", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "fbf33a8acae3384416e3363f21fb5d0a", "score": "0.5323905", "text": "function cleanBlankSpaces(el) {\n if (typeof el === 'undefined') {\n el = editor.el;\n }\n\n if (el && ['SCRIPT', 'STYLE', 'PRE'].indexOf(el.tagName) >= 0) {\n return false;\n }\n\n var walker = editor.doc.createTreeWalker(el, NodeFilter.SHOW_TEXT, editor.node.filter(function (node) {\n return node.textContent.match(/([ \\n]{2,})|(^[ \\n]{1,})|([ \\n]{1,}$)/g) !== null;\n }), false);\n\n while (walker.nextNode()) {\n var node = walker.currentNode;\n\n if (isPreformatted(node.parentNode, true)) {\n continue;\n }\n\n var is_block_or_element = editor.node.isBlock(node.parentNode) || editor.node.isElement(node.parentNode); // Remove middle spaces.\n // Replace new lines with spaces.\n // Replace begin/end spaces.\n\n var txt = node.textContent.replace(/(?!^)( ){2,}(?!$)/g, ' ').replace(/\\n/g, ' ').replace(/^[ ]{2,}/g, ' ').replace(/[ ]{2,}$/g, ' ');\n\n if (is_block_or_element) {\n var p_node = node.previousSibling;\n var n_node = node.nextSibling;\n\n if (p_node && n_node && txt === ' ') {\n if (editor.node.isBlock(p_node) && editor.node.isBlock(n_node)) {\n txt = '';\n } else {\n txt = ' ';\n }\n } else {\n // No previous siblings.\n if (!p_node) {\n txt = txt.replace(/^ */, '');\n } // No next siblings.\n\n\n if (!n_node) {\n txt = txt.replace(/ *$/, '');\n }\n }\n }\n\n node.textContent = txt;\n }\n }", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.5307704", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.5307704", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.5307704", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.5307704", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.5307704", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.5307704", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.5307704", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" } ]
2e151267b40b4ec251308060d8b738eb
CONSTRUCTOR FUNCTIONS Create new nodes (class):
[ { "docid": "2512a88b5ac014c253b265ce1a7eb2c4", "score": "0.0", "text": "function Node(value, next) {\n this.value = value;\n this.next = next;\n}", "title": "" } ]
[ { "docid": "4954cd04971e6c3aff542e89b23862d6", "score": "0.7619684", "text": "constructor(){\n this.nodes = {}\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "8ea4a0829acbb772970bec963ed7bec6", "score": "0.75901884", "text": "constructor(nodes) {\n this.nodes = nodes;\n }", "title": "" }, { "docid": "a7e35f2ee55cc9d834defe524ce7c03a", "score": "0.7567008", "text": "constructor(nodes) {\n this.nodes = nodes\n }", "title": "" }, { "docid": "f5916f04a8e9663c90090bcb5de05b2d", "score": "0.7532644", "text": "function CreateNode() {\r\n this.nodeID = 0,\r\n this.name = \"node\",\r\n this.xPos = 0,\r\n this.yPos = 0, \r\n this.zIndex = 0, \r\n this.width = 0, \r\n this.height = 0,\r\n this.class = \"\",\r\n this.style = \"\",\r\n this.parentID = 0, \r\n this.levelID = 0,\r\n //HTML Control\r\n this.divNodeID = \"\",\r\n this.recordStatus = \"\"\r\n }", "title": "" }, { "docid": "5241f764088918c56b1cfda0c386a4ab", "score": "0.73490155", "text": "constructor() {\n this.type = 'Lore.Node';\n this.id = Lore.Node.createGUID();\n this.isVisible = true;\n this.position = new Lore.Vector3f();\n this.rotation = new Lore.Quaternion();\n this.scale = new Lore.Vector3f(1.0, 1.0, 1.0);\n this.up = new Lore.Vector3f(0.0, 1.0, 0.0);\n this.normalMatrix = new Lore.Matrix3f();\n this.modelMatrix = new Lore.Matrix4f();\n this.isStale = false;\n\n this.children = new Array();\n this.parent = null;\n }", "title": "" }, { "docid": "edec3e7c6ebbf9b803c4702b1a44817d", "score": "0.734441", "text": "constructor() {\n this.nodes;\n\n }", "title": "" }, { "docid": "3b24559c8609d8096ebe0b9455bb6ce8", "score": "0.7314661", "text": "function TNode() { }", "title": "" }, { "docid": "3b24559c8609d8096ebe0b9455bb6ce8", "score": "0.7314661", "text": "function TNode() { }", "title": "" }, { "docid": "3b24559c8609d8096ebe0b9455bb6ce8", "score": "0.7314661", "text": "function TNode() { }", "title": "" }, { "docid": "3b24559c8609d8096ebe0b9455bb6ce8", "score": "0.7314661", "text": "function TNode() { }", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.7227625", "text": "function TNode() {}", "title": "" }, { "docid": "00c2f76a7605d107f200cf9cd868cfd3", "score": "0.69562596", "text": "constructor(node, children, parent) {\n this.node = node;\n this.children = children;\n this.parent = parent;\n }", "title": "" }, { "docid": "95fe776e0ae1789eaa066b11fc5db3ae", "score": "0.6912089", "text": "constructor( nodes, node, token, type ) {\n const items= node.getKid(token);\n if (!items) {\n throw new Error(`node ${node.id} has empty child ${token}`);\n }\n console.assert(node.getParam(token).type == type);\n this.nodes= nodes;\n this.node= node;\n this.token= token;\n this.type= type; // typeName\n this.items= items;\n this.inline= false;\n }", "title": "" }, { "docid": "b35efbcf2bf347246bd30de20d17b70b", "score": "0.6910003", "text": "function Node(data){\n \n this.data = data;\n this.parent = null;\n this.children = [];\n\n}", "title": "" }, { "docid": "9bd3695ac86bccdbb50db0e1c922df13", "score": "0.6886135", "text": "function Constructor() {\n this.name = 'Power of node';\n}", "title": "" }, { "docid": "919bc04c5676970d89bb12365ec18ecc", "score": "0.6885441", "text": "function Node() {\n\t\t this.type = _.functionName(this.constructor);\n\t\t }", "title": "" }, { "docid": "eac357058f8781abf0a2a80ecadbbed3", "score": "0.6880201", "text": "function createNode(node) {\n var obj = new Object();\n obj.name = node.name;\n obj.type = node.type;\n obj.subNodes = new Array();\n\n //Link to functions\n obj.display = display;\n obj.nodeAddSubs = nodeAddSubs;\n\n return obj;\n}", "title": "" }, { "docid": "17e2712fb79f0f25dcaa7319e39adfae", "score": "0.68743527", "text": "constructor(nodesToRemove, nodesToAdd) {\n this.nodesToRemove = nodesToRemove;\n this.nodesToAdd = nodesToAdd;\n }", "title": "" }, { "docid": "61d20b0e4755e045b70a04ab37dfdd31", "score": "0.6870443", "text": "function Node() {\n\t\tthis.id = \"\";\n\t\tthis.border = false;\n\t\tthis.edges = [];\n\t}", "title": "" }, { "docid": "d45786414352bc7be11fc7e3865e036d", "score": "0.6822303", "text": "constructor() {\n\tthis.nodes = []\n\tthis.edges = []\n }", "title": "" }, { "docid": "b693b7629aee0826c77ebc4da3f4f34b", "score": "0.67721015", "text": "constructor() {\n\t\tthis.nodes = [];\n\t\tthis.adjacencyList = {};\n\t}", "title": "" }, { "docid": "e8625ab12730f100a2f35a5d4b419adc", "score": "0.6751457", "text": "function Node(parent) {\n this.parent = parent;\n this.children = [];\n}", "title": "" }, { "docid": "af3147fe5f03112e1d9d304b7f4c5b02", "score": "0.6740298", "text": "constructor(n) {\n super((n ?\n n :\n new cc.Node()));\n return this;\n }", "title": "" }, { "docid": "63531bd9ec06eadf2c74fe44a5b7d488", "score": "0.6739165", "text": "function FoodNode() { }", "title": "" }, { "docid": "0cdb28a63b9e730b01cd2188234b5182", "score": "0.669951", "text": "function BaseNode() {\n}", "title": "" }, { "docid": "e0b4de02668dc10edf2dede3ee63a07f", "score": "0.6665223", "text": "function RNode() { }", "title": "" }, { "docid": "e0b4de02668dc10edf2dede3ee63a07f", "score": "0.6665223", "text": "function RNode() { }", "title": "" }, { "docid": "e0b4de02668dc10edf2dede3ee63a07f", "score": "0.6665223", "text": "function RNode() { }", "title": "" }, { "docid": "e0b4de02668dc10edf2dede3ee63a07f", "score": "0.6665223", "text": "function RNode() { }", "title": "" }, { "docid": "dcdba848f20ce65a137564e00d2a2730", "score": "0.66059244", "text": "function Node(type, nodeId, desc, skipIfExists, params) {\n\tLOGGER.log(\"create ast node {node-id = \" + nodeId + \", \" + desc + \" }\");\n\tLOGGER.log(\" use params: %j\", params);\n\tLOGGER.log();\n\n\t// ## Attributes ##\n\tthis.type = type;\n\tthis.nodeId = nodeId;\n\tthis.desc = desc;\n\tthis.params = params;\n\n\t/* additional children ::: */\n\tthis.children = [];\n\tthis.childrenIdx = {};\n}", "title": "" }, { "docid": "79b9d03324617a3ce73360462280f3fa", "score": "0.66005003", "text": "constructor(n) {\n (this[\"node\"] = n, this[\"tpid\"] = \"czlab.elmo.ecs.COMP/CPixie\");\n return this;\n }", "title": "" }, { "docid": "54711da19195604bb50cbe676cdb94e4", "score": "0.6593975", "text": "function Tree() {}", "title": "" }, { "docid": "2fea398782275ecbac6bd491d97446d0", "score": "0.6591716", "text": "function initNode(name) {\n var node = new cc.Node();\n node.name = name;\n node.position = cc.v2(0, 0);\n node.scale = 1;\n node.anchorX = 0.5;\n node.anchorY = 0.5;\n node.width = 100;\n node.height = 100;\n node.rotation = 0;\n return node;\n}", "title": "" }, { "docid": "ae312b7730152cd72546a30811ca64ee", "score": "0.6584795", "text": "constructor() {\n this._rbTree = createTree();\n }", "title": "" }, { "docid": "af007a0d7dc405f0f348d876162b6d12", "score": "0.65845555", "text": "constructor(nodeFactory = new node_factory_1.NodeFactory()) {\n this.nodeFactory = nodeFactory;\n }", "title": "" }, { "docid": "ee304f78c662b14dd95824f36f706974", "score": "0.6564232", "text": "function SceneNode() {}", "title": "" }, { "docid": "16828316c8aa31008d64d3ae3bf75d49", "score": "0.6559995", "text": "function createTree() {}", "title": "" }, { "docid": "63815ca2a9a377408bf1b2d66d084d48", "score": "0.6545319", "text": "function Node(data){\n this.data = data;\n this.parent = null;\n this.children = [];\n}", "title": "" }, { "docid": "666af2f5c270a84221834861a52670d6", "score": "0.65345997", "text": "function Node(id) {\n this.id = id;\n this.links = [];\n this.data = null;\n}", "title": "" }, { "docid": "aff38fbf3b3a3d26287666842543f4f8", "score": "0.65254146", "text": "function Node(data) {\n\tthis.data = data;\n\tthis.children = [];\n}", "title": "" }, { "docid": "cb3dfc3bcfc46167c10a02a27713bc61", "score": "0.65239346", "text": "constructor() { //Defines a constructor function for the truss object.\r\n\t\tsuper(); //Inherits attributes\r\n\t\tthis.id = Trusses.length; //Sets the ID to be at the size of the array.\r\n\t\tthis.nodes = []; //Initializes an empty array.\r\n\t\tthis.members = []; //Initializes an empty array/\r\n\t\tthis.unknowns = \"\"; //Initializes a unknowns variable.\r\n\t\tthis.totalDef = 0; //Initializes the total deformation\r\n\r\n\t\tthis.AddNode(this.padding, height - this.padding, this); //Adds a new default node.\r\n\t\tthis.AddNode(width - this.padding, height - this.padding, this); // Adds a second default node.\r\n\t\tthis.span = Math.abs(this.nodes[0].location.x - this.nodes[1].location.x); //Gets span in px distance\r\n\r\n\t\tthis.nodes[0].SetExternalForce(0, 0); //Clears any external force\r\n\t\tthis.nodes[1].SetExternalForce(0, 0); //Clears any external force\r\n\t}", "title": "" }, { "docid": "1837380c5d5f3ee07c1afca19c809b8d", "score": "0.65042794", "text": "function Node( settings ){\n\t\tif (!settings) settings = {};\n\t\tthis.children = [];\n\t\tthis.id = settings.id || Node.undefinedId;\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "092688f5459782db44f735fe2457ad5a", "score": "0.65020216", "text": "function MyNode(arr){ this.arr = arr; }", "title": "" }, { "docid": "f22cb981733d75c2bc34bdb791b93657", "score": "0.6491531", "text": "Constructor(){}", "title": "" }, { "docid": "e8ca0498ea355e973fca4de74fc44bd0", "score": "0.64861214", "text": "init() {\n\n // new Nodes get a new random ID, used to associate the UI InternalNode with a\n // twin WorkerNode.\n this.id = this._idPrefix + '#' + randomstring.generate()\n // TODO: detect ID collisions.\n }", "title": "" }, { "docid": "54c52e4de1efd442006d8e303a64b39d", "score": "0.64835", "text": "function __construct_node(type, loc) {\n return {\n\ttype: type, \n\tloc: loc,\n\tmegatron_ignore: true\n };\n}", "title": "" }, { "docid": "8eae139c04def755bb9310e0e14127ea", "score": "0.64805156", "text": "function createNode(id,name,wid,hei,clr){\n\tvar obj = {id:id,name:name,data:{\"$angularWidth\":wid,\"$height\":hei,\"$color\":clr},adjacencies:[]};\n\tdataSource[0].adjacencies.push({\"nodeTo\": id,\"data\": {'$type': 'none'}});\n\tdataSource.push(obj);\n\t\n\treturn obj; \t\n}", "title": "" }, { "docid": "6316dfd2475f5898c7fbb0ae2e27cced", "score": "0.6477862", "text": "function NodeWrapper() {\r\n this._node = this.constructor.createNode();\r\n }", "title": "" }, { "docid": "7e59d472451ece452e00c791940edafd", "score": "0.6475292", "text": "function Node(x,y) {\n\tthis.x = x;\n\tthis.y = y;\t\n}", "title": "" }, { "docid": "5e364b2a24e27e2ddf7faaa3ba28439d", "score": "0.64739597", "text": "function RNode() {}", "title": "" }, { "docid": "fed60e5aaf9bda4212f744f300b8843a", "score": "0.64674586", "text": "function LinkedListNode() {}", "title": "" }, { "docid": "2baad2e206bbad19235f3def10d7cf8f", "score": "0.64602584", "text": "function Node() {\n this.index = [];\n this.indexH = [];\n this.children = {};\n}", "title": "" }, { "docid": "49ef988b0123e2dde95e98abb1717bad", "score": "0.64508516", "text": "function NewProjectNode()\n{\n\tvar projectNode : ProjectNode = new ProjectNode();\n\t\n\t//Take the current instance of the project\n\t//projectNode.project = Instantiate(project);\n\tprojectNode.project = new ProjectStatsList();\n\tprojectNode.project.Add(project.GetStats());\n\tprojectNode.project.first.credits = player.GetSaldo();\n\t\n\t//Create the lists for all slots\n\tprojectNode.slot01 = new EmployeeList();\n\tprojectNode.slot02 = new EmployeeList();\n\tprojectNode.slot03 = new EmployeeList();\n\tprojectNode.slot04 = new EmployeeList();\n\tprojectNode.slot05 = new EmployeeList();\n\tprojectNode.slot06 = new EmployeeList();\n\tprojectNode.slot07 = new EmployeeList();\n\tprojectNode.slot08 = new EmployeeList();\n\t\n\t//Create the Employee Node for each slot\n\tNewEmployeeNode(employee01, projectNode.slot01);\n\tNewEmployeeNode(employee02, projectNode.slot02);\n\tNewEmployeeNode(employee03, projectNode.slot03);\n\tNewEmployeeNode(employee04, projectNode.slot04);\n\tNewEmployeeNode(employee05, projectNode.slot05);\n\tNewEmployeeNode(employee06, projectNode.slot06);\n\tNewEmployeeNode(employee07, projectNode.slot07);\n\tNewEmployeeNode(employee08, projectNode.slot08);\n\t\n\tprojectList.Add(projectNode);\t\n\t\n\tproject.ProjectProvenance();\t\n}", "title": "" }, { "docid": "d51117c27e700d44f44638fcb00f6c3a", "score": "0.6433361", "text": "function Trees() {\n}", "title": "" }, { "docid": "d51117c27e700d44f44638fcb00f6c3a", "score": "0.6433361", "text": "function Trees() {\n}", "title": "" }, { "docid": "c3a7c580d5b6280636082454e6ed9475", "score": "0.6433351", "text": "constructor(order) {\n this.order = order;\n this.root = new Node([]);\n }", "title": "" }, { "docid": "8d4947a3f6af8253aad9a6a84d2cb0fb", "score": "0.6425861", "text": "function Node() {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n this.horizontalRotation = 0;\n this.verticalRotation = 0;\n this.animateActive = true;\n\n this.children = [];\n}", "title": "" }, { "docid": "ade9195e3bd15858ad5ac6987a201b83", "score": "0.6417047", "text": "function Node(cost) {\n this.cost = cost;\n this.children = [];\n}", "title": "" }, { "docid": "0ea745779febfe8c6afc9eab21f00cd4", "score": "0.6412974", "text": "function Node(name, type, file) {\n this.name = name;\n this.type = type;\n this.file = file;\n}", "title": "" }, { "docid": "2c8c14ab6c4a007a600998323c270c9b", "score": "0.6410221", "text": "function Node() {\n this.name = undefined;\n this.meshes = [];\n}", "title": "" }, { "docid": "6fc768659cb5b81af035ad23c1329d4d", "score": "0.64051795", "text": "create_node_instance() {\n let serialized_node = this.serialize_json();\n let new_node = SerialObjectTypes.build_object_from_json(JSON.parse(serialized_node));\n new_node.generate_object_id();\n for ( let insock of new_node._InputSockets) {\n insock.generate_object_id();\n insock._OwnerNodeId = new_node._ObjectID;\n }\n for ( let outsock of new_node._OutputSockets) {\n outsock.generate_object_id();\n outsock._OwnerNodeId = new_node._ObjectID;\n }\n return new_node;\n }", "title": "" }, { "docid": "22d7d8145bb147cf2902811cd8a046be", "score": "0.640186", "text": "function createNode(name, path, parent, children, freshnessScore) {\n return {\n name: name,\n path: path,\n parent: parent,\n children: children,\n freshnessScore: freshnessScore\n };\n}", "title": "" }, { "docid": "5532fcfbce0534562a8df3afe70bd583", "score": "0.6390714", "text": "constructor(rows, cols) {\n this.grid = [];\n for (let j = 0; j < rows; j++) {\n this.grid[j] = [];\n for (let i = 0; i < cols; i++) {\n this.grid[j][i] = new Node(i, j);\n }\n }\n }", "title": "" }, { "docid": "fc3c98e024f9e7de006b7708ca5baad7", "score": "0.63874817", "text": "function NodeDef() {}", "title": "" }, { "docid": "e6052d11b717170394c5fa369ccccaba", "score": "0.63821864", "text": "function Graph() {\n this._nodes = Object.create(null);\n}", "title": "" }, { "docid": "f27b40dfb3ac7713b3a893e0b6581104", "score": "0.63787824", "text": "constructor(rows, columns) {\n 'use strict';\n this.nodes = [];\n this.adjacencyList = [];\n this.rows = rows;\n this.columns = columns;\n }", "title": "" }, { "docid": "e0ba8b7e69639522336870d79f96a01e", "score": "0.6371194", "text": "function Node(name, cpt, children, parents, value) {\n this.name = name;\n this.children = children;\n this.parents = parents;\n this.CPT = cpt;\n this.value = value;\n return this;\n}", "title": "" }, { "docid": "296fc9339549faf42f04e0c469f5e4d1", "score": "0.6348773", "text": "constructor() {\n //initialized with head and tail to the node, every subsequent node is added to the tail\n this.head = null;\n //every node afterwards is push onto tail and just like above chains downwards everytime\n this.tail = null;\n this.length = 0;\n }", "title": "" }, { "docid": "e3a68157705f03b3e11fb2d4a1b3e446", "score": "0.634562", "text": "function newNodeObject() {\n return {'circle':null, 'text':null, 'label_highlight':null, 'label_mouseover':null, 'search_highlight':null, 'node_x':null, 'node_y':null, 'label_x':null, 'label_y':null, 'tooltip':'', 'mouseover':false, 'selected':false, 'node_rest_key':'default_node', 'node_rest_colour':nvrgtr_display_opts.colours.default_node, 'node_mouseover_key':'cluster_highlight', 'node_mouseover_colour':nvrgtr_display_opts.colours.cluster_highlight, 'node_selected_key':'selection', 'node_selected_colour':nvrgtr_display_opts.colours.selection, 'label_rest_colour':nvrgtr_display_opts.colours.label_bg, 'label_mouseover_key':'cluster_highlight', 'label_mouseover_colour':nvrgtr_display_opts.colours.cluster_highlight, 'label_selected_key':'selection', 'label_selected_colour':nvrgtr_display_opts.colours.selection, 'banners':[]};\n}", "title": "" }, { "docid": "e439e0344ab38ab669abfdee1b383f29", "score": "0.6343817", "text": "_createNodes() {\n // Test all statements for leadership\n // If they are leaders, create node\n for (const $stmt of Query.searchFromInclusive(this.#jp, \"statement\")) {\n if (CfgUtils.isLeader($stmt)) {\n\n if (this.#splitInstList && CfgUtils.getNodeType($stmt) === CfgNodeType.INST_LIST) {\n this._getOrAddNode($stmt, true, CfgNodeType.INST_LIST);\n\n for (const $right of $stmt.siblingsRight) {\n if (!CfgUtils.isLeader($right))\n this._getOrAddNode($right, true, CfgNodeType.INST_LIST);\n else \n break;\n }\n }\n else\n this._getOrAddNode($stmt, true);\n }\n }\n\n // Special case: if starting node is a statement and a graph node was not created for it (e.g. creating a graph starting from an arbitrary statement),\n // create one with the type INST_LIST\n if (\n this.#jp.instanceOf(\"statement\") &&\n this.#nodes.get(this.#jp.astId) === undefined\n ) {\n this._getOrAddNode(this.#jp, true, CfgNodeType.INST_LIST);\n }\n }", "title": "" }, { "docid": "173fe59af88f5f2550fd88dc7fa76ca0", "score": "0.6342995", "text": "function Node(id) {\n this.id = id;\n this.links = null;\n this.data = null;\n}", "title": "" }, { "docid": "9d56c65b3e9d01f4335bb338e91ad6b0", "score": "0.6342888", "text": "constructor(args) {\n super();\n var { noodle: noodle, objMeta: meta, container: container, core: core, pos: pos } = args;\n meta = meta || {};\n meta.container = meta.container || new Container({ noodle: noodle });\n this.core = core = core || {};\n core.resetFuncs = core.resetFuncs || [];\n //core.outPorts = core.outPorts || [];\n\n this.pos = new Pos(pos || { x: 0, y: 0 });\n\n this.addMeta({ meta: meta }); //TODO: this.constructor.addMeta?\n this.meta.id = noodle.ids.firstFree()\n\n this.in = { ports: core.inPorts || [] };\n this.out = { ports: core.outPorts || [] };\n this.label = core.name;\n this.parNode = this;\n this.startPos = new Pos();\n\n var ports = this.ports.all;\n for (var i in ports) {\n var port = ports[i];\n port.meta.parNode = this;\n }\n\n }", "title": "" }, { "docid": "a8fc997366e4c27f8c6574263ee3a916", "score": "0.6335892", "text": "function Node(name, id, parentArr) {\n\tthis.name = name;\n\tthis.id = id;\n\tthis.parentArr = parentArr; // this reference is needed to remove node from tree\n\tthis.children = [];\n}", "title": "" }, { "docid": "6b23df7e34fa86e99efdcb1605e6e6e8", "score": "0.63269943", "text": "function Node(data) {\n this.data = data;\n this.parent = null;\n this.children = [];\n}", "title": "" }, { "docid": "5e8883402b858fc4798bea4841892f17", "score": "0.6326247", "text": "constructor(num_nodes) {\n this.num_nodes = num_nodes;\n this.values = this.generate_values();\n\n this.nodes = Array(0);\n this.edges = Array(0);\n\n this.create_nodes(0, this.values.length - 1);\n this.create_edges();\n\n this.root_id = this.values[Math.floor((this.values.length - 1) / 2)]\n this.num_nodes = null; //garbage collection\n this.values = null; //garbage collection\n }", "title": "" }, { "docid": "f661b3950c500444afa2c53423b0a7e6", "score": "0.63221395", "text": "function createNode(value,prev,next)\n{\n this.value = value;\n this.prev = prev;\n this.next = next;\n\n}", "title": "" }, { "docid": "378562cb05138abf254e2282c831cb4d", "score": "0.63192457", "text": "function Node(cost) {\n this.cost = cost;\n this.children = [];\n }", "title": "" }, { "docid": "709a78528cdb67f1aebea9e53858b987", "score": "0.63186634", "text": "function Node(val,children) {\n this.val = val;\n this.children = children;\n}", "title": "" }, { "docid": "fd35c51e943dfbff474f62306b4531d1", "score": "0.6313931", "text": "constructor(parent) {\n super(parent);\n this.type = NodeType.Dummy;\n }", "title": "" }, { "docid": "fd35c51e943dfbff474f62306b4531d1", "score": "0.6313931", "text": "constructor(parent) {\n super(parent);\n this.type = NodeType.Dummy;\n }", "title": "" }, { "docid": "fd35c51e943dfbff474f62306b4531d1", "score": "0.6313931", "text": "constructor(parent) {\n super(parent);\n this.type = NodeType.Dummy;\n }", "title": "" }, { "docid": "fd35c51e943dfbff474f62306b4531d1", "score": "0.6313931", "text": "constructor(parent) {\n super(parent);\n this.type = NodeType.Dummy;\n }", "title": "" }, { "docid": "cb6baa1ad038929fee973dcae2fa549c", "score": "0.63133717", "text": "function createNode(kind, pos) {\n\t nodeCount++;\n\t if (!(pos >= 0)) {\n\t pos = scanner.getStartPos();\n\t }\n\t return new NodeConstructor(kind, pos, pos);\n\t }", "title": "" }, { "docid": "d93b8220cba9199c83d79eebdd4500a4", "score": "0.6309189", "text": "function constructTree() {\n const head = new TreeNode(10);\n\n const node21 = new TreeNode(8);\n const node22 = new TreeNode(12);\n\n const node31 = new TreeNode(7);\n const node32 = new TreeNode(9);\n const node33 = new TreeNode(11);\n const node34 = new TreeNode(13);\n\n head.left = node21;\n head.right = node22;\n\n node21.left = node31;\n node21.right = node32;\n node22.left = node33;\n node22.right = node34;\n\n return head;\n}", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.6307385", "text": "function NodeDef() { }", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.6307385", "text": "function NodeDef() { }", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.6307385", "text": "function NodeDef() { }", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.6307385", "text": "function NodeDef() { }", "title": "" }, { "docid": "eda04a1ad030f4105dbf6d6b52b88af8", "score": "0.62917536", "text": "function createnode(x, y, w, h) {\n\t return {\n\t x: x,\n\t y: y,\n\t w: w,\n\t h: h,\n\t c: [],\n\t l: [],\n\t n: []\n\t };\n\t }", "title": "" }, { "docid": "07390c709a26d06ee9161a789b6aa9a9", "score": "0.6279848", "text": "function Ctor() {\n }", "title": "" }, { "docid": "07390c709a26d06ee9161a789b6aa9a9", "score": "0.6279848", "text": "function Ctor() {\n }", "title": "" }, { "docid": "073f8239c41b0ec2e92c1833b6f4aca6", "score": "0.627963", "text": "function ctor() {}", "title": "" }, { "docid": "30fdbcaf66ec2bd37551267e00e64b8f", "score": "0.62714463", "text": "function NodeObject(_name, energy){\n var _node = {};\n _node.name = _name;\n _node.neighbors = [];\n _node.heat = 0;\n _node.energy = energy;\n return _node;\n}", "title": "" }, { "docid": "44c362d1c1dfd8f51b311fc16c931214", "score": "0.6262128", "text": "function Node(opts){this.after=opts.after;this.before=opts.before;this.type=opts.type;this.value=opts.value;this.sourceIndex=opts.sourceIndex;}", "title": "" } ]